Stupid bug in SphereLight ray intersection code.
The ray origin wasn't transformed into local space, resulting in silly problems.
This commit is contained in:
parent
461b3c377e
commit
18024d43b9
|
@ -227,7 +227,7 @@ impl<'a> Surface for SphereLight<'a> {
|
||||||
let radius = lerp_slice(self.radii, r.time); // Radius of the sphere
|
let radius = lerp_slice(self.radii, r.time); // Radius of the sphere
|
||||||
|
|
||||||
// Get the ray origin and direction in local space
|
// 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;
|
let dir = wr.dir * xform;
|
||||||
|
|
||||||
// Code adapted to Rust from https://github.com/Tecla/Rayito
|
// Code adapted to Rust from https://github.com/Tecla/Rayito
|
||||||
|
|
Loading…
Reference in New Issue
Block a user