ParticleSystem< MaxParticles, InitPolicy, UpdatePolicy, EmitPolicy, DrawPolicy, ParticleType > Class Template Reference

The base class for spawning and managing particles. More...

#include <Graphics/ParticleSystem.h>

List of all members.

Public Member Functions

 ParticleSystem ()
 Default constructor.
uint GetParticleCount () const
 Determines the total number of active particles in the system.
uint GetMaxNumberParticles () const
void Emit (const Point2f &pos, uint amt)
 Emits the requested number of particles at the given position.
void Update (float dt)
 Updates the particle system.
void Draw ()
 Draws all of the currently active particles.
void Clear ()
 Removes all particles from the system.

Public Attributes

InitPolicy initPolicy
UpdatePolicy updatePolicy
EmitPolicy emitPolicy
DrawPolicy drawPolicy

Detailed Description

template<uint MaxParticles, class InitPolicy, class UpdatePolicy, class EmitPolicy = DefaultEmitPolicy<>, class DrawPolicy = DefaultParticleDrawPolicy, class ParticleType = Particle>
class ParticleSystem< MaxParticles, InitPolicy, UpdatePolicy, EmitPolicy, DrawPolicy, ParticleType >

The base class for spawning and managing particles.

Template Parameters:
MaxParticles the maximum number of particles that can be active in the particle system.
InitPolicy the Policy used to initialize new particles.
UpdatePolicy the Policy used on each active particle during an update.
EmitPolicy the policy used for emitting particles on each update, expected to have the same methods as the DefaultEmitPolicy class.
DrawPolicy the policy used for drawing the particles, expected to have the same methods as the DefaultParticleDrawPolicy class.
ParticleType the type of particle to use in the particle system. The ParticleType is expected to inheret from the Particle class (or at least have duplicate members).

Member Function Documentation

template<uint MaxParticles, class InitPolicy, class UpdatePolicy, class EmitPolicy = DefaultEmitPolicy<>, class DrawPolicy = DefaultParticleDrawPolicy, class ParticleType = Particle>
void ParticleSystem< MaxParticles, InitPolicy, UpdatePolicy, EmitPolicy, DrawPolicy, ParticleType >::Emit ( const Point2f pos,
uint  amt 
) [inline]

Emits the requested number of particles at the given position.

Parameters:
[in] pos the position to emit the particles.
[in] amt the number of particles to emit. NOTE: The particle system will only emit particles if the number of active particles is less then MaxParticles.
template<uint MaxParticles, class InitPolicy, class UpdatePolicy, class EmitPolicy = DefaultEmitPolicy<>, class DrawPolicy = DefaultParticleDrawPolicy, class ParticleType = Particle>
uint ParticleSystem< MaxParticles, InitPolicy, UpdatePolicy, EmitPolicy, DrawPolicy, ParticleType >::GetMaxNumberParticles (  )  const [inline]
Returns:
The maximum number of active particles the system can handle.
template<uint MaxParticles, class InitPolicy, class UpdatePolicy, class EmitPolicy = DefaultEmitPolicy<>, class DrawPolicy = DefaultParticleDrawPolicy, class ParticleType = Particle>
uint ParticleSystem< MaxParticles, InitPolicy, UpdatePolicy, EmitPolicy, DrawPolicy, ParticleType >::GetParticleCount (  )  const [inline]

Determines the total number of active particles in the system.

Returns:
The number of active particles.
template<uint MaxParticles, class InitPolicy, class UpdatePolicy, class EmitPolicy = DefaultEmitPolicy<>, class DrawPolicy = DefaultParticleDrawPolicy, class ParticleType = Particle>
void ParticleSystem< MaxParticles, InitPolicy, UpdatePolicy, EmitPolicy, DrawPolicy, ParticleType >::Update ( float  dt  )  [inline]

Updates the particle system.

Parameters:
[in] dt the time in seconds since the last frame.

Member Data Documentation

template<uint MaxParticles, class InitPolicy, class UpdatePolicy, class EmitPolicy = DefaultEmitPolicy<>, class DrawPolicy = DefaultParticleDrawPolicy, class ParticleType = Particle>
DrawPolicy ParticleSystem< MaxParticles, InitPolicy, UpdatePolicy, EmitPolicy, DrawPolicy, ParticleType >::drawPolicy

The draw policy

template<uint MaxParticles, class InitPolicy, class UpdatePolicy, class EmitPolicy = DefaultEmitPolicy<>, class DrawPolicy = DefaultParticleDrawPolicy, class ParticleType = Particle>
EmitPolicy ParticleSystem< MaxParticles, InitPolicy, UpdatePolicy, EmitPolicy, DrawPolicy, ParticleType >::emitPolicy

The emit policy

template<uint MaxParticles, class InitPolicy, class UpdatePolicy, class EmitPolicy = DefaultEmitPolicy<>, class DrawPolicy = DefaultParticleDrawPolicy, class ParticleType = Particle>
InitPolicy ParticleSystem< MaxParticles, InitPolicy, UpdatePolicy, EmitPolicy, DrawPolicy, ParticleType >::initPolicy

The initialization policy

template<uint MaxParticles, class InitPolicy, class UpdatePolicy, class EmitPolicy = DefaultEmitPolicy<>, class DrawPolicy = DefaultParticleDrawPolicy, class ParticleType = Particle>
UpdatePolicy ParticleSystem< MaxParticles, InitPolicy, UpdatePolicy, EmitPolicy, DrawPolicy, ParticleType >::updatePolicy

The update policy


The documentation for this class was generated from the following file:
Generated on Mon Apr 5 19:08:06 2010 for BrickOut |ReDuX| by  doxygen 1.6.3