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

public Class PulleyJointDef

extends JointDef
Class Inheritance
Imports
com.badlogic.gdx.math.Vector2, com.badlogic.gdx.physics.box2d.Body, .JointDef

Pulley joint definition. This requires two ground anchors, two dynamic body anchor points, max lengths for each side, and a pulley ratio.

Field Summary

Modifier and TypeField and Description
public final Vector2
groundAnchorA

The first ground anchor in world coordinates.

public final Vector2
groundAnchorB

The second ground anchor in world coordinates.

public float
lengthA

The a reference length for the segment attached to bodyA.

public float
lengthB

The a reference length for the segment attached to bodyB.

public final Vector2
localAnchorA

The local anchor point relative to bodyA's origin.

public final Vector2
localAnchorB

The local anchor point relative to bodyB's origin.

private static final float
public float
ratio

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

Inherited from com.badlogic.gdx.physics.box2d.JointDef:
bodyAbodyBcollideConnectedtype

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public void
initialize(Body bodyA, Body bodyB, Vector2 groundAnchorA, Vector2 groundAnchorB, Vector2 anchorA, Vector2 anchorB, float ratio)

Initialize the bodies, anchors, lengths, max lengths, and ratio using the world anchors.

Field Detail

groundAnchorAback to summary
public final Vector2 groundAnchorA

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

groundAnchorBback to summary
public final Vector2 groundAnchorB

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

lengthAback to summary
public float lengthA

The a reference length for the segment attached to bodyA.

lengthBback to summary
public float lengthB

The a reference length for the segment attached to bodyB.

localAnchorAback to summary
public final Vector2 localAnchorA

The local anchor point relative to bodyA's origin.

localAnchorBback to summary
public final Vector2 localAnchorB

The local anchor point relative to bodyB's origin.

minPulleyLengthback to summary
private static final float minPulleyLength
ratioback to summary
public float ratio

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

Constructor Detail

PulleyJointDefback to summary
public PulleyJointDef()

Method Detail

initializeback to summary
public void initialize(Body bodyA, Body bodyB, Vector2 groundAnchorA, Vector2 groundAnchorB, Vector2 anchorA, Vector2 anchorB, float ratio)

Initialize the bodies, anchors, lengths, max lengths, and ratio using the world anchors.