Package com.github.stephengold.joltjni
Class VehicleTransmissionSettings
java.lang.Object
com.github.stephengold.joltjni.JoltPhysicsObject
com.github.stephengold.joltjni.VehicleTransmissionSettings
- All Implemented Interfaces:
ConstJoltPhysicsObject,ConstVehicleTransmissionSettings,AutoCloseable,Comparable<JoltPhysicsObject>
- Direct Known Subclasses:
VehicleTransmission
public class VehicleTransmissionSettings
extends JoltPhysicsObject
implements ConstVehicleTransmissionSettings
Settings used to configure the transmission (gearbox) of a
WheeledVehicleController.-
Constructor Summary
ConstructorsConstructorDescriptionInstantiate default settings.Instantiate a copy of the specified settings. -
Method Summary
Modifier and TypeMethodDescriptionfloatReturn how long it takes to release the clutch inAutomode.floatReturn the total torque applied by the clutch when fully engaged.float[]Return the number of engine rotations per gearbox rotation for each forward gear.getMode()Return the type of transmission.float[]Return the number of engine rotations per gearbox rotation for each reverse gear.floatReturn the maximum engine RPMs for downshifting inAutomode.floatReturn the minimum engine RPMs for upshifting inAutomode.floatReturn the minimum time between shifts inAutomode.floatReturn how long it takes to shift gears inAutomode.voidrestoreBinaryState(StreamIn stream) Load the settings from the specified binary stream.voidsaveBinaryState(StreamOut stream) Save the settings to the specified binary stream.voidsetClutchReleaseTime(float latency) Alter how long it takes to release the clutch inAutomode.voidsetClutchStrength(float strength) Alter the total torque applied by the clutch when fully engaged.voidsetGearRatios(float... ratios) Alter the number of engine rotations per gearbox rotation for each forward gear.voidsetMode(ETransmissionMode mode) Alter the type of transmission.voidsetReverseGearRatios(float... ratios) Alter the number of engine rotations per gearbox rotation for each reverse gear.voidsetShiftDownRpm(float rpm) Alter the maximum engine RPMs for downshifting inAutomode.voidsetShiftUpRpm(float rpm) Alter the minimum engine RPMs for upshifting inAutomode.voidsetSwitchLatency(float latency) Alter the minimum time between shifts inAutomode.voidsetSwitchTime(float latency) Alter how long it takes to shift gears inAutomode.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
-
VehicleTransmissionSettings
public VehicleTransmissionSettings()Instantiate default settings. -
VehicleTransmissionSettings
Instantiate a copy of the specified settings.- Parameters:
original- the settings to copy (notnull, unaffected)
-
-
Method Details
-
restoreBinaryState
Load the settings from the specified binary stream.- Parameters:
stream- the stream to read from (notnull)
-
setClutchReleaseTime
public void setClutchReleaseTime(float latency) Alter how long it takes to release the clutch inAutomode. (native attribute: mClutchReleaseTime)- Parameters:
latency- the desired latency (in seconds, default=0.3)
-
setClutchStrength
public void setClutchStrength(float strength) Alter the total torque applied by the clutch when fully engaged. (native attribute: mClutchStrength)- Parameters:
strength- the desired strength (default=10)
-
setGearRatios
public void setGearRatios(float... ratios) Alter the number of engine rotations per gearbox rotation for each forward gear. The first element is for 1st gear. (native attribute: mGearRatios)- Parameters:
ratios- the desired ratios (not null)
-
setMode
Alter the type of transmission. (native attribute: mMode)- Parameters:
mode- the desired mode (not null, default=Auto)
-
setReverseGearRatios
public void setReverseGearRatios(float... ratios) Alter the number of engine rotations per gearbox rotation for each reverse gear. (native attribute: mReverseGearRatios)- Parameters:
ratios- the desired ratios (not null)
-
setShiftDownRpm
public void setShiftDownRpm(float rpm) Alter the maximum engine RPMs for downshifting inAutomode. (native attribute: mShiftDownRPM)- Parameters:
rpm- (default=2000)
-
setShiftUpRpm
public void setShiftUpRpm(float rpm) Alter the minimum engine RPMs for upshifting inAutomode. (native attribute: mShiftUpRPM)- Parameters:
rpm- (default=4000)
-
setSwitchLatency
public void setSwitchLatency(float latency) Alter the minimum time between shifts inAutomode. (native attribute: mSwitchLatency)- Parameters:
latency- the desired latency (in seconds)
-
setSwitchTime
public void setSwitchTime(float latency) Alter how long it takes to shift gears inAutomode. (native attribute: mSwitchTime)- Parameters:
latency- the desired latency (in seconds)
-
getClutchReleaseTime
public float getClutchReleaseTime()Return how long it takes to release the clutch inAutomode. The settings are unaffected. (native attribute: mClutchReleaseTime)- Specified by:
getClutchReleaseTimein interfaceConstVehicleTransmissionSettings- Returns:
- the latency (in seconds)
-
getClutchStrength
public float getClutchStrength()Return the total torque applied by the clutch when fully engaged. The settings are unaffected. (native attribute: mClutchStrength)- Specified by:
getClutchStrengthin interfaceConstVehicleTransmissionSettings- Returns:
- the strength
-
getGearRatios
public float[] getGearRatios()Return the number of engine rotations per gearbox rotation for each forward gear. The first element is for 1st gear. The settings are unaffected. (native attribute: mGearRatios)- Specified by:
getGearRatiosin interfaceConstVehicleTransmissionSettings- Returns:
- a new array
-
getMode
Return the type of transmission. The settings are unaffected. (native attribute: mMode)- Specified by:
getModein interfaceConstVehicleTransmissionSettings- Returns:
- an enum value (not null)
-
getReverseGearRatios
public float[] getReverseGearRatios()Return the number of engine rotations per gearbox rotation for each reverse gear. The settings are unaffected. (native attribute: mReverseGearRatios)- Specified by:
getReverseGearRatiosin interfaceConstVehicleTransmissionSettings- Returns:
- a new array
-
getShiftDownRpm
public float getShiftDownRpm()Return the maximum engine RPMs for downshifting inAutomode. The settings are unaffected. (native attribute: mShiftDownRPM)- Specified by:
getShiftDownRpmin interfaceConstVehicleTransmissionSettings- Returns:
- the threshold rate (in revolutions per minute)
-
getShiftUpRpm
public float getShiftUpRpm()Return the minimum engine RPMs for upshifting inAutomode. The settings are unaffected. (native attribute: mShiftUpRPM)- Specified by:
getShiftUpRpmin interfaceConstVehicleTransmissionSettings- Returns:
- the threshold rate (in revolutions per minute)
-
getSwitchLatency
public float getSwitchLatency()Return the minimum time between shifts inAutomode. The settings are unaffected. (native attribute: mSwitchLatency)- Specified by:
getSwitchLatencyin interfaceConstVehicleTransmissionSettings- Returns:
- the latency (in seconds)
-
getSwitchTime
public float getSwitchTime()Return how long it takes to shift gears inAutomode. The settings are unaffected. (native attribute: mSwitchTime)- Specified by:
getSwitchTimein interfaceConstVehicleTransmissionSettings- Returns:
- the latency (in seconds)
-
saveBinaryState
Save the settings to the specified binary stream. The settings are unaffected.- Specified by:
saveBinaryStatein interfaceConstVehicleTransmissionSettings- Parameters:
stream- the stream to write to (notnull)
-