Skip to main content

reflect_ray

Function reflect_ray 

Source
pub fn reflect_ray(ray: &Ray, hit: &Hit) -> Ray
Expand description

Builds a reflected ray bouncing off the hit surface.

§Arguments

  • &Ray - The incoming ray.
  • &Hit - The hit point with normal information.

§Returns

  • Ray - A new ray originating at the hit point with the reflected direction, t_min reset to RAYTRACE_DEFAULT_T_MIN, t_max set to RAYTRACE_DEFAULT_T_MAX, and depth incremented by one.