Does Bullet supports nonconvex meshes

plamen_t
Posts: 6
Joined: Wed Nov 12, 2008 8:58 pm

Does Bullet supports nonconvex meshes

Post by plamen_t »

Hi all,

I have one question. Does Bullet supports collision detection of nonconvex meshes? I have models which are nonconvex. Also is the performance penalty too big if I use nonconvex meshes. I mean for example if I have one convex mesh with 1000 triangles and one nonconvex mesh with 1000 triangles how much will be the difference in the time?

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

Re: Does Bullet supports nonconvex meshes

Post by Erwin Coumans »

Yes, Bullet support concave triangle meshes. For non-moving static world geometry, it is best to use btBvhTriangleMeshShape.

For moving concave meshes, you can use btGimpactShape, see Bullet/Demos/MovingConcaveDemo. For best performance, while keeping the shape concave, you can use a btCompoundShape and convex child shapes. Conversion from concave mesh to btCompoundShape can be done using automatic convex decomposition, see Bullet/Demos/ConvexDecompositionDemo.

In general, convex shapes shouldn't have over 100 vertices. You can use the btShapeHull utility to automatically simplify and reduce the number of vertices for convex shapes.
Hope this helps,
Erwin