16 template <
int N,
typename Real>
31 template <
int N,
typename Real>
34 template <
typename Real>
37 template <
typename Real>
41 template <
int N,
typename Real>
43 DCPQuery<Real, Line<N, Real>, Line<N, Real>>::operator()(
44 Line<N, Real>
const& line0, Line<N, Real>
const& line1)
49 Real a01 = -
Dot(line0.direction, line1.direction);
50 Real b0 =
Dot(diff, line0.direction);
56 Real det = (Real)1 - a01 * a01;
57 Real b1 = -
Dot(diff, line1.direction);
58 s0 = (a01 * b1 - b0) / det;
59 s1 = (a01 * b0 - b1) / det;
68 result.parameter[0] =
s0;
69 result.parameter[1] =
s1;
70 result.closestPoint[0] = line0.origin + s0 * line0.direction;
71 result.closestPoint[1] = line1.origin + s1 * line1.direction;
72 diff = result.closestPoint[0] - result.closestPoint[1];
73 result.sqrDistance =
Dot(diff, diff);
74 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