Package com.github.stephengold.joltjni
Class BodyFilter
java.lang.Object
com.github.stephengold.joltjni.JoltPhysicsObject
com.github.stephengold.joltjni.NonCopyable
com.github.stephengold.joltjni.BodyFilter
- All Implemented Interfaces:
ConstJoltPhysicsObject,AutoCloseable,Comparable<ConstJoltPhysicsObject>
Determine which bodies are candidates for a collision test.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanshouldCollide(ConstBodyId bodyId) Test whether the specified body is a candidate for collisions.Methods inherited from class com.github.stephengold.joltjni.JoltPhysicsObject
close, compareTo, equals, hasAssignedNativeObject, hashCode, ownsNativeObject, setVirtualAddress, startCleaner, toString, va
-
Constructor Details
-
BodyFilter
public BodyFilter()Instantiate a default filter that selects all layers.
-
-
Method Details
-
shouldCollide
Test whether the specified body is a candidate for collisions. The filter is unaffected.- Parameters:
bodyId- the body to test (not null, unaffected)- Returns:
- true if may collide, false if filtered out
-