pub fn is_ray_obstructed(&self, ray: &Ray, distance: f64) -> bool {
        for object in self.objects.iter() {
            let object_intersections = object.intersections(ray);

            for intersection in object_intersections {
                if intersection.t >= 0.0 && intersection.t < distance {
                    return true;
                }
            }
        }

        false
    }
// Optimized version of intersections(), which stops at the first obstructing intersection.
//
Optimized version of intersections(), which stops at the first obstructing intersection.
Optimized version of intersections () which stops at the first obstructing intersection .
pub fn is_ray_obstructed(&self, ray: &Ray, distance: f64) -> bool {
        for object in self.objects.iter() {
            let object_intersections = object.intersections(ray);
            for intersection in object_intersections {
                if intersection.t >= 0.0 && intersection.t < distance {
                    return true;
                }
            }
        }
        false
    }
pub fn is_ray_obstructed ( & self , ray : & Ray , distance : f64 ) -> bool { for object in self . objects . iter ( ) { let object_intersections = object . intersections ( ray ) ; for intersection in object_intersections { if intersection . t >= 0.0 && intersection . t < distance { return true ; } } } false }
Optimized version of intersections(), which stops at the first obstructing intersection.
Optimized version of intersections () which stops at the first obstructing intersection .
&self
ray
&Ray
distance
f64