Package com.github.stephengold.joltjni
Class ObjectLayerFilter
java.lang.Object
com.github.stephengold.joltjni.JoltPhysicsObject
com.github.stephengold.joltjni.NonCopyable
com.github.stephengold.joltjni.ObjectLayerFilter
- All Implemented Interfaces:
ConstJoltPhysicsObject,AutoCloseable,Comparable<ConstJoltPhysicsObject>
- Direct Known Subclasses:
DefaultObjectLayerFilter,SpecifiedObjectLayerFilter
A collision filter for physics-object layers.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanshouldCollide(int objLayerIndex) Test whether the specified layer 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
-
ObjectLayerFilter
public ObjectLayerFilter()Instantiate a default filter that selects all layers.
-
-
Method Details
-
shouldCollide
public boolean shouldCollide(int objLayerIndex) Test whether the specified layer is a candidate for collisions. The filter is unaffected.- Parameters:
objLayerIndex- the index of the object layer to test- Returns:
- true if may collide, false if filtered out
-