I have 3 types of bodies. they
1) MouseJointBody (it moves only with mouseJoint)
2) 2 MovingBodys (it is constantly moving in the world)
3) StaticBody (fixed in a constant position)
I need to collide between these bodies:
1) MouseJointBody with MovingBodys and StaticBody and world bounderies
2) StaticBody only with MouseJointBody
3) MovingBodys only with MouseJointBody and world bounderies
4) MovingBodys collide with each other
but no need to deal with StaticBody and MovingBody. I set the filter data for these bodies as shown below:
StaticBody:
fixDef.filter.categoryBits=0x0004; fixDef.filter.maskBits= 0x0002;
MovingBodys:
fixDef.filter.categoryBits=0x0004; fixDef.filter.maskBits= 0x0002;
MouseJointBody:
fixDef.filter.categoryBits=0x0002; fixDef.filter.maskBits= 0x0004;
Everything works fine, but my MovingBodys don't collide with eachother, and MouseJointBody and MovingBody don't collide with the world field. these two are leaving the world. please tell me the solution for this.
source share