Skip to content

Commit

Permalink
BroadPhaseQuery: add 4 public methods
Browse files Browse the repository at this point in the history
  • Loading branch information
stephengold committed Sep 20, 2024
1 parent 693de5a commit d4599f8
Showing 1 changed file with 46 additions and 0 deletions.
46 changes: 46 additions & 0 deletions src/main/java/com/github/stephengold/joltjni/BroadPhaseQuery.java
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*
Expand All @@ -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.
*
Expand Down

0 comments on commit d4599f8

Please sign in to comment.