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

public Class MouseJoint

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

A mouse joint is used to make a point on a body track a specified world point. This a soft constraint with a maximum force. This allows the constraint to stretch and without applying huge forces.

Note

this joint is not documented in the manual because it was developed to be used in the testbed. If you want to learn how to use the mouse joint, look at the testbed.

Field Summary

Modifier and TypeField and Description
private final Vector2
pack-priv final float[]
tmp

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

Use this to update the target point.
Inherited from com.badlogic.gdx.physics.box2d.Joint:
addrjointEdgeAjointEdgeB

Constructor Summary

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

Method Summary

Modifier and TypeMethod and Description
public float
getDampingRatio()

Set/get the damping ratio (dimensionless).

public float
getFrequency()

Set/get the frequency in Hertz.

public float
getMaxForce()

Set/get the maximum force in Newtons.

public Vector2
private native float
jniGetDampingRatio(long addr)

private native float
jniGetFrequency(long addr)

private native float
jniGetMaxForce(long addr)

private native void
jniGetTarget(long addr, float[] target)

private native void
jniSetDampingRatio(long addr, float ratio)

private native void
jniSetFrequency(long addr, float hz)

private native void
jniSetMaxForce(long addr, float force)

private native void
jniSetTarget(long addr, float x, float y)

public void
setDampingRatio(float ratio)

Set/get the damping ratio (dimensionless).

public void
setFrequency(float hz)

Set/get the frequency in Hertz.

public void
setMaxForce(float force)

Set/get the maximum force in Newtons.

public void
setTarget(Vector2 target)

Use this to update the target point.

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

Field Detail

targetback to summary
private final Vector2 target
tmpback to summary
pack-priv final float[] tmp

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

Use this to update the target point.

Constructor Detail

MouseJointback to summary
public MouseJoint(World world, long addr)

Method Detail

getDampingRatioback to summary
public float getDampingRatio()

Set/get the damping ratio (dimensionless).

getFrequencyback to summary
public float getFrequency()

Set/get the frequency in Hertz.

getMaxForceback to summary
public float getMaxForce()

Set/get the maximum force in Newtons.

getTargetback to summary
public Vector2 getTarget()
jniGetDampingRatioback to summary
private native float jniGetDampingRatio(long addr)
jniGetFrequencyback to summary
private native float jniGetFrequency(long addr)
jniGetMaxForceback to summary
private native float jniGetMaxForce(long addr)
jniGetTargetback to summary
private native void jniGetTarget(long addr, float[] target)
jniSetDampingRatioback to summary
private native void jniSetDampingRatio(long addr, float ratio)
jniSetFrequencyback to summary
private native void jniSetFrequency(long addr, float hz)
jniSetMaxForceback to summary
private native void jniSetMaxForce(long addr, float force)
jniSetTargetback to summary
private native void jniSetTarget(long addr, float x, float y)
setDampingRatioback to summary
public void setDampingRatio(float ratio)

Set/get the damping ratio (dimensionless).

setFrequencyback to summary
public void setFrequency(float hz)

Set/get the frequency in Hertz.

setMaxForceback to summary
public void setMaxForce(float force)

Set/get the maximum force in Newtons.

setTargetback to summary
public void setTarget(Vector2 target)

Use this to update the target point.