Package com.github.stephengold.joltjni
Class VehicleEngineSettings
java.lang.Object
com.github.stephengold.joltjni.JoltPhysicsObject
com.github.stephengold.joltjni.VehicleEngineSettings
- All Implemented Interfaces:
ConstJoltPhysicsObject,ConstVehicleEngineSettings,AutoCloseable,Comparable<JoltPhysicsObject>
- Direct Known Subclasses:
VehicleEngine
Settings used to configure the engine of a
WheeledVehicleController.-
Constructor Summary
ConstructorsConstructorDescriptionInstantiate default settings.Instantiate a copy of the specified settings. -
Method Summary
Modifier and TypeMethodDescriptionfloatReturn the angular damping factor.floatReturn the engine's rotational inertia.floatReturn the maximum rotation rate.floatReturn the maximum torque.floatReturn the minimum rotation rate to avoid stalling.Access the normalized torque as a function of normalized RPM.voidsetAngularDamping(float damping) Alter the angular damping factor.voidsetInertia(float inertia) Alter the engine's rotational inertia.voidsetMaxRpm(float rpm) Alter the maximum rotation rate.voidsetMaxTorque(float torque) Alter the maximum torque.voidsetMinRpm(float rpm) Alter the minimum rotation rate to avoid stalling.voidCopy the specified curve to the normalized-torque curve.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
-
VehicleEngineSettings
public VehicleEngineSettings()Instantiate default settings. -
VehicleEngineSettings
Instantiate a copy of the specified settings.- Parameters:
original- the settings to copy (notnull, unaffected)
-
-
Method Details
-
setAngularDamping
public void setAngularDamping(float damping) Alter the angular damping factor. (native attribute: mAngularDamping)- Parameters:
damping- the desired damping factor (per second, default=0.2)
-
setInertia
public void setInertia(float inertia) Alter the engine's rotational inertia. (native attribute: mInertia)- Parameters:
inertia- the desired inertia (in kg.meter^2, default=0.5)
-
setMaxRpm
public void setMaxRpm(float rpm) Alter the maximum rotation rate. (native attribute: mMaxRPM)- Parameters:
rpm- the desired limit (in revolutions per minute, default=6000)
-
setMaxTorque
public void setMaxTorque(float torque) Alter the maximum torque. (native attribute: mMaxTorque)- Parameters:
torque- the desired limit (in Newton meters, default=500)
-
setMinRpm
public void setMinRpm(float rpm) Alter the minimum rotation rate to avoid stalling. (native attribute: mMinRPM)- Parameters:
rpm- the desired limit (in revolutions per minute, default=1000)
-
setNormalizedTorque
Copy the specified curve to the normalized-torque curve. (native attribute: mNormalizedTorque)- Parameters:
curve- the curve to copy (notnull, unaffected)
-
getAngularDamping
public float getAngularDamping()Return the angular damping factor. The settings are unaffected. (native attribute: mAngularDamping)- Specified by:
getAngularDampingin interfaceConstVehicleEngineSettings- Returns:
- the damping factor (per second)
-
getInertia
public float getInertia()Return the engine's rotational inertia. The settings are unaffected. (native attribute: mInertia)- Specified by:
getInertiain interfaceConstVehicleEngineSettings- Returns:
- the inertia (in kilogram.meter^2)
-
getMaxRpm
public float getMaxRpm()Return the maximum rotation rate. The settings are unaffected. (native attribute: mMaxRPM)- Specified by:
getMaxRpmin interfaceConstVehicleEngineSettings- Returns:
- the limit (in revolutions per minute)
-
getMaxTorque
public float getMaxTorque()Return the maximum torque. The settings are unaffected. (native attribute: mMaxTorque)- Specified by:
getMaxTorquein interfaceConstVehicleEngineSettings- Returns:
- the limit (in Newton meters)
-
getMinRpm
public float getMinRpm()Return the minimum rotation rate to avoid stalling. The settings are unaffected. (native attribute: mMinRPM)- Specified by:
getMinRpmin interfaceConstVehicleEngineSettings- Returns:
- the limit (in revolutions per minute)
-
getNormalizedTorque
Access the normalized torque as a function of normalized RPM. (native attribute: mNormalizedTorque)- Specified by:
getNormalizedTorquein interfaceConstVehicleEngineSettings- Returns:
- a new JVM object with the pre-existing native object assigned
-