Cocos2d-x  v3.10
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Groups
PUAffector Class Reference

PUAffector, the base class of pu affector, inherit from Particle3DAffector. More...

Inherits Particle3DAffector.

Inherited by PUAlignAffector, PUBaseCollider, PUBaseForceAffector, PUCollisionAvoidanceAffector, PUColorAffector, PUFlockCenteringAffector, PUForceFieldAffector, PUGeometryRotator, PUGravityAffector, PUJetAffector, PULineAffector, PUParticleFollower, PUPathFollower, PURandomiser, PUScaleAffector, PUScaleVelocityAffector, PUTextureAnimator, PUTextureRotator, PUVelocityMatchingAffector, and PUVortexAffector.

Public Types

enum  AffectSpecialisation
 The AffectSpecialisation enumeration is used to specialise the affector even more. More...
 

Public Member Functions

virtual void notifyStart ()
 Perform activities when a affector is started(internal method).
 
virtual void notifyStop ()
 Perform activities when a affector is stopped(internal method).
 
virtual void notifyPause ()
 Perform activities when a affector is paused(internal method).
 
virtual void notifyResume ()
 Perform activities when a affector is resumed(internal method).
 
virtual void notifyRescaled (const Vec3 &scale)
 Notify that the affector is rescaled(internal method).
 
local notifyRescaled ( local scale)
 Notify that the affector is rescaled(internal method).
 
virtual void prepare ()
 The function is automatically called during initialisation (prepare) activities of a ParticleSystem(internal method).
 
virtual void unPrepare ()
 The function is automatically called when a ParticleSystem is expired(internal method).
 
virtual void preUpdateAffector (float deltaTime)
 This function is called before the ParticleSystem update-loop where all particles are traversed(internal method). More...
 
local preUpdateAffector ( local deltaTime)
 This function is called before the ParticleSystem update-loop where all particles are traversed(internal method). More...
 
virtual void updatePUAffector (PUParticle3D *particle, float delta)
 This function is called when the ParticleSystem update-loop where all particles are traversed(internal method). More...
 
local updatePUAffector ( local particle, local delta)
 This function is called when the ParticleSystem update-loop where all particles are traversed(internal method). More...
 
virtual void postUpdateAffector (float deltaTime)
 This function is called after the ParticleSystem update-loop where all particles are traversed(internal method). More...
 
virtual void firstParticleUpdate (PUParticle3D *particle, float deltaTime)
 This function is called when the first particle in the update-loop is processed(internal method). More...
 
var firstParticleUpdate ( var particle, var deltaTime)
 This function is called when the first particle in the update-loop is processed(internal method). More...
 
local firstParticleUpdate ( local particle, local deltaTime)
 This function is called when the first particle in the update-loop is processed(internal method). More...
 
virtual void initParticleForEmission (PUParticle3D *particle)
 Initialise a newly emitted particle(internal method). More...
 
var initParticleForEmission ( var particle)
 Initialise a newly emitted particle(internal method). More...
 
local initParticleForEmission ( local particle)
 Initialise a newly emitted particle(internal method). More...
 
void process (PUParticle3D *particle, float delta, bool firstParticle)
 Process a particle(internal method). More...
 
local process ( local particle, local delta, local firstParticle)
 Process a particle(internal method). More...
 
void setLocalPosition (const Vec3 &pos)
 Set position of affector. More...
 
const Vec3 getLocalPosition () const
 Get position of affector. More...
 
void setMass (float mass)
 Set the mass of affector. More...
 
float getMass () const
 Get the mass of affector. More...
 
const Vec3getDerivedPosition ()
 Calculate the world position of the affector. More...
 
var getDerivedPosition ()
 Calculate the world position of the affector. More...
 
local getDerivedPosition ()
 Calculate the world position of the affector. More...
 
const AffectSpecialisationgetAffectSpecialisation (void) const
 Get the AffectSpecialisation enumeration,isn't used by all affectors. More...
 
void setAffectSpecialisation (const AffectSpecialisation &affectSpecialisation)
 Set the AffectSpecialisation enumeration. More...
 
const std::string & getAffectorType (void) const
 Get the type of affector. More...
 
void setAffectorType (const std::string &affectorType)
 Set the type of affector. More...
 
void addEmitterToExclude (const std::string &emitterName)
 Add a emitter name that excludes Particles emitted by this emitter from being affected。 The name of emitter.
 
