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

public Class PrismaticJointDef

extends JointDef
Class Inheritance
Imports
com.badlogic.gdx.math.Vector2, com.badlogic.gdx.physics.box2d.Body, .JointDef

Prismatic joint definition. This requires defining a line of motion using an axis and an anchor point. The definition uses local anchor points and a local axis so that the initial configuration can violate the constraint slightly. The joint translation is zero when the local anchor points coincide in world space. Using local anchors and a local axis helps when saving and loading a game.

Field Summary

Modifier and TypeField and Description
public boolean
enableLimit

Enable/disable the joint limit.

public boolean
enableMotor

Enable/disable the joint motor.

public final Vector2
localAnchorA

The local anchor point relative to body1's origin.

public final Vector2
localAnchorB

The local anchor point relative to body2's origin.

public final Vector2
localAxisA

The local translation axis in body1.

public float
lowerTranslation

The lower translation limit, usually in meters.

public float
maxMotorForce

The maximum motor torque, usually in N-m.

public float
motorSpeed

The desired motor speed in radians per second.

public float
referenceAngle

The constrained angle between the bodies: body2_angle - body1_angle.

public float
upperTranslation

The upper translation limit, usually in meters.

Inherited from com.badlogic.gdx.physics.box2d.JointDef:
bodyAbodyBcollideConnectedtype

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public void
initialize(Body bodyA, Body bodyB, Vector2 anchor, Vector2 axis)

Initialize the bodies, anchors, axis, and reference angle using the world anchor and world axis.

Field Detail

enableLimitback to summary
public boolean enableLimit

Enable/disable the joint limit.

enableMotorback to summary
public boolean enableMotor

Enable/disable the joint motor.

localAnchorAback to summary
public final Vector2 localAnchorA

The local anchor point relative to body1's origin.

localAnchorBback to summary
public final Vector2 localAnchorB

The local anchor point relative to body2's origin.

localAxisAback to summary
public final Vector2 localAxisA

The local translation axis in body1.

lowerTranslationback to summary
public float lowerTranslation

The lower translation limit, usually in meters.

maxMotorForceback to summary
public float maxMotorForce

The maximum motor torque, usually in N-m.

motorSpeedback to summary
public float motorSpeed

The desired motor speed in radians per second.

referenceAngleback to summary
public float referenceAngle

The constrained angle between the bodies: body2_angle - body1_angle.

upperTranslationback to summary
public float upperTranslation

The upper translation limit, usually in meters.

Constructor Detail

PrismaticJointDefback to summary
public PrismaticJointDef()

Method Detail

initializeback to summary
public void initialize(Body bodyA, Body bodyB, Vector2 anchor, Vector2 axis)

Initialize the bodies, anchors, axis, and reference angle using the world anchor and world axis.