btWorldImporter convex hull performance

inverse42
Posts: 3
Joined: Mon Dec 24, 2012 5:47 am

btWorldImporter convex hull performance

Post by inverse42 »

I was seeing significant performance issues using btWorldImporter on convex hulls.

It appears the problem is that btWorldImporter::convertCollisionShape(...) uses btConvexHullShape::addPoint(...), which recomputes the local AABB each time it is called, quickly degenerating into an O(N^2) operation.

My fix was to make btWorldImporter::createConvexHullShape(...) take the points/numPoints/stride parameters and pass them directly to the btConvexHullShape constructor.

Is this the preferred fix? Should I submit this as an Issue?