17 template <
typename Real>
24 Real rayParameter, triangleParameter[3];
32 template <
typename Real>
41 auto ltResult = ltQuery(line, triangle);
43 if (ltResult.lineParameter >= (Real)0)
45 result.distance = ltResult.distance;
46 result.sqrDistance = ltResult.sqrDistance;
47 result.rayParameter = ltResult.lineParameter;
48 result.triangleParameter[0] = ltResult.triangleParameter[0];
49 result.triangleParameter[1] = ltResult.triangleParameter[1];
50 result.triangleParameter[2] = ltResult.triangleParameter[2];
51 result.closestPoint[0] = ltResult.closestPoint[0];
52 result.closestPoint[1] = ltResult.closestPoint[1];
57 auto ptResult = ptQuery(ray.origin, triangle);
58 result.distance = ptResult.distance;
59 result.sqrDistance = ptResult.sqrDistance;
60 result.rayParameter = (Real)0;
61 result.triangleParameter[0] = ptResult.parameter[0];
62 result.triangleParameter[1] = ptResult.parameter[1];
63 result.triangleParameter[2] = ptResult.parameter[2];
64 result.closestPoint[0] = ray.origin;
65 result.closestPoint[1] = ptResult.closest;
GLsizei GLsizei GLfloat distance
Result operator()(Type0 const &primitive0, Type1 const &primitive1)