btConvexHullShape slow

Post Reply
ed_welch
Posts: 43
Joined: Wed Mar 04, 2015 6:16 pm

btConvexHullShape slow

Post by ed_welch »

I've measured btConvexHullShape to be 3 times as slow as btBvhTriangleMeshShape for ray testing (that's even with using btShapeHull to speed it up). Is that right? Because the Wiki says it's ment to be faster.
User avatar
Erwin Coumans
Site Admin
Posts: 4221
Joined: Sun Jun 26, 2005 6:43 pm
Location: California, USA
Contact:

Re: btConvexHullShape slow

Post by Erwin Coumans »

The btConvexHullShape performance is better for contact queries, but not ray cast/convex cast queries indeed.
The ray cast/convex cast query is pretty slow for btConvexHullShape, it uses an iterative algorithm with up to 1000 iterations. The btBvhTriangleMeshShape uses a ray-triangle implementation.

For Bullet 3 there is a fast ray-convex query implementation, so once the code base of Bullet 2 and Bullet 3 is fully merged, the issue is resolved.
If you want to implement the ray versus btConvexHullShape yourself, see rayConvex in Bullet/src/Bullet3OpenCL/Raycast/b3GpuRaycast.cpp (it is a CPU implementation, but it requires plane equations, there is code to generate those).
ed_welch
Posts: 43
Joined: Wed Mar 04, 2015 6:16 pm

Re: btConvexHullShape slow

Post by ed_welch »

Ok, that's good to know. Thanks for the answer ;)
Post Reply