InteractionGroup
Specifies which Colliders a collider will collide with, by using bit masks of InteractionLayers. This object stores two InteractionFields:
memberships - which layers this collider is a part of
filter - which layers this collider may collide with
If a collider collides with layer X
, it means that the collider will collide with any others which have bit X
set in their memberships field.
If we want to specify a collider which is part of the layers [0, 2, 3]
and can collide with the layers [2]
, we specify the fields as:
index 3 2 1 0
memberships 1 1 0 1
filter 0 1 0 0
Content copied to clipboard
which is written as
InteractionGroup(
memberships = InteractionField.fromRaw(0b1101),
filter = InteractionField.fromRaw(0b0100),
)
Content copied to clipboard
For details on what this interaction group will do exactly, see Collider.
Parameters
memberships
Which layers this collider is a part of.
filter
Which layers this collider may collide with.