Class WheelSettingsWvRef

All Implemented Interfaces:
ConstJoltPhysicsObject, ConstSerializableObject, ConstWheelSettings, ConstWheelSettingsWv, AutoCloseable, Comparable<JoltPhysicsObject>

public final class WheelSettingsWvRef extends Ref implements ConstWheelSettingsWv
A counted reference to a WheelSettingsWv object. (native type: Ref<WheelSettingsWV>)
  • Constructor Details

    • WheelSettingsWvRef

      public WheelSettingsWvRef()
      Instantiate an empty reference.
  • Method Details

    • setEnableSuspensionForcePoint

      public WheelSettingsWvRef setEnableSuspensionForcePoint(boolean enable)
      Alter where to apply tire forces. (native attribute: mEnableSuspensionForcePoint)
      Parameters:
      enable - true to apply at the configured suspension-force point, false to apply at the wheel's point of contact (default=false)
      Returns:
      the current reference, for chaining
    • setMaxBrakeTorque

      public WheelSettingsWvRef setMaxBrakeTorque(float torque)
      Alter the maximum torque that the main brake can exert on the wheel. (native attribute: mMaxBrakeTorque)
      Parameters:
      torque - the desired torque (in Newton.meters, default=1500)
      Returns:
      the current reference, for chaining
    • setMaxHandBrakeTorque

      public WheelSettingsWvRef setMaxHandBrakeTorque(float torque)
      Alter the maximum torque that the hand brake can exert on the wheel. (native attribute: mMaxHandBrakeTorque)
      Parameters:
      torque - the desired torque (in Newton.meters, default=4000)
      Returns:
      the current reference, for chaining
    • setMaxSteerAngle

      public WheelSettingsWvRef setMaxSteerAngle(float angle)
      Alter the maximum steering angle. (native attribute: mMaxSteerAngle)
      Parameters:
      angle - the desired maximum steering angle (in radians, default=7*Pi/18)
      Returns:
      the current reference, for chaining
    • setPosition

      public WheelSettingsWvRef setPosition(Vec3Arg position)
      Relocate the attachment point. (native attribute: mPosition)
      Parameters:
      position - the location of the attachment point (in the body's local coordinates, not null, unaffected, default=(0,0,0))
      Returns:
      the current reference, for chaining
    • setRadius

      public WheelSettingsWvRef setRadius(float radius)
      Alter the radius of the wheel. (native attribute: mRadius)
      Parameters:
      radius - the desired radius (in meters, default=0.3)
      Returns:
      the current reference, for chaining
    • setSteeringAxis

      public WheelSettingsWvRef setSteeringAxis(Vec3Arg direction)
      Alter the steering axis (upward direction). (native attribute: mSteeringAxis)
      Parameters:
      direction - the desired direction (not null, unaffected, default=(0,1,0))
      Returns:
      the current reference, for chaining
    • setSuspensionDirection

      public WheelSettingsWvRef setSuspensionDirection(Vec3Arg direction)
      Alter the downward direction of the suspension. (native attribute: mSuspensionDirection)
      Parameters:
      direction - the desired direction (not null, unaffected, default=(0,-1,0))
      Returns:
      the current reference, for chaining
    • setSuspensionForcePoint

      public WheelSettingsWvRef setSuspensionForcePoint(Vec3Arg location)
      Alter the location where tire forces will be applied if the force-point option is enabled. (native attribute: mSuspensionForcePoint)
      Parameters:
      location - the desired location (in the body coordinates, not null, unaffected, default=(0,0,0))
      Returns:
      the current reference, for chaining
    • setSuspensionMaxLength

      public WheelSettingsWvRef setSuspensionMaxLength(float length)
      Alter the maximum displacement from the attachment point. (native attribute: mSuspensionMaxLength)
      Parameters:
      length - the desired limit (in meters, default=0.5)
      Returns:
      the current reference, for chaining
    • setSuspensionMinLength

      public WheelSettingsWvRef setSuspensionMinLength(float length)
      Alter the minimum displacement from the attachment point. (native attribute: mSuspensionMinLength)
      Parameters:
      length - the desired limit (in meters, default=0.3)
      Returns:
      the current reference, for chaining
    • setSuspensionPreloadLength

      public WheelSettingsWvRef setSuspensionPreloadLength(float length)
      Alter the suspension preload length. (native attribute: mSuspensionPreloadLength)
      Parameters:
      length - the desired offset (in meters, default=0)
      Returns:
      the current reference, for chaining
    • setWheelForward

      public WheelSettingsWvRef setWheelForward(Vec3Arg direction)
      Alter the forward direction when steering is neutral. (native attribute: mWheelForward)
      Parameters:
      direction - the desired direction (not null, unaffected, default=(0,0,1))
      Returns:
      the current reference, for chaining
    • setWheelUp

      public WheelSettingsWvRef setWheelUp(Vec3Arg direction)
      Alter the "up" direction when steering is neutral. (native attribute: mWheelUp)
      Parameters:
      direction - the desired direction (not null, unaffected, default=(0,1,0))
      Returns:
      the current reference, for chaining
    • setWidth

      public WheelSettingsWvRef setWidth(float width)
      Alter the width of the wheel. (native attribute: mWidth)
      Parameters:
      width - the desired width (in meters, default=0.1)
      Returns:
      the current reference, for chaining
    • getEnableSuspensionForcePoint

      public boolean getEnableSuspensionForcePoint()
      Determine where to apply tire forces. The settings are unaffected. (native attribute: mEnableSuspensionForcePoint)
      Specified by:
      getEnableSuspensionForcePoint in interface ConstWheelSettings
      Returns:
      true if applied at the configured suspension-force point, false if applied at the wheel's point of contact
    • getMaxBrakeTorque

      public float getMaxBrakeTorque()
      Return the maximum torque that the main brake can exert on the wheel. The settings are unaffected. (native attribute: mMaxBrakeTorque)
      Specified by:
      getMaxBrakeTorque in interface ConstWheelSettingsWv
      Returns:
      the maximum torque (in Newton.meters)
    • getMaxHandBrakeTorque

      public float getMaxHandBrakeTorque()
      Return the maximum torque that the hand brake can exert on the wheel. The settings are unaffected. (native attribute: mMaxHandBrakeTorque)
      Specified by:
      getMaxHandBrakeTorque in interface ConstWheelSettingsWv
      Returns:
      the maximum torque (in Newton.meters)
    • getMaxSteerAngle

      public float getMaxSteerAngle()
      Return the maximum steering angle. The settings are unaffected. (native attribute: mMaxSteerAngle)
      Specified by:
      getMaxSteerAngle in interface ConstWheelSettingsWv
      Returns:
      the maximum steering angle (in radians)
    • getPosition

      public Vec3 getPosition()
      Copy the location of the attachment point. The settings are unaffected. (native attribute: mPosition)
      Specified by:
      getPosition in interface ConstWheelSettings
      Returns:
      a new location vector (in the body's local coordinates)
    • getRadius

      public float getRadius()
      Return the radius of the wheel. The settings are unaffected. (native attribute: mRadius)
      Specified by:
      getRadius in interface ConstWheelSettings
      Returns:
      the radius (in meters)
    • getRtti

      public Rtti getRtti()
      Access the type information of the target. (native method: GetRTTI)
      Specified by:
      getRtti in interface ConstSerializableObject
      Returns:
      a new JVM object with the pre-existing native object assigned
    • getSteeringAxis

      public Vec3 getSteeringAxis()
      Copy the steering axis (upward direction). The settings are unaffected. (native attribute: mSteeringAxis)
      Specified by:
      getSteeringAxis in interface ConstWheelSettings
      Returns:
      a new direction vector
    • getSuspensionDirection

      public Vec3 getSuspensionDirection()
      Copy the downward direction of the suspension. The settings are unaffected. (native attribute: mSuspensionDirection)
      Specified by:
      getSuspensionDirection in interface ConstWheelSettings
      Returns:
      a new direction vector
    • getSuspensionForcePoint

      public Vec3 getSuspensionForcePoint()
      Copy the location where tire forces will be applied if the force-point option is enabled. The settings are unaffected. (native attribute: mSuspensionForcePoint)
      Specified by:
      getSuspensionForcePoint in interface ConstWheelSettings
      Returns:
      a new location vector (in body coordinates)
    • getSuspensionMaxLength

      public float getSuspensionMaxLength()
      Return the maximum displacement from the attachment point. The settings are unaffected. (native attribute: mSuspensionMaxLength)
      Specified by:
      getSuspensionMaxLength in interface ConstWheelSettings
      Returns:
      the distance (in meters)
    • getSuspensionMinLength

      public float getSuspensionMinLength()
      Return the minimum displacement from the attachment point. The settings are unaffected. (native attribute: mSuspensionMinLength)
      Specified by:
      getSuspensionMinLength in interface ConstWheelSettings
      Returns:
      the distance (in meters)
    • getSuspensionPreloadLength

      public float getSuspensionPreloadLength()
      Return the suspension preload length. The settings are unaffected. (native attribute: mSuspensionPreloadLength)
      Specified by:
      getSuspensionPreloadLength in interface ConstWheelSettings
      Returns:
      the offset (in meters)
    • getSuspensionSpring

      public SpringSettings getSuspensionSpring()
      Access the settings for the suspension spring. (native attribute: mSuspensionSpring)
      Specified by:
      getSuspensionSpring in interface ConstWheelSettings
      Returns:
      a new JVM object with the pre-existing native object assigned
    • getWheelForward

      public Vec3 getWheelForward()
      Copy the forward direction when steering is neutral. The settings are unaffected. (native attribute: mWheelForward)
      Specified by:
      getWheelForward in interface ConstWheelSettings
      Returns:
      a new direction vector
    • getWheelUp

      public Vec3 getWheelUp()
      Copy the "up" direction when steering is neutral. The settings are unaffected. (native attribute: mWheelUp)
      Specified by:
      getWheelUp in interface ConstWheelSettings
      Returns:
      a new direction vector
    • getWidth

      public float getWidth()
      Return the width of the wheel. The settings are unaffected. (native attribute: mWidth)
      Specified by:
      getWidth in interface ConstWheelSettings
      Returns:
      the width (in meters)
    • saveBinaryState

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

      public WheelSettingsWv getPtr()
      Temporarily access the referenced WheelSettingsWv.
      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 WheelSettingsWV. No objects are affected.
      Specified by:
      targetVa in interface ConstJoltPhysicsObject
      Overrides:
      targetVa in class JoltPhysicsObject
      Returns:
      a virtual address (not zero)
    • toRef

      public WheelSettingsWvRef toRef()
      Create another counted reference to the native WheelSettingsWV.
      Specified by:
      toRef in class Ref
      Returns:
      a new JVM object with a new native object assigned