Particle Universe
1.2
|
#include <ParticleUniverseObserver.h>
Public Types | |
typedef vector< ParticleEventHandler * >::iterator | ParticleEventHandlerIterator |
typedef vector< ParticleEventHandler * >::const_iterator | ParticleEventHandlerConstIterator |
typedef vector< ParticleEventHandler * > | ParticleEventHandlerList |
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 | |
ParticleObserver (void) | |
virtual | ~ParticleObserver (void) |
const String & | getObserverType (void) const |
void | setObserverType (const String &observerType) |
virtual bool | isEnabled (void) const |
bool | _getOriginalEnabled (void) const |
virtual void | setEnabled (bool enabled) |
void | _resetEnabled (void) |
ParticleTechnique * | getParentTechnique (void) const |
void | setParentTechnique (ParticleTechnique *parentTechnique) |
const String & | getName (void) const |
void | setName (const String &name) |
const Particle::ParticleType & | getParticleTypeToObserve (void) const |
void | setParticleTypeToObserve (const Particle::ParticleType particleTypeToObserve) |
virtual void | _notifyStart (void) |
virtual void | _notifyStop (void) |
virtual void | _notifyRescaled (const Vector3 &scale) |
virtual void | _preProcessParticles (ParticleTechnique *technique, Real timeElapsed) |
virtual void | _processParticle (ParticleTechnique *particleTechnique, Particle *particle, Real timeElapsed, bool firstParticle) |
virtual void | _firstParticle (ParticleTechnique *particleTechnique, Particle *particle, Real timeElapsed) |
virtual void | _postProcessParticles (ParticleTechnique *technique, Real timeElapsed) |
virtual bool | _observe (ParticleTechnique *particleTechnique, Particle *particle, Real timeElapsed)=0 |
ParticleEventHandler * | createEventHandler (const String &eventHandlerType) |
void | addEventHandler (ParticleEventHandler *eventHandler) |
void | removeEventHandler (ParticleEventHandler *eventHandler) |
ParticleEventHandler * | getEventHandler (size_t index) const |
ParticleEventHandler * | getEventHandler (const String &eventHandlerName) const |
size_t | getNumEventHandlers (void) const |
void | destroyEventHandler (ParticleEventHandler *eventHandler) |
void | destroyEventHandler (size_t index) |
void | destroyAllEventHandlers (void) |
virtual void | copyAttributesTo (ParticleObserver *observer) |
virtual void | copyParentAttributesTo (ParticleObserver *observer) |
Real | getObserverInterval (void) const |
void | setObserverInterval (Real observerInterval) |
bool | getObserveUntilEvent (void) const |
void | setObserveUntilEvent (bool observeUntilEvent) |
bool | isParticleTypeToObserveSet (void) const |
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 Particle::ParticleType | DEFAULT_PARTICLE_TYPE |
static const Real | DEFAULT_INTERVAL |
static const bool | DEFAULT_UNTIL_EVENT |
Protected Member Functions | |
virtual void | _handleObserve (ParticleTechnique *particleTechnique, Particle *particle, Real timeElapsed) |
virtual void | _handleEvent (ParticleTechnique *particleTechnique, Particle *particle, Real timeElapsed) |
Protected Attributes | |
ParticleTechnique * | mParentTechnique |
String | mObserverType |
String | mName |
bool | mEnabled |
bool | mOriginalEnabled |
bool | mOriginalEnabledSet |
bool | mObserve |
bool | mObserveUntilEvent |
bool | mEventHandlersExecuted |
Vector3 | _mObserverScale |
Particle::ParticleType | mParticleTypeToObserve |
bool | mParticleTypeToObserveSet |
ParticleEventHandlerList | mEventHandlers |
Real | mObserverInterval |
Real | mObserverIntervalRemainder |
bool | mObserverIntervalSet |
Protected Attributes inherited from ParticleUniverse::IAlias | |
String | mAliasName |
AliasType | mAliasType |
ParticleObservers are used to observe whether a certain condition occurs. This condition is often related to the state of a Particle, but also certain situations regarding a ParticleTechnique, ParticleEmitter or even the ParticleSystem can be validated.
typedef vector<ParticleEventHandler*>::const_iterator ParticleUniverse::ParticleObserver::ParticleEventHandlerConstIterator |
typedef vector<ParticleEventHandler*>::iterator ParticleUniverse::ParticleObserver::ParticleEventHandlerIterator |
ParticleUniverse::ParticleObserver::ParticleObserver | ( | void | ) |
|
virtual |
|
inlinevirtual |
Perform precalculations if the first Particle in the update-loop is processed.
bool ParticleUniverse::ParticleObserver::_getOriginalEnabled | ( | void | ) | const |
Returns the 'enabled' value that was set in setEnabled() and not altered during execution.
|
protectedvirtual |
Handle the event.
|
protectedvirtual |
Handle the observer implementation.
|
virtual |
Notify that the Particle System is rescaled.
|
virtual |
Perform activities when a ParticleTechnique is started.
Reimplemented in ParticleUniverse::OnCountObserver, and ParticleUniverse::OnClearObserver.
|
inlinevirtual |
Perform activities when a ParticleTechnique is stopped.
|
pure virtual |
This function determines whether a condition (the event) is true or false.
Implemented in ParticleUniverse::OnCountObserver, ParticleUniverse::OnTimeObserver, ParticleUniverse::OnPositionObserver, ParticleUniverse::OnRandomObserver, ParticleUniverse::OnClearObserver, ParticleUniverse::OnVelocityObserver, ParticleUniverse::OnEventFlagObserver, ParticleUniverse::OnCollisionObserver, ParticleUniverse::OnQuotaObserver, ParticleUniverse::OnEmissionObserver, and ParticleUniverse::OnExpireObserver.
|
inlinevirtual |
Perform activities after the individual particles are processed.
Reimplemented in ParticleUniverse::OnClearObserver, and ParticleUniverse::OnQuotaObserver.
|
virtual |
Perform activities before the individual particles are processed.
Reimplemented in ParticleUniverse::OnTimeObserver, and ParticleUniverse::OnRandomObserver.
|
virtual |
Executes the ParticleObserver.
Reimplemented in ParticleUniverse::OnClearObserver, and ParticleUniverse::OnRandomObserver.
void ParticleUniverse::ParticleObserver::_resetEnabled | ( | void | ) |
Reset internal values for 'enabled'. This means that both the mEnabled and mOriginalEnabled can be set again using setEnabled.
void ParticleUniverse::ParticleObserver::addEventHandler | ( | ParticleEventHandler * | eventHandler | ) |
Todo
|
virtual |
Copy attributes to another observer.
Reimplemented in ParticleUniverse::OnPositionObserver, ParticleUniverse::OnTimeObserver, ParticleUniverse::OnCountObserver, ParticleUniverse::OnRandomObserver, ParticleUniverse::OnVelocityObserver, and ParticleUniverse::OnEventFlagObserver.
|
virtual |
Copy parent attributes to another observer.
ParticleEventHandler* ParticleUniverse::ParticleObserver::createEventHandler | ( | const String & | eventHandlerType | ) |
Todo
void ParticleUniverse::ParticleObserver::destroyAllEventHandlers | ( | void | ) |
Todo
void ParticleUniverse::ParticleObserver::destroyEventHandler | ( | ParticleEventHandler * | eventHandler | ) |
Todo
void ParticleUniverse::ParticleObserver::destroyEventHandler | ( | size_t | index | ) |
Todo
ParticleEventHandler* ParticleUniverse::ParticleObserver::getEventHandler | ( | size_t | index | ) | const |
Todo
ParticleEventHandler* ParticleUniverse::ParticleObserver::getEventHandler | ( | const String & | eventHandlerName | ) | const |
Todo
|
inline |
Todo
size_t ParticleUniverse::ParticleObserver::getNumEventHandlers | ( | void | ) | const |
Todo
Real ParticleUniverse::ParticleObserver::getObserverInterval | ( | void | ) | const |
Return the interval value, which defines at what interval the observer is called.
|
inline |
Todo
bool ParticleUniverse::ParticleObserver::getObserveUntilEvent | ( | void | ) | const |
Return the value of mObserveUntilEvent.
|
inline |
Todo
|
inline |
Todo
|
virtual |
Todo
bool ParticleUniverse::ParticleObserver::isParticleTypeToObserveSet | ( | void | ) | const |
Returns true if the particle type to observe specifically has been set.
void ParticleUniverse::ParticleObserver::removeEventHandler | ( | ParticleEventHandler * | eventHandler | ) |
Todo
|
virtual |
Todo
|
inline |
void ParticleUniverse::ParticleObserver::setObserverInterval | ( | Real | observerInterval | ) |
Set the interval value, which defines at what interval the observer is called.
|
inline |
void ParticleUniverse::ParticleObserver::setObserveUntilEvent | ( | bool | observeUntilEvent | ) |
Sets the value of mObserveUntilEvent. This value determines whether observation must be continued after an event ocurred and the event handlers are called.
|
inline |
void ParticleUniverse::ParticleObserver::setParticleTypeToObserve | ( | const Particle::ParticleType | particleTypeToObserve | ) |
|
protected |
Although the scale is on a Particle System level, the observer can also be scaled.
|
static |
|
static |
|
static |
|
static |
|
protected |
Determines whether an observer is activated.
|
protected |
|
protected |
Flag that is set if the event handler(s) are called at least once.
|
protected |
|
protected |
Determines whether the _observe() function must be executed.
|
protected |
Values that determine that the observer is called after every interval.
|
protected |
|
protected |
|
protected |
|
protected |
Observes until an event takes place. If the event occurs, the event handlers are called and after that the observer doesn't observe anymore.
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
Determines whether mParticleTypeToObserve is set. If ´true´, only that particles of the specified type are observed. If ´false´ (= default), all particles are observed.