Skip to main content

batch_ray_cast

Function batch_ray_cast 

Source
pub fn batch_ray_cast(
    rays: &[Ray],
    nodes: &[BvhNode],
    triangles: &[Triangle],
    root: usize,
) -> Vec<Option<HitRecord>>
Expand description

Cast multiple rays against a BVH and return the closest hit for each.

This is a CPU mock of a GPU batch ray cast. Returns a Vec of optional HitRecords, one per input ray.