polyandcircle contact problems

Box2D contact points are based on feature pairs, not shape pairs. So when the features that are in contact change, the contact point is removed and a new one is added.

When a sphere moves through a box, the contact point moves from one face of the box to another. This changes the contact features and thus an remove/add sequence occurs.

This was not done to torment you. It was done so that Box2D can persist contact forces from step to step. If there are two contact points, like when a box is touching another box, I need a way to give the contact points an tag/id to match new points with old points. It turns out that using feature pairs is an efficient way to do this.

Believe it or not, this is not the first time this issue has come up. I have answered this question several times on these forums. This is why I have changed the contact listener interface so as to stop tormenting users like you.

There may be a bug in the release code that prevents poly-vs-circle reporting add/remove correctly. The latest SVN version of the code should not have this bug.
thank you very much for your explanation.
now i know whats up hehe
i know that you do not wanna torment me, i just didn't understand whats going on...

thanks again and btw. thanks for the great engine!
Thanks very much Boris and Erin for taking the time to explain. Much appreciated 🙂

EDIT:

Did a little more digging and, now that I know what to look for, found some of the previous threads Erin mentioned:
http://www.box2d.org/forum/viewtopic.php?f=3&t=3203
http://www.box2d.org/forum/viewtopic.php?f=8&t=2912

FWIW, I am using the recommended reference-counting approach with Box2D 2.0.2, but still had issues with polygon sensors. I updated to the latest svn revision (r220), made a few small updates to my code to match the new fixtures API, and the polygon sensors work properly 🙂

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