Package com.github.stephengold.joltjni
Class ObjectLayerPairFilterTable
java.lang.Object
com.github.stephengold.joltjni.JoltPhysicsObject
com.github.stephengold.joltjni.NonCopyable
com.github.stephengold.joltjni.ObjectLayerPairFilter
com.github.stephengold.joltjni.ObjectLayerPairFilterTable
- All Implemented Interfaces:
ConstJoltPhysicsObject,ConstObjectLayerPairFilter,AutoCloseable,Comparable<JoltPhysicsObject>
Filter collisions between object layers using a table.
-
Constructor Summary
ConstructorsConstructorDescriptionObjectLayerPairFilterTable(int numObjectLayers) Instantiate a filter with the specified capacity and all collisions disabled. -
Method Summary
Modifier and TypeMethodDescriptiondisableCollision(int layer1, int layer2) Disable collisions between the specified object layers.enableCollision(int layer1, int layer2) Enable collisions between the specified object layers.Methods inherited from class com.github.stephengold.joltjni.ObjectLayerPairFilter
shouldCollideMethods inherited from class com.github.stephengold.joltjni.JoltPhysicsObject
close, compareTo, equals, getContainingObject, hasAssignedNativeObject, hashCode, isCleanerStarted, ownsNativeObject, setVirtualAddress, setVirtualAddress, startCleaner, targetVa, toString, vaMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.lang.Comparable
compareToMethods inherited from interface com.github.stephengold.joltjni.readonly.ConstJoltPhysicsObject
close, hasAssignedNativeObject, ownsNativeObject, targetVa
-
Constructor Details
-
ObjectLayerPairFilterTable
public ObjectLayerPairFilterTable(int numObjectLayers) Instantiate a filter with the specified capacity and all collisions disabled.- Parameters:
numObjectLayers- the number of object layers (≥1)
-
-
Method Details
-
disableCollision
Disable collisions between the specified object layers.- Parameters:
layer1- the index of the first object layer (≥0, <numObjectLayers)layer2- the index of the 2nd object layer (≥0, <numObjectLayers)- Returns:
- the modified filter, for chaining
-
enableCollision
Enable collisions between the specified object layers.- Parameters:
layer1- the index of the first object layer (≥0, <numObjectLayers)layer2- the index of the 2nd object layer (≥0, <numObjectLayers)- Returns:
- the modified filter, for chaining
-