Package com.github.stephengold.joltjni
Class VehicleConstraintRef
java.lang.Object
com.github.stephengold.joltjni.JoltPhysicsObject
com.github.stephengold.joltjni.template.Ref
com.github.stephengold.joltjni.VehicleConstraintRef
- All Implemented Interfaces:
ConstJoltPhysicsObject
,AutoCloseable
,Comparable<JoltPhysicsObject>
A counted reference to a
VehicleConstraint
. (native type:
Ref<VehicleConstraint>
)-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetPtr()
Temporarily access the referencedVehicleConstraint
.getWheelWorldTransform
(int wheelIndex, Vec3Arg right, Vec3Arg up) Copy the world transform of the specified wheel.Copy the "up" direction based on gravity.void
overrideGravity
(Vec3Arg acceleration) Override the vehicle's gravity vector.void
Remove the gravity override, if any.long
targetVa()
Return the address of the nativeVehicleConstraint
.toRef()
Create another counted reference to the nativeVehicleConstraint
.Methods inherited from class com.github.stephengold.joltjni.JoltPhysicsObject
close, compareTo, equals, getContainingObject, hasAssignedNativeObject, hashCode, ownsNativeObject, setVirtualAddress, setVirtualAddress, startCleaner, toString, va
-
Constructor Details
-
VehicleConstraintRef
public VehicleConstraintRef()Instantiate an empty reference.
-
-
Method Details
-
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
Copy the "up" direction based on gravity. The constraint is unaffected.- Returns:
- a new direction vector (in system coordinates)
-
overrideGravity
Override the vehicle's gravity vector.- Parameters:
acceleration
- the desired acceleration vector (not null, unaffected)
-
resetGravityOverride
public void resetGravityOverride()Remove the gravity override, if any. -
getPtr
Temporarily access the referencedVehicleConstraint
. -
targetVa
public long targetVa()Return the address of the nativeVehicleConstraint
. 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 nativeVehicleConstraint
.
-