#include <OgreParticleSystemManager.h>
Inheritance diagram for Ogre::ParticleSystemManager:
Public Types | |
typedef MapIterator< ParticleTemplateMap > | ParticleSystemTemplateIterator |
Public Methods | |
ParticleSystemManager () | |
virtual | ~ParticleSystemManager () |
void | addEmitterFactory (ParticleEmitterFactory *factory) |
Adds a new 'factory' object for emitters to the list of available emitter types. | |
void | addAffectorFactory (ParticleAffectorFactory *factory) |
Adds a new 'factory' object for affectors to the list of available affector types. | |
void | addTemplate (const String &name, const ParticleSystem &sysTemplate) |
Adds a new particle system template to the list of available templates. | |
ParticleSystem * | createTemplate (const String &name) |
Create a new particle system template. | |
ParticleSystem * | getTemplate (const String &name) |
Retrieves a particle system template for possible modification. | |
ParticleSystem * | createSystem (const String &name, unsigned int quota=500) |
Basic method for creating a blank particle system. | |
ParticleSystem * | createSystem (const String &name, const String &templateName) |
Creates a particle system based on a template. | |
void | destroySystem (const String &name) |
Destroys a particle system, freeing it's memory and removing references to it in this class. | |
void | destroySystem (ParticleSystem *sys) |
Destroys a particle system, freeing it's memory and removing references to it in this class. | |
ParticleSystem * | getSystem (const String &name) |
Retrieves a pointer to a system already created. | |
ParticleEmitter * | _createEmitter (const String &emitterType) |
Internal method for creating a new emitter from a factory. | |
void | _destroyEmitter (ParticleEmitter *emitter) |
Internal method for destroying an emitter. | |
ParticleAffector * | _createAffector (const String &affectorType) |
Internal method for creating a new affector from a factory. | |
void | _destroyAffector (ParticleAffector *affector) |
Internal method for destroying an affector. | |
bool | frameStarted (const FrameEvent &evt) |
Frame event. | |
bool | frameEnded (const FrameEvent &evt) |
Frame event. | |
void | _initialise (void) |
Init method to be called by OGRE system. | |
void | parseScript (DataChunk &chunk) |
Parses a particle system script file passed as a chunk. | |
void | parseAllSources (const String &extension=".particle") |
Parses all particle system script files in resource folders & archives. | |
Real | getTimeFactor (void) const |
Return relative speed of time as perceived by particle systems. | |
void | setTimeFactor (Real tf) |
Set the relative speed of time as perceived by particle systems. | |
ParticleSystemTemplateIterator | getTemplateIterator (void) |
Gets an iterator over the list of particle system templates. | |
Static Public Methods | |
ParticleSystemManager & | getSingleton (void) |
Override standard Singleton retrieval. | |
ParticleSystemManager * | getSingletonPtr (void) |
Override standard Singleton retrieval. | |
Protected Types | |
typedef std::map< String, ParticleSystem > | ParticleTemplateMap |
typedef std::map< String, ParticleSystem * > | ParticleSystemMap |
typedef std::map< String, ParticleEmitterFactory * > | ParticleEmitterFactoryMap |
typedef std::map< String, ParticleAffectorFactory * > | ParticleAffectorFactoryMap |
Protected Methods | |
void | parseNewEmitter (const String &type, DataChunk &chunk, ParticleSystem *sys) |
Internal script parsing method. | |
void | parseNewAffector (const String &type, DataChunk &chunk, ParticleSystem *sys) |
Internal script parsing method. | |
void | parseAttrib (const String &line, ParticleSystem *sys) |
Internal script parsing method. | |
void | parseEmitterAttrib (const String &line, ParticleEmitter *sys) |
Internal script parsing method. | |
void | parseAffectorAttrib (const String &line, ParticleAffector *sys) |
Internal script parsing method. | |
void | skipToNextCloseBrace (DataChunk &chunk) |
Internal script parsing method. | |
void | skipToNextOpenBrace (DataChunk &chunk) |
Internal script parsing method. | |
Protected Attributes | |
ParticleTemplateMap | mSystemTemplates |
Templates based on scripts. | |
ParticleSystemMap | mSystems |
Actual instantiated particle systems (may be based on template, may be manual). | |
ParticleEmitterFactoryMap | mEmitterFactories |
Factories for named emitter types (can be extended using plugins). | |
ParticleAffectorFactoryMap | mAffectorFactories |
Factories for named affector types (can be extended using plugins). | |
Real | mTimeFactor |
Controls time. | |
Static Protected Attributes | |
ParticleSystemManager * | ms_Singleton = 0 |
This class also manages factories for ParticleEmitter and ParticleAffector classes. To enable easy extensions to the types of emitters (particle sources) and affectors (particle modifiers), the ParticleSystemManager lets plugins or applications register factory classes which submit new subclasses to ParticleEmitter and ParticleAffector. Ogre comes with a number of them already provided, such as cone, sphere and box-shaped emitters, and simple affectors such as constant directional force and colour faders. However using this registration process, a plugin can create any behaviour required.
This class also manages the loading and parsing of particle system scripts, which are text files describing named particle system templates. Instances of particle systems using these templates can then be created easily through the createParticleSystem method.
Definition at line 55 of file OgreParticleSystemManager.h.
|
Definition at line 70 of file OgreParticleSystemManager.h. |
|
Definition at line 66 of file OgreParticleSystemManager.h. |
|
Definition at line 62 of file OgreParticleSystemManager.h. |
|
Definition at line 310 of file OgreParticleSystemManager.h. |
|
Definition at line 58 of file OgreParticleSystemManager.h. |
|
Definition at line 48 of file OgreParticleSystemManager.cpp. References mTimeFactor. |
|
Definition at line 53 of file OgreParticleSystemManager.cpp. References mSystems, and mSystemTemplates. |
|
Internal method for creating a new affector from a factory.
Definition at line 293 of file OgreParticleSystemManager.cpp. References Except, mAffectorFactories, and Ogre::String. |
|
Internal method for creating a new emitter from a factory.
Definition at line 265 of file OgreParticleSystemManager.cpp. References Except, mEmitterFactories, and Ogre::String. |
|
Internal method for destroying an affector.
Definition at line 308 of file OgreParticleSystemManager.cpp. References Except, Ogre::ParticleAffector::getType(), and mAffectorFactories. |
|
Internal method for destroying an emitter.
Definition at line 279 of file OgreParticleSystemManager.cpp. References Except, Ogre::ParticleEmitter::getType(), and mEmitterFactories. |
|
Init method to be called by OGRE system.
Definition at line 343 of file OgreParticleSystemManager.cpp. References parseAllSources(). Referenced by Ogre::Root::oneTimePostWindowInit(). |
|
Adds a new 'factory' object for affectors to the list of available affector types.
Definition at line 169 of file OgreParticleSystemManager.cpp. References Ogre::ParticleAffectorFactory::getName(), mAffectorFactories, and Ogre::String. |
|
Adds a new 'factory' object for emitters to the list of available emitter types.
Definition at line 162 of file OgreParticleSystemManager.cpp. References Ogre::ParticleEmitterFactory::getName(), mEmitterFactories, and Ogre::String. |
|
Adds a new particle system template to the list of available templates.
Definition at line 176 of file OgreParticleSystemManager.cpp. References mSystemTemplates, and Ogre::String. Referenced by createTemplate(). |
|
Creates a particle system based on a template.
Definition at line 209 of file OgreParticleSystemManager.cpp. References createSystem(), Except, Ogre::ParticleSystem::getParticleQuota(), getTemplate(), and Ogre::String. |
|
Basic method for creating a blank particle system.
Definition at line 201 of file OgreParticleSystemManager.cpp. References mSystems, Ogre::ParticleSystem::setParticleQuota(), and Ogre::String. Referenced by createSystem(). |
|
Create a new particle system template.
Definition at line 181 of file OgreParticleSystemManager.cpp. References addTemplate(), getTemplate(), and Ogre::String. Referenced by parseScript(). |
|
Destroys a particle system, freeing it's memory and removing references to it in this class.
Definition at line 235 of file OgreParticleSystemManager.cpp. References mSystems. |
|
Destroys a particle system, freeing it's memory and removing references to it in this class.
Definition at line 225 of file OgreParticleSystemManager.cpp. References mSystems, and Ogre::String. |
|
Frame event.
Reimplemented from Ogre::FrameListener. Definition at line 338 of file OgreParticleSystemManager.cpp. |
|
Frame event.
Reimplemented from Ogre::FrameListener. Definition at line 322 of file OgreParticleSystemManager.cpp. References mSystems, mTimeFactor, Ogre::Real, and Ogre::FrameEvent::timeSinceLastFrame. |
|
Override standard Singleton retrieval.
Reimplemented from Ogre::Singleton< ParticleSystemManager >. Definition at line 43 of file OgreParticleSystemManager.cpp. References Ogre::Singleton< ParticleSystemManager >::ms_Singleton. |
|
Override standard Singleton retrieval.
Reimplemented from Ogre::Singleton< ParticleSystemManager >. Definition at line 39 of file OgreParticleSystemManager.cpp. References Ogre::Singleton< ParticleSystemManager >::ms_Singleton. |
|
Retrieves a pointer to a system already created.
Definition at line 250 of file OgreParticleSystemManager.cpp. References Except, mSystems, and Ogre::String. |
|
Retrieves a particle system template for possible modification.
Definition at line 188 of file OgreParticleSystemManager.cpp. References mSystemTemplates, and Ogre::String. Referenced by createSystem(), and createTemplate(). |
|
Gets an iterator over the list of particle system templates.
Definition at line 312 of file OgreParticleSystemManager.h. |
|
Return relative speed of time as perceived by particle systems.
Definition at line 479 of file OgreParticleSystemManager.cpp. References mTimeFactor, and Ogre::Real. |
|
Internal script parsing method.
Definition at line 443 of file OgreParticleSystemManager.cpp. References Ogre::ParticleAffector::getType(), Ogre::StringInterface::setParameter(), and Ogre::String. Referenced by parseNewAffector(). |
|
Parses all particle system script files in resource folders & archives.
Definition at line 145 of file OgreParticleSystemManager.cpp. References parseScript(), and Ogre::String. Referenced by _initialise(). |
|
Internal script parsing method.
Definition at line 411 of file OgreParticleSystemManager.cpp. References Ogre::BillboardSet::getName(), Ogre::StringInterface::setParameter(), and Ogre::String. Referenced by parseScript(). |
|
Internal script parsing method.
Definition at line 427 of file OgreParticleSystemManager.cpp. References Ogre::ParticleEmitter::getType(), Ogre::StringInterface::setParameter(), and Ogre::String. Referenced by parseNewEmitter(). |
|
Internal script parsing method.
Definition at line 383 of file OgreParticleSystemManager.cpp. References Ogre::ParticleSystem::addAffector(), Ogre::DataChunk::getLine(), Ogre::DataChunk::isEOF(), parseAffectorAttrib(), and Ogre::String. Referenced by parseScript(). |
|
Internal script parsing method.
Definition at line 352 of file OgreParticleSystemManager.cpp. References Ogre::ParticleSystem::addEmitter(), Ogre::DataChunk::getLine(), Ogre::DataChunk::isEOF(), parseEmitterAttrib(), and Ogre::String. Referenced by parseScript(). |
|
Parses a particle system script file passed as a chunk.
Definition at line 66 of file OgreParticleSystemManager.cpp. References createTemplate(), Ogre::DataChunk::getLine(), Ogre::BillboardSet::getName(), Ogre::DataChunk::isEOF(), parseAttrib(), parseNewAffector(), parseNewEmitter(), skipToNextCloseBrace(), skipToNextOpenBrace(), and Ogre::String. Referenced by parseAllSources(). |
|
Set the relative speed of time as perceived by particle systems.
Definition at line 483 of file OgreParticleSystemManager.cpp. References mTimeFactor, and Ogre::Real. |
|
Internal script parsing method.
Definition at line 459 of file OgreParticleSystemManager.cpp. References Ogre::DataChunk::getLine(), Ogre::DataChunk::isEOF(), and Ogre::String. Referenced by parseScript(). |
|
Internal script parsing method.
Definition at line 469 of file OgreParticleSystemManager.cpp. References Ogre::DataChunk::getLine(), Ogre::DataChunk::isEOF(), and Ogre::String. Referenced by parseScript(). |
|
Factories for named affector types (can be extended using plugins).
Definition at line 72 of file OgreParticleSystemManager.h. Referenced by _createAffector(), _destroyAffector(), and addAffectorFactory(). |
|
Factories for named emitter types (can be extended using plugins).
Definition at line 68 of file OgreParticleSystemManager.h. Referenced by _createEmitter(), _destroyEmitter(), and addEmitterFactory(). |
|
Definition at line 38 of file OgreParticleSystemManager.cpp. Referenced by getSingleton(), and getSingletonPtr(). |
|
Actual instantiated particle systems (may be based on template, may be manual).
Definition at line 64 of file OgreParticleSystemManager.h. Referenced by createSystem(), destroySystem(), frameStarted(), getSystem(), and ~ParticleSystemManager(). |
|
Templates based on scripts.
Definition at line 60 of file OgreParticleSystemManager.h. Referenced by addTemplate(), getTemplate(), and ~ParticleSystemManager(). |
|
Controls time.
Definition at line 75 of file OgreParticleSystemManager.h. Referenced by frameStarted(), getTimeFactor(), ParticleSystemManager(), and setTimeFactor(). |
Copyright © 2002-2003 by The OGRE Team
Last modified Sun Nov 28 19:51:24 2004