java.lang.Object
com.github.stephengold.joltjni.JoltPhysicsObject
com.github.stephengold.joltjni.NonCopyable
com.github.stephengold.joltjni.BroadPhaseQuery
- All Implemented Interfaces:
ConstJoltPhysicsObject
,AutoCloseable
,Comparable<JoltPhysicsObject>
- Direct Known Subclasses:
BroadPhase
Interface for crude collision detection against the bounding boxes in a
PhysicsSystem
.-
Method Summary
Modifier and TypeMethodDescriptionvoid
castRay
(RayCast raycast, RayCastBodyCollector collector) Cast a ray and collect the resulting hits.void
castRay
(RayCast raycast, RayCastBodyCollector collector, BroadPhaseLayerFilter bplFilter) Cast a ray and collect the resulting hits.void
castRay
(RayCast raycast, RayCastBodyCollector collector, BroadPhaseLayerFilter bplFilter, ObjectLayerFilter olFilter) Cast a ray and collect the resulting hits.void
collideAaBox
(AaBox box, CollideShapeBodyCollector collector) Collect bodies whose bounding boxes overlap with the specified test box.void
collideAaBox
(AaBox box, CollideShapeBodyCollector collector, BroadPhaseLayerFilter bplFilter) Collect bodies whose bounding boxes overlap with the specified test box.void
collideAaBox
(AaBox box, CollideShapeBodyCollector collector, BroadPhaseLayerFilter bplFilter, ObjectLayerFilter olFilter) Collect bodies whose bounding boxes overlap with the specified test box.void
collidePoint
(Vec3Arg point, CollideShapeBodyCollector collector, BroadPhaseLayerFilter bplFilter, ObjectLayerFilter olFilter) Collect bodies whose bounding boxes intersect the specified point.void
collideSphere
(Vec3Arg center, float radius, CollideShapeBodyCollector collector) Collect bodies whose bounding boxes intersect the specified test sphere.void
collideSphere
(Vec3Arg center, float radius, CollideShapeBodyCollector collector, BroadPhaseLayerFilter bplFilter) Collect bodies whose bounding boxes intersect the specified test sphere.void
collideSphere
(Vec3Arg center, float radius, CollideShapeBodyCollector collector, BroadPhaseLayerFilter bplFilter, ObjectLayerFilter olFilter) Collect bodies whose bounding boxes intersect the specified test sphere.Access the underlyingPhysicsSystem
.Methods inherited from class com.github.stephengold.joltjni.JoltPhysicsObject
close, compareTo, equals, getContainingObject, hasAssignedNativeObject, hashCode, ownsNativeObject, setVirtualAddress, setVirtualAddress, startCleaner, targetVa, toString, va
-
Method Details
-
castRay
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
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
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 spherecollector
- 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 spherecollector
- 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 spherecollector
- 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
Access the underlyingPhysicsSystem
.- Returns:
- the pre-existing instance, or
null
if none
-