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.
 
 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_motorJoint , b2_mouseJoint , b2_prismaticJoint ,
  b2_revoluteJoint , b2_weldJoint , b2_wheelJoint
}
 Joint type enumeration. More...
 

Functions

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

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.