Public Member Functions | Protected Member Functions | Protected Attributes | Friends | List of all members
b2DistanceJoint Class Reference

#include <b2_distance_joint.h>

Inheritance diagram for b2DistanceJoint:
Inheritance graph
[legend]

Public Member Functions

void Draw (b2Draw *draw) const override
 Debug draw this joint. More...
 
void Dump () override
 Dump joint to dmLog. More...
 
b2Vec2 GetAnchorA () const override
 Get the anchor point on bodyA in world coordinates. More...
 
b2Vec2 GetAnchorB () const override
 Get the anchor point on bodyB in world coordinates. More...
 
float GetCurrentLength () const
 Get the current length. More...
 
float GetDamping () const
 
float GetLength () const
 Get the rest length. More...
 
const b2Vec2GetLocalAnchorA () const
 The local anchor point relative to bodyA's origin. More...
 
const b2Vec2GetLocalAnchorB () const
 The local anchor point relative to bodyB's origin. More...
 
float GetMaxLength () const
 Get the maximum length. More...
 
float GetMinLength () const
 Get the minimum length. More...
 
b2Vec2 GetReactionForce (float inv_dt) const override
 
float GetReactionTorque (float inv_dt) const override
 
float GetStiffness () const
 
void SetDamping (float damping)
 Set/get linear damping in N*s/m. More...
 
float SetLength (float length)
 
float SetMaxLength (float maxLength)
 
float SetMinLength (float minLength)
 
void SetStiffness (float stiffness)
 Set/get the linear stiffness in N/m. More...
 
- Public Member Functions inherited from b2Joint
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
 
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

 b2DistanceJoint (const b2DistanceJointDef *data)
 
void InitVelocityConstraints (const b2SolverData &data) override
 
bool SolvePositionConstraints (const b2SolverData &data) override
 
void SolveVelocityConstraints (const b2SolverData &data) override
 
- Protected Member Functions inherited from b2Joint
 b2Joint (const b2JointDef *def)
 
virtual ~b2Joint ()
 

Protected Attributes

float m_bias
 
float m_currentLength
 
float m_damping
 
float m_gamma
 
float m_impulse
 
int32 m_indexA
 
int32 m_indexB
 
float m_invIA
 
float m_invIB
 
float m_invMassA
 
float m_invMassB
 
float m_length
 
b2Vec2 m_localAnchorA
 
b2Vec2 m_localAnchorB
 
b2Vec2 m_localCenterA
 
b2Vec2 m_localCenterB
 
float m_lowerImpulse
 
float m_mass
 
float m_maxLength
 
float m_minLength
 
b2Vec2 m_rA
 
b2Vec2 m_rB
 
float m_softMass
 
float m_stiffness
 
b2Vec2 m_u
 
float m_upperImpulse
 
- Protected Attributes inherited from b2Joint
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 b2Joint
 

Additional Inherited Members

- Static Protected Member Functions inherited from b2Joint
static b2JointCreate (const b2JointDef *def, b2BlockAllocator *allocator)
 
static void Destroy (b2Joint *joint, b2BlockAllocator *allocator)
 

Detailed Description

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.

Definition at line 76 of file b2_distance_joint.h.

Constructor & Destructor Documentation

◆ b2DistanceJoint()

b2DistanceJoint::b2DistanceJoint ( const b2DistanceJointDef data)
protected

Definition at line 57 of file b2_distance_joint.cpp.

Member Function Documentation

◆ Draw()

void b2DistanceJoint::Draw ( b2Draw draw) const
overridevirtual

Debug draw this joint.

Reimplemented from b2Joint.

Definition at line 387 of file b2_distance_joint.cpp.

◆ Dump()

void b2DistanceJoint::Dump ( )
overridevirtual

Dump joint to dmLog.

Reimplemented from b2Joint.

Definition at line 368 of file b2_distance_joint.cpp.

◆ GetAnchorA()

b2Vec2 b2DistanceJoint::GetAnchorA ( ) const
overridevirtual

Get the anchor point on bodyA in world coordinates.

Implements b2Joint.

Definition at line 316 of file b2_distance_joint.cpp.

◆ GetAnchorB()

b2Vec2 b2DistanceJoint::GetAnchorB ( ) const
overridevirtual

Get the anchor point on bodyB in world coordinates.

Implements b2Joint.

Definition at line 321 of file b2_distance_joint.cpp.

◆ GetCurrentLength()

float b2DistanceJoint::GetCurrentLength ( ) const

Get the current length.

Definition at line 359 of file b2_distance_joint.cpp.

◆ GetDamping()

float b2DistanceJoint::GetDamping ( ) const
inline

Definition at line 127 of file b2_distance_joint.h.

◆ GetLength()

float b2DistanceJoint::GetLength ( ) const
inline

Get the rest length.

Definition at line 98 of file b2_distance_joint.h.

◆ GetLocalAnchorA()

const b2Vec2& b2DistanceJoint::GetLocalAnchorA ( ) const
inline

The local anchor point relative to bodyA's origin.

Definition at line 92 of file b2_distance_joint.h.

◆ GetLocalAnchorB()

const b2Vec2& b2DistanceJoint::GetLocalAnchorB ( ) const
inline

The local anchor point relative to bodyB's origin.

Definition at line 95 of file b2_distance_joint.h.

◆ GetMaxLength()

float b2DistanceJoint::GetMaxLength ( ) const
inline

Get the maximum length.

Definition at line 112 of file b2_distance_joint.h.

◆ GetMinLength()

float b2DistanceJoint::GetMinLength ( ) const
inline

Get the minimum length.

Definition at line 105 of file b2_distance_joint.h.

◆ GetReactionForce()

b2Vec2 b2DistanceJoint::GetReactionForce ( float  inv_dt) const
overridevirtual

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

