Cocos2d-x  v3.17
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Groups Pages
PhysicsJoint Class Referenceabstract

An PhysicsJoint object connects two physics bodies together. More...

Inherited by PhysicsJointDistance, PhysicsJointFixed, PhysicsJointGear, PhysicsJointGroove, PhysicsJointLimit, PhysicsJointMotor, PhysicsJointPin, PhysicsJointRatchet, PhysicsJointRotaryLimit, PhysicsJointRotarySpring, and PhysicsJointSpring.

Public Member Functions

PhysicsBodygetBodyA () const
 Get physics body a connected to this joint. More...
 
PhysicsBodygetBodyB () const
 Get physics body b connected to this joint. More...
 
local getBodyB ()
 Get physics body b connected to this joint. More...
 
PhysicsWorldgetWorld () const
 Get the physics world. More...
 
local getWorld ()
 Get the physics world. More...
 
int getTag () const
 Get this joint's tag. More...
 
local getTag ()
 Get this joint's tag. More...
 
void setTag (int tag)
 Set this joint's tag. More...
 
var setTag ( var tag)
 Set this joint's tag. More...
 
local setTag ( local tag)
 Set this joint's tag. More...
 
bool isEnabled () const
 Determines if the joint is enable. More...
 
local isEnabled ()
 Determines if the joint is enable. More...
 
void setEnable (bool enable)
 Enable/Disable the joint. More...
 
local setEnable ( local enable)
 Enable/Disable the joint. More...
 
bool isCollisionEnabled () const
 Determines if the collision is enable. More...
 
local isCollisionEnabled ()
 Determines if the collision is enable. More...
 
void setCollisionEnable (bool enable)
 Enable/disable the collision between two bodies. More...
 
local setCollisionEnable ( local enable)
 Enable/disable the collision between two bodies. More...
 
void removeFormWorld ()
 Remove the joint from the world. More...
 
local removeFormWorld ()
 Remove the joint from the world. More...
 
void setMaxForce (float force)
 Set the max force between two bodies. More...
 
local setMaxForce ( local force)
 Set the max force between two bodies. More...
 
float getMaxForce () const
 Get the max force setting. More...
 

Detailed Description

An PhysicsJoint object connects two physics bodies together.

Member Function Documentation

PhysicsBody* getBodyA ( ) const
inline

Get physics body a connected to this joint.

var getBodyA ( )
inline

Get physics body a connected to this joint.

local getBodyA ( )
inline

Get physics body a connected to this joint.

PhysicsBody* getBodyB ( ) const
inline

Get physics body b connected to this joint.

var getBodyB ( )
inline

Get physics body b connected to this joint.

local getBodyB ( )
inline

Get physics body b connected to this joint.

PhysicsWorld* getWorld ( ) const
inline

Get the physics world.

var getWorld ( )
inline

Get the physics world.

local getWorld ( )
inline

Get the physics world.

int getTag ( ) const
inline

Get this joint's tag.

Returns
An integer number.
var getTag ( )
inline

Get this joint's tag.

Returns
An integer number.
local getTag ( )
inline

Get this joint's tag.

Returns
An integer number.
void setTag ( int  tag)
inline

Set this joint's tag.

Parameters
tagAn integer number that identifies a PhysicsJoint.
var setTag ( var  tag)
inline

Set this joint's tag.

Parameters
tagAn integer number that identifies a PhysicsJoint.
local setTag ( local  tag)
inline

Set this joint's tag.

Parameters
tagAn integer number that identifies a PhysicsJoint.
bool isEnabled ( ) const
inline

Determines if the joint is enable.

var isEnabled ( )
inline

Determines if the joint is enable.

local isEnabled ( )
inline

Determines if the joint is enable.

void setEnable ( bool  enable)

Enable/Disable the joint.

var setEnable ( var  enable)

Enable/Disable the joint.

local setEnable ( local  enable)

Enable/Disable the joint.

bool isCollisionEnabled ( ) const
inline

Determines if the collision is enable.

var isCollisionEnabled ( )
inline

Determines if the collision is enable.

local isCollisionEnabled ( )
inline

Determines if the collision is enable.

void setCollisionEnable ( bool  enable)

Enable/disable the collision between two bodies.

var setCollisionEnable ( var  enable)

Enable/disable the collision between two bodies.

local setCollisionEnable ( local  enable)

Enable/disable the collision between two bodies.

void removeFormWorld ( )

Remove the joint from the world.

var removeFormWorld ( )

Remove the joint from the world.

local removeFormWorld ( )

Remove the joint from the world.

void setMaxForce ( float  force)

Set the max force between two bodies.

var setMaxForce ( var  force)

Set the max force between two bodies.

local setMaxForce ( local  force)

Set the max force between two bodies.

float getMaxForce ( ) const
inline

Get the max force setting.

var getMaxForce ( )
inline

Get the max force setting.

local getMaxForce ( )
inline

Get the max force setting.


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