Class WheeledVehicleController

All Implemented Interfaces:
ConstJoltPhysicsObject, AutoCloseable, Comparable<JoltPhysicsObject>
Direct Known Subclasses:
MotorcycleController

public class WheeledVehicleController extends VehicleController
Control the acceleration and deceleration of a wheeled vehicle.
  • Method Details

    • getBrakeInput

      public float getBrakeInput()
      Return how strongly the brake pedal is pressed. The controller is unaffected. (native member: mBrakeInput)
      Returns:
      the value (≥0, ≤1)
    • getDifferentials

      public VehicleDifferentialSettings[] getDifferentials()
      Access the vehicle's differentials.
      Returns:
      a new array of JVM objects, each with a pre-existing native object assigned
    • getEngine

      public VehicleEngine getEngine()
      Access the vehicle's engine.
      Returns:
      a new JVM object with the pre-existing native object assigned
    • getForwardInput

      public float getForwardInput()
      Return the forward acceleration. The controller is unaffected. (native field: mForwardInput)
      Returns:
      the value (≥-1, ≤1)
    • getHandBrakeInput

      public float getHandBrakeInput()
      Return how strongly the hand brake is pulled. The controller is unaffected. (native field: mHandBrakeInput)
      Returns:
      the value (≥0, ≤1)
    • getRightInput

      public float getRightInput()
      Return the steering angle. The controller is unaffected. (native member: mRightInput)
      Returns:
      the steering angle (≥-1, ≤1, right=1)
    • getTransmission

      public VehicleTransmission getTransmission()
      Access the vehicle's transmission.
      Returns:
      a new JVM object with the pre-existing native object assigned
    • setBrakeInput

      public void setBrakeInput(float pressure)
      Alter how strongly the brake pedal is pressed. (native member: mBrakeInput)
      Parameters:
      pressure - the desired pressure (≥0, ≤1, default=0)
    • setDifferentialLimitedSlipRatio

      public void setDifferentialLimitedSlipRatio(float ratio)
      Alter the wheel-speed ratio of each differential, measured at the clutch. (native member: mDifferentialLimitedSlipRatio)
      Parameters:
      ratio - the desired ratio (>0)
    • setDriverInput

      public void setDriverInput(float forward, float right, float brake, float handBrake)
      Update the control inputs from the vehicle's driver.
      Parameters:
      forward - the desired driving direction and amount of acceleration (≥-1, ≤1)
      right - the desired steering angle (≥-1, ≤1)
      brake - the desired main brake pressure (≥0, ≤1)
      handBrake - the desired amount of hand braking (≥0, ≤1)
    • setForwardInput

      public void setForwardInput(float forward)
      Alter the forward acceleration. (native member: mForwardInput)
      Parameters:
      forward - the desired driving direction and accelerator pedal pressure (≥-1, ≤1, default=0)
    • setHandBrakeInput

      public void setHandBrakeInput(float pressure)
      Alter how strongly the hand brake is pulled. (native member: mHandBrakeInput)
      Parameters:
      pressure - the desired pressure (≥0, ≤1, default=0)
    • setRightInput

      public void setRightInput(float right)
      Alter the steering amount. (native member: mRightInput)
      Parameters:
      right - the desired steering amount (≥-1, ≤1, default=0, right=1)