From 18024d43b9d79818d8b124b85264582195af2794 Mon Sep 17 00:00:00 2001 From: Nathan Vegdahl Date: Wed, 25 Oct 2017 06:59:35 -0700 Subject: [PATCH] Stupid bug in SphereLight ray intersection code. The ray origin wasn't transformed into local space, resulting in silly problems. --- src/light/sphere_light.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/light/sphere_light.rs b/src/light/sphere_light.rs index afeea9a..4a2334e 100644 --- a/src/light/sphere_light.rs +++ b/src/light/sphere_light.rs @@ -227,7 +227,7 @@ impl<'a> Surface for SphereLight<'a> { let radius = lerp_slice(self.radii, r.time); // Radius of the sphere // Get the ray origin and direction in local space - let orig = r.orig.into_vector(); + let orig = (r.orig * xform).into_vector(); let dir = wr.dir * xform; // Code adapted to Rust from https://github.com/Tecla/Rayito