Class GearConstraintSettings

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

public class GearConstraintSettings extends TwoBodyConstraintSettings
Settings used to construct a GearConstraint.
  • Constructor Details

    • GearConstraintSettings

      public GearConstraintSettings()
      Instantiate default settings.
  • Method Details

    • getHingeAxis1

      public Vec3 getHingeAxis1()
      Copy the hinge axis for body 1. The settings are unaffected. (native attribute: mHingeAxis1)
      Returns:
      a new direction vector
    • getHingeAxis2

      public Vec3 getHingeAxis2()
      Copy the hinge axis for body 2. The settings are unaffected. (native attribute: mHingeAxis2)
      Returns:
      a new direction vector
    • getRatio

      public float getRatio()
      Return the gear ratio.
      Returns:
      the ratio
    • 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)
    • setHingeAxis1

      public void setHingeAxis1(Vec3Arg axis)
      Alter the hinge axis for body 1. (native attribute: mHingeAxis1)
      Parameters:
      axis - the desired direction vector (default=(1,0,0))
    • setHingeAxis2

      public void setHingeAxis2(Vec3Arg axis)
      Alter the hinge axis for body 2. (native attribute: mHingeAxis2)
      Parameters:
      axis - the desired direction vector (default=(1,0,0))
    • setRatio

      public void setRatio(float ratio)
      Alter the gear ratio.
      Parameters:
      ratio - the desired ratio (default=1)
    • setRatio

      public void setRatio(int numTeeth1, int numTeeth2)
      Alter the gear ratio.
      Parameters:
      numTeeth1 - the number of teeth in the body 1 gear
      numTeeth2 - the number of teeth in the body 2 gear
    • 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)