Click or drag to resize

UtilIntersectRayTriangle(Ray, Vector3, Vector3, Vector3, Double) Method

Performs an intersection test between a ray and a triangle.

Namespace: Demo3D.Common
Assembly: Demo3D.Common (in Demo3D.Common.dll) Version: 19.01.00
Syntax
C#
public static bool IntersectRayTriangle(
	Ray ray,
	 in Vector3 p1,
	 in Vector3 p2,
	 in Vector3 p3,
	out double distance
)

Parameters

ray  Ray
The ray.
p1  Vector3
The first point of the triangle.
p2  Vector3
The second point of the triangle.
p3  Vector3
The thrid point of the triangle.
distance  Double
The distance along the ray at which the intersection occurs.

Return Value

Boolean
True if the ray intersects the triangle, false otherwise.
Remarks
Note that this intersection test in directed. If the ray direction and triangle normal are not opposed then this function will return false.
See Also