You've already forked HackerSM64
mirror of
https://github.com/HackerN64/HackerSM64.git
synced 2026-01-21 10:35:32 -08:00
Made raycasts not hit backfaces
* Update name of lighting engine branch in readme
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user