Skip to main content

gpu_ray_aabb_intersect

Function gpu_ray_aabb_intersect 

Source
pub fn gpu_ray_aabb_intersect(
    ray_origin: [f32; 3],
    ray_dir: [f32; 3],
    min: [f32; 3],
    max: [f32; 3],
) -> Option<f32>
Expand description

Intersect a ray with an AABB using the slab method.

Returns Some(t) (the entry distance along the ray) if the ray hits the box, or None on a miss. The ray direction need not be normalised.