Scaling bodies

Hey everyone!

I'm pretty new to Box2D but I succeeded putting together a body constructor which reads infos from 2 XML's. I have one XML which contains all bodies (with their own shapes). And one XML which makes instances of these bodies and eventually overrides their properties such as x and y position and rotation.

Another feature I'd like to add is the scale of each body instances.

Resizing the body's shapes would be easy if the body would have circle or rectangle shapes. But it also has polygons. That complicates this procedure

So in theory I'd like to take a body (with all shapes already set) and scale it - let's say - to 50%. How can I do that without recalculating the points from it's shapes?

I appreciate any help.
i'm not sure aboute a built in scale method in box2d
but recalculating the points of a scaled polygon seems pretty easy
(pt - center) * ratio
Yea... I did this. Now all my bodies are scalable at loading time.
I thought a real-time scaling without much effort (getting all shapes of body and recalculating all their points) would be nice 🙂 Looks like we'd have to wait for another version for that 🙂

Thanks for replying though 😉

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