Fast Collision Detection using Representative-Triangles

kuxv
Posts: 9
Joined: Sun Mar 30, 2008 2:10 pm

Fast Collision Detection using Representative-Triangles

Post by kuxv »

Hi,
I've discovered paper on fast collision detection http://www.cs.unc.edu/~geom/RTRI/
It is about bounding volume hierarchies of triangle features(i.e. vertices, edges, faces).
Now because I'm new to Bullet I would like to know if this could be integrated and if so then how ?
I'll be happy to implement it so if anybody can help me with kick-off so I can start coding right now it would be very appreciated.
User avatar
Erwin Coumans
Site Admin
Posts: 4221
Joined: Sun Jun 26, 2005 6:43 pm
Location: California, USA

Re: Fast Collision Detection using Representative-Triangles

Post by Erwin Coumans »

It should be straightforward to integrate another collision detector into Bullet. There are a few examples of doing so.

Best way is to check out Bullet/Demos/MovingConcaveDemo. It registers the optional GIMPACT concave collision detection.
Note that GIMPACT and Bullet already have an AABB tree that could be re-used for other purposes.

Also, there is the ODE box-box algorithms adapted for Bullet in Bullet/Extras/AlternativeCollisionAlgorithms, as example code.

Let us know how you get on,
Thanks,
Erwin
kuxv
Posts: 9
Joined: Sun Mar 30, 2008 2:10 pm

Re: Fast Collision Detection using Representative-Triangles

Post by kuxv »

Thanks for quick reply, I'll look at it.
kuxv
Posts: 9
Joined: Sun Mar 30, 2008 2:10 pm

Re: Fast Collision Detection using Representative-Triangles

Post by kuxv »

HI, I've taken a look at bullet source code and I have some more questions to ask. There is AABB tree implemented(as you told me) in btOptimizedBvh.h. It stores individual mesh triangles at leafs of the tree. If there are 2 potentionaly colliding pairs from Broadphase and they are stored as BVHs, then these two BVHs are compared. Then triangles which are suspicious are compared for intersection in Narrowphase. Am I correct or had I misunderstood something ?

If I'm correct it should be easy to implement technique mentioned in that paper from my first post. Because all I need is to take this AABB tree and add some more info to each leaf and use this info later in Narrowphase.

Any notes welcome. Thank you.
kuxv
Posts: 9
Joined: Sun Mar 30, 2008 2:10 pm

Re: Fast Collision Detection using Representative-Triangles

Post by kuxv »

I have another question. My target here is to make discrete collision detection of 2 and more TriMeshes. I want to represent them using AABB trees. Those meshes should move and react on collisions when thay occure. Is it OK to use btBvhTriangleMeshShape for this? If not why?

Thanks for help.
User avatar
Erwin Coumans
Site Admin
Posts: 4221
Joined: Sun Jun 26, 2005 6:43 pm
Location: California, USA

Re: Fast Collision Detection using Representative-Triangles

Post by Erwin Coumans »

kuxv wrote:I have another question. My target here is to make discrete collision detection of 2 and more TriMeshes. I want to represent them using AABB trees. Those meshes should move and react on collisions when thay occure. Is it OK to use btBvhTriangleMeshShape for this? If not why?

Thanks for help.
No, there is currently no collision detection between two btBvhTriangleMeshShapes. Purpose of btBvhTriangleMeshShape is for static non-moving collision shapes, such as non-changing world environments, buildings etc. So there is no collision detection or resolution between static objects.

By default, Bullet only registers and handles convex versus concave collision detection, in btConvexConcaveCollisionAlgorithm. This uses btOptimizedBvh. btOptimizedBvh only implements a BVH tree versus AABB traversal, not a BVH tree versus BVH tree traversal.

If you really need moving concave triangle meshes, you can try to use btGImpactMeshShape. Please check Bullet/Demos/MovingConcaveDemo how to use this.
Collision detection between btGImpactMeshShape uses btGImpactQuantizedBvh. Bullet/Extras/GIMPACT/Bullet/btGImpactQuantizedBvh.h is very similar to btOptimizedBvh, and it implements BVH tree versus BVH tree.

btGImpactCollisionAlgorithm implements the interaction (and tree traversal) between two btGImpactMeshShapes. You need to register this algorithm, because by default it is not part of Bullet.

Hope this helps,
Erwin
kuxv
Posts: 9
Joined: Sun Mar 30, 2008 2:10 pm

Re: Fast Collision Detection using Representative-Triangles

Post by kuxv »

Hi,

it's been some time from my first post. I've talked with Nathanael regarding implementation of RTRI in bullet soft body.
I need to create data structure holding topological information of nodes/faces. That one is easy.
Then comes harder part and that's why I need some help. It's regarding contacts generation.
Acording to Nathanael it will require a new contact type and solver. Generalized face/face with barycentric masses weighting.
I know absolutly nothing about this. I've tried google of course, but no luck :(
If anybody can give me some info on this or direct me somewhere where I can find more information about this it would be very appreciated.

Thanks
kuxv
Posts: 9
Joined: Sun Mar 30, 2008 2:10 pm

Re: Fast Collision Detection using Representative-Triangles

Post by kuxv »

So when I was looking for face-face contact generation I've came upon this http://mis.hevra.haifa.ac.il/~ishimshon ... mshoni.pdf. There is even source code included. It takes 2 triangles and tells whenever they intersects or now. But I don't think this is what is meant by contact generation. I would really appreceiate some info on this. I think that contact generation stands for points or areas which actually intersects when 2 triangles intersects. Am I right?