Gel2D - The free/open source game creation suite

Public Member Functions | Public Attributes
gel::GelParticleSys Class Reference

Particle simulation / rendering. More...

#include <gelParticle.h>

Inheritance diagram for gel::GelParticleSys:
gel::GelObject gel::GelTextureObject gel::GelEventReceiver

List of all members.

Public Member Functions

 GelParticleSys ()
 Default constructor.
 GelParticleSys (const char *desc_name)
 Convenience constructor.
 ~GelParticleSys ()
 Destructor.
Gel2dVec getLoc () const
 Gets the location of particle emission.
void setLoc (Gel2dVec loc)
 Sets the location of particle emission.
void fire ()
 Fires the particle system.
void setTexture (GelTexture *tex)
 Sets the particle system's texture.
void mapRect (const Gel2dVec &pos, const Gel2dVec &size)
int writeDesc (const char *filename)
 Writes a particle system description file to disk.
int readDesc (const char *filename)
 Reads a particle system description file from disk.
void update ()
 Updates the particle system simulation.
void render ()
 Renders the particle system to the screen.

Public Attributes

int emissionRate
bool infiniteSysLife
float sysLife
Gel2dVec originDis
float direction
float spread
float minLife
float maxLife
float minSpeed
float maxSpeed
float minGravity
float maxGravity
float minRadialAccel
float maxRadialAccel
float minTangetAccel
float maxTangetAccel
float startSize
float endSize
float randSize
float parRot
float randRot
float startAlpha
float endAlpha
float randAlpha
GelColor minStartCol
GelColor maxStartCol
GelColor minEndCol
GelColor maxEndCol
GelColor randCol
Gel2dVec uv [4]

Detailed Description

Particle simulation / rendering.


Constructor & Destructor Documentation

gel::GelParticleSys::GelParticleSys ( )

Default constructor.

gel::GelParticleSys::GelParticleSys ( const char *  desc_name)

Convenience constructor.

Reads a particle system description file from disk.

Parameters:
desc_name: The directory / name of a Gel2D Particle System description file.
gel::GelParticleSys::~GelParticleSys ( )

Destructor.


Member Function Documentation

Gel2dVec gel::GelParticleSys::getLoc ( ) const [inline]

Gets the location of particle emission.

Returns:
The location at which particles are emitted.
void gel::GelParticleSys::setLoc ( Gel2dVec  loc) [inline]

Sets the location of particle emission.

This is the location at which any subsequent particles will be emitted.
This is the way you will want to move particle systems, as opposed to using setPos(), which will translate the position of the entire system, existing particles and all. Not pretty.

Parameters:
loc: The particle emission location.
void gel::GelParticleSys::fire ( ) [inline]

Fires the particle system.

This function resets the system's age to zero.

void gel::GelParticleSys::setTexture ( GelTexture tex)

Sets the particle system's texture.

Parameters:
tex: The particle system's new texture.
void gel::GelParticleSys::mapRect ( const Gel2dVec pos,
const Gel2dVec size 
)
int gel::GelParticleSys::writeDesc ( const char *  filename)

Writes a particle system description file to disk.

Parameters:
filename: The directory / name of the description file.
int gel::GelParticleSys::readDesc ( const char *  filename)

Reads a particle system description file from disk.

Parameters:
filename: The directory / name of the description file.
Returns:
GEL_TRUE if the file is a valid Gel2D Particle System, else GEL_FALSE.
void gel::GelParticleSys::update ( )

Updates the particle system simulation.

This must be called somewhere in your game loop.

void gel::GelParticleSys::render ( ) [virtual]

Renders the particle system to the screen.

Reimplemented from gel::GelObject.


Member Data Documentation


The documentation for this class was generated from the following file: