Fix Issue 680, compilation error using Visual Studio 2005, service pack 1, quicksort compare function needs to be in a class.

Toggle between GJK and SAT (initializePolyhedralFeatures) in convexDecomposition at easch restart of the demo (spacebar)
This commit is contained in:
erwin.coumans
2012-12-17 20:38:31 +00:00
parent c4548ec746
commit 7e14e79da0
4 changed files with 28 additions and 15 deletions

View File

@@ -1931,11 +1931,15 @@ void btConvexHullInternal::merge(IntermediateHull& h0, IntermediateHull& h1)
}
}
static bool pointCmp(const btConvexHullInternal::Point32& p, const btConvexHullInternal::Point32& q)
class pointCmp
{
return (p.y < q.y) || ((p.y == q.y) && ((p.x < q.x) || ((p.x == q.x) && (p.z < q.z))));
}
public:
bool operator() ( const btConvexHullInternal::Point32& p, const btConvexHullInternal::Point32& q ) const
{
return (p.y < q.y) || ((p.y == q.y) && ((p.x < q.x) || ((p.x == q.x) && (p.z < q.z))));
}
};
void btConvexHullInternal::compute(const void* coords, bool doubleCoords, int stride, int count)
{
@@ -2026,7 +2030,7 @@ void btConvexHullInternal::compute(const void* coords, bool doubleCoords, int st
points[i].index = i;
}
}
points.quickSort(pointCmp);
points.quickSort(pointCmp());
vertexPool.reset();
vertexPool.setArraySize(count);