Public Member Functions | Protected Member Functions | Static Protected Member Functions | Protected Attributes | Friends | List of all members
b2Joint Class Referenceabstract

#include <b2_joint.h>

Inheritance diagram for b2Joint:
Inheritance graph
[legend]

Public Member Functions

virtual void Draw (b2Draw *draw) const
 Debug draw this joint. More...
 
virtual void Dump ()
 Dump this joint to the log file. More...
 
virtual b2Vec2 GetAnchorA () const =0
 Get the anchor point on bodyA in world coordinates. More...
 
virtual b2Vec2 GetAnchorB () const =0
 Get the anchor point on bodyB in world coordinates. More...
 
b2BodyGetBodyA ()
 Get the first body attached to this joint. More...
 
b2BodyGetBodyB ()
 Get the second body attached to this joint. More...
 
bool GetCollideConnected () const
 
b2JointGetNext ()
 Get the next joint the world joint list. More...
 
const b2JointGetNext () const
 
virtual b2Vec2 GetReactionForce (float inv_dt) const =0
 Get the reaction force on bodyB at the joint anchor in Newtons. More...
 
virtual float GetReactionTorque (float inv_dt) const =0
 Get the reaction torque on bodyB in N*m. More...
 
b2JointType GetType () const
 Get the type of the concrete joint. More...
 
b2JointUserDataGetUserData ()
 Get the user data pointer. More...
 
bool IsEnabled () const
 Short-cut function to determine if either body is enabled. More...
 
virtual void ShiftOrigin (const b2Vec2 &newOrigin)
 Shift the origin for any points stored in world coordinates. More...
 

Protected Member Functions

 b2Joint (const b2JointDef *def)
 
virtual void InitVelocityConstraints (const b2SolverData &data)=0
 
virtual bool SolvePositionConstraints (const b2SolverData &data)=0
 
virtual void SolveVelocityConstraints (const b2SolverData &data)=0
 
virtual ~b2Joint ()
 

Static Protected Member Functions

static b2JointCreate (const b2JointDef *def, b2BlockAllocator *allocator)
 
static void Destroy (b2Joint *joint, b2BlockAllocator *allocator)
 

Protected Attributes

b2Bodym_bodyA
 
b2Bodym_bodyB
 
bool m_collideConnected
 
b2JointEdge m_edgeA
 
b2JointEdge m_edgeB
 
int32 m_index
 
bool m_islandFlag
 
b2Jointm_next
 
b2Jointm_prev
 
b2JointType m_type
 
b2JointUserData m_userData
 

Friends

class b2Body
 
class b2GearJoint
 
class b2Island
 
class b2World
 

Detailed Description

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

Definition at line 110 of file b2_joint.h.

Constructor & Destructor Documentation

◆ b2Joint()

b2Joint::b2Joint ( const b2JointDef def)
protected

Definition at line 225 of file b2_joint.cpp.

◆ ~b2Joint()

virtual b2Joint::~b2Joint ( )
inlineprotectedvirtual

Definition at line 169 of file b2_joint.h.

Member Function Documentation

◆ Create()

b2Joint * b2Joint::Create ( const b2JointDef def,
b2BlockAllocator allocator 
)
staticprotected

Definition at line 90 of file b2_joint.cpp.

◆ Destroy()

void b2Joint::Destroy ( b2Joint joint,
b2BlockAllocator allocator 
)
staticprotected

Definition at line 174 of file b2_joint.cpp.

◆ Draw()

void b2Joint::Draw ( b2Draw draw) const
virtual

Debug draw this joint.

Reimplemented in b2WheelJoint, b2RevoluteJoint, b2PrismaticJoint, and b2DistanceJoint.

Definition at line 255 of file b2_joint.cpp.

◆ Dump()

virtual void b2Joint::Dump ( )
inlinevirtual

Dump this joint to the log file.

Reimplemented in b2WheelJoint, b2RevoluteJoint, b2PrismaticJoint, b2DistanceJoint, b2PulleyJoint, b2MotorJoint, b2MouseJoint, b2WeldJoint, b2FrictionJoint, and b2GearJoint.

Definition at line 151 of file b2_joint.h.

◆ GetAnchorA()

virtual b2Vec2 b2Joint::GetAnchorA ( ) const
pure virtual

Get the anchor point on bodyA in world coordinates.

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

◆ GetAnchorB()

