Box2D  3.0.0
A Real-Time-Oriented 2-D Physics Engine
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Friends | List of all members
box2d::Joint Class Referenceabstract

Base Joint class. More...

#include <Joint.hpp>

Inheritance diagram for box2d::Joint:
box2d::DistanceJoint box2d::FrictionJoint box2d::GearJoint box2d::MotorJoint box2d::MouseJoint box2d::PrismaticJoint box2d::PulleyJoint box2d::RevoluteJoint box2d::RopeJoint box2d::WeldJoint box2d::WheelJoint

Public Types

enum  LimitState { e_inactiveLimit, e_atLowerLimit, e_atUpperLimit, e_equalLimits }
 
using index_t = size_t
 

Public Member Functions

JointType GetType () const noexcept
 Get the type of the concrete joint. More...
 
BodyGetBodyA () noexcept
 Get the first body attached to this joint. More...
 
BodyGetBodyB () noexcept
 Get the second body attached to this joint. More...
 
const BodyGetBodyA () const noexcept
 Get the first body attached to this joint. More...
 
const BodyGetBodyB () const noexcept
 Get the second body attached to this joint. More...
 
virtual Length2D GetAnchorA () const =0
 Get the anchor point on bodyA in world coordinates. More...
 
virtual Length2D GetAnchorB () const =0
 Get the anchor point on bodyB in world coordinates. More...
 
virtual Force2D GetReactionForce (Frequency inv_dt) const =0
 Get the reaction force on bodyB at the joint anchor in Newtons. More...
 
virtual Torque GetReactionTorque (Frequency inv_dt) const =0
 Get the reaction torque on bodyB in N*m. More...
 
void * GetUserData () const noexcept
 Get the user data pointer. More...
 
void SetUserData (void *data) noexcept
 Set the user data pointer. More...
 
bool GetCollideConnected () const noexcept
 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. More...
 
virtual void ShiftOrigin (const Length2D newOrigin)
 Shift the origin for any points stored in world coordinates. More...
 

Static Public Member Functions

static bool IsOkay (const JointDef &def) noexcept
 

Protected Member Functions

 Joint (const JointDef &def)
 
virtual ~Joint () noexcept
 
void SetBodyA (Body *value) noexcept
 
void SetBodyB (Body *value) noexcept
 

Friends

class JointAtty
 

Detailed Description

Base Joint class.

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

Member Typedef Documentation

◆ index_t

Member Enumeration Documentation

◆ LimitState

Enumerator
e_inactiveLimit 
e_atLowerLimit 
e_atUpperLimit 
e_equalLimits 

Constructor & Destructor Documentation

◆ Joint()

box2d::Joint::Joint ( const JointDef def)
protected

◆ ~Joint()

virtual box2d::Joint::~Joint ( )
inlineprotectedvirtualnoexcept

Member Function Documentation

◆ GetAnchorA()

virtual Length2D box2d::Joint::GetAnchorA ( ) const
pure virtual

◆ GetAnchorB()

virtual Length2D box2d::Joint::GetAnchorB ( ) const
pure virtual

◆ GetBodyA() [1/2]

Body * box2d::Joint::GetBodyA ( )
inlinenoexcept

Get the first body attached to this joint.

◆ GetBodyA() [2/2]

const Body * box2d::Joint::GetBodyA ( ) const
inlinenoexcept

Get the first body attached to this joint.

◆ GetBodyB() [1/2]

Body * box2d::Joint::GetBodyB ( )
inlinenoexcept

Get the second body attached to this joint.

◆ GetBodyB() [2/2]

const Body * box2d::Joint::GetBodyB ( ) const
inlinenoexcept

Get the second body attached to this joint.

◆ GetCollideConnected()

bool box2d::Joint::GetCollideConnected ( ) const
inlinenoexcept

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.

◆ GetReactionForce()

virtual Force2D box2d::Joint::GetReactionForce ( Frequency  inv_dt) const
pure virtual

◆ GetReactionTorque()

virtual Torque box2d::Joint::GetReactionTorque ( Frequency  inv_dt) const
pure virtual

◆ GetType()

JointType box2d::Joint::GetType ( ) const
inlinenoexcept

Get the type of the concrete joint.

◆ GetUserData()

void * box2d::Joint::GetUserData ( ) const
inlinenoexcept

Get the user data pointer.

◆ IsOkay()

bool box2d::Joint::IsOkay ( const JointDef def)
staticnoexcept

◆ SetBodyA()

void box2d::Joint::SetBodyA ( Body value)
inlineprotectednoexcept

◆ SetBodyB()

void box2d::Joint::SetBodyB ( Body value)
inlineprotectednoexcept

◆ SetUserData()

void box2d::Joint::SetUserData ( void *  data)
inlinenoexcept

Set the user data pointer.

◆ ShiftOrigin()

virtual void box2d::Joint::ShiftOrigin ( const Length2D  newOrigin)
inlinevirtual

Shift the origin for any points stored in world coordinates.

Reimplemented in box2d::MouseJoint, and box2d::PulleyJoint.

Friends And Related Function Documentation

◆ JointAtty

friend class JointAtty
friend

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