Make BenchmarkDemo a console application, without OpenGL/Glut dependency.

Fix potential division by zero when enabling convex distance utility.
Thanks to linzner http://code.google.com/p/bullet/issues/detail?id=264
This commit is contained in:
erwin.coumans
2009-08-12 08:18:57 +00:00
parent ae3255f5e9
commit e89fe1cbfa
17 changed files with 152 additions and 90 deletions

View File

@@ -215,9 +215,10 @@ void btConvexConvexAlgorithm ::processCollision (btCollisionObject* body0,btColl
#ifdef USE_SEPDISTANCE_UTIL2
if (dispatchInfo.m_useConvexConservativeDistanceUtil)
{
sepDist = gjkPairDetector.getCachedSeparatingDistance()+dispatchInfo.m_convexConservativeDistanceThreshold;
sepDist = gjkPairDetector.getCachedSeparatingDistance();
if (sepDist>SIMD_EPSILON)
{
sepDist += dispatchInfo.m_convexConservativeDistanceThreshold;
//now perturbe directions to get multiple contact points
sepNormalWorldSpace = gjkPairDetector.getCachedSeparatingAxis().normalized();
btPlaneSpace1(sepNormalWorldSpace,v0,v1);