Package org.jbox2d.dynamics.joints
Class PrismaticJointDef
java.lang.Object
org.jbox2d.dynamics.joints.JointDef
org.jbox2d.dynamics.joints.PrismaticJointDef
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
FieldsModifier and TypeFieldDescriptionboolean
Enable/disable the joint limit.boolean
Enable/disable the joint motor.final Vec2
The local anchor point relative to body1's origin.final Vec2
The local anchor point relative to body2's origin.final Vec2
The local translation axis in body1.float
The lower translation limit, usually in meters.float
The maximum motor torque, usually in N-m.float
The desired motor speed in radians per second.float
The constrained angle between the bodies: body2_angle - body1_angle.float
The upper translation limit, usually in meters. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
initialize
(Body b1, Body b2, Vec2 anchor, Vec2 axis) Initialize the bodies, anchors, axis, and reference angle using the world anchor and world axis.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Field Details
-
localAnchorA
The local anchor point relative to body1's origin. -
localAnchorB
The local anchor point relative to body2's origin. -
localAxisA
The local translation axis in body1. -
referenceAngle
public float referenceAngleThe constrained angle between the bodies: body2_angle - body1_angle. -
enableLimit
public boolean enableLimitEnable/disable the joint limit. -
lowerTranslation
public float lowerTranslationThe lower translation limit, usually in meters. -
upperTranslation
public float upperTranslationThe upper translation limit, usually in meters. -
enableMotor
public boolean enableMotorEnable/disable the joint motor. -
maxMotorForce
public float maxMotorForceThe maximum motor torque, usually in N-m. -
motorSpeed
public float motorSpeedThe desired motor speed in radians per second.
-
-
Constructor Details
-
PrismaticJointDef
public PrismaticJointDef()
-
-
Method Details
-
initialize
Initialize the bodies, anchors, axis, and reference angle using the world anchor and world axis.
-