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

#include <CCPUBaseCollider.h>

Inheritance diagram for PUBaseCollider:
PUAffector Particle3DAffector Ref PUBoxCollider PUParticle3DInterParticleCollider PUPlaneCollider PUSphereCollider

Public Types

enum  IntersectionType { IT_POINT, IT_BOX }
 Determines how a particle collision should be determined. More...
 
enum  CollisionType { CT_NONE, CT_BOUNCE, CT_FLOW }
 Determines how a particle behaves after collision with this collider. More...
 
- Public Types inherited from PUAffector
enum  AffectSpecialisation { AFSP_DEFAULT, AFSP_TTL_INCREASE, AFSP_TTL_DECREASE }
 The AffectSpecialisation enumeration is used to specialise the affector even more. More...
 

Public Member Functions

virtual void preUpdateAffector (float deltaTime) override
const IntersectionType getIntersectionType () const
 Returns the type of intersection. More...
 
local getIntersectionType ()
 Returns the type of intersection. More...
 
void setIntersectionType (const IntersectionType &intersectionType)
 Sets the type of intersection. More...
 
const CollisionType getCollisionType () const
 Returns the type of collision. More...
 
void setCollisionType (const CollisionType &collisionType)
 Sets the type of collision. More...
 
const float getFriction () const
 Returns the friction value. More...
 
void setFriction (const float friction)
 Sets the friction value. More...
 
const float getBouncyness () const
 Returns the bouncyness value. More...
 
void setBouncyness (const float bouncyness)
 Sets the bouncyness value. More...
 
void populateAlignedBox (AABB &box, const Vec3 &position, const float width, const float height, const float depth)
 Fill the AxisAlignedBox with data derived from the other arguments. More...
 
var populateAlignedBox ( var box, var position, var width, var height, var depth)
 Fill the AxisAlignedBox with data derived from the other arguments. More...
 
local populateAlignedBox ( local box, local position, local width, local height, local depth)
 Fill the AxisAlignedBox with data derived from the other arguments. More...
 
void calculateRotationSpeedAfterCollision (PUParticle3D *particle)
 Recalculates the rotation speed after collision. More...
 
virtual void copyAttributesTo (PUAffector *affector) override
virtual ~PUBaseCollider ()
- Public Member Functions inherited from PUAffector
virtual void notifyStart ()
virtual void notifyStop ()
virtual void notifyPause ()
virtual void notifyResume ()
virtual void notifyRescaled (const Vec3 &scale)
local notifyRescaled ( local scale)
virtual void prepare ()
virtual void unPrepare ()
virtual void updatePUAffector (PUParticle3D *particle, float delta)
local updatePUAffector ( local particle, local delta)
virtual void postUpdateAffector (float deltaTime)
virtual void firstParticleUpdate (PUParticle3D *particle, float deltaTime)
var firstParticleUpdate ( var particle, var deltaTime)
local firstParticleUpdate ( local particle, local deltaTime)
virtual void initParticleForEmission (PUParticle3D *particle)
var initParticleForEmission ( var particle)
local initParticleForEmission ( local particle)
void process (PUParticle3D *particle, float delta, bool firstParticle)
void setLocalPosition (const Vec3 &pos)
const Vec3 getLocalPosition () const
void setMass (float mass)
float getMass () const
const Vec3getDerivedPosition ()
 Calculate the derived position of the affector. More...
 
local getDerivedPosition ()
 Calculate the derived position of the affector. More...
 
const AffectSpecialisationgetAffectSpecialisation (void) const
 Todo. More...
 
local getAffectSpecialisation ()
 Todo. More...
 
void setAffectSpecialisation (const AffectSpecialisation &affectSpecialisation)
const std::string & getAffectorType (void) const
 Todo. More...
 
void setAffectorType (const std::string &affectorType)
void addEmitterToExclude (const std::string &emitterName)
 Add a ParticleEmitter name that excludes Particles emitted by this ParticleEmitter from being affected. More...
 
void removeEmitterToExclude (const std::string &emitterName)
 Remove a ParticleEmitter name that excludes Particles emitted by this ParticleEmitter. More...
 
const std::string & getName (void) const
 Todo. More...
 
