23 #ifndef B2_DISTANCE_JOINT_H 24 #define B2_DISTANCE_JOINT_H 38 localAnchorA.Set(0.0
f, 0.0
f);
39 localAnchorB.Set(0.0
f, 0.0
f);
102 float SetLength(
float length);
109 float SetMinLength(
float minLength);
116 float SetMaxLength(
float maxLength);
119 float GetCurrentLength()
const;
130 void Dump()
override;
float GetLength() const
Get the rest length.
const b2Vec2 & GetLocalAnchorA() const
The local anchor point relative to bodyA's origin.
virtual void SolveVelocityConstraints(const b2SolverData &data)=0
virtual b2Vec2 GetReactionForce(float inv_dt) const =0
Get the reaction force on bodyB at the joint anchor in Newtons.
Joint definitions are used to construct joints.
float minLength
Minimum length. Clamped to a stable minimum value.
GLenum GLuint GLenum GLsizei length
float stiffness
The linear stiffness in N/m.
float GetStiffness() const
const b2Vec2 & GetLocalAnchorB() const
The local anchor point relative to bodyB's origin.
virtual float GetReactionTorque(float inv_dt) const =0
Get the reaction torque on bodyB in N*m.
A rigid body. These are created via b2World::CreateBody.
virtual b2Vec2 GetAnchorA() const =0
Get the anchor point on bodyA in world coordinates.
virtual void InitVelocityConstraints(const b2SolverData &data)=0
virtual bool SolvePositionConstraints(const b2SolverData &data)=0
IMGUI_API void Initialize(ImGuiContext *context)
b2Vec2 localAnchorA
The local anchor point relative to bodyA's origin.
b2Vec2 localAnchorB
The local anchor point relative to bodyB's origin.
float length
The rest length of this joint. Clamped to a stable minimum value.
virtual void Dump()
Dump this joint to the log file.
float GetMinLength() const
Get the minimum length.
virtual b2Vec2 GetAnchorB() const =0
Get the anchor point on bodyB in world coordinates.
float maxLength
Maximum length. Must be greater than or equal to the minimum length.
virtual void Draw(b2Draw *draw) const
Debug draw this joint.
float GetMaxLength() const
Get the maximum length.
void SetDamping(float damping)
Set/get linear damping in N*s/m.
float damping
The linear damping in N*s/m.
void SetStiffness(float stiffness)
Set/get the linear stiffness in N/m.