Class BroadPhaseQuery

All Implemented Interfaces:
ConstJoltPhysicsObject, AutoCloseable, Comparable<JoltPhysicsObject>
Direct Known Subclasses:
BroadPhase

public class BroadPhaseQuery extends NonCopyable
Interface for crude collision detection against the bounding boxes in a PhysicsSystem.
  • Method Details

    • castRay

      public void castRay(RayCast raycast, RayCastBodyCollector collector)
      Cast a ray and collect the resulting hits.
      Parameters:
      raycast - the test ray (not null, unaffected)
      collector - the hit collector to use (not null)
    • castRay

      public void castRay(RayCast raycast, RayCastBodyCollector collector, BroadPhaseLayerFilter bplFilter)
      Cast a ray and collect the resulting hits.
      Parameters:
      raycast - the test ray (not null, unaffected)
      collector - the hit collector to use (not null)
      bplFilter - the broadphase-layer filter to apply (not null, unaffected)
    • castRay

      public void castRay(RayCast raycast, RayCastBodyCollector collector, BroadPhaseLayerFilter bplFilter, ObjectLayerFilter olFilter)
      Cast a ray and collect the resulting hits.
      Parameters:
      raycast - the test ray (not null, unaffected)
      collector - the hit collector to use (not null)
      bplFilter - the broadphase-layer filter to apply (not null, unaffected)
      olFilter - the object-layer filter to apply (not null, unaffected)
    • collideAaBox

      public void collideAaBox(AaBox box, CollideShapeBodyCollector collector)
      Collect bodies whose bounding boxes overlap with the specified test box.
      Parameters:
      box - the test box (not null, unaffected)
      collector - the hit collector to use (not null)
    • collideAaBox

      public void collideAaBox(AaBox box, CollideShapeBodyCollector collector, BroadPhaseLayerFilter bplFilter)
      Collect bodies whose bounding boxes overlap with the specified test box.
      Parameters:
      box - the test box (not null, unaffected)
      collector - the hit collector to use (not null)
      bplFilter - the broadphase-layer filter to apply (not null, unaffected)
    • collideAaBox

      public void collideAaBox(AaBox box, CollideShapeBodyCollector collector, BroadPhaseLayerFilter bplFilter, ObjectLayerFilter olFilter)
      Collect bodies whose bounding boxes overlap with the specified test box.
      Parameters:
      box - the test box (not null, unaffected)
      collector - the hit collector to use (not null)
      bplFilter - the broadphase-layer filter to apply (not null, unaffected)
      olFilter - the object-layer filter to apply (not null, unaffected)
    • collidePoint

      public void collidePoint(Vec3Arg point, CollideShapeBodyCollector collector, BroadPhaseLayerFilter bplFilter, ObjectLayerFilter olFilter)
      Collect bodies whose bounding boxes intersect the specified point.
      Parameters:
      point - the location to test (not null, unaffected)
      collector - the hit collector to use (not null)
      bplFilter - the broadphase-layer filter to apply (not null, unaffected)
      olFilter - the object-layer filter to apply (not null, unaffected)
    • collideSphere

      public void collideSphere(Vec3Arg center, float radius, CollideShapeBodyCollector collector)
      Collect bodies whose bounding boxes intersect the specified test sphere.
      Parameters:
      center - the center of the test sphere (not null, unaffected)
      radius - the radius of the test sphere
      collector - the hit collector to use (not null)
    • collideSphere

      public void collideSphere(Vec3Arg center, float radius, CollideShapeBodyCollector collector, BroadPhaseLayerFilter bplFilter)
      Collect bodies whose bounding boxes intersect the specified test sphere.
      Parameters:
      center - the center of the test sphere (not null, unaffected)
      radius - the radius of the test sphere
      collector - the hit collector to use (not null)
      bplFilter - the broadphase-layer filter to apply (not null, unaffected)
    • collideSphere

      public void collideSphere(Vec3Arg center, float radius, CollideShapeBodyCollector collector, BroadPhaseLayerFilter bplFilter, ObjectLayerFilter olFilter)
      Collect bodies whose bounding boxes intersect the specified test sphere.
      Parameters:
      center - the center of the test sphere (not null, unaffected)
      radius - the radius of the test sphere
      collector - the hit collector to use (not null)
      bplFilter - the broadphase-layer filter to apply (not null, unaffected)
      olFilter - the object-layer filter to apply (not null, unaffected)
    • getSystem

      public PhysicsSystem getSystem()
      Access the underlying PhysicsSystem.
      Returns:
      the pre-existing instance, or null if none