All Implemented Interfaces:
ConstGroupFilter, ConstJoltPhysicsObject, ConstSerializableObject, RefTarget, AutoCloseable, Comparable<JoltPhysicsObject>
Direct Known Subclasses:
GroupFilterTable

public class GroupFilter extends SerializableObject implements ConstGroupFilter
Test whether 2 collision groups can collide.
  • Method Details

    • sRestoreFromBinaryState

      public static GroupFilterResult sRestoreFromBinaryState(StreamIn stream)
      Read a filter from the specified binary stream.
      Parameters:
      stream - where to read objects (not null)
      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

      public boolean canCollide(ConstCollisionGroup group1, ConstCollisionGroup group2)
      Test whether the specified groups can collide. The filter is unaffected.
      Specified by:
      canCollide in interface ConstGroupFilter
      Parameters:
      group1 - the first group (not null, unaffected)
      group2 - the 2nd group (not null, unaffected)
      Returns:
      true if they can collide, otherwise false
    • saveBinaryState

      public void saveBinaryState(StreamOut stream)
      Save the settings to the specified binary stream. The filter is unaffected.
      Specified by:
      saveBinaryState in interface ConstGroupFilter
      Parameters:
      stream - the stream to write to (not null)
    • getRefCount

      public int getRefCount()
      Count the active references to the native GroupFilter. The filter is unaffected.
      Specified by:
      getRefCount in interface RefTarget
      Returns:
      the count (≥0)
    • setEmbedded

      public void setEmbedded()
      Mark the native GroupFilter as embedded.
      Specified by:
      setEmbedded in interface RefTarget
    • toRef

      public Ref toRef()
      Create a counted reference to the native GroupFilter.
      Specified by:
      toRef in interface RefTarget
      Returns:
      a new JVM object with a new native object assigned