Class VehicleConstraintRef

All Implemented Interfaces:
ConstJoltPhysicsObject, AutoCloseable, Comparable<JoltPhysicsObject>

public final class VehicleConstraintRef extends Ref
A counted reference to a VehicleConstraint. (native type: Ref<VehicleConstraint>)
  • Constructor Details

    • VehicleConstraintRef

      public VehicleConstraintRef()
      Instantiate an empty reference.
  • Method Details

    • getWheelWorldTransform

      public RMat44 getWheelWorldTransform(int wheelIndex, Vec3Arg right, Vec3Arg up)
      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

      public Vec3 getWorldUp()
      Copy the "up" direction based on gravity. The constraint is unaffected.
      Returns:
      a new direction vector (in system coordinates)
    • overrideGravity

      public void overrideGravity(Vec3Arg acceleration)
      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

      public VehicleConstraint getPtr()
      Temporarily access the referenced VehicleConstraint.
      Specified by:
      getPtr in class Ref
      Returns:
      a new JVM object with the pre-existing native object assigned
    • targetVa

      public long targetVa()
      Return the address of the native VehicleConstraint. No objects are affected.
      Specified by:
      targetVa in interface ConstJoltPhysicsObject
      Overrides:
      targetVa in class JoltPhysicsObject
      Returns:
      a virtual address (not zero)
    • toRef

      public VehicleConstraintRef toRef()
      Create another counted reference to the native VehicleConstraint.
      Specified by:
      toRef in class Ref
      Returns:
      a new JVM object with a new native object assigned