void removeEmitterToExclude (const std::string &emitterName)
 Remove a emitter name that excludes particles emitted by this emitter. More...
 
const std::string & getName (void) const
 Get the name of affector The name of affector.
 
void setName (const std::string &name)
 Set the name of affector The name of affector.
 
virtual void copyAttributesTo (PUAffector *affector)
 Copy attributes to another affector(internal method). More...
 
local copyAttributesTo ( local affector)
 Copy attributes to another affector(internal method). More...
 
- Public Member Functions inherited from Particle3DAffector
virtual void updateAffector (Particle3D *particle, float deltaTime)
 Update affector(internal method). More...
 
var updateAffector ( var particle, var deltaTime)
 Update affector(internal method). More...
 
local updateAffector ( local particle, local deltaTime)
 Update affector(internal method). More...
 
void setEnabled (bool enabled)
 Set the affector enable or disable. More...
 
bool isEnabled (void) const
 Get the affector enabled. More...
 
- Public Member Functions inherited from Ref
void retain ()
 Retains the ownership. More...
 
local 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...
 
local getReferenceCount ()
 Returns the Ref's current reference count. More...
 
virtual ~Ref ()
 Destructor.
 

Additional Inherited Members

- Public Attributes inherited from Ref
unsigned int _ID
 object id, ScriptSupport need public _ID
 
local _ID
 object id, ScriptSupport need public _ID
 
int _luaID
 Lua reference id.
 
local _luaID
 Lua reference id.
 
void * _scriptObject
 scriptObject, support for swift
 
local _scriptObject
 scriptObject, support for swift
 
bool _rooted
 When true, it means that the object was already rooted.
 
local _rooted
 When true, it means that the object was already rooted.
 
bool _scriptOwned
 The life of the object is scrolled by the scripting engine. More...
 
local _scriptOwned
 The life of the object is scrolled by the scripting engine. More...
 

Detailed Description

PUAffector, the base class of pu affector, inherit from Particle3DAffector.

affectors modify particles in a particle system over their lifetime. This class defines the interface, and provides a few implementations of some basic functions.

Member Function Documentation

virtual void preUpdateAffector ( float  deltaTime)
virtual

This function is called before the ParticleSystem update-loop where all particles are traversed(internal method).

The delta time between two frames.

var preUpdateAffector ( var  deltaTime)
virtual

This function is called before the ParticleSystem update-loop where all particles are traversed(internal method).

The delta time between two frames.

local preUpdateAffector ( local  deltaTime)
virtual

This function is called before the ParticleSystem update-loop where all particles are traversed(internal method).

The delta time between two frames.

virtual void updatePUAffector ( PUParticle3D particle,
float  delta 
)
virtual

This function is called when the ParticleSystem update-loop where all particles are traversed(internal method).

The current traversed particle. The delta time between two frames.

var updatePUAffector ( var  particle,
var  delta 
)
virtual

This function is called when the ParticleSystem update-loop where all particles are traversed(internal method).

The current traversed particle. The delta time between two frames.

local updatePUAffector ( local  particle,
local  delta 
)
virtual

This function is called when the ParticleSystem update-loop where all particles are traversed(internal method).

The current traversed particle. The delta time between two frames.

virtual void postUpdateAffector ( float  deltaTime)
virtual

This function is called after the ParticleSystem update-loop where all particles are traversed(internal method).

The delta time between two frames.

var postUpdateAffector ( var  deltaTime)
virtual

This function is called after the ParticleSystem update-loop where all particles are traversed(internal method).

The delta time between two frames.

local postUpdateAffector ( local  deltaTime)
virtual

This function is called after the ParticleSystem update-loop where all particles are traversed(internal method).

The delta time between two frames.

virtual void firstParticleUpdate ( PUParticle3D particle,
float  deltaTime 
)
virtual

This function is called when the first particle in the update-loop is processed(internal method).

The current traversed particle. The delta time between two frames.

var firstParticleUpdate ( var  particle,
var  deltaTime 
)
virtual

This function is called when the first particle in the update-loop is processed(internal method).

The current traversed particle. The delta time between two frames.

local firstParticleUpdate ( local  particle,
local  deltaTime 
)
virtual

This function is called when the first particle in the update-loop is processed(internal method).

