From 53966ad869f7e52ba9d600787091eea9abafba3d Mon Sep 17 00:00:00 2001 From: Maximilian Giller Date: Thu, 17 Nov 2022 16:55:18 +0100 Subject: [PATCH] Fixes box collision condition to fix mirror effect --- primitive/box.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/primitive/box.cpp b/primitive/box.cpp index 4a368fd..4bd430e 100644 --- a/primitive/box.cpp +++ b/primitive/box.cpp @@ -52,7 +52,7 @@ bool Box::intersect(Ray &ray) const float t = tIn; // Test whether this is the foremost primitive in front of the camera - if (t >= ray.length) + if (t >= ray.length || t < EPSILON) { return false; }