68bool Intersect<2>(
const RotBox<2>& r,
const AxisBox<2>& b,
bool proper)
70 const AxisBox<2> b2 = r.boundingBox();
71 if(!Intersect(b2, b, proper))
74 RotMatrix<2> m = r.m_orient.inverse();
76 const AxisBox<2> b3 = RotBox<2>(Point<2>(b.m_low).rotate(m, r.m_corner0),
77 b.m_high - b.m_low, m).boundingBox();
78 const AxisBox<2> b4(r.m_corner0, r.m_corner0 + r.m_size);
79 return Intersect(b3, b4, proper);
113bool Intersect<3>(
const RotBox<3>& r,
const AxisBox<3>& b,
bool proper)
119 const AxisBox<3> b2 = r.boundingBox();
120 if(!Intersect(b2, b, proper))
123 RotMatrix<3> minv = r.m_orient.inverse();
124 Vector<3> b_size = b.m_high - b.m_low;
126 const AxisBox<3> b3 = RotBox<3>(Point<3>(b.m_low).rotate(minv, r.m_corner0),
127 b_size, minv).boundingBox();
128 const AxisBox<3> b4(r.m_corner0, r.m_corner0 + r.m_size);
129 if(!Intersect(b3, b4, proper))
134 Vector<3> sep = b.m_low - r.m_corner0;
135 const RotMatrix<3> &m = r.m_orient;
139 for(
int i = 0; i < 3; ++i) {
144 for(
int j = 0; j < 3; ++j) {
152 axis[1] = -m.elem(i, 2);
153 axis[2] = m.elem(i, 1);
156 axis[0] = m.elem(i, 2);
158 axis[2] = -m.elem(i, 0);
161 axis[0] = -m.elem(i, 1);
162 axis[1] = m.elem(i, 0);
182 const int next[] = {1, 2, 0};
184 CoordType b_low, b_high, r_low, r_high, dist;
191 val = axis[k] * b_size[k];
204 val = axis[k] * b_size[k];
215 val = Dot(m.row(k), axis) * r.m_size[k];
228 val = Dot(m.row(k), axis) * r.m_size[k];
237 dist = Dot(sep, axis);
239 if(_Greater(r_low - dist, b_high, proper)
240 || _Less(r_high - dist, b_low, proper))
250template bool Intersect<2>(
const Point<2>&,
const Point<2>&,
bool);
251template bool Intersect<3>(
const Point<3>&,
const Point<3>&,
bool);
252template bool Contains<2>(
const Point<2>&,
const Point<2>&,
bool);
253template bool Contains<3>(
const Point<3>&,
const Point<3>&,
bool);
255template bool Intersect<Point<2>,AxisBox<2> >(
const Point<2>&,
const AxisBox<2>&, bool);
256template bool Intersect<Point<3>,AxisBox<3> >(
const Point<3>&,
const AxisBox<3>&, bool);
257template bool Contains<2>(
const Point<2>&,
const AxisBox<2>&,
bool);
258template bool Contains<3>(
const Point<3>&,
const AxisBox<3>&,
bool);
259template bool Intersect<2>(
const AxisBox<2>&,
const Point<2>&,
bool);
260template bool Intersect<3>(
const AxisBox<3>&,
const Point<3>&,
bool);
261template bool Contains<2>(
const AxisBox<2>&,
const Point<2>&,
bool);
262template bool Contains<3>(
const AxisBox<3>&,
const Point<3>&,
bool);
264template bool Intersect<2>(
const AxisBox<2>&,
const AxisBox<2>&,
bool);
265template bool Intersect<3>(
const AxisBox<3>&,
const AxisBox<3>&,
bool);
266template bool Contains<2>(
const AxisBox<2>&,
const AxisBox<2>&,
bool);
267template bool Contains<3>(
const AxisBox<3>&,
const AxisBox<3>&,
bool);
269template bool Intersect<Point<2>,Ball<2> >(
const Point<2>&,
const Ball<2>&, bool);
270template bool Intersect<Point<3>,Ball<3> >(
const Point<3>&,
const Ball<3>&, bool);
271template bool Contains<2>(
const Point<2>&,
const Ball<2>&,
bool);
272template bool Contains<3>(
const Point<3>&,
const Ball<3>&,
bool);
273template bool Intersect<2>(
const Ball<2>&,
const Point<2>&,
bool);
274template bool Intersect<3>(
const Ball<3>&,
const Point<3>&,
bool);
275template bool Contains<2>(
const Ball<2>&,
const Point<2>&,
bool);
276template bool Contains<3>(
const Ball<3>&,
const Point<3>&,
bool);
278template bool Intersect<AxisBox<2>,Ball<2> >(
const AxisBox<2>&,
const Ball<2>&, bool);
279template bool Intersect<AxisBox<3>,Ball<3> >(
const AxisBox<3>&,
const Ball<3>&, bool);
280template bool Contains<2>(
const AxisBox<2>&,
const Ball<2>&,
bool);
281template bool Contains<3>(
const AxisBox<3>&,
const Ball<3>&,
bool);
282template bool Intersect<2>(
const Ball<2>&,
const AxisBox<2>&,
bool);
283template bool Intersect<3>(
const Ball<3>&,
const AxisBox<3>&,
bool);
284template bool Contains<2>(
const Ball<2>&,
const AxisBox<2>&,
bool);
285template bool Contains<3>(
const Ball<3>&,
const AxisBox<3>&,
bool);
287template bool Intersect<2>(
const Ball<2>&,
const Ball<2>&,
bool);
288template bool Intersect<3>(
const Ball<3>&,
const Ball<3>&,
bool);
289template bool Contains<2>(
const Ball<2>&,
const Ball<2>&,
bool);
290template bool Contains<3>(
const Ball<3>&,
const Ball<3>&,
bool);
292template bool Intersect<Point<2>,Segment<2> >(
const Point<2>&,
const Segment<2>&, bool);
293template bool Intersect<Point<3>,Segment<3> >(
const Point<3>&,
const Segment<3>&, bool);
294template bool Contains<2>(
const Point<2>&,
const Segment<2>&,
bool);
295template bool Contains<3>(
const Point<3>&,
const Segment<3>&,
bool);
296template bool Intersect<2>(
const Segment<2>&,
const Point<2>&,
bool);
297template bool Intersect<3>(
const Segment<3>&,
const Point<3>&,
bool);
298template bool Contains<2>(
const Segment<2>&,
const Point<2>&,
bool);
299template bool Contains<3>(
const Segment<3>&,
const Point<3>&,
bool);
301template bool Intersect<AxisBox<2>,Segment<2> >(
const AxisBox<2>&,
const Segment<2>&, bool);
302template bool Intersect<AxisBox<3>,Segment<3> >(
const AxisBox<3>&,
const Segment<3>&, bool);
303template bool Contains<2>(
const AxisBox<2>&,
const Segment<2>&,
bool);
304template bool Contains<3>(
const AxisBox<3>&,
const Segment<3>&,
bool);
305template bool Intersect<2>(
const Segment<2>&,
const AxisBox<2>&,
bool);
306template bool Intersect<3>(
const Segment<3>&,
const AxisBox<3>&,
bool);
307template bool Contains<2>(
const Segment<2>&,
const AxisBox<2>&,
bool);
308template bool Contains<3>(
const Segment<3>&,
const AxisBox<3>&,
bool);
310template bool Intersect<Ball<2>,Segment<2> >(
const Ball<2>&,
const Segment<2>&, bool);
311template bool Intersect<Ball<3>,Segment<3> >(
const Ball<3>&,
const Segment<3>&, bool);
312template bool Contains<2>(
const Ball<2>&,
const Segment<2>&,
bool);
313template bool Contains<3>(
const Ball<3>&,
const Segment<3>&,
bool);
314template bool Intersect<2>(
const Segment<2>&,
const Ball<2>&,
bool);
315template bool Intersect<3>(
const Segment<3>&,
const Ball<3>&,
bool);
316template bool Contains<2>(
const Segment<2>&,
const Ball<2>&,
bool);
317template bool Contains<3>(
const Segment<3>&,
const Ball<3>&,
bool);
319template bool Intersect<2>(
const Segment<2>&,
const Segment<2>&,
bool);
320template bool Intersect<3>(
const Segment<3>&,
const Segment<3>&,
bool);
321template bool Contains<2>(
const Segment<2>&,
const Segment<2>&,
bool);
322template bool Contains<3>(
const Segment<3>&,
const Segment<3>&,
bool);
324template bool Intersect<Point<2>,RotBox<2> >(
const Point<2>&,
const RotBox<2>&, bool);
325template bool Intersect<Point<3>,RotBox<3> >(
const Point<3>&,
const RotBox<3>&, bool);
326template bool Contains<2>(
const Point<2>&,
const RotBox<2>&,
bool);
327template bool Contains<3>(
const Point<3>&,
const RotBox<3>&,
bool);
328template bool Intersect<2>(
const RotBox<2>&,
const Point<2>&,
bool);
329template bool Intersect<3>(
const RotBox<3>&,
const Point<3>&,
bool);
330template bool Contains<2>(
const RotBox<2>&,
const Point<2>&,
bool);
331template bool Contains<3>(
const RotBox<3>&,
const Point<3>&,
bool);
333template bool Intersect<AxisBox<2>,RotBox<2> >(
const AxisBox<2>&,
const RotBox<2>&, bool);
334template bool Intersect<AxisBox<3>,RotBox<3> >(
const AxisBox<3>&,
const RotBox<3>&, bool);
335template bool Contains<2>(
const AxisBox<2>&,
const RotBox<2>&,
bool);
336template bool Contains<3>(
const AxisBox<3>&,
const RotBox<3>&,
bool);
337template bool Contains<2>(
const RotBox<2>&,
const AxisBox<2>&,
bool);
338template bool Contains<3>(
const RotBox<3>&,
const AxisBox<3>&,
bool);
340template bool Intersect<Ball<2>,RotBox<2> >(
const Ball<2>&,
const RotBox<2>&, bool);
341template bool Intersect<Ball<3>,RotBox<3> >(
const Ball<3>&,
const RotBox<3>&, bool);
342template bool Contains<2>(
const Ball<2>&,
const RotBox<2>&,
bool);
343template bool Contains<3>(
const Ball<3>&,
const RotBox<3>&,
bool);
344template bool Intersect<2>(
const RotBox<2>&,
const Ball<2>&,
bool);
345template bool Intersect<3>(
const RotBox<3>&,
const Ball<3>&,
bool);
346template bool Contains<2>(
const RotBox<2>&,
const Ball<2>&,
bool);
347template bool Contains<3>(
const RotBox<3>&,
const Ball<3>&,
bool);
349template bool Intersect<Segment<2>,RotBox<2> >(
const Segment<2>&,
const RotBox<2>&, bool);
350template bool Intersect<Segment<3>,RotBox<3> >(
const Segment<3>&,
const RotBox<3>&, bool);
351template bool Contains<2>(
const Segment<2>&,
const RotBox<2>&,
bool);
352template bool Contains<3>(
const Segment<3>&,
const RotBox<3>&,
bool);
353template bool Intersect<2>(
const RotBox<2>&,
const Segment<2>&,
bool);
354template bool Intersect<3>(
const RotBox<3>&,
const Segment<3>&,
bool);
355template bool Contains<2>(
const RotBox<2>&,
const Segment<2>&,
bool);
356template bool Contains<3>(
const RotBox<3>&,
const Segment<3>&,
bool);
358template bool Intersect<2>(
const RotBox<2>&,
const RotBox<2>&,
bool);
359template bool Intersect<3>(
const RotBox<3>&,
const RotBox<3>&,
bool);
360template bool Contains<2>(
const RotBox<2>&,
const RotBox<2>&,
bool);
361template bool Contains<3>(
const RotBox<3>&,
const RotBox<3>&,
bool);
Generic library namespace.
double CoordType
Basic floating point type.
static FloatType epsilon()
This is the attempted precision of the library.