Package com.github.stephengold.joltjni
Class VehicleDifferentialSettings
java.lang.Object
com.github.stephengold.joltjni.JoltPhysicsObject
com.github.stephengold.joltjni.VehicleDifferentialSettings
- All Implemented Interfaces:
ConstJoltPhysicsObject
,AutoCloseable
,Comparable<JoltPhysicsObject>
Settings used to configure the differential of a
WheeledVehicleController
.-
Method Summary
Modifier and TypeMethodDescriptionfloat
Return the number of gearbox rotations per wheel rotation.float
Return the fraction of the engine's torque that is applied to this differential.int
Return the index of the left wheel.float
Return the ratio of maximum wheel speed to minimum wheel speed.int
Return the index of the right wheel.void
setDifferentialRatio
(float ratio) Alter the number of gearbox rotations per wheel rotation.float
setEngineTorqueRatio
(float fraction) Alter the fraction of the engine's torque that is applied to this differential.void
setLeftWheel
(int wheelIndex) Alter which left wheel is assigned to the differential.void
setLimitedSlipRatio
(float ratio) Alter the ratio of maximum wheel speed to minimum wheel speed.void
setRightWheel
(int wheelIndex) Alter which right wheel is assigned to the differential.Methods inherited from class com.github.stephengold.joltjni.JoltPhysicsObject
close, compareTo, equals, getContainingObject, hasAssignedNativeObject, hashCode, ownsNativeObject, setVirtualAddress, setVirtualAddress, startCleaner, targetVa, toString, va
-
Method Details
-
getDifferentialRatio
public float getDifferentialRatio()Return the number of gearbox rotations per wheel rotation. The settings are unaffected. (native attribute: mDifferentialRatio)- Returns:
- the ratio
-
getEngineTorqueRatio
public float getEngineTorqueRatio()Return the fraction of the engine's torque that is applied to this differential. The settings are unaffected. (native attribute: mEngineTorqueRatio)- Returns:
- the fraction
-
getLeftWheel
public int getLeftWheel()Return the index of the left wheel. The settings are unaffected. (native attribute: mLeftWheel)- Returns:
- the index of the wheel (≥0) or -1 for none
-
getLimitedSlipRatio
public float getLimitedSlipRatio()Return the ratio of maximum wheel speed to minimum wheel speed. The settings are unaffected. (native member: mLimitedSlipRatio)- Returns:
- the ratio (>1,
FLT_MAX
for an open differential)
-
getRightWheel
public int getRightWheel()Return the index of the right wheel. The settings are unaffected. (native attribute: mRightWheel)- Returns:
- the index of the wheel (≥0) or -1 for none
-
setDifferentialRatio
public void setDifferentialRatio(float ratio) Alter the number of gearbox rotations per wheel rotation. (native attribute: mDifferentialRatio)- Parameters:
ratio
- the desired ratio (default=3.42)
-
setEngineTorqueRatio
public float setEngineTorqueRatio(float fraction) Alter the fraction of the engine's torque that is applied to this differential. (native attribute: mEngineTorqueRatio)- Parameters:
fraction
- the desired ratio (default=1)- Returns:
- the fraction, for chaining
-
setLeftWheel
public void setLeftWheel(int wheelIndex) Alter which left wheel is assigned to the differential. (native attribute: mLeftWheel)- Parameters:
wheelIndex
- the index of the wheel (≥0) or -1 for none (default=-1)
-
setLimitedSlipRatio
public void setLimitedSlipRatio(float ratio) Alter the ratio of maximum wheel speed to minimum wheel speed. When this ratio is exceeded, all torque gets distributed to the slowest wheel. (native member: mLimitedSlipRatio)- Parameters:
ratio
- the desired ratio (>1,FLT_MAX
for an open differential, default=1.4)
-
setRightWheel
public void setRightWheel(int wheelIndex) Alter which right wheel is assigned to the differential. (native attribute: mRightWheel)- Parameters:
wheelIndex
- the index of the wheel (≥0) or -1 for none (default=-1)
-