APIdia Launch Partner
Top Description Fields Constructors Methods
com.badlogic.gdx.physics.box2d.joints

public Class PulleyJoint

extends Joint
Class Inheritance
Imports
com.badlogic.gdx.math.Vector2, com.badlogic.gdx.physics.box2d.Joint, .World

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.

Field Summary

Modifier and TypeField and Description
private final Vector2
private final Vector2
groundAnchorB

Get the second ground anchor.

private final float[]
tmp

Hides com.badlogic.gdx.physics.box2d.Joint.tmp.

Get the first ground anchor.
Inherited from com.badlogic.gdx.physics.box2d.Joint:
addrjointEdgeAjointEdgeB

Constructor Summary

AccessConstructor and Description
public
PulleyJoint(World world, long addr)

Method Summary

Modifier and TypeMethod and Description
public Vector2
public Vector2
public float
getLength1()

Get the current length of the segment attached to body1.

public float
getLength2()

Get the current length of the segment attached to body2.

public float
getRatio()

Get the pulley ratio.

private native void
jniGetGroundAnchorA(long addr, float[] anchor)

private native void
jniGetGroundAnchorB(long addr, float[] anchor)

private native float
jniGetLength1(long addr)

private native float
jniGetLength2(long addr)

private native float
jniGetRatio(long addr)

Inherited from com.badlogic.gdx.physics.box2d.Joint:
getAnchorAgetAnchorBgetBodyAgetBodyBgetCollideConnectedgetReactionForcegetReactionTorquegetTypegetUserDataisActivesetUserData

Field Detail

groundAnchorAback to summary
private final Vector2 groundAnchorA
groundAnchorBback to summary
private final Vector2 groundAnchorB

Get the second ground anchor.

tmpback to summary
private final float[] tmp

Hides com.badlogic.gdx.physics.box2d.Joint.tmp.

Get the first ground anchor.

Constructor Detail

PulleyJointback to summary
public PulleyJoint(World world, long addr)

Method Detail

getGroundAnchorAback to summary
public Vector2 getGroundAnchorA()
getGroundAnchorBback to summary
public Vector2 getGroundAnchorB()
getLength1back to summary
public float getLength1()

Get the current length of the segment attached to body1.

getLength2back to summary
public float getLength2()

Get the current length of the segment attached to body2.

getRatioback to summary
public float getRatio()

Get the pulley ratio.

jniGetGroundAnchorAback to summary
private native void jniGetGroundAnchorA(long addr, float[] anchor)
jniGetGroundAnchorBback to summary
private native void jniGetGroundAnchorB(long addr, float[] anchor)
jniGetLength1back to summary
private native float jniGetLength1(long addr)
jniGetLength2back to summary
private native float jniGetLength2(long addr)
jniGetRatioback to summary
private native float jniGetRatio(long addr)