17 template <
int N,
typename Real>
35 template <
int N,
typename Real>
38 template <
typename Real>
41 template <
typename Real>
45 template <
int N,
typename Real>
47 DCPQuery<Real, Line<N, Real>, Segment<N, Real>>::operator()(
54 segment.GetCenteredForm(segCenter, segDirection, segExtent);
57 Real a01 = -
Dot(line.direction, segDirection);
58 Real b0 =
Dot(diff, line.direction);
64 Real det = (Real)1 - a01 * a01;
65 Real extDet = segExtent * det;
66 Real b1 = -
Dot(diff, segDirection);
75 s0 = (a01 * b1 - b0) / det;
83 s0 = -(a01 * s1 + b0);
91 s0 = -(a01 * s1 + b0);
102 result.parameter[0] =
s0;
103 result.parameter[1] =
s1;
104 result.closestPoint[0] = line.origin + s0 * line.direction;
105 result.closestPoint[1] = segCenter + s1 * segDirection;
106 diff = result.closestPoint[0] - result.closestPoint[1];
107 result.sqrDistance =
Dot(diff, diff);
108 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