cocos2d-x  3.4
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
PhysicsJoint Class Referenceabstract

#include <CCPhysicsJoint.h>

Inheritance diagram for PhysicsJoint:
PhysicsJointDistance PhysicsJointFixed PhysicsJointGear PhysicsJointGroove PhysicsJointLimit PhysicsJointMotor PhysicsJointPin PhysicsJointRatchet PhysicsJointRotaryLimit PhysicsJointRotarySpring PhysicsJointSpring

Public Member Functions

PhysicsBodygetBodyA () const
PhysicsBodygetBodyB () const
PhysicsWorldgetWorld () const
int getTag () const
void setTag (int tag)
bool isEnabled () const
void setEnable (bool enable)
 Enable/Disable the joint. More...
 
bool isCollisionEnabled () const
void setCollisionEnable (bool enable)
 Enable/disable the collision between two bodies. More...
 
void removeFormWorld ()
 Remove the joint from the world. More...
 
void setMaxForce (float force)
 Set the max force between two bodies. More...
 
float getMaxForce () const
 Get the max force setting. More...
 

Protected Member Functions

 PhysicsJoint ()
virtual ~PhysicsJoint ()=0
bool init (PhysicsBody *a, PhysicsBody *b)
bool initJoint ()
virtual bool createConstraints ()

Protected Attributes

std::vector< cpConstraint * > _cpConstraints
PhysicsBody_bodyA
PhysicsBody_bodyB
PhysicsWorld_world
bool _enable
bool _collisionEnable
bool _destoryMark
int _tag
float _maxForce
bool _initDirty

Friends

class PhysicsBody
class PhysicsWorld
class PhysicsDebugDraw

Constructor & Destructor Documentation

PhysicsJoint ( )
protected
virtual ~PhysicsJoint ( )
protectedpure virtual

Member Function Documentation

PhysicsBody* getBodyA ( ) const
inline
PhysicsBody* getBodyB ( ) const
inline
float getMaxForce ( ) const
inline

Get the max force setting.

int getTag ( ) const
inline
PhysicsWorld* getWorld ( ) const
inline
bool init ( PhysicsBody a,
PhysicsBody b 
)
protected
bool initJoint ( )
protected
bool isCollisionEnabled ( ) const
inline
bool isEnabled ( ) const
inline
void removeFormWorld ( )

Remove the joint from the world.

void setCollisionEnable ( bool  enable)

Enable/disable the collision between two bodies.

void setEnable ( bool  enable)

Enable/Disable the joint.

void setMaxForce ( float  force)

Set the max force between two bodies.

void setTag ( int  tag)
inline

Friends And Related Function Documentation

friend class PhysicsBody
friend
friend class PhysicsDebugDraw
friend
friend class PhysicsWorld
friend

Member Data Documentation

PhysicsBody* _bodyA
protected
PhysicsBody* _bodyB
protected
bool _collisionEnable
protected
std::vector<cpConstraint*>
_cpConstraints
protected
bool _destoryMark
protected
bool _enable
protected
bool _initDirty
protected
float _maxForce
protected
int _tag
protected
PhysicsWorld* _world
protected

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