0031295: Foundation Classes, BVH_Tools - incorrect detection of ray-box intersection
authorosa <osa@opencascade.com>
Mon, 13 Jan 2020 09:14:59 +0000 (12:14 +0300)
committerbugmaster <bugmaster@opencascade.com>
Mon, 13 Jan 2020 13:18:55 +0000 (16:18 +0300)
src/BVH/BVH_Tools.hxx

index ad5b609..847d904 100644 (file)
@@ -269,7 +269,7 @@ public: //! @name Ray-Box Intersection
     T aTimeEnter = Max (aTimeMin[0], Max (aTimeMin[1], aTimeMin[2]));
     T aTimeLeave = Min (aTimeMax[0], Min (aTimeMax[1], aTimeMax[2]));
 
-    Standard_Boolean hasIntersection = aTimeEnter < aTimeLeave && aTimeLeave > 0;
+    Standard_Boolean hasIntersection = aTimeEnter <= aTimeLeave && aTimeLeave >= 0;
     if (hasIntersection)
     {
       theTimeEnter = aTimeEnter;