19 #ifndef B2_DISTANCE_JOINT_H
20 #define B2_DISTANCE_JOINT_H
22 #include <Box2D/Dynamics/Joints/b2Joint.h>
34 type = e_distanceJoint;
91 float32 GetLength()
const;
95 float32 GetFrequency()
const;
99 float32 GetDampingRatio()
const;
110 void SolveVelocityConstraints(
const b2SolverData& data);
111 bool SolvePositionConstraints(
const b2SolverData& data);
113 float32 m_frequencyHz;
114 float32 m_dampingRatio;
144 inline float32 b2DistanceJoint::GetLength()
const
154 inline float32 b2DistanceJoint::GetFrequency()
const
156 return m_frequencyHz;
161 m_dampingRatio = ratio;
164 inline float32 b2DistanceJoint::GetDampingRatio()
const
166 return m_dampingRatio;
void Initialize(b2Body *bodyA, b2Body *bodyB, const b2Vec2 &anchorA, const b2Vec2 &anchorB)
Definition: b2DistanceJoint.cpp:38
b2Body * bodyA
The first attached body.
Definition: b2Joint.h:92
b2Vec2 localAnchorA
The local anchor point relative to bodyA's origin.
Definition: b2DistanceJoint.h:48
b2Body * bodyB
The second attached body.
Definition: b2Joint.h:95
b2Vec2 GetReactionForce(float32 inv_dt) const
Definition: b2DistanceJoint.cpp:233
Definition: b2Joint.h:103
void SetLength(float32 length)
Definition: b2DistanceJoint.h:139
void Set(float32 x_, float32 y_)
Set this vector to some specified coordinates.
Definition: b2Math.h:65
float32 GetReactionTorque(float32 inv_dt) const
Definition: b2DistanceJoint.cpp:239
b2JointType type
The joint type is set automatically for concrete joint types.
Definition: b2Joint.h:86
Solver Data.
Definition: b2TimeStep.h:63
void Dump()
Dump joint to dmLog.
Definition: b2DistanceJoint.cpp:245
float32 length
The natural length between the anchor points.
Definition: b2DistanceJoint.h:54
Definition: b2DistanceJoint.h:67
float32 frequencyHz
Definition: b2DistanceJoint.h:58
Joint definitions are used to construct joints.
Definition: b2Joint.h:74
const b2Vec2 & GetLocalAnchorA() const
The local anchor point relative to bodyA's origin.
Definition: b2DistanceJoint.h:83
b2Vec2 GetAnchorB() const
Get the anchor point on bodyB in world coordinates.
Definition: b2DistanceJoint.cpp:228
A rigid body. These are created via b2World::CreateBody.
Definition: b2Body.h:126
Definition: b2DistanceJoint.h:30
float32 dampingRatio
The damping ratio. 0 = no damping, 1 = critical damping.
Definition: b2DistanceJoint.h:61
void SetDampingRatio(float32 ratio)
Set/get damping ratio.
Definition: b2DistanceJoint.h:159
b2Vec2 GetAnchorA() const
Get the anchor point on bodyA in world coordinates.
Definition: b2DistanceJoint.cpp:223
const b2Vec2 & GetLocalAnchorB() const
The local anchor point relative to bodyB's origin.
Definition: b2DistanceJoint.h:86
b2Vec2 localAnchorB
The local anchor point relative to bodyB's origin.
Definition: b2DistanceJoint.h:51
A 2D column vector.
Definition: b2Math.h:53
void SetFrequency(float32 hz)
Set/get frequency in Hz.
Definition: b2DistanceJoint.h:149