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