Package com.github.stephengold.joltjni
Class GroupFilterTable
java.lang.Object
com.github.stephengold.joltjni.JoltPhysicsObject
com.github.stephengold.joltjni.NonCopyable
com.github.stephengold.joltjni.SerializableObject
com.github.stephengold.joltjni.GroupFilter
com.github.stephengold.joltjni.GroupFilterTable
- All Implemented Interfaces:
ConstJoltPhysicsObject,RefTarget,AutoCloseable,Comparable<ConstJoltPhysicsObject>
A group filter implemented using a table.
-
Constructor Summary
ConstructorsConstructorDescriptionCreate a default filter with no subgroups.GroupFilterTable(int numSubGroups) Create a default filter with the specified number of subgroups. -
Method Summary
Modifier and TypeMethodDescriptionvoiddisableCollision(int subGroup1, int subGroup2) Disable collisions between the specified subgroups.voidenableCollision(int subGroup1, int subGroup2) Enable collisions between the specified subgroups.intCount the active references to the nativeGroupFilterTable.voidMark the nativeGroupFilterTableas embedded.toRef()Create a counted reference to the nativeGroupFilterTable.Methods inherited from class com.github.stephengold.joltjni.JoltPhysicsObject
close, compareTo, equals, hasAssignedNativeObject, hashCode, ownsNativeObject, setVirtualAddress, startCleaner, toString, va
-
Constructor Details
-
GroupFilterTable
public GroupFilterTable()Create a default filter with no subgroups. -
GroupFilterTable
public GroupFilterTable(int numSubGroups) Create a default filter with the specified number of subgroups. Collisions will be enabled except when the sub-group IDs are equal.- Parameters:
numSubGroups- the initial number of subgroups (≥0)
-
-
Method Details
-
disableCollision
public void disableCollision(int subGroup1, int subGroup2) Disable collisions between the specified subgroups.- Parameters:
subGroup1- the ID of the first subgroupsubGroup2- the ID of the 2nd subgroup
-
enableCollision
public void enableCollision(int subGroup1, int subGroup2) Enable collisions between the specified subgroups.- Parameters:
subGroup1- the ID of the first subgroupsubGroup2- the ID of the 2nd subgroup
-
getRefCount
public int getRefCount()Count the active references to the nativeGroupFilterTable. The filter is unaffected.- Specified by:
getRefCountin interfaceRefTarget- Returns:
- the count (≥0)
-
setEmbedded
public void setEmbedded()Mark the nativeGroupFilterTableas embedded.- Specified by:
setEmbeddedin interfaceRefTarget
-
toRef
Create a counted reference to the nativeGroupFilterTable.
-