Class CollisionGroup

java.lang.Object
com.github.stephengold.joltjni.JoltPhysicsObject
com.github.stephengold.joltjni.CollisionGroup
All Implemented Interfaces:
ConstJoltPhysicsObject, AutoCloseable, Comparable<ConstJoltPhysicsObject>

public class CollisionGroup extends JoltPhysicsObject
Restrict which bodies can collide.
  • Constructor Details

    • CollisionGroup

      public CollisionGroup(GroupFilter filter, int groupId, int subGroupId)
      Instantiate a group with the specified filter and IDs.
      Parameters:
      filter - the collision-group filter
      groupId - the main group ID
      subGroupId - the ID of the subgroup to which the body belongs
  • Method Details

    • getGroupFilter

      public GroupFilter getGroupFilter()
      Access the group filter. The group is unaffected.
      Returns:
      filter the pre-existing filter (not null)
    • getGroupId

      public int getGroupId()
      Return the main group ID. The group is unaffected.
      Returns:
      the ID value
    • getSubGroupId

      public int getSubGroupId()
      Return the sub-group ID. The group is unaffected.
      Returns:
      the ID value
    • setGroupFilter

      public void setGroupFilter(GroupFilter filter)
      Replace the group filter.
      Parameters:
      filter - the desired filter (not null, alias created)
    • setGroupId

      public void setGroupId(int id)
      Alter the main group ID.
      Parameters:
      id - the desired ID
    • setSubGroupID

      public void setSubGroupID(int id)
      Alter the sub-group ID.
      Parameters:
      id - the desired ID