Class VehicleCollisionTester

All Implemented Interfaces:
ConstJoltPhysicsObject, ConstVehicleCollisionTester, RefTarget, AutoCloseable, Comparable<JoltPhysicsObject>
Direct Known Subclasses:
VehicleCollisionTesterCastCylinder, VehicleCollisionTesterCastSphere, VehicleCollisionTesterRay

public class VehicleCollisionTester extends NonCopyable implements ConstVehicleCollisionTester, RefTarget
Detect collisions between vehicle wheels and the environment.
  • Method Details

    • setObjectLayer

      public void setObjectLayer(int objectLayer)
      Alter the object layer used for collision detection when no filters are overridden.
      Parameters:
      objectLayer - the index of the desired layer
    • setVirtualAddressAsCoOwner

      protected final void setVirtualAddressAsCoOwner(long testerVa)
      Assign a native object (assuming there's none already assigned) and designate the JVM object as a co-owner.
      Parameters:
      testerVa - the virtual address of the native object to assign (not zero)
    • getObjectLayer

      public int getObjectLayer()
      Return the object layer used for collision detection when no filters are overridden.
      Specified by:
      getObjectLayer in interface ConstVehicleCollisionTester
      Returns:
      the index of the layer
    • getRefCount

      public int getRefCount()
      Count the active references to the native VehicleCollisionTester. The tester is unaffected.
      Specified by:
      getRefCount in interface RefTarget
      Returns:
      the count (≥0)
    • setEmbedded

      public void setEmbedded()
      Mark the native VehicleCollisionTester as embedded.
      Specified by:
      setEmbedded in interface RefTarget
    • toRef

      public Ref toRef()
      Create a counted reference to the native VehicleCollisionTester.
      Specified by:
      toRef in interface RefTarget
      Returns:
      a new JVM object with a new native object assigned