21 template <
typename Real>
33 template <
typename Real>
42 std::array<Vector2<Real>, 2>
point;
54 template <
typename Real>
61 auto plResult = plQuery(circle.center, line);
62 result.intersect = (plResult.distance <= circle.radius);
66 template <
typename Real>
72 DoQuery(line.origin, line.direction, circle, result);
73 for (
int i = 0; i < result.numIntersections; ++i)
75 result.point[i] = line.origin + result.parameter[i] * line.direction;
80 template <
typename Real>
94 Real a1 =
Dot(lineDirection, diff);
95 Real discr = a1 * a1 - a0;
98 Real root = sqrt(discr);
99 result.intersect =
true;
100 result.numIntersections = 2;
101 result.parameter[0] = -a1 - root;
102 result.parameter[1] = -a1 + root;
104 else if (discr < (Real)0)
106 result.intersect =
false;
107 result.numIntersections = 0;
111 result.intersect =
true;
112 result.numIntersections = 1;
113 result.parameter[0] = -a1;
std::array< Vector2< Real >, 2 > point
DualQuaternion< Real > Dot(DualQuaternion< Real > const &d0, DualQuaternion< Real > const &d1)
std::array< Real, 2 > parameter
Result operator()(Type0 const &primitive0, Type1 const &primitive1)