java.lang.Object
com.github.stephengold.joltjni.JoltPhysicsObject
com.github.stephengold.joltjni.SerializableObject
com.github.stephengold.joltjni.GroupFilter
- All Implemented Interfaces:
ConstGroupFilter,ConstJoltPhysicsObject,ConstSerializableObject,RefTarget,AutoCloseable,Comparable<JoltPhysicsObject>
- Direct Known Subclasses:
GroupFilterTable
Test whether 2 collision groups can collide.
-
Method Summary
Modifier and TypeMethodDescriptionbooleancanCollide(ConstCollisionGroup group1, ConstCollisionGroup group2) Test whether the specified groups can collide.intCount the active references to the nativeGroupFilter.voidsaveBinaryState(StreamOut stream) Save the settings to the specified binary stream.voidMark the nativeGroupFilteras embedded.protected final voidsetVirtualAddressAsCoOwner(long filterVa) Assign a native object (assuming there's none already assigned) and designate the JVM object as a co-owner.static GroupFilterResultsRestoreFromBinaryState(StreamIn stream) Read a filter from the specified binary stream.toRef()Create a counted reference to the nativeGroupFilter.Methods inherited from class com.github.stephengold.joltjni.SerializableObject
getRttiMethods 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, targetVaMethods inherited from interface com.github.stephengold.joltjni.readonly.ConstSerializableObject
getRtti
-
Method Details
-
sRestoreFromBinaryState
Read a filter from the specified binary stream.- Parameters:
stream- where to read objects (notnull)- Returns:
- a new object
-
setVirtualAddressAsCoOwner
protected final void setVirtualAddressAsCoOwner(long filterVa) Assign a native object (assuming there's none already assigned) and designate the JVM object as a co-owner.- Parameters:
filterVa- the virtual address of the native object to assign (not zero)
-
canCollide
Test whether the specified groups can collide. The filter is unaffected.- Specified by:
canCollidein interfaceConstGroupFilter- Parameters:
group1- the first group (notnull, unaffected)group2- the 2nd group (notnull, unaffected)- Returns:
trueif they can collide, otherwisefalse
-
saveBinaryState
Save the settings to the specified binary stream. The filter is unaffected.- Specified by:
saveBinaryStatein interfaceConstGroupFilter- Parameters:
stream- the stream to write to (notnull)
-
getRefCount
public int getRefCount()Count the active references to the nativeGroupFilter. The filter is unaffected.- Specified by:
getRefCountin interfaceRefTarget- Returns:
- the count (≥0)
-
setEmbedded
public void setEmbedded()Mark the nativeGroupFilteras embedded.- Specified by:
setEmbeddedin interfaceRefTarget
-
toRef
Create a counted reference to the nativeGroupFilter.
-