What does collision filter do under the hood?

Are all entities added to the same BVH tree regardless of layer?

The BVH nodes associatively (bitwise or) combine all child categories of the colliders; and if a GroupIndex is used on any subsequently added child, they are treated as "all bits" from then on.

But otherwise, it does filter by layers as well as it can.

I have a system that uses thousands of layers (with some custom code for the GroupIndex), and it's pretty fast even at around 20k colliders all sharing the same space (but partitioned by layers, I found this much faster than Physics Worlds which have tremendous overhead).

1 Like