20 template <
typename Real>
33 template <
typename Real>
36 public FIQuery<Real, Line3<Real>, Ellipsoid3<Real>>
41 public FIQuery<Real, Line3<Real>, Ellipsoid3<Real>>::Result
56 template <
typename Real>
69 segment.GetCenteredForm(segOrigin, segDirection, segExtent);
77 Real a2 =
Dot(segDirection, matDir);
78 Real a1 =
Dot(segDirection, matDiff);
79 Real a0 =
Dot(diff, matDiff) - (Real)1;
81 Real discr = a1*a1 - a0*a2;
87 result.intersect =
true;
100 q = a0 + segExtent*(((Real)-2)*a1 + a2*segExtent);
103 result.intersect =
true;
107 qder = a1 - a2*segExtent;
108 result.intersect = (qder < (Real)0);
116 q = a0 + segExtent*(((Real)2)*a1 + a2*segExtent);
119 result.intersect =
true;
123 qder = a1 + a2*segExtent;
124 result.intersect = (qder < (Real)0);
132 result.intersect =
false;
138 template <
typename Real>
145 segment.GetCenteredForm(segOrigin, segDirection, segExtent);
148 DoQuery(segOrigin, segDirection, segExtent, ellipsoid, result);
149 for (
int i = 0; i < result.numIntersections; ++i)
151 result.point[i] = segOrigin + result.parameter[i] * segDirection;
156 template <
typename Real>
162 segDirection, ellipsoid, result);
164 if (result.intersect)
170 std::array<Real, 2> segInterval = { -segExtent, segExtent };
172 auto iiResult = iiQuery(result.parameter, segInterval);
173 if (iiResult.intersect)
175 result.numIntersections = iiResult.numIntersections;
176 result.parameter = iiResult.overlap;
180 result.intersect =
false;
181 result.numIntersections = 0;
DualQuaternion< Real > Dot(DualQuaternion< Real > const &d0, DualQuaternion< Real > const &d1)
GLdouble GLdouble GLdouble GLdouble q
Result operator()(Type0 const &primitive0, Type1 const &primitive1)