public static int pointInsideTriangle(Vector2f t0, Vector2f t1, Vector2f t2, Vector2f p) {
        int val1 = counterClockwise(t0, t1, p);
        if (val1 == 0) {
            return 1;
        }
        int val2 = counterClockwise(t1, t2, p);
        if (val2 == 0) {
            return 1;
        }
        if (val2 != val1) {
            return 0;
        }
        int val3 = counterClockwise(t2, t0, p);
        if (val3 == 0) {
            return 1;
        }
        if (val3 != val1) {
            return 0;
        }
        return val3;
    }
Test if a point is inside a triangle.  1 if the point is on the ccw side,
-1 if the point is on the cw side, and 0 if it is on neither.

@param t0 First point of the triangle.
@param t1 Second point of the triangle.
@param t2 Third point of the triangle.
@param p The point to test.
@return Value 1 or -1 if inside triangle, 0 otherwise.
jme3-core/src/main/java/com/jme3/math/FastMath.java