OGRE  1.12.13
Object-Oriented Graphics Rendering Engine
Ogre::ParticleAffector Class Referenceabstract

Abstract class defining the interface to be implemented by particle affectors. More...

#include <OgreParticleAffector.h>

+ Inheritance diagram for Ogre::ParticleAffector:

Public Member Functions

 ParticleAffector (ParticleSystem *parent)
 
virtual ~ParticleAffector ()
 Virtual destructor essential. More...
 
virtual void _affectParticles (ParticleSystem *pSystem, Real timeElapsed)=0
 Method called to allow the affector to 'do it's stuff' on all active particles in the system. More...
 
virtual void _initParticle (Particle *pParticle)
 Method called to allow the affector to initialize all newly created particles in the system. More...
 
const StringgetType (void) const
 Returns the name of the type of affector. More...
 
- Public Member Functions inherited from Ogre::StringInterface
 StringInterface ()
 
virtual ~StringInterface ()
 Virtual destructor, see Effective C++. More...
 
void copyParametersTo (StringInterface *dest) const
 Method for copying this object's parameters to another object. More...
 
ParamDictionarygetParamDictionary (void)
 Retrieves the parameter dictionary for this class. More...
 
const ParamDictionarygetParamDictionary (void) const
 
String getParameter (const String &name) const
 Generic parameter retrieval method. More...
 
const ParameterListgetParameters (void) const
 Retrieves a list of parameters valid for this object. More...
 
bool setParameter (const String &name, const String &value)
 Generic parameter setting method. More...
 
void setParameterList (const NameValuePairList &paramList)
 Generic multiple parameter setting method. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from Ogre::StringInterface
static void cleanupDictionary ()
 Cleans up the static 'msDictionary' required to reset Ogre, otherwise the containers are left with invalid pointers, which will lead to a crash as soon as one of the ResourceManager implementers (e.g. More...
 

Detailed Description

Abstract class defining the interface to be implemented by particle affectors.

Remarks
Particle affectors modify particles in a particle system over their lifetime. They can be grouped into types, e.g. 'vector force' affectors, 'fader' affectors etc; each type will modify particles in a different way, using different parameters.
Because there are so many types of affectors you could use, OGRE chooses not to dictate the available types. It comes with some in-built, but allows plugins or applications to extend the affector types available. This is done by subclassing ParticleAffector to have the appropriate emission behaviour you want, and also creating a subclass of ParticleAffectorFactory which is responsible for creating instances of your new affector type. You register this factory with the ParticleSystemManager using addAffectorFactory, and from then on affectors of this type can be created either from code or through text particle scripts by naming the type.
This same approach is used for ParticleEmitters (which are the source of particles in a system). This means that OGRE is particularly flexible when it comes to creating particle system effects, with literally infinite combinations of affector and affector types, and parameters within those types.

Constructor & Destructor Documentation

◆ ParticleAffector()

Ogre::ParticleAffector::ParticleAffector ( ParticleSystem parent)
inline

◆ ~ParticleAffector()

virtual Ogre::ParticleAffector::~ParticleAffector ( )
virtual

Virtual destructor essential.

Member Function Documentation

◆ _initParticle()

virtual void Ogre::ParticleAffector::_initParticle ( Particle pParticle)
inlinevirtual

Method called to allow the affector to initialize all newly created particles in the system.

Remarks
This is where the affector gets the chance to initialize it's effects to the particles of a system. The affector is expected to initialize some or all of the particles in the system passed to it, depending on the affector's approach.
Parameters
pParticlePointer to a Particle to initialize.

Reimplemented in Ogre::RotationAffector, Ogre::ColourImageAffector, and Ogre::TextureAnimatorAffector.

◆ _affectParticles()

virtual void Ogre::ParticleAffector::_affectParticles ( ParticleSystem pSystem,
Real  timeElapsed 
)
pure virtual

Method called to allow the affector to 'do it's stuff' on all active particles in the system.

Remarks
This is where the affector gets the chance to apply it's effects to the particles of a system. The affector is expected to apply it's effect to some or all of the particles in the system passed to it, depending on the affector's approach.
Parameters
pSystemPointer to a ParticleSystem to affect.
timeElapsedThe number of seconds which have elapsed since the last call.

Implemented in Ogre::ColourFaderAffector2, Ogre::RotationAffector, Ogre::ColourFaderAffector, Ogre::LinearForceAffector, Ogre::DeflectorPlaneAffector, Ogre::DirectionRandomiserAffector, Ogre::ColourInterpolatorAffector, Ogre::ScaleAffector, Ogre::ColourImageAffector, and Ogre::TextureAnimatorAffector.

◆ getType()

const String& Ogre::ParticleAffector::getType ( void  ) const
inline

Returns the name of the type of affector.

Remarks
This property is useful for determining the type of affector procedurally so another can be created.

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