23#ifndef B2_DISTANCE_JOINT_H 
   24#define B2_DISTANCE_JOINT_H 
   37        type = e_distanceJoint;
 
   38        localAnchorA.Set(0.0f, 0.0f);
 
   39        localAnchorB.Set(0.0f, 0.0f);
 
  123    float GetStiffness()
 const { 
return m_stiffness; }
 
  127    float GetDamping()
 const { 
return m_damping; }
 
  140    void InitVelocityConstraints(
const b2SolverData& data) 
override;
 
  141    void SolveVelocityConstraints(
const b2SolverData& data) 
override;
 
  142    bool SolvePositionConstraints(
const b2SolverData& data) 
override;
 
  156    float m_lowerImpulse;
 
  157    float m_upperImpulse;
 
  167    float m_currentLength;
 
A rigid body. These are created via b2World::CreateBody.
Definition: b2_body.h:129
 
Definition: b2_distance_joint.h:77
 
b2Vec2 GetAnchorB() const override
Get the anchor point on bodyB in world coordinates.
 
float GetLength() const
Get the rest length.
Definition: b2_distance_joint.h:98
 
float SetMaxLength(float maxLength)
 
void Dump() override
Dump joint to dmLog.
 
float GetCurrentLength() const
Get the current length.
 
float SetLength(float length)
 
void Draw(b2Draw *draw) const override
Debug draw this joint.
 
void SetDamping(float damping)
Set/get linear damping in N*s/m.
Definition: b2_distance_joint.h:126
 
void SetStiffness(float stiffness)
Set/get the linear stiffness in N/m.
Definition: b2_distance_joint.h:122
 
const b2Vec2 & GetLocalAnchorB() const
The local anchor point relative to bodyB's origin.
Definition: b2_distance_joint.h:95
 
b2Vec2 GetReactionForce(float inv_dt) const override
 
float SetMinLength(float minLength)
 
const b2Vec2 & GetLocalAnchorA() const
The local anchor point relative to bodyA's origin.
Definition: b2_distance_joint.h:92
 
b2Vec2 GetAnchorA() const override
Get the anchor point on bodyA in world coordinates.
 
float GetMinLength() const
Get the minimum length.
Definition: b2_distance_joint.h:105
 
float GetMaxLength() const
Get the maximum length.
Definition: b2_distance_joint.h:112
 
float GetReactionTorque(float inv_dt) const override
 
Definition: b2_joint.h:111
 
Definition: b2_distance_joint.h:34
 
float length
The rest length of this joint. Clamped to a stable minimum value.
Definition: b2_distance_joint.h:59
 
b2Vec2 localAnchorA
The local anchor point relative to bodyA's origin.
Definition: b2_distance_joint.h:53
 
b2Vec2 localAnchorB
The local anchor point relative to bodyB's origin.
Definition: b2_distance_joint.h:56
 
float stiffness
The linear stiffness in N/m.
Definition: b2_distance_joint.h:68
 
float minLength
Minimum length. Clamped to a stable minimum value.
Definition: b2_distance_joint.h:62
 
void Initialize(b2Body *bodyA, b2Body *bodyB, const b2Vec2 &anchorA, const b2Vec2 &anchorB)
 
float damping
The linear damping in N*s/m.
Definition: b2_distance_joint.h:71
 
float maxLength
Maximum length. Must be greater than or equal to the minimum length.
Definition: b2_distance_joint.h:65
 
Joint definitions are used to construct joints.
Definition: b2_joint.h:73
 
Solver Data.
Definition: b2_time_step.h:68
 
A 2D column vector.
Definition: b2_math.h:42