Package com.github.stephengold.joltjni
Class NarrowPhaseQuery
java.lang.Object
com.github.stephengold.joltjni.JoltPhysicsObject
com.github.stephengold.joltjni.NonCopyable
com.github.stephengold.joltjni.NarrowPhaseQuery
- All Implemented Interfaces:
ConstJoltPhysicsObject,AutoCloseable,Comparable<ConstJoltPhysicsObject>
Interface for precise collision detection against the bodies in a
PhysicsSpace.-
Method Summary
Modifier and TypeMethodDescriptionbooleancastRay(RRayCast raycast, RayCastResult hitResult) Cast a ray and obtain the nearest hit, if any.booleancastRay(RRayCast raycast, RayCastResult hitResult, BroadPhaseLayerFilter bplFilter) Cast a ray and obtain the nearest hit, if any.booleancastRay(RRayCast raycast, RayCastResult hitResult, BroadPhaseLayerFilter bplFilter, ObjectLayerFilter olFilter) Cast a ray and obtain the nearest hit, if any.booleancastRay(RRayCast raycast, RayCastResult hitResult, BroadPhaseLayerFilter bplFilter, ObjectLayerFilter olFilter, BodyFilter bodyFilter) Cast a ray and obtain the nearest hit, if any.voidcastRay(RRayCast raycast, RayCastSettings settings, CastRayCollector collector) Cast a ray and collect the resulting hits.voidcastRay(RRayCast raycast, RayCastSettings settings, CastRayCollector collector, BroadPhaseLayerFilter bplFilter) Cast a ray and collect the resulting hits.voidcastRay(RRayCast raycast, RayCastSettings settings, CastRayCollector collector, BroadPhaseLayerFilter bplFilter, ObjectLayerFilter olFilter) Cast a ray and collect the resulting hits.voidcastRay(RRayCast raycast, RayCastSettings settings, CastRayCollector collector, BroadPhaseLayerFilter bplFilter, ObjectLayerFilter olFilter, BodyFilter bodyFilter) Cast a ray and collect the resulting hits.voidcastRay(RRayCast raycast, RayCastSettings settings, CastRayCollector collector, BroadPhaseLayerFilter bplFilter, ObjectLayerFilter olFilter, BodyFilter bodyFilter, ShapeFilter shapeFilter) Cast a ray and collect the resulting hits.voidcastShape(RShapeCast shapeCast, ShapeCastSettings settings, RVec3Arg base, CastShapeCollector collector) Cast a shape and collect the resulting hits.voidcastShape(RShapeCast shapeCast, ShapeCastSettings settings, RVec3Arg base, CastShapeCollector collector, BroadPhaseLayerFilter bplFilter) Cast a shape and collect the resulting hits.voidcastShape(RShapeCast shapeCast, ShapeCastSettings settings, RVec3Arg base, CastShapeCollector collector, BroadPhaseLayerFilter bplFilter, ObjectLayerFilter olFilter) Cast a shape and collect the resulting hits.voidcastShape(RShapeCast shapeCast, ShapeCastSettings settings, RVec3Arg base, CastShapeCollector collector, BroadPhaseLayerFilter bplFilter, ObjectLayerFilter olFilter, BodyFilter bodyFilter) Cast a shape and collect the resulting hits.voidcastShape(RShapeCast shapeCast, ShapeCastSettings settings, RVec3Arg base, CastShapeCollector collector, BroadPhaseLayerFilter bplFilter, ObjectLayerFilter olFilter, BodyFilter bodyFilter, ShapeFilter shapeFilter) Cast a shape and collect the resulting hits.voidcollidePoint(RVec3Arg point, CollidePointCollector collector) Collect collisions with the specified point.voidcollidePoint(RVec3Arg point, CollidePointCollector collector, BroadPhaseLayerFilter bplFilter) Collect collisions with the specified point.voidcollidePoint(RVec3Arg point, CollidePointCollector collector, BroadPhaseLayerFilter bplFilter, ObjectLayerFilter olFilter) Collect collisions with the specified point.voidcollidePoint(RVec3Arg point, CollidePointCollector collector, BroadPhaseLayerFilter bplFilter, ObjectLayerFilter olFilter, BodyFilter bodyFilter) Collect collisions with the specified point.voidcollidePoint(RVec3Arg point, CollidePointCollector collector, BroadPhaseLayerFilter bplFilter, ObjectLayerFilter olFilter, BodyFilter bodyFilter, ShapeFilter shapeFilter) Collect collisions with the specified point.voidcollideShape(ConstShape shape, Vec3Arg shapeScale, RMat44Arg comTransform, CollideShapeSettings settings, RVec3Arg base, CollideShapeCollector collector) Collect collisions with the specified shape.voidcollideShape(ConstShape shape, Vec3Arg shapeScale, RMat44Arg comTransform, CollideShapeSettings settings, RVec3Arg base, CollideShapeCollector collector, BroadPhaseLayerFilter bplFilter) Collect collisions with the specified shape.voidcollideShape(ConstShape shape, Vec3Arg shapeScale, RMat44Arg comTransform, CollideShapeSettings settings, RVec3Arg base, CollideShapeCollector collector, BroadPhaseLayerFilter bplFilter, ObjectLayerFilter olFilter) Collect collisions with the specified shape.voidcollideShape(ConstShape shape, Vec3Arg shapeScale, RMat44Arg comTransform, CollideShapeSettings settings, RVec3Arg base, CollideShapeCollector collector, BroadPhaseLayerFilter bplFilter, ObjectLayerFilter olFilter, BodyFilter bodyFilter) Collect collisions with the specified shape.voidcollideShape(ConstShape shape, Vec3Arg shapeScale, RMat44Arg comTransform, CollideShapeSettings settings, RVec3Arg base, CollideShapeCollector collector, BroadPhaseLayerFilter bplFilter, ObjectLayerFilter olFilter, BodyFilter bodyFilter, ShapeFilter shapeFilter) Collect collisions with the specified shape.Access the underlyingPhysicsSystem.Methods inherited from class com.github.stephengold.joltjni.JoltPhysicsObject
close, compareTo, equals, hasAssignedNativeObject, hashCode, ownsNativeObject, setVirtualAddress, startCleaner, toString, va
-
Method Details
-
castRay
Cast a ray and obtain the nearest hit, if any.- Parameters:
raycast- the desired ray (not null, unaffected)hitResult- storage for information about the hit, if any (not null, may be modified)- Returns:
- true if a hit was found, otherwise false
-
castRay
Cast a ray and obtain the nearest hit, if any.- Parameters:
raycast- the desired ray (not null, unaffected)hitResult- storage for information about the hit, if any (not null, may be modified)bplFilter- the broadphase-layer filter to apply (not null, unaffected)- Returns:
- true if a hit was found, otherwise false
-
castRay
public boolean castRay(RRayCast raycast, RayCastResult hitResult, BroadPhaseLayerFilter bplFilter, ObjectLayerFilter olFilter) Cast a ray and obtain the nearest hit, if any.- Parameters:
raycast- the desired ray (not null, unaffected)hitResult- storage for information about the hit, if any (not null, may be modified)bplFilter- the broadphase-layer filter to apply (not null, unaffected)olFilter- the object-layer filter to apply (not null, unaffected)- Returns:
- true if a hit was found, otherwise false
-
castRay
public boolean castRay(RRayCast raycast, RayCastResult hitResult, BroadPhaseLayerFilter bplFilter, ObjectLayerFilter olFilter, BodyFilter bodyFilter) Cast a ray and obtain the nearest hit, if any.- Parameters:
raycast- the desired ray (not null, unaffected)hitResult- storage for information about the hit, if any (not null, may be modified)bplFilter- the broadphase-layer filter to apply (not null, unaffected)olFilter- the object-layer filter to apply (not null, unaffected)bodyFilter- the body filter to apply (not null, unaffected)- Returns:
- true if a hit was found, otherwise false
-
castRay
Cast a ray and collect the resulting hits.- Parameters:
raycast- the desired ray (not null, unaffected)settings- the raycast configuration options to use (not null, unaffected)collector- the hit collector to use (not null)
-
castRay
public void castRay(RRayCast raycast, RayCastSettings settings, CastRayCollector collector, BroadPhaseLayerFilter bplFilter) Cast a ray and collect the resulting hits.- Parameters:
raycast- the desired ray (not null, unaffected)settings- the raycast configuration options to use (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(RRayCast raycast, RayCastSettings settings, CastRayCollector collector, BroadPhaseLayerFilter bplFilter, ObjectLayerFilter olFilter) Cast a ray and collect the resulting hits.- Parameters:
raycast- the desired ray (not null, unaffected)settings- the raycast configuration options to use (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)
-
castRay
public void castRay(RRayCast raycast, RayCastSettings settings, CastRayCollector collector, BroadPhaseLayerFilter bplFilter, ObjectLayerFilter olFilter, BodyFilter bodyFilter) Cast a ray and collect the resulting hits.- Parameters:
raycast- the desired ray (not null, unaffected)settings- the raycast configuration options to use (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)bodyFilter- the body filter to apply (not null, unaffected)
-
castRay
public void castRay(RRayCast raycast, RayCastSettings settings, CastRayCollector collector, BroadPhaseLayerFilter bplFilter, ObjectLayerFilter olFilter, BodyFilter bodyFilter, ShapeFilter shapeFilter) Cast a ray and collect the resulting hits.- Parameters:
raycast- the desired ray (not null, unaffected)settings- the raycast configuration options to use (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)bodyFilter- the body filter to apply (not null, unaffected)shapeFilter- the shape filter to apply (not null, unaffected)
-
castShape
public void castShape(RShapeCast shapeCast, ShapeCastSettings settings, RVec3Arg base, CastShapeCollector collector) Cast a shape and collect the resulting hits.- Parameters:
shapeCast- the desired shape cast (not null, unaffected)settings- the shape-cast configuration options to use (not null, unaffected)base- the base location for reporting hits (not null, unaffected, (0,0,0)→world coordinates)collector- the hit collector to use (not null)
-
castShape
public void castShape(RShapeCast shapeCast, ShapeCastSettings settings, RVec3Arg base, CastShapeCollector collector, BroadPhaseLayerFilter bplFilter) Cast a shape and collect the resulting hits.- Parameters:
shapeCast- the desired shape cast (not null, unaffected)settings- the shape-cast configuration options to use (not null, unaffected)base- the base location for reporting hits (not null, unaffected, (0,0,0)→world coordinates)collector- the hit collector to use (not null)bplFilter- the broadphase-layer filter to apply (not null, unaffected)
-
castShape
public void castShape(RShapeCast shapeCast, ShapeCastSettings settings, RVec3Arg base, CastShapeCollector collector, BroadPhaseLayerFilter bplFilter, ObjectLayerFilter olFilter) Cast a shape and collect the resulting hits.- Parameters:
shapeCast- the desired shape cast (not null, unaffected)settings- the shape-cast configuration options to use (not null, unaffected)base- the base location for reporting hits (not null, unaffected, (0,0,0)→world coordinates)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)
-
castShape
public void castShape(RShapeCast shapeCast, ShapeCastSettings settings, RVec3Arg base, CastShapeCollector collector, BroadPhaseLayerFilter bplFilter, ObjectLayerFilter olFilter, BodyFilter bodyFilter) Cast a shape and collect the resulting hits.- Parameters:
shapeCast- the desired shape cast (not null, unaffected)settings- the shape-cast configuration options to use (not null, unaffected)base- the base location for reporting hits (not null, unaffected, (0,0,0)→world coordinates)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)bodyFilter- the body filter to apply (not null, unaffected)
-
castShape
public void castShape(RShapeCast shapeCast, ShapeCastSettings settings, RVec3Arg base, CastShapeCollector collector, BroadPhaseLayerFilter bplFilter, ObjectLayerFilter olFilter, BodyFilter bodyFilter, ShapeFilter shapeFilter) Cast a shape and collect the resulting hits.- Parameters:
shapeCast- the desired shape cast (not null, unaffected)settings- the shape-cast configuration options to use (not null, unaffected)base- the base location for reporting hits (not null, unaffected, (0,0,0)→world coordinates)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)bodyFilter- the body filter to apply (not null, unaffected)shapeFilter- the shape filter to apply (not null, unaffected)
-
collidePoint
Collect collisions with the specified point.- Parameters:
point- the location of the point to test (not null, unaffected)collector- the hit collector to use (not null)
-
collidePoint
public void collidePoint(RVec3Arg point, CollidePointCollector collector, BroadPhaseLayerFilter bplFilter) Collect collisions with the specified point.- Parameters:
point- the location of the point to test (not null, unaffected)collector- the hit collector to use (not null)bplFilter- the broadphase-layer filter to apply (not null, unaffected)
-
collidePoint
public void collidePoint(RVec3Arg point, CollidePointCollector collector, BroadPhaseLayerFilter bplFilter, ObjectLayerFilter olFilter) Collect collisions with the specified point.- Parameters:
point- the location of the point 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)
-
collidePoint
public void collidePoint(RVec3Arg point, CollidePointCollector collector, BroadPhaseLayerFilter bplFilter, ObjectLayerFilter olFilter, BodyFilter bodyFilter) Collect collisions with the specified point.- Parameters:
point- the location of the point 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)bodyFilter- the body filter to apply (not null, unaffected)
-
collidePoint
public void collidePoint(RVec3Arg point, CollidePointCollector collector, BroadPhaseLayerFilter bplFilter, ObjectLayerFilter olFilter, BodyFilter bodyFilter, ShapeFilter shapeFilter) Collect collisions with the specified point.- Parameters:
point- the location of the point 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)bodyFilter- the body filter to apply (not null, unaffected)shapeFilter- the shape filter to apply (not null, unaffected)
-
collideShape
public void collideShape(ConstShape shape, Vec3Arg shapeScale, RMat44Arg comTransform, CollideShapeSettings settings, RVec3Arg base, CollideShapeCollector collector) Collect collisions with the specified shape.- Parameters:
shape- the shape to test (not null, unaffected)shapeScale- the scaling vector for the shape (not null, unaffected)comTransform- the coordinate transform to apply to the shape's center of mass (not null, unaffected)settings- the collision settings to use (not null, unaffected)base- the base location for reporting hits (not null, unaffected, (0,0,0)→world coordinates)collector- the hit collector to use (not null)
-
collideShape
public void collideShape(ConstShape shape, Vec3Arg shapeScale, RMat44Arg comTransform, CollideShapeSettings settings, RVec3Arg base, CollideShapeCollector collector, BroadPhaseLayerFilter bplFilter) Collect collisions with the specified shape.- Parameters:
shape- the shape to test (not null, unaffected)shapeScale- the scaling vector for the shape (not null, unaffected)comTransform- the coordinate transform to apply to the shape's center of mass (not null, unaffected)settings- the collision settings to use (not null, unaffected)base- the base location for reporting hits (not null, unaffected, (0,0,0)→world coordinates)collector- the hit collector to use (not null)bplFilter- the broadphase-layer filter to apply (not null, unaffected)
-
collideShape
public void collideShape(ConstShape shape, Vec3Arg shapeScale, RMat44Arg comTransform, CollideShapeSettings settings, RVec3Arg base, CollideShapeCollector collector, BroadPhaseLayerFilter bplFilter, ObjectLayerFilter olFilter) Collect collisions with the specified shape.- Parameters:
shape- the shape to test (not null, unaffected)shapeScale- the scaling vector for the shape (not null, unaffected)comTransform- the coordinate transform to apply to the shape's center of mass (not null, unaffected)settings- the collision settings to use (not null, unaffected)base- the base location for reporting hits (not null, unaffected, (0,0,0)→world coordinates)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)
-
collideShape
public void collideShape(ConstShape shape, Vec3Arg shapeScale, RMat44Arg comTransform, CollideShapeSettings settings, RVec3Arg base, CollideShapeCollector collector, BroadPhaseLayerFilter bplFilter, ObjectLayerFilter olFilter, BodyFilter bodyFilter) Collect collisions with the specified shape.- Parameters:
shape- the shape to test (not null, unaffected)shapeScale- the scaling vector for the shape (not null, unaffected)comTransform- the coordinate transform to apply to the shape's center of mass (not null, unaffected)settings- the collision settings to use (not null, unaffected)base- the base location for reporting hits (not null, unaffected, (0,0,0)→world coordinates)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)bodyFilter- the body filter to apply (not null, unaffected)
-
collideShape
public void collideShape(ConstShape shape, Vec3Arg shapeScale, RMat44Arg comTransform, CollideShapeSettings settings, RVec3Arg base, CollideShapeCollector collector, BroadPhaseLayerFilter bplFilter, ObjectLayerFilter olFilter, BodyFilter bodyFilter, ShapeFilter shapeFilter) Collect collisions with the specified shape.- Parameters:
shape- the shape to test (not null, unaffected)shapeScale- the scaling vector for the shape (not null, unaffected)comTransform- the coordinate transform to apply to the shape's center of mass (not null, unaffected)settings- the collision settings to use (not null, unaffected)base- the base location for reporting hits (not null, unaffected, (0,0,0)→world coordinates)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)bodyFilter- the body filter to apply (not null, unaffected)shapeFilter- the shape filter to apply (not null, unaffected)
-
getSystem
Access the underlyingPhysicsSystem.- Returns:
- the pre-existing instance
-