Main Page   Namespace List   Class Hierarchy   Compound List   File List   Compound Members   File Members  

ParticleSystem Class Reference

#include <particle.h>

Inheritance diagram for ParticleSystem:

Bouncy Roman Spark List of all members.

Public Methods

 ParticleSystem ()
 ~ParticleSystem ()
int Compare (const ParticleSystem &ParticleSys)
int GetMyPosition () const
void SetMyPosition (int newPosition)
int GetNumAlive ()
void SetupParticles ()
PARTICLEAdd ()
void Remove ()
virtual void SetDefaults (PARTICLE *Particle)
virtual void SetShape (PARTICLE *Particle)
virtual void Update ()
virtual void Render (int nodeid)

Public Attributes

int linkPosition
LinkedList< PARTICLEParticleList
SystemInfo SysInfo

Constructor & Destructor Documentation

ParticleSystem::ParticleSystem   [inline]
 

Definition at line 64 of file particle.h.

00064 {};

ParticleSystem::~ParticleSystem   [inline]
 

Definition at line 65 of file particle.h.

00065 {};


Member Function Documentation

PARTICLE * ParticleSystem::Add  
 

Definition at line 91 of file particle.cpp.

References LinkedList< PARTICLE >::Insert(), PARTICLE::linkPosition, SystemInfo::numParticles, ParticleList, SetDefaults(), SetShape(), and SysInfo.

00092 {
00093     PARTICLE* newParticle = new PARTICLE;
00094     SetDefaults(newParticle);
00095     SetShape(newParticle);
00096     newParticle->linkPosition = ++SysInfo.numParticles;
00097     ParticleList.Insert(newParticle);
00098     return newParticle;
00099 }

int ParticleSystem::Compare const ParticleSystem &    ParticleSys
 

Definition at line 101 of file particle.cpp.

References bigger, linkPosition, same, and smaller.

00102 {
00103   if (linkPosition < ParticleSys.linkPosition)
00104     return smaller;
00105   if (linkPosition > ParticleSys.linkPosition)
00106     return bigger;
00107   else
00108     return same;
00109 }

int ParticleSystem::GetMyPosition   const [inline]
 

Definition at line 68 of file particle.h.

References linkPosition.

00068 {return linkPosition;}

int ParticleSystem::GetNumAlive  
 

Definition at line 56 of file particle.cpp.

References ParticleInfo::Alive, LinkedList< PARTICLE >::Get(), SystemInfo::numParticles, ParticleList, PARTICLE::PartInfo, and SysInfo.

Referenced by ParticleManager::Update().

00057 {
00058     int numParticles = 0;
00059     PARTICLE* tempParticle;
00060     for (int loop = 1; loop <= SysInfo.numParticles; loop++)
00061     {
00062         tempParticle = ParticleList.Get(loop);
00063         if (tempParticle->PartInfo.Alive)
00064             numParticles++;
00065     }
00066     return numParticles;
00067 }

void ParticleSystem::Remove  
 

Definition at line 82 of file particle.cpp.

References LinkedList< PARTICLE >::Delete(), SystemInfo::numParticles, ParticleList, and SysInfo.

00083 {
00084     if (SysInfo.numParticles > 0)
00085     {
00086         ParticleList.Delete(1);
00087         --SysInfo.numParticles;
00088     }
00089 }

void ParticleSystem::Render int    nodeid [virtual]
 

Reimplemented in Spark, Roman, and Bouncy.

Definition at line 36 of file particle.cpp.

Referenced by ParticleManager::Render().

00037 {
00038    // Add a default method
00039 }

void ParticleSystem::SetDefaults PARTICLE   Particle [virtual]
 

Reimplemented in Spark, Roman, and Bouncy.

Definition at line 46 of file particle.cpp.

Referenced by Add(), and SetupParticles().

00047 {
00048    // Add a default method
00049 }

void ParticleSystem::SetMyPosition int    newPosition [inline]
 

Definition at line 69 of file particle.h.

References linkPosition.

00069 {linkPosition = newPosition;}

void ParticleSystem::SetShape PARTICLE   Particle [virtual]
 

Reimplemented in Spark, Roman, and Bouncy.

Definition at line 51 of file particle.cpp.

Referenced by Add(), and SetupParticles().

00052 {
00053    // Add a default method
00054 }

void ParticleSystem::SetupParticles  
 

Definition at line 70 of file particle.cpp.

References LinkedList< PARTICLE >::Insert(), PARTICLE::linkPosition, SystemInfo::numParticles, ParticleList, SetDefaults(), SetShape(), and SysInfo.

Referenced by ParticleManager::Add().

00071 {
00072     for (int loop = 1; loop <= SysInfo.numParticles; loop++)
00073     {
00074         PARTICLE* newParticle = new PARTICLE;
00075         SetDefaults(newParticle);
00076         SetShape(newParticle);
00077         newParticle->linkPosition = loop;
00078         ParticleList.Insert(newParticle);
00079     }
00080 }

void ParticleSystem::Update   [virtual]
 

Reimplemented in Spark, Roman, and Bouncy.

Definition at line 41 of file particle.cpp.

Referenced by ParticleManager::Update().

00042 {
00043    // Add a default method
00044 }


Member Data Documentation

int ParticleSystem::linkPosition
 

Definition at line 70 of file particle.h.

Referenced by ParticleManager::Add(), Compare(), GetMyPosition(), ParticleManager::Remove(), ParticleManager::RemoveType(), SetMyPosition(), and ParticleManager::Update().

LinkedList<PARTICLE> ParticleSystem::ParticleList
 

Definition at line 72 of file particle.h.

Referenced by Add(), GetNumAlive(), Remove(), Bouncy::Render(), Roman::Render(), Spark::Render(), SetupParticles(), Bouncy::Update(), Roman::Update(), Spark::Update(), and ParticleManager::Update().

SystemInfo ParticleSystem::SysInfo
 

Definition at line 73 of file particle.h.

Referenced by Add(), CreateBouncy(), CreateRomanCandle(), CreateSparks(), GetNumAlive(), ParticleManager::Remove(), Remove(), ParticleManager::RemoveType(), Bouncy::Render(), Roman::Render(), Spark::Render(), ParticleManager::SetBlendMode(), Bouncy::SetDefaults(), Roman::SetDefaults(), Spark::SetDefaults(), ParticleManager::SetId(), ParticleManager::SetTextureId(), ParticleManager::SetType(), SetupParticles(), ParticleManager::SetVisibility(), ParticleManager::ToggleVisibility(), Bouncy::Update(), Roman::Update(), Spark::Update(), and ParticleManager::Update().


The documentation for this class was generated from the following files:
Generated on Fri Dec 23 05:15:52 2005 for Constructive Solid Geometry by doxygen1.2.15