Box2D  3.0.0
A Real-Time-Oriented 2-D Physics Engine
Public Member Functions | Static Public Member Functions | List of all members
box2d::DistanceJoint Class Reference

Distance Joint. More...

#include <DistanceJoint.hpp>

Inheritance diagram for box2d::DistanceJoint:
box2d::Joint

Public Member Functions

 DistanceJoint (const DistanceJointDef &data)
 
Length2D GetAnchorA () const override
 Get the anchor point on bodyA in world coordinates. More...
 
Length2D GetAnchorB () const override
 Get the anchor point on bodyB in world coordinates. More...
 
Force2D GetReactionForce (Frequency inv_dt) const override
 Get the reaction force given the inverse time step. Unit is N. More...
 
Torque GetReactionTorque (Frequency inv_dt) const override
 Get the reaction torque given the inverse time step. Unit is N*m. This is always zero for a distance joint. More...
 
Length2D GetLocalAnchorA () const noexcept
 The local anchor point relative to bodyA's origin. More...
 
Length2D GetLocalAnchorB () const noexcept
 The local anchor point relative to bodyB's origin. More...
 
void SetLength (Length length) noexcept
 Set/get the natural length. Manipulating the length can lead to non-physical behavior when the frequency is zero. More...
 
Length GetLength () const noexcept
 
void SetFrequency (Frequency hz) noexcept
 Set/get frequency in Hz. More...
 
Frequency GetFrequency () const noexcept
 
void SetDampingRatio (RealNum ratio) noexcept
 Set/get damping ratio. More...
 
RealNum GetDampingRatio () const noexcept
 
- Public Member Functions inherited from box2d::Joint
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...
 
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 DistanceJointDef &data) noexcept
 
- Static Public Member Functions inherited from box2d::Joint
static bool IsOkay (const JointDef &def) noexcept
 

Additional Inherited Members

- Public Types inherited from box2d::Joint
enum  LimitState { e_inactiveLimit, e_atLowerLimit, e_atUpperLimit, e_equalLimits }
 
using index_t = size_t
 
- Protected Member Functions inherited from box2d::Joint
 Joint (const JointDef &def)
 
virtual ~Joint () noexcept
 
void SetBodyA (Body *value) noexcept
 
void SetBodyB (Body *value) noexcept
 

Detailed Description

Distance Joint.

A distance joint constrains two points on two bodies to remain at a fixed distance from each other. You can view this as a massless, rigid rod.

Constructor & Destructor Documentation

◆ DistanceJoint()

DistanceJoint::DistanceJoint ( const DistanceJointDef data)

Member Function Documentation

◆ GetAnchorA()

Length2D DistanceJoint::GetAnchorA ( ) const
overridevirtual

Get the anchor point on bodyA in world coordinates.

Implements box2d::Joint.

◆ GetAnchorB()

Length2D DistanceJoint::GetAnchorB ( ) const
overridevirtual

Get the anchor point on bodyB in world coordinates.

Implements box2d::Joint.

◆ GetDampingRatio()

RealNum box2d::DistanceJoint::GetDampingRatio ( ) const
inlinenoexcept

◆ GetFrequency()

Frequency box2d::DistanceJoint::GetFrequency ( ) const
inlinenoexcept

◆ GetLength()

Length box2d::DistanceJoint::GetLength ( ) const
inlinenoexcept

◆ GetLocalAnchorA()

Length2D box2d::DistanceJoint::GetLocalAnchorA ( ) const
inlinenoexcept

The local anchor point relative to bodyA's origin.

◆ GetLocalAnchorB()

Length2D box2d::DistanceJoint::GetLocalAnchorB ( ) const
inlinenoexcept

The local anchor point relative to bodyB's origin.

◆ GetReactionForce()

Force2D DistanceJoint::GetReactionForce ( Frequency  inv_dt) const
overridevirtual

Get the reaction force given the inverse time step. Unit is N.

Implements box2d::Joint.

◆ GetReactionTorque()

Torque DistanceJoint::GetReactionTorque ( Frequency  inv_dt) const
overridevirtual

Get the reaction torque given the inverse time step. Unit is N*m. This is always zero for a distance joint.

Implements box2d::Joint.

◆ IsOkay()

bool DistanceJoint::IsOkay ( const DistanceJointDef data)
staticnoexcept

◆ SetDampingRatio()

void box2d::DistanceJoint::SetDampingRatio ( RealNum  ratio)
inlinenoexcept

Set/get damping ratio.

◆ SetFrequency()

void box2d::DistanceJoint::SetFrequency ( Frequency  hz)
inlinenoexcept

Set/get frequency in Hz.

◆ SetLength()

void box2d::DistanceJoint::SetLength ( Length  length)
inlinenoexcept

Set/get the natural length. Manipulating the length can lead to non-physical behavior when the frequency is zero.


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