All Implemented Interfaces:
ConstJoltPhysicsObject, ConstWheel, AutoCloseable, Comparable<JoltPhysicsObject>
Direct Known Subclasses:
WheelTv, WheelWv

public class Wheel extends NonCopyable implements ConstWheel
A single wheel of a vehicle.
  • Method Details

    • getAngularVelocity

      public float getAngularVelocity()
      Return the wheel's angular velocity.
      Specified by:
      getAngularVelocity in interface ConstWheel
      Returns:
      the angular velocity (in radians per second, positive when the vehicle is moving forward)
    • getContactBodyId

      public int getContactBodyId()
      Return the ID of the body that's supporting the wheel. (native method: GetContactBodyID)
      Specified by:
      getContactBodyId in interface ConstWheel
      Returns:
      the body ID
    • getContactLateral

      public Vec3 getContactLateral()
      Copy the wheel's lateral (sideways) direction.
      Specified by:
      getContactLateral in interface ConstWheel
      Returns:
      a new direction vector (in system coordinates)
    • getContactLongitudinal

      public Vec3 getContactLongitudinal()
      Copy the wheel's longitudinal direction.
      Specified by:
      getContactLongitudinal in interface ConstWheel
      Returns:
      a new direction vector (in system coordinates)
    • getContactNormal

      public Vec3 getContactNormal()
      Copy the contact normal direction.
      Specified by:
      getContactNormal in interface ConstWheel
      Returns:
      a new direction vector (in system coordinates)
    • getContactPointVelocity

      public Vec3 getContactPointVelocity()
      Copy the velocity of the contact point.
      Specified by:
      getContactPointVelocity in interface ConstWheel
      Returns:
      a new velocity vector (meters per second in system coordinates)
    • getContactPosition

      public RVec3 getContactPosition()
      Copy the location of the contact point.
      Specified by:
      getContactPosition in interface ConstWheel
      Returns:
      a new location vector (in system coordinates)
    • getContactSubShapeId

      public int getContactSubShapeId()
      Return ID of the sub-shape that's supporting the vehicle. (native method: GetContactSubShapeID)
      Specified by:
      getContactSubShapeId in interface ConstWheel
      Returns:
      the sub-shape ID
    • getLateralLambda

      public float getLateralLambda()
      Return the lateral (sideways) component of the impulse applied to the wheel.
      Specified by:
      getLateralLambda in interface ConstWheel
      Returns:
      the impulse component (in Newton seconds)
    • getLongitudinalLambda

      public float getLongitudinalLambda()
      Return the forward component of the impulse applied to the wheel.
      Specified by:
      getLongitudinalLambda in interface ConstWheel
      Returns:
      the impulse component (in Newton seconds)
    • getRotationAngle

      public float getRotationAngle()
      Return the wheel's rotation angle.
      Specified by:
      getRotationAngle in interface ConstWheel
      Returns:
      the angle (in radians)
    • getSettings

      public ConstWheelSettings getSettings()
      Access the settings used to create this wheel.
      Specified by:
      getSettings in interface ConstWheel
      Returns:
      a new JVM object with the pre-existing native object assigned
    • getSteerAngle

      public float getSteerAngle()
      Return the steering angle.
      Specified by:
      getSteerAngle in interface ConstWheel
      Returns:
      the leftward angle (in radians, ≥-Pi, ≤Pi)
    • getSuspensionLambda

      public float getSuspensionLambda()
      Return the total impulse applied to the suspension.
      Specified by:
      getSuspensionLambda in interface ConstWheel
      Returns:
      the magnitude of the impulse (in Newton seconds)
    • getSuspensionLength

      public float getSuspensionLength()
      Return the length of the suspension.
      Specified by:
      getSuspensionLength in interface ConstWheel
      Returns:
      the distance between the axle and the hard point (in meters)
    • hasContact

      public boolean hasContact()
      Test whether the wheel is supported.
      Specified by:
      hasContact in interface ConstWheel
      Returns:
      true if supported, otherwise false
    • hasHitHardPoint

      public boolean hasHitHardPoint()
      Test whether the suspension has hit its hard point.
      Specified by:
      hasHitHardPoint in interface ConstWheel
      Returns:
      true if hit, otherwise false