Package com.github.stephengold.joltjni
Class VehicleConstraintSettings
java.lang.Object
com.github.stephengold.joltjni.JoltPhysicsObject
com.github.stephengold.joltjni.SerializableObject
com.github.stephengold.joltjni.ConstraintSettings
com.github.stephengold.joltjni.VehicleConstraintSettings
- All Implemented Interfaces:
ConstConstraintSettings,ConstJoltPhysicsObject,ConstSerializableObject,ConstVehicleConstraintSettings,RefTarget,AutoCloseable,Comparable<JoltPhysicsObject>
public class VehicleConstraintSettings
extends ConstraintSettings
implements ConstVehicleConstraintSettings
Settings used to construct a
VehicleConstraint.-
Constructor Summary
ConstructorsConstructorDescriptionInstantiate default settings.Instantiate a copy of the specified settings. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddWheels(WheelSettings... wheelSettingsArray) Append the specified wheel settings.getAntiRollBar(int barIndex) Access the settings for the specified anti-roll bar.Access the controller settings.Copy the "forward" vector.floatReturn the vehicle's maximum pitch/roll angle.intCount the anti-roll bars.intCount the wheels.getUp()Copy the "up" vector.getWheel(int wheelIndex) Access the settings of the specified wheel.Enumerate all wheel settings.voidsetController(VehicleControllerSettings controllerSettings) Alter how the vehicle accelerates and decelerates.voidsetForward(Vec3Arg forward) Alter the forward direction.voidsetMaxPitchRollAngle(float angle) Alter the vehicle's maximum pitch/roll angle.voidsetNumAntiRollBars(int count) Alter the number of anti-roll bars.voidAlter the up direction.toRef()Create a counted reference to the nativeVehicleConstraintSettings.Methods inherited from class com.github.stephengold.joltjni.ConstraintSettings
getConstraintPriority, getControllerType, getDrawConstraintSize, getEnabled, getNumPositionStepsOverride, getNumVelocityStepsOverride, getRefCount, saveBinaryState, setConstraintPriority, setDrawConstraintSize, setEmbedded, setEnabled, setNumPositionStepsOverride, setNumVelocityStepsOverride, setVirtualAddressAsCoOwner, sRestoreFromBinaryStateMethods 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.ConstConstraintSettings
getConstraintPriority, getControllerType, getDrawConstraintSize, getEnabled, getNumPositionStepsOverride, getNumVelocityStepsOverride, saveBinaryStateMethods inherited from interface com.github.stephengold.joltjni.readonly.ConstJoltPhysicsObject
close, hasAssignedNativeObject, ownsNativeObject, targetVaMethods inherited from interface com.github.stephengold.joltjni.readonly.ConstSerializableObject
getRtti
-
Constructor Details
-
VehicleConstraintSettings
public VehicleConstraintSettings()Instantiate default settings. -
VehicleConstraintSettings
Instantiate a copy of the specified settings.- Parameters:
original- the settings to copy (notnull, unaffected)
-
-
Method Details
-
addWheels
Append the specified wheel settings. (native attribute: mWheels)- Parameters:
wheelSettingsArray- the wheel settings to append
-
setController
Alter how the vehicle accelerates and decelerates. (native attribute: mController)- Parameters:
controllerSettings- the desired settings (not null, default=null)
-
setForward
Alter the forward direction. (native attribute: mForward)- Parameters:
forward- the desired forward direction (not null, unaffected, default=(0,0,1))
-
setMaxPitchRollAngle
public void setMaxPitchRollAngle(float angle) Alter the vehicle's maximum pitch/roll angle. (native attribute: mMaxPitchRollAngle)- Parameters:
angle- the desired limit angle (in radians, default=Pi)
-
setNumAntiRollBars
public void setNumAntiRollBars(int count) Alter the number of anti-roll bars. (native attribute: mAntiRollBars)- Parameters:
count- the desired number (≥0, default=0)
-
setUp
Alter the up direction. (native attribute: mUp)- Parameters:
up- the desired up direction (not null, unaffected, default=(0,1,0))
-
getAntiRollBar
Access the settings for the specified anti-roll bar. (native field: mAntiRollBars)- Specified by:
getAntiRollBarin interfaceConstVehicleConstraintSettings- Parameters:
barIndex- the index of the anti-roll bar to access (≥0, <numBars)- Returns:
- a new JVM object with the pre-existing native object assigned
-
getController
Access the controller settings.- Specified by:
getControllerin interfaceConstVehicleConstraintSettings- Returns:
- a new JVM object with the pre-existing native object assigned, or
nullif none
-
getForward
Copy the "forward" vector. The settings are unaffected. (native attribute: mForward)- Specified by:
getForwardin interfaceConstVehicleConstraintSettings- Returns:
- a new direction vector
-
getMaxPitchRollAngle
public float getMaxPitchRollAngle()Return the vehicle's maximum pitch/roll angle. The settings are unaffected. (native attribute: mMaxPitchRollAngle)- Specified by:
getMaxPitchRollAnglein interfaceConstVehicleConstraintSettings- Returns:
- the limit angle (in radians)
-
getNumAntiRollBars
public int getNumAntiRollBars()Count the anti-roll bars. The settings are unaffected. (native attribute: mAntiRollBars)- Specified by:
getNumAntiRollBarsin interfaceConstVehicleConstraintSettings- Returns:
- the count (≥0)
-
getNumWheels
public int getNumWheels()Count the wheels. The settings are unaffected. (native attribute: mWheels)- Specified by:
getNumWheelsin interfaceConstVehicleConstraintSettings- Returns:
- the count (≥0)
-
getUp
Copy the "up" vector. The settings are unaffected. (native attribute: mUp)- Specified by:
getUpin interfaceConstVehicleConstraintSettings- Returns:
- a new direction vector
-
getWheel
Access the settings of the specified wheel. (native attribute: mWheels)- Specified by:
getWheelin interfaceConstVehicleConstraintSettings- Parameters:
wheelIndex- which wheel (≥0, <numWheels)- Returns:
- a new JVM object with the pre-existing native object assigned, or
nullif none
-
getWheels
Enumerate all wheel settings. The settings are unaffected. (native attribute: mWheels)- Specified by:
getWheelsin interfaceConstVehicleConstraintSettings- Returns:
- a new array of pre-existing objects
-
toRef
Create a counted reference to the nativeVehicleConstraintSettings.- Specified by:
toRefin interfaceRefTarget- Overrides:
toRefin classConstraintSettings- Returns:
- a new JVM object with a new native object assigned
-