Interface ConstVehicleConstraint
- All Superinterfaces:
Comparable<JoltPhysicsObject>
,ConstConstraint
,ConstJoltPhysicsObject
- All Known Implementing Classes:
VehicleConstraint
,VehicleConstraintRef
Read-only access to
VehicleConstraint
. (native type: const
VehicleConstraint)-
Method Summary
Modifier and TypeMethodDescriptionint
Count how many anti-roll bars the vehicle has.int
Count how many wheels the vehicle has.getAntiRollBar
(int barIndex) Access the specified anti-roll bar.Copy the gravity override.Copy the local "forward" direction.Copy the local "up" direction.float
Return the vehicle's maximum pitch/roll angle.int
Return the number of simulation steps between wheel-collision tests when the vehicle is active.int
Return the number of simulation steps between collision tests when the body is inactive.void
getWheelLocalBasis
(Wheel wheel, Vec3 storeForward, Vec3 storeUp, Vec3 storeRight) Copy the basis vectors for the specified wheel.getWheelWorldTransform
(int wheelIndex, Vec3Arg right, Vec3Arg up) Copy the world transform of the specified wheel.Copy the "up" direction based on gravity.boolean
Test whether gravity is overridden.Methods inherited from interface java.lang.Comparable
compareTo
Methods inherited from interface com.github.stephengold.joltjni.readonly.ConstConstraint
getConstraintPriority, getConstraintSettings, getEnabled, getNumPositionStepsOverride, getNumVelocityStepsOverride, getSubType, getType, isActive, saveState
Methods inherited from interface com.github.stephengold.joltjni.readonly.ConstJoltPhysicsObject
close, hasAssignedNativeObject, ownsNativeObject, targetVa
-
Method Details
-
countAntiRollBars
int countAntiRollBars()Count how many anti-roll bars the vehicle has. The constraint is unaffected.- Returns:
- the count (≥0)
-
countWheels
int countWheels()Count how many wheels the vehicle has. The constraint is unaffected.- Returns:
- the count (≥0)
-
getAntiRollBar
Access the specified anti-roll bar.- Parameters:
barIndex
- the index of the bar to access (≥0)- Returns:
- a new JVM object with the pre-existing native object assigned
-
getGravityOverride
Vec3 getGravityOverride()Copy the gravity override. The constraint is unaffected.- Returns:
- a new vector
-
getLocalForward
Vec3 getLocalForward()Copy the local "forward" direction. The constraint is unaffected.- Returns:
- a new direction vector
-
getLocalUp
Vec3 getLocalUp()Copy the local "up" direction. The constraint is unaffected.- Returns:
- a new direction vector
-
getMaxPitchRollAngle
float getMaxPitchRollAngle()Return the vehicle's maximum pitch/roll angle. The constraint is unaffected.- Returns:
- the limit angle (in radians)
-
getNumStepsBetweenCollisionTestActive
int getNumStepsBetweenCollisionTestActive()Return the number of simulation steps between wheel-collision tests when the vehicle is active. The constraint is unaffected.- Returns:
- the number of steps
-
getNumStepsBetweenCollisionTestInactive
int getNumStepsBetweenCollisionTestInactive()Return the number of simulation steps between collision tests when the body is inactive. The constraint is unaffected.- Returns:
- the number of steps
-
getWheelLocalBasis
Copy the basis vectors for the specified wheel.- Parameters:
wheel
- which wheel to query (not null)storeForward
- storage for the forward vector (not null, modified)storeUp
- storage for the up vector (not null, modified)storeRight
- storage for the right vector (not null, modified)
-
getWheelWorldTransform
Copy the world transform of the specified wheel. The constraint is unaffected.- Parameters:
wheelIndex
- the index of the wheel to query (≥0)right
- the wheel's axis of rotation (a unit vector in the wheel's model space)up
- the "up" direction (a unit vector in the wheel's model space)- Returns:
- a new coordinate transform matrix
-
getWorldUp
Vec3 getWorldUp()Copy the "up" direction based on gravity. The constraint is unaffected.- Returns:
- a new direction vector (in system coordinates)
-
isGravityOverridden
boolean isGravityOverridden()Test whether gravity is overridden. The constraint is unaffected.- Returns:
true
if overridden, otherwisefalse
-