pub fn light_ray(
        ray: &Ray<f64>,
        objects: &[Polyhedron],
        impacted_object: &Polyhedron,
        light: &Light,
    ) -> image::Rgb<u8> {
        let toi = impacted_object
            .shape
            .toi_with_ray(&impacted_object.position, &ray, false)
            .unwrap();
        // Where the object hits the ray.
        // Requires that we know that the ray hits. If it doesn't, this will panic. Since this is
        // only intended for internal use I'm willing to take that bet.
        let point_of_impact = ray.point_at(toi);
        // We need to express the point of where the light is in terms of a vector so that we can
        // draw a Ray<f64> out to it from point_of_impact.
        let light_position: Vector3<f64> = light.position.coords;
        let ray_to_light: Ray<f64> = Ray::new(point_of_impact, light_position - (toi * ray.dir));

        // Check for collisions between all objects and ray_to_light. If we find one closer to
        // the point of impact than the light, render nothing.
        // Why is this one not a reference? It already is one.
        for object in objects {}

        impacted_object.color
    }
/// Draw the light ray from an object to a light.
/// Will panic if the ray doesn't intersect the object.
// Always returns a color. If we're looking at an object, we already know that we hit it.
Draw the light ray from an object to a light.
Will panic if the ray doesn't intersect the object.
Always returns a color. If we're looking at an object, we already know that we hit it.
Draw the light ray from an object to a light . Will panic if the ray doesn ' t intersect the object . Always returns a color . If we ' re looking at an object we already know that we hit it .
pub fn light_ray(
        ray: &Ray<f64>,
        objects: &[Polyhedron],
        impacted_object: &Polyhedron,
        light: &Light,
    ) -> image::Rgb<u8> {
        let toi = impacted_object
            .shape
            .toi_with_ray(&impacted_object.position, &ray, false)
            .unwrap();
        // Where the object hits the ray.
        // Requires that we know that the ray hits. If it doesn't, this will panic. Since this is
        // only intended for internal use I'm willing to take that bet.
        let point_of_impact = ray.point_at(toi);
        // We need to express the point of where the light is in terms of a vector so that we can
        // draw a Ray<f64> out to it from point_of_impact.
        let light_position: Vector3<f64> = light.position.coords;
        let ray_to_light: Ray<f64> = Ray::new(point_of_impact, light_position - (toi * ray.dir));
        // Check for collisions between all objects and ray_to_light. If we find one closer to
        // the point of impact than the light, render nothing.
        // Why is this one not a reference? It already is one.
        for object in objects {}
        impacted_object.color
    }
pub fn light_ray ( ray : & Ray < f64 > , objects : & [ Polyhedron ] , impacted_object : & Polyhedron , light : & Light , ) -> image :: Rgb < u8 > { let toi = impacted_object . shape . toi_with_ray ( & impacted_object . position , & ray , false ) . unwrap ( ) ; // Where the object hits the ray. // Requires that we know that the ray hits. If it doesn't, this will panic. Since this is // only intended for internal use I'm willing to take that bet. let point_of_impact = ray . point_at ( toi ) ; // We need to express the point of where the light is in terms of a vector so that we can // draw a Ray<f64> out to it from point_of_impact. let light_position : Vector3 < f64 > = light . position . coords ; let ray_to_light : Ray < f64 > = Ray :: new ( point_of_impact , light_position - ( toi * ray . dir ) ) ; // Check for collisions between all objects and ray_to_light. If we find one closer to // the point of impact than the light, render nothing. // Why is this one not a reference? It already is one. for object in objects { } impacted_object . color }
Draw the light ray from an object to a light.
Draw the light ray from an object to a light .
ray
&Ray<f64>
objects
&[Polyhedron]
impacted_object
&Polyhedron
light
&Light