findClosestPointOnTriangle

Determine the closest point on the triangle with the given vertices <code>(v0X, v0Y)</code>, <code>(v1X, v1Y)</code>, <code>(v2X, v2Y)</code> between that triangle and the given point <code>(pX, pY)</code> and store that point into the given <code>result</code>. <p> Additionally, this method returns whether the closest point is a vertex ({@link #POINT_ON_TRIANGLE_VERTEX_0}, {@link #POINT_ON_TRIANGLE_VERTEX_1}, {@link #POINT_ON_TRIANGLE_VERTEX_2}) of the triangle, lies on an edge ({@link #POINT_ON_TRIANGLE_EDGE_01}, {@link #POINT_ON_TRIANGLE_EDGE_12}, {@link #POINT_ON_TRIANGLE_EDGE_20}) or on the {@link #POINT_ON_TRIANGLE_FACE face} of the triangle. <p> Reference: Book "Real-Time Collision Detection" chapter 5.1.5 "Closest Point on Triangle to Point"

@param v0X the x coordinate of the first vertex of the triangle @param v0Y the y coordinate of the first vertex of the triangle @param v1X the x coordinate of the second vertex of the triangle @param v1Y the y coordinate of the second vertex of the triangle @param v2X the x coordinate of the third vertex of the triangle @param v2Y the y coordinate of the third vertex of the triangle @param pX the x coordinate of the point @param pY the y coordinate of the point @param result will hold the closest point @return one of {@link #POINT_ON_TRIANGLE_VERTEX_0}, {@link #POINT_ON_TRIANGLE_VERTEX_1}, {@link #POINT_ON_TRIANGLE_VERTEX_2}, {@link #POINT_ON_TRIANGLE_EDGE_01}, {@link #POINT_ON_TRIANGLE_EDGE_12}, {@link #POINT_ON_TRIANGLE_EDGE_20} or {@link #POINT_ON_TRIANGLE_FACE}

Meta