Box2D 3.1.0
A 2D physics engine for games
 
Loading...
Searching...
No Matches
Joint

Joints allow you to connect rigid bodies together while allowing various forms of relative motions. More...

Collaboration diagram for Joint:

Topics

 Distance Joint
 Functions for the distance joint.
 
 Motor Joint
 Functions for the motor joint.
 
 Mouse Joint
 Functions for the mouse joint.
 
 Filter Joint
 Functions for the filter joint.
 
 Prismatic Joint
 A prismatic joint allows for translation along a single axis with no rotation.
 
 Revolute Joint
 A revolute joint allows for relative rotation in the 2D plane with no relative translation.
 
 Weld Joint
 A weld joint fully constrains the relative transform between two bodies while allowing for springiness.
 
 Wheel Joint
 The wheel joint can be used to simulate wheels on vehicles.
 

Enumerations

enum  b2JointType {
  b2_distanceJoint , b2_filterJoint , b2_motorJoint , b2_mouseJoint ,
  b2_prismaticJoint , b2_revoluteJoint , b2_weldJoint , b2_wheelJoint
}
 Joint type enumeration. More...
 

Functions

B2_API void b2DestroyJoint (b2JointId jointId)
 Destroy a joint.
 
B2_API bool b2Joint_IsValid (b2JointId id)
 Joint identifier validation. Provides validation for up to 64K allocations.
 
B2_API b2JointType b2Joint_GetType (b2JointId jointId)
 Get the joint type.
 
B2_API b2BodyId b2Joint_GetBodyA (b2JointId jointId)
 Get body A id on a joint.
 
B2_API b2BodyId b2Joint_GetBodyB (b2JointId jointId)
 Get body B id on a joint.
 
B2_API b2WorldId b2Joint_GetWorld (b2JointId jointId)
 Get the world that owns this joint.
 
B2_API b2Vec2 b2Joint_GetLocalAnchorA (b2JointId jointId)
 Get the local anchor on bodyA.
 
B2_API b2Vec2 b2Joint_GetLocalAnchorB (b2JointId jointId)
 Get the local anchor on bodyB.
 
B2_API void b2Joint_SetCollideConnected (b2JointId jointId, bool shouldCollide)
 Toggle collision between connected bodies.
 
B2_API bool b2Joint_GetCollideConnected (b2JointId jointId)
 Is collision allowed between connected bodies?
 
B2_API void b2Joint_SetUserData (b2JointId jointId, void *userData)
 Set the user data on a joint.
 
B2_API void * b2Joint_GetUserData (b2JointId jointId)
 Get the user data on a joint.
 
B2_API void b2Joint_WakeBodies (b2JointId jointId)
 Wake the bodies connect to this joint.
 
B2_API b2Vec2 b2Joint_GetConstraintForce (b2JointId jointId)
 Get the current constraint force for this joint. Usually in Newtons.
 
B2_API float b2Joint_GetConstraintTorque (b2JointId jointId)
 Get the current constraint torque for this joint. Usually in Newton * meters.
 

Detailed Description

Joints allow you to connect rigid bodies together while allowing various forms of relative motions.

Enumeration Type Documentation

◆ b2JointType

Joint type enumeration.

This is useful because all joint types use b2JointId and sometimes you want to get the type of a joint.