Best way to implement an 'infinite' world?

Hello Box2D forum users,

I'm trying to make a game that has an infinite 2D world, and am looking at Box2D to implement physics.

The world is tile-based, and split into 32x32 maps, each of which connects both horizontally and vertically to more maps. I'm planning to organise maps into larger rectangular regions (at the moment, I'm thinking 32 maps horizontally and 8 maps vertically).

The way I'm thinking of doing it is wrapping the tiles with chains of edges; this should work fine for a simple tile-based map. However, there's two things I'm unsure about. Firstly, the obvious issue of extending this to be infinite. I assume I can't just keep adding shapes to the world as the player moves around, and removing the shapes no longer in range, due to floating point inaccuracies; the plan is to set the origin to a corner of the current region. But I can see this having problems when moving between two regions, as it will have to translate every single shape in the world whenever that happens. Secondly, the player will be able to modify the terrain; how easy is it to remove/add sections from a static edge chain?

Thanks in advance,
Vit
I would handle large worlds by using origin shifting. If you find you need this, I can add a function to shift the entire Box2D world quickly.

Please make any feature requests here: http://code.google.com/p/box2d/issues/list
Implemented issue 260 . You can now shift (re-center) a world using b2World::ShiftOrigin. You can see this function in the testbed using CTRL + arrow key.

Completed: At revision: 246

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