25 template <
typename Real>
28 public TIQuery<Real, Line2<Real>, AlignedBox2<Real>>
33 public TIQuery<Real, Line2<Real>, AlignedBox2<Real>>::Result
47 template <
typename Real>
50 public FIQuery<Real, Line2<Real>, AlignedBox2<Real>>
55 public FIQuery<Real, Line2<Real>, AlignedBox2<Real>>::Result
74 template <
typename Real>
82 box.GetCenteredForm(boxCenter, boxExtent);
94 DoQuery(segOrigin, segDirection, segExtent, boxExtent, result);
98 template <
typename Real>
103 for (
int i = 0; i < 2; ++i)
105 Real lhs = fabs(segOrigin[i]);
106 Real rhs = boxExtent[i] + segExtent * fabs(segDirection[i]);
109 result.intersect =
false;
115 segDirection, boxExtent, result);
118 template <
typename Real>
126 box.GetCenteredForm(boxCenter, boxExtent);
135 transformedSegment.
GetCenteredForm(segOrigin, segDirection, segExtent);
138 DoQuery(segOrigin, segDirection, segExtent, boxExtent, result);
139 for (
int i = 0; i < result.numIntersections; ++i)
143 result.point[i] = boxCenter + (segOrigin + result.parameter[i] * segDirection);
144 result.cdeParameter[i] = result.parameter[i];
147 result.parameter[i] = (result.parameter[i] / segExtent + (Real)1) * (Real)0.5;
152 template <
typename Real>
158 segDirection, boxExtent, result);
160 if (result.intersect)
165 std::array<Real, 2> segInterval = { -segExtent, segExtent };
167 auto iiResult = iiQuery(result.parameter, segInterval);
168 result.intersect = iiResult.intersect;
169 result.numIntersections = iiResult.numIntersections;
170 result.parameter = iiResult.overlap;
std::array< Real, 2 > cdeParameter
Result operator()(Type0 const &primitive0, Type1 const &primitive1)
void GetCenteredForm(Vector< N, Real > ¢er, Vector< N, Real > &direction, Real &extent) const