Math/Ray: Fix return 0 to return false

This commit is contained in:
Lynix 2023-10-25 20:22:29 +02:00
parent 384bdc0974
commit bb9f907691
1 changed files with 2 additions and 2 deletions

View File

@ -421,12 +421,12 @@ namespace Nz
Vector3<T> directionToPoint = origin - firstPoint;
T u = directionToPoint.DotProduct(P) / divisor;
if (u < T(0.0) || u > T(1.0))
return 0; // The intersection lies outside of the triangle
return false; // The intersection lies outside of the triangle
Vector3<T> Q = Vector3<T>::CrossProduct(directionToPoint, firstEdge);
T v = directionToPoint.DotProduct(Q) / divisor;
if (v < T(0.0) || u + v > T(1.0))
return 0; // The intersection lies outside of the triangle
return false; // The intersection lies outside of the triangle
T t = secondEdge.DotProduct(Q) / divisor;
if (t > T(0.0))