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

public Class RevoluteJoint

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

A revolute joint constrains two bodies to share a common point while they are free to rotate about the point. The relative rotation about the shared point is the joint angle. You can limit the relative rotation with a joint limit that specifies a lower and upper angle. You can use a motor to drive the relative rotation about the shared point. A maximum motor torque is provided so that infinite forces are not generated.

Field Summary

Modifier and TypeField and Description
private final Vector2
private final Vector2
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
RevoluteJoint(World world, long addr)

Method Summary

Modifier and TypeMethod and Description
public void
enableLimit(boolean flag)

Enable/disable the joint limit.

public void
enableMotor(boolean flag)

Enable/disable the joint motor.

public float
getJointAngle()

Get the current joint angle in radians.

public float
getJointSpeed()

Get the current joint angle speed in radians per second.

public Vector2
public Vector2
public float
getLowerLimit()

Get the lower joint limit in radians.

public float
public float
getMotorSpeed()

Get the motor speed in radians per second.

public float
getMotorTorque(float invDt)

Get the current motor torque, usually in N-m.

public float
getReferenceAngle()

Get the current motor torque, usually in N-m.

public float
getUpperLimit()

Get the upper joint limit in radians.

public boolean
isLimitEnabled()

Is the joint limit enabled?

public boolean
isMotorEnabled()

Is the joint motor enabled?

private native void
jniEnableLimit(long addr, boolean flag)

private native void
jniEnableMotor(long addr, boolean flag)

private native float
jniGetJointAngle(long addr)

private native float
jniGetJointSpeed(long addr)

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

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

private native float
jniGetLowerLimit(long addr)

private native float
private native float
jniGetMotorSpeed(long addr)

private native float
jniGetMotorTorque(long addr, float invDt)

private native float
private native float
jniGetUpperLimit(long addr)

private native boolean
jniIsLimitEnabled(long addr)

private native boolean
jniIsMotorEnabled(long addr)

private native void
jniSetLimits(long addr, float lower, float upper)

private native void
jniSetMaxMotorTorque(long addr, float torque)

private native void
jniSetMotorSpeed(long addr, float speed)

public void
setLimits(float lower, float upper)

Set the joint limits in radians.

public void
setMaxMotorTorque(float torque)

Set the maximum motor torque, usually in N-m.

public void
setMotorSpeed(float speed)

Set the motor speed in radians per second.

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.

Get the first ground anchor.

Constructor Detail

RevoluteJointback to summary
public RevoluteJoint(World world, long addr)

Method Detail

enableLimitback to summary
public void enableLimit(boolean flag)

Enable/disable the joint limit.

enableMotorback to summary
public void enableMotor(boolean flag)

Enable/disable the joint motor.

getJointAngleback to summary
public float getJointAngle()

Get the current joint angle in radians.

getJointSpeedback to summary
public float getJointSpeed()

Get the current joint angle speed in radians per second.

getLocalAnchorAback to summary
public Vector2 getLocalAnchorA()
getLocalAnchorBback to summary
public Vector2 getLocalAnchorB()
getLowerLimitback to summary
public float getLowerLimit()

Get the lower joint limit in radians.

getMaxMotorTorqueback to summary
public float getMaxMotorTorque()
getMotorSpeedback to summary
public float getMotorSpeed()

Get the motor speed in radians per second.

getMotorTorqueback to summary
public float getMotorTorque(float invDt)

Get the current motor torque, usually in N-m.

getReferenceAngleback to summary
public float getReferenceAngle()

Get the current motor torque, usually in N-m.

getUpperLimitback to summary
public float getUpperLimit()

Get the upper joint limit in radians.

isLimitEnabledback to summary
public boolean isLimitEnabled()

Is the joint limit enabled?

isMotorEnabledback to summary
public boolean isMotorEnabled()

Is the joint motor enabled?

jniEnableLimitback to summary
private native void jniEnableLimit(long addr, boolean flag)
jniEnableMotorback to summary
private native void jniEnableMotor(long addr, boolean flag)
jniGetJointAngleback to summary
private native float jniGetJointAngle(long addr)
jniGetJointSpeedback to summary
private native float jniGetJointSpeed(long addr)
jniGetLocalAnchorAback to summary
private native void jniGetLocalAnchorA(long addr, float[] anchor)
jniGetLocalAnchorBback to summary
private native void jniGetLocalAnchorB(long addr, float[] anchor)
jniGetLowerLimitback to summary
private native float jniGetLowerLimit(long addr)
jniGetMaxMotorTorqueback to summary
private native float jniGetMaxMotorTorque(long addr)
jniGetMotorSpeedback to summary
private native float jniGetMotorSpeed(long addr)
jniGetMotorTorqueback to summary
private native float jniGetMotorTorque(long addr, float invDt)
jniGetReferenceAngleback to summary
private native float jniGetReferenceAngle(long addr)
jniGetUpperLimitback to summary
private native float jniGetUpperLimit(long addr)
jniIsLimitEnabledback to summary
private native boolean jniIsLimitEnabled(long addr)
jniIsMotorEnabledback to summary
private native boolean jniIsMotorEnabled(long addr)
jniSetLimitsback to summary
private native void jniSetLimits(long addr, float lower, float upper)
jniSetMaxMotorTorqueback to summary
private native void jniSetMaxMotorTorque(long addr, float torque)
jniSetMotorSpeedback to summary
private native void jniSetMotorSpeed(long addr, float speed)
setLimitsback to summary
public void setLimits(float lower, float upper)

Set the joint limits in radians.

setMaxMotorTorqueback to summary
public void setMaxMotorTorque(float torque)

Set the maximum motor torque, usually in N-m.

setMotorSpeedback to summary
public void setMotorSpeed(float speed)

Set the motor speed in radians per second.