Method RayIntersectsTriangle
RayIntersectsTriangle(Ray, Vector3, Vector3, Vector3, out float, out Vector3)
Tests whether a raycast intersects a triangle. Does not test for culling.
Declaration
public static bool RayIntersectsTriangle(Ray InRay, Vector3 InTriangleA, Vector3 InTriangleB, Vector3 InTriangleC, out float OutDistance, out Vector3 OutPoint)
Parameters
Type | Name | Description |
---|---|---|
Ray | InRay | The ray to test. |
Vector3 | InTriangleA | First vertex position in the triangle. |
Vector3 | InTriangleB | Second vertex position in the triangle. |
Vector3 | InTriangleC | Third vertex position in the triangle. |
float | OutDistance | The distance of the intersection point from the ray origin if the ray intersects the triangle; otherwise, 0. |
Vector3 | OutPoint | The point of collision if the ray intersects the triangle; otherwise, 0. |
Returns
Type | Description |
---|---|
bool | True if the ray intersects the triangle; otherwise false. |