Particle Universe  1.2
ParticleUniverse::DoPlacementParticleEventHandler Class Reference

#include <ParticleUniverseDoPlacementParticleEventHandler.h>

Inheritance diagram for ParticleUniverse::DoPlacementParticleEventHandler:

Public Member Functions

 DoPlacementParticleEventHandler (void)
 
virtual ~DoPlacementParticleEventHandler (void)
 
bool isInheritPosition (void) const
 
bool isInheritDirection (void) const
 
bool isInheritOrientation (void) const
 
bool isInheritTimeToLive (void) const
 
bool isInheritMass (void) const
 
bool isInheritTextureCoordinate (void) const
 
bool isInheritColour (void) const
 
bool isInheritParticleWidth (void) const
 
bool isInheritParticleHeight (void) const
 
bool isInheritParticleDepth (void) const
 
void setInheritPosition (bool inheritPosition)
 
void setInheritDirection (bool inheritDirection)
 
void setInheritOrientation (bool inheritOrientation)
 
void setInheritTimeToLive (bool inheritTimeToLive)
 
void setInheritMass (bool inheritMass)
 
void setInheritTextureCoordinate (bool inheritTextureCoordinate)
 
void setInheritColour (bool inheritColour)
 
void setInheritParticleWidth (bool inheritParticleWidth)
 
void setInheritParticleHeight (bool inheritParticleHeight)
 
void setInheritParticleDepth (bool inheritParticleDepth)
 
const StringgetForceEmitterName (void) const
 
void setForceEmitterName (const String &forceEmitterName)
 
ParticleEmittergetForceEmitter (void) const
 
void removeAsListener (void)
 
unsigned int getNumberOfParticles (void) const
 
void setNumberOfParticles (unsigned int numberOfParticles)
 
bool alwaysUsePosition (void) const
 
void setAlwaysUsePosition (bool alwaysUsePosition)
 
virtual void _handle (ParticleTechnique *particleTechnique, Particle *particle, Real timeElapsed)
 
virtual void particleEmitted (ParticleTechnique *particleTechnique, Particle *particle)
 
virtual void particleExpired (ParticleTechnique *particleTechnique, Particle *particle)
 
virtual void copyAttributesTo (ParticleEventHandler *eventHandler)
 
- Public Member Functions inherited from ParticleUniverse::ParticleEventHandler
 ParticleEventHandler (void)
 
virtual ~ParticleEventHandler (void)
 
const StringgetName (void) const
 
void setName (const String &name)
 
ParticleObservergetParentObserver (void) const
 
void setParentObserver (ParticleObserver *parentObserver)
 
const StringgetEventHandlerType (void) const
 
void setEventHandlerType (const String &eventHandlerType)
 
virtual void _notifyRescaled (const Vector3 &scale)
 
virtual void copyParentAttributesTo (ParticleEventHandler *eventHandler)
 
- Public Member Functions inherited from ParticleUniverse::IAlias
 IAlias (void)
 
virtual ~IAlias (void)
 
const StringgetAliasName (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)
 
- Public Member Functions inherited from ParticleUniverse::TechniqueListener
 TechniqueListener (void)
 
virtual ~TechniqueListener (void)
 

Static Public Attributes

static const unsigned int DEFAULT_NUMBER_OF_PARTICLES
 

Protected Attributes

String mForceEmitterName
 
unsigned int mNumberOfParticles
 
ParticleTechniquemTechnique
 
ParticleEmittermEmitter
 
bool mFound
 
bool mAlwaysUsePosition
 
ParticlemBaseParticle
 
bool mInheritPosition
 
bool mInheritDirection
 
bool mInheritOrientation
 
bool mInheritTimeToLive
 
bool mInheritMass
 
bool mInheritTextureCoordinate
 
bool mInheritColour
 
bool mInheritParticleWidth
 
bool mInheritParticleHeight
 
bool mInheritParticleDepth
 
- Protected Attributes inherited from ParticleUniverse::ParticleEventHandler
ParticleObservermParentObserver
 
String mEventHandlerType
 
String mName
 
Vector3 _mEventHandlerScale
 
- Protected Attributes inherited from ParticleUniverse::IAlias
String mAliasName
 
AliasType mAliasType
 

Additional Inherited Members

- 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
}
 

Detailed Description

This class 'sticks' one or more particles to the position of a particle that is passed through the DoPlacementParticleEventHandler.

