collision filtering

trying to wrap my head around what values to use.
Collision filtering variables:
-group index
-category bits
-mask bits

Object A - Hero
Object B - Bullets
Object C - TV(non obstacle decoration that you can shoot, but doesn't get in your way)
Object D - Wall (obstacle both hero and bullets hit)
Object E - Chair(obstacle)

here is a comprehensive list of what i intend.
hero - hero = NA (only one)
hero - bullets = false
hero - tv = false
hero - wall = true
hero - chair = true
bullets - bullets = false
bullets - tv = true
bullets - wall = true
bullets - chair = true
tv - tv = true
tv - wall = true
tv - chair = true
wall - wall = NA (static)
wall - chair = true
chair - chair = true

for some reason I'm having a brain block on sorting out the appropriate values, writing it all out might help.
ill post my results here too.
i think i have it sorted, here are my results.
*Edited*
Hero - groupIndex = -2, categroyBits = 2, maskBits = 1
Bullets - groupIndex = -1, categroyBits = 3, maskBits = 1
TV - groupIndex = 0, categroyBits = 3, maskBits = 1
Wall - groupIndex = 0, categroyBits = 1, maskBits = 3
Chair - groupIndex = 0, categroyBits = 1, maskBits = 3

(where groupIndex = 0 I'm not actually setting groupIndex, but i believe it defaults to 0)


*collisions seem to work best when category and mask groups pair up, like Bullets(3, 1) and Chair (1, 3) are a pair.
i worry that i may find issues with hero collisions since wall and chair don't point at category 2.
**I'm not allowing the hero body to sleep so perhaps i won't find problems, i think that if the hero body was asleep while a chair passed by it may not collide since the chair doesn't have 2 as a maskBits. haven't tested that though. (it almost seems as if you should be able to set multiple maskBits to achieve all possibilities. perhaps you can, since its a hexadecimal? 0x0001 maybe 0x0011 includes 0x0010 and 0x0001 ? like flag vars in box2d that hold multiple values in one hexadecimal...
new question, can you have Multiple Mask Bits for one shape?, and is this documented somewhere already?
i've read somewhere that filter.categoryBits must follow the power of two.
i see in your edited post you have categoryBits = 3.
is it right ?

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