virtual b2Vec2 b2Joint::GetAnchorB ( ) const
pure virtual

Get the anchor point on bodyB in world coordinates.

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

◆ GetBodyA()

b2Body * b2Joint::GetBodyA ( )
inline

Get the first body attached to this joint.

Definition at line 198 of file b2_joint.h.

◆ GetBodyB()

b2Body * b2Joint::GetBodyB ( )
inline

Get the second body attached to this joint.

Definition at line 203 of file b2_joint.h.

◆ GetCollideConnected()

bool b2Joint::GetCollideConnected ( ) const
inline

Get collide connected. Note: modifying the collide connect flag won't work correctly because the flag is only checked when fixture AABBs begin to overlap.

Definition at line 223 of file b2_joint.h.

◆ GetNext() [1/2]

b2Joint * b2Joint::GetNext ( )
inline

Get the next joint the world joint list.

Definition at line 208 of file b2_joint.h.

◆ GetNext() [2/2]

const b2Joint * b2Joint::GetNext ( ) const
inline

Definition at line 213 of file b2_joint.h.

◆ GetReactionForce()

virtual b2Vec2 b2Joint::GetReactionForce ( float  inv_dt) const
pure virtual

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

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

◆ GetReactionTorque()

virtual float b2Joint::GetReactionTorque ( float  inv_dt) const
pure virtual

◆ GetType()

b2JointType b2Joint::GetType ( ) const
inline

Get the type of the concrete joint.

Definition at line 193 of file b2_joint.h.

◆ GetUserData()

b2JointUserData & b2Joint::GetUserData ( )
inline

Get the user data pointer.

Definition at line 218 of file b2_joint.h.

◆ InitVelocityConstraints()

virtual void b2Joint::InitVelocityConstraints ( const b2SolverData data)
protectedpure virtual

◆ IsEnabled()

bool b2Joint::IsEnabled ( ) const

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

Definition at line 250 of file b2_joint.cpp.

◆ ShiftOrigin()

virtual void b2Joint::ShiftOrigin ( const b2Vec2 newOrigin)
inlinevirtual

Shift the origin for any points stored in world coordinates.

Reimplemented in b2PulleyJoint, and b2MouseJoint.

Definition at line 154 of file b2_joint.h.

◆ SolvePositionConstraints()

virtual bool b2Joint::SolvePositionConstraints ( const b2SolverData data)
protectedpure virtual

◆ SolveVelocityConstraints()

virtual void b2Joint::SolveVelocityConstraints ( const b2SolverData data)
protectedpure virtual

Friends And Related Function Documentation

◆ b2Body

friend class b2Body
friend

Definition at line 161 of file b2_joint.h.

◆ b2GearJoint

friend class b2GearJoint
friend

Definition at line 163 of file b2_joint.h.

◆ b2Island

friend class b2Island
friend

Definition at line 162 of file b2_joint.h.

◆ b2World

friend class b2World
friend

Definition at line 160 of file b2_joint.h.

Member Data Documentation

◆ m_bodyA

b2Body* b2Joint::m_bodyA
protected

Definition at line 182 of file b2_joint.h.

◆ m_bodyB

b2Body* b2Joint::m_bodyB
protected

Definition at line 183 of file b2_joint.h.

◆ m_collideConnected

bool b2Joint::m_collideConnected
protected

Definition at line 188 of file b2_joint.h.

◆ m_edgeA

b2JointEdge b2Joint::m_edgeA
protected

Definition at line 180 of file b2_joint.h.

◆ m_edgeB

b2JointEdge b2Joint::m_edgeB
protected

Definition at line 181 of file b2_joint.h.

◆ m_index

int32 b2Joint::m_index
protected

Definition at line 185 of file b2_joint.h.

◆ m_islandFlag

bool b2Joint::m_islandFlag
protected

Definition at line 187 of file b2_joint.h.

◆ m_next

b2Joint* b2Joint::m_next
protected

Definition at line 179 of file b2_joint.h.

◆ m_prev

b2Joint* b2Joint::m_prev
protected

Definition at line 178 of file b2_joint.h.

◆ m_type

b2JointType b2Joint::m_type
protected

Definition at line 177 of file b2_joint.h.

◆ m_userData

b2JointUserData b2Joint::m_userData
protected

Definition at line 190 of file b2_joint.h.


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


mvsim
Author(s):
autogenerated on Tue Jul 4 2023 03:08:22