Page 1 of 1

Supporting an Infinite World

Posted: Sat Feb 25, 2012 4:08 am
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

Re: Supporting an Infinite World

Posted: Sat Mar 03, 2012 3:21 am
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.

Re: Supporting an Infinite World

Posted: Mon Nov 21, 2016 6:45 pm
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.