btShapeHull is a class to reduce the polygon count in btConvexHullShape (otherwise btConvexHullShape preforms very poorly)
To use it I was using the code below:
Code: Select all
btConvexHullShape convexHullShape(
m_pPositions->GetVertexData(), m_pPositions->GetNumVertices(), m_pPositions->GetStride()*sizeof(float));
//create a hull approximation
btShapeHull* hull = new btShapeHull(&convexHullShape);
btScalar margin = convexHullShape.getMargin();
hull->buildHull(margin);
btConvexHullShape* pConvexHullShape = new btConvexHullShape(
(const btScalar*)hull->getVertexPointer(), hull->numVertices(), sizeof(btVector3));
Setting the margin parameter to zero won't work, because that parameter is actually ignored. You actually need to call
convexHullShape.setMargin(0);
before creating the btShapeHull.
Anyway, I post this here in case it might help some one with similiar problems.