aboutsummaryrefslogtreecommitdiff
path: root/src/intersect/intersect.cpp
diff options
context:
space:
mode:
authorsotech117 <michael_foiani@brown.edu>2023-12-13 01:30:52 -0500
committersotech117 <michael_foiani@brown.edu>2023-12-13 01:30:52 -0500
commit07776876eb4638a224fd332944ce9ddca1f5a592 (patch)
tree1fbe79ac2b7dfc70d5963c7b9928e2f09910c00e /src/intersect/intersect.cpp
parentc6f2be2fed772f300c0cdfe59a4a8a2733d15574 (diff)
hardcode the camera depth to where a result is shown
Diffstat (limited to 'src/intersect/intersect.cpp')
-rw-r--r--src/intersect/intersect.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/intersect/intersect.cpp b/src/intersect/intersect.cpp
index 353508e..69512e3 100644
--- a/src/intersect/intersect.cpp
+++ b/src/intersect/intersect.cpp
@@ -1,3 +1,4 @@
+#include <iostream>
#include "raytracer/raytracer.h"
/**
@@ -28,6 +29,7 @@ glm::vec4 intersectCircle(
return glm::vec4(0.f);
}
+
float t1 = (-b - std::sqrt(discriminant)) / (2.f*a);
float t2 = (-b + std::sqrt(discriminant)) / (2.f*a);
if (t1 <= 0 && t2 <= 0) // both behind camera