diff --git a/src/bounds.cpp b/src/bounds.cpp index 6cb0cf6..e6e3781 100644 --- a/src/bounds.cpp +++ b/src/bounds.cpp @@ -2045,7 +2045,12 @@ namespace bx return true; } - const Vec3 pos = closestPoint(plane, hit.pos); + const Vec3 nearest = abs(distance(plane, line.pos) ) <= abs(distance(plane, line.end) ) + ? line.pos + : line.end + ; + + const Vec3 pos = closestPoint(plane, nearest); const Vec3 uvw = barycentric(_triangle, pos); const float nr = -_ty.radius; diff --git a/src/os.cpp b/src/os.cpp index 23c3e7c..be93dd0 100644 --- a/src/os.cpp +++ b/src/os.cpp @@ -372,6 +372,8 @@ namespace bx #else _Exit(_exitCode); #endif // BX_PLATFORM_* + + BX_UNREACHABLE; } namespace