Package com.github.stephengold.joltjni
Class VehicleEngineSettings
java.lang.Object
com.github.stephengold.joltjni.JoltPhysicsObject
com.github.stephengold.joltjni.VehicleEngineSettings
- All Implemented Interfaces:
ConstJoltPhysicsObject
,AutoCloseable
,Comparable<JoltPhysicsObject>
- Direct Known Subclasses:
VehicleEngine
Settings used to configure the engine of a
WheeledVehicleController
.-
Method Summary
Modifier and TypeMethodDescriptionfloat
Return the angular damping factor.float
Return the engine's rotational inertia.float
Return the maximum rotation rate.float
Return the maximum torque.float
Return the minimum rotation rate to avoid stalling.void
setAngularDamping
(float damping) Alter the angular damping factor.void
setInertia
(float inertia) Alter the engine's rotational inertia.void
setMaxRpm
(float rpm) Alter the maximum rotation rate.void
setMaxTorque
(float torque) Alter the maximum torque.void
setMinRpm
(float rpm) Alter the minimum rotation rate to avoid stalling.Methods inherited from class com.github.stephengold.joltjni.JoltPhysicsObject
close, compareTo, equals, getContainingObject, hasAssignedNativeObject, hashCode, ownsNativeObject, setVirtualAddress, setVirtualAddress, startCleaner, targetVa, toString, va
-
Method Details
-
getAngularDamping
public float getAngularDamping()Return the angular damping factor. The settings are unaffected. (native attribute: mAngularDamping)- Returns:
- the damping factor (per second)
-
getInertia
public float getInertia()Return the engine's rotational inertia. The settings are unaffected. (native attribute: mInertia)- Returns:
- the inertia (in kilogram.meter^2)
-
getMaxRpm
public float getMaxRpm()Return the maximum rotation rate. The settings are unaffected. (native attribute: mMaxRPM)- Returns:
- the limit (in revolutions per minute)
-
getMaxTorque
public float getMaxTorque()Return the maximum torque. The settings are unaffected. (native attribute: mMaxTorque)- 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)- Returns:
- the limit (in revolutions per minute)
-
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)
-