intersectSweptSphereTriangle

Determine the point of intersection between a sphere with the given center <code>(centerX, centerY, centerZ)</code> and <code>radius</code> moving with the given velocity <code>(velX, velY, velZ)</code> and the triangle specified via its three vertices <code>(v0X, v0Y, v0Z)</code>, <code>(v1X, v1Y, v1Z)</code>, <code>(v2X, v2Y, v2Z)</code>. <p> The vertices of the triangle must be specified in counter-clockwise winding order. <p> An intersection is only considered if the time of intersection is smaller than the given <code>maxT</code> value. <p> Reference: <a href="http://www.peroxide.dk/papers/collision/collision.pdf">Improved Collision detection and Response</a>

@param centerX the x coordinate of the sphere's center @param centerY the y coordinate of the sphere's center @param centerZ the z coordinate of the sphere's center @param radius the radius of the sphere @param velX the x component of the velocity of the sphere @param velY the y component of the velocity of the sphere @param velZ the z component of the velocity of the sphere @param v0X the x coordinate of the first triangle vertex @param v0Y the y coordinate of the first triangle vertex @param v0Z the z coordinate of the first triangle vertex @param v1X the x coordinate of the second triangle vertex @param v1Y the y coordinate of the second triangle vertex @param v1Z the z coordinate of the second triangle vertex @param v2X the x coordinate of the third triangle vertex @param v2Y the y coordinate of the third triangle vertex @param v2Z the z coordinate of the third triangle vertex @param epsilon a small epsilon when testing spheres that move almost parallel to the triangle @param maxT the maximum intersection time @param pointAndTime iff the moving sphere and the triangle intersect, this will hold the point of intersection in the <code>(x, y, z)</code> components and the time of intersection in the <code>w</code> component @return {@link #POINT_ON_TRIANGLE_FACE} if the intersection point lies on the triangle's face, or {@link #POINT_ON_TRIANGLE_VERTEX_0}, {@link #POINT_ON_TRIANGLE_VERTEX_1} or {@link #POINT_ON_TRIANGLE_VERTEX_2} if the intersection point is a vertex, or {@link #POINT_ON_TRIANGLE_EDGE_01}, {@link #POINT_ON_TRIANGLE_EDGE_12} or {@link #POINT_ON_TRIANGLE_EDGE_20} if the intersection point lies on an edge; or <code>0</code> if no intersection

public static
int
intersectSweptSphereTriangle
(
double centerX
,
double centerY
,
double centerZ
,
double radius
,
double velX
,
double velY
,
double velZ
,
double v0X
,
double v0Y
,
double v0Z
,
double v1X
,
double v1Y
,
double v1Z
,
double v2X
,
double v2Y
,
double v2Z
,
double epsilon
,
double maxT
,)

Meta