intersectRayTriangle

Determine whether the ray with the given <code>origin</code> and the given <code>dir</code> intersects the triangle consisting of the three vertices <code>v0</code>, <code>v1</code> and <code>v2</code> and return the value of the parameter <i>t</i> in the ray equation <i>p(t) = origin + t * dir</i> of the point of intersection. <p> This is an implementation of the <a href="http://www.graphics.cornell.edu/pubs/1997/MT97.pdf"> Fast, Minimum Storage Ray/Triangle Intersection</a> method. <p> This test does not take into account the winding order of the triangle, so a ray will intersect a front-facing triangle as well as a back-facing triangle.

@see #intersectRayTriangle(double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double)

@param origin the ray's origin @param dir the ray's direction @param v0 the position of the first vertex @param v1 the position of the second vertex @param v2 the position of the third vertex @param epsilon a small epsilon when testing rays that are almost parallel to the triangle @return the value of the parameter <i>t</i> in the ray equation <i>p(t) = origin + t * dir</i> of the point of intersection if the ray intersects the triangle; <code>-1.0</code> otherwise

Meta