# Class PrismaticJointDef

java.lang.Object
com.codename1.gaming.physics.box2d.dynamics.joints.JointDef
com.codename1.gaming.physics.box2d.dynamics.joints.PrismaticJointDef

public class PrismaticJointDef extends 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

  Fields
  Modifier and Type
  Field
  Description
  `boolean`
  `enableLimit`
  Enable/disable the joint limit.
  `boolean`
  `enableMotor`
  Enable/disable the joint motor.
  `final Vec2`
  `localAnchorA`
  The local anchor point relative to body1's origin.
  `final Vec2`
  `localAnchorB`
  The local anchor point relative to body2's origin.
  `final Vec2`
  `localAxisA`
  The local translation axis in body1.
  `float`
  `lowerTranslation`
  The lower translation limit, usually in meters.
  `float`
  `maxMotorForce`
  The maximum motor torque, usually in N-m.
  `float`
  `motorSpeed`
  The desired motor speed in radians per second.
  `float`
  `referenceAngle`
  The constrained angle between the bodies: body2_angle - body1_angle.
  `float`
  `upperTranslation`
  The upper translation limit, usually in meters.

  ### Fields inherited from class JointDef

  `bodyA, bodyB, collideConnected, type, userData`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `PrismaticJointDef()`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `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 Object

  `clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Field Details

  - ### localAnchorA

    public final Vec2 localAnchorA
    The local anchor point relative to body1's origin.

  - ### localAnchorB

    public final Vec2 localAnchorB
    The local anchor point relative to body2's origin.

  - ### localAxisA

    public final Vec2 localAxisA
    The local translation axis in body1.

  - ### referenceAngle

    public float referenceAngle
    The constrained angle between the bodies: body2_angle - body1_angle.

  - ### enableLimit

    public boolean enableLimit
    Enable/disable the joint limit.

  - ### lowerTranslation

    public float lowerTranslation
    The lower translation limit, usually in meters.

  - ### upperTranslation

    public float upperTranslation
    The upper translation limit, usually in meters.

  - ### enableMotor

    public boolean enableMotor
    Enable/disable the joint motor.

  - ### maxMotorForce

    public float maxMotorForce
    The maximum motor torque, usually in N-m.

  - ### motorSpeed

    public float motorSpeed
    The desired motor speed in radians per second.

- ## Constructor Details

  - ### PrismaticJointDef

    public PrismaticJointDef()

- ## Method Details

  - ### initialize

    public void initialize(Body b1, Body b2, Vec2 anchor, Vec2 axis)
    Initialize the bodies, anchors, axis, and reference angle using the world anchor and world axis.