void setName (const std::string &name)
virtual ~PUAffector ()
- Public Member Functions inherited from Particle3DAffector
virtual void updateAffector (Particle3D *particle, float deltaTime)
void setEnabled (bool enabled)
 Enables or disables the emitter. More...
 
bool isEnabled (void) const
virtual ~Particle3DAffector ()
- 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 Attributes

CC_CONSTRUCTOR_ACCESS __pad0__: PUBaseCollider()
var __pad0__: PUBaseCollider()
- Public Attributes inherited from PUAffector
CC_CONSTRUCTOR_ACCESS __pad0__: PUAffector()
- Public Attributes inherited from Particle3DAffector
CC_CONSTRUCTOR_ACCESS __pad0__: Particle3DAffector()

Static Public Attributes

static const float DEFAULT_BOUNCYNESS
var DEFAULT_BOUNCYNESS
local DEFAULT_BOUNCYNESS
static const float DEFAULT_FRICTION
var DEFAULT_FRICTION
local DEFAULT_FRICTION
static const IntersectionType DEFAULT_INTERSECTION_TYPE
static const CollisionType DEFAULT_COLLISION_TYPE
local DEFAULT_COLLISION_TYPE

Protected Attributes

float _friction
float _bouncyness
IntersectionType _intersectionType
var _intersectionType
local _intersectionType
CollisionType _collisionType
float _velocityScale
- Protected Attributes inherited from PUAffector
Vec3 _position
Vec3 _affectorScale
 Although the scale is on a Particle System level, the affector can also be scaled. More...
 
Vec3 _derivedPosition
 Because the public attribute ´position?is sometimes used for both localspace and worldspace position, the mDerivedPosition attribute is introduced. More...
 
AffectSpecialisation _affectSpecialisation
 The mAffectSpecialisation is used to specialise the affector. More...
 
std::string _affectorType
std::vector< std::string > _excludedEmitters
var _excludedEmitters
local _excludedEmitters
std::string _name
float _mass
- Protected Attributes inherited from Particle3DAffector
ParticleSystem3D_particleSystem
bool _isEnabled
- Protected Attributes inherited from Ref
unsigned int _referenceCount
 count of references More...
 
local _referenceCount
 count of references More...
 

Additional Inherited Members

- Protected Member Functions inherited from PUAffector
float calculateAffectSpecialisationFactor (const PUParticle3D *particle)
var calculateAffectSpecialisationFactor ( var particle)
local calculateAffectSpecialisationFactor ( local particle)
- Protected Member Functions inherited from Ref
 Ref ()
 Constructor. More...
 
 Ref ()
 Constructor. More...
 

Member Enumeration Documentation

Determines how a particle behaves after collision with this collider.

The behaviour of the particle is solved in the collider and only behaviour that needs the colliders?data is taken into account. The fact that a particle expires for example, can be achieved by using an Observer in combination with an EventHandler (DoExpireEventHandler). CT_NONE means that the particle doesn do anything. This value should be set if the behaviour of the particle is determined outside the collider (for example, expiring the particle). CT_BOUNCE means that the particle bounces off the collider. CT_FLOW means that the particle flows around the contours of the collider.

Enumerator
CT_NONE 
CT_BOUNCE 
CT_FLOW 

Determines how a particle collision should be determined.

IT_POINT means that the position of the particle will be validated against the Colliders' shape. IT_BOX means that the dimensions (width, height and depth) are used to determine whether the particle collides.

Enumerator
IT_POINT 
IT_BOX 

Determines how a particle collision should be determined.

IT_POINT means that the position of the particle will be validated against the Colliders' shape. IT_BOX means that the dimensions (width, height and depth) are used to determine whether the particle collides.

Enumerator
IT_POINT 
IT_BOX 

Determines how a particle collision should be determined.

IT_POINT means that the position of the particle will be validated against the Colliders' shape. IT_BOX means that the dimensions (width, height and depth) are used to determine whether the particle collides.

Enumerator
IT_POINT 
IT_BOX 

Constructor & Destructor Documentation

virtual ~PUBaseCollider ( )
virtual
var ~PUBaseCollider ( )
virtual
local ~PUBaseCollider ( )
virtual

Member Function Documentation

void
calculateRotationSpeedAfterCollision
( PUParticle3D particle)

Recalculates the rotation speed after collision.

