Page 1 of 1

Lots of newbie questions

Posted: Sat Jan 09, 2016 12:36 am
by virtualpaul
Hello all,

I am new to bullet and physics engines in general.

I was impressed by the demos, they are really cool to see.

I am wondering if bullet would support physics around a spherical planet with some terrain?
I am guessing I would need to use double instead of float (BT_USE_DOUBLE_PRECISION) if the planet is large.

Is there a way to support a solar system (planets and moons) too with different gravity on each planet/moon?
I read the tutorial section and I saw that they suggest to scale the world between 0.05 and 10 meters so perhaps I would need to keep each planet/moon as separate 'worlds' if they are big or maybe there is a simpler way?

Another question I have is when loading complex models into the world, is there is a tool that could 'extract' a list of simple shapes (collision geometry: sphere, cubes, etc) to get a good approximation of the object instead of all the model details.

Is there a way to use shape subtraction to declare objects (e.g. a bowling ball made of a larger sphere with smaller spheres subtracted from it)?

Re: Lots of newbie questions

Posted: Sat Jan 09, 2016 6:16 am
by drleviathan
Yes, Bullet could simulate a spherical planet. You would need to set the acceleration of gravity on a per-RigidBody basis according to the gravitational field where it is, but that is a feature that Bullet supports.

Yes, you would need to use double precision for large simulations.

A solar system might be possible. In the past someone on these forums reported success at making a spaceship game on a large scale using double precision.

An older version of the VHACD library is included in in the Bullet/Extras codebase. Bullet doesn't support direct VHACD integration but you can wield it yourself to do what you want. It is a convex decomposition tool that will break a concave mesh up into its convex parts with a variable degree of accuracy depending on a few parameter dials. However, it doesn't process the meshes in real time -- the number crunching will take from tens of milliseconds to hundreds of seconds. As of two or three years ago the VHACD library could run on a GPU if properly setup to provide results about 200 times faster.

Re: Lots of newbie questions

Posted: Sat Jan 09, 2016 7:36 am
by Basroil
If you're dealing with planets and real gravity, you'll need true n-body physics. There are a few physics solvers out there, but you'll likely have to make you own custom system that mixes rigid body and n-body particle physics together. You'll find bullet works well alone at high frequency, but if your solar system is crowded or you use very large time steps it might fall apart.

If you just want an approximation, mario galaxy style, you can apply gravity as forces from your character body to the nearest systems, using some sort of power curve.

As for "space game", remember you can always use multiple levels of simulation based on what you're doing. Kerbal is a great example of that (two levels, one for take-off, another for space)