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

#include <CCPUBoxCollider.h>

Inheritance diagram for PUBoxCollider:
PUBaseCollider PUAffector Particle3DAffector Ref

Public Member Functions

virtual void preUpdateAffector (float deltaTime) override
virtual void updatePUAffector (PUParticle3D *particle, float deltaTime) override
const float getWidth () const
 Returns the width of the box. More...
 
void setWidth (const float width)
 Sets the width of the box. More...
 
const float getHeight () const
 Returns the height of the box. More...
 
void setHeight (const float height)
 Sets the height of the box. More...
 
const float getDepth () const
 Returns the depth of the box. More...
 
void setDepth (const float depth)
 Sets the depth of the box. More...
 
bool isInnerCollision () const
 Returns indication whether the collision is inside or outside of the box. More...
 
void setInnerCollision (bool innerCollision)
 Set indication whether the collision is inside or outside of the box. More...
 
void calculateDirectionAfterCollision (PUParticle3D *particle)
virtual void copyAttributesTo (PUAffector *affector) override
var copyAttributesTo ( var affector)
local copyAttributesTo ( local affector)
virtual ~PUBoxCollider ()
- Public Member Functions inherited from PUBaseCollider
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 ~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 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...
 

Static Public Member Functions

static PUBoxCollidercreate ()

Public Attributes

CC_CONSTRUCTOR_ACCESS __pad0__: PUBoxCollider()
- Public Attributes inherited from PUBaseCollider
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_WIDTH
static const float DEFAULT_HEIGHT
local DEFAULT_HEIGHT
static const float DEFAULT_DEPTH
- Static Public Attributes inherited from PUBaseCollider
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 Member Functions

void calculateBounds ()
bool isSmallestValue (float value, const Vec3 &particlePosition)
var isSmallestValue ( var value, var particlePosition)
local isSmallestValue ( local value, local particlePosition)
- 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...
 

Protected Attributes

float _width
float _height
float _depth
float _xmin
float _xmax
float _ymin
float _ymax
float _zmin
float _zmax
AABB _box
Vec3 _predictedPosition
bool _innerCollision
- Protected Attributes inherited from PUBaseCollider
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

- Public Types inherited from PUBaseCollider
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...
 

Constructor & Destructor Documentation

virtual ~PUBoxCollider ( )
virtual
var ~PUBoxCollider ( )
virtual
local ~PUBoxCollider ( )
virtual

Member Function Documentation

void calculateBounds ( )
protected
var calculateBounds ( )
protected
local calculateBounds ( )
protected
void
calculateDirectionAfterCollision
( PUParticle3D particle)
var
calculateDirectionAfterCollision
( var  particle)
local
calculateDirectionAfterCollision
( local  particle)
virtual void copyAttributesTo ( PUAffector affector)
overridevirtual

Reimplemented from PUBaseCollider.

var copyAttributesTo ( var  affector)
overridevirtual

Reimplemented from PUBaseCollider.

local copyAttributesTo ( local  affector)
overridevirtual

Reimplemented from PUBaseCollider.

static PUBoxCollider* create ( )
static
var create ( )
static
local create ( )
static
const float getDepth ( ) const

Returns the depth of the box.

var getDepth ( )

Returns the depth of the box.

local getDepth ( )

Returns the depth of the box.

const float getHeight ( ) const

Returns the height of the box.

var getHeight ( )

Returns the height of the box.

local getHeight ( )

Returns the height of the box.

const float getWidth ( ) const

Returns the width of the box.

var getWidth ( )

Returns the width of the box.

local getWidth ( )

Returns the width of the box.

bool isInnerCollision ( ) const

Returns indication whether the collision is inside or outside of the box.

Remarks
If value is true, the collision is inside of the box.
var isInnerCollision ( )

Returns indication whether the collision is inside or outside of the box.

Remarks
If value is true, the collision is inside of the box.
local isInnerCollision ( )

Returns indication whether the collision is inside or outside of the box.

Remarks
If value is true, the collision is inside of the box.
bool isSmallestValue ( float  value,
const Vec3 particlePosition 
)
protected
var isSmallestValue ( var  value,
var  particlePosition 
)
protected
local isSmallestValue ( local  value,
local  particlePosition 
)
protected
virtual void preUpdateAffector ( float  deltaTime)
overridevirtual

Reimplemented from PUBaseCollider.

var preUpdateAffector ( var  deltaTime)
overridevirtual

Reimplemented from PUBaseCollider.

local preUpdateAffector ( local  deltaTime)
overridevirtual

Reimplemented from PUBaseCollider.

void setDepth ( const float  depth)

Sets the depth of the box.

var setDepth ( var  depth)

Sets the depth of the box.

local setDepth ( local  depth)

Sets the depth of the box.

void setHeight ( const float  height)

Sets the height of the box.

var setHeight ( var  height)

Sets the height of the box.

local setHeight ( local  height)

Sets the height of the box.

void setInnerCollision ( bool  innerCollision)

Set indication whether the collision is inside or outside of the box.

Remarks
If value is set to true, the collision is inside of the box.
var setInnerCollision ( var  innerCollision)

Set indication whether the collision is inside or outside of the box.

Remarks
If value is set to true, the collision is inside of the box.
local setInnerCollision ( local  innerCollision)

Set indication whether the collision is inside or outside of the box.

Remarks
If value is set to true, the collision is inside of the box.
void setWidth ( const float  width)

Sets the width of the box.

var setWidth ( var  width)

Sets the width of the box.

local setWidth ( local  width)

Sets the width of the box.

virtual void updatePUAffector ( PUParticle3D particle,
float  deltaTime 
)
overridevirtual

Reimplemented from PUAffector.

var updatePUAffector ( var  particle,
var  deltaTime 
)
overridevirtual

Reimplemented from PUAffector.

local updatePUAffector ( local  particle,
local  deltaTime 
)
overridevirtual

Reimplemented from PUAffector.

Member Data Documentation

var __pad0__
local __pad0__
AABB _box
protected
var _box
protected
local _box
protected
float _depth
protected
var _depth
protected
local _depth
protected
float _height
protected
var _height
protected
local _height
protected
bool _innerCollision
protected
var _innerCollision
protected
local _innerCollision
protected
Vec3 _predictedPosition
protected
var _predictedPosition
protected
local _predictedPosition
protected
float _width
protected
var _width
protected
local _width
protected
float _xmax
protected
var _xmax
protected
local _xmax
protected
float _xmin
protected
var _xmin
protected
local _xmin
protected
float _ymax
protected
var _ymax
protected
local _ymax
protected
float _ymin
protected
var _ymin
protected
local _ymin
protected
float _zmax
protected
var _zmax
protected
local _zmax
protected
float _zmin
protected
var _zmin
protected
local _zmin
protected
const float DEFAULT_DEPTH
static
var DEFAULT_DEPTH
static
local DEFAULT_DEPTH
static
const float DEFAULT_HEIGHT
static
var DEFAULT_HEIGHT
static
local DEFAULT_HEIGHT
static
const float DEFAULT_WIDTH
static
var DEFAULT_WIDTH
static
local DEFAULT_WIDTH
static

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