Skip to content

KBE3D / KBCore / Cesium / IntersectionTests / rayTriangle

函数: rayTriangle()

rayTriangle(ray: Ray, p0: Cartesian3, p1: Cartesian3, p2: Cartesian3, cullBackFaces?: boolean, result?: Cartesian3): Cartesian3

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

Implements MinimumStorage RayTriangle Intersection.pdf | Fast Minimum Storage Ray/Triangle Intersection

by Tomas Moller and Ben Trumbore.

参数

ray

Ray

The ray.

p0

Cartesian3

The first vertex of the triangle.

p1

Cartesian3

The second vertex of the triangle.

p2

Cartesian3

The third vertex of the triangle.

cullBackFaces?

boolean

If <code>true</code>, will only compute an intersection with the front face of the triangle and return undefined for intersections with the back face.

result?

Cartesian3

The <code>Cartesian3</code> onto which to store the result.

返回

Cartesian3

The intersection point or undefined if there is no intersections.

KBE3D @3.0.0 Copyright © 2024-present KBE3D