cocos2d-x  3.3
 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...
 

Static Public Member Functions

static void destroy (PhysicsJoint *joint)
 Distory the joint. More...
 

Protected Member Functions

 PhysicsJoint ()
 
virtual ~PhysicsJoint ()=0
 
bool init (PhysicsBody *a, PhysicsBody *b)
 
PhysicsBodyInfogetBodyInfo (PhysicsBody *body) const
 PhysicsShape is PhysicsBody's friend class, but all the subclasses isn't. More...
 
NodegetBodyNode (PhysicsBody *body) const
 

Protected Attributes

PhysicsBody_bodyA
 
PhysicsBody_bodyB
 
PhysicsWorld_world
 
PhysicsJointInfo_info
 
bool _enable
 
bool _collisionEnable
 
bool _destoryMark
 
int _tag
 

Friends

class PhysicsBody
 
class PhysicsWorld
 
class PhysicsDebugDraw
 

Constructor & Destructor Documentation

PhysicsJoint ( )
protected
virtual ~PhysicsJoint ( )
protectedpure virtual

Member Function Documentation

static void destroy ( PhysicsJoint joint)
static

Distory the joint.

PhysicsBody* getBodyA ( ) const
inline
PhysicsBody* getBodyB ( ) const
inline
PhysicsBodyInfo* getBodyInfo ( PhysicsBody body) const
protected

PhysicsShape is PhysicsBody's friend class, but all the subclasses isn't.

so this method is use for subclasses to catch the bodyInfo from PhysicsBody.

Node* getBodyNode ( PhysicsBody body) const
protected
float getMaxForce ( ) const

Get the max force setting.

int getTag ( ) const
inline
PhysicsWorld* getWorld ( ) const
inline
bool init ( PhysicsBody a,
PhysicsBody b 
)
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
bool _destoryMark
protected
bool _enable
protected
PhysicsJointInfo* _info
protected
int _tag
protected
PhysicsWorld* _world
protected

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