Package com.github.stephengold.joltjni
Class VehicleTrackSettings
java.lang.Object
com.github.stephengold.joltjni.JoltPhysicsObject
com.github.stephengold.joltjni.VehicleTrackSettings
- All Implemented Interfaces:
ConstJoltPhysicsObject
,AutoCloseable
,Comparable<JoltPhysicsObject>
Settings to configure one track in a
TrackedVehicleController
.-
Method Summary
Modifier and TypeMethodDescriptionvoid
addWheel
(int wheelIndex) Add the specified wheel to the track.float
Return the angular damping factor.float
Return the number of gearbox rotations per driven-wheel rotation.int
Return the index of the wheel powered by the engine.float
Return the moment of inertia of the track and its wheels as seen on the driven wheel.int
Count the track's wheels.void
setDrivenWheel
(int wheelIndex) Alter which wheel is powered by the engine.Methods inherited from class com.github.stephengold.joltjni.JoltPhysicsObject
close, compareTo, equals, getContainingObject, hasAssignedNativeObject, hashCode, ownsNativeObject, setVirtualAddress, setVirtualAddress, startCleaner, targetVa, toString, va
-
Method Details
-
addWheel
public void addWheel(int wheelIndex) Add the specified wheel to the track.- Parameters:
wheelIndex
- the index (among the vehicle's wheels) of the wheel to add (≥0)
-
getAngularDamping
public float getAngularDamping()Return the angular damping factor. The settings are unaffected. (native attribute: mAngularDamping)- Returns:
- the damping factor (per second)
-
getDifferentialRatio
public float getDifferentialRatio()Return the number of gearbox rotations per driven-wheel rotation. The settings are unaffected. (native attribute: mDifferentialRatio)- Returns:
- the ratio
-
getDrivenWheel
public int getDrivenWheel()Return the index of the wheel powered by the engine. The settings are unaffected. (native attribute: mDrivenWheel)- Returns:
- the index of the driven wheel (≥0)
-
getInertia
public float getInertia()Return the moment of inertia of the track and its wheels as seen on the driven wheel. The settings are unaffected. (native attribute: mInertia)- Returns:
- the moment (in kilogram.meter^2)
-
getNumWheels
public int getNumWheels()Count the track's wheels. The settings are unaffected. (native attribute: mWheels)- Returns:
- the count (≥0)
-
setDrivenWheel
public void setDrivenWheel(int wheelIndex) Alter which wheel is powered by the engine. (native attribute: mDrivenWheel)- Parameters:
wheelIndex
- the index of the desired wheel (≥0, default=0)
-