Particle Universe
1.2
|
#include <ParticleUniverseParticle.h>
Public Types | |
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 Member Functions | |
Particle (void) | |
virtual | ~Particle (void) |
bool | _isMarkedForEmission (void) const |
void | _setMarkedForEmission (bool markedForEmission) |
virtual void | _initForEmission (void) |
virtual void | _initForExpiration (ParticleTechnique *technique, Real timeElapsed) |
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) |
Static Public Attributes | |
static Real | DEFAULT_TTL |
static Real | DEFAULT_MASS |
Protected Attributes | |
uint32 | mEventFlags |
bool | mMarkedForEmission |
bool | mEnabled |
bool | mFreezed |
bool | mOriginalEnabled |
bool | mOriginalEnabledSet |
Vector3 | mDerivedPosition |
ParticleBehaviourList | mBehaviours |
Particle is the abstract/virtual class that represents the object to be emitted.
typedef ParticleBehaviourList::const_iterator ParticleUniverse::Particle::ParticleBehaviourIterator |
|
inline |
|
virtual |
bool ParticleUniverse::Particle::_getOriginalEnabled | ( | void | ) | const |
Returns the original 'enabled' value of the particle
|
virtual |
Perform initialising activities as soon as the particle is emitted.
Reimplemented in ParticleUniverse::ParticleTechnique, ParticleUniverse::ParticleSystem, ParticleUniverse::ParticleEmitter, ParticleUniverse::ParticleAffector, and ParticleUniverse::VisualParticle.
|
virtual |
Perform some action if the particle expires.
Reimplemented in ParticleUniverse::ParticleTechnique, ParticleUniverse::ParticleSystem, ParticleUniverse::ParticleEmitter, ParticleUniverse::ParticleAffector, and ParticleUniverse::VisualParticle.
|
inline |
Todo
|
virtual |
Perform actions on the particle itself during the update loop of a ParticleTechnique.
Reimplemented in ParticleUniverse::ParticleSystem.
|
inline |
void ParticleUniverse::Particle::_setOriginalEnabled | ( | bool | originalEnabled | ) |
This function sets the original 'enabled' value of the particle.
|
inline |
As setEventFlags, except the flags passed as parameters are appended to the existing flags on this object.
Real ParticleUniverse::Particle::calculateVelocity | ( | void | ) | const |
Calculates the velocity, based on the direction vector.
|
virtual |
Copy the data of this particle to another particle.
void ParticleUniverse::Particle::copyBehaviours | ( | ParticleBehaviourList & | behaviours | ) |
Copy a vector of ParticleBehaviour objects to this particle.
ParticleBehaviour* ParticleUniverse::Particle::getBehaviour | ( | const String & | behaviourType | ) |
Returns the first occurence of the ParticleBehaviour specified by its type.
|
inline |
Return the event flags.
|
inline |
Determines whether it has certain flags set.
|
virtual |
Todo
bool ParticleUniverse::Particle::isFreezed | ( | void | ) | const |
Returns true if the particle is freezed and doesn't move anymore.
|
inline |
The flags passed as parameters are removed from the existing flags.
|
virtual |
Todo
Reimplemented in ParticleUniverse::ParticleSystem, and ParticleUniverse::ParticleEmitter.
|
inline |
Sets the event flags.
void ParticleUniverse::Particle::setFreezed | ( | bool | freezed | ) |
Freeze the particle, so it doesn't move anymore.
|
static |
|
static |
Vector3 ParticleUniverse::Particle::direction |
Vector3 ParticleUniverse::Particle::latestPosition |
Real ParticleUniverse::Particle::mass |
|
protected |
List containing ParticleBehaviours.
|
protected |
Because the public attribute ´position´ is sometimes used for both localspace and worldspace position, the mDerivedPosition attribute is introduced.
|
protected |
Determines whether a particle is activated.
|
protected |
|
protected |
Determines whether a particle is 'freezed'. This means that the particle doesn´t move anymore.
|
protected |
Determines whether the particle is marked for emission.
|
protected |
Original setting.
|
protected |
Original may be set only once.
Any ParticleUniverse::Particle::mUserDefinedObject |
Keep the posibility to attach some custom data. This is additional to the Behaviour data. The advantage of a UserDefinedObject in favour of a ParticleBehaviour is, that no search is needed.
Vector3 ParticleUniverse::Particle::originalDirection |
Real ParticleUniverse::Particle::originalDirectionLength |
Vector3 ParticleUniverse::Particle::originalPosition |
Real ParticleUniverse::Particle::originalScaledDirectionLength |
Real ParticleUniverse::Particle::originalVelocity |
ParticleEmitter* ParticleUniverse::Particle::parentEmitter |
ParticleType ParticleUniverse::Particle::particleType |
PhysicsActor* ParticleUniverse::Particle::physicsActor |
If a physics engine is used, this attribute is set as soon as a particle is emitted.
Vector3 ParticleUniverse::Particle::position |
Real ParticleUniverse::Particle::timeFraction |
Real ParticleUniverse::Particle::timeToLive |
Real ParticleUniverse::Particle::totalTimeToLive |
IVisualData* ParticleUniverse::Particle::visualData |
For some renderers it is needed to relate a particle to some visual data