This function must be explicitly called in the updatePUAffector(float deltaTime) function of the class that inherits from BaseCollider.

var
calculateRotationSpeedAfterCollision
( var  particle)

Recalculates the rotation speed after collision.

This function must be explicitly called in the updatePUAffector(float deltaTime) function of the class that inherits from BaseCollider.

local
calculateRotationSpeedAfterCollision
( local  particle)

Recalculates the rotation speed after collision.

This function must be explicitly called in the updatePUAffector(float deltaTime) function of the class that inherits from BaseCollider.

virtual void copyAttributesTo ( PUAffector affector)
overridevirtual
var copyAttributesTo ( var  affector)
overridevirtual
local copyAttributesTo ( local  affector)
overridevirtual
const float getBouncyness ( ) const

Returns the bouncyness value.

var getBouncyness ( )

Returns the bouncyness value.

local getBouncyness ( )

Returns the bouncyness value.

const CollisionType
getCollisionType
( ) const

Returns the type of collision.

var getCollisionType ( )

Returns the type of collision.

local getCollisionType ( )

Returns the type of collision.

const float getFriction ( ) const

Returns the friction value.

var getFriction ( )

Returns the friction value.

local getFriction ( )

Returns the friction value.

const IntersectionType
getIntersectionType
( ) const

Returns the type of intersection.

var getIntersectionType ( )

Returns the type of intersection.

local getIntersectionType ( )

Returns the type of intersection.

void populateAlignedBox ( AABB box,
const Vec3 position,
const float  width,
const float  height,
const float  depth 
)

Fill the AxisAlignedBox with data derived from the other arguments.

var populateAlignedBox ( var  box,
var  position,
var  width,
var  height,
var  depth 
)

Fill the AxisAlignedBox with data derived from the other arguments.

local populateAlignedBox ( local  box,
local  position,
local  width,
local  height,
local  depth 
)

Fill the AxisAlignedBox with data derived from the other arguments.

virtual void preUpdateAffector ( float  deltaTime)
overridevirtual

Reimplemented from PUAffector.

Reimplemented in PUSphereCollider, and PUBoxCollider.

var preUpdateAffector ( var  deltaTime)
overridevirtual

Reimplemented from PUAffector.

Reimplemented in PUSphereCollider, and PUBoxCollider.

local preUpdateAffector ( local  deltaTime)
overridevirtual

Reimplemented from PUAffector.

Reimplemented in PUSphereCollider, and PUBoxCollider.

void setBouncyness ( const float  bouncyness)

Sets the bouncyness value.

var setBouncyness ( var  bouncyness)

Sets the bouncyness value.

local setBouncyness ( local  bouncyness)

Sets the bouncyness value.

void setCollisionType ( const CollisionType collisionType)

Sets the type of collision.

var setCollisionType ( var  collisionType)

Sets the type of collision.

local setCollisionType ( local  collisionType)

Sets the type of collision.

void setFriction ( const float  friction)

Sets the friction value.

var setFriction ( var  friction)

Sets the friction value.

local setFriction ( local  friction)

Sets the friction value.

void setIntersectionType ( const IntersectionType intersectionType)

Sets the type of intersection.

var setIntersectionType ( var  intersectionType)

Sets the type of intersection.

local setIntersectionType ( local  intersectionType)

Sets the type of intersection.

Member Data Documentation

var __pad0__
local __pad0__
float _bouncyness
protected
var _bouncyness
protected
local _bouncyness
protected
CollisionType _collisionType
protected
var _collisionType
protected
local _collisionType
protected
float _friction
protected
var _friction
protected
local _friction
protected
IntersectionType _intersectionType
protected
var _intersectionType
protected
local _intersectionType
protected
float _velocityScale
protected
var _velocityScale
protected
local _velocityScale
protected
const float DEFAULT_BOUNCYNESS
static
var DEFAULT_BOUNCYNESS
static
local DEFAULT_BOUNCYNESS
static
const CollisionType
DEFAULT_COLLISION_TYPE
static
var DEFAULT_COLLISION_TYPE
static
local DEFAULT_COLLISION_TYPE
static
const float DEFAULT_FRICTION
static
var DEFAULT_FRICTION
static
local DEFAULT_FRICTION
static
const IntersectionType
DEFAULT_INTERSECTION_TYPE
static

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