Possible bug when changing body type

Hi

Sorry to cross post but I'm using Box2dFlashAS3 and have come across a possible bug which is explained in this thread -

viewtopic.php?f=8&t=6010&p=27920#p27920

Paril also reproduced the bug in Box2CS.

Just wondering if someone could check if the problem exists in the most recent C version to rule out a porting error.

Thanks
I can confirm that this is an issue with the C++ version as well. I've just filed a bug report (issue 169)

As a workaround, try setting your body to inactive, and immediately setting it to active again:
Code:
body->SetActive(false);
body->SetActive(true);
This is probably due to the broad-phase having already filtered the contact. As a work around, move the body a large distance and then move it back.
Setting the body active flag to false when I change the body type, then back to true again after the next update seemed to fix the problem.

Code:
body->SetActive(false);
m_world.Step();
body->SetActive(true);


Thanks for your help

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