# b2Joint Class Reference

`#include <b2Joint.h>`

Inheritance diagram for b2Joint:

List of all members.

## Public Member Functions
b2JointType | GetType () const
| Get the type of the concrete joint.
b2Body * | GetBodyA ()
| Get the first body attached to this joint.
b2Body * | GetBodyB ()
| Get the second body attached to this joint.
virtual b2Vec2 | GetAnchorA () const =0
| Get the anchor point on bodyA in world coordinates.
virtual b2Vec2 | GetAnchorB () const =0
| Get the anchor point on bodyB in world coordinates.
virtual b2Vec2 | GetReactionForce (float32 inv_dt) const =0
| Get the reaction force on body2 at the joint anchor in Newtons.
virtual float32 | GetReactionTorque (float32 inv_dt) const =0
| Get the reaction torque on body2 in N*m.
b2Joint * | GetNext ()
| Get the next joint the world joint list.
void * | GetUserData () const
| Get the user data pointer.
void | SetUserData (void *data)
| Set the user data pointer.
bool | IsActive () const
| Short-cut function to determine if either body is inactive.
## Protected Member Functions
| b2Joint (const b2JointDef *def)
virtual | ~b2Joint ()
virtual void | InitVelocityConstraints (const b2TimeStep &step)=0
virtual void | SolveVelocityConstraints (const b2TimeStep &step)=0
virtual bool | SolvePositionConstraints (float32 baumgarte)=0
## Static Protected Member Functions
static b2Joint * | Create (const b2JointDef *def, b2BlockAllocator *allocator)
static void | Destroy (b2Joint *joint, b2BlockAllocator *allocator)
## Protected Attributes
b2JointType | m_type
b2Joint * | m_prev
b2Joint * | m_next
b2JointEdge | m_edgeA
b2JointEdge | m_edgeB
b2Body * | m_bodyA
b2Body * | m_bodyB
bool | m_islandFlag
bool | m_collideConnected
void * | m_userData
b2Vec2 | m_localCenterA
b2Vec2 | m_localCenterB
float32 | m_invMassA
float32 | m_invIA
float32 | m_invMassB
float32 | m_invIB
## Friends
class | b2World
class | b2Body
class | b2Island

## Detailed Description

The base joint class. Joints are used to constraint two bodies together in various fashions. Some joints also feature limits and motors.

## Constructor & Destructor Documentation

b2Joint::b2Joint | ( | const b2JointDef * | def | ) | `[protected]`

virtual b2Joint::~b2Joint | ( |  | ) | `[inline, protected, virtual]`

## Member Function Documentation

b2Joint * b2Joint::Create | ( | const b2JointDef * | def,
|  | b2BlockAllocator * | allocator |
| ) |  |  | `[static, protected]`

void b2Joint::Destroy | ( | b2Joint * | joint,
|  | b2BlockAllocator * | allocator |
| ) |  |  | `[static, protected]`

virtual b2Vec2 b2Joint::GetAnchorA | ( |  | ) | const`[pure virtual]`

Get the anchor point on bodyA in world coordinates.

Implemented in b2DistanceJoint, b2FrictionJoint, b2GearJoint, b2LineJoint, b2MouseJoint, b2PrismaticJoint, b2PulleyJoint, b2RevoluteJoint, and b2WeldJoint.

virtual b2Vec2 b2Joint::GetAnchorB | ( |  | ) | const`[pure virtual]`

Get the anchor point on bodyB in world coordinates.

Implemented in b2DistanceJoint, b2FrictionJoint, b2GearJoint, b2LineJoint, b2MouseJoint, b2PrismaticJoint, b2PulleyJoint, b2RevoluteJoint, and b2WeldJoint.

b2Body * b2Joint::GetBodyA | ( |  | ) | `[inline]`

Get the first body attached to this joint.

b2Body * b2Joint::GetBodyB | ( |  | ) | `[inline]`

Get the second body attached to this joint.

b2Joint * b2Joint::GetNext | ( |  | ) | `[inline]`

Get the next joint the world joint list.

virtual b2Vec2 b2Joint::GetReactionForce | ( | float32 | inv_dt | ) | const`[pure virtual]`

Get the reaction force on body2 at the joint anchor in Newtons.

Implemented in b2DistanceJoint, b2FrictionJoint, b2GearJoint, b2LineJoint, b2MouseJoint, b2PrismaticJoint, b2PulleyJoint, b2RevoluteJoint, and b2WeldJoint.

virtual float32 b2Joint::GetReactionTorque | ( | float32 | inv_dt | ) | const`[pure virtual]`

Get the reaction torque on body2 in N*m.

Implemented in b2DistanceJoint, b2FrictionJoint, b2GearJoint, b2LineJoint, b2MouseJoint, b2PrismaticJoint, b2PulleyJoint, b2RevoluteJoint, and b2WeldJoint.

b2JointType b2Joint::GetType | ( |  | ) | const`[inline]`

Get the type of the concrete joint.

void * b2Joint::GetUserData | ( |  | ) | const`[inline]`

Get the user data pointer.

virtual void b2Joint::InitVelocityConstraints | ( | const b2TimeStep & | step | ) | `[protected, pure virtual]`

Implemented in b2DistanceJoint, b2FrictionJoint, b2GearJoint, b2LineJoint, b2MouseJoint, b2PrismaticJoint, b2PulleyJoint, b2RevoluteJoint, and b2WeldJoint.

bool b2Joint::IsActive | ( |  | ) | const

Short-cut function to determine if either body is inactive.

void b2Joint::SetUserData | ( | void * | data | ) | `[inline]`

Set the user data pointer.

virtual bool b2Joint::SolvePositionConstraints | ( | float32 | baumgarte | ) | `[protected, pure virtual]`

Implemented in b2DistanceJoint, b2FrictionJoint, b2GearJoint, b2LineJoint, b2MouseJoint, b2PrismaticJoint, b2PulleyJoint, b2RevoluteJoint, and b2WeldJoint.

virtual void b2Joint::SolveVelocityConstraints | ( | const b2TimeStep & | step | ) | `[protected, pure virtual]`

Implemented in b2DistanceJoint, b2FrictionJoint, b2GearJoint, b2LineJoint, b2MouseJoint, b2PrismaticJoint, b2PulleyJoint, b2RevoluteJoint, and b2WeldJoint.

## Friends And Related Function Documentation

friend class b2Body`[friend]`

friend class b2Island`[friend]`

friend class b2World`[friend]`

## Member Data Documentation

b2Body* b2Joint::m_bodyA`[protected]`

b2Body* b2Joint::m_bodyB`[protected]`

bool b2Joint::m_collideConnected`[protected]`

b2JointEdge b2Joint::m_edgeA`[protected]`

b2JointEdge b2Joint::m_edgeB`[protected]`

float32 b2Joint::m_invIA`[protected]`

float32 b2Joint::m_invIB`[protected]`

float32 b2Joint::m_invMassA`[protected]`

float32 b2Joint::m_invMassB`[protected]`

bool b2Joint::m_islandFlag`[protected]`

b2Vec2 b2Joint::m_localCenterA`[protected]`

b2Vec2 b2Joint::m_localCenterB`[protected]`

b2Joint* b2Joint::m_next`[protected]`

b2Joint* b2Joint::m_prev`[protected]`

b2JointType b2Joint::m_type`[protected]`

void* b2Joint::m_userData`[protected]`

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

- Box2D/Box2D/Dynamics/Joints/b2Joint.h
- Box2D/Box2D/Dynamics/Joints/b2Joint.cpp