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>
73 Real a2 =
Dot(ray.direction, matDir);
74 Real a1 =
Dot(ray.direction, matDiff);
75 Real a0 =
Dot(diff, matDiff) - (Real)1;
77 Real discr = a1*a1 - a0*a2;
83 result.intersect =
true;
91 result.intersect = (a1 < (Real)0);
97 result.intersect =
false;
103 template <
typename Real>
109 DoQuery(ray.origin, ray.direction, ellipsoid, result);
110 for (
int i = 0; i < result.numIntersections; ++i)
112 result.point[i] = ray.origin + result.parameter[i] * ray.direction;
117 template <
typename Real>
123 rayDirection, ellipsoid, result);
125 if (result.intersect)
130 std::array<Real, 2> rayInterval =
131 { (Real)0, std::numeric_limits<Real>::max() };
133 auto iiResult = iiQuery(result.parameter, rayInterval);
134 if (iiResult.intersect)
136 result.numIntersections = iiResult.numIntersections;
137 result.parameter = iiResult.overlap;
141 result.intersect =
false;
142 result.numIntersections = 0;
DualQuaternion< Real > Dot(DualQuaternion< Real > const &d0, DualQuaternion< Real > const &d1)
Result operator()(Type0 const &primitive0, Type1 const &primitive1)