From 12e5357c78cb775d243f106237f94f36a8c7190f Mon Sep 17 00:00:00 2001 From: Joseph Mirabel <jmirabel@laas.fr> Date: Wed, 28 Aug 2019 12:01:55 +0200 Subject: [PATCH] [Bug] Fix computation of penetration depth for triangle / triangle query. --- src/narrowphase/narrowphase.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/narrowphase/narrowphase.cpp b/src/narrowphase/narrowphase.cpp index 00897891..ab80770f 100644 --- a/src/narrowphase/narrowphase.cpp +++ b/src/narrowphase/narrowphase.cpp @@ -672,6 +672,9 @@ bool GJKSolver_indep::shapeDistance<Capsule, Capsule> (P1, P2, P3, Q1, Q2, Q3, tf1, tf2, normal); dist = -penetrationDepth; assert (dist <= 1e-6); + // GJK says Inside when below GJK.tolerance. So non intersecting + // triangle may trigger "Inside" and have no penetration. + return penetrationDepth < 0; } dist = 0; return false; -- GitLab