|
Box2D
2.4.1
A 2D physics engine for games
|
23 #ifndef B2_PULLEY_JOINT_H
24 #define B2_PULLEY_JOINT_H
29 const float b2_minPulleyLength = 2.0f;
38 groundAnchorA.Set(-1.0f, 1.0f);
39 groundAnchorB.Set(1.0f, 1.0f);
40 localAnchorA.Set(-1.0f, 0.0f);
41 localAnchorB.Set(1.0f, 0.0f);
45 collideConnected =
true;
50 const b2Vec2& groundAnchorA,
const b2Vec2& groundAnchorB,
94 b2Vec2 GetGroundAnchorA()
const;
97 b2Vec2 GetGroundAnchorB()
const;
100 float GetLengthA()
const;
103 float GetLengthB()
const;
106 float GetRatio()
const;
109 float GetCurrentLengthA()
const;
112 float GetCurrentLengthB()
const;
115 void Dump()
override;
125 void InitVelocityConstraints(
const b2SolverData& data)
override;
126 void SolveVelocityConstraints(
const b2SolverData& data)
override;
127 bool SolvePositionConstraints(
const b2SolverData& data)
override;
A 2D column vector.
Definition: b2_math.h:41
A rigid body. These are created via b2World::CreateBody.
Definition: b2_body.h:128
b2Vec2 groundAnchorB
The second ground anchor in world coordinates. This point never moves.
Definition: b2_pulley_joint.h:58
virtual b2Vec2 GetReactionForce(float inv_dt) const =0
Get the reaction force on bodyB at the joint anchor in Newtons.
float lengthB
The a reference length for the segment attached to bodyB.
Definition: b2_pulley_joint.h:70
virtual b2Vec2 GetAnchorA() const =0
Get the anchor point on bodyA in world coordinates.
Definition: b2_pulley_joint.h:33
Joint definitions are used to construct joints.
Definition: b2_joint.h:72
b2Vec2 localAnchorB
The local anchor point relative to bodyB's origin.
Definition: b2_pulley_joint.h:64
float ratio
The pulley ratio, used to simulate a block-and-tackle.
Definition: b2_pulley_joint.h:73
b2Vec2 groundAnchorA
The first ground anchor in world coordinates. This point never moves.
Definition: b2_pulley_joint.h:55
virtual void Dump()
Dump this joint to the log file.
Definition: b2_joint.h:151
virtual void ShiftOrigin(const b2Vec2 &newOrigin)
Shift the origin for any points stored in world coordinates.
Definition: b2_joint.h:154
b2Vec2 localAnchorA
The local anchor point relative to bodyA's origin.
Definition: b2_pulley_joint.h:61
Solver Data.
Definition: b2_time_step.h:67
virtual b2Vec2 GetAnchorB() const =0
Get the anchor point on bodyB in world coordinates.
Definition: b2_joint.h:110
virtual float GetReactionTorque(float inv_dt) const =0
Get the reaction torque on bodyB in N*m.
float lengthA
The a reference length for the segment attached to bodyA.
Definition: b2_pulley_joint.h:67
Definition: b2_pulley_joint.h:84