btConvexHullShape slow
btConvexHullShape slow
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.
- Erwin Coumans
- Site Admin
- Posts: 4221
- Joined: Sun Jun 26, 2005 6:43 pm
- Location: California, USA
- Contact:
Re: btConvexHullShape slow
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).
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).
Re: btConvexHullShape slow
Ok, that's good to know. Thanks for the answer