38 #ifndef FCL_BV_RSS_INL_H 39 #define FCL_BV_RSS_INL_H 41 #include "fcl/math/bv/RSS.h" 52 void clipToRange(
double& val,
double a,
double b);
79 const Matrix3<double>& Rab,
80 const Vector3<double>& Tab,
89 const Transform3<double>& tfab,
97 RSS<double>
translate(
const RSS<double>& bv,
const Vector3<double>& t);
100 template <
typename S>
102 : axis(Matrix3<S>::Identity()), To(Vector3<S>::Zero())
108 template <
typename S>
111 Vector3<S> t = other.
To -
To;
113 axis.col(0).dot(t),
axis.col(1).dot(t),
axis.col(2).dot(t));
114 Matrix3<S> R =
axis.transpose() * other.
axis;
116 S dist = rectDistance(R, T,
l, other.
l);
117 return (dist <= (
r + other.
r));
121 template <
typename S>
129 template <
typename S>
132 Vector3<S> local_p = p -
To;
134 axis.col(0).dot(local_p),
135 axis.col(1).dot(local_p),
136 axis.col(2).dot(local_p));
137 S abs_proj2 = fabs(proj[2]);
140 if((proj[0] <
l[0]) && (proj[0] > 0) && (proj[1] <
l[1]) && (proj[1] > 0))
142 return (abs_proj2 <
r);
144 else if((proj[0] <
l[0]) && (proj[0] > 0) && ((proj[1] < 0) || (proj[1] >
l[1])))
146 S y = (proj[1] > 0) ?
l[1] : 0;
147 Vector3<S> v(proj[0], y, 0);
148 return ((proj - v).squaredNorm() <
r *
r);
150 else if((proj[1] <
l[1]) && (proj[1] > 0) && ((proj[0] < 0) || (proj[0] >
l[0])))
152 S x = (proj[0] > 0) ?
l[0] : 0;
153 Vector3<S> v(x, proj[1], 0);
154 return ((proj - v).squaredNorm() <
r *
r);
158 S x = (proj[0] > 0) ?
l[0] : 0;
159 S y = (proj[1] > 0) ?
l[1] : 0;
160 Vector3<S> v(x, y, 0);
161 return ((proj - v).squaredNorm() <
r *
r);
166 template <
typename S>
170 Vector3<S> local_p = p -
To;
172 axis.col(0).dot(local_p),
173 axis.col(1).dot(local_p),
174 axis.col(2).dot(local_p));
175 S abs_proj2 = fabs(proj[2]);
178 if((proj[0] <
l[0]) && (proj[0] > 0) && (proj[1] <
l[1]) && (proj[1] > 0))
184 r = 0.5 * (
r + abs_proj2);
187 To[2] += 0.5 * (abs_proj2 -
r);
189 To[2] -= 0.5 * (abs_proj2 -
r);
192 else if((proj[0] <
l[0]) && (proj[0] > 0) && ((proj[1] < 0) || (proj[1] >
l[1])))
194 S y = (proj[1] > 0) ?
l[1] : 0;
195 Vector3<S> v(proj[0], y, 0);
196 S new_r_sqr = (proj - v).squaredNorm();
197 if(new_r_sqr <
r *
r)
203 S delta_y = - std::sqrt(r * r - proj[2] * proj[2]) + fabs(proj[1] - y);
210 S delta_y = fabs(proj[1] - y);
216 To[2] += 0.5 * (abs_proj2 -
r);
218 To[2] -= 0.5 * (abs_proj2 -
r);
222 else if((proj[1] <
l[1]) && (proj[1] > 0) && ((proj[0] < 0) || (proj[0] >
l[0])))
224 S x = (proj[0] > 0) ?
l[0] : 0;
225 Vector3<S> v(x, proj[1], 0);
226 S new_r_sqr = (proj - v).squaredNorm();
227 if(new_r_sqr <
r *
r)
233 S delta_x = - std::sqrt(r * r - proj[2] * proj[2]) + fabs(proj[0] - x);
240 S delta_x = fabs(proj[0] - x);
246 To[2] += 0.5 * (abs_proj2 -
r);
248 To[2] -= 0.5 * (abs_proj2 -
r);
254 S x = (proj[0] > 0) ?
l[0] : 0;
255 S y = (proj[1] > 0) ?
l[1] : 0;
256 Vector3<S> v(x, y, 0);
257 S new_r_sqr = (proj - v).squaredNorm();
258 if(new_r_sqr <
r *
r)
264 S diag = std::sqrt(new_r_sqr - proj[2] * proj[2]);
265 S delta_diag = - std::sqrt(r * r - proj[2] * proj[2]) + diag;
267 S delta_x = delta_diag / diag * fabs(proj[0] - x);
268 S delta_y = delta_diag / diag * fabs(proj[1] - y);
272 if(proj[0] < 0 && proj[1] < 0)
280 S delta_x = fabs(proj[0] - x);
281 S delta_y = fabs(proj[1] - y);
286 if(proj[0] < 0 && proj[1] < 0)
293 To[2] += 0.5 * (abs_proj2 -
r);
295 To[2] -= 0.5 * (abs_proj2 -
r);
304 template <
typename S>
307 *
this = *
this + other;
312 template <
typename S>
319 Vector3<S> d0_pos = other.
axis.col(0) * (other.
l[0] + other.
r);
320 Vector3<S> d1_pos = other.
axis.col(1) * (other.
l[1] + other.
r);
322 Vector3<S> d0_neg = other.
axis.col(0) * (-other.
r);
323 Vector3<S> d1_neg = other.
axis.col(1) * (-other.
r);
325 Vector3<S> d2_pos = other.
axis.col(2) * other.
r;
326 Vector3<S> d2_neg = other.
axis.col(2) * (-other.
r);
328 v[0] = other.
To + d0_pos + d1_pos + d2_pos;
329 v[1] = other.
To + d0_pos + d1_pos + d2_neg;
330 v[2] = other.
To + d0_pos + d1_neg + d2_pos;
331 v[3] = other.
To + d0_pos + d1_neg + d2_neg;
332 v[4] = other.
To + d0_neg + d1_pos + d2_pos;
333 v[5] = other.
To + d0_neg + d1_pos + d2_neg;
334 v[6] = other.
To + d0_neg + d1_neg + d2_pos;
335 v[7] = other.
To + d0_neg + d1_neg + d2_neg;
337 d0_pos.noalias() =
axis.col(0) * (
l[0] +
r);
338 d1_pos.noalias() =
axis.col(1) * (
l[1] +
r);
339 d0_neg.noalias() =
axis.col(0) * (-
r);
340 d1_neg.noalias() =
axis.col(1) * (-
r);
341 d2_pos.noalias() =
axis.col(2) *
r;
342 d2_neg.noalias() =
axis.col(2) * (-
r);
344 v[8] =
To + d0_pos + d1_pos + d2_pos;
345 v[9] =
To + d0_pos + d1_pos + d2_neg;
346 v[10] =
To + d0_pos + d1_neg + d2_pos;
347 v[11] =
To + d0_pos + d1_neg + d2_neg;
348 v[12] =
To + d0_neg + d1_pos + d2_pos;
349 v[13] =
To + d0_neg + d1_pos + d2_neg;
350 v[14] =
To + d0_neg + d1_neg + d2_pos;
351 v[15] =
To + d0_neg + d1_neg + d2_neg;
356 Vector3<S> s(0, 0, 0);
358 getCovariance<S>(v,
nullptr,
nullptr,
nullptr, 16, M);
362 if(s[0] > s[1]) { max = 0; min = 1; }
363 else { min = 0; max = 1; }
364 if(s[2] < s[min]) { mid = min; min = 2; }
365 else if(s[2] > s[max]) { mid = max; max = 2; }
369 bv.
axis.col(0) = E.col(max);
370 bv.
axis.col(1) = E.col(mid);
371 bv.
axis.col(2).noalias() =
axis.col(0).cross(
axis.col(1));
374 getRadiusAndOriginAndRectangleSize<S>(v,
nullptr,
nullptr,
nullptr, 16, bv.
axis, bv.
To, bv.
l, bv.
r);
380 template <
typename S>
387 template <
typename S>
394 template <
typename S>
401 template <
typename S>
408 template <
typename S>
411 return (std::sqrt(
l[0] *
l[0] +
l[1] *
l[1]) + 2 *
r);
415 template <
typename S>
422 template <
typename S>
428 Vector3<S> t = other.
To -
To;
430 axis.col(0).dot(t),
axis.col(1).dot(t),
axis.col(2).dot(t));
431 Matrix3<S> R =
axis.transpose() * other.
axis;
433 S dist = rectDistance(R, T,
l, other.
l, P, Q);
434 dist -= (
r + other.
r);
435 return (dist < (S)0.0) ? (S)0.0 : dist;
439 template <
typename S>
440 void clipToRange(S& val, S a, S b)
443 else if(val > b) val = b;
447 template <
typename S>
448 void segCoords(S& t, S& u, S a, S b, S A_dot_B, S A_dot_T, S B_dot_T)
450 S denom = 1 - A_dot_B * A_dot_B;
452 if(denom == 0) t = 0;
455 t = (A_dot_T - B_dot_T * A_dot_B) / denom;
456 clipToRange(t, (S)0.0, a);
459 u = t * A_dot_B - B_dot_T;
464 clipToRange(t, (S)0.0, a);
469 t = u * A_dot_B + A_dot_T;
470 clipToRange(t, (S)0.0, a);
475 template <
typename S>
476 bool inVoronoi(S a, S b, S Anorm_dot_B, S Anorm_dot_T, S A_dot_B, S A_dot_T, S B_dot_T)
478 if(fabs(Anorm_dot_B) < 1e-7)
return false;
482 u = -Anorm_dot_T / Anorm_dot_B;
483 clipToRange(u, (S)0.0, b);
485 t = u * A_dot_B + A_dot_T;
486 clipToRange(t, (S)0.0, a);
488 v = t * A_dot_B - B_dot_T;
492 if(v > (u + 1e-7))
return true;
496 if(v < (u - 1e-7))
return true;
502 template <
typename S>
503 S rectDistance(
const Matrix3<S>& Rab, Vector3<S>
const& Tab,
const S a[2],
const S b[2], Vector3<S>* P, Vector3<S>* Q)
505 S A0_dot_B0, A0_dot_B1, A1_dot_B0, A1_dot_B1;
507 A0_dot_B0 = Rab(0, 0);
508 A0_dot_B1 = Rab(0, 1);
509 A1_dot_B0 = Rab(1, 0);
510 A1_dot_B1 = Rab(1, 1);
512 S aA0_dot_B0, aA0_dot_B1, aA1_dot_B0, aA1_dot_B1;
513 S bA0_dot_B0, bA0_dot_B1, bA1_dot_B0, bA1_dot_B1;
515 aA0_dot_B0 = a[0] * A0_dot_B0;
516 aA0_dot_B1 = a[0] * A0_dot_B1;
517 aA1_dot_B0 = a[1] * A1_dot_B0;
518 aA1_dot_B1 = a[1] * A1_dot_B1;
519 bA0_dot_B0 = b[0] * A0_dot_B0;
520 bA1_dot_B0 = b[0] * A1_dot_B0;
521 bA0_dot_B1 = b[1] * A0_dot_B1;
522 bA1_dot_B1 = b[1] * A1_dot_B1;
524 Vector3<S> Tba = Rab.transpose() * Tab;
531 S ALL_x, ALU_x, AUL_x, AUU_x;
532 S BLL_x, BLU_x, BUL_x, BUU_x;
533 S LA1_lx, LA1_ux, UA1_lx, UA1_ux, LB1_lx, LB1_ux, UB1_lx, UB1_ux;
536 ALU_x = ALL_x + aA1_dot_B0;
537 AUL_x = ALL_x + aA0_dot_B0;
538 AUU_x = ALU_x + aA0_dot_B0;
556 BLU_x = BLL_x + bA0_dot_B1;
557 BUL_x = BLL_x + bA0_dot_B0;
558 BUU_x = BLU_x + bA0_dot_B0;
577 if((UA1_ux > b[0]) && (UB1_ux > a[0]))
579 if(((UA1_lx > b[0]) ||
580 inVoronoi(b[1], a[1], A1_dot_B0, aA0_dot_B0 - b[0] - Tba[0],
581 A1_dot_B1, aA0_dot_B1 - Tba[1],
582 -Tab[1] - bA1_dot_B0))
585 inVoronoi(a[1], b[1], A0_dot_B1, Tab[0] + bA0_dot_B0 - a[0],
586 A1_dot_B1, Tab[1] + bA1_dot_B0, Tba[1] - aA0_dot_B1)))
588 segCoords(t, u, a[1], b[1], A1_dot_B1, Tab[1] + bA1_dot_B0,
589 Tba[1] - aA0_dot_B1);
591 D[0] = Tab[0] + Rab(0, 0) * b[0] + Rab(0, 1) * u - a[0] ;
592 D[1] = Tab[1] + Rab(1, 0) * b[0] + Rab(1, 1) * u - t;
593 D[2] = Tab[2] + Rab(2, 0) * b[0] + Rab(2, 1) * u;
608 if((UA1_lx < 0) && (LB1_ux > a[0]))
611 inVoronoi(b[1], a[1], -A1_dot_B0, Tba[0] - aA0_dot_B0,
612 A1_dot_B1, aA0_dot_B1 - Tba[1], -Tab[1]))
615 inVoronoi(a[1], b[1], A0_dot_B1, Tab[0] - a[0],
616 A1_dot_B1, Tab[1], Tba[1] - aA0_dot_B1)))
618 segCoords(t, u, a[1], b[1], A1_dot_B1, Tab[1], Tba[1] - aA0_dot_B1);
620 D[0] = Tab[0] + Rab(0, 1) * u - a[0];
621 D[1] = Tab[1] + Rab(1, 1) * u - t;
622 D[2] = Tab[2] + Rab(2, 1) * u;
636 if((LA1_ux > b[0]) && (UB1_lx < 0))
638 if(((LA1_lx > b[0]) ||
639 inVoronoi(b[1], a[1], A1_dot_B0, -Tba[0] - b[0],
640 A1_dot_B1, -Tba[1], -Tab[1] - bA1_dot_B0))
643 inVoronoi(a[1], b[1], -A0_dot_B1, -Tab[0] - bA0_dot_B0,
644 A1_dot_B1, Tab[1] + bA1_dot_B0, Tba[1])))
646 segCoords(t, u, a[1], b[1], A1_dot_B1, Tab[1] + bA1_dot_B0, Tba[1]);
648 D[0] = Tab[0] + Rab(0, 0) * b[0] + Rab(0, 1) * u;
649 D[1] = Tab[1] + Rab(1, 0) * b[0] + Rab(1, 1) * u - t;
650 D[2] = Tab[2] + Rab(2, 0) * b[0] + Rab(2, 1) * u;
664 if((LA1_lx < 0) && (LB1_lx < 0))
667 inVoronoi(b[1], a[1], -A1_dot_B0, Tba[0], A1_dot_B1,
671 inVoronoi(a[1], b[1], -A0_dot_B1, -Tab[0], A1_dot_B1,
674 segCoords(t, u, a[1], b[1], A1_dot_B1, Tab[1], Tba[1]);
676 D[0] = Tab[0] + Rab(0, 1) * u;
677 D[1] = Tab[1] + Rab(1, 1) * u - t;
678 D[2] = Tab[2] + Rab(2, 1) * u;
690 S ALL_y, ALU_y, AUL_y, AUU_y;
693 ALU_y = ALL_y + aA1_dot_B1;
694 AUL_y = ALL_y + aA0_dot_B1;
695 AUU_y = ALU_y + aA0_dot_B1;
697 S LA1_ly, LA1_uy, UA1_ly, UA1_uy, LB0_lx, LB0_ux, UB0_lx, UB0_ux;
731 if((UA1_uy > b[1]) && (UB0_ux > a[0]))
733 if(((UA1_ly > b[1]) ||
734 inVoronoi(b[0], a[1], A1_dot_B1, aA0_dot_B1 - Tba[1] - b[1],
735 A1_dot_B0, aA0_dot_B0 - Tba[0], -Tab[1] - bA1_dot_B1))
738 inVoronoi(a[1], b[0], A0_dot_B0, Tab[0] - a[0] + bA0_dot_B1,
739 A1_dot_B0, Tab[1] + bA1_dot_B1, Tba[0] - aA0_dot_B0)))
741 segCoords(t, u, a[1], b[0], A1_dot_B0, Tab[1] + bA1_dot_B1,
742 Tba[0] - aA0_dot_B0);
744 D[0] = Tab[0] + Rab(0, 1) * b[1] + Rab(0, 0) * u - a[0] ;
745 D[1] = Tab[1] + Rab(1, 1) * b[1] + Rab(1, 0) * u - t;
746 D[2] = Tab[2] + Rab(2, 1) * b[1] + Rab(2, 0) * u;
760 if((UA1_ly < 0) && (LB0_ux > a[0]))
763 inVoronoi(b[0], a[1], -A1_dot_B1, Tba[1] - aA0_dot_B1, A1_dot_B0,
764 aA0_dot_B0 - Tba[0], -Tab[1]))
767 inVoronoi(a[1], b[0], A0_dot_B0, Tab[0] - a[0],
768 A1_dot_B0, Tab[1], Tba[0] - aA0_dot_B0)))
770 segCoords(t, u, a[1], b[0], A1_dot_B0, Tab[1], Tba[0] - aA0_dot_B0);
772 D[0] = Tab[0] + Rab(0, 0) * u - a[0];
773 D[1] = Tab[1] + Rab(1, 0) * u - t;
774 D[2] = Tab[2] + Rab(2, 0) * u;
788 if((LA1_uy > b[1]) && (UB0_lx < 0))
790 if(((LA1_ly > b[1]) ||
791 inVoronoi(b[0], a[1], A1_dot_B1, -Tba[1] - b[1],
792 A1_dot_B0, -Tba[0], -Tab[1] - bA1_dot_B1))
796 inVoronoi(a[1], b[0], -A0_dot_B0, -Tab[0] - bA0_dot_B1, A1_dot_B0,
797 Tab[1] + bA1_dot_B1, Tba[0])))
799 segCoords(t, u, a[1], b[0], A1_dot_B0, Tab[1] + bA1_dot_B1, Tba[0]);
801 D[0] = Tab[0] + Rab(0, 1) * b[1] + Rab(0, 0) * u;
802 D[1] = Tab[1] + Rab(1, 1) * b[1] + Rab(1, 0) * u - t;
803 D[2] = Tab[2] + Rab(2, 1) * b[1] + Rab(2, 0) * u;
818 if((LA1_ly < 0) && (LB0_lx < 0))
821 inVoronoi(b[0], a[1], -A1_dot_B1, Tba[1], A1_dot_B0,
825 inVoronoi(a[1], b[0], -A0_dot_B0, -Tab[0], A1_dot_B0,
828 segCoords(t, u, a[1], b[0], A1_dot_B0, Tab[1], Tba[0]);
830 D[0] = Tab[0] + Rab(0, 0) * u;
831 D[1] = Tab[1] + Rab(1, 0) * u - t;
832 D[2] = Tab[2] + Rab(2, 0) * u;
844 S BLL_y, BLU_y, BUL_y, BUU_y;
847 BLU_y = BLL_y + bA1_dot_B1;
848 BUL_y = BLL_y + bA1_dot_B0;
849 BUU_y = BLU_y + bA1_dot_B0;
851 S LA0_lx, LA0_ux, UA0_lx, UA0_ux, LB1_ly, LB1_uy, UB1_ly, UB1_uy;
885 if((UA0_ux > b[0]) && (UB1_uy > a[1]))
887 if(((UA0_lx > b[0]) ||
888 inVoronoi(b[1], a[0], A0_dot_B0, aA1_dot_B0 - Tba[0] - b[0],
889 A0_dot_B1, aA1_dot_B1 - Tba[1], -Tab[0] - bA0_dot_B0))
892 inVoronoi(a[0], b[1], A1_dot_B1, Tab[1] - a[1] + bA1_dot_B0,
893 A0_dot_B1, Tab[0] + bA0_dot_B0, Tba[1] - aA1_dot_B1)))
895 segCoords(t, u, a[0], b[1], A0_dot_B1, Tab[0] + bA0_dot_B0,
896 Tba[1] - aA1_dot_B1);
898 D[0] = Tab[0] + Rab(0, 0) * b[0] + Rab(0, 1) * u - t;
899 D[1] = Tab[1] + Rab(1, 0) * b[0] + Rab(1, 1) * u - a[1];
900 D[2] = Tab[2] + Rab(2, 0) * b[0] + Rab(2, 1) * u;
914 if((UA0_lx < 0) && (LB1_uy > a[1]))
917 inVoronoi(b[1], a[0], -A0_dot_B0, Tba[0] - aA1_dot_B0, A0_dot_B1,
918 aA1_dot_B1 - Tba[1], -Tab[0]))
921 inVoronoi(a[0], b[1], A1_dot_B1, Tab[1] - a[1], A0_dot_B1, Tab[0],
922 Tba[1] - aA1_dot_B1)))
924 segCoords(t, u, a[0], b[1], A0_dot_B1, Tab[0], Tba[1] - aA1_dot_B1);
926 D[0] = Tab[0] + Rab(0, 1) * u - t;
927 D[1] = Tab[1] + Rab(1, 1) * u - a[1];
928 D[2] = Tab[2] + Rab(2, 1) * u;
942 if((LA0_ux > b[0]) && (UB1_ly < 0))
944 if(((LA0_lx > b[0]) ||
945 inVoronoi(b[1], a[0], A0_dot_B0, -b[0] - Tba[0], A0_dot_B1, -Tba[1],
946 -bA0_dot_B0 - Tab[0]))
949 inVoronoi(a[0], b[1], -A1_dot_B1, -Tab[1] - bA1_dot_B0, A0_dot_B1,
950 Tab[0] + bA0_dot_B0, Tba[1])))
952 segCoords(t, u, a[0], b[1], A0_dot_B1, Tab[0] + bA0_dot_B0, Tba[1]);
954 D[0] = Tab[0] + Rab(0, 0) * b[0] + Rab(0, 1) * u - t;
955 D[1] = Tab[1] + Rab(1, 0) * b[0] + Rab(1, 1) * u;
956 D[2] = Tab[2] + Rab(2, 0) * b[0] + Rab(2, 1) * u;
970 if((LA0_lx < 0) && (LB1_ly < 0))
973 inVoronoi(b[1], a[0], -A0_dot_B0, Tba[0], A0_dot_B1, -Tba[1],
977 inVoronoi(a[0], b[1], -A1_dot_B1, -Tab[1], A0_dot_B1,
980 segCoords(t, u, a[0], b[1], A0_dot_B1, Tab[0], Tba[1]);
982 D[0] = Tab[0] + Rab(0, 1) * u - t;
983 D[1] = Tab[1] + Rab(1, 1) * u;
984 D[2] = Tab[2] + Rab(2, 1) * u;
996 S LA0_ly, LA0_uy, UA0_ly, UA0_uy, LB0_ly, LB0_uy, UB0_ly, UB0_uy;
1030 if((UA0_uy > b[1]) && (UB0_uy > a[1]))
1032 if(((UA0_ly > b[1]) ||
1033 inVoronoi(b[0], a[0], A0_dot_B1, aA1_dot_B1 - Tba[1] - b[1],
1034 A0_dot_B0, aA1_dot_B0 - Tba[0], -Tab[0] - bA0_dot_B1))
1037 inVoronoi(a[0], b[0], A1_dot_B0, Tab[1] - a[1] + bA1_dot_B1, A0_dot_B0,
1038 Tab[0] + bA0_dot_B1, Tba[0] - aA1_dot_B0)))
1040 segCoords(t, u, a[0], b[0], A0_dot_B0, Tab[0] + bA0_dot_B1,
1041 Tba[0] - aA1_dot_B0);
1043 D[0] = Tab[0] + Rab(0, 1) * b[1] + Rab(0, 0) * u - t;
1044 D[1] = Tab[1] + Rab(1, 1) * b[1] + Rab(1, 0) * u - a[1];
1045 D[2] = Tab[2] + Rab(2, 1) * b[1] + Rab(2, 0) * u;
1059 if((UA0_ly < 0) && (LB0_uy > a[1]))
1062 inVoronoi(b[0], a[0], -A0_dot_B1, Tba[1] - aA1_dot_B1, A0_dot_B0,
1063 aA1_dot_B0 - Tba[0], -Tab[0]))
1066 inVoronoi(a[0], b[0], A1_dot_B0, Tab[1] - a[1],
1067 A0_dot_B0, Tab[0], Tba[0] - aA1_dot_B0)))
1069 segCoords(t, u, a[0], b[0], A0_dot_B0, Tab[0], Tba[0] - aA1_dot_B0);
1071 D[0] = Tab[0] + Rab(0, 0) * u - t;
1072 D[1] = Tab[1] + Rab(1, 0) * u - a[1];
1073 D[2] = Tab[2] + Rab(2, 0) * u;
1087 if((LA0_uy > b[1]) && (UB0_ly < 0))
1089 if(((LA0_ly > b[1]) ||
1090 inVoronoi(b[0], a[0], A0_dot_B1, -Tba[1] - b[1], A0_dot_B0, -Tba[0],
1091 -Tab[0] - bA0_dot_B1))
1095 inVoronoi(a[0], b[0], -A1_dot_B0, -Tab[1] - bA1_dot_B1, A0_dot_B0,
1096 Tab[0] + bA0_dot_B1, Tba[0])))
1098 segCoords(t, u, a[0], b[0], A0_dot_B0, Tab[0] + bA0_dot_B1, Tba[0]);
1100 D[0] = Tab[0] + Rab(0, 1) * b[1] + Rab(0, 0) * u - t;
1101 D[1] = Tab[1] + Rab(1, 1) * b[1] + Rab(1, 0) * u;
1102 D[2] = Tab[2] + Rab(2, 1) * b[1] + Rab(2, 0) * u;
1116 if((LA0_ly < 0) && (LB0_ly < 0))
1119 inVoronoi(b[0], a[0], -A0_dot_B1, Tba[1], A0_dot_B0,
1123 inVoronoi(a[0], b[0], -A1_dot_B0, -Tab[1], A0_dot_B0,
1126 segCoords(t, u, a[0], b[0], A0_dot_B0, Tab[0], Tba[0]);
1128 D[0] = Tab[0] + Rab(0, 0) * u - t;
1129 D[1] = Tab[1] + Rab(1, 0) * u;
1130 D[2] = Tab[2] + Rab(2, 0) * u;
1149 if (Rab(2, 0) < 0.0) sep1 += b[0] * Rab(2, 0);
1150 if (Rab(2, 1) < 0.0) sep1 += b[1] * Rab(2, 1);
1155 if (Rab(2, 0) > 0.0) sep1 -= b[0] * Rab(2, 0);
1156 if (Rab(2, 1) > 0.0) sep1 -= b[1] * Rab(2, 1);
1162 if (Rab(0, 2) < 0.0) sep2 += a[0] * Rab(0, 2);
1163 if (Rab(1, 2) < 0.0) sep2 += a[1] * Rab(1, 2);
1168 if (Rab(0, 2) > 0.0) sep2 -= a[0] * Rab(0, 2);
1169 if (Rab(1, 2) > 0.0) sep2 -= a[1] * Rab(1, 2);
1172 if(sep1 >= sep2 && sep1 >= 0)
1186 if(sep2 >= sep1 && sep2 >= 0)
1188 Vector3<S> Q_(Tab[0], Tab[1], Tab[2]);
1192 P_[0] = Rab(0, 2) * sep2 + Tab[0];
1193 P_[1] = Rab(1, 2) * sep2 + Tab[1];
1194 P_[2] = Rab(2, 2) * sep2 + Tab[2];
1198 P_[0] = -Rab(0, 2) * sep2 + Tab[0];
1199 P_[1] = -Rab(1, 2) * sep2 + Tab[1];
1200 P_[2] = -Rab(2, 2) * sep2 + Tab[2];
1212 S sep = (sep1 > sep2 ? sep1 : sep2);
1213 return (sep > 0 ? sep : 0);
1217 template <
typename S>
1219 const Transform3<S>& tfab,
1225 S A0_dot_B0 = tfab.linear()(0, 0);
1226 S A0_dot_B1 = tfab.linear()(0, 1);
1227 S A1_dot_B0 = tfab.linear()(1, 0);
1228 S A1_dot_B1 = tfab.linear()(1, 1);
1230 S aA0_dot_B0 = a[0] * A0_dot_B0;
1231 S aA0_dot_B1 = a[0] * A0_dot_B1;
1232 S aA1_dot_B0 = a[1] * A1_dot_B0;
1233 S aA1_dot_B1 = a[1] * A1_dot_B1;
1234 S bA0_dot_B0 = b[0] * A0_dot_B0;
1235 S bA1_dot_B0 = b[0] * A1_dot_B0;
1236 S bA0_dot_B1 = b[1] * A0_dot_B1;
1237 S bA1_dot_B1 = b[1] * A1_dot_B1;
1239 Vector3<S> Tba = tfab.linear().transpose() * tfab.translation();
1246 S LA1_lx, LA1_ux, UA1_lx, UA1_ux, LB1_lx, LB1_ux, UB1_lx, UB1_ux;
1249 S ALU_x = ALL_x + aA1_dot_B0;
1250 S AUL_x = ALL_x + aA0_dot_B0;
1251 S AUU_x = ALU_x + aA0_dot_B0;
1268 S BLL_x = tfab.translation()[0];
1269 S BLU_x = BLL_x + bA0_dot_B1;
1270 S BUL_x = BLL_x + bA0_dot_B0;
1271 S BUU_x = BLU_x + bA0_dot_B0;
1290 if((UA1_ux > b[0]) && (UB1_ux > a[0]))
1292 if(((UA1_lx > b[0]) ||
1293 inVoronoi(b[1], a[1], A1_dot_B0, aA0_dot_B0 - b[0] - Tba[0],
1294 A1_dot_B1, aA0_dot_B1 - Tba[1],
1295 -tfab.translation()[1] - bA1_dot_B0))
1298 inVoronoi(a[1], b[1], A0_dot_B1, tfab.translation()[0] + bA0_dot_B0 - a[0],
1299 A1_dot_B1, tfab.translation()[1] + bA1_dot_B0, Tba[1] - aA0_dot_B1)))
1301 segCoords(t, u, a[1], b[1], A1_dot_B1, tfab.translation()[1] + bA1_dot_B0,
1302 Tba[1] - aA0_dot_B1);
1304 D[0] = tfab.translation()[0] + tfab.linear()(0, 0) * b[0] + tfab.linear()(0, 1) * u - a[0] ;
1305 D[1] = tfab.translation()[1] + tfab.linear()(1, 0) * b[0] + tfab.linear()(1, 1) * u - t;
1306 D[2] = tfab.translation()[2] + tfab.linear()(2, 0) * b[0] + tfab.linear()(2, 1) * u;
1321 if((UA1_lx < 0) && (LB1_ux > a[0]))
1324 inVoronoi(b[1], a[1], -A1_dot_B0, Tba[0] - aA0_dot_B0,
1325 A1_dot_B1, aA0_dot_B1 - Tba[1], -tfab.translation()[1]))
1328 inVoronoi(a[1], b[1], A0_dot_B1, tfab.translation()[0] - a[0],
1329 A1_dot_B1, tfab.translation()[1], Tba[1] - aA0_dot_B1)))
1331 segCoords(t, u, a[1], b[1], A1_dot_B1, tfab.translation()[1], Tba[1] - aA0_dot_B1);
1333 D[0] = tfab.translation()[0] + tfab.linear()(0, 1) * u - a[0];
1334 D[1] = tfab.translation()[1] + tfab.linear()(1, 1) * u - t;
1335 D[2] = tfab.translation()[2] + tfab.linear()(2, 1) * u;
1349 if((LA1_ux > b[0]) && (UB1_lx < 0))
1351 if(((LA1_lx > b[0]) ||
1352 inVoronoi(b[1], a[1], A1_dot_B0, -Tba[0] - b[0],
1353 A1_dot_B1, -Tba[1], -tfab.translation()[1] - bA1_dot_B0))
1356 inVoronoi(a[1], b[1], -A0_dot_B1, -tfab.translation()[0] - bA0_dot_B0,
1357 A1_dot_B1, tfab.translation()[1] + bA1_dot_B0, Tba[1])))
1359 segCoords(t, u, a[1], b[1], A1_dot_B1, tfab.translation()[1] + bA1_dot_B0, Tba[1]);
1361 D[0] = tfab.translation()[0] + tfab.linear()(0, 0) * b[0] + tfab.linear()(0, 1) * u;
1362 D[1] = tfab.translation()[1] + tfab.linear()(1, 0) * b[0] + tfab.linear()(1, 1) * u - t;
1363 D[2] = tfab.translation()[2] + tfab.linear()(2, 0) * b[0] + tfab.linear()(2, 1) * u;
1377 if((LA1_lx < 0) && (LB1_lx < 0))
1379 if (((LA1_ux < 0) ||
1380 inVoronoi(b[1], a[1], -A1_dot_B0, Tba[0], A1_dot_B1,
1381 -Tba[1], -tfab.translation()[1]))
1384 inVoronoi(a[1], b[1], -A0_dot_B1, -tfab.translation()[0], A1_dot_B1,
1385 tfab.translation()[1], Tba[1])))
1387 segCoords(t, u, a[1], b[1], A1_dot_B1, tfab.translation()[1], Tba[1]);
1389 D[0] = tfab.translation()[0] + tfab.linear()(0, 1) * u;
1390 D[1] = tfab.translation()[1] + tfab.linear()(1, 1) * u - t;
1391 D[2] = tfab.translation()[2] + tfab.linear()(2, 1) * u;
1403 S ALL_y, ALU_y, AUL_y, AUU_y;
1406 ALU_y = ALL_y + aA1_dot_B1;
1407 AUL_y = ALL_y + aA0_dot_B1;
1408 AUU_y = ALU_y + aA0_dot_B1;
1410 S LA1_ly, LA1_uy, UA1_ly, UA1_uy, LB0_lx, LB0_ux, UB0_lx, UB0_ux;
1444 if((UA1_uy > b[1]) && (UB0_ux > a[0]))
1446 if(((UA1_ly > b[1]) ||
1447 inVoronoi(b[0], a[1], A1_dot_B1, aA0_dot_B1 - Tba[1] - b[1],
1448 A1_dot_B0, aA0_dot_B0 - Tba[0], -tfab.translation()[1] - bA1_dot_B1))
1451 inVoronoi(a[1], b[0], A0_dot_B0, tfab.translation()[0] - a[0] + bA0_dot_B1,
1452 A1_dot_B0, tfab.translation()[1] + bA1_dot_B1, Tba[0] - aA0_dot_B0)))
1454 segCoords(t, u, a[1], b[0], A1_dot_B0, tfab.translation()[1] + bA1_dot_B1,
1455 Tba[0] - aA0_dot_B0);
1457 D[0] = tfab.translation()[0] + tfab.linear()(0, 1) * b[1] + tfab.linear()(0, 0) * u - a[0] ;
1458 D[1] = tfab.translation()[1] + tfab.linear()(1, 1) * b[1] + tfab.linear()(1, 0) * u - t;
1459 D[2] = tfab.translation()[2] + tfab.linear()(2, 1) * b[1] + tfab.linear()(2, 0) * u;
1473 if((UA1_ly < 0) && (LB0_ux > a[0]))
1476 inVoronoi(b[0], a[1], -A1_dot_B1, Tba[1] - aA0_dot_B1, A1_dot_B0,
1477 aA0_dot_B0 - Tba[0], -tfab.translation()[1]))
1480 inVoronoi(a[1], b[0], A0_dot_B0, tfab.translation()[0] - a[0],
1481 A1_dot_B0, tfab.translation()[1], Tba[0] - aA0_dot_B0)))
1483 segCoords(t, u, a[1], b[0], A1_dot_B0, tfab.translation()[1], Tba[0] - aA0_dot_B0);
1485 D[0] = tfab.translation()[0] + tfab.linear()(0, 0) * u - a[0];
1486 D[1] = tfab.translation()[1] + tfab.linear()(1, 0) * u - t;
1487 D[2] = tfab.translation()[2] + tfab.linear()(2, 0) * u;
1501 if((LA1_uy > b[1]) && (UB0_lx < 0))
1503 if(((LA1_ly > b[1]) ||
1504 inVoronoi(b[0], a[1], A1_dot_B1, -Tba[1] - b[1],
1505 A1_dot_B0, -Tba[0], -tfab.translation()[1] - bA1_dot_B1))
1509 inVoronoi(a[1], b[0], -A0_dot_B0, -tfab.translation()[0] - bA0_dot_B1, A1_dot_B0,
1510 tfab.translation()[1] + bA1_dot_B1, Tba[0])))
1512 segCoords(t, u, a[1], b[0], A1_dot_B0, tfab.translation()[1] + bA1_dot_B1, Tba[0]);
1514 D[0] = tfab.translation()[0] + tfab.linear()(0, 1) * b[1] + tfab.linear()(0, 0) * u;
1515 D[1] = tfab.translation()[1] + tfab.linear()(1, 1) * b[1] + tfab.linear()(1, 0) * u - t;
1516 D[2] = tfab.translation()[2] + tfab.linear()(2, 1) * b[1] + tfab.linear()(2, 0) * u;
1531 if((LA1_ly < 0) && (LB0_lx < 0))
1534 inVoronoi(b[0], a[1], -A1_dot_B1, Tba[1], A1_dot_B0,
1535 -Tba[0], -tfab.translation()[1]))
1538 inVoronoi(a[1], b[0], -A0_dot_B0, -tfab.translation()[0], A1_dot_B0,
1539 tfab.translation()[1], Tba[0])))
1541 segCoords(t, u, a[1], b[0], A1_dot_B0, tfab.translation()[1], Tba[0]);
1543 D[0] = tfab.translation()[0] + tfab.linear()(0, 0) * u;
1544 D[1] = tfab.translation()[1] + tfab.linear()(1, 0) * u - t;
1545 D[2] = tfab.translation()[2] + tfab.linear()(2, 0) * u;
1557 S BLL_y, BLU_y, BUL_y, BUU_y;
1559 BLL_y = tfab.translation()[1];
1560 BLU_y = BLL_y + bA1_dot_B1;
1561 BUL_y = BLL_y + bA1_dot_B0;
1562 BUU_y = BLU_y + bA1_dot_B0;
1564 S LA0_lx, LA0_ux, UA0_lx, UA0_ux, LB1_ly, LB1_uy, UB1_ly, UB1_uy;
1598 if((UA0_ux > b[0]) && (UB1_uy > a[1]))
1600 if(((UA0_lx > b[0]) ||
1601 inVoronoi(b[1], a[0], A0_dot_B0, aA1_dot_B0 - Tba[0] - b[0],
1602 A0_dot_B1, aA1_dot_B1 - Tba[1], -tfab.translation()[0] - bA0_dot_B0))
1605 inVoronoi(a[0], b[1], A1_dot_B1, tfab.translation()[1] - a[1] + bA1_dot_B0,
1606 A0_dot_B1, tfab.translation()[0] + bA0_dot_B0, Tba[1] - aA1_dot_B1)))
1608 segCoords(t, u, a[0], b[1], A0_dot_B1, tfab.translation()[0] + bA0_dot_B0,
1609 Tba[1] - aA1_dot_B1);
1611 D[0] = tfab.translation()[0] + tfab.linear()(0, 0) * b[0] + tfab.linear()(0, 1) * u - t;
1612 D[1] = tfab.translation()[1] + tfab.linear()(1, 0) * b[0] + tfab.linear()(1, 1) * u - a[1];
1613 D[2] = tfab.translation()[2] + tfab.linear()(2, 0) * b[0] + tfab.linear()(2, 1) * u;
1627 if((UA0_lx < 0) && (LB1_uy > a[1]))
1630 inVoronoi(b[1], a[0], -A0_dot_B0, Tba[0] - aA1_dot_B0, A0_dot_B1,
1631 aA1_dot_B1 - Tba[1], -tfab.translation()[0]))
1634 inVoronoi(a[0], b[1], A1_dot_B1, tfab.translation()[1] - a[1], A0_dot_B1, tfab.translation()[0],
1635 Tba[1] - aA1_dot_B1)))
1637 segCoords(t, u, a[0], b[1], A0_dot_B1, tfab.translation()[0], Tba[1] - aA1_dot_B1);
1639 D[0] = tfab.translation()[0] + tfab.linear()(0, 1) * u - t;
1640 D[1] = tfab.translation()[1] + tfab.linear()(1, 1) * u - a[1];
1641 D[2] = tfab.translation()[2] + tfab.linear()(2, 1) * u;
1655 if((LA0_ux > b[0]) && (UB1_ly < 0))
1657 if(((LA0_lx > b[0]) ||
1658 inVoronoi(b[1], a[0], A0_dot_B0, -b[0] - Tba[0], A0_dot_B1, -Tba[1],
1659 -bA0_dot_B0 - tfab.translation()[0]))
1662 inVoronoi(a[0], b[1], -A1_dot_B1, -tfab.translation()[1] - bA1_dot_B0, A0_dot_B1,
1663 tfab.translation()[0] + bA0_dot_B0, Tba[1])))
1665 segCoords(t, u, a[0], b[1], A0_dot_B1, tfab.translation()[0] + bA0_dot_B0, Tba[1]);
1667 D[0] = tfab.translation()[0] + tfab.linear()(0, 0) * b[0] + tfab.linear()(0, 1) * u - t;
1668 D[1] = tfab.translation()[1] + tfab.linear()(1, 0) * b[0] + tfab.linear()(1, 1) * u;
1669 D[2] = tfab.translation()[2] + tfab.linear()(2, 0) * b[0] + tfab.linear()(2, 1) * u;
1683 if((LA0_lx < 0) && (LB1_ly < 0))
1686 inVoronoi(b[1], a[0], -A0_dot_B0, Tba[0], A0_dot_B1, -Tba[1],
1687 -tfab.translation()[0]))
1690 inVoronoi(a[0], b[1], -A1_dot_B1, -tfab.translation()[1], A0_dot_B1,
1691 tfab.translation()[0], Tba[1])))
1693 segCoords(t, u, a[0], b[1], A0_dot_B1, tfab.translation()[0], Tba[1]);
1695 D[0] = tfab.translation()[0] + tfab.linear()(0, 1) * u - t;
1696 D[1] = tfab.translation()[1] + tfab.linear()(1, 1) * u;
1697 D[2] = tfab.translation()[2] + tfab.linear()(2, 1) * u;
1709 S LA0_ly, LA0_uy, UA0_ly, UA0_uy, LB0_ly, LB0_uy, UB0_ly, UB0_uy;
1743 if((UA0_uy > b[1]) && (UB0_uy > a[1]))
1745 if(((UA0_ly > b[1]) ||
1746 inVoronoi(b[0], a[0], A0_dot_B1, aA1_dot_B1 - Tba[1] - b[1],
1747 A0_dot_B0, aA1_dot_B0 - Tba[0], -tfab.translation()[0] - bA0_dot_B1))
1750 inVoronoi(a[0], b[0], A1_dot_B0, tfab.translation()[1] - a[1] + bA1_dot_B1, A0_dot_B0,
1751 tfab.translation()[0] + bA0_dot_B1, Tba[0] - aA1_dot_B0)))
1753 segCoords(t, u, a[0], b[0], A0_dot_B0, tfab.translation()[0] + bA0_dot_B1,
1754 Tba[0] - aA1_dot_B0);
1756 D[0] = tfab.translation()[0] + tfab.linear()(0, 1) * b[1] + tfab.linear()(0, 0) * u - t;
1757 D[1] = tfab.translation()[1] + tfab.linear()(1, 1) * b[1] + tfab.linear()(1, 0) * u - a[1];
1758 D[2] = tfab.translation()[2] + tfab.linear()(2, 1) * b[1] + tfab.linear()(2, 0) * u;
1772 if((UA0_ly < 0) && (LB0_uy > a[1]))
1775 inVoronoi(b[0], a[0], -A0_dot_B1, Tba[1] - aA1_dot_B1, A0_dot_B0,
1776 aA1_dot_B0 - Tba[0], -tfab.translation()[0]))
1779 inVoronoi(a[0], b[0], A1_dot_B0, tfab.translation()[1] - a[1],
1780 A0_dot_B0, tfab.translation()[0], Tba[0] - aA1_dot_B0)))
1782 segCoords(t, u, a[0], b[0], A0_dot_B0, tfab.translation()[0], Tba[0] - aA1_dot_B0);
1784 D[0] = tfab.translation()[0] + tfab.linear()(0, 0) * u - t;
1785 D[1] = tfab.translation()[1] + tfab.linear()(1, 0) * u - a[1];
1786 D[2] = tfab.translation()[2] + tfab.linear()(2, 0) * u;
1800 if((LA0_uy > b[1]) && (UB0_ly < 0))
1802 if(((LA0_ly > b[1]) ||
1803 inVoronoi(b[0], a[0], A0_dot_B1, -Tba[1] - b[1], A0_dot_B0, -Tba[0],
1804 -tfab.translation()[0] - bA0_dot_B1))
1808 inVoronoi(a[0], b[0], -A1_dot_B0, -tfab.translation()[1] - bA1_dot_B1, A0_dot_B0,
1809 tfab.translation()[0] + bA0_dot_B1, Tba[0])))
1811 segCoords(t, u, a[0], b[0], A0_dot_B0, tfab.translation()[0] + bA0_dot_B1, Tba[0]);
1813 D[0] = tfab.translation()[0] + tfab.linear()(0, 1) * b[1] + tfab.linear()(0, 0) * u - t;
1814 D[1] = tfab.translation()[1] + tfab.linear()(1, 1) * b[1] + tfab.linear()(1, 0) * u;
1815 D[2] = tfab.translation()[2] + tfab.linear()(2, 1) * b[1] + tfab.linear()(2, 0) * u;
1829 if((LA0_ly < 0) && (LB0_ly < 0))
1832 inVoronoi(b[0], a[0], -A0_dot_B1, Tba[1], A0_dot_B0,
1833 -Tba[0], -tfab.translation()[0]))
1836 inVoronoi(a[0], b[0], -A1_dot_B0, -tfab.translation()[1], A0_dot_B0,
1837 tfab.translation()[0], Tba[0])))
1839 segCoords(t, u, a[0], b[0], A0_dot_B0, tfab.translation()[0], Tba[0]);
1841 D[0] = tfab.translation()[0] + tfab.linear()(0, 0) * u - t;
1842 D[1] = tfab.translation()[1] + tfab.linear()(1, 0) * u;
1843 D[2] = tfab.translation()[2] + tfab.linear()(2, 0) * u;
1859 if(tfab.translation()[2] > 0.0)
1861 sep1 = tfab.translation()[2];
1862 if (tfab.linear()(2, 0) < 0.0) sep1 += b[0] * tfab.linear()(2, 0);
1863 if (tfab.linear()(2, 1) < 0.0) sep1 += b[1] * tfab.linear()(2, 1);
1867 sep1 = -tfab.translation()[2];
1868 if (tfab.linear()(2, 0) > 0.0) sep1 -= b[0] * tfab.linear()(2, 0);
1869 if (tfab.linear()(2, 1) > 0.0) sep1 -= b[1] * tfab.linear()(2, 1);
1875 if (tfab.linear()(0, 2) < 0.0) sep2 += a[0] * tfab.linear()(0, 2);
1876 if (tfab.linear()(1, 2) < 0.0) sep2 += a[1] * tfab.linear()(1, 2);
1881 if (tfab.linear()(0, 2) > 0.0) sep2 -= a[0] * tfab.linear()(0, 2);
1882 if (tfab.linear()(1, 2) > 0.0) sep2 -= a[1] * tfab.linear()(1, 2);
1885 if(sep1 >= sep2 && sep1 >= 0)
1887 if(tfab.translation()[2] > 0)
1899 if(sep2 >= sep1 && sep2 >= 0)
1901 Vector3<S> Q_(tfab.translation());
1905 P_.noalias() = tfab.linear().col(2) * sep2;
1906 P_.noalias() += tfab.translation();
1910 P_.noalias() = tfab.linear().col(2) * -sep2;
1911 P_.noalias() += tfab.translation();
1923 S sep = (sep1 > sep2 ? sep1 : sep2);
1924 return (sep > 0 ? sep : 0);
1928 template <
typename S,
typename DerivedA,
typename DerivedB>
1930 const Eigen::MatrixBase<DerivedA>& R0,
1931 const Eigen::MatrixBase<DerivedB>& T0,
1935 Matrix3<S> R0b2 = R0 * b2.
axis;
1936 Matrix3<S> R = b1.
axis.transpose() * R0b2;
1938 Vector3<S> Ttemp = R0 * b2.
To + T0 - b1.
To;
1939 Vector3<S> T = Ttemp.transpose() * b1.
axis;
1941 S dist = rectDistance(R, T, b1.
l, b2.
l);
1942 return (dist <= (b1.
r + b2.
r));
1946 template <
typename S,
typename DerivedA,
typename DerivedB>
1948 const Eigen::MatrixBase<DerivedA>& R0,
1949 const Eigen::MatrixBase<DerivedB>& T0,
1955 Matrix3<S> R0b2 = R0 * b2.
axis;
1956 Matrix3<S> R = b1.
axis.transpose() * R0b2;
1958 Vector3<S> Ttemp = R0 * b2.
To + T0 - b1.
To;
1959 Vector3<S> T = Ttemp.transpose() * b1.
axis;
1961 S dist = rectDistance(R, T, b1.
l, b2.
l, P, Q);
1962 dist -= (b1.
r + b2.
r);
1963 return (dist < (S)0.0) ? (S)0.0 : dist;
1967 template <
typename S>
Main namespace.
Definition: broadphase_bruteforce-inl.h:45
AABB< S > translate(const AABB< S > &aabb, const Eigen::MatrixBase< Derived > &t)
translate the center of AABB by t
Definition: AABB-inl.h:345
Definition: constants.h:46