What is bullet world size limits

Post Reply
nikomaster
Posts: 13
Joined: Fri May 16, 2014 9:55 am

What is bullet world size limits

Post by nikomaster »

Hello I am making a small sandbox like simulator game and I am using bullet as physics engine. Everything works fine ..I am still learning and adjusting here and there.

In this application you are able to build vehicles using constraints with primitives and meshes. However every time a vehicle reaches certain part of the world it goes crazy, all constraints separate and some values such as velocity, and position get away from reality.

For example, I made a small airplane using boxes as airfoils and cylinders as wheels and I send it to fly which works great however every time it reaches position Y=40000 it completely goes nuts.

I understand that each unit at 1/60 hertz simulation represents 1 meter so every time it reaches an altitude of 40 km the constraints separate I get a reading on world position of 1e+80 same for linear velocity, and all I see is parts of the objects going everywhere on the screen very fast.

The way I get to those limits is not fast, in fact I get there on what I consider simulation values. Climbing speed was about 1500 ft/min, ground speed about 320 km/h, applying an impulse of 80 on direction forward to the fuselage, the weight is about 400 kg. There is air resistance in the simulation factor which slows down the vehicle so velocity never goes out of hand.
Everything works fine until it reaches those limits

I haven't tested on X, and Z limits but on Y it always gets crazy over 40000 units even when all goes smoothly.

I am using the discrete world object, impulse constraint solver, btDbvtBroadPhase as broadphase, gravity -9.8, in other words the default configuration.

I don't know if this is a bug or a glitch but it would helpful to know the limits of the dynamic world. To make adjustments.

Any answer would be appreciated it.
Thanks
c6burns
Posts: 149
Joined: Fri May 24, 2013 6:08 am

Re: What is bullet world size limits

Post by c6burns »

This sounds like an issue of floating point accuracy. You need to either scale down the world, or use double precision floats (by rebuilding bullet to do so), or both.
nikomaster
Posts: 13
Joined: Fri May 16, 2014 9:55 am

Re: What is bullet world size limits

Post by nikomaster »

thank you for your answer!

I'll try with double precision floats, I just hope the change won't drop errors, good I use my own data structures.

If this does not work, I think I'd try scaling down the world or using some sort of world paging system such as reposition to 0,0,0 coordinates on physics world and just moving the graphics world to the position above.
nikomaster
Posts: 13
Joined: Fri May 16, 2014 9:55 am

Re: What is bullet world size limits

Post by nikomaster »

another curious thing is that on the horizontal plane I can go far without having this glitch it seems this only happens on Y
Post Reply