diff options
author | Martin Poirier <theeth@yahoo.com> | 2009-03-13 21:04:38 +0300 |
---|---|---|
committer | Martin Poirier <theeth@yahoo.com> | 2009-03-13 21:04:38 +0300 |
commit | 54a55827ecee7f25d6a52255d8a639498a678fa6 (patch) | |
tree | 6311657bfab7e75fa59e6828e0381bdcd4ec9eda /extern/bullet2/src/BulletCollision/CollisionDispatch/btBoxBoxDetector.cpp | |
parent | dff781c2a8c77f35fefe00b0a561235861d4d053 (diff) | |
parent | 39acb4efa4c3f35806f5dc37124ff1028eb18215 (diff) |
merging trunk 19093:19274etch-a-ton
Diffstat (limited to 'extern/bullet2/src/BulletCollision/CollisionDispatch/btBoxBoxDetector.cpp')
-rw-r--r-- | extern/bullet2/src/BulletCollision/CollisionDispatch/btBoxBoxDetector.cpp | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/extern/bullet2/src/BulletCollision/CollisionDispatch/btBoxBoxDetector.cpp b/extern/bullet2/src/BulletCollision/CollisionDispatch/btBoxBoxDetector.cpp index 45ebff5dc45..31353f1b2c4 100644 --- a/extern/bullet2/src/BulletCollision/CollisionDispatch/btBoxBoxDetector.cpp +++ b/extern/bullet2/src/BulletCollision/CollisionDispatch/btBoxBoxDetector.cpp @@ -207,7 +207,13 @@ void cullPoints2 (int n, btScalar p[], int m, int i0, int iret[]) cy += q*(p[i*2+1]+p[i*2+3]); } q = p[n*2-2]*p[1] - p[0]*p[n*2-1]; - a = 1.f/(btScalar(3.0)*(a+q)); + if (btFabs(a+q) > SIMD_EPSILON) + { + a = 1.f/(btScalar(3.0)*(a+q)); + } else + { + a=1e30f; + } cx = a*(cx + q*(p[n*2-2]+p[0])); cy = a*(cy + q*(p[n*2-1]+p[1])); } @@ -226,9 +232,9 @@ void cullPoints2 (int n, btScalar p[], int m, int i0, int iret[]) a = btScalar(j)*(2*M__PI/m) + A[i0]; if (a > M__PI) a -= 2*M__PI; btScalar maxdiff=1e9,diff; -#if defined(DEBUG) || defined (_DEBUG) - *iret = i0; // iret is not allowed to keep this value -#endif + + *iret = i0; // iret is not allowed to keep this value, but it sometimes does, when diff=#QNAN0 + for (i=0; i<n; i++) { if (avail[i]) { diff = btFabs (A[i]-a); |