From 0d4d15209fb7fbcacec538084d4fa81308276e77 Mon Sep 17 00:00:00 2001 From: vonhyou Date: Mon, 19 Feb 2024 17:30:29 -0500 Subject: [PATCH] bugfix: incorrect type --- src/Geometry.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Geometry.cc b/src/Geometry.cc index 93c6241..5eaab26 100644 --- a/src/Geometry.cc +++ b/src/Geometry.cc @@ -6,9 +6,9 @@ void Geometry::setTransform(const Matrix4f &transform) { bool Sphere::intersect(const Ray &r) const { Vector3f originCenter = r.getOrigin() - center; - int a = r.getDirection().dot(r.getDirection()); - int b = 2 * originCenter.dot(r.getDirection()); - int c = originCenter.dot(originCenter) - radius * radius; + float a = r.getDirection().dot(r.getDirection()); + float b = 2.0f * originCenter.dot(r.getDirection()); + float c = originCenter.dot(originCenter) - radius * radius; return b * b - 4 * a * c >= 0; }