diff --git a/src/BulletCollision/CollisionDispatch/btConvexConvexAlgorithm.cpp b/src/BulletCollision/CollisionDispatch/btConvexConvexAlgorithm.cpp index 5f447af2a..44dd3c553 100644 --- a/src/BulletCollision/CollisionDispatch/btConvexConvexAlgorithm.cpp +++ b/src/BulletCollision/CollisionDispatch/btConvexConvexAlgorithm.cpp @@ -296,7 +296,7 @@ void btConvexConvexAlgorithm ::processCollision(const btCollisionObjectWrapper* btCapsuleShape* capsuleA = (btCapsuleShape*)min0; btCapsuleShape* capsuleB = (btCapsuleShape*)min1; - btScalar threshold = m_manifoldPtr->getContactBreakingThreshold(); + btScalar threshold = m_manifoldPtr->getContactBreakingThreshold()+ resultOut->m_closestPointDistanceThreshold; btScalar dist = capsuleCapsuleDistance(normalOnB, pointOnBWorld, capsuleA->getHalfHeight(), capsuleA->getRadius(), capsuleB->getHalfHeight(), capsuleB->getRadius(), capsuleA->getUpAxis(), capsuleB->getUpAxis(), @@ -318,7 +318,7 @@ void btConvexConvexAlgorithm ::processCollision(const btCollisionObjectWrapper* btCapsuleShape* capsuleA = (btCapsuleShape*)min0; btSphereShape* capsuleB = (btSphereShape*)min1; - btScalar threshold = m_manifoldPtr->getContactBreakingThreshold(); + btScalar threshold = m_manifoldPtr->getContactBreakingThreshold()+ resultOut->m_closestPointDistanceThreshold; btScalar dist = capsuleCapsuleDistance(normalOnB, pointOnBWorld, capsuleA->getHalfHeight(), capsuleA->getRadius(), 0., capsuleB->getRadius(), capsuleA->getUpAxis(), 1, @@ -340,7 +340,7 @@ void btConvexConvexAlgorithm ::processCollision(const btCollisionObjectWrapper* btSphereShape* capsuleA = (btSphereShape*)min0; btCapsuleShape* capsuleB = (btCapsuleShape*)min1; - btScalar threshold = m_manifoldPtr->getContactBreakingThreshold(); + btScalar threshold = m_manifoldPtr->getContactBreakingThreshold()+ resultOut->m_closestPointDistanceThreshold; btScalar dist = capsuleCapsuleDistance(normalOnB, pointOnBWorld, 0., capsuleA->getRadius(), capsuleB->getHalfHeight(), capsuleB->getRadius(), 1, capsuleB->getUpAxis(), @@ -480,7 +480,7 @@ void btConvexConvexAlgorithm ::processCollision(const btCollisionObjectWrapper* btPolyhedralConvexShape* polyhedronB = (btPolyhedralConvexShape*)min1; if (polyhedronA->getConvexPolyhedron() && polyhedronB->getConvexPolyhedron()) { - btScalar threshold = m_manifoldPtr->getContactBreakingThreshold(); + btScalar threshold = m_manifoldPtr->getContactBreakingThreshold()+ resultOut->m_closestPointDistanceThreshold; btScalar minDist = -1e30f; btVector3 sepNormalWorldSpace; @@ -547,7 +547,7 @@ void btConvexConvexAlgorithm ::processCollision(const btCollisionObjectWrapper* //tri->initializePolyhedralFeatures(); - btScalar threshold = m_manifoldPtr->getContactBreakingThreshold(); + btScalar threshold = m_manifoldPtr->getContactBreakingThreshold()+ resultOut->m_closestPointDistanceThreshold; btVector3 sepNormalWorldSpace; btScalar minDist = -1e30f; diff --git a/src/BulletCollision/CollisionDispatch/btConvexPlaneCollisionAlgorithm.cpp b/src/BulletCollision/CollisionDispatch/btConvexPlaneCollisionAlgorithm.cpp index 994609ab0..ba1bc06b6 100644 --- a/src/BulletCollision/CollisionDispatch/btConvexPlaneCollisionAlgorithm.cpp +++ b/src/BulletCollision/CollisionDispatch/btConvexPlaneCollisionAlgorithm.cpp @@ -116,7 +116,7 @@ void btConvexPlaneCollisionAlgorithm::processCollision(const btCollisionObjectWr btVector3 vtxInPlaneProjected = vtxInPlane - distance * planeNormal; btVector3 vtxInPlaneWorld = planeObjWrap->getWorldTransform() * vtxInPlaneProjected; - hasCollision = distance < m_manifoldPtr->getContactBreakingThreshold(); + hasCollision = distance < m_manifoldPtr->getContactBreakingThreshold()+ resultOut->m_closestPointDistanceThreshold; resultOut->setPersistentManifold(m_manifoldPtr); if (hasCollision) {