optimized btConvexHullShape from mesh

Thrump
Posts: 2
Joined: Mon May 25, 2009 7:04 pm

optimized btConvexHullShape from mesh

Post by Thrump »

I'm creating a btConvexHullShape from a concave mesh, by called btConvexHullShape::addPoint on each point of the mesh. Collision-wise, it seems to be a convex hull, objects don't penetrate into the concave parts of the mesh.

I'm using debugDrawWorld to view the world, and it seems all the supplied points are being displayed from the original model. Could this be slowing down collision tests, or are the visuals different than the internal collision hull?

Is there a way that bullet can optimize a convex hull to only keep the points it needs for a best fit?
User avatar
Erwin Coumans
Site Admin
Posts: 4221
Joined: Sun Jun 26, 2005 6:43 pm
Location: California, USA

Re: optimized btConvexHullShape from mesh

Post by Erwin Coumans »

Yes, you can use the btShapeHull utility to optimize performance of convex shapes. It reduces the number of vertices automatically.

See http://www.bulletphysics.com/mediawiki- ... on_utility

Thanks,
Erwin
Thrump
Posts: 2
Joined: Mon May 25, 2009 7:04 pm

Re: optimized btConvexHullShape from mesh

Post by Thrump »

That works great (I just needed to cast the btVector3* returned by hull->getVertexPointer() to float*).
Thanks,
Mike