Package com.github.stephengold.joltjni
Class TrackedVehicleController
java.lang.Object
com.github.stephengold.joltjni.JoltPhysicsObject
com.github.stephengold.joltjni.NonCopyable
com.github.stephengold.joltjni.VehicleController
com.github.stephengold.joltjni.TrackedVehicleController
- All Implemented Interfaces:
ConstJoltPhysicsObject
,AutoCloseable
,Comparable<JoltPhysicsObject>
Control the acceleration and deceleration of a vehicle with tracks.
-
Method Summary
Modifier and TypeMethodDescriptionAccess the vehicle's engine.void
setDriverInput
(float forward, float leftRatio, float rightRatio, float brake) Update the control inputs from the vehicle's driver.void
setRpmMeter
(Vec3Arg location, float size) Configure debug rendering of the RPM meter.Methods inherited from class com.github.stephengold.joltjni.VehicleController
getConstraint
Methods inherited from class com.github.stephengold.joltjni.JoltPhysicsObject
close, compareTo, equals, getContainingObject, hasAssignedNativeObject, hashCode, ownsNativeObject, setVirtualAddress, setVirtualAddress, startCleaner, targetVa, toString, va
-
Method Details
-
getEngine
Access the vehicle's engine.- Returns:
- a new JVM object with the pre-existing native object assigned
-
setDriverInput
public void setDriverInput(float forward, float leftRatio, float rightRatio, float brake) Update the control inputs from the vehicle's driver.- Parameters:
forward
- the desired driving direction and amount of acceleration (≥-1, ≤1)leftRatio
- the left-track rotation-rate ratio (≥-1, ≤1)rightRatio
- the right-track rotation-rate ratio (≥-1, ≤1)brake
- the desired brake pressure (≥0, ≤1)
-
setRpmMeter
Configure debug rendering of the RPM meter.- Parameters:
location
- the desired location of the meter (not null, unaffected)size
- the desired size of the meter
-