use crate::vec3::Vec3; pub struct Ray { origin: Vec3, direction: Vec3, } impl Ray { pub fn new(origin: Vec3, direction: Vec3) -> Ray { Ray { origin, direction } } pub fn origin(&self) -> &Vec3 { &self.origin } pub fn direction(&self) -> &Vec3 { &self.direction } pub fn at(&self, go_length: f64) -> Vec3 { self.origin + go_length * self.direction } }