First body (pulley side 1), or null for a static anchor.
Second body (pulley side 1), or null for a static anchor.
Third body (pulley side 2), or null for a static anchor.
Fourth body (pulley side 2), or null for a static anchor.
Anchor on body1 in local space (disposed if weak).
Anchor on body2 in local space (disposed if weak).
Anchor on body3 in local space (disposed if weak).
Anchor on body4 in local space (disposed if weak).
Minimum allowed total rope length (must be >= 0).
Maximum allowed total rope length (must be >= jointMin).
Weight of the second distance segment. Default 1.0.
The set of CbTypes assigned to this constraint. Used to filter which listeners respond to this constraint's events.
Whether the constraint's simulation component is currently sleeping.
Only valid when the constraint is active and in a space — throws otherwise.
Maximum allowed total rope length (must be >= jointMin).
Minimum allowed total rope length (must be >= 0).
Arbitrary user data attached to this constraint.
Lazily initialized to {} on first access.
Creates and returns a copy of this constraint with the same parameters. The copy is not automatically added to a space.
Invokes fn once for each distinct body linked to this constraint.
Pulley joint — constrains the weighted sum of two distances to remain within
[jointMin, jointMax]:jointMin ≤ distance(anchor1, anchor2) + ratio * distance(anchor3, anchor4) ≤ jointMaxThis models a rope-and-pulley system where lifting one side lowers the other. All four anchors are in the local space of their respective bodies.
Example
Fully modernized — uses ZPP_PulleyJoint directly (extracted to TypeScript).