Trait Hittable

Source
pub trait Hittable {
    // Required method
    fn hit(&self, r: &Ray, t_min: f64, t_max: f64) -> Option<HitRecord>;
}
Expand description

Trait for objects that can be intersected by a ray.

Required Methods§

Source

fn hit(&self, r: &Ray, t_min: f64, t_max: f64) -> Option<HitRecord>

Returns Some(HitRecord) if the ray intersects in the interval [t_min, t_max], or None.

Implementors§