Class GroupFilterTable

All Implemented Interfaces:
ConstGroupFilter, ConstJoltPhysicsObject, ConstSerializableObject, RefTarget, AutoCloseable, Comparable<JoltPhysicsObject>

public class GroupFilterTable extends GroupFilter
A group filter implemented using a table.
  • Constructor Details

    • GroupFilterTable

      public GroupFilterTable()
      Create a default filter with no subgroups.
    • GroupFilterTable

      public GroupFilterTable(GroupFilterTable original)
      Instantiate a copy of the specified filter.
      Parameters:
      original - the settings to copy (not null, unaffected)
    • GroupFilterTable

      public GroupFilterTable(int numSubGroups)
      Create a default filter with the specified number of subgroups. Collisions will be enabled except when the subgroup 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 subgroup
      subGroup2 - the ID of the 2nd subgroup
      Throws:
      IllegalArgumentException - if subGroup1 == subGroup2
    • enableCollision

      public void enableCollision(int subGroup1, int subGroup2)
      Enable collisions between the specified subgroups.
      Parameters:
      subGroup1 - the ID of the first subgroup
      subGroup2 - the ID of the 2nd subgroup
      Throws:
      IllegalArgumentException - if subGroup1 == subGroup2
    • toRef

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