Implements b2Joint.

Definition at line 326 of file b2_distance_joint.cpp.

◆ GetReactionTorque()

float b2DistanceJoint::GetReactionTorque ( float  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 b2Joint.

Definition at line 332 of file b2_distance_joint.cpp.

◆ GetStiffness()

float b2DistanceJoint::GetStiffness ( ) const
inline

Definition at line 123 of file b2_distance_joint.h.

◆ InitVelocityConstraints()

void b2DistanceJoint::InitVelocityConstraints ( const b2SolverData data)
overrideprotectedvirtual

Implements b2Joint.

Definition at line 76 of file b2_distance_joint.cpp.

◆ SetDamping()

void b2DistanceJoint::SetDamping ( float  damping)
inline

Set/get linear damping in N*s/m.

Definition at line 126 of file b2_distance_joint.h.

◆ SetLength()

float b2DistanceJoint::SetLength ( float  length)

Set the rest length

Returns
clamped rest length

Definition at line 338 of file b2_distance_joint.cpp.

◆ SetMaxLength()

float b2DistanceJoint::SetMaxLength ( float  maxLength)

Set the maximum length

Returns
the clamped maximum length

Definition at line 352 of file b2_distance_joint.cpp.

◆ SetMinLength()

float b2DistanceJoint::SetMinLength ( float  minLength)

Set the minimum length

Returns
the clamped minimum length

Definition at line 345 of file b2_distance_joint.cpp.

◆ SetStiffness()

void b2DistanceJoint::SetStiffness ( float  stiffness)
inline

Set/get the linear stiffness in N/m.

Definition at line 122 of file b2_distance_joint.h.

◆ SolvePositionConstraints()

bool b2DistanceJoint::SolvePositionConstraints ( const b2SolverData data)
overrideprotectedvirtual

Implements b2Joint.

Definition at line 268 of file b2_distance_joint.cpp.

◆ SolveVelocityConstraints()

void b2DistanceJoint::SolveVelocityConstraints ( const b2SolverData data)
overrideprotectedvirtual

Implements b2Joint.

Definition at line 175 of file b2_distance_joint.cpp.

Friends And Related Function Documentation

◆ b2Joint

friend class b2Joint
friend

Definition at line 137 of file b2_distance_joint.h.

Member Data Documentation

◆ m_bias

float b2DistanceJoint::m_bias
protected

Definition at line 146 of file b2_distance_joint.h.

◆ m_currentLength

float b2DistanceJoint::m_currentLength
protected

Definition at line 167 of file b2_distance_joint.h.

◆ m_damping

float b2DistanceJoint::m_damping
protected

Definition at line 145 of file b2_distance_joint.h.

◆ m_gamma

float b2DistanceJoint::m_gamma
protected

Definition at line 154 of file b2_distance_joint.h.

◆ m_impulse

float b2DistanceJoint::m_impulse
protected

Definition at line 155 of file b2_distance_joint.h.

◆ m_indexA

int32 b2DistanceJoint::m_indexA
protected

Definition at line 160 of file b2_distance_joint.h.

◆ m_indexB

int32 b2DistanceJoint::m_indexB
protected

Definition at line 161 of file b2_distance_joint.h.

◆ m_invIA

float b2DistanceJoint::m_invIA
protected

Definition at line 170 of file b2_distance_joint.h.

◆ m_invIB

float b2DistanceJoint::m_invIB
protected

Definition at line 171 of file b2_distance_joint.h.

◆ m_invMassA

float b2DistanceJoint::m_invMassA
protected

Definition at line 168 of file b2_distance_joint.h.

◆ m_invMassB

float b2DistanceJoint::m_invMassB
protected

Definition at line 169 of file b2_distance_joint.h.

◆ m_length

float b2DistanceJoint::m_length
protected

Definition at line 147 of file b2_distance_joint.h.

◆ m_localAnchorA

b2Vec2 b2DistanceJoint::m_localAnchorA
protected

Definition at line 152 of file b2_distance_joint.h.

◆ m_localAnchorB

b2Vec2 b2DistanceJoint::m_localAnchorB
protected

Definition at line 153 of file b2_distance_joint.h.

◆ m_localCenterA

b2Vec2 b2DistanceJoint::m_localCenterA
protected

Definition at line 165 of file b2_distance_joint.h.

◆ m_localCenterB

b2Vec2 b2DistanceJoint::m_localCenterB
protected

Definition at line 166 of file b2_distance_joint.h.

◆ m_lowerImpulse

float b2DistanceJoint::m_lowerImpulse
protected

Definition at line 156 of file b2_distance_joint.h.

◆ m_mass

float b2DistanceJoint::m_mass
protected

Definition at line 173 of file b2_distance_joint.h.

◆ m_maxLength

float b2DistanceJoint::m_maxLength
protected

Definition at line 149 of file b2_distance_joint.h.

◆ m_minLength

float b2DistanceJoint::m_minLength
protected

Definition at line 148 of file b2_distance_joint.h.

◆ m_rA

b2Vec2 b2DistanceJoint::m_rA
protected

Definition at line 163 of file b2_distance_joint.h.

◆ m_rB

b2Vec2 b2DistanceJoint::m_rB
protected

Definition at line 164 of file b2_distance_joint.h.

◆ m_softMass

float b2DistanceJoint::m_softMass
protected

Definition at line 172 of file b2_distance_joint.h.

◆ m_stiffness

float b2DistanceJoint::m_stiffness
protected

Definition at line 144 of file b2_distance_joint.h.

◆ m_u

b2Vec2 b2DistanceJoint::m_u
protected

Definition at line 162 of file b2_distance_joint.h.

◆ m_upperImpulse

float b2DistanceJoint::m_upperImpulse
protected

Definition at line 157 of file b2_distance_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