From cd94c7ad6fa28203f8da308d585fa7b5c974cfe8 Mon Sep 17 00:00:00 2001 From: bijan-S Date: Wed, 5 May 2021 21:48:22 -0400 Subject: [PATCH] Fixed bug in plane intersection test --- src/object/plane.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/object/plane.rs b/src/object/plane.rs index 981fb5f..4d2fc83 100644 --- a/src/object/plane.rs +++ b/src/object/plane.rs @@ -67,7 +67,7 @@ impl Surface for Plane { fn intersect(&self, ray: Ray) -> Option { let d = self.normal.dot(&ray.direction); - if d < 1e-3 { return None; } + if d > -1e-3 { return None; } let t = (self.center - ray.origin).dot(&*self.normal) / d;