OGRE 14.3
Object-Oriented Graphics Rendering Engine
Loading...
Searching...
No Matches
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.
 
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.
 
virtual void _initParticle (Particle *pParticle)
 Method called to allow the affector to initialize all newly created particles in the system.
 
const StringgetType (void) const
 Returns the name of the type of affector.
 
- Public Member Functions inherited from Ogre::StringInterface
 StringInterface ()
 
virtual ~StringInterface ()
 Virtual destructor, see Effective C++.
 
void copyParametersTo (StringInterface *dest) const
 Method for copying this object's parameters to another object.
 
ParamDictionarygetParamDictionary (void)
 Retrieves the parameter dictionary for this class.
 
const ParamDictionarygetParamDictionary (void) const
 
String getParameter (const String &name) const
 Generic parameter retrieval method.
 
const ParameterListgetParameters (void) const
 Retrieves a list of parameters valid for this object.
 
bool setParameter (const String &name, const String &value)
 Generic parameter setting method.
 
void setParameterList (const NameValuePairList &paramList)
 Generic multiple parameter setting method.
 

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.
 

Detailed Description

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

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.

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::ColourImageAffector, Ogre::ColourInterpolatorAffector, Ogre::RotationAffector, Ogre::ScaleAffector, 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.

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::ColourFaderAffector, Ogre::ColourFaderAffector2, Ogre::ColourImageAffector, Ogre::ColourInterpolatorAffector, Ogre::DeflectorPlaneAffector, Ogre::DirectionRandomiserAffector, Ogre::LinearForceAffector, Ogre::RotationAffector, Ogre::ScaleAffector, and Ogre::TextureAnimatorAffector.

◆ getType()

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

Returns the name of the type of affector.

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: