rayTriangle

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

Computes the intersection of a ray and a triangle as a Cartesian3 coordinate.

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

Return

The intersection point or undefined if there is no intersections.

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

result

The Cartesian3 onto which to store the result.

See also