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

public abstract Class Joint

extends Object
Class Inheritance
Known Direct Subclasses
com.badlogic.gdx.physics.box2d.joints.DistanceJoint, com.badlogic.gdx.physics.box2d.joints.FrictionJoint, com.badlogic.gdx.physics.box2d.joints.GearJoint, com.badlogic.gdx.physics.box2d.joints.MotorJoint, com.badlogic.gdx.physics.box2d.joints.MouseJoint, com.badlogic.gdx.physics.box2d.joints.PrismaticJoint, com.badlogic.gdx.physics.box2d.joints.PulleyJoint, com.badlogic.gdx.physics.box2d.joints.RevoluteJoint, com.badlogic.gdx.physics.box2d.joints.RopeJoint, com.badlogic.gdx.physics.box2d.joints.WeldJoint, com.badlogic.gdx.physics.box2d.joints.WheelJoint
Imports
com.badlogic.gdx.math.Vector2, com.badlogic.gdx.physics.box2d.JointDef.JointType

Field Summary

Modifier and TypeField and Description
protected long
addr

the address of the joint

private final Vector2
anchorA

Get the anchor point on bodyA in world coordinates.

private final Vector2
anchorB

Get the anchor point on bodyB in world coordinates.

protected JointEdge
jointEdgeA

joint edge a

protected JointEdge
jointEdgeB

joint edge b

private final Vector2
reactionForce

Get the reaction force on body2 at the joint anchor in Newtons.

private final float[]
tmp

temporary float array

private Object
userData

user data

private final World
world

world

Constructor Summary

AccessConstructor and Description
protected
Joint(World world, long
the address of the joint
addr
)

Constructs a new joint

Method Summary

Modifier and TypeMethod and Description
public Vector2
public Vector2
public Body
getBodyA()

Get the first body attached to this joint.

public Body
getBodyB()

Get the second body attached to this joint.

public boolean
public Vector2
getReactionForce(float inv_dt)

public float
getReactionTorque(float inv_dt)

Get the reaction torque on body2 in N*m.

public JointDef.JointType
getType()

Get the type of the concrete joint.

public Object
getUserData()

Get the user data

public boolean
isActive()

Short-cut function to determine if either body is inactive.

private native void
jniGetAnchorA(long addr, float[] anchorA)

private native void
jniGetAnchorB(long addr, float[] anchorB)

private native long
jniGetBodyA(long addr)

private native long
jniGetBodyB(long addr)

private native boolean
private native void
jniGetReactionForce(long addr, float inv_dt, float[] reactionForce)

private native float
jniGetReactionTorque(long addr, float inv_dt)

private native int
jniGetType(long addr)

private native boolean
jniIsActive(long addr)

public void
setUserData(Object userData)

Set the user data

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

addrback to summary
protected long addr

the address of the joint

anchorAback to summary
private final Vector2 anchorA

Get the anchor point on bodyA in world coordinates.

anchorBback to summary
private final Vector2 anchorB

Get the anchor point on bodyB in world coordinates.

jointEdgeAback to summary
protected JointEdge jointEdgeA

joint edge a

jointEdgeBback to summary
protected JointEdge jointEdgeB

joint edge b

reactionForceback to summary
private final Vector2 reactionForce

Get the reaction force on body2 at the joint anchor in Newtons.

tmpback to summary
private final float[] tmp

temporary float array

userDataback to summary
private Object userData

user data

worldback to summary
private final World world

world

Constructor Detail

Jointback to summary
protected Joint(World world, long addr)

Constructs a new joint

Parameters
addr:long

the address of the joint

Method Detail

getAnchorAback to summary
public Vector2 getAnchorA()
getAnchorBback to summary
public Vector2 getAnchorB()
getBodyAback to summary
public Body getBodyA()

Get the first body attached to this joint.

getBodyBback to summary
public Body getBodyB()

Get the second body attached to this joint.

getCollideConnectedback to summary
public boolean getCollideConnected()
getReactionForceback to summary
public Vector2 getReactionForce(float inv_dt)
getReactionTorqueback to summary
public float getReactionTorque(float inv_dt)

Get the reaction torque on body2 in N*m.

getTypeback to summary
public JointDef.JointType getType()

Get the type of the concrete joint.

getUserDataback to summary
public Object getUserData()

Get the user data

isActiveback to summary
public boolean isActive()

Short-cut function to determine if either body is inactive.

jniGetAnchorAback to summary
private native void jniGetAnchorA(long addr, float[] anchorA)
jniGetAnchorBback to summary
private native void jniGetAnchorB(long addr, float[] anchorB)
jniGetBodyAback to summary
private native long jniGetBodyA(long addr)
jniGetBodyBback to summary
private native long jniGetBodyB(long addr)
jniGetCollideConnectedback to summary
private native boolean jniGetCollideConnected(long addr)
jniGetReactionForceback to summary
private native void jniGetReactionForce(long addr, float inv_dt, float[] reactionForce)
jniGetReactionTorqueback to summary
private native float jniGetReactionTorque(long addr, float inv_dt)
jniGetTypeback to summary
private native int jniGetType(long addr)
jniIsActiveback to summary
private native boolean jniIsActive(long addr)
setUserDataback to summary
public void setUserData(Object userData)

Set the user data