ParticleSystem Class Reference

A simple particle system effect. More...

List of all members.

Classes

class  EmitterParams
 This class regroups all the parameters needed to initialize a particle. More...
interface  IParticleShader
 ParticleSystem's shader interface. More...
class  Particle
 Particle object returned by CreateParticle. More...
class  ParticleShaderDefault
 Default shader, texture modulated by a color. More...
class  SimulationParams
 SimulationParams regroups all the parameters needed by the Update and Draw to advance and render the particles. More...

Public Member Functions

 ParticleSystem (int max_particles)
 ParticleSystem constructor.
void Dispose ()
 Dispose implementation.
Particle CreateParticle (bool skip_auto_init=false)
 Particles get created automatically using Emit parameters, but if needed you can also create and init particles yourself.
void Update (float dt)
 The update function.
void Draw ()
 The draw function.

Static Public Member Functions

static void Terminate ()
 Dispose of static resources.

Public Attributes

TextureInfo TextureInfo
 The texture information for this particle system.
Vector4 Color = Colors.White
 A global multiplier color for the particle system.
BlendMode BlendMode = BlendMode.Normal
 The blend mode used by the particle system.
EmitterParams Emit
 Parameters used for controlling the emission and initial parameters of particles.
SimulationParams Simulation
 Parameters used for controlling the simulation.
Matrix3 RenderTransform = Matrix3.Identity
 The modelview matrix used for rendering the particle system.
IParticleShader Shader
 User can set an external shader.

Properties

int MaxParticles [get]
 The maximum number of particles the system can deal with.
int ParticlesCount [get]
 The current number of particles alive.
bool IsFull [get]
 Return true if the number of active particles has reached maximum capacity.
static ParticleShaderDefault DefaultShader [get]
 The particle system's default shader (texture * color).
bool Disposed [get]
 Return true if this object been disposed.

Detailed Description

A simple particle system effect.


Constructor & Destructor Documentation

ParticleSystem ( int  max_particles)

ParticleSystem constructor.

Parameters:
max_particlesThe maximum number of particles for this particle system.

Member Function Documentation

Particle CreateParticle ( bool  skip_auto_init = false)

Particles get created automatically using Emit parameters, but if needed you can also create and init particles yourself.

Parameters:
skip_auto_initIf false, the created particle gets initialized using the Emit parameters, just like the particles randomly created everyframe (this is in case you want to use a random variation as a starting point).
Returns:
A handle to the particle just created

Member Data Documentation

Matrix3 RenderTransform = Matrix3.Identity

The modelview matrix used for rendering the particle system.

RenderTransform overrides base class's Node.GetTransform() to render the local geometry.

User can set an external shader.

The Label class won't dispose of shaders set by user (other than ParticleSystem.DefaultShader).

The texture information for this particle system.

All particles use the same image.