Class RackAndPinionConstraintSettings

All Implemented Interfaces:
ConstConstraintSettings, ConstJoltPhysicsObject, RefTarget, AutoCloseable, Comparable<JoltPhysicsObject>

public class RackAndPinionConstraintSettings extends TwoBodyConstraintSettings
Settings used to construct a RackAndPinionConstraint.
  • Constructor Details

    • RackAndPinionConstraintSettings

      public RackAndPinionConstraintSettings()
      Instantiate default settings.
  • Method Details

    • getHingeAxis

      public Vec3 getHingeAxis()
      Copy the hinge axis of the pinion. The settings are unaffected. (native attribute: mHingeAxis)
      Returns:
      a new direction vector
    • getRatio

      public float getRatio()
      Return the ratio of pinion rotation divided rack translation. The settings are unaffected. (native attribute: mRatio)
      Returns:
      the ratio (in radians per meter)
    • getSliderAxis

      public Vec3 getSliderAxis()
      Copy the translation axis of the slider. The settings are unaffected. (native attribute: mSliderAxis)
      Returns:
      a new direction vector
    • getSpace

      public EConstraintSpace getSpace()
      Return which space the other properties are specified in. The settings are unaffected. (native attribute: mSpace)
      Returns:
      an enum value (not null)
    • setHingeAxis

      public Vec3Arg setHingeAxis(Vec3Arg direction)
      Alter the hinge axis of the pinion. (native attribute: mHingeAxis)
      Parameters:
      direction - the desired axis direction (not null, unaffected, default=(1,0,0))
      Returns:
      the argument, for chaining
    • setRatio

      public void setRatio(int rackTeeth, float rackLength, int pinionTeeth)
      Update the ratio of pinion rotation to rack translation.
      Parameters:
      rackTeeth - the number of teeth in the rack
      rackLength - the length of the rack (in meters)
      pinionTeeth - the number of teeth in the pinion
    • setSliderAxis

      public Vec3Arg setSliderAxis(Vec3Arg direction)
      Alter the translation axis of the rack. (native attribute: mSliderAxis)
      Parameters:
      direction - the desired axis direction (not null, unaffected, default=(1,0,0))
      Returns:
      the argument, for chaining
    • setSpace

      public void setSpace(EConstraintSpace space)
      Alter which space the other properties are specified in. (native attribute: mSpace)
      Parameters:
      space - enum value (not null, default=WorldSpace)