java.lang.Object
com.github.stephengold.joltjni.JoltPhysicsObject
com.github.stephengold.joltjni.NonCopyable
com.github.stephengold.joltjni.BodyFilter
- All Implemented Interfaces:
ConstJoltPhysicsObject,AutoCloseable,Comparable<JoltPhysicsObject>
- Direct Known Subclasses:
IgnoreMultipleBodiesFilter
Determine which bodies are candidates for a collision test.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanshouldCollide(int bodyId) Test whether the specified body is a candidate for collisions.Methods inherited from class com.github.stephengold.joltjni.JoltPhysicsObject
close, compareTo, equals, getContainingObject, hasAssignedNativeObject, hashCode, isCleanerStarted, ownsNativeObject, setVirtualAddress, setVirtualAddress, startCleaner, targetVa, toString, va
-
Constructor Details
-
BodyFilter
public BodyFilter()Instantiate a default filter that selects all bodies.
-
-
Method Details
-
shouldCollide
public boolean shouldCollide(int bodyId) Test whether the specified body is a candidate for collisions. The filter is unaffected.- Parameters:
bodyId- the body to test (notnull, unaffected)- Returns:
trueif may collide,falseif filtered out
-