diff --git a/src/main/java/com/github/stephengold/joltjni/BroadPhaseQuery.java b/src/main/java/com/github/stephengold/joltjni/BroadPhaseQuery.java index 61075318..cf0ea302 100644 --- a/src/main/java/com/github/stephengold/joltjni/BroadPhaseQuery.java +++ b/src/main/java/com/github/stephengold/joltjni/BroadPhaseQuery.java @@ -55,6 +55,29 @@ public class BroadPhaseQuery extends NonCopyable { // ************************************************************************* // new methods exposed + /** + * Cast a ray and collect the resulting hits. + * + * @param raycast the test ray (not null, unaffected) + * @param collector the hit collector to use (not null) + */ + public void castRay(RayCast raycast, RayCastBodyCollector collector) { + castRay(raycast, collector, new BroadPhaseLayerFilter()); + } + + /** + * Cast a ray and collect the resulting hits. + * + * @param raycast the test ray (not null, unaffected) + * @param collector the hit collector to use (not null) + * @param bplFilter the broadphase-layer filter to apply (not null, + * unaffected) + */ + public void castRay(RayCast raycast, RayCastBodyCollector collector, + BroadPhaseLayerFilter bplFilter) { + castRay(raycast, collector, bplFilter, new ObjectLayerFilter()); + } + /** * Cast a ray and collect the resulting hits. * @@ -74,6 +97,29 @@ public void castRay(RayCast raycast, RayCastBodyCollector collector, castRay(queryVa, raycastVa, collectorVa, bplFilterVa, olFilterVa); } + /** + * Collect bodies whose bounding boxes overlap with the specified test box. + * + * @param box the test box (not null, unaffected) + * @param collector the hit collector to use (not null) + */ + public void collideAaBox(AaBox box, CollideShapeBodyCollector collector) { + collideAaBox(box, collector, new BroadPhaseLayerFilter()); + } + + /** + * Collect bodies whose bounding boxes overlap with the specified test box. + * + * @param box the test box (not null, unaffected) + * @param collector the hit collector to use (not null) + * @param bplFilter the broadphase-layer filter to apply (not null, + * unaffected) + */ + public void collideAaBox(AaBox box, CollideShapeBodyCollector collector, + BroadPhaseLayerFilter bplFilter) { + collideAaBox(box, collector, bplFilter, new ObjectLayerFilter()); + } + /** * Collect bodies whose bounding boxes overlap with the specified test box. *