19 #ifndef B2_PULLEY_JOINT_H 20 #define B2_PULLEY_JOINT_H 22 #include <Box2D/Dynamics/Joints/b2Joint.h> 24 const float32 b2_minPulleyLength = 2.0f;
85 b2Vec2 GetReactionForce(float32 inv_dt)
const;
86 float32 GetReactionTorque(float32 inv_dt)
const;
89 b2Vec2 GetGroundAnchorA()
const;
92 b2Vec2 GetGroundAnchorB()
const;
95 float32 GetLengthA()
const;
98 float32 GetLengthB()
const;
101 float32 GetRatio()
const;
104 float32 GetCurrentLengthA()
const;
107 float32 GetCurrentLengthB()
const;
113 void ShiftOrigin(
const b2Vec2& newOrigin);
121 void SolveVelocityConstraints(
const b2SolverData& data);
122 bool SolvePositionConstraints(
const b2SolverData& data);
b2Body * bodyA
The first attached body.
Definition: b2Joint.h:92
b2Body * bodyB
The second attached body.
Definition: b2Joint.h:95
float32 lengthB
The a reference length for the segment attached to bodyB.
Definition: b2PulleyJoint.h:65
Definition: b2Joint.h:103
void Set(float32 x_, float32 y_)
Set this vector to some specified coordinates.
Definition: b2Math.h:65
float32 ratio
The pulley ratio, used to simulate a block-and-tackle.
Definition: b2PulleyJoint.h:68
b2JointType type
The joint type is set automatically for concrete joint types.
Definition: b2Joint.h:86
bool collideConnected
Set this flag to true if the attached bodies should collide.
Definition: b2Joint.h:98
Solver Data.
Definition: b2TimeStep.h:63
Joint definitions are used to construct joints.
Definition: b2Joint.h:74
Definition: b2PulleyJoint.h:28
A rigid body. These are created via b2World::CreateBody.
Definition: b2Body.h:126
b2Vec2 groundAnchorA
The first ground anchor in world coordinates. This point never moves.
Definition: b2PulleyJoint.h:50
float32 lengthA
The a reference length for the segment attached to bodyA.
Definition: b2PulleyJoint.h:62
A 2D column vector.
Definition: b2Math.h:53
b2Vec2 localAnchorB
The local anchor point relative to bodyB's origin.
Definition: b2PulleyJoint.h:59
b2Vec2 localAnchorA
The local anchor point relative to bodyA's origin.
Definition: b2PulleyJoint.h:56
Definition: b2PulleyJoint.h:79
void Initialize(b2Body *bodyA, b2Body *bodyB, const b2Vec2 &groundAnchorA, const b2Vec2 &groundAnchorB, const b2Vec2 &anchorA, const b2Vec2 &anchorB, float32 ratio)
Initialize the bodies, anchors, lengths, max lengths, and ratio using the world anchors.
Definition: b2PulleyJoint.cpp:35
b2Vec2 groundAnchorB
The second ground anchor in world coordinates. This point never moves.
Definition: b2PulleyJoint.h:53