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

public Class RopeJoint

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

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 b2DistanceJoint if you want to dynamically control length.

Field Summary

Modifier and TypeField and Description
private final Vector2
private final Vector2
private final float[]
Inherited from com.badlogic.gdx.physics.box2d.Joint:
addrjointEdgeAjointEdgeB

Constructor Summary

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

Method Summary

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

Get the maximum length of the rope.

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

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

private native float
jniGetMaxLength(long addr)

private native void
jniSetMaxLength(long addr, float length)

public void
setMaxLength(float length)

Set the maximum length of the rope.

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

Field Detail

localAnchorAback to summary
private final Vector2 localAnchorA
localAnchorBback to summary
private final Vector2 localAnchorB
tmpback to summary
private final float[] tmp

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

Constructor Detail

RopeJointback to summary
public RopeJoint(World world, long addr)

Method Detail

getLocalAnchorAback to summary
public Vector2 getLocalAnchorA()
getLocalAnchorBback to summary
public Vector2 getLocalAnchorB()
getMaxLengthback to summary
public float getMaxLength()

Get the maximum length of the rope.

jniGetLocalAnchorAback to summary
private native void jniGetLocalAnchorA(long addr, float[] anchor)
jniGetLocalAnchorBback to summary
private native void jniGetLocalAnchorB(long addr, float[] anchor)
jniGetMaxLengthback to summary
private native float jniGetMaxLength(long addr)
jniSetMaxLengthback to summary
private native void jniSetMaxLength(long addr, float length)
setMaxLengthback to summary
public void setMaxLength(float length)

Set the maximum length of the rope.