improved line trace and box primitive

This commit is contained in:
2025-04-18 13:56:08 +03:00
parent a340766348
commit 8bf0bb8e0d
4 changed files with 43 additions and 21 deletions

View File

@@ -54,7 +54,12 @@ namespace omath::collision
const auto tHit = sideB.Dot(q) * invDet;
if (tHit <= kEpsilon)
if (ray.infinite_length)
{
if (tHit <= kEpsilon)
return ray.end;
}
else if (tHit < 0.0f || tHit > 1.0f)
return ray.end;
return ray.start + rayDir * tHit;