TileStorm Class Reference

#include <TileStorm.h>

Collaboration diagram for TileStorm:

Collaboration graph
[legend]
List of all members.

Detailed Description

This class represents a 2D effect particle-tile effect for rendering explosions with texture mapped shrapnel, etc. The class is essentially a pointer to an array of particles defined as C structures, with additional house-keeping routines and a 'Draw' function to allow objects to draw themselves. This particle system does not take in to account collisions with other particle- system's particles, or with rigid bodies. It can be thought of as a 2D special effect overlay.

Definition at line 37 of file TileStorm.h.

Public Member Functions

 TileStorm (void)
 default constructor
 TileStorm (Vector vPos, Vector vFce, float fSAngle, float fFric, float fRand, int iParticles, int tex)
 general constructor
 ~TileStorm (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

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
ParticlepParticles
 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
int iTexture
 which texture to use when rendering the tiles


Constructor & Destructor Documentation

TileStorm::TileStorm ( void   ) 

Initialize the effect with default values. The default number of tile-particles is one (1), and so using this constructor is generally not very useful.

Definition at line 29 of file TileStorm.cpp.

References Particle::bAlive, Particle::fAngle, fDecayRate, Particle::fEnergy, fFriction, Particle::fPosY, fRandomness, Particle::fRotVel, Particle::fSize, fSpreadAngle, Particle::fVelX, Particle::fVelY, iNumParticles, iTexture, PI, pParticles, TEXID_NULL, vForce, vPosition, Vector::x, Vector::y, and Vector::z.

TileStorm::TileStorm ( Vector  vPos,
Vector  vFce,
float  fSAngle,
float  fFric,
float  fRand,
int  iParticles,
int  tex 
)

Initialize the effect with specific initial values. Note that the class member (int) iNumParticles will be clamped to a maximum value of MAX_PARTICLES.

Definition at line 69 of file TileStorm.cpp.

References Particle::bAlive, Particle::fAngle, Particle::fDecayRate, fDecayRate, Particle::fEnergy, fFriction, Particle::fPosX, Particle::fPosY, fRandomness, Particle::fRotVel, Particle::fSize, fSpreadAngle, Particle::fVelX, Particle::fVelY, iNumParticles, iTexture, MAX_PARTICLES, pParticles, vForce, vPosition, VRotate2D(), Vector::x, and Vector::y.

Here is the call graph for this function:

TileStorm::~TileStorm ( void   ) 

This function is the default destructor, which frees the memory allocated to holding the particle structure data.

Definition at line 117 of file TileStorm.cpp.

References pParticles.


Member Function Documentation

void TileStorm::Draw ( void   ) 

Definition at line 165 of file TileStorm.cpp.

References GetTexture(), iNumParticles, iTexture, and pParticles.

Referenced by CEffect::Draw().

Here is the call graph for this function:

Here is the caller graph for this function:

bool TileStorm::Step ( float  timeStep  ) 

Step the effect forward in time by a specified amount. This will update the effect's particles' position, orientation, etc. and prepare the effect 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 128 of file TileStorm.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:


Member Data Documentation

Vector TileStorm::vPosition

Definition at line 40 of file TileStorm.h.

Referenced by TileStorm().

Vector TileStorm::vForce

Definition at line 41 of file TileStorm.h.

Referenced by TileStorm().

float TileStorm::fSpreadAngle

Definition at line 42 of file TileStorm.h.

Referenced by TileStorm().

float TileStorm::fFriction

Definition at line 43 of file TileStorm.h.

Referenced by Step(), and TileStorm().

int TileStorm::iNumParticles

Definition at line 44 of file TileStorm.h.

Referenced by Draw(), Step(), and TileStorm().

Particle* TileStorm::pParticles

Definition at line 45 of file TileStorm.h.

Referenced by Draw(), Step(), TileStorm(), and ~TileStorm().

float TileStorm::fRandomness

Definition at line 46 of file TileStorm.h.

Referenced by TileStorm().

float TileStorm::fDecayRate

Definition at line 47 of file TileStorm.h.

Referenced by Step(), and TileStorm().

int TileStorm::iTexture

Definition at line 49 of file TileStorm.h.

Referenced by Draw(), and TileStorm().

 

Copyright Windsor Schmidt 2006 - All rights reserved.