16 template <
int N,
typename Real>
32 template <
int N,
typename Real>
36 template <
typename Real>
39 template <
typename Real>
43 template <
int N,
typename Real>
45 DCPQuery<Real, Vector<N, Real>, Segment<N, Real>>::operator()(
54 Real
t =
Dot(direction, diff);
57 result.segmentParameter = (Real)1;
58 result.segmentClosest = segment.p[1];
62 diff = point - segment.p[0];
63 t =
Dot(direction, diff);
66 result.segmentParameter = (Real)0;
67 result.segmentClosest = segment.p[0];
71 Real sqrLength =
Dot(direction, direction);
72 if (sqrLength > (Real)0)
75 result.segmentParameter =
t;
76 result.segmentClosest = segment.p[0] + t * direction;
80 result.segmentParameter = (Real)0;
81 result.segmentClosest = segment.p[0];
86 diff = point - result.segmentClosest;
87 result.sqrDistance =
Dot(diff, diff);
88 result.distance = sqrt(result.sqrDistance);
GLsizei GLsizei GLfloat distance
Result operator()(Type0 const &primitive0, Type1 const &primitive1)
DualQuaternion< Real > Dot(DualQuaternion< Real > const &d0, DualQuaternion< Real > const &d1)
Vector< N, Real > segmentClosest