00001
00006 #include "Particle.h"
00007
00008 using namespace ParticleSystems;
00009 using namespace GraphicsLib;
00010
00011 Particle::Particle( int sysId,
00012 GraphicsLib::Point3 pos,
00013 GraphicsLib::Vector vel,
00014 GraphicsLib::Colour c,
00015 GLfloat trans,
00016 float b,
00017 float ma,
00018 float mo,
00019 float e,
00020 float s
00021 ) {
00022 SYSID = sysId;
00023 position = pos;
00024 velocity = vel;
00025 colour = c;
00026 transparency = trans;
00027 bounce = b;
00028 mass = ma;
00029 momentum = mo;
00030 energy = e;
00031 size = s;
00032 dead = false;
00033 }
00034
00035 Particle::Particle( int sysId,
00036 Solver *sol,
00037 GraphicsLib::Point3 pos,
00038 GraphicsLib::Vector vel,
00039 GraphicsLib::Colour c,
00040 GraphicsLib::Colour fc,
00041 GLfloat s,
00042 GLfloat fs,
00043 GLfloat maxLife
00044 ) {
00045 SYSID = sysId;
00046 position = pos;
00047 old_Position = position;
00048 velocity = vel;
00049 solv = sol;
00050 colour = c;
00051 faded_colour = fc;
00052 size = s;
00053 flare_size = fs;
00054 MAXLIFE = maxLife;
00055 dead = false;
00056 bounce = 2.0f;
00057
00058 }
00059
00060
00061 Particle::Particle(int sysId, Solver *sol) {
00062 size = 0.05;
00063 SYSID = sysId;
00064 solv = sol;
00065 position = new Point3( RandomNum(1.0f),RandomNum(1.0f),RandomNum(1.0f));
00066 old_Position = position;
00067 velocity.set(0.1f,0.1f,0.0f);
00068 colour.set(0.5,0.5,0.5);
00069 MAXLIFE = RandomPosNum(30);
00070 dead = false;
00071 }
00072
00073 Particle::~Particle() {
00074 }