Class VehicleConstraintSettingsRef

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

public final class VehicleConstraintSettingsRef extends Ref implements ConstVehicleConstraintSettings
A counted reference to a VehicleConstraintSettings object. (native type: Ref<VehicleConstraintSettings>)
  • Constructor Details

    • VehicleConstraintSettingsRef

      public VehicleConstraintSettingsRef()
      Instantiate an empty reference.
  • 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
    • getConstraintPriority

      public int getConstraintPriority()
      Return the constraint's priority when solving. The settings are unaffected. (native attribute: mConstraintPriority)
      Specified by:
      getConstraintPriority in interface ConstConstraintSettings
      Returns:
      the priority level
    • 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
    • getControllerType

      public int getControllerType()
      Return the constraint's controller type. The settings are unaffected.
      Specified by:
      getControllerType in interface ConstConstraintSettings
      Returns:
      a numeric code, such as VehicleController.motorcycleType
    • getDrawConstraintSize

      public float getDrawConstraintSize()
      Return the size of the constraint in debug renders. The settings are unaffected. (native attribute: mDrawConstraintSize)
      Specified by:
      getDrawConstraintSize in interface ConstConstraintSettings
      Returns:
      the size
    • getEnabled

      public boolean getEnabled()
      Test whether the constraint will be enabled initially. The settings are unaffected. (native attribute: mEnabled)
      Specified by:
      getEnabled in interface ConstConstraintSettings
      Returns:
      true if enabled, otherwise false
    • 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)
    • getNumPositionStepsOverride

      public int getNumPositionStepsOverride()
      Return the override for the number of position iterations used in the solver. The settings are unaffected. (native attribute: mNumPositionStepsOverride)
      Specified by:
      getNumPositionStepsOverride in interface ConstConstraintSettings
      Returns:
      the number of iterations, or 0 to use the default in PhysicsSettings
    • getNumVelocityStepsOverride

      public int getNumVelocityStepsOverride()
      Return the override for the number of velocity iterations used in the solver. The settings are unaffected. (native attribute: mNumVelocityStepsOverride)
      Specified by:
      getNumVelocityStepsOverride in interface ConstConstraintSettings
      Returns:
      the number of iterations, or 0 to use the default configured in PhysicsSettings
    • getNumWheels

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

      public Rtti getRtti()
      Access the type information of the current object. (native method: getRTTI)
      Specified by:
      getRtti in interface ConstSerializableObject
      Returns:
      a new JVM object with the pre-existing native object assigned
    • 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
    • saveBinaryState

      public void saveBinaryState(StreamOut stream)
      Save the settings to the specified binary stream. The settings are unaffected.
      Specified by:
      saveBinaryState in interface ConstConstraintSettings
      Parameters:
      stream - the stream to write to (not null)
    • getPtr

      public VehicleConstraintSettings getPtr()
      Temporarily access the referenced VehicleConstraintSettings.
      Specified by:
      getPtr in class Ref
      Returns:
      a new JVM object with the pre-existing native object assigned
    • targetVa

      public long targetVa()
      Return the address of the native VehicleConstraintSettings. No objects are affected.
      Specified by:
      targetVa in interface ConstJoltPhysicsObject
      Overrides:
      targetVa in class JoltPhysicsObject
      Returns:
      a virtual address (not zero)
    • toRef

      Create another counted reference to the native VehicleConstraintSettings.
      Specified by:
      toRef in class Ref
      Returns:
      a new JVM object with a new native object assigned