Particle Universe
1.2
|
#include <ParticleUniverseAffector.h>
Public Types | |
enum | AffectSpecialisation { AFSP_DEFAULT, AFSP_TTL_INCREASE, AFSP_TTL_DECREASE } |
Public Types inherited from ParticleUniverse::Particle | |
enum | ParticleType { PT_VISUAL, PT_TECHNIQUE, PT_EMITTER, PT_AFFECTOR, PT_SYSTEM } |
enum | ReservedParticleEventFlags { PEF_EXPIRED = 1<<0, PEF_EMITTED = 1<<1, PEF_COLLIDED = 1<<2 } |
typedef vector< ParticleBehaviour * > | ParticleBehaviourList |
typedef ParticleBehaviourList::const_iterator | ParticleBehaviourIterator |
Public Types inherited from ParticleUniverse::IAlias | |
enum | AliasType { AT_UNDEFINED, AT_TECHNIQUE, AT_RENDERER, AT_EMITTER, AT_AFFECTOR, AT_OBSERVER, AT_EXTERN, AT_HANDLER, AT_BEHAVIOUR } |
Public Member Functions | |
ParticleAffector (void) | |
virtual | ~ParticleAffector (void) |
const AffectSpecialisation & | getAffectSpecialisation (void) const |
void | setAffectSpecialisation (const AffectSpecialisation &affectSpecialisation) |
const String & | getAffectorType (void) const |
void | setAffectorType (const String &affectorType) |
const String & | getName (void) const |
void | setName (const String &name) |
ParticleTechnique * | getParentTechnique (void) const |
void | setParentTechnique (ParticleTechnique *parentTechnique) |
virtual void | _prepare (ParticleTechnique *particleTechnique) |
virtual void | _unprepare (ParticleTechnique *particleTechnique) |
virtual void | _notifyStart (void) |
virtual void | _notifyStop (void) |
virtual void | _notifyPause (void) |
virtual void | _notifyResume (void) |
virtual void | _notifyRescaled (const Vector3 &scale) |
virtual void | _preProcessParticles (ParticleTechnique *particleTechnique, Real timeElapsed) |
virtual void | _firstParticle (ParticleTechnique *particleTechnique, Particle *particle, Real timeElapsed) |
virtual void | _initForEmission (void) |
virtual void | _initForExpiration (ParticleTechnique *technique, Real timeElapsed) |
virtual void | _initParticleForEmission (Particle *particle) |
void | _processParticle (ParticleTechnique *particleTechnique, Particle *particle, Real timeElapsed, bool firstParticle) |
virtual void | _postProcessParticles (ParticleTechnique *technique, Real timeElapsed) |
virtual void | _affect (ParticleTechnique *particleTechnique, Particle *particle, Real timeElapsed)=0 |
void | addEmitterToExclude (const String &emitterName) |
void | removeEmitterToExclude (const String &emitterName) |
void | removeAllEmittersToExclude (void) |
const list< String > & | getEmittersToExclude (void) const |
bool | hasEmitterToExclude (const String &emitterName) |
virtual void | copyAttributesTo (ParticleAffector *affector) |
virtual void | copyParentAttributesTo (ParticleAffector *affector) |
const Vector3 & | getDerivedPosition (void) |
Real | _calculateAffectSpecialisationFactor (const Particle *particle) |
Public Member Functions inherited from ParticleUniverse::Particle | |
Particle (void) | |
virtual | ~Particle (void) |
bool | _isMarkedForEmission (void) const |
void | _setMarkedForEmission (bool markedForEmission) |
virtual bool | isEnabled (void) const |
virtual void | setEnabled (bool enabled) |
void | _setOriginalEnabled (bool originalEnabled) |
bool | _getOriginalEnabled (void) const |
bool | isFreezed (void) const |
void | setFreezed (bool freezed) |
void | setEventFlags (uint32 flags) |
void | addEventFlags (uint32 flags) |
void | removeEventFlags (uint32 flags) |
uint32 | getEventFlags (void) const |
bool | hasEventFlags (uint32 flags) const |
void | copyBehaviours (ParticleBehaviourList &behaviours) |
virtual void | _process (ParticleTechnique *technique, Real timeElapsed) |
ParticleBehaviour * | getBehaviour (const String &behaviourType) |
Real | calculateVelocity (void) const |
virtual void | copyAttributesTo (Particle *particle) |
Public Member Functions inherited from ParticleUniverse::IAlias | |
IAlias (void) | |
virtual | ~IAlias (void) |
const String & | getAliasName (void) const |
void | setAliasName (String aliasName) |
const AliasType | getAliasType (void) const |
void | setAliasType (AliasType aliasType) |
Public Member Functions inherited from ParticleUniverse::IElement | |
IElement (void) | |
virtual | ~IElement (void) |
Static Public Attributes | |
static const bool | DEFAULT_ENABLED |
static const Vector3 | DEFAULT_POSITION |
static const AffectSpecialisation | DEFAULT_SPECIALISATION |
Static Public Attributes inherited from ParticleUniverse::Particle | |
static Real | DEFAULT_TTL |
static Real | DEFAULT_MASS |
Protected Attributes | |
ParticleTechnique * | mParentTechnique |
String | mAffectorType |
String | mName |
AffectSpecialisation | mAffectSpecialisation |
list< String > | mExcludedEmitters |
Vector3 | _mAffectorScale |
Protected Attributes inherited from ParticleUniverse::Particle | |
uint32 | mEventFlags |
bool | mMarkedForEmission |
bool | mEnabled |
bool | mFreezed |
bool | mOriginalEnabled |
bool | mOriginalEnabledSet |
Vector3 | mDerivedPosition |
ParticleBehaviourList | mBehaviours |
Protected Attributes inherited from ParticleUniverse::IAlias | |
String | mAliasName |
AliasType | mAliasType |
Additional Inherited Members | |
Public Attributes inherited from ParticleUniverse::Particle | |
ParticleEmitter * | parentEmitter |
Vector3 | position |
Vector3 | direction |
Real | mass |
Real | timeToLive |
Real | totalTimeToLive |
Real | timeFraction |
ParticleType | particleType |
Any | mUserDefinedObject |
PhysicsActor * | physicsActor |
IVisualData * | visualData |
Vector3 | originalPosition |
Vector3 | originalDirection |
Real | originalVelocity |
Real | originalDirectionLength |
Real | originalScaledDirectionLength |
Vector3 | latestPosition |
Abstract class defining the interface to be implemented by particle affectors.
ParticleUniverse::ParticleAffector::ParticleAffector | ( | void | ) |
|
inlinevirtual |
|
pure virtual |
Affect a particle.
particle | Pointer to a ParticleTechnique to which the particle belongs. |
particle | Pointer to a Particle. |
timeElapsed | The number of seconds which have elapsed since the last call. |
Implemented in ParticleUniverse::TextureAnimator, ParticleUniverse::GeometryRotator, ParticleUniverse::BoxCollider, ParticleUniverse::LineAffector, ParticleUniverse::TextureRotator, ParticleUniverse::Randomiser, ParticleUniverse::ColourAffector, ParticleUniverse::AlignAffector, ParticleUniverse::InterParticleCollider, ParticleUniverse::SphereCollider, ParticleUniverse::VortexAffector, ParticleUniverse::PathFollower, ParticleUniverse::ForceFieldAffector, ParticleUniverse::JetAffector, ParticleUniverse::PlaneCollider, ParticleUniverse::CollisionAvoidanceAffector, ParticleUniverse::FlockCenteringAffector, ParticleUniverse::VelocityMatchingAffector, ParticleUniverse::ParticleFollower, ParticleUniverse::GravityAffector, ParticleUniverse::LinearForceAffector, ParticleUniverse::ScaleAffector, ParticleUniverse::SineForceAffector, and ParticleUniverse::ScaleVelocityAffector.
Real ParticleUniverse::ParticleAffector::_calculateAffectSpecialisationFactor | ( | const Particle * | particle | ) |
If the mAffectSpecialisation is used to specialise the affector, a factor can be calculated and used in a child class. This factor depends on the value of mAffectSpecialisation.
|
inlinevirtual |
Perform precalculations if the first Particle in the update-loop is processed.
Reimplemented in ParticleUniverse::LineAffector, ParticleUniverse::AlignAffector, and ParticleUniverse::ParticleFollower.
|
virtual |
Initialise the ParticleAffector before it is emitted itself.
Reimplemented from ParticleUniverse::Particle.
|
virtual |
Initialise the ParticleAffector before it is expired itself.
Reimplemented from ParticleUniverse::Particle.
|
inlinevirtual |
Initialise a newly emitted particle.
particle | Pointer to a Particle to initialise. |
Reimplemented in ParticleUniverse::TextureAnimator, ParticleUniverse::GeometryRotator, and ParticleUniverse::TextureRotator.
|
inlinevirtual |
Perform activities when a ParticleAffector is paused.
|
virtual |
Notify that the Affector is rescaled.
Reimplemented in ParticleUniverse::LineAffector, and ParticleUniverse::PlaneCollider.
|
inlinevirtual |
Perform activities when a ParticleAffector is resumed.
|
virtual |
Perform activities when a ParticleAffector is started.
Reimplemented in ParticleUniverse::ForceFieldAffector.
|
inlinevirtual |
Perform activities when a ParticleAffector is stopped.
|
inlinevirtual |
Perform activities after the individual particles are processed.
Reimplemented in ParticleUniverse::LineAffector, and ParticleUniverse::Randomiser.
|
inlinevirtual |
Perform initialisation actions.
Reimplemented in ParticleUniverse::InterParticleCollider, ParticleUniverse::ForceFieldAffector, ParticleUniverse::CollisionAvoidanceAffector, and ParticleUniverse::VelocityMatchingAffector.
|
inlinevirtual |
Perform activities before the individual particles are processed.
Reimplemented in ParticleUniverse::TextureAnimator, ParticleUniverse::BoxCollider, ParticleUniverse::LineAffector, ParticleUniverse::Randomiser, ParticleUniverse::BaseCollider, ParticleUniverse::SphereCollider, ParticleUniverse::VortexAffector, ParticleUniverse::ForceFieldAffector, ParticleUniverse::GravityExtern, ParticleUniverse::VortexExtern, ParticleUniverse::FlockCenteringAffector, ParticleUniverse::GravityAffector, ParticleUniverse::LinearForceAffector, ParticleUniverse::SineForceAffector, ParticleUniverse::BoxColliderExtern, and ParticleUniverse::SphereColliderExtern.
void ParticleUniverse::ParticleAffector::_processParticle | ( | ParticleTechnique * | particleTechnique, |
Particle * | particle, | ||
Real | timeElapsed, | ||
bool | firstParticle | ||
) |
Entry point for affecting a Particle.
particle | Pointer to a ParticleTechnique to which the particle belongs. |
particle | Pointer to a Particle. |
timeElapsed | The number of seconds which have elapsed since the last call. |
firstParticle | Determines whether the ParticleAffector encounters the first particle of all active particles. |
|
inlinevirtual |
Reverse the actions from the _prepare.
Reimplemented in ParticleUniverse::InterParticleCollider, ParticleUniverse::CollisionAvoidanceAffector, and ParticleUniverse::VelocityMatchingAffector.
void ParticleUniverse::ParticleAffector::addEmitterToExclude | ( | const String & | emitterName | ) |
Add a ParticleEmitter name that excludes Particles emitted by this ParticleEmitter from being affected.
|
virtual |
Copy attributes to another affector.
Reimplemented in ParticleUniverse::ForceFieldAffector, ParticleUniverse::BaseCollider, ParticleUniverse::LineAffector, ParticleUniverse::BoxCollider, ParticleUniverse::Randomiser, ParticleUniverse::TextureAnimator, ParticleUniverse::GeometryRotator, ParticleUniverse::ColourAffector, ParticleUniverse::InterParticleCollider, ParticleUniverse::SphereCollider, ParticleUniverse::TextureRotator, ParticleUniverse::PathFollower, ParticleUniverse::JetAffector, ParticleUniverse::PlaneCollider, ParticleUniverse::CollisionAvoidanceAffector, ParticleUniverse::VortexAffector, ParticleUniverse::VelocityMatchingAffector, ParticleUniverse::AlignAffector, ParticleUniverse::FlockCenteringAffector, ParticleUniverse::BaseForceAffector, ParticleUniverse::ScaleAffector, ParticleUniverse::GravityAffector, ParticleUniverse::ScaleVelocityAffector, ParticleUniverse::LinearForceAffector, ParticleUniverse::ParticleFollower, and ParticleUniverse::SineForceAffector.
|
virtual |
Copy parent attributes to another affector.
|
inline |
Todo
|
inline |
Todo
const Vector3& ParticleUniverse::ParticleAffector::getDerivedPosition | ( | void | ) |
Calculate the derived position of the affector.
Return the list with emitters to exclude.
|
inline |
Todo
|
inline |
Todo
bool ParticleUniverse::ParticleAffector::hasEmitterToExclude | ( | const String & | emitterName | ) |
Returns true if the list with excluded emitters contains a given name.
void ParticleUniverse::ParticleAffector::removeAllEmittersToExclude | ( | void | ) |
Remove all ParticleEmitter names that excludes Particles emitted by this ParticleEmitter.
void ParticleUniverse::ParticleAffector::removeEmitterToExclude | ( | const String & | emitterName | ) |
Remove a ParticleEmitter name that excludes Particles emitted by this ParticleEmitter.
|
inline |
|
inline |
|
inline |
void ParticleUniverse::ParticleAffector::setParentTechnique | ( | ParticleTechnique * | parentTechnique | ) |
|
protected |
Although the scale is on a Particle System level, the affector can also be scaled.
|
static |
|
static |
|
static |
|
protected |
|
protected |
The mAffectSpecialisation is used to specialise the affector. This attribute is comparable with the mAutoDirection of the ParticleEmitter, it is an optional attribute and used in some of the Particle Affectors.
List of ParticleEmitter names that excludes particles emitted by ParticleEmitters with that name.
|
protected |
|
protected |