Package com.github.stephengold.joltjni
Class CollisionGroup
java.lang.Object
com.github.stephengold.joltjni.JoltPhysicsObject
com.github.stephengold.joltjni.CollisionGroup
- All Implemented Interfaces:
ConstJoltPhysicsObject,AutoCloseable,Comparable<ConstJoltPhysicsObject>
Restrict which bodies can collide.
-
Constructor Summary
ConstructorsConstructorDescriptionCollisionGroup(GroupFilter filter, int groupId, int subGroupId) Instantiate a group with the specified filter and IDs. -
Method Summary
Modifier 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.JoltPhysicsObject
close, compareTo, equals, hasAssignedNativeObject, hashCode, ownsNativeObject, setVirtualAddress, startCleaner, toString, va
-
Constructor Details
-
CollisionGroup
Instantiate a group with the specified filter and IDs.- Parameters:
filter- the collision-group filtergroupId- the main group IDsubGroupId- the ID of the subgroup to which the body belongs
-
-
Method Details
-
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
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
-