Ray.intersect

Ray vs triangle intersection.

  1. bool intersect(Triangle!(T, 3) triangle, T t, T u, T v)
    struct Ray(T, int N)
    nothrow @nogc pure const nothrow
    static if(N == 3 && isFloatingPoint!T)
    bool
    intersect
    (,
    out T t
    ,
    out T u
    ,
    out T v
    )
  2. bool intersect(Plane!T plane, point_t intersection, T distance)

Return Value

Type: bool

Barycentric coordinates, the intersection point is at (1 - u - v) * A + u * B + v * C.

See Also

"Fast, Minimum Storage Ray/Triangle intersection", Mommer & Trumbore (1997)

Meta