aboutsummaryrefslogtreecommitdiff
path: root/src/intersect/intersect.cpp
diff options
context:
space:
mode:
authorFate Bussey <lafayette_bussey@brown.edu>2023-12-12 14:00:56 -0500
committerFate Bussey <lafayette_bussey@brown.edu>2023-12-12 14:00:56 -0500
commit2117034251eaa124ec9c6bec4524e490a0ee9ec0 (patch)
tree2b6ef68677e779ff118a6f5b342a5f57464b8593 /src/intersect/intersect.cpp
parent58c896801817ac67913644ccd9373cd18774232a (diff)
potentially buggy normals and first update to phong
Diffstat (limited to 'src/intersect/intersect.cpp')
-rw-r--r--src/intersect/intersect.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/intersect/intersect.cpp b/src/intersect/intersect.cpp
index cc3143d..3e8493c 100644
--- a/src/intersect/intersect.cpp
+++ b/src/intersect/intersect.cpp
@@ -114,7 +114,7 @@ glm::vec4 intersectCylinder(
{
float t = FINF;
- // implicit: x^2 + z^2 = r^2, y + w between -.5, 5 rectuangular side
+ // implicit: x^2 + z^2 = r^2, y + w between -.5, .5 rectuangular side
float radius = 0.5f;
float a = d.x*d.x + d.z*d.z;
float b = 2.f * (p.x*d.x + p.z*d.z);
@@ -149,7 +149,7 @@ glm::vec4 intersectCylinder(
// implicit y + w = .5f, top base
- float tTop = (.5f - p.y - p.y) / (d[3] + d.y);
+ float tTop = (.5f - p.y - p[3]) / (d[3] + d.y);
auto pTop = p + tTop * d;
if (
tTop > 0 &&
@@ -162,7 +162,7 @@ glm::vec4 intersectCylinder(
// implicit p_y + t*d_y = -.5f, Bottom base
- float tBase = (.5f - p.y - p.y) / (d[3] + d.y);
+ float tBase = (.5f - p.y - p[3]) / (d[3] + d.y);
auto pBase = p + tBase * d;
if (
tBase > 0 &&