diff --git a/src/engine/math_util.c b/src/engine/math_util.c index 722d12466..c410e558b 100644 --- a/src/engine/math_util.c +++ b/src/engine/math_util.c @@ -1339,8 +1339,8 @@ s32 ray_surface_intersect(Vec3f orig, Vec3f dir, f32 dir_length, struct Surface vec3f_cross(h, dir, e2); // Determine the cos(angle) difference between ray and surface normals. f32 det = vec3f_dot(e1, h); - // Check if we're perpendicular from the surface. - if ((det > -NEAR_ZERO) && (det < NEAR_ZERO)) return FALSE; + // Check if we're perpendicular or pointing away from the surface. + if (det < NEAR_ZERO) return FALSE; // Check if we're making contact with the surface. // Make f the inverse of the cos(angle) between ray and surface normals. f32 f = 1.0f / det; // invDet