23 template <
typename Real>
26 public TIQuery<Real, Line3<Real>, AlignedBox3<Real>>
31 public TIQuery<Real, Line3<Real>, AlignedBox3<Real>>::Result
45 template <
typename Real>
48 public FIQuery<Real, Line3<Real>, AlignedBox3<Real>>
53 public FIQuery<Real, Line3<Real>, AlignedBox3<Real>>::Result
68 template <
typename Real>
76 box.GetCenteredForm(boxCenter, boxExtent);
88 DoQuery(segOrigin, segDirection, segExtent, boxExtent, result);
92 template <
typename Real>
97 for (
int i = 0; i < 3; ++i)
99 if (
std::abs(segOrigin[i]) > boxExtent[i] +
100 segExtent*
std::abs(segDirection[i]))
102 result.intersect =
false;
108 segDirection, boxExtent, result);
111 template <
typename Real>
119 box.GetCenteredForm(boxCenter, boxExtent);
128 transformedSegment.
GetCenteredForm(segOrigin, segDirection, segExtent);
131 DoQuery(segOrigin, segDirection, segExtent, boxExtent, result);
132 for (
int i = 0; i < result.numPoints; ++i)
134 result.point[i] = segOrigin + result.lineParameter[i] * segDirection;
139 template <
typename Real>
145 segDirection, boxExtent, result);
147 if (result.intersect)
154 std::array<Real, 2> interval0 =
156 result.lineParameter[0], result.lineParameter[1]
159 std::array<Real, 2> interval1 =
161 -segExtent, segExtent
164 auto iiResult = iiQuery(interval0, interval1);
165 if (iiResult.numIntersections > 0)
167 result.numPoints = iiResult.numIntersections;
168 for (
int i = 0; i < result.numPoints; ++i)
170 result.lineParameter[i] = iiResult.overlap[i];
175 result.intersect =
false;
176 result.numPoints = 0;
gte::BSNumber< UIntegerType > abs(gte::BSNumber< UIntegerType > const &number)
Result operator()(Type0 const &primitive0, Type1 const &primitive1)
void GetCenteredForm(Vector< N, Real > ¢er, Vector< N, Real > &direction, Real &extent) const