So, I'm working on a game where (hopefully) the player will be able to explore a literally infinite world. The trade-offs are that...
1) The world will not be the same when you go back to a place you've seen before
2) The game will have to deal with the world in chunks. Everything that exists in the world will be described relative to the origin of the chunk that the player is currently in.
This means that I need to change the world's origin every once in a while.
Is there a way I can change the X and Y coordinates of every object in Box2D by the same amount, without having a sudden freeze in all physics simulation? (I've separated my graphics and physics loops, so graphics would keep on rolling). Maybe construct a new Box2D world in the background as the player approaches the border, and swap them out when the player reaches it?
Also, will this introduce instability in physics simulation when switching chunks?
1) The world will not be the same when you go back to a place you've seen before
2) The game will have to deal with the world in chunks. Everything that exists in the world will be described relative to the origin of the chunk that the player is currently in.
This means that I need to change the world's origin every once in a while.
Is there a way I can change the X and Y coordinates of every object in Box2D by the same amount, without having a sudden freeze in all physics simulation? (I've separated my graphics and physics loops, so graphics would keep on rolling). Maybe construct a new Box2D world in the background as the player approaches the border, and swap them out when the player reaches it?
Also, will this introduce instability in physics simulation when switching chunks?