Collision groups and categories
From Box2D Wiki
Collision Groups
Each shape can be part of an group, which is used to determine what other shapes it can collide with. You can set this on a Shape's `m_filter.groupIndex` property or earlier on a ShapeDef's `filter.groupIndex` property.
If you assign a negative group, that shape will never collide with another shape in the same negative group. For instance if you set a spaceship and it's bullets to the same negative group, that spaceship will never get hit by it's own ricocheting bullets.
