1use crate::math::Interval;2use crate::math::NormalizedVec3;3use crate::math::NotNanF64;4use crate::math::Point;5use crate::math::Ray;67mod list;8mod sphere;910pub struct HitRecord {11 pub point: Point,12 pub normal: NormalizedVec3,13 pub t: NotNanF64,14 pub front_face: bool,15}1617impl HitRecord {18 fn new(r: &Ray, point: Point, outward_normal: NormalizedVec3, t: NotNanF64) -> HitRecord {19 let front_face = r.dir.dot(&outward_normal) < 0.;20 HitRecord {21 point,22 normal: if front_face {23 outward_normal24 } else {25 -outward_normal26 },27 t,28 front_face,29 }30 }31}3233pub trait Hittable: Send {34 fn hit(&self, r: &Ray, range: &Interval) -> Option<HitRecord>;35}3637pub use list::HittableList;38pub use sphere::Sphere;