fn hit(&self, r: &Ray, t_min: f64, t_max: f64) -> Option<HitRecord> {
        let mut record = None;
        let mut closest_so_far = t_max;

        for object in &self.objects {
            if let Some(hit_record) = object.hit(r, t_min, closest_so_far) {
                closest_so_far = hit_record.t;
                record = Some(hit_record);
            }
        }

        record
    }
/// Tries to hit an object in the hittable list.
/// Returns a [`HitRecord`] of the closest hit.
Tries to hit an object in the hittable list.
Returns a [`HitRecord`] of the closest hit.
Tries to hit an object in the hittable list . Returns a [ ` HitRecord ` ] of the closest hit .
fn hit(&self, r: &Ray, t_min: f64, t_max: f64) -> Option<HitRecord> {
        let mut record = None;
        let mut closest_so_far = t_max;
        for object in &self.objects {
            if let Some(hit_record) = object.hit(r, t_min, closest_so_far) {
                closest_so_far = hit_record.t;
                record = Some(hit_record);
            }
        }
        record
    }
fn hit ( & self , r : & Ray , t_min : f64 , t_max : f64 ) -> Option < HitRecord > { let mut record = None ; let mut closest_so_far = t_max ; for object in & self . objects { if let Some ( hit_record ) = object . hit ( r , t_min , closest_so_far ) { closest_so_far = hit_record . t ; record = Some ( hit_record ) ; } } record }
Tries to hit an object in the hittable list.
Tries to hit an object in the hittable list .
&self
r
&Ray
t_min
f64
t_max
f64