Remarks
The position of each particle that is passed through the DoPlacementParticleEventHandler is used to emit one or more particles on that same position. The ParticleEmitter that is used for emitting the particle(s) is searched (once) by means of its name.
This class uses a 'TechniqueListener' to pass the newly created particle from the ParticleTechnique to the DoPlacementParticleEventHandler, where it is initialised.

Constructor & Destructor Documentation

ParticleUniverse::DoPlacementParticleEventHandler::DoPlacementParticleEventHandler ( void  )
virtual ParticleUniverse::DoPlacementParticleEventHandler::~DoPlacementParticleEventHandler ( void  )
virtual

Member Function Documentation

virtual void ParticleUniverse::DoPlacementParticleEventHandler::_handle ( ParticleTechnique particleTechnique,
Particle particle,
Real  timeElapsed 
)
virtual

If the _handle() function of this class is invoked (by an Observer), it searches the ParticleEmitter defined by the mForceEmitterName. This ParticleEmitter is either part of the ParticleTechnique in which the DoPlacementParticleEventHandler is defined, and if the ParticleEmitter is not found, other ParticleTechniques are searched. The ParticleEmitter is 'forced' to emit the requested number of particles.

Implements ParticleUniverse::ParticleEventHandler.

bool ParticleUniverse::DoPlacementParticleEventHandler::alwaysUsePosition ( void  ) const
inline

Boolean that determines whether always the position of the particle that is handled must be used for emission of the new particle.

virtual void ParticleUniverse::DoPlacementParticleEventHandler::copyAttributesTo ( ParticleEventHandler eventHandler)
virtual

Copy attributes to another event handler.

Reimplemented from ParticleUniverse::ParticleEventHandler.

ParticleEmitter* ParticleUniverse::DoPlacementParticleEventHandler::getForceEmitter ( void  ) const

Returns a pointer to the emitter that is used as a force emitter.

const String& ParticleUniverse::DoPlacementParticleEventHandler::getForceEmitterName ( void  ) const
inline

Get the name of the emitter that is used to emit its particles.

unsigned int ParticleUniverse::DoPlacementParticleEventHandler::getNumberOfParticles ( void  ) const
inline

Get the number of particles to emit.

bool ParticleUniverse::DoPlacementParticleEventHandler::isInheritColour ( void  ) const
inline
bool ParticleUniverse::DoPlacementParticleEventHandler::isInheritDirection ( void  ) const
inline
bool ParticleUniverse::DoPlacementParticleEventHandler::isInheritMass ( void  ) const
inline
bool ParticleUniverse::DoPlacementParticleEventHandler::isInheritOrientation ( void  ) const
inline
bool ParticleUniverse::DoPlacementParticleEventHandler::isInheritParticleDepth ( void  ) const
inline
bool ParticleUniverse::DoPlacementParticleEventHandler::isInheritParticleHeight ( void  ) const
inline
bool ParticleUniverse::DoPlacementParticleEventHandler::isInheritParticleWidth ( void  ) const
inline
bool ParticleUniverse::DoPlacementParticleEventHandler::isInheritPosition ( void  ) const
inline

Getters/Setters

bool ParticleUniverse::DoPlacementParticleEventHandler::isInheritTextureCoordinate ( void  ) const
inline
bool ParticleUniverse::DoPlacementParticleEventHandler::isInheritTimeToLive ( void  ) const
inline
virtual void ParticleUniverse::DoPlacementParticleEventHandler::particleEmitted ( ParticleTechnique particleTechnique,
Particle particle 
)
virtual

Initialise the emitted particle. This means that its position is set.

Implements ParticleUniverse::TechniqueListener.

virtual void ParticleUniverse::DoPlacementParticleEventHandler::particleExpired ( ParticleTechnique particleTechnique,
Particle particle 
)
inlinevirtual

No implementation.

Implements ParticleUniverse::TechniqueListener.

void ParticleUniverse::DoPlacementParticleEventHandler::removeAsListener ( void  )

Remove this as a listener from the technique.

