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

public Class GearJoint

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

A gear joint is used to connect two joints together. Either joint can be a revolute or prismatic joint. You specify a gear ratio to bind the motions together: coordinate1 + ratio * coordinate2 = constant The ratio can be negative or positive. If one joint is a revolute joint and the other joint is a prismatic joint, then the ratio will have units of length or units of 1/length.

Field Summary

Modifier and TypeField and Description
private Joint
private Joint
Inherited from com.badlogic.gdx.physics.box2d.Joint:
addrjointEdgeAjointEdgeB

Constructor Summary

AccessConstructor and Description
public
GearJoint(World world, long addr, Joint joint1, Joint joint2)

Method Summary

Modifier and TypeMethod and Description
public Joint
getJoint1()

Get first joint.

public Joint
getJoint2()

Get first joint.

public float
getRatio()

Get the gear ratio.

private native long
jniGetJoint1(long addr)

private native long
jniGetJoint2(long addr)

private native float
jniGetRatio(long addr)

private native void
jniSetRatio(long addr, float ratio)

public void
setRatio(float ratio)

Set the gear ratio.

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

Field Detail

joint1back to summary
private Joint joint1
joint2back to summary
private Joint joint2

Constructor Detail

GearJointback to summary
public GearJoint(World world, long addr, Joint joint1, Joint joint2)

Method Detail

getJoint1back to summary
public Joint getJoint1()

Get first joint.

getJoint2back to summary
public Joint getJoint2()

Get first joint.

getRatioback to summary
public float getRatio()

Get the gear ratio.

jniGetJoint1back to summary
private native long jniGetJoint1(long addr)
jniGetJoint2back to summary
private native long jniGetJoint2(long addr)
jniGetRatioback to summary
private native float jniGetRatio(long addr)
jniSetRatioback to summary
private native void jniSetRatio(long addr, float ratio)
setRatioback to summary
public void setRatio(float ratio)

Set the gear ratio.