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;
121 void SolveVelocityConstraints(
const b2SolverData& data);
122 bool SolvePositionConstraints(
const b2SolverData& data);
float32 GetReactionTorque(float32 inv_dt) const
Get the reaction torque on bodyB in N*m.
Definition: b2PulleyJoint.cpp:278
b2Vec2 GetAnchorB() const
Get the anchor point on bodyB in world coordinates.
Definition: b2PulleyJoint.cpp:267
b2Body * bodyA
The first attached body.
Definition: b2Joint.h:92
b2Vec2 GetGroundAnchorA() const
Get the first ground anchor.
Definition: b2PulleyJoint.cpp:284
float32 GetCurrentLengthA() const
Get the current length of the segment attached to bodyA.
Definition: b2PulleyJoint.cpp:309
float32 GetLengthA() const
Get the current length of the segment attached to bodyA.
Definition: b2PulleyJoint.cpp:294
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
void ShiftOrigin(const b2Vec2 &newOrigin)
Implement b2Joint::ShiftOrigin.
Definition: b2PulleyJoint.cpp:344
Definition: b2Joint.h:103
float32 GetRatio() const
Get the pulley ratio.
Definition: b2PulleyJoint.cpp:304
float32 GetCurrentLengthB() const
Get the current length of the segment attached to bodyB.
Definition: b2PulleyJoint.cpp:317
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
void Dump()
Dump joint to dmLog.
Definition: b2PulleyJoint.cpp:325
b2Vec2 GetGroundAnchorB() const
Get the second ground anchor.
Definition: b2PulleyJoint.cpp:289
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
b2Vec2 GetReactionForce(float32 inv_dt) const
Get the reaction force on bodyB at the joint anchor in Newtons.
Definition: b2PulleyJoint.cpp:272
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 GetLengthB() const
Get the current length of the segment attached to bodyB.
Definition: b2PulleyJoint.cpp:299
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 GetAnchorA() const
Get the anchor point on bodyA in world coordinates.
Definition: b2PulleyJoint.cpp:262
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