 |
Box2D
2.4.0
A 2D physics engine for games
|
23 #ifndef B2_DISTANCE_JOINT_H
24 #define B2_DISTANCE_JOINT_H
38 type = e_distanceJoint;
39 localAnchorA.Set(0.0f, 0.0f);
40 localAnchorB.Set(0.0f, 0.0f);
93 float GetLength()
const {
return m_length; }
97 float GetStiffness()
const {
return m_stiffness; }
101 float GetDamping()
const {
return m_damping; }
111 void InitVelocityConstraints(
const b2SolverData& data)
override;
112 void SolveVelocityConstraints(
const b2SolverData& data)
override;
113 bool SolvePositionConstraints(
const b2SolverData& data)
override;
A 2D column vector.
Definition: b2_math.h:42
A rigid body. These are created via b2World::CreateBody.
Definition: b2_body.h:133
b2Vec2 GetAnchorB() const override
Get the anchor point on bodyB in world coordinates.
Definition: b2_distance_joint.h:70
const b2Vec2 & GetLocalAnchorA() const
The local anchor point relative to bodyA's origin.
Definition: b2_distance_joint.h:85
void SetDamping(float damping)
Set/get linear damping in N*s/m.
Definition: b2_distance_joint.h:100
Joint definitions are used to construct joints.
Definition: b2_joint.h:73
const b2Vec2 & GetLocalAnchorB() const
The local anchor point relative to bodyB's origin.
Definition: b2_distance_joint.h:88
b2Vec2 localAnchorA
The local anchor point relative to bodyA's origin.
Definition: b2_distance_joint.h:52
float damping
The linear damping in N*s/m.
Definition: b2_distance_joint.h:64
void Dump() override
Dump joint to dmLog.
float length
The natural length between the anchor points.
Definition: b2_distance_joint.h:58
float stiffness
The linear stiffness in N/m. A value of 0 disables softness.
Definition: b2_distance_joint.h:61
void SetLength(float length)
Definition: b2_distance_joint.h:92
float GetReactionTorque(float inv_dt) const override
b2Vec2 GetAnchorA() const override
Get the anchor point on bodyA in world coordinates.
Solver Data.
Definition: b2_time_step.h:68
b2Vec2 GetReactionForce(float inv_dt) const override
b2Vec2 localAnchorB
The local anchor point relative to bodyB's origin.
Definition: b2_distance_joint.h:55
void SetStiffness(float stiffness)
Set/get the linear stiffness in N/m.
Definition: b2_distance_joint.h:96
Definition: b2_joint.h:112
Definition: b2_distance_joint.h:35
void Initialize(b2Body *bodyA, b2Body *bodyB, const b2Vec2 &anchorA, const b2Vec2 &anchorB)