35 template <
typename Real>
52 template <
typename Real>
60 auto rbResult = rbQuery(cone.ray, box);
61 if (rbResult.intersect)
64 result.intersect =
true;
78 Real a0 =
Dot(cone.ray.direction, box.axis[0]);
79 Real a1 =
Dot(cone.ray.direction, box.axis[1]);
80 Real a2 =
Dot(cone.ray.direction, diff);
81 Real b0 =
Dot(box.axis[0], diff);
82 Real b1 =
Dot(box.axis[1], diff);
83 Real b2 =
Dot(diff, diff);
84 Real csSqr = cone.cosAngle * cone.cosAngle;
86 for (
int i1 = 0; i1 < 2; ++i1)
88 Real sign1 = i1 * (Real)2 - (Real)1;
89 Real
y = sign1 * box.extent[1];
90 for (
int i0 = 0; i0 < 2; ++i0)
92 Real sign0 = i0 * (Real)2 - (Real)1;
93 Real
x = sign0 * box.extent[0];
94 Real fNumerator = a0 * x + a1 * y + a2;
95 if (fNumerator >(Real)0)
97 Real dSqr = x*x + y*y + (b0*x + b1*
y)*(Real)2 + b2;
98 Real nSqr = fNumerator*fNumerator;
99 if (nSqr > dSqr * csSqr)
101 result.intersect =
true;
108 result.intersect =
false;
DualQuaternion< Real > Dot(DualQuaternion< Real > const &d0, DualQuaternion< Real > const &d1)
Result operator()(Type0 const &primitive0, Type1 const &primitive1)