Skip to main content

ray_sphere_intersect

Function ray_sphere_intersect 

Source
pub fn ray_sphere_intersect(
    ray: &Ray,
    center: [f32; 3],
    radius: f32,
) -> Option<f32>
Expand description

Test ray–sphere intersection.

Returns the smallest positive t, or None if there is no hit.