23 #ifndef B2_REVOLUTE_JOINT_H 24 #define B2_REVOLUTE_JOINT_H 44 localAnchorA.Set(0.0
f, 0.0
f);
45 localAnchorB.Set(0.0
f, 0.0
f);
46 referenceAngle = 0.0f;
49 maxMotorTorque = 0.0f;
110 float GetJointAngle()
const;
113 float GetJointSpeed()
const;
116 bool IsLimitEnabled()
const;
119 void EnableLimit(
bool flag);
122 float GetLowerLimit()
const;
125 float GetUpperLimit()
const;
128 void SetLimits(
float lower,
float upper);
131 bool IsMotorEnabled()
const;
134 void EnableMotor(
bool flag);
137 void SetMotorSpeed(
float speed);
140 float GetMotorSpeed()
const;
143 void SetMaxMotorTorque(
float torque);
156 float GetMotorTorque(
float inv_dt)
const;
159 void Dump()
override;
virtual void SolveVelocityConstraints(const b2SolverData &data)=0
float GetMaxMotorTorque() const
b2Vec2 localAnchorB
The local anchor point relative to bodyB's origin.
float lowerAngle
The lower angle for the joint limit (radians).
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.
virtual float GetReactionTorque(float inv_dt) const =0
Get the reaction torque on bodyB in N*m.
float GetMotorSpeed() const
Get the motor speed in radians per second.
A rigid body. These are created via b2World::CreateBody.
float GetReferenceAngle() const
Get the reference angle.
virtual b2Vec2 GetAnchorA() const =0
Get the anchor point on bodyA in world coordinates.
virtual void InitVelocityConstraints(const b2SolverData &data)=0
const b2Vec2 & GetLocalAnchorB() const
The local anchor point relative to bodyB's origin.
b2Vec2 localAnchorA
The local anchor point relative to bodyA's origin.
virtual bool SolvePositionConstraints(const b2SolverData &data)=0
float referenceAngle
The bodyB angle minus bodyA angle in the reference state (radians).
IMGUI_API void Initialize(ImGuiContext *context)
bool enableMotor
A flag to enable the joint motor.
virtual void Dump()
Dump this joint to the log file.
float motorSpeed
The desired motor speed. Usually in radians per second.
float upperAngle
The upper angle for the joint limit (radians).
virtual b2Vec2 GetAnchorB() const =0
Get the anchor point on bodyB in world coordinates.
const b2Vec2 & GetLocalAnchorA() const
The local anchor point relative to bodyA's origin.
virtual void Draw(b2Draw *draw) const
Debug draw this joint.
A 2-by-2 matrix. Stored in column-major order.
bool enableLimit
A flag to enable joint limits.