diff --git a/interfaces/Crafter.Math-Ray.cppm b/interfaces/Crafter.Math-Ray.cppm index e9a8ac1..e9e974d 100755 --- a/interfaces/Crafter.Math-Ray.cppm +++ b/interfaces/Crafter.Math-Ray.cppm @@ -31,13 +31,12 @@ namespace Crafter { Vector h = Vector::Cross(rayDir, edge2); float determinant = Vector::Dot(edge1, h); - if(determinant < 0) { - return -1; + return std::numeric_limits::max(); } if (determinant > -EPSILON && determinant < EPSILON) { - return -1; + return std::numeric_limits::max(); } float inverse_determinant = 1.0 / determinant; @@ -54,7 +53,7 @@ namespace Crafter { float v = inverse_determinant * Vector::Dot(rayDir, q); if (v < 0.0 || u + v > 1.0) { - return -1; + return std::numeric_limits::max(); } return inverse_determinant * Vector::Dot(edge2, q);