From 405d746c57a6b3d0e0564676429f4aa626d88878 Mon Sep 17 00:00:00 2001
From: Florent Lamiraux <florent@laas.fr>
Date: Fri, 21 Dec 2018 15:15:38 +0100
Subject: [PATCH] Fix details::sphereTriangleIntersect.

---
 src/narrowphase/details.h | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/narrowphase/details.h b/src/narrowphase/details.h
index 5488d238..e3f9448d 100644
--- a/src/narrowphase/details.h
+++ b/src/narrowphase/details.h
@@ -424,7 +424,9 @@ namespace fcl {
           Vec3f unit (center_to_contact.normalized ());
           p1 = center + radius * unit;
           p2 = contact_point;
+          distance = (p2 - p1).norm ();
         }
+      assert ((distance < 0) || (fabs (distance - (p2-p1).norm ()) < 1e-7));
       return has_contact;
     }
 
-- 
GitLab