use crate::EPSILON; use nalgebra::{Matrix4, Point3, Vector3}; pub struct Ray { pub a: Point3, pub b: Vector3, } impl Ray { pub fn new(a: Point3, b: Vector3) -> Ray { let b = b.normalize(); Ray { a, b } } pub fn at_t(&self, t: f32) -> Point3 { self.a + self.b * t } }