public class PulleyJointDef

  1. Object
  2. JointDef
  3. PulleyJointDef
Pulley joint definition. This requires two ground anchors, two dynamic body anchor points, and a pulley ratio.

Fields

public Vec2 groundAnchorAThe first ground anchor in world coordinates.
public Vec2 groundAnchorBThe second ground anchor in world coordinates.
public Vec2 localAnchorAThe local anchor point relative to bodyA’s origin.
public Vec2 localAnchorBThe local anchor point relative to bodyB’s origin.
public float lengthAThe a reference length for the segment attached to bodyA.
public float lengthBThe a reference length for the segment attached to bodyB.
public float ratioThe pulley ratio, used to simulate a block-and-tackle.

Constructors

public PulleyJointDef()

Methods

public void initialize(Body b1, Body b2, Vec2 ga1, Vec2 ga2, Vec2 anchor1, Vec2 anchor2, float r)Initialize the bodies, anchors, lengths, max lengths, and ratio using the world anchors.

Inherited fields

Inherited methods

Field details

groundAnchorA

public Vec2 groundAnchorA
The first ground anchor in world coordinates. This point never moves.

groundAnchorB

public Vec2 groundAnchorB
The second ground anchor in world coordinates. This point never moves.

localAnchorA

public Vec2 localAnchorA
The local anchor point relative to bodyA’s origin.

localAnchorB

public Vec2 localAnchorB
The local anchor point relative to bodyB’s origin.

lengthA

public float lengthA
The a reference length for the segment attached to bodyA.

lengthB

public float lengthB
The a reference length for the segment attached to bodyB.

ratio

public float ratio
The pulley ratio, used to simulate a block-and-tackle.

Constructor details

PulleyJointDef

public PulleyJointDef()

Method details

initialize

public void initialize(Body b1, Body b2, Vec2 ga1, Vec2 ga2, Vec2 anchor1, Vec2 anchor2, float r)
Initialize the bodies, anchors, lengths, max lengths, and ratio using the world anchors.