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

public Class PrismaticJoint

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

A prismatic joint. This joint provides one degree of freedom: translation along an axis fixed in body1. Relative rotation is prevented. You can use a joint limit to restrict the range of motion and a joint motor to drive the motion or to model joint friction.

Field Summary

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

Constructor Summary

AccessConstructor and Description
public
PrismaticJoint(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
getJointSpeed()

Get the current joint translation speed, usually in meters per second.

public float
getJointTranslation()

Get the current joint translation, usually in meters.

public Vector2
public Vector2
public Vector2
public float
getLowerLimit()

Get the lower joint limit, usually in meters.

public float
getMaxMotorForce()

Get the max motor force, usually in N.

public float
getMotorForce(float invDt)

Get the current motor force given the inverse time step, usually in N.

public float
getMotorSpeed()

Get the motor speed, usually in meters per second.

public float
getReferenceAngle()

Get the reference angle.

public float
getUpperLimit()

Get the upper joint limit, usually in meters.

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
jniGetJointSpeed(long addr)

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

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

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

private native float
jniGetLowerLimit(long addr)

private native float
private native float
jniGetMotorForce(long addr, float invDt)

private native float
jniGetMotorSpeed(long addr)

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
jniSetMaxMotorForce(long addr, float force)

private native void
jniSetMotorSpeed(long addr, float speed)

public void
setLimits(float lower, float upper)

Set the joint limits, usually in meters.

public void
setMaxMotorForce(float force)

Set the maximum motor force, usually in N.

public void
setMotorSpeed(float speed)

Set the motor speed, usually in meters 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
localAxisAback to summary
private final Vector2 localAxisA
tmpback to summary
private final float[] tmp

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

Constructor Detail

PrismaticJointback to summary
public PrismaticJoint(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.

getJointSpeedback to summary
public float getJointSpeed()

Get the current joint translation speed, usually in meters per second.

getJointTranslationback to summary
public float getJointTranslation()

Get the current joint translation, usually in meters.

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

Get the lower joint limit, usually in meters.

getMaxMotorForceback to summary
public float getMaxMotorForce()

Get the max motor force, usually in N.

getMotorForceback to summary
public float getMotorForce(float invDt)

Get the current motor force given the inverse time step, usually in N.

getMotorSpeedback to summary
public float getMotorSpeed()

Get the motor speed, usually in meters per second.

getReferenceAngleback to summary
public float getReferenceAngle()

Get the reference angle.

getUpperLimitback to summary
public float getUpperLimit()

Get the upper joint limit, usually in meters.

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)
jniGetJointSpeedback to summary
private native float jniGetJointSpeed(long addr)
jniGetJointTranslationback to summary
private native float jniGetJointTranslation(long addr)
jniGetLocalAnchorAback to summary
private native void jniGetLocalAnchorA(long addr, float[] anchor)
jniGetLocalAnchorBback to summary
private native void jniGetLocalAnchorB(long addr, float[] anchor)
jniGetLocalAxisAback to summary
private native void jniGetLocalAxisA(long addr, float[] anchor)
jniGetLowerLimitback to summary
private native float jniGetLowerLimit(long addr)
jniGetMaxMotorForceback to summary
private native float jniGetMaxMotorForce(long addr)
jniGetMotorForceback to summary
private native float jniGetMotorForce(long addr, float invDt)
jniGetMotorSpeedback to summary
private native float jniGetMotorSpeed(long addr)
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)
jniSetMaxMotorForceback to summary
private native void jniSetMaxMotorForce(long addr, float force)
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, usually in meters.

setMaxMotorForceback to summary
public void setMaxMotorForce(float force)

Set the maximum motor force, usually in N.

setMotorSpeedback to summary
public void setMotorSpeed(float speed)

Set the motor speed, usually in meters per second.