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.
- Author:
- Daniel Murphy
- Warning:
- at least one body should be dynamic with a non-fixed rotation.
-
Field Summary
FieldsModifier and TypeFieldDescriptionbooleanEnable/disable the joint limit.booleanEnable/disable the joint motor.final Vec2The local anchor point relative to body1's origin.final Vec2The local anchor point relative to body2's origin.final Vec2The local translation axis in body1.floatThe lower translation limit, usually in meters.floatThe maximum motor torque, usually in N-m.floatThe desired motor speed in radians per second.floatThe constrained angle between the bodies: body2_angle - body1_angle.floatThe upper translation limit, usually in meters. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidinitialize(Body b1, Body b2, Vec2 anchor, Vec2 axis) Initialize the bodies, anchors, axis, and reference angle using the world anchor and world axis.
-
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.
-