Abstract class defining the interface to be implemented by particle affectors.
More...
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.
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
-
pSystem | Pointer to a ParticleSystem to affect. |
timeElapsed | The number of seconds which have elapsed since the last call. |
Implemented in Ogre::TextureAnimatorAffector, Ogre::ScaleAffector, Ogre::RotationAffector, Ogre::LinearForceAffector, Ogre::DirectionRandomiserAffector, Ogre::DeflectorPlaneAffector, Ogre::ColourInterpolatorAffector, Ogre::ColourImageAffector, Ogre::ColourFaderAffector2, and Ogre::ColourFaderAffector.