public class RopeJoint

  1. Object
  2. Joint
  3. RopeJoint
A rope joint enforces a maximum distance between two points on two bodies. It has no other effect. Warning: if you attempt to change the maximum length during the simulation you will get some non-physical behavior. A model that would allow you to dynamically modify the length would have some sponginess, so I chose not to implement it that way. See DistanceJoint if you want to dynamically control length.

Constructors

protected RopeJoint(IWorldPool worldPool, RopeJointDef def)

Methods

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.
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 getLocalAnchorA()
public Vec2 getLocalAnchorB()
public float getMaxLength()
public void setMaxLength(float maxLength)
public LimitState getLimitState()

Inherited fields

Inherited methods

Constructor details

RopeJoint

protected RopeJoint(IWorldPool worldPool, RopeJointDef def)

Method details

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.

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.

getLocalAnchorA

public Vec2 getLocalAnchorA()

getLocalAnchorB

public Vec2 getLocalAnchorB()

getMaxLength

public float getMaxLength()

setMaxLength

public void setMaxLength(float maxLength)

getLimitState

public LimitState getLimitState()