Class VehicleDifferentialSettings

java.lang.Object
com.github.stephengold.joltjni.JoltPhysicsObject
com.github.stephengold.joltjni.VehicleDifferentialSettings
All Implemented Interfaces:
ConstJoltPhysicsObject, AutoCloseable, Comparable<JoltPhysicsObject>

public class VehicleDifferentialSettings extends JoltPhysicsObject
Settings used to configure the differential of a WheeledVehicleController.
  • Method Details

    • getDifferentialRatio

      public float getDifferentialRatio()
      Return the number of gearbox rotations per wheel rotation. The settings are unaffected. (native attribute: mDifferentialRatio)
      Returns:
      the ratio
    • getEngineTorqueRatio

      public float getEngineTorqueRatio()
      Return the fraction of the engine's torque that is applied to this differential. The settings are unaffected. (native attribute: mEngineTorqueRatio)
      Returns:
      the fraction
    • getLeftWheel

      public int getLeftWheel()
      Return the index of the left wheel. The settings are unaffected. (native attribute: mLeftWheel)
      Returns:
      the index of the wheel (≥0) or -1 for none
    • getLimitedSlipRatio

      public float getLimitedSlipRatio()
      Return the ratio of maximum wheel speed to minimum wheel speed. The settings are unaffected. (native member: mLimitedSlipRatio)
      Returns:
      the ratio (>1, FLT_MAX for an open differential)
    • getRightWheel

      public int getRightWheel()
      Return the index of the right wheel. The settings are unaffected. (native attribute: mRightWheel)
      Returns:
      the index of the wheel (≥0) or -1 for none
    • setDifferentialRatio

      public void setDifferentialRatio(float ratio)
      Alter the number of gearbox rotations per wheel rotation. (native attribute: mDifferentialRatio)
      Parameters:
      ratio - the desired ratio (default=3.42)
    • setEngineTorqueRatio

      public float setEngineTorqueRatio(float fraction)
      Alter the fraction of the engine's torque that is applied to this differential. (native attribute: mEngineTorqueRatio)
      Parameters:
      fraction - the desired ratio (default=1)
      Returns:
      the fraction, for chaining
    • setLeftWheel

      public void setLeftWheel(int wheelIndex)
      Alter which left wheel is assigned to the differential. (native attribute: mLeftWheel)
      Parameters:
      wheelIndex - the index of the wheel (≥0) or -1 for none (default=-1)
    • setLimitedSlipRatio

      public void setLimitedSlipRatio(float ratio)
      Alter the ratio of maximum wheel speed to minimum wheel speed. When this ratio is exceeded, all torque gets distributed to the slowest wheel. (native member: mLimitedSlipRatio)
      Parameters:
      ratio - the desired ratio (>1, FLT_MAX for an open differential, default=1.4)
    • setRightWheel

      public void setRightWheel(int wheelIndex)
      Alter which right wheel is assigned to the differential. (native attribute: mRightWheel)
      Parameters:
      wheelIndex - the index of the wheel (≥0) or -1 for none (default=-1)