Dynamic b2World boundaries? (based on stage size)

Hey guys, so obviously it's easy to draw boxes around the edges of your stage based on the browser size, but how about the world boundaries?

When I set up my world it looks like this:
Code:
var b2dWorldAABB:b2AABB = new b2AABB();
b2dWorldAABB.lowerBound.Set(-100.0, -100.0);
b2dWorldAABB.upperBound.Set(_width+100, _height+100);
_b2dWorld = new b2World(b2dWorldAABB, _b2dGravity, true);

How do I change the upper and lower bounds without creating a new world?
you can't change world's bounds once you've created it.
just pump them up to make sure it'll fit your scenario.
in verions 2.1a there are no limits for the world, it just expands itself so it can fit your bodies.
Ok, but then, if that's the case, how would you remove bodies that go outside the viewable area?

Thanks!
that's a reasonable question and that's exactly what i asked myself too.
i don't have experience with 2.1 but several months ago i was working on a "endless" scrolling game.
when i say endless i mean that i had to set the world bounds to pretty big numbers.
in my situation i surrounded the visible portion of the screen sensors, which detect the object going out of screen.
then i moved those sensors inside the world according to my player position.
in every way i think that if you're planning to build that big world, you need to find a way to handle the bodies within it properly, instead of just relying on the world bounds.
let's see if any of the wise men would suggest something else. 🙂
Good suggestion thanks! hopefully with the next release or the alchemy port or something things like dynamic would bounds will work. Until then sensors with a collision manager isn't too hard to setup.
Walls of sensors are a good idea, provided they are thick enough to catch fast moving objects – they aren’t involved in CCD, so a bullet can pass through a sensor without ever triggering it. Be mindful.

The main benefit of the sensor wall solution though is that it is quiet and automatic – on sensor hit, clean up body from game, essentially. The alternative (which I prefer) is to do a for loop every hundred steps or so: if a body’s location is outside of my parameters, I can destroy conveniently outside of the timestep. Those parameters are also quite simple to change per the browser size – whereas sensors would have to be explicitly destroyed and rebuilt.
Ah, thats a good solution too, could use GetXForm of the bodies on enterframe and remove all with params outside the world bounds?

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