TerrainDisplay.Collision.Intersection.IsConvexQuad C# (CSharp) Метод

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

public static IsConvexQuad ( System.Vector3 a, System.Vector3 b, System.Vector3 c, System.Vector3 d ) : bool
a System.Vector3
b System.Vector3
c System.Vector3
d System.Vector3
Результат bool
        public static bool IsConvexQuad(Vector3 a, Vector3 b, Vector3 c, Vector3 d)
        {
            var vector = Vector3.Cross(d - b, a - b);
            var vector2 = Vector3.Cross(d - b, c - b);
            if (Vector3.Dot(vector, vector2) >= 0f)
            {
                return false;
            }
            var vector3 = Vector3.Cross(c - a, d - a);
            var vector4 = Vector3.Cross(c - a, b - a);
            return (Vector3.Dot(vector3, vector4) < 0f);
        }