Supporting an Infinite World

Post Reply
jpmcmu
Posts: 1
Joined: Tue Feb 21, 2012 7:51 pm

Supporting an Infinite World

Post by jpmcmu »

I am currently using bullet in a game with a procedural generated infinite world. At some point during gameplay we begin to reach the end of a floats ability to represent positions precisely. In order to solve this problem in the rest of the engine we occasionally recenter the coordinate system around a local point. This works well for the rest of the engine but as far as I can tell there is no way to recenter the physics world, short of reinserting all of the physics bodies.

I am wondering if anyone has used bullet for a similar application and has found a better solution. Using double precision floats is not an option. Any advice or feedback would be appreciated.

Thanks,

- James
mcc
Posts: 4
Joined: Fri Mar 02, 2012 5:43 pm

Re: Supporting an Infinite World

Post by mcc »

Kind of a late response, and I'm new to Bullet, but a thing I've done in previous projects (with physics engines other than Bullet) is use more than one btDiscreteDynamicsWorld (or whatever), stitch them together at the edges when drawing, and make it where when objects move over the edge of one dynamics world they are removed and reinserted into the other. This means no object is ever *that* far from its respective world's origin. To prevent weird things from happening at the edges, static stuff like the ground can slightly overlap on both sides of the seam.
Marius
Posts: 10
Joined: Fri Nov 11, 2016 11:34 pm

Re: Supporting an Infinite World

Post by Marius »

I found this old thread, and I'm going to need to solve this same exact problem for my own project. Can anyone here confirm that the solution presented above is practically viable with Bullet?

My main concern I guess is that if you're traveling fast between two worlds, are things going to "behave" nicely doing this? Would it make sense to instead just re-use the same dynamics world and remove/insert objects at the center as they move?

Edit - I'll add one more detail here, though. I don't need an "infinite" world, but something planetary or moon sized and spherical.
Post Reply