aboutsummaryrefslogtreecommitdiff
path: root/src/world/shapes/sphere.rs
diff options
context:
space:
mode:
authorJulian T <julian@jtle.dk>2021-07-31 14:02:52 +0200
committerJulian T <julian@jtle.dk>2021-07-31 14:02:52 +0200
commitcee9bcf4a2c8ffbfe6487f7886b2247eaba1c92c (patch)
tree7fd405d9a3f6351d6341706fba50a8616d6c3a84 /src/world/shapes/sphere.rs
parent55044e56304c8484b8ff52f362ab1c66c9c5ca93 (diff)
Better documentation and cleanup
Diffstat (limited to 'src/world/shapes/sphere.rs')
-rw-r--r--src/world/shapes/sphere.rs12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/world/shapes/sphere.rs b/src/world/shapes/sphere.rs
index e3348de..9ecedd6 100644
--- a/src/world/shapes/sphere.rs
+++ b/src/world/shapes/sphere.rs
@@ -42,12 +42,12 @@ impl Hittable for Sphere {
return None
}
let w = ray.at(distance);
- Some(Intersection {
- n: self.norm_at(&w),
- p: w,
- t: distance,
- m: None,
- })
+ Some(Intersection::new(
+ self.norm_at(&w),
+ w,
+ ray,
+ distance,
+ ))
}
}