box2d collision groups

boscop picture boscop · Jun 1, 2009 · Viewed 19k times · Source

does anyone know whether bodies only collide when (body1.categoryBits & body2.maskBits) && (body1.maskBits & body2.categoryBits) ? or do they already collide when (body1.categoryBits & body2.maskBits) || (body1.maskBits & body2.categoryBits) ?

Answer

Aurelien Ribon picture Aurelien Ribon · Jul 5, 2011

If anyone is still looking for more explanations, I made a detailed tutorial here :
http://aurelienribon.wordpress.com/2011/07/01/box2d-tutorial-collision-filtering/