cocos2d-x  3.5
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
PUDoPlacementParticleEventHandler Class Reference

#include <CCPUDoPlacementParticleEventHandler.h>

Inheritance diagram for PUDoPlacementParticleEventHandler:
PUEventHandler PUListener Ref

Public Member Functions

bool isInheritPosition (void) const
 Getters/Setters. More...
 
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 std::string & getForceEmitterName (void) const
 Get the name of the emitter that is used to emit its particles. More...
 
void setForceEmitterName (const std::string &forceEmitterName)
 Set the name of the emitter that is used to emit its particles. More...
 
PUEmittergetForceEmitter (void) const
 Returns a pointer to the emitter that is used as a force emitter. More...
 
void removeAsListener (void)
 Remove this as a listener from the technique. More...
 
unsigned int getNumberOfParticles (void) const
 Get the number of particles to emit. More...
 
void setNumberOfParticles (unsigned int numberOfParticles)
 Set the number of particles to emit. More...
 
bool alwaysUsePosition (void) const
 Boolean that determines whether always the position of the particle that is handled must be used for emission of the new particle. More...
 
void setAlwaysUsePosition (bool alwaysUsePosition)
 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. More...
 
virtual void handle (PUParticleSystem3D *particleSystem, PUParticle3D *particle, float timeElapsed) override
 If the _handle() function of this class is invoked (by an Observer), it searches the ParticleEmitter defined by the mForceEmitterName. More...
 
virtual void particleEmitted (PUParticleSystem3D *particleSystem, PUParticle3D *particle) override
 Initialise the emitted particle. More...
 
virtual void particleExpired (PUParticleSystem3D *particleSystem, PUParticle3D *particle) override
 No implementation. More...
 
virtual void copyAttributesTo (PUEventHandler *eventHandler) override
virtual ~PUDoPlacementParticleEventHandler (void)
- Public Member Functions inherited from PUEventHandler
const std::string & getName (void) const
 Todo. More...
 
void setName (const std::string &name)
PUObservergetParentObserver (void) const
 Todo. More...
 
void setParentObserver (PUObserver *parentObserver)
const std::string & getEventHandlerType (void) const
 Todo. More...
 
void setEventHandlerType (const std::string &eventHandlerType)
virtual void notifyRescaled (const Vec3 &scale)
 Notify that the event handler is rescaled. More...
 
virtual ~PUEventHandler ()
- Public Member Functions inherited from Ref
void retain ()
 Retains the ownership. More...
 
void release ()
 Releases the ownership immediately. More...
 
Refautorelease ()
 Releases the ownership sometime soon automatically. More...
 
unsigned int getReferenceCount () const
 Returns the Ref's current reference count. More...
 
virtual ~Ref ()
 Destructor. More...
 
- Public Member Functions inherited from PUListener
 PUListener ()
virtual ~PUListener ()

Static Public Member Functions

static
PUDoPlacementParticleEventHandler
create ()

Public Attributes

CC_CONSTRUCTOR_ACCESS __pad0__: PUDoPlacementParticleEventHandler(void)
- Public Attributes inherited from PUEventHandler
CC_CONSTRUCTOR_ACCESS __pad0__: PUEventHandler()

Static Public Attributes

static const unsigned int DEFAULT_NUMBER_OF_PARTICLES

Protected Attributes

std::string _forceEmitterName
unsigned int _numberOfParticles
PUParticleSystem3D_system
 Store the technique value to keep up to speed. More...
 
PUEmitter_emitter
 Store the emitter value to keep up to speed. More...
 
bool _found
 Used to determine whether the emitter used by the DoPlacementParticleEventHandler, is already found. More...
 
bool _alwaysUsePosition
 By default the place where to put a new particle is on the position of the particle in the _handle function. More...
 
PUParticle3D_baseParticle
 The base particle from which the attributes are inherited. More...
 
bool _inheritPosition
 These flags are used to determine which attributes must be inherited from the base particle. More...
 
bool _inheritDirection
bool _inheritOrientation
bool _inheritTimeToLive
bool _inheritMass
bool _inheritTextureCoordinate
bool _inheritColour
bool _inheritParticleWidth
bool _inheritParticleHeight
bool _inheritParticleDepth
- Protected Attributes inherited from PUEventHandler
PUObserver_parentObserver
std::string _eventHandlerType
std::string _name
Vec3 _eventHandlerScale
 Although the scale is on a Particle System level, the event handler can also be scaled. More...
 
- Protected Attributes inherited from Ref
unsigned int _referenceCount
 count of references More...
 

Additional Inherited Members

- Protected Member Functions inherited from Ref
 Ref ()
 Constructor. More...
 

Constructor & Destructor Documentation

virtual
~PUDoPlacementParticleEventHandler
( void  )
virtual

Member Function Documentation

bool 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 copyAttributesTo ( PUEventHandler eventHandler)
overridevirtual

Reimplemented from PUEventHandler.

static
PUDoPlacementParticleEventHandler*
create
( )
static
PUEmitter* getForceEmitter ( void  ) const

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

const std::string&
getForceEmitterName
( void  ) const
inline

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

unsigned int getNumberOfParticles ( void  ) const
inline

Get the number of particles to emit.

virtual void handle ( PUParticleSystem3D particleSystem,
PUParticle3D particle,
float  timeElapsed 
)
overridevirtual

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 PUEventHandler.

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

Getters/Setters.

bool isInheritTextureCoordinate ( void  ) const
inline
bool isInheritTimeToLive ( void  ) const
inline
virtual void particleEmitted ( PUParticleSystem3D particleSystem,
PUParticle3D particle 
)
overridevirtual

Initialise the emitted particle.

This means that its position is set.

Implements PUListener.

virtual void particleExpired ( PUParticleSystem3D particleSystem,
PUParticle3D particle 
)
inlineoverridevirtual

No implementation.

Implements PUListener.

void 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 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 setForceEmitterName ( const std::string &  forceEmitterName)

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

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

Set the number of particles to emit.

Member Data Documentation

bool _alwaysUsePosition
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.

PUParticle3D* _baseParticle
protected

The base particle from which the attributes are inherited.

PUEmitter* _emitter
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.
std::string _forceEmitterName
protected
bool _found
protected

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

bool _inheritColour
protected
bool _inheritDirection
protected
bool _inheritMass
protected
bool _inheritOrientation
protected
bool _inheritParticleDepth
protected
bool _inheritParticleHeight
protected
bool _inheritParticleWidth
protected
bool _inheritPosition
protected

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

bool _inheritTextureCoordinate
protected
bool _inheritTimeToLive
protected
unsigned int _numberOfParticles
protected
PUParticleSystem3D* _system
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.
const unsigned int
DEFAULT_NUMBER_OF_PARTICLES
static

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