Collision filtering questions

Morning,

I'm gettting confused with categoryBits, maskBits and groupIndex.
The easiest way that appear to me is to ONLY use goupIndex for my objects.
I don't see, yet, the benefit of using categories + specify the mask bit except that we can specify if A can collide with B and B do not collide with A.
Is it the only benefits of using categoryBits + maskBits Vs groupIndex ?
Is it possible to assign multiple mask bits to one fixture ? If yes, then how ?

If I have two objects with the same negative groupIndex, they'll never collide. OK!
But what if I I want to check if they are colliding at certain moment ?
I don't want them to collide in the Box2D world. Just want to know at specific moment if they are in contact with each other or not.
Is that possible ?
Category bits: the type of the object
Mask bits: what types of objects this object wants to collide with
Group index: allows related objects to override the mask bits.

For example: an object is a car (category), cars want to collide with other cars and the floor (mask). However, the individual pieces of a single car should not collide with each other (group).

melles wrote:
If I have two objects with the same negative groupIndex, they'll never collide. OK!
But what if I I want to check if they are colliding at certain moment ?
I don't want them to collide in the Box2D world. Just want to know at specific moment if they are in contact with each other or not.
Is that possible ?


For this you should use sensors.

Original thread: https://box2d.org/forum/viewtopic.php?t=5938