Distance calculation (query) between two triangular meshes

esingla
Posts: 8
Joined: Sat Mar 13, 2010 8:00 am

Distance calculation (query) between two triangular meshes

Post by esingla »

I am using Bullet for the last few months now, and am quite comfortable with it. This is surely a wonderful library.....Hats off to developers!

I am currently using the library for a collision detection query, and i do not need dynamics for my work. My problem is that I am not very clear with how to get a distance between any two objects (in my case both have been defined as triangular meshes). Both can be concave in shape. I am able to see the penetration distance for the objects which are colliding, through the functions 'processCollision', and then using 'btPersistentManifold'. However, I didnt get how to really calculate the distance between two static objects, if they are not colliding. I think my query is simple enough, but anyway, i am not getting the idea. Do I need to split the objects into convex objects and then work out? I feel this to be a tedious job, and expects that a library like Bullet must have something easier then this.
I thank you for the help in advance.
User avatar
Erwin Coumans
Site Admin
Posts: 4221
Joined: Sun Jun 26, 2005 6:43 pm
Location: California, USA

Re: Distance calculation (query) between two triangular mesh

Post by Erwin Coumans »

There is currently no support to compute positive distances between concave triangle meshes.

It could be added, using btGimpactMeshShape.

The underlying algorithms (GJK) can compute positive distances, it just hasn't been hooked up, so there is no API. Please file a request if you need it, also see http://bulletphysics.org/Bullet/phpBB3/ ... f=9&t=5147

Thanks,
Erwin