BEPUutilities.Toolbox.IsPointInsideTriangle C# (CSharp) Метод

IsPointInsideTriangle() публичный статический Метод

Determines if supplied point is within the triangle as defined by the provided vertices.
public static IsPointInsideTriangle ( System.Vector3 &vA, System.Vector3 &vB, System.Vector3 &vC, System.Vector3 &p ) : bool
vA System.Vector3 A vertex of the triangle.
vB System.Vector3 A vertex of the triangle.
vC System.Vector3 A vertex of the triangle.
p System.Vector3 The point for comparison against the triangle.
Результат bool
        public static bool IsPointInsideTriangle(ref Vector3 vA, ref Vector3 vB, ref Vector3 vC, ref Vector3 p)
        {
            float u, v, w;
            GetBarycentricCoordinates(ref p, ref vA, ref vB, ref vC, out u, out v, out w);
            //Are the barycoords valid?
            return (u > -Epsilon) && (v > -Epsilon) && (w > -Epsilon);
        }

Same methods

Toolbox::IsPointInsideTriangle ( System.Vector3 &vA, System.Vector3 &vB, System.Vector3 &vC, System.Vector3 &p, float margin ) : bool