public class PulleyJoint

  1. Object
  2. Joint
  3. PulleyJoint
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. Warning: the pulley joint can get a bit squirrelly by itself. They often work better when combined with prismatic joints. You should also cover the the anchor points with static shapes to prevent one side from going to zero length.

Fields

public static final float MIN_PULLEY_LENGTH = 2.0f

Constructors

protected PulleyJoint(IWorldPool argWorldPool, PulleyJointDef def)

Methods

public float getLengthA()
public float getLengthB()
public float getCurrentLengthA()
public float getCurrentLengthB()
public Vec2 getLocalAnchorA()
public Vec2 getLocalAnchorB()
public void getAnchorA(Vec2 argOut)get the anchor point on bodyA in world coordinates.
public void getAnchorB(Vec2 argOut)get the anchor point on bodyB in world coordinates.
public void getReactionForce(float inv_dt, Vec2 argOut)get the reaction force on body2 at the joint anchor in Newtons.
public float getReactionTorque(float inv_dt)get the reaction torque on body2 in N*m.
public Vec2 getGroundAnchorA()
public Vec2 getGroundAnchorB()
public float getLength1()
public float getLength2()
public float getRatio()
public void initVelocityConstraints(SolverData data)
public void solveVelocityConstraints(SolverData data)
public boolean solvePositionConstraints(SolverData data)This returns true if the position errors are within tolerance.

Inherited fields

Inherited methods

Field details

MIN_PULLEY_LENGTH

public static final float MIN_PULLEY_LENGTH = 2.0f

Constructor details

PulleyJoint

protected PulleyJoint(IWorldPool argWorldPool, PulleyJointDef def)

Method details

getLengthA

public float getLengthA()

getLengthB

public float getLengthB()

getCurrentLengthA

public float getCurrentLengthA()

getCurrentLengthB

public float getCurrentLengthB()

getLocalAnchorA

public Vec2 getLocalAnchorA()

getLocalAnchorB

public Vec2 getLocalAnchorB()

getAnchorA

public void getAnchorA(Vec2 argOut)
get the anchor point on bodyA in world coordinates.

getAnchorB

public void getAnchorB(Vec2 argOut)
get the anchor point on bodyB in world coordinates.

getReactionForce

public void getReactionForce(float inv_dt, Vec2 argOut)
get the reaction force on body2 at the joint anchor in Newtons.

getReactionTorque

public float getReactionTorque(float inv_dt)
get the reaction torque on body2 in N*m.

getGroundAnchorA

public Vec2 getGroundAnchorA()

getGroundAnchorB

public Vec2 getGroundAnchorB()

getLength1

public float getLength1()

getLength2

public float getLength2()

getRatio

public float getRatio()

initVelocityConstraints

public void initVelocityConstraints(SolverData data)

solveVelocityConstraints

public void solveVelocityConstraints(SolverData data)

solvePositionConstraints

public boolean solvePositionConstraints(SolverData data)
This returns true if the position errors are within tolerance.