Skip to main content

ray_sphere

Function ray_sphere 

Source
pub fn ray_sphere(
    origin: [f64; 3],
    dir: [f64; 3],
    centre: [f64; 3],
    radius: f64,
) -> Option<(f64, f64)>
Expand description

Ray-sphere intersection: the entry and exit parameters (t_near, t_far) with t_far >= 0 (t_near is negative when the origin is inside).