Ok so I have a simple set of filters for two objects and I use local collision detection. I create several objects and switch on debugging mode (hybrid). Each shape has a quad collision area but, in the simulator they push each other away even when not colliding. Then go to sleep once they seem to be far enough away.
If I add a filter which is literally this
physics.addBody( lock, “kinematic”, {density=0.1, friction=0, bounce=0,
shape={ -20,-20, 20,-20, 20,20, -20,20 },
filter={ categoryBits = 2, maskBits = 1},
} )
for one object and then this
physics.addBody( number, “dynamic”, {density=0, friction=0, bounce=0,
shape={ -10,-10, 10,-10, 10,10, -10,10 },
filter={ categoryBits = 1, maskBits = 2}
} )
for the second object. They never collide with one another. The lock object is static and the number is dynamic. At the start of the application I see the objects go to sleep. I then drag the number using a touch listener and the objects never wake again. Even if I force them awake in the moving phase, they never register a collision.
How is physics so broken? Or am I just missing something?
Edit: In fact a better question would be why do physics simply stop working once an object goes to sleep. The object never seems to be checked again regardless of what you do to it.
I tried an experiment and deliberately overlapped my filtered objects at start-up. lo and behold they register a collision. However, once the physics objects go to sleep. You can move them, set them awake etc. etc and they will never again register a collision or any physics activity.