ray_intersects_triangle

Function ray_intersects_triangle 

Source
pub fn ray_intersects_triangle<T: Float>(
    ray: Ray<T>,
    a: Point3<T>,
    b: Point3<T>,
    c: Point3<T>,
) -> Option<(T, T, T)>
Expand description

If the ray intersects the triangle (a,b,c), returns Some((t,u,v)) where intersection = origin + t·dir, and (u,v) are barycentric coords. Otherwise returns None.