16 template <
typename Real>
28 template <
typename Real>
50 template <
typename Real>
62 auto ppResult = ppQuery(plane, cPlane);
63 if (!ppResult.intersect)
66 result.intersect =
false;
73 result.intersect =
true;
83 Real a2 =
Dot(ppResult.line.direction, ppResult.line.direction);
84 Real a1 =
Dot(diff, ppResult.line.direction);
85 Real a0 =
Dot(diff, diff) - circle.radius*circle.radius;
88 Real discr = a1*a1 - a0*a2;
89 result.intersect = (discr >= (Real)0);
95 template <
typename Real>
107 auto ppResult = ppQuery(plane, cPlane);
108 if (!ppResult.intersect)
111 result.intersect =
false;
115 if (!ppResult.isLine)
118 result.intersect =
true;
119 result.isPoints =
false;
120 result.circle = circle;
130 Real a2 =
Dot(ppResult.line.direction, ppResult.line.direction);
131 Real a1 =
Dot(diff, ppResult.line.direction);
132 Real a0 =
Dot(diff, diff) - circle.radius*circle.radius;
134 Real discr = a1*a1 - a0*a2;
138 result.intersect =
false;
142 result.isPoints =
true;
144 Real inv = ((Real)1) / a2;
145 if (discr == (Real)0)
148 result.numIntersections = 1;
150 ppResult.line.origin - (a1*inv)*ppResult.line.direction;
156 Real root = sqrt(discr);
157 result.numIntersections = 2;
159 ppResult.line.origin - ((a1 + root)*inv)*ppResult.line.direction;
161 ppResult.line.origin - ((a1 - root)*inv)*ppResult.line.direction;
DualQuaternion< Real > Dot(DualQuaternion< Real > const &d0, DualQuaternion< Real > const &d1)
Result operator()(Type0 const &primitive0, Type1 const &primitive1)