java.lang.Object
com.github.stephengold.joltjni.JoltPhysicsObject
com.github.stephengold.joltjni.CollisionGroup
- All Implemented Interfaces:
- ConstCollisionGroup,- ConstJoltPhysicsObject,- AutoCloseable,- Comparable<JoltPhysicsObject>
Restrict which bodies can collide.
- 
Field SummaryFieldsModifier and TypeFieldDescriptionstatic final intinvalid main groupstatic final intinvalid sub-group
- 
Constructor SummaryConstructorsConstructorDescriptionInstantiate a default group.CollisionGroup(GroupFilter filter, int groupId, int subGroupId) Instantiate a group with the specified filter and IDs.CollisionGroup(GroupFilterTableRef filterRef, int groupId, int subGroupId) Instantiate a group with the specified filter and IDs.
- 
Method SummaryModifier and TypeMethodDescriptionAccess the group filter.intReturn the main group ID.intReturn the sub-group ID.voidsetGroupFilter(GroupFilter filter) Replace the group filter.voidsetGroupId(int id) Alter the main group ID.voidsetSubGroupId(int id) Alter the sub-group ID.Methods inherited from class com.github.stephengold.joltjni.JoltPhysicsObjectclose, compareTo, equals, getContainingObject, hasAssignedNativeObject, hashCode, isCleanerStarted, ownsNativeObject, setVirtualAddress, setVirtualAddress, startCleaner, targetVa, toString, vaMethods inherited from class java.lang.Objectclone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.lang.ComparablecompareToMethods inherited from interface com.github.stephengold.joltjni.readonly.ConstJoltPhysicsObjectclose, hasAssignedNativeObject, ownsNativeObject, targetVa
- 
Field Details- 
cInvalidGrouppublic static final int cInvalidGroupinvalid main group- See Also:
 
- 
cInvalidSubGrouppublic static final int cInvalidSubGroupinvalid sub-group- See Also:
 
 
- 
- 
Constructor Details- 
CollisionGrouppublic CollisionGroup()Instantiate a default group.
- 
CollisionGroupInstantiate a group with the specified filter and IDs.- Parameters:
- filter- the collision-group filter (not null)
- groupId- the main group ID
- subGroupId- the ID of the subgroup to which the body belongs
 
- 
CollisionGroupInstantiate a group with the specified filter and IDs.- Parameters:
- filterRef- a counted reference to the desired collision-group filter (not null)
- groupId- the main group ID
- subGroupId- the ID of the subgroup to which the body belongs
 
 
- 
- 
Method Details- 
setGroupFilterReplace the group filter.- Parameters:
- filter- the desired filter (not null, alias created)
 
- 
setGroupIdpublic void setGroupId(int id) Alter the main group ID. (native function: SetGroupID)- Parameters:
- id- the desired ID (default=cInvalidGroup)
 
- 
setSubGroupIdpublic void setSubGroupId(int id) Alter the sub-group ID. (native function: SetSubGroupID)- Parameters:
- id- the desired ID (default=cInvalidSubGroup)
 
- 
getGroupFilterAccess the group filter.- Specified by:
- getGroupFilterin interface- ConstCollisionGroup
- Returns:
- a new JVM object with the pre-existing native object assigned, or
 nullif none
 
- 
getGroupIdpublic int getGroupId()Return the main group ID. The group is unaffected. (native function: GetGroupID)- Specified by:
- getGroupIdin interface- ConstCollisionGroup
- Returns:
- the GroupIDvalue
 
- 
getSubGroupIdpublic int getSubGroupId()Return the sub-group ID. The group is unaffected. (native function: GetSubGroupID)- Specified by:
- getSubGroupIdin interface- ConstCollisionGroup
- Returns:
- the SubGroupIDvalue
 
 
-