collision library for raycasting triangle meshes

Post Reply
jorrit5477
Posts: 3
Joined: Wed Oct 18, 2006 6:09 pm

collision library for raycasting triangle meshes

Post by jorrit5477 »

Hello,

For a project at my college I am integrating an haptic device in a 3D render engine. To detect collision between the 3D cursor and shapes I would like to use an external collision library.
Shapes can be either moving or static and ar build from triangle meshes (no primitives implemented thusfar).

I have implemented a system using Opcode and raycasting (using 4 rays per test), but it seems to miss some collisions every now and then, resulting in slipthrough (the cursor going through the surface) when the shape is complex.
Now I am looking for another library to test for collisions, but I see that triangle meshes difficult to use in Bullet.

Can I use Bullet and triangle meshes (or can I create complex compound objects to do this)? Or is any other library more suitable for this?

Hope somebody can help me, since it is fairly unknown matter at my college.

Regards,
Jorrit
User avatar
Erwin Coumans
Site Admin
Posts: 4221
Joined: Sun Jun 26, 2005 6:43 pm
Location: California, USA
Contact:

Re: collision library for raycasting triangle meshes

Post by Erwin Coumans »

jorrit5477 wrote:Hello,

For a project at my college I am integrating an haptic device in a 3D render engine. To detect collision between the 3D cursor and shapes I would like to use an external collision library.
Shapes can be either moving or static and ar build from triangle meshes (no primitives implemented thusfar).

I have implemented a system using Opcode and raycasting (using 4 rays per test), but it seems to miss some collisions every now and then, resulting in slipthrough (the cursor going through the surface) when the shape is complex.
Now I am looking for another library to test for collisions, but I see that triangle meshes difficult to use in Bullet.
What is exactly hard about using Bullet's btTriangleMeshShape? You can just pass a btTriangleMesh as input, which is easiest. If you are only interested in collision detection/raycasting just check out CollisionInterfaceDemo, or RaycastDemo. It sounds you can beter use convex cast, and cast an object, instead of a ray. Check btConvexCast, see GjkConvexCastDemo, or ContinuousConvexCollision. This allows to sweep of perform CCD tests.
Can I use Bullet and triangle meshes (or can I create complex compound objects to do this)? Or is any other library more suitable for this?
You can use Bullet compounds. Also you can try out FAST. It has CCD with concave triangle meshes. See links for paper and download the C++ sources for FAST
http://www.continuousphysics.com/Bullet ... .php?t=608

THanks,
Erwin


Hope somebody can help me, since it is fairly unknown matter at my college.

Regards,
Jorrit[/quote]
jorrit5477
Posts: 3
Joined: Wed Oct 18, 2006 6:09 pm

Post by jorrit5477 »

Thank you for the quick reply :)

The thing I saw in doing a quick research on this forum was that moving triangle meshes are not supported (that was mentoined with what I said 'difficult').

I use those 4 rays to detect if the start and end point of a given line segment are inside the mesh/shape (2 rays for each point, requiring that either on of the tests result in an odd number of detected collisions. This is done since I need to know if the line segment intersects the back or the front side of a face (if any).

I cannot tell if a shape will be convex or not, and the system requires precise detection. So maybe I can use a composition of convex shapes to represent the mesh.

I'll have a look at FAST as well.

Thanks,
Jorrit
Post Reply