Possable applications.

InvisibleCalm
Posts: 4
Joined: Sat Jan 09, 2010 12:10 am

Possable applications.

Post by InvisibleCalm »

I'm overhauling some software relics (Fortran and Ada) and I'm thinking that I might be able to utilize Bullet in more ways than one. Unfortunately my scope and coordinate system is that of the Geocentric earth. I see Threads here and there about large area use of Bullet but I'm wondering if anyone has had success at that scale (or coordinate system). It seems like if anything I would be using a Dynamic AABB Tree or maybe a Multi SAP. Any thoughts could help.

Thanks.
ola
Posts: 169
Joined: Sun Jan 14, 2007 7:56 pm
Location: Norway

Re: Possable applications.

Post by ola »

For a geocentric earth you can compile Bullet to use double precision numbers, and configure it to use the btDvtBroadphase. I do this in several projects that use a globe model with a geocentric coordinate system and it's working very well.

Best regards,
Ola
InvisibleCalm
Posts: 4
Joined: Sat Jan 09, 2010 12:10 am

Re: Possable applications.

Post by InvisibleCalm »

Thanks for the info.

That's good news. I was worried I would just have to bail on the whole Bullet idea. The double precision re-compile, is that simply a compile time variable change? Is there information about this on the Wiki?

An additional question regarding gravity. As I remember correctly, I thought I read gravity was always applied at the negative Z-axis. Do you have to turn that off and apply your own gravity toward vec3(0,0,0)?

Finally, are you representing the globe as a simple sphere, or did you manage to get the WGS84 ellipsoid? Or for that matter, any DTED or NED? That's probably wishful thinking, I just don't know how complex the "ground" can be, or does the globe become represented as a massive rigid body?

Thanks again.
ola
Posts: 169
Joined: Sun Jan 14, 2007 7:56 pm
Location: Norway

Re: Possable applications.

Post by ola »

InvisibleCalm wrote: The double precision re-compile, is that simply a compile time variable change? Is there information about this on the Wiki?
You need to make sure that BT_USE_DOUBLE_PRECISION is defined throughout the code. You can add a

Code: Select all

#define BT_USE_DOUBLE_PRECISION 
at the top of btScalar.h, which should do it. Then recompile everything.

To check if it actually worked, build the double precision demo and run it. It will say on the screen whether it runs in single or double precision mode.
InvisibleCalm wrote: An additional question regarding gravity. As I remember correctly, I thought I read gravity was always applied at the negative Z-axis. Do you have to turn that off and apply your own gravity toward vec3(0,0,0)?
Yes. Set the default gravity to 0,0,0. Then you need to apply the gravity on each moving rigid body each integration frame. You can use the internal tick callbacks to trigger your code doing this, see http://bulletphysics.org/mediawiki-1.5. ... _Callbacks -- this makes sure that it is updated before Bullet integrates the velocity and position.

For my gravity vector, i take the rigid body position as a vector, normalize it, and multiply it by the negative gravity strength at that point.
InvisibleCalm wrote: Finally, are you representing the globe as a simple sphere, or did you manage to get the WGS84 ellipsoid? Or for that matter, any DTED or NED? That's probably wishful thinking, I just don't know how complex the "ground" can be, or does the globe become represented as a massive rigid body?
Since the coordinate system is geocentric, you can use whatever geometry you like. I use a sphere earth model, but it shouldn't be any problem creating the WGS84 ellipsoid instead, it's just a matter of transforming your elevation data into a geocentric mesh.

I have divided my collision geometry for the earth surface into tiles. Each tile is a static rigid body with a btBvhTriangleMeshShape. I load them on demand, as I have high detailed data (SRTM) and do not want to load the whole globe at once. But I guess you could also make a single btBvhTriangleMeshShape representing your whole globe too if you use a coarser data set. The btBvhTriangleMeshShape can handle pretty big meshes, so just play with it and see how it goes. :-)

Best regards,
Ola
minghia
Posts: 13
Joined: Wed Feb 24, 2010 5:46 am

Re: Possable applications.

Post by minghia »

Would it be possible to get some example code of converting the DTED data to the appropriate shape to use in Bullet. I have some level 1 data that I want to use for collision detection.

Tony Vasile