summaryrefslogtreecommitdiff
path: root/src/object.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/object.rs')
-rw-r--r--src/object.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/object.rs b/src/object.rs
index ff965f0..0da9148 100644
--- a/src/object.rs
+++ b/src/object.rs
@@ -37,7 +37,7 @@ pub struct Sphere {
impl Sphere {
pub fn new(center: Vec3, radius: f32) -> Self {
- let r = f32::max(0.0, radius);
+ let radius = f32::max(0.0, radius);
Self { center, radius }
}
}
@@ -65,7 +65,7 @@ impl Hittable for Sphere {
rec.t = root;
rec.position = r.at(rec.t);
- let outward_normal = rec.normal
+ let outward_normal = rec.position
.sub(&self.center)
.scalar_mul(1.0 / self.radius);
rec.set_face_normal(r, outward_normal);