The current traversed particle. The delta time between two frames.

virtual void
initParticleForEmission
( PUParticle3D particle)
virtual

Initialise a newly emitted particle(internal method).

Particle pointer to a particle to initialise.

var initParticleForEmission ( var  particle)
virtual

Initialise a newly emitted particle(internal method).

Particle pointer to a particle to initialise.

local initParticleForEmission ( local  particle)
virtual

Initialise a newly emitted particle(internal method).

Particle pointer to a particle to initialise.

void process ( PUParticle3D particle,
float  delta,
bool  firstParticle 
)

Process a particle(internal method).

The particle to be processed. The delta time between two frames. Is the first particle.

var process ( var  particle,
var  delta,
var  firstParticle 
)

Process a particle(internal method).

The particle to be processed. The delta time between two frames. Is the first particle.

local process ( local  particle,
local  delta,
local  firstParticle 
)

Process a particle(internal method).

The particle to be processed. The delta time between two frames. Is the first particle.

void setLocalPosition ( const Vec3 pos)
inline

Set position of affector.

The position in local coordinate system.

var setLocalPosition ( var  pos)
inline

Set position of affector.

The position in local coordinate system.

local setLocalPosition ( local  pos)
inline

Set position of affector.

The position in local coordinate system.

const Vec3 getLocalPosition ( ) const
inline

Get position of affector.

The position in local coordinate system.

var getLocalPosition ( )
inline

Get position of affector.

The position in local coordinate system.

local getLocalPosition ( )
inline

Get position of affector.

The position in local coordinate system.

void setMass ( float  mass)

Set the mass of affector.

The mass of affector.

var setMass ( var  mass)

Set the mass of affector.

The mass of affector.

local setMass ( local  mass)

Set the mass of affector.

The mass of affector.

float getMass ( ) const

Get the mass of affector.

The mass of affector.

var getMass ( )

Get the mass of affector.

The mass of affector.

local getMass ( )

Get the mass of affector.

The mass of affector.

const Vec3& getDerivedPosition ( )

Calculate the world position of the affector.

The position in world coordinate system.

var getDerivedPosition ( )

Calculate the world position of the affector.

The position in world coordinate system.

local getDerivedPosition ( )

Calculate the world position of the affector.

The position in world coordinate system.

const AffectSpecialisation&
getAffectSpecialisation
( void  ) const
inline

Get the AffectSpecialisation enumeration,isn't used by all affectors.

The enumeration.

var getAffectSpecialisation (   )
inline

Get the AffectSpecialisation enumeration,isn't used by all affectors.

The enumeration.

local getAffectSpecialisation (   )
inline

Get the AffectSpecialisation enumeration,isn't used by all affectors.

The enumeration.

void setAffectSpecialisation ( const AffectSpecialisation affectSpecialisation)
inline

Set the AffectSpecialisation enumeration.

The enumeration.

var setAffectSpecialisation ( var  affectSpecialisation)
inline

Set the AffectSpecialisation enumeration.

The enumeration.

local setAffectSpecialisation ( local  affectSpecialisation)
inline

Set the AffectSpecialisation enumeration.

The enumeration.

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

Get the type of affector.

The type.

var getAffectorType (   )
inline

Get the type of affector.

The type.

local getAffectorType (   )
inline

Get the type of affector.

The type.

void setAffectorType ( const std::string &  affectorType)
inline

Set the type of affector.

The type.

var setAffectorType ( var  affectorType)
inline

Set the type of affector.

The type.

local setAffectorType ( local  affectorType)
inline

Set the type of affector.

The type.

void removeEmitterToExclude ( const std::string &  emitterName)

Remove a emitter name that excludes particles emitted by this emitter.

The name of emitter.

var removeEmitterToExclude ( var  emitterName)

Remove a emitter name that excludes particles emitted by this emitter.

The name of emitter.

local removeEmitterToExclude ( local  emitterName)

Remove a emitter name that excludes particles emitted by this emitter.

The name of emitter.

virtual void copyAttributesTo ( PUAffector affector)
virtual

Copy attributes to another affector(internal method).

The affector.

var copyAttributesTo ( var  affector)
virtual

Copy attributes to another affector(internal method).

The affector.

local copyAttributesTo ( local  affector)
virtual

Copy attributes to another affector(internal method).

The affector.


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