2
0
mirror of https://github.com/AxioDL/metaforce.git synced 2025-12-09 04:27:42 +00:00

Several collision fixes

This commit is contained in:
Jack Andersen
2017-12-17 16:54:50 -10:00
parent 2a8edf9da8
commit 73ae278c87
29 changed files with 114 additions and 110 deletions

View File

@@ -328,14 +328,14 @@ bool RayTriangleIntersection(const zeus::CVector3f& point, const zeus::CVector3f
return false;
zeus::CVector3f v0toPoint = point - verts[0];
float dot1 = v0toPoint.dot(cross0);
if (dot1 < 0.0 || dot1 > dot0)
if (dot1 < 0.f || dot1 > dot0)
return false;
zeus::CVector3f cross1 = v0toPoint.cross(v0tov1);
float dot2 = cross1.dot(dir);
if (dot2 < 0.0 || dot1 + dot2 > dot0)
if (dot2 < 0.f || dot1 + dot2 > dot0)
return false;
float final = 1.0 / dot0 * cross1.dot(v0tov2);
if (final < 0.0 || final >= d)
float final = 1.f / dot0 * cross1.dot(v0tov2);
if (final < 0.f || final >= d)
return false;
d = final;
return true;