mirror of
https://github.com/orange-cpp/omath.git
synced 2026-02-13 07:03:25 +00:00
improved line trace and box primitive
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user