Click or drag to resize

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

Performs an intersection test between a ray and a triangle.

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

Parameters

ray
Type: Demo3D.VisualsRay
The ray.
p1
Type: System.NumericsVector3
The first point of the triangle.
p2
Type: System.NumericsVector3
The second point of the triangle.
p3
Type: System.NumericsVector3
The thrid point of the triangle.
distance
Type: SystemDouble
The distance along the ray at which the intersection occurs.

Return Value

Type: 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