Remarks
If a new force-emitter name has been set, the removeAsListener must be called, to remove the DoPlacementParticleEventHandler from the old technique (to which the force-emitter belongs. Only then the new force-emitter is used. The reason why it is not called automatically in the setForceEmitterName() funtion is to offer some flexibility on the moment the removeAsListener() is called.
void ParticleUniverse::DoPlacementParticleEventHandler::setAlwaysUsePosition ( bool  alwaysUsePosition)
inline

Set the boolean to indicate whether the position of the particle that is handled must be used for emission of the new particle or whether the contact point of the physics actor must be used. This only applies if a physics angine is used, otherwise the default is used.

void ParticleUniverse::DoPlacementParticleEventHandler::setForceEmitterName ( const String forceEmitterName)

Set the name of the emitter that is used to emit its particles.

void ParticleUniverse::DoPlacementParticleEventHandler::setInheritColour ( bool  inheritColour)
inline
void ParticleUniverse::DoPlacementParticleEventHandler::setInheritDirection ( bool  inheritDirection)
inline
void ParticleUniverse::DoPlacementParticleEventHandler::setInheritMass ( bool  inheritMass)
inline
void ParticleUniverse::DoPlacementParticleEventHandler::setInheritOrientation ( bool  inheritOrientation)
inline
void ParticleUniverse::DoPlacementParticleEventHandler::setInheritParticleDepth ( bool  inheritParticleDepth)
inline
void ParticleUniverse::DoPlacementParticleEventHandler::setInheritParticleHeight ( bool  inheritParticleHeight)
inline
void ParticleUniverse::DoPlacementParticleEventHandler::setInheritParticleWidth ( bool  inheritParticleWidth)
inline
void ParticleUniverse::DoPlacementParticleEventHandler::setInheritPosition ( bool  inheritPosition)
inline
void ParticleUniverse::DoPlacementParticleEventHandler::setInheritTextureCoordinate ( bool  inheritTextureCoordinate)
inline
void ParticleUniverse::DoPlacementParticleEventHandler::setInheritTimeToLive ( bool  inheritTimeToLive)
inline
void ParticleUniverse::DoPlacementParticleEventHandler::setNumberOfParticles ( unsigned int  numberOfParticles)
inline

Set the number of particles to emit.

Member Data Documentation

const unsigned int ParticleUniverse::DoPlacementParticleEventHandler::DEFAULT_NUMBER_OF_PARTICLES
static
bool ParticleUniverse::DoPlacementParticleEventHandler::mAlwaysUsePosition
protected

By default the place where to put a new particle is on the position of the particle in the _handle function. If mAlwaysUsePosition is set to false, it tries the contact point of the physics actor that is associated with the particle.

Particle* ParticleUniverse::DoPlacementParticleEventHandler::mBaseParticle
protected

The base particle from which the attributes are inherited

ParticleEmitter* ParticleUniverse::DoPlacementParticleEventHandler::mEmitter
protected

Store the emitter value to keep up to speed.

Remarks
If the ParticleEmitter has been destroyed, the DoPlacementParticleEventHandler isnīt automatically notified. Using the pointer causes an exception.
String ParticleUniverse::DoPlacementParticleEventHandler::mForceEmitterName
protected
bool ParticleUniverse::DoPlacementParticleEventHandler::mFound
protected

Used to determine whether the emitter used by the DoPlacementParticleEventHandler, is already found.

bool ParticleUniverse::DoPlacementParticleEventHandler::mInheritColour
protected
bool ParticleUniverse::DoPlacementParticleEventHandler::mInheritDirection
protected
bool ParticleUniverse::DoPlacementParticleEventHandler::mInheritMass
protected
bool ParticleUniverse::DoPlacementParticleEventHandler::mInheritOrientation
protected
bool ParticleUniverse::DoPlacementParticleEventHandler::mInheritParticleDepth
protected
bool ParticleUniverse::DoPlacementParticleEventHandler::mInheritParticleHeight
protected
bool ParticleUniverse::DoPlacementParticleEventHandler::mInheritParticleWidth
protected
bool ParticleUniverse::DoPlacementParticleEventHandler::mInheritPosition
protected

These flags are used to determine which attributes must be inherited from the base particle.

bool ParticleUniverse::DoPlacementParticleEventHandler::mInheritTextureCoordinate
protected
bool ParticleUniverse::DoPlacementParticleEventHandler::mInheritTimeToLive
protected
unsigned int ParticleUniverse::DoPlacementParticleEventHandler::mNumberOfParticles
protected
ParticleTechnique* ParticleUniverse::DoPlacementParticleEventHandler::mTechnique
protected

Store the technique value to keep up to speed.

Remarks
If the ParticleTechnique has been destroyed, the DoPlacementParticleEventHandler isnīt automatically notified. Using the pointer causes an exception.

The documentation for this class was generated from the following file: