public static bool PointInTriangleBarycentric(Vector3 a, Vector3 b, Vector3 c, Vector3 p) { Vector3 vector; Barycentric(a, b, c, p, out vector); return (((vector.Y >= 0f) && (vector.Z >= 0f)) && ((vector.Y + vector.Z) <= 1f)); }