Package com.github.stephengold.joltjni
Class VehicleConstraintSettingsRef
java.lang.Object
com.github.stephengold.joltjni.JoltPhysicsObject
com.github.stephengold.joltjni.template.Ref
com.github.stephengold.joltjni.VehicleConstraintSettingsRef
- All Implemented Interfaces:
ConstConstraintSettings
,ConstJoltPhysicsObject
,ConstSerializableObject
,ConstVehicleConstraintSettings
,AutoCloseable
,Comparable<JoltPhysicsObject>
public final class VehicleConstraintSettingsRef
extends Ref
implements ConstVehicleConstraintSettings
A counted reference to a
VehicleConstraintSettings
object. (native
type: Ref<VehicleConstraintSettings>
)-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
addWheels
(WheelSettings... wheelSettingsArray) Append the specified wheel settings.getAntiRollBar
(int barIndex) Access the settings for the specified anti-roll bar.int
Return the constraint's priority when solving.Access the controller settings.int
Return the constraint's controller type.float
Return the size of the constraint in debug renders.boolean
Test whether the constraint will be enabled initially.Copy the "forward" vector.float
Return the vehicle's maximum pitch/roll angle.int
Count the anti-roll bars.int
Return the override for the number of position iterations used in the solver.int
Return the override for the number of velocity iterations used in the solver.int
Count the wheels.getPtr()
Temporarily access the referencedVehicleConstraintSettings
.getRtti()
Access the type information of the current object.getUp()
Copy the "up" vector.getWheel
(int wheelIndex) Access the settings of the specified wheel.Enumerate all wheel settings.void
saveBinaryState
(StreamOut stream) Save the settings to the specified binary stream.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.long
targetVa()
Return the address of the nativeVehicleConstraintSettings
.toRef()
Create another counted reference to the nativeVehicleConstraintSettings
.Methods inherited from class com.github.stephengold.joltjni.JoltPhysicsObject
close, compareTo, equals, getContainingObject, hasAssignedNativeObject, hashCode, isCleanerStarted, ownsNativeObject, setVirtualAddress, setVirtualAddress, startCleaner, 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
-
Constructor Details
-
VehicleConstraintSettingsRef
public VehicleConstraintSettingsRef()Instantiate an empty reference.
-
-
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:
getAntiRollBar
in 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
-
getConstraintPriority
public int getConstraintPriority()Return the constraint's priority when solving. The settings are unaffected. (native attribute: mConstraintPriority)- Specified by:
getConstraintPriority
in interfaceConstConstraintSettings
- Returns:
- the priority level
-
getController
Access the controller settings.- Specified by:
getController
in interfaceConstVehicleConstraintSettings
- Returns:
- a new JVM object with the pre-existing native object assigned, or
null
if none
-
getControllerType
public int getControllerType()Return the constraint's controller type. The settings are unaffected.- Specified by:
getControllerType
in interfaceConstConstraintSettings
- Returns:
- a numeric code, such as
VehicleController.motorcycleType
-
getDrawConstraintSize
public float getDrawConstraintSize()Return the size of the constraint in debug renders. The settings are unaffected. (native attribute: mDrawConstraintSize)- Specified by:
getDrawConstraintSize
in interfaceConstConstraintSettings
- Returns:
- the size
-
getEnabled
public boolean getEnabled()Test whether the constraint will be enabled initially. The settings are unaffected. (native attribute: mEnabled)- Specified by:
getEnabled
in interfaceConstConstraintSettings
- Returns:
true
if enabled, otherwisefalse
-
getForward
Copy the "forward" vector. The settings are unaffected. (native attribute: mForward)- Specified by:
getForward
in 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:
getMaxPitchRollAngle
in 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:
getNumAntiRollBars
in interfaceConstVehicleConstraintSettings
- Returns:
- the count (≥0)
-
getNumPositionStepsOverride
public int getNumPositionStepsOverride()Return the override for the number of position iterations used in the solver. The settings are unaffected. (native attribute: mNumPositionStepsOverride)- Specified by:
getNumPositionStepsOverride
in interfaceConstConstraintSettings
- Returns:
- the number of iterations, or 0 to use the default in
PhysicsSettings
-
getNumVelocityStepsOverride
public int getNumVelocityStepsOverride()Return the override for the number of velocity iterations used in the solver. The settings are unaffected. (native attribute: mNumVelocityStepsOverride)- Specified by:
getNumVelocityStepsOverride
in interfaceConstConstraintSettings
- Returns:
- the number of iterations, or 0 to use the default configured in
PhysicsSettings
-
getNumWheels
public int getNumWheels()Count the wheels. The settings are unaffected. (native attribute: mWheels)- Specified by:
getNumWheels
in interfaceConstVehicleConstraintSettings
- Returns:
- the count (≥0)
-
getRtti
Access the type information of the current object. (native method: getRTTI)- Specified by:
getRtti
in interfaceConstSerializableObject
- Returns:
- a new JVM object with the pre-existing native object assigned
-
getUp
Copy the "up" vector. The settings are unaffected. (native attribute: mUp)- Specified by:
getUp
in interfaceConstVehicleConstraintSettings
- Returns:
- a new direction vector
-
getWheel
Access the settings of the specified wheel. (native attribute: mWheels)- Specified by:
getWheel
in interfaceConstVehicleConstraintSettings
- Parameters:
wheelIndex
- which wheel (≥0, <numWheels)- Returns:
- a new JVM object with the pre-existing native object assigned, or
null
if none
-
getWheels
Enumerate all wheel settings. The settings are unaffected. (native attribute: mWheels)- Specified by:
getWheels
in interfaceConstVehicleConstraintSettings
- Returns:
- a new array of pre-existing objects
-
saveBinaryState
Save the settings to the specified binary stream. The settings are unaffected.- Specified by:
saveBinaryState
in interfaceConstConstraintSettings
- Parameters:
stream
- the stream to write to (not null)
-
getPtr
Temporarily access the referencedVehicleConstraintSettings
. -
targetVa
public long targetVa()Return the address of the nativeVehicleConstraintSettings
. No objects are affected.- Specified by:
targetVa
in interfaceConstJoltPhysicsObject
- Overrides:
targetVa
in classJoltPhysicsObject
- Returns:
- a virtual address (not zero)
-
toRef
Create another counted reference to the nativeVehicleConstraintSettings
.
-