Made raycasts not hit backfaces

* Update name of lighting engine branch in readme
This commit is contained in:
KazeEmanuar
2022-06-09 16:04:58 +02:00
committed by GitHub
parent 4cfbc656a9
commit a1ab7c51f0

View File

@@ -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