blaze.dynamics.joints.pulleyJoint
- class
PulleyJointDef
: blaze.dynamics.joints.joint.JointDef;
- Pulley joint definition. This requires two ground anchors,
two dynamic body anchor points, max lengths for each side,
and a pulley ratio.
- this(Body b1, Body b2, bVec2 ga1, bVec2 ga2, bVec2 anchor1, bVec2 anchor2, float r);
- Initialize the bodies, anchors, lengths, max lengths, and ratio using the world anchors.
- bVec2
groundAnchor1
;
- The first ground anchor in world coordinates. This point never moves.
- bVec2
groundAnchor2
;
- The second ground anchor in world coordinates. This point never moves.
- bVec2
localAnchor1
;
- The local anchor point relative to body1's origin.
- bVec2
localAnchor2
;
- The local anchor point relative to body2's origin.
- float
length1
;
- The a reference length for the segment attached to body1.
- float
maxLength1
;
- The maximum length of the segment attached to body1.
- float
length2
;
- The a reference length for the segment attached to body2.
- float
maxLength2
;
- The maximum length of the segment attached to body2.
- float
ratio
;
- The pulley
ratio
, used to simulate a block-and-tackle.
- class
PulleyJoint
: blaze.dynamics.joints.joint.Joint;
- The pulley joint is connected to two bodies and two fixed ground points.
The pulley supports a ratio such that:
length1 + ratio * length2 <= constant
Yes, the force transmitted is scaled by the ratio.
The pulley also enforces a maximum length limit on both sides. This is
useful to prevent one side of the pulley hitting the top.
- bVec2
groundAnchor1
();
- Get the first ground anchor.
- bVec2
groundAnchor2
();
- Get the second ground anchor.
- float
length1
();
- Get the current length of the segment attached to body1.
- float
length2
();
- Get the current length of the segment attached to body2.
- float
ratio
();
- Get the pulley
ratio
.
|