Package com.github.stephengold.joltjni
Class MotorcycleControllerSettings
java.lang.Object
com.github.stephengold.joltjni.JoltPhysicsObject
com.github.stephengold.joltjni.SerializableObject
com.github.stephengold.joltjni.VehicleControllerSettings
com.github.stephengold.joltjni.WheeledVehicleControllerSettings
com.github.stephengold.joltjni.MotorcycleControllerSettings
- All Implemented Interfaces:
ConstJoltPhysicsObject,ConstMotorcycleControllerSettings,ConstSerializableObject,ConstVehicleControllerSettings,ConstWheeledVehicleControllerSettings,RefTarget,AutoCloseable,Comparable<JoltPhysicsObject>
public class MotorcycleControllerSettings
extends WheeledVehicleControllerSettings
implements ConstMotorcycleControllerSettings
Settings used to construct a
MotorcycleController.-
Constructor Summary
ConstructorsConstructorDescriptionInstantiate default settings.Instantiate a copy of the specified settings. -
Method Summary
Modifier and TypeMethodDescriptionfloatReturn the lean smoothing factor.floatReturn the spring constant for the lean spring.floatReturn the damping constant for the lean spring.floatReturn the coefficient of additional force to control the lean angle.floatReturn the rate of decay of the angle integral when the wheels are unsupported.floatReturn the maximum lean angle (during turns).voidset(ConstMotorcycleControllerSettings source) Copy the argument to the current settings.voidsetLeanSmoothingFactor(float factor) Alter the lean smoothing factor.voidsetLeanSpringConstant(float k) Alter the spring constant for the lean spring.voidsetLeanSpringDamping(float damping) Alter the damping constant for the lean spring.voidsetLeanSpringIntegrationCoefficient(float coefficient) Alter the coefficient of additional force to control the lean angle.voidsetLeanSpringIntegrationCoefficientDecay(float decay) Alter the rate of decay of the angle integral when the wheels are unsupported.voidsetMaxLeanAngle(float angle) Alter the maximum lean angle (during turns).Methods inherited from class com.github.stephengold.joltjni.WheeledVehicleControllerSettings
getDifferential, getDifferentialLimitedSlipRatio, getEngine, getNumDifferentials, getTransmission, set, setDifferentialLimitedSlipRatio, setNumDifferentialsMethods inherited from class com.github.stephengold.joltjni.VehicleControllerSettings
getRefCount, restoreBinaryState, saveBinaryState, setEmbedded, setVirtualAddressAsCoOwner, toRefMethods inherited from class com.github.stephengold.joltjni.SerializableObject
getRttiMethods 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, targetVaMethods inherited from interface com.github.stephengold.joltjni.readonly.ConstSerializableObject
getRttiMethods inherited from interface com.github.stephengold.joltjni.readonly.ConstVehicleControllerSettings
saveBinaryStateMethods inherited from interface com.github.stephengold.joltjni.readonly.ConstWheeledVehicleControllerSettings
getDifferential, getDifferentialLimitedSlipRatio, getEngine, getNumDifferentials, getTransmission
-
Constructor Details
-
MotorcycleControllerSettings
public MotorcycleControllerSettings()Instantiate default settings. -
MotorcycleControllerSettings
Instantiate a copy of the specified settings.- Parameters:
original- the settings to copy (notnull, unaffected)
-
-
Method Details
-
set
Copy the argument to the current settings.- Parameters:
source- the settings to copy (notnull, unaffected)
-
setLeanSmoothingFactor
public void setLeanSmoothingFactor(float factor) Alter the lean smoothing factor. (native attribute: mLeanSmoothingFactor)- Parameters:
factor- the desired factor (default=0.8)
-
setLeanSpringConstant
public void setLeanSpringConstant(float k) Alter the spring constant for the lean spring. (native attribute: mLeanSpringConstant)- Parameters:
k- the desired spring constant (default=5000)
-
setLeanSpringDamping
public void setLeanSpringDamping(float damping) Alter the damping constant for the lean spring. (native attribute: mLeanSpringDamping)- Parameters:
damping- the desired damping constant (default=1000)
-
setLeanSpringIntegrationCoefficient
public void setLeanSpringIntegrationCoefficient(float coefficient) Alter the coefficient of additional force to control the lean angle. (native attribute: mLeanSpringIntegrationCoefficient)- Parameters:
coefficient- the desired integration coefficient (default=0)
-
setLeanSpringIntegrationCoefficientDecay
public void setLeanSpringIntegrationCoefficientDecay(float decay) Alter the rate of decay of the angle integral when the wheels are unsupported. (native attribute: mLeanSpringIntegrationCoefficientDecay)- Parameters:
decay- the desired rate of decay (per second, default=4)
-
setMaxLeanAngle
public void setMaxLeanAngle(float angle) Alter the maximum lean angle (during turns). (native attribute: mMaxLeanAngle)- Parameters:
angle- the desired angle (in radians, default=Pi/4)
-
getLeanSmoothingFactor
public float getLeanSmoothingFactor()Return the lean smoothing factor. The settings are unaffected. (native attribute: mLeanSmoothingFactor)- Specified by:
getLeanSmoothingFactorin interfaceConstMotorcycleControllerSettings- Returns:
- the factor
-
getLeanSpringConstant
public float getLeanSpringConstant()Return the spring constant for the lean spring. The settings are unaffected. (native attribute: mLeanSpringConstant)- Specified by:
getLeanSpringConstantin interfaceConstMotorcycleControllerSettings- Returns:
- the spring constant
-
getLeanSpringDamping
public float getLeanSpringDamping()Return the damping constant for the lean spring. The settings are unaffected. (native attribute: mLeanSpringDamping)- Specified by:
getLeanSpringDampingin interfaceConstMotorcycleControllerSettings- Returns:
- the damping constant
-
getLeanSpringIntegrationCoefficient
public float getLeanSpringIntegrationCoefficient()Return the coefficient of additional force to control the lean angle. The settings are unaffected. (native attribute: mLeanSpringIntegrationCoefficient)- Specified by:
getLeanSpringIntegrationCoefficientin interfaceConstMotorcycleControllerSettings- Returns:
- the integration coefficient
-
getLeanSpringIntegrationCoefficientDecay
public float getLeanSpringIntegrationCoefficientDecay()Return the rate of decay of the angle integral when the wheels are unsupported. The settings are unaffected. (native attribute: mLeanSpringIntegrationCoefficientDecay)- Specified by:
getLeanSpringIntegrationCoefficientDecayin interfaceConstMotorcycleControllerSettings- Returns:
- the rate of decay (per second)
-
getMaxLeanAngle
public float getMaxLeanAngle()Return the maximum lean angle (during turns). The settings are unaffected. (native attribute: mMaxLeanAngle)- Specified by:
getMaxLeanAnglein interfaceConstMotorcycleControllerSettings- Returns:
- the angle (in radians)
-