diff --git a/src/BulletCollision/CollisionDispatch/btConvexConvexAlgorithm.cpp b/src/BulletCollision/CollisionDispatch/btConvexConvexAlgorithm.cpp index b4fd4c6a6..7420764f0 100644 --- a/src/BulletCollision/CollisionDispatch/btConvexConvexAlgorithm.cpp +++ b/src/BulletCollision/CollisionDispatch/btConvexConvexAlgorithm.cpp @@ -367,8 +367,6 @@ void btConvexConvexAlgorithm ::processCollision (btCollisionObject* body0,btColl gjkPairDetector.getClosestPoints(input,*resultOut,dispatchInfo.m_debugDraw); - btVector3 v0,v1; - btVector3 sepNormalWorldSpace; #ifdef USE_SEPDISTANCE_UTIL2 @@ -380,8 +378,7 @@ void btConvexConvexAlgorithm ::processCollision (btCollisionObject* body0,btColl { sepDist += dispatchInfo.m_convexConservativeDistanceThreshold; //now perturbe directions to get multiple contact points - sepNormalWorldSpace = gjkPairDetector.getCachedSeparatingAxis().normalized(); - btPlaneSpace1(sepNormalWorldSpace,v0,v1); + } } #endif //USE_SEPDISTANCE_UTIL2 @@ -393,6 +390,12 @@ void btConvexConvexAlgorithm ::processCollision (btCollisionObject* body0,btColl { int i; + btVector3 v0,v1; + btVector3 sepNormalWorldSpace; + + sepNormalWorldSpace = gjkPairDetector.getCachedSeparatingAxis().normalized(); + btPlaneSpace1(sepNormalWorldSpace,v0,v1); + bool perturbeA = true; const btScalar angleLimit = 0.125f * SIMD_PI;