Package com.github.stephengold.joltjni
Class VehicleTrackSettings
java.lang.Object
com.github.stephengold.joltjni.JoltPhysicsObject
com.github.stephengold.joltjni.VehicleTrackSettings
- All Implemented Interfaces:
ConstJoltPhysicsObject,ConstVehicleTrackSettings,AutoCloseable,Comparable<JoltPhysicsObject>
Settings to configure one track in a
TrackedVehicleController.-
Constructor Summary
ConstructorsConstructorDescriptionInstantiate default settings.Instantiate a copy of the specified settings. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddWheel(int wheelIndex) Add the specified wheel to the track.floatReturn the angular damping factor.floatReturn the number of gearbox rotations per driven-wheel rotation.intReturn the index of the wheel powered by the engine.floatReturn the moment of inertia of the track and its wheels as seen on the driven wheel.intCount the track's wheels.voidset(ConstVehicleTrackSettings source) Copy the argument to the current settings.voidsetAngularDamping(float factor) Alter the angular damping factor.voidsetDifferentialRatio(float ratio) Alter the number of gearbox rotations per driven-wheel rotation.voidsetDrivenWheel(int wheelIndex) Alter which wheel is powered by the engine.voidsetInertia(float inertia) Alter the moment of inertia of the track and its wheels as seen on the driven wheel.Methods inherited from class com.github.stephengold.joltjni.JoltPhysicsObject
close, compareTo, equals, getContainingObject, hasAssignedNativeObject, hashCode, isCleanerStarted, ownsNativeObject, setVirtualAddress, setVirtualAddress, startCleaner, targetVa, toString, vaMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.lang.Comparable
compareToMethods inherited from interface com.github.stephengold.joltjni.readonly.ConstJoltPhysicsObject
close, hasAssignedNativeObject, ownsNativeObject, targetVa
-
Constructor Details
-
VehicleTrackSettings
public VehicleTrackSettings()Instantiate default settings. -
VehicleTrackSettings
Instantiate a copy of the specified settings.- Parameters:
original- the settings to copy (notnull, unaffected)
-
-
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)
-
set
Copy the argument to the current settings.- Parameters:
source- the settings to copy (notnull, unaffected)
-
setAngularDamping
public void setAngularDamping(float factor) Alter the angular damping factor. (native attribute: mAngularDamping)- Parameters:
factor- the desired damping factor (per second, default=0.5)
-
setDifferentialRatio
public void setDifferentialRatio(float ratio) Alter the number of gearbox rotations per driven-wheel rotation. (native attribute: mDifferentialRatio)- Parameters:
ratio- the desired ratio (default=6)
-
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)
-
setInertia
public void setInertia(float inertia) Alter the moment of inertia of the track and its wheels as seen on the driven wheel. (native attribute: mInertia)- Parameters:
inertia- the moment (in kilogram.meter^2, default=10)
-
getAngularDamping
public float getAngularDamping()Return the angular damping factor. The settings are unaffected. (native attribute: mAngularDamping)- Specified by:
getAngularDampingin interfaceConstVehicleTrackSettings- 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)- Specified by:
getDifferentialRatioin interfaceConstVehicleTrackSettings- Returns:
- the ratio
-
getDrivenWheel
public int getDrivenWheel()Return the index of the wheel powered by the engine. The settings are unaffected. (native attribute: mDrivenWheel)- Specified by:
getDrivenWheelin interfaceConstVehicleTrackSettings- 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)- Specified by:
getInertiain interfaceConstVehicleTrackSettings- Returns:
- the moment (in kilogram.meter^2)
-
getNumWheels
public int getNumWheels()Count the track's wheels. The settings are unaffected. (native attribute: mWheels)- Specified by:
getNumWheelsin interfaceConstVehicleTrackSettings- Returns:
- the count (≥0)
-