Package com.github.stephengold.joltjni
Class WheeledVehicleController
java.lang.Object
com.github.stephengold.joltjni.JoltPhysicsObject
com.github.stephengold.joltjni.NonCopyable
com.github.stephengold.joltjni.VehicleController
com.github.stephengold.joltjni.WheeledVehicleController
- All Implemented Interfaces:
ConstJoltPhysicsObject,RefTarget,AutoCloseable,Comparable<ConstJoltPhysicsObject>
Control the acceleration and deceleration of a wheeled vehicle.
-
Method Summary
Modifier and TypeMethodDescriptionintCount the active references to the nativeWheeledVehicleController.voidsetDriverInput(float forward, float right, float brake, float handBrake) Update the control inputs from the vehicle's driver.voidMark the nativeWheeledVehicleControlleras embedded.toRef()Create a counted reference to the nativeWheeledVehicleController.Methods inherited from class com.github.stephengold.joltjni.VehicleController
getConstraintMethods inherited from class com.github.stephengold.joltjni.JoltPhysicsObject
close, compareTo, equals, hasAssignedNativeObject, hashCode, ownsNativeObject, setVirtualAddress, startCleaner, toString, va
-
Method Details
-
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)
-
getRefCount
public int getRefCount()Count the active references to the nativeWheeledVehicleController. The controller is unaffected.- Specified by:
getRefCountin interfaceRefTarget- Returns:
- the count (≥0)
-
setEmbedded
public void setEmbedded()Mark the nativeWheeledVehicleControlleras embedded.- Specified by:
setEmbeddedin interfaceRefTarget
-
toRef
Create a counted reference to the nativeWheeledVehicleController.
-