#include <PSystem.h>
Collaboration diagram for PSystem:

Definition at line 60 of file PSystem.h.
Public Member Functions | |
| PSystem (void) | |
| default constructor | |
| PSystem (Vector vPos, Vector vFce, float fSAngle, float fFric, float fRand, int iParticles) | |
| general constructor | |
| ~PSystem (void) | |
| remove the particle system | |
| void | Draw (void) |
| draws the particle system in it's current state | |
| bool | Step (float timeStep) |
| advance the state of the particle system | |
| void | SetColor (float r, float g, float b) |
| set the color used to draw the particle system | |
Public Attributes | |
| Vector | vPosition |
| absolute position of the particle system's origin | |
| Vector | vForce |
| magnitude and direction of the system's particles (at initialization time) | |
| float | fSpreadAngle |
| velocities of particles deviate this much from the force vector's direction | |
| float | fFriction |
| rate at which particles are slowed by the effect of air friction | |
| int | iNumParticles |
| the number of particles in the system | |
| Particle * | pParticles |
| pointer to a list of particles contained in the system | |
| float | fRandomness |
| amount of randomness introduced to the particles' force vectors | |
| float | fDecayRate |
| rate at which particles lose energy | |
| float | fColorR |
| red color component intensity of the particle system | |
| float | fColorG |
| green color component intensity of the particle system | |
| float | fColorB |
| blue color component intensity of the particle system | |
| PSystem::PSystem | ( | void | ) |
Initialize the particle system with default values. The default number of Particles is one (1), and so using this constructor is generally not very useful.
Definition at line 29 of file PSystem.cpp.
References Particle::bAlive, Particle::fAngle, fColorB, fColorG, fColorR, fDecayRate, Particle::fEnergy, fFriction, Particle::fPosY, fRandomness, Particle::fRotVel, Particle::fSize, fSpreadAngle, Particle::fVelX, Particle::fVelY, iNumParticles, PI, pParticles, vForce, vPosition, Vector::x, Vector::y, and Vector::z.
| PSystem::PSystem | ( | Vector | vPos, | |
| Vector | vFce, | |||
| float | fSAngle, | |||
| float | fFric, | |||
| float | fRand, | |||
| int | iParticles | |||
| ) |
Initialize the particle system with specific initial values. Note that the class member (int) iNumParticles will be clamped to a maximum value of MAX_PARTICLES.
Definition at line 70 of file PSystem.cpp.
References Particle::bAlive, Particle::fAngle, fColorB, fColorG, fColorR, Particle::fDecayRate, fDecayRate, Particle::fEnergy, fFriction, Particle::fPosX, Particle::fPosY, fRandomness, Particle::fRotVel, Particle::fSize, fSpreadAngle, Particle::fVelX, Particle::fVelY, iNumParticles, MAX_PARTICLES, pParticles, vForce, vPosition, VRotate2D(), Vector::x, and Vector::y.
Here is the call graph for this function:

| PSystem::~PSystem | ( | void | ) |
This function is the default destructor, which frees the memory allocated to holding the particle structure data.
Definition at line 120 of file PSystem.cpp.
References pParticles.
| void PSystem::Draw | ( | void | ) |
This function draws the particle system to the screen. The particle geometry currently consists of simple triangles to simulate 'sparks' when drawn. This function will retrieve each particle's position, orientation, and energy (used for determining the transparency value) in order to render the particle. An overall particle system color is used to select the drawing color used for the triangle representing each particle.
Definition at line 174 of file PSystem.cpp.
References fColorB, fColorG, fColorR, iNumParticles, and pParticles.
Referenced by CEffect::Draw().
Here is the caller graph for this function:

| bool PSystem::Step | ( | float | timeStep | ) |
Step the particle system forward in time by a specified amount. This will update particles' position, orientation, etc. and prepare the particle system for being drawn to the screen. This function may change the boolean member bParticlesExpired to indicate when the energy of all particles in the system has reached zero.
Definition at line 131 of file PSystem.cpp.
References Particle::fAngle, fDecayRate, Particle::fEnergy, fFriction, Particle::fPosX, Particle::fPosY, Particle::fRotVel, Particle::fVelX, Particle::fVelY, iNumParticles, and pParticles.
Referenced by CEffect::Step().
Here is the caller graph for this function:

| void PSystem::SetColor | ( | float | r, | |
| float | g, | |||
| float | b | |||
| ) |
Set the color of the particle system, with individual intensity values for red, green, and blue color components.
Definition at line 205 of file PSystem.cpp.
References fColorB, fColorG, and fColorR.
Referenced by GameLogicFire(), ProcessTileCollisions(), and RemoveDeadObjects().
Here is the caller graph for this function:

| float PSystem::fSpreadAngle |
| float PSystem::fFriction |
| float PSystem::fRandomness |
| float PSystem::fDecayRate |
| float PSystem::fColorR |
| float PSystem::fColorG |
| float PSystem::fColorB |
Copyright Windsor Schmidt 2006 - All rights reserved.