Introduce a way to bypass collisions
w0rm opened this issue · 0 comments
w0rm commented
There should be a way to bypass collisions between certain bodies. This is absolutely necessary for the lock constraint, where bodies should not be collided together.
Usually this is done by assigning a body to layers that it belongs to, and collision masks that specify layers that the body collides with. Layers and collision masks can be stored as bitmasks. Then collision check between two bodies can be done using bitwise and
operation between the two.
For reference, check the corresponding section in the Godot engine documentation