24 template <
typename Real>
27 public TIQuery<Real, Line2<Real>, AlignedBox2<Real>>
32 public TIQuery<Real, Line2<Real>, AlignedBox2<Real>>::Result
45 template <
typename Real>
48 public FIQuery<Real, Line2<Real>, AlignedBox2<Real>>
53 public FIQuery<Real, Line2<Real>, AlignedBox2<Real>>::Result
67 template <
typename Real>
75 box.GetCenteredForm(boxCenter, boxExtent);
81 DoQuery(rayOrigin, ray.direction, boxExtent, result);
85 template <
typename Real>
90 for (
int i = 0; i < 2; ++i)
92 if (
std::abs(rayOrigin[i]) > boxExtent[i]
93 && rayOrigin[i] * rayDirection[i] >= (Real)0)
95 result.intersect =
false;
101 rayDirection, boxExtent, result);
104 template <
typename Real>
112 box.GetCenteredForm(boxCenter, boxExtent);
118 DoQuery(rayOrigin, ray.direction, boxExtent, result);
119 for (
int i = 0; i < result.numIntersections; ++i)
121 result.point[i] = ray.origin + result.parameter[i] * ray.direction;
126 template <
typename Real>
132 rayDirection, boxExtent, result);
134 if (result.intersect)
139 std::array<Real, 2> rayInterval =
140 { (Real)0, std::numeric_limits<Real>::max() };
142 auto iiResult = iiQuery(result.parameter, rayInterval);
143 result.intersect = iiResult.intersect;
144 result.numIntersections = iiResult.numIntersections;
145 result.parameter = iiResult.overlap;
gte::BSNumber< UIntegerType > abs(gte::BSNumber< UIntegerType > const &number)
Result operator()(Type0 const &primitive0, Type1 const &primitive1)