remove debug logging and add some comments

This commit is contained in:
Andrew Meadows 2016-05-20 15:07:47 -07:00
parent 83b8ef8131
commit 2e30f0916c

View file

@ -70,14 +70,15 @@ btConvexHullShape* ShapeFactory::createConvexHull(const QVector<glm::vec3>& poin
// create hull approximation // create hull approximation
btShapeHull shapeHull(hull); btShapeHull shapeHull(hull);
shapeHull.buildHull(margin); shapeHull.buildHull(margin);
// we cannot copy Bullet shapes so we must create a new one...
btConvexHullShape* newHull = new btConvexHullShape(); btConvexHullShape* newHull = new btConvexHullShape();
const btVector3* newPoints = shapeHull.getVertexPointer(); const btVector3* newPoints = shapeHull.getVertexPointer();
for (int i = 0; i < shapeHull.numVertices(); ++i) { for (int i = 0; i < shapeHull.numVertices(); ++i) {
newHull->addPoint(newPoints[i], false); newHull->addPoint(newPoints[i], false);
} }
// ...and delete the old one
delete hull; delete hull;
hull = newHull; hull = newHull;
qDebug() << "reduced hull with" << points.size() << "points down to" << hull->getNumPoints(); // TODO: remove after testing
} }
hull->recalcLocalAabb(); hull->recalcLocalAabb();