How can a polygon be modified while the simulation is runnin

I've been modifying some vertices of a polygon while the simulation is running.
And it's obvious that "just modifying" them does not work perfectly.

It appears that the bounding box of the body does not automatically change.
It also appears that if the new polygon gets outside of the bounding box (or is it shape proxy?) of the original polygon the part of the new polygon inside the bounding box behaves correct. And the part sticking out of the bounding box just does not collide with other objects.

The part of the polygon that is inside the bounding box collides correct just in some cases.

What is the right way of doing this ?
Is there a way to correct (reinitialize) the polygon after you change it's shape ?
(i would be glad even if with some penalties such ass loosing momentum or smth. else)

Or is this kind of use totally not recommended ?

Thx, Tudor
This is not supported. You'll need to destroy and recreate the body.

Version 2.0 will support adding/removing shapes from a body, but not morphing shapes.
Not even if the new body is totally inside the bounding box of the original body ? (if i shrink the body ?)
I'm not saying you can't do it. I'm just saying it's up to you to make it work. It's open source after all. 🙂

You can try using the internal function SynchronizeShapes to adjust the bounding box. If the body is dynamic and awake, this is done automatically each time step.
Great library... I'm having a lot of fun playing with it.

So on the topic of destroying/recreating polygons, does the entire b2Body need to be recreated or is it possible to just recreate the b2Shape associated with it?

Anyone see any tutorials for this kind of thing?
1.4.3 does not support adding/removing shapes from bodies. 2.0 will.

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