Main Page | Namespace List | Class Hierarchy | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

ONE::fx::ParticleSystem Class Reference

List of all members.

Detailed Description

Manager class for TexturedEmitter s.

This class facilitates emitter management and particle rendering. The emitter class must extend the TexturedBase class. However, use of the TexturedEmitter template is recommended.
New emitters must be created through the ParticleSystem::createEmitter function in order to register them with this manager. The registered emitters are automatically sorted by their texture to minimize texture switches during rendering. Manual changes to the texture setting (via the setTexture function) will disturb the ordering. The ParticleSystem::sortEmitters function should then be called after all changes have been made. Rendering will still work otherwise, but efficiency may decrease.

Author:
Daniel Seibert


Public Member Functions

void clear ()
 removes and destroys all registered emitters
template<class EmtT>
EmtT * createEmitter (G3D::TextureRef)
 creates an emitter that uses the given texture
 ParticleSystem ()
void process (const float &)
 calls ParticleEmitter::process on all registered managers
void remove (Emitter *)
 removes an emitter from the particle system
void render (G3D::RenderDevice *)
 renders all registered emitters
void sortEmitters ()
 sorts the registered emitters
 ~ParticleSystem ()

Classes

struct  Comparator


Constructor & Destructor Documentation

ONE::fx::ParticleSystem::ParticleSystem  ) 
 

ONE::fx::ParticleSystem::~ParticleSystem  ) 
 


Member Function Documentation

void ONE::fx::ParticleSystem::clear  ) 
 

removes and destroys all registered emitters

template<class EmtT>
EmtT * ONE::fx::ParticleSystem::createEmitter G3D::TextureRef   ) 
 

creates an emitter that uses the given texture

The emitter is registered with this manager and will be destroyed at manager shutdown or when clear is called. It should not be deleted manually unless the emitter is first removed from the particle system via the ParticleSystem::remove function.
If the emitter's texture is changed later, the sortEmitters function should be called after all changes have been made to ensure efficient rendering.

Parameters:
EmtT the emitter type that will be created. EmtT must be convertible to TexturedBase.
Returns:
a pointer to the new emitter

void ONE::fx::ParticleSystem::process const float  ) 
 

calls ParticleEmitter::process on all registered managers

See that function for details.

void ONE::fx::ParticleSystem::remove Emitter  ) 
 

removes an emitter from the particle system

The emitter will no longer be processed or cleared by this manager. It must be deleted manually.

void ONE::fx::ParticleSystem::render G3D::RenderDevice *   ) 
 

renders all registered emitters

void ONE::fx::ParticleSystem::sortEmitters  ) 
 

sorts the registered emitters

The emitters are sorted to ensure efficient rendering with as few texture switches as possible. Calling this function is only necessary after emitter texture settings have been changed.


Generated on Wed Sep 7 19:03:14 2005 for ONEngine by  doxygen 1.4.3