TerrainDisplay.Collision.Intersection.PointInTriangle C# (CSharp) Method

PointInTriangle() public static method

public static PointInTriangle ( System.Vector2 &p, System.Vector2 &a, System.Vector2 &b, System.Vector2 &c ) : bool
p System.Vector2
a System.Vector2
b System.Vector2
c System.Vector2
return bool
        public static bool PointInTriangle(ref Vector2 p, ref Vector2 a, ref Vector2 b, ref Vector2 c)
        {
            if (Vector2.Dot(p - a, b - a) < 0f)
            {
                return false;
            }
            if (Vector2.Dot(p - b, c - b) < 0f)
            {
                return false;
            }
            if (Vector2.Dot(p - c, a - c) < 0f)
            {
                return false;
            }
            return true;
        }

Same methods

Intersection::PointInTriangle ( System.Vector3 p, System.Vector3 a, System.Vector3 b, System.Vector3 c ) : bool