OGRE-Next
3.0.0
Object-Oriented Graphics Rendering Engine
|
Manages particle systems, particle system scripts (templates) and the available emitter & affector factories. More...
#include <OgreParticleSystemManager.h>
Public Types | |
typedef MapIterator< ParticleAffectorFactoryMap > | ParticleAffectorFactoryIterator |
typedef map< String, ParticleAffectorFactory * >::type | ParticleAffectorFactoryMap |
typedef MapIterator< ParticleEmitterFactoryMap > | ParticleEmitterFactoryIterator |
typedef map< String, ParticleEmitterFactory * >::type | ParticleEmitterFactoryMap |
typedef MapIterator< ParticleSystemRendererFactoryMap > | ParticleRendererFactoryIterator |
typedef map< String, ParticleSystemRendererFactory * >::type | ParticleSystemRendererFactoryMap |
typedef MapIterator< ParticleTemplateMap > | ParticleSystemTemplateIterator |
typedef map< String, ParticleSystem * >::type | ParticleTemplateMap |
Public Member Functions | |
ParticleSystemManager () | |
~ParticleSystemManager () override | |
ParticleAffector * | _createAffector (const String &affectorType, ParticleSystem *psys) |
Internal method for creating a new affector from a factory. More... | |
ParticleEmitter * | _createEmitter (const String &emitterType, ParticleSystem *psys) |
Internal method for creating a new emitter from a factory. More... | |
ParticleSystemRenderer * | _createRenderer (const String &rendererType, SceneManager *sceneManager) |
Internal method for creating a new renderer from a factory. More... | |
void | _destroyAffector (ParticleAffector *affector) |
Internal method for destroying an affector. More... | |
void | _destroyEmitter (ParticleEmitter *emitter) |
Internal method for destroying an emitter. More... | |
void | _destroyRenderer (ParticleSystemRenderer *renderer) |
Internal method for destroying a renderer. More... | |
ParticleSystemFactory * | _getFactory () |
Get an instance of ParticleSystemFactory (internal use). More... | |
void | _initialise () |
Init method to be called by OGRE system. More... | |
void | addAffectorFactory (ParticleAffectorFactory *factory) |
Adds a new 'factory' object for affectors to the list of available affector types. More... | |
void | addEmitterFactory (ParticleEmitterFactory *factory) |
Adds a new 'factory' object for emitters to the list of available emitter types. More... | |
void | addRendererFactory (ParticleSystemRendererFactory *factory) |
Registers a factory class for creating ParticleSystemRenderer instances. More... | |
void | addTemplate (const String &name, ParticleSystem *sysTemplate) |
Adds a new particle system template to the list of available templates. More... | |
ParticleSystem * | createTemplate (const String &name, const String &resourceGroup) |
Create a new particle system template. More... | |
ParticleAffectorFactoryIterator | getAffectorFactoryIterator () |
Return an iterator over the affector factories currently registered. More... | |
ParticleEmitterFactoryIterator | getEmitterFactoryIterator () |
Return an iterator over the emitter factories currently registered. More... | |
Real | getLoadingOrder () const override |
Gets the relative loading order of scripts of this type. More... | |
ParticleRendererFactoryIterator | getRendererFactoryIterator () |
Return an iterator over the renderer factories currently registered. More... | |
const StringVector & | getScriptPatterns () const override |
Gets the file patterns which should be used to find scripts for this class. More... | |
Real | getSimulationTickRate () const |
See setSimulationTickRate() More... | |
ParticleSystem * | getTemplate (const String &name) |
Retrieves a particle system template for possible modification. More... | |
ParticleSystemTemplateIterator | getTemplateIterator () |
Gets an iterator over the list of particle system templates. More... | |
void | parseScript (DataStreamPtr &stream, const String &groupName) override |
Parse a script file. More... | |
void | removeAllTemplates (bool deleteTemplate=true) |
Removes a specified template from the ParticleSystemManager. More... | |
void | removeTemplate (const String &name, bool deleteTemplate=true) |
Removes a specified template from the ParticleSystemManager. More... | |
void | removeTemplatesByResourceGroup (const String &resourceGroup) |
Removes all templates that belong to a secific Resource Group from the ParticleSystemManager. More... | |
void | setSimulationTickRate (Real tickRate) |
Sets the simulation tick rate. More... | |
Public Member Functions inherited from Ogre::Singleton< ParticleSystemManager > | |
Singleton () | |
~Singleton () | |
Public Member Functions inherited from Ogre::ScriptLoader | |
virtual | ~ScriptLoader () |
Static Public Member Functions | |
static ParticleSystemManager & | getSingleton () |
Override standard Singleton retrieval. More... | |
static ParticleSystemManager * | getSingletonPtr () |
Override standard Singleton retrieval. More... | |
Static Public Member Functions inherited from Ogre::Singleton< ParticleSystemManager > | |
static ParticleSystemManager & | getSingleton () |
static ParticleSystemManager * | getSingletonPtr () |
Manages particle systems, particle system scripts (templates) and the available emitter & affector factories.
typedef MapIterator<ParticleAffectorFactoryMap> Ogre::ParticleSystemManager::ParticleAffectorFactoryIterator |
typedef map<String, ParticleAffectorFactory *>::type Ogre::ParticleSystemManager::ParticleAffectorFactoryMap |
typedef MapIterator<ParticleEmitterFactoryMap> Ogre::ParticleSystemManager::ParticleEmitterFactoryIterator |
typedef map<String, ParticleEmitterFactory *>::type Ogre::ParticleSystemManager::ParticleEmitterFactoryMap |
typedef MapIterator<ParticleSystemRendererFactoryMap> Ogre::ParticleSystemManager::ParticleRendererFactoryIterator |
typedef map<String, ParticleSystemRendererFactory *>::type Ogre::ParticleSystemManager::ParticleSystemRendererFactoryMap |
typedef MapIterator<ParticleTemplateMap> Ogre::ParticleSystemManager::ParticleSystemTemplateIterator |
typedef map<String, ParticleSystem *>::type Ogre::ParticleSystemManager::ParticleTemplateMap |
Ogre::ParticleSystemManager::ParticleSystemManager | ( | ) |
|
override |
ParticleAffector* Ogre::ParticleSystemManager::_createAffector | ( | const String & | affectorType, |
ParticleSystem * | psys | ||
) |
Internal method for creating a new affector from a factory.
affectorType | String name of the affector type to be created. A factory of this type must have been registered. |
psys | The particle system it is being created for |
ParticleEmitter* Ogre::ParticleSystemManager::_createEmitter | ( | const String & | emitterType, |
ParticleSystem * | psys | ||
) |
Internal method for creating a new emitter from a factory.
emitterType | String name of the emitter type to be created. A factory of this type must have been registered. |
psys | The particle system this is being created for |
ParticleSystemRenderer* Ogre::ParticleSystemManager::_createRenderer | ( | const String & | rendererType, |
SceneManager * | sceneManager | ||
) |
Internal method for creating a new renderer from a factory.
rendererType | String name of the renderer type to be created. A factory of this type must have been registered. |
void Ogre::ParticleSystemManager::_destroyAffector | ( | ParticleAffector * | affector | ) |
Internal method for destroying an affector.
affector | Pointer to affector to be destroyed. On return this pointer will point to invalid (freed) memory. |
void Ogre::ParticleSystemManager::_destroyEmitter | ( | ParticleEmitter * | emitter | ) |
Internal method for destroying an emitter.
emitter | Pointer to emitter to be destroyed. On return this pointer will point to invalid (freed) memory. |
void Ogre::ParticleSystemManager::_destroyRenderer | ( | ParticleSystemRenderer * | renderer | ) |
Internal method for destroying a renderer.
renderer | Pointer to renderer to be destroyed. On return this pointer will point to invalid (freed) memory. |
|
inline |
Get an instance of ParticleSystemFactory (internal use).
void Ogre::ParticleSystemManager::_initialise | ( | ) |
Init method to be called by OGRE system.
void Ogre::ParticleSystemManager::addAffectorFactory | ( | ParticleAffectorFactory * | factory | ) |
Adds a new 'factory' object for affectors to the list of available affector types.
factory | Pointer to a ParticleAffectorFactory subclass created by the plugin or application code. |
void Ogre::ParticleSystemManager::addEmitterFactory | ( | ParticleEmitterFactory * | factory | ) |
Adds a new 'factory' object for emitters to the list of available emitter types.
factory | Pointer to a ParticleEmitterFactory subclass created by the plugin or application code. |
void Ogre::ParticleSystemManager::addRendererFactory | ( | ParticleSystemRendererFactory * | factory | ) |
Registers a factory class for creating ParticleSystemRenderer instances.
factory | Pointer to a ParticleSystemRendererFactory subclass created by the plugin or application code. |
void Ogre::ParticleSystemManager::addTemplate | ( | const String & | name, |
ParticleSystem * | sysTemplate | ||
) |
Adds a new particle system template to the list of available templates.
name | The name of the template. Must be unique across all templates. |
sysTemplate | A pointer to a particle system to be used as a template. The manager will take over ownership of this pointer. |
ParticleSystem* Ogre::ParticleSystemManager::createTemplate | ( | const String & | name, |
const String & | resourceGroup | ||
) |
Create a new particle system template.
name | The name of the template. Must be unique across all templates. |
resourceGroup | The name of the resource group which will be used to load any dependent resources. |
ParticleAffectorFactoryIterator Ogre::ParticleSystemManager::getAffectorFactoryIterator | ( | ) |
Return an iterator over the affector factories currently registered.
ParticleEmitterFactoryIterator Ogre::ParticleSystemManager::getEmitterFactoryIterator | ( | ) |
Return an iterator over the emitter factories currently registered.
|
overridevirtual |
Gets the relative loading order of scripts of this type.
Implements Ogre::ScriptLoader.
ParticleRendererFactoryIterator Ogre::ParticleSystemManager::getRendererFactoryIterator | ( | ) |
Return an iterator over the renderer factories currently registered.
|
overridevirtual |
Gets the file patterns which should be used to find scripts for this class.
Implements Ogre::ScriptLoader.
|
inline |
|
static |
Override standard Singleton retrieval.
|
static |
Override standard Singleton retrieval.
ParticleSystem* Ogre::ParticleSystemManager::getTemplate | ( | const String & | name | ) |
Retrieves a particle system template for possible modification.
|
inline |
Gets an iterator over the list of particle system templates.
|
overridevirtual |
Parse a script file.
stream | Weak reference to a data stream which is the source of the script |
groupName | The name of a resource group which should be used if any resources are created during the parse of this script. |
Implements Ogre::ScriptLoader.
void Ogre::ParticleSystemManager::removeAllTemplates | ( | bool | deleteTemplate = true | ) |
Removes a specified template from the ParticleSystemManager.
deleteTemplate | Whether or not to delete the templates before removing them. |
void Ogre::ParticleSystemManager::removeTemplate | ( | const String & | name, |
bool | deleteTemplate = true |
||
) |
Removes a specified template from the ParticleSystemManager.
name | The name of the template to remove. |
deleteTemplate | Whether or not to delete the template before removing it. |
void Ogre::ParticleSystemManager::removeTemplatesByResourceGroup | ( | const String & | resourceGroup | ) |
Removes all templates that belong to a secific Resource Group from the ParticleSystemManager.
resourceGroup | Resource group to delete templates for |
|
inline |
Sets the simulation tick rate.
However for particle FXs which were created as fixed tick rate, changes take effect immediately.
tickRate | A value <= 0 means we will use variable rate. That means that if a second has elapsed between two frames, then we will issue a single update() call with 1 second to the particle FXs. |
A value > 0 means we will use fixed tick rate / time step. That means that if a second has elapsed between two frames and the value is 0.1f, then we will issue 10 updates of 10ms each to simulate the particle FXs.
Fixed tick rate is much more stable but may consume more resources. It also allows for deterministic simulations, which is impossible with variable rate.
The default value is 0 A sensible value is 1.0 / 60.0 (for 60hz updates)