1use super::NormalizedVec3;2use super::vec3::Point;34#[derive(Debug, Copy, Clone)]5pub struct Ray {6 pub orig: Point,7 pub dir: NormalizedVec3,8}910impl Ray {11 pub fn at(self, t: f64) -> Point {12 self.orig + self.dir.get() * t13 }14}
https://raytracing.github.io in Rust
git clone https://code.pdelong.com/raytracing-rs.git
1use super::NormalizedVec3;2use super::vec3::Point;34#[derive(Debug, Copy, Clone)]5pub struct Ray {6 pub orig: Point,7 pub dir: NormalizedVec3,8}910impl Ray {11 pub fn at(self, t: f64) -> Point {12 self.orig + self.dir.get() * t13 }14}