diff options
author | Julian T <julian@jtle.dk> | 2021-02-21 18:01:56 +0100 |
---|---|---|
committer | Julian T <julian@jtle.dk> | 2021-02-21 18:01:56 +0100 |
commit | da1c3949a449f3fafe579c62ff6b14ffd993a197 (patch) | |
tree | 754df5c9b5e9f0fa0a8bb7a8cd3dd4b12fe5ad89 /src/trace/mod.rs | |
parent | c695da871a75bb6786c08c3546ef71ed032bd61d (diff) |
Add 3d bounding box and merged SceneIntersection and Intersection
Diffstat (limited to 'src/trace/mod.rs')
-rw-r--r-- | src/trace/mod.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/trace/mod.rs b/src/trace/mod.rs index b7de476..d45fb23 100644 --- a/src/trace/mod.rs +++ b/src/trace/mod.rs @@ -1,4 +1,4 @@ -use crate::world::Scene; +use crate::world::{Hittable, Scene}; use crate::core::{Spectrum, Ray, Vector3f}; use crate::sample::Sampler; @@ -30,8 +30,8 @@ impl NormTracer<'_> { impl Tracer for NormTracer<'_> { fn trace(&self, _: &mut dyn Sampler, ray: &Ray) -> Spectrum { // Trace ray, we dont care about material - if let Some(si) = self.scn.intersect(ray) { - let norm = si.i.n * 0.5 + Vector3f::new(0.5); + if let Some(i) = self.scn.intersect(ray) { + let norm = i.n * 0.5 + Vector3f::new(0.5); return Spectrum::new_rgb(norm.x, norm.y, norm.z); } |