#include <OgreParticleSystemManager.h>
Inheritance diagram for Ogre::ParticleSystemManager:
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. | |
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 54 of file OgreParticleSystemManager.h.
|
Definition at line 69 of file OgreParticleSystemManager.h. |
|
Definition at line 65 of file OgreParticleSystemManager.h. |
|
Definition at line 61 of file OgreParticleSystemManager.h. |
|
Definition at line 57 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, and mAffectorFactories. |
|
Internal method for creating a new emitter from a factory.
Definition at line 265 of file OgreParticleSystemManager.cpp. References Except, and mEmitterFactories. |
|
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(), and mAffectorFactories. |
|
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(), and mEmitterFactories. |
|
Adds a new particle system template to the list of available templates.
Definition at line 176 of file OgreParticleSystemManager.cpp. References mSystemTemplates. 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(), and getTemplate(). |
|
Basic method for creating a blank particle system.
Definition at line 201 of file OgreParticleSystemManager.cpp. References mSystems, and Ogre::ParticleSystem::setParticleQuota(). Referenced by createSystem(). |
|
Create a new particle system template.
Definition at line 181 of file OgreParticleSystemManager.cpp. References addTemplate(), and getTemplate(). 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. |
|
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. |
|
Retrieves a particle system template for possible modification.
Definition at line 188 of file OgreParticleSystemManager.cpp. References mSystemTemplates. Referenced by createSystem(), and createTemplate(). |
|
Return relative speed of time as perceived by particle systems.
Definition at line 477 of file OgreParticleSystemManager.cpp. References mTimeFactor, and Ogre::Real. |
|
Internal script parsing method.
Definition at line 441 of file OgreParticleSystemManager.cpp. References Ogre::ParticleAffector::getType(), Ogre::StringInterface::setParameter(), and Ogre::String::split(). Referenced by parseNewAffector(). |
|
Parses all particle system script files in resource folders & archives.
Definition at line 145 of file OgreParticleSystemManager.cpp. References parseScript(). Referenced by _initialise(). |
|
Internal script parsing method.
Definition at line 409 of file OgreParticleSystemManager.cpp. References Ogre::ParticleSystem::getName(), Ogre::StringInterface::setParameter(), and Ogre::String::split(). Referenced by parseScript(). |
|
Internal script parsing method.
Definition at line 425 of file OgreParticleSystemManager.cpp. References Ogre::ParticleEmitter::getType(), Ogre::StringInterface::setParameter(), and Ogre::String::split(). Referenced by parseNewEmitter(). |
|
Internal script parsing method.
Definition at line 382 of file OgreParticleSystemManager.cpp. References Ogre::ParticleSystem::addAffector(), Ogre::DataChunk::getLine(), Ogre::DataChunk::isEOF(), parseAffectorAttrib(), and Ogre::String::toLowerCase(). 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::toLowerCase(). 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::ParticleSystem::getName(), Ogre::DataChunk::isEOF(), parseAttrib(), parseNewAffector(), parseNewEmitter(), skipToNextCloseBrace(), skipToNextOpenBrace(), and Ogre::String::split(). Referenced by parseAllSources(). |
|
Set the relative speed of time as perceived by particle systems.
Definition at line 481 of file OgreParticleSystemManager.cpp. References mTimeFactor, and Ogre::Real. |
|
Internal script parsing method.
Definition at line 457 of file OgreParticleSystemManager.cpp. References Ogre::DataChunk::getLine(), and Ogre::DataChunk::isEOF(). Referenced by parseScript(). |
|
Internal script parsing method.
Definition at line 467 of file OgreParticleSystemManager.cpp. References Ogre::DataChunk::getLine(), and Ogre::DataChunk::isEOF(). Referenced by parseScript(). |
|
Factories for named affector types (can be extended using plugins).
Definition at line 71 of file OgreParticleSystemManager.h. Referenced by _createAffector(), _destroyAffector(), and addAffectorFactory(). |
|
Factories for named emitter types (can be extended using plugins).
Definition at line 67 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 63 of file OgreParticleSystemManager.h. Referenced by createSystem(), destroySystem(), frameStarted(), getSystem(), and ~ParticleSystemManager(). |
|
Templates based on scripts.
Definition at line 59 of file OgreParticleSystemManager.h. Referenced by addTemplate(), getTemplate(), and ~ParticleSystemManager(). |
|
Controls time.
Definition at line 74 of file OgreParticleSystemManager.h. Referenced by frameStarted(), getTimeFactor(), ParticleSystemManager(), and setTimeFactor(). |
Copyright © 2002-2003 by The OGRE Team
Last modified Fri May 14 23:26:50 2004