rayTriangleParametric

fun rayTriangleParametric(ray: Ray, p0: Cartesian3, p1: Cartesian3, p2: Cartesian3, cullBackFaces: Boolean? = definedExternally): Double(source)

Computes the intersection of a ray and a triangle as a parametric distance along the input ray. The result is negative when the triangle is behind the ray.

Implements Fast Minimum Storage Ray/Triangle Intersection by Tomas Moller and Ben Trumbore.

Return

The intersection as a parametric distance along the ray, or undefined if there is no intersection.

Parameters

ray

The ray.

p0

The first vertex of the triangle.

p1

The second vertex of the triangle.

p2

The third vertex of the triangle.

cullBackFaces

If true, will only compute an intersection with the front face of the triangle and return undefined for intersections with the back face. Default value - false

See also