17 template <
int N,
typename Real>
32 template <
int N,
typename Real>
35 template <
typename Real>
38 template <
typename Real>
42 template <
int N,
typename Real>
44 DCPQuery<Real, Line<N, Real>, Ray<N, Real>>::operator()(
50 Real a01 = -
Dot(line.direction, ray.direction);
51 Real b0 =
Dot(diff, line.direction);
56 Real b1 = -
Dot(diff, ray.direction);
62 Real det = (Real)1 - a01 * a01;
63 s0 = (a01 * b1 - b0) / det;
80 result.parameter[0] =
s0;
81 result.parameter[1] =
s1;
82 result.closestPoint[0] = line.origin + s0 * line.direction;
83 result.closestPoint[1] = ray.origin + s1 * ray.direction;
84 diff = result.closestPoint[0] - result.closestPoint[1];
85 result.sqrDistance =
Dot(diff, diff);
86 result.distance = sqrt(result.sqrDistance);
gte::BSNumber< UIntegerType > abs(gte::BSNumber< UIntegerType > const &number)
GLuint GLfloat GLfloat GLfloat GLfloat GLfloat GLfloat s0
GLsizei GLsizei GLfloat distance
Result operator()(Type0 const &primitive0, Type1 const &primitive1)
DualQuaternion< Real > Dot(DualQuaternion< Real > const &d0, DualQuaternion< Real > const &d1)
GLuint GLfloat GLfloat GLfloat GLfloat GLfloat GLfloat GLfloat GLfloat s1