Using the download link from SourceForge.
I have two rigid bodies touching yet I'm getting remove messages for the two bodies. Are the Add/Remove messages called per contact point or per collision?
I think they are called on per shape basis, not per body. I've also had the similar bug with a sensor circle single-shaped body and а single-shaped polygon body - i've suddenly received a Remove message when I shouldn't.
However this bug is not reproduced in the Google Code version.
I'm using the Add/Remove functions to add pairs into a collision map and then deal with the map after the timestep. I should have also said that this is just between two single shape box bodies.
I think I've 'fixed' my issue by checking if the separation on the contact is a negative number and just ignoring that contact. I'll give the Google Code version a try and see if I still have problems.
Converted the code to use the Google Code version and the problem still seems to be here.
Create two bodies that are touching and randomly I get the end contact message. The other really cool thing is I can have the two bodies resting on a static ground plane then drop another box and get a end contact message for the two resting bodies. Any ideas as this makes Box2D pretty much unusable for me as bodies need to keep track of what bodies they are in contact with. And random end contact messages is making that impossible. Would it be any better if I run through the contact manifold every frame and manually track where pairs are touching and not touching?
Doing some more testing I've found that when I create the body if I do AllowSleeping(false) I don't get my weird errant Remove message. Also if I do this and manually put bodies to sleep there is no issue. But of course having dozens of active bodies on screen is going to seriously hurt performance so this really isn't an option.
Any ideas why a Removed message would be sent to two bodies that are still touching and have been touching long enough that both are asleep?
I'll see if I can.
When a body went to sleep I was setting it mass properties to zero so that it would become a static object. After objects became static is when this problem started happening. So setting bodies to not sleep or not turning them static seems to have fixed the issue.