Class VehicleConstraintSettings

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

public class VehicleConstraintSettings extends ConstraintSettings implements ConstVehicleConstraintSettings
Settings used to construct a VehicleConstraint.
  • Constructor Details

    • VehicleConstraintSettings

      public VehicleConstraintSettings()
      Instantiate default settings.
    • VehicleConstraintSettings

      public VehicleConstraintSettings(ConstVehicleConstraintSettings original)
      Instantiate a copy of the specified settings.
      Parameters:
      original - the settings to copy (not null, unaffected)
  • Method Details

    • addWheels

      public void addWheels(WheelSettings... wheelSettingsArray)
      Append the specified wheel settings. (native attribute: mWheels)
      Parameters:
      wheelSettingsArray - the wheel settings to append
    • setController

      public void setController(VehicleControllerSettings controllerSettings)
      Alter how the vehicle accelerates and decelerates. (native attribute: mController)
      Parameters:
      controllerSettings - the desired settings (not null, default=null)
    • setForward

      public void setForward(Vec3Arg forward)
      Alter the forward direction. (native attribute: mForward)
      Parameters:
      forward - the desired forward direction (not null, unaffected, default=(0,0,1))
    • setMaxPitchRollAngle

      public void setMaxPitchRollAngle(float angle)
      Alter the vehicle's maximum pitch/roll angle. (native attribute: mMaxPitchRollAngle)
      Parameters:
      angle - the desired limit angle (in radians, default=Pi)
    • setNumAntiRollBars

      public void setNumAntiRollBars(int count)
      Alter the number of anti-roll bars. (native attribute: mAntiRollBars)
      Parameters:
      count - the desired number (≥0, default=0)
    • setUp

      public void setUp(Vec3Arg up)
      Alter the up direction. (native attribute: mUp)
      Parameters:
      up - the desired up direction (not null, unaffected, default=(0,1,0))
    • getAntiRollBar

      public VehicleAntiRollBar getAntiRollBar(int barIndex)
      Access the settings for the specified anti-roll bar. (native field: mAntiRollBars)
      Specified by:
      getAntiRollBar in interface ConstVehicleConstraintSettings
      Parameters:
      barIndex - the index of the anti-roll bar to access (≥0, <numBars)
      Returns:
      a new JVM object with the pre-existing native object assigned
    • getController

      public VehicleControllerSettings getController()
      Access the controller settings.
      Specified by:
      getController in interface ConstVehicleConstraintSettings
      Returns:
      a new JVM object with the pre-existing native object assigned, or null if none
    • getForward

      public Vec3 getForward()
      Copy the "forward" vector. The settings are unaffected. (native attribute: mForward)
      Specified by:
      getForward in interface ConstVehicleConstraintSettings
      Returns:
      a new direction vector
    • getMaxPitchRollAngle

      public float getMaxPitchRollAngle()
      Return the vehicle's maximum pitch/roll angle. The settings are unaffected. (native attribute: mMaxPitchRollAngle)
      Specified by:
      getMaxPitchRollAngle in interface ConstVehicleConstraintSettings
      Returns:
      the limit angle (in radians)
    • getNumAntiRollBars

      public int getNumAntiRollBars()
      Count the anti-roll bars. The settings are unaffected. (native attribute: mAntiRollBars)
      Specified by:
      getNumAntiRollBars in interface ConstVehicleConstraintSettings
      Returns:
      the count (≥0)
    • getNumWheels

      public int getNumWheels()
      Count the wheels. The settings are unaffected. (native attribute: mWheels)
      Specified by:
      getNumWheels in interface ConstVehicleConstraintSettings
      Returns:
      the count (≥0)
    • getUp

      public Vec3 getUp()
      Copy the "up" vector. The settings are unaffected. (native attribute: mUp)
      Specified by:
      getUp in interface ConstVehicleConstraintSettings
      Returns:
      a new direction vector
    • getWheel

      public WheelSettings getWheel(int wheelIndex)
      Access the settings of the specified wheel. (native attribute: mWheels)
      Specified by:
      getWheel in interface ConstVehicleConstraintSettings
      Parameters:
      wheelIndex - which wheel (≥0, <numWheels)
      Returns:
      a new JVM object with the pre-existing native object assigned, or null if none
    • getWheels

      public WheelSettings[] getWheels()
      Enumerate all wheel settings. The settings are unaffected. (native attribute: mWheels)
      Specified by:
      getWheels in interface ConstVehicleConstraintSettings
      Returns:
      a new array of pre-existing objects