Class AllHitRayCastBodyCollector

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

public class AllHitRayCastBodyCollector extends RayCastBodyCollector
Collect all results from a broad-phase ray-cast query. (native type: AllHitCollisionCollector<RayCastBodyCollector>)
  • Constructor Details

    • AllHitRayCastBodyCollector

      public AllHitRayCastBodyCollector()
      Instantiate a default collector.
  • Method Details

    • countHits

      public int countHits()
      Count the hits.
      Returns:
      the count (≥0)
    • get

      public BroadPhaseCastResult get(int index)
      Access the hit with the specified index.
      Parameters:
      index - (≥0, <numHits)
      Returns:
      a new JVM object with the pre-existing native object assigned
    • getHits

      public List<BroadPhaseCastResult> getHits()
      Access all the hits as a list. (native attribute: mHits)
      Returns:
      a new list of new JVM objects with pre-existing native objects assigned
    • sort

      public void sort()
      Sort the hits.
    • reset

      public void reset()
      Reset the collector so it can be reused.
      Specified by:
      reset in class RayCastBodyCollector