Zooming a Box2D World

Is it possible to scale the entire world...bodies etc in say a mouse wheel event?
Two separate issues here I think:

1. Scaling bodies
2. Mouse input

How are you rendering the objects? Presumably somewhere you are translating box2d dimensions into pixels? If not, you need to do this.. if so, just change your scale.

Capturing mouse events is going to be a particular feature of your environment (eg flash, windows/directx, java etc).. but essentially:

On mouse wheel forward, increase scale.
On mouse wheel back, decrease scale.

I don't think it's a good idea to actually change the dimensions of objects in box2d. This is just a "representation" of whatever you are rendering.

Another way would be to change the "camera" position if you are using some form of projection (eg in OpenGL)
Just change de scale of you projection.

Example :

someSpriteContainer (in which you added your assets etc...)

someSpriteContainer.scaleX = someSpriteContainer.scaleY += 1;
or
someSpriteContainer.scaleX = someSpriteContainer.scaleY -= 1;

that should do it.
Yeah, if you're scaling the *entire* world, that's just scaling the graphics. If you're scaling the entire world but one or two elements (i.e. the player), it's still best to scale the graphics, and then scale up/down (i.e. destroy and re-create) those few elements.
I have already tried changing the scaleX and scaleY of the container which holds the assets...unfortunatly this does not change the bodies in the world so when the assets increase/decrease in size the bodies stay the same..
if you are just zooming. the bodies should stay the same size. zooming is just visually making your graphics bigger.
the body's and world's size and position would not need to change if you just want to zoom in on something.
(so debug draw would not line up any more unless you scale its containing sprite equally.)

basically if you have a penny on your desk, and you pull out a magnifying glass to look at it. the penny does not enlarge or move, just your perception of it does.

does this help?

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