use crate::vec3::{Point3, Vec3}; pub struct Ray { pub origin: Point3, pub direction: Vec3, } impl Ray { // TODO: Sanity check perf difference between using &Vec3 and cloning it vs just asking for // Vec3 and not cloning pub fn new(origin: Point3, direction: Vec3) -> Self { Ray { origin, direction } } pub fn at(&self, time: f64) -> Point3 { self.origin + time * self.direction } }