Package com.github.stephengold.joltjni
Class VehicleConstraintSettings
java.lang.Object
com.github.stephengold.joltjni.JoltPhysicsObject
com.github.stephengold.joltjni.NonCopyable
com.github.stephengold.joltjni.SerializableObject
com.github.stephengold.joltjni.ConstraintSettings
com.github.stephengold.joltjni.VehicleConstraintSettings
- All Implemented Interfaces:
ConstConstraintSettings
,ConstJoltPhysicsObject
,RefTarget
,AutoCloseable
,Comparable<JoltPhysicsObject>
Settings used to construct a
VehicleConstraint
.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
addWheels
(WheelSettings... wheelSettingsArray) Append the specified wheel settings.getAntiRollBar
(int index) Access the settings for the specified anti-roll bar.Access the controller settings.Copy the "forward" vector.float
Return the vehicle's maximum pitch/roll angle.int
Count the anti-roll bars.int
Count the wheels.getUp()
Copy the "up" vector.Enumerate all wheel settings.void
setController
(VehicleControllerSettings controllerSettings) Alter how the vehicle accelerates and decelerates.void
setForward
(Vec3Arg forward) Alter the forward direction.void
setMaxPitchRollAngle
(float angle) Alter the vehicle's maximum pitch/roll angle.void
setNumAntiRollBars
(int count) Alter the number of anti-roll bars.void
Alter the up direction.Methods inherited from class com.github.stephengold.joltjni.ConstraintSettings
getConstraintPriority, getControllerType, getDrawConstraintSize, getEnabled, getNumPositionStepsOverride, getNumVelocityStepsOverride, getRefCount, setConstraintPriority, setDrawConstraintSize, setEmbedded, setEnabled, setNumPositionStepsOverride, setNumVelocityStepsOverride, toRef
Methods inherited from class com.github.stephengold.joltjni.JoltPhysicsObject
close, compareTo, equals, getContainingObject, hasAssignedNativeObject, hashCode, ownsNativeObject, setVirtualAddress, setVirtualAddress, startCleaner, targetVa, toString, va
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.lang.Comparable
compareTo
Methods inherited from interface com.github.stephengold.joltjni.readonly.ConstJoltPhysicsObject
close, hasAssignedNativeObject, ownsNativeObject, targetVa
-
Constructor Details
-
VehicleConstraintSettings
public VehicleConstraintSettings()Instantiate default settings.
-
-
Method Details
-
addWheels
Append the specified wheel settings. (native attribute: mWheels)- Parameters:
wheelSettingsArray
- the wheel settings to append
-
getAntiRollBar
Access the settings for the specified anti-roll bar. (native field: mAntiRollBars)- Parameters:
index
- the index of the anti-roll bar to access (≥0)- Returns:
- a new JVM object with the pre-existing native object assigned
-
getController
Access the controller settings.- Returns:
- a new JVM object with the pre-existing native object assigned
-
getForward
Copy the "forward" vector. The settings are unaffected. (native attribute: mForward)- Returns:
- a new direction vector
-
getMaxPitchRollAngle
public float getMaxPitchRollAngle()Return the vehicle's maximum pitch/roll angle. The settings are unaffected. (native attribute: mMaxPitchRollAngle)- Returns:
- the limit angle (in radians)
-
getNumAntiRollBars
public int getNumAntiRollBars()Count the anti-roll bars. The settings are unaffected. (native attribute: mAntiRollBars)- Returns:
- the count (≥0)
-
getNumWheels
public int getNumWheels()Count the wheels. The settings are unaffected. (native attribute: mWheels)- Returns:
- the count (≥0)
-
getUp
Copy the "up" vector. The settings are unaffected. (native attribute: mUp)- Returns:
- a new direction vector
-
getWheels
Enumerate all wheel settings. The settings are unaffected. (native attribute: mWheels)- Returns:
- a new array of pre-existing objects
-
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))
-