Fixed bug in plane intersection test
This commit is contained in:
parent
6d2a1407bf
commit
cd94c7ad6f
1 changed files with 1 additions and 1 deletions
|
|
@ -67,7 +67,7 @@ impl Surface for Plane {
|
|||
fn intersect(&self, ray: Ray) -> Option<f32> {
|
||||
|
||||
let d = self.normal.dot(&ray.direction);
|
||||
if d < 1e-3 { return None; }
|
||||
if d > -1e-3 { return None; }
|
||||
|
||||
let t = (self.center - ray.origin).dot(&*self.normal) / d;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue