69 FCL_REAL denom = 1 - A_dot_B * A_dot_B;
74 t = (A_dot_T - B_dot_T * A_dot_B) / denom;
78 u = t * A_dot_B - B_dot_T;
85 t = u * A_dot_B + A_dot_T;
98 if (fabs(Anorm_dot_B) < 1e-7)
return false;
102 u = -Anorm_dot_T / Anorm_dot_B;
105 t = u * A_dot_B + A_dot_T;
108 v = t * A_dot_B - B_dot_T;
110 if (Anorm_dot_B > 0) {
111 if (v > (u + 1e-7))
return true;
113 if (v < (u - 1e-7))
return true;
124 FCL_REAL A0_dot_B0, A0_dot_B1, A1_dot_B0, A1_dot_B1;
126 A0_dot_B0 = Rab(0, 0);
127 A0_dot_B1 = Rab(0, 1);
128 A1_dot_B0 = Rab(1, 0);
129 A1_dot_B1 = Rab(1, 1);
131 FCL_REAL aA0_dot_B0, aA0_dot_B1, aA1_dot_B0, aA1_dot_B1;
132 FCL_REAL bA0_dot_B0, bA0_dot_B1, bA1_dot_B0, bA1_dot_B1;
134 aA0_dot_B0 = a[0] * A0_dot_B0;
135 aA0_dot_B1 = a[0] * A0_dot_B1;
136 aA1_dot_B0 = a[1] * A1_dot_B0;
137 aA1_dot_B1 = a[1] * A1_dot_B1;
138 bA0_dot_B0 = b[0] * A0_dot_B0;
139 bA1_dot_B0 = b[0] * A1_dot_B0;
140 bA0_dot_B1 = b[1] * A0_dot_B1;
141 bA1_dot_B1 = b[1] * A1_dot_B1;
143 Vec3f Tba(Rab.transpose() * Tab);
150 FCL_REAL ALL_x, ALU_x, AUL_x, AUU_x;
151 FCL_REAL BLL_x, BLU_x, BUL_x, BUU_x;
152 FCL_REAL LA1_lx, LA1_ux, UA1_lx, UA1_ux, LB1_lx, LB1_ux, UB1_lx, UB1_ux;
155 ALU_x = ALL_x + aA1_dot_B0;
156 AUL_x = ALL_x + aA0_dot_B0;
157 AUU_x = ALU_x + aA0_dot_B0;
172 BLU_x = BLL_x + bA0_dot_B1;
173 BUL_x = BLL_x + bA0_dot_B0;
174 BUU_x = BLU_x + bA0_dot_B0;
190 if ((UA1_ux > b[0]) && (UB1_ux > a[0])) {
191 if (((UA1_lx > b[0]) ||
192 inVoronoi(b[1], a[1], A1_dot_B0, aA0_dot_B0 - b[0] - Tba[0], A1_dot_B1,
193 aA0_dot_B1 - Tba[1], -Tab[1] - bA1_dot_B0)) &&
195 inVoronoi(a[1], b[1], A0_dot_B1, Tab[0] + bA0_dot_B0 - a[0], A1_dot_B1,
196 Tab[1] + bA1_dot_B0, Tba[1] - aA0_dot_B1))) {
197 segCoords(t, u, a[1], b[1], A1_dot_B1, Tab[1] + bA1_dot_B0,
198 Tba[1] - aA0_dot_B1);
200 S[0] = Tab[0] + Rab(0, 0) * b[0] + Rab(0, 1) * u - a[0];
201 S[1] = Tab[1] + Rab(1, 0) * b[0] + Rab(1, 1) * u - t;
202 S[2] = Tab[2] + Rab(2, 0) * b[0] + Rab(2, 1) * u;
215 if ((UA1_lx < 0) && (LB1_ux > a[0])) {
216 if (((UA1_ux < 0) ||
inVoronoi(b[1], a[1], -A1_dot_B0, Tba[0] - aA0_dot_B0,
217 A1_dot_B1, aA0_dot_B1 - Tba[1], -Tab[1])) &&
219 inVoronoi(a[1], b[1], A0_dot_B1, Tab[0] - a[0], A1_dot_B1, Tab[1],
220 Tba[1] - aA0_dot_B1))) {
221 segCoords(t, u, a[1], b[1], A1_dot_B1, Tab[1], Tba[1] - aA0_dot_B1);
223 S[0] = Tab[0] + Rab(0, 1) * u - a[0];
224 S[1] = Tab[1] + Rab(1, 1) * u - t;
225 S[2] = Tab[2] + Rab(2, 1) * u;
238 if ((LA1_ux > b[0]) && (UB1_lx < 0)) {
239 if (((LA1_lx > b[0]) ||
240 inVoronoi(b[1], a[1], A1_dot_B0, -Tba[0] - b[0], A1_dot_B1, -Tba[1],
241 -Tab[1] - bA1_dot_B0)) &&
242 ((UB1_ux < 0) ||
inVoronoi(a[1], b[1], -A0_dot_B1, -Tab[0] - bA0_dot_B0,
243 A1_dot_B1, Tab[1] + bA1_dot_B0, Tba[1]))) {
244 segCoords(t, u, a[1], b[1], A1_dot_B1, Tab[1] + bA1_dot_B0, Tba[1]);
246 S[0] = Tab[0] + Rab(0, 0) * b[0] + Rab(0, 1) * u;
247 S[1] = Tab[1] + Rab(1, 0) * b[0] + Rab(1, 1) * u - t;
248 S[2] = Tab[2] + Rab(2, 0) * b[0] + Rab(2, 1) * u;
261 if ((LA1_lx < 0) && (LB1_lx < 0)) {
262 if (((LA1_ux < 0) ||
inVoronoi(b[1], a[1], -A1_dot_B0, Tba[0], A1_dot_B1,
263 -Tba[1], -Tab[1])) &&
264 ((LB1_ux < 0) ||
inVoronoi(a[1], b[1], -A0_dot_B1, -Tab[0], A1_dot_B1,
266 segCoords(t, u, a[1], b[1], A1_dot_B1, Tab[1], Tba[1]);
268 S[0] = Tab[0] + Rab(0, 1) * u;
269 S[1] = Tab[1] + Rab(1, 1) * u - t;
270 S[2] = Tab[2] + Rab(2, 1) * u;
281 FCL_REAL ALL_y, ALU_y, AUL_y, AUU_y;
284 ALU_y = ALL_y + aA1_dot_B1;
285 AUL_y = ALL_y + aA0_dot_B1;
286 AUU_y = ALU_y + aA0_dot_B1;
288 FCL_REAL LA1_ly, LA1_uy, UA1_ly, UA1_uy, LB0_lx, LB0_ux, UB0_lx, UB0_ux;
316 if ((UA1_uy > b[1]) && (UB0_ux > a[0])) {
317 if (((UA1_ly > b[1]) ||
318 inVoronoi(b[0], a[1], A1_dot_B1, aA0_dot_B1 - Tba[1] - b[1], A1_dot_B0,
319 aA0_dot_B0 - Tba[0], -Tab[1] - bA1_dot_B1)) &&
321 inVoronoi(a[1], b[0], A0_dot_B0, Tab[0] - a[0] + bA0_dot_B1, A1_dot_B0,
322 Tab[1] + bA1_dot_B1, Tba[0] - aA0_dot_B0))) {
323 segCoords(t, u, a[1], b[0], A1_dot_B0, Tab[1] + bA1_dot_B1,
324 Tba[0] - aA0_dot_B0);
326 S[0] = Tab[0] + Rab(0, 1) * b[1] + Rab(0, 0) * u - a[0];
327 S[1] = Tab[1] + Rab(1, 1) * b[1] + Rab(1, 0) * u - t;
328 S[2] = Tab[2] + Rab(2, 1) * b[1] + Rab(2, 0) * u;
341 if ((UA1_ly < 0) && (LB0_ux > a[0])) {
342 if (((UA1_uy < 0) ||
inVoronoi(b[0], a[1], -A1_dot_B1, Tba[1] - aA0_dot_B1,
343 A1_dot_B0, aA0_dot_B0 - Tba[0], -Tab[1])) &&
345 inVoronoi(a[1], b[0], A0_dot_B0, Tab[0] - a[0], A1_dot_B0, Tab[1],
346 Tba[0] - aA0_dot_B0))) {
347 segCoords(t, u, a[1], b[0], A1_dot_B0, Tab[1], Tba[0] - aA0_dot_B0);
349 S[0] = Tab[0] + Rab(0, 0) * u - a[0];
350 S[1] = Tab[1] + Rab(1, 0) * u - t;
351 S[2] = Tab[2] + Rab(2, 0) * u;
364 if ((LA1_uy > b[1]) && (UB0_lx < 0)) {
365 if (((LA1_ly > b[1]) ||
366 inVoronoi(b[0], a[1], A1_dot_B1, -Tba[1] - b[1], A1_dot_B0, -Tba[0],
367 -Tab[1] - bA1_dot_B1)) &&
369 ((UB0_ux < 0) ||
inVoronoi(a[1], b[0], -A0_dot_B0, -Tab[0] - bA0_dot_B1,
370 A1_dot_B0, Tab[1] + bA1_dot_B1, Tba[0]))) {
371 segCoords(t, u, a[1], b[0], A1_dot_B0, Tab[1] + bA1_dot_B1, Tba[0]);
373 S[0] = Tab[0] + Rab(0, 1) * b[1] + Rab(0, 0) * u;
374 S[1] = Tab[1] + Rab(1, 1) * b[1] + Rab(1, 0) * u - t;
375 S[2] = Tab[2] + Rab(2, 1) * b[1] + Rab(2, 0) * u;
388 if ((LA1_ly < 0) && (LB0_lx < 0)) {
389 if (((LA1_uy < 0) ||
inVoronoi(b[0], a[1], -A1_dot_B1, Tba[1], A1_dot_B0,
390 -Tba[0], -Tab[1])) &&
391 ((LB0_ux < 0) ||
inVoronoi(a[1], b[0], -A0_dot_B0, -Tab[0], A1_dot_B0,
393 segCoords(t, u, a[1], b[0], A1_dot_B0, Tab[1], Tba[0]);
395 S[0] = Tab[0] + Rab(0, 0) * u;
396 S[1] = Tab[1] + Rab(1, 0) * u - t;
397 S[2] = Tab[2] + Rab(2, 0) * u;
408 FCL_REAL BLL_y, BLU_y, BUL_y, BUU_y;
411 BLU_y = BLL_y + bA1_dot_B1;
412 BUL_y = BLL_y + bA1_dot_B0;
413 BUU_y = BLU_y + bA1_dot_B0;
415 FCL_REAL LA0_lx, LA0_ux, UA0_lx, UA0_ux, LB1_ly, LB1_uy, UB1_ly, UB1_uy;
443 if ((UA0_ux > b[0]) && (UB1_uy > a[1])) {
444 if (((UA0_lx > b[0]) ||
445 inVoronoi(b[1], a[0], A0_dot_B0, aA1_dot_B0 - Tba[0] - b[0], A0_dot_B1,
446 aA1_dot_B1 - Tba[1], -Tab[0] - bA0_dot_B0)) &&
448 inVoronoi(a[0], b[1], A1_dot_B1, Tab[1] - a[1] + bA1_dot_B0, A0_dot_B1,
449 Tab[0] + bA0_dot_B0, Tba[1] - aA1_dot_B1))) {
450 segCoords(t, u, a[0], b[1], A0_dot_B1, Tab[0] + bA0_dot_B0,
451 Tba[1] - aA1_dot_B1);
453 S[0] = Tab[0] + Rab(0, 0) * b[0] + Rab(0, 1) * u - t;
454 S[1] = Tab[1] + Rab(1, 0) * b[0] + Rab(1, 1) * u - a[1];
455 S[2] = Tab[2] + Rab(2, 0) * b[0] + Rab(2, 1) * u;
468 if ((UA0_lx < 0) && (LB1_uy > a[1])) {
469 if (((UA0_ux < 0) ||
inVoronoi(b[1], a[0], -A0_dot_B0, Tba[0] - aA1_dot_B0,
470 A0_dot_B1, aA1_dot_B1 - Tba[1], -Tab[0])) &&
472 inVoronoi(a[0], b[1], A1_dot_B1, Tab[1] - a[1], A0_dot_B1, Tab[0],
473 Tba[1] - aA1_dot_B1))) {
474 segCoords(t, u, a[0], b[1], A0_dot_B1, Tab[0], Tba[1] - aA1_dot_B1);
476 S[0] = Tab[0] + Rab(0, 1) * u - t;
477 S[1] = Tab[1] + Rab(1, 1) * u - a[1];
478 S[2] = Tab[2] + Rab(2, 1) * u;
491 if ((LA0_ux > b[0]) && (UB1_ly < 0)) {
492 if (((LA0_lx > b[0]) ||
493 inVoronoi(b[1], a[0], A0_dot_B0, -b[0] - Tba[0], A0_dot_B1, -Tba[1],
494 -bA0_dot_B0 - Tab[0])) &&
495 ((UB1_uy < 0) ||
inVoronoi(a[0], b[1], -A1_dot_B1, -Tab[1] - bA1_dot_B0,
496 A0_dot_B1, Tab[0] + bA0_dot_B0, Tba[1]))) {
497 segCoords(t, u, a[0], b[1], A0_dot_B1, Tab[0] + bA0_dot_B0, Tba[1]);
499 S[0] = Tab[0] + Rab(0, 0) * b[0] + Rab(0, 1) * u - t;
500 S[1] = Tab[1] + Rab(1, 0) * b[0] + Rab(1, 1) * u;
501 S[2] = Tab[2] + Rab(2, 0) * b[0] + Rab(2, 1) * u;
514 if ((LA0_lx < 0) && (LB1_ly < 0)) {
515 if (((LA0_ux < 0) ||
inVoronoi(b[1], a[0], -A0_dot_B0, Tba[0], A0_dot_B1,
516 -Tba[1], -Tab[0])) &&
517 ((LB1_uy < 0) ||
inVoronoi(a[0], b[1], -A1_dot_B1, -Tab[1], A0_dot_B1,
519 segCoords(t, u, a[0], b[1], A0_dot_B1, Tab[0], Tba[1]);
521 S[0] = Tab[0] + Rab(0, 1) * u - t;
522 S[1] = Tab[1] + Rab(1, 1) * u;
523 S[2] = Tab[2] + Rab(2, 1) * u;
534 FCL_REAL LA0_ly, LA0_uy, UA0_ly, UA0_uy, LB0_ly, LB0_uy, UB0_ly, UB0_uy;
562 if ((UA0_uy > b[1]) && (UB0_uy > a[1])) {
563 if (((UA0_ly > b[1]) ||
564 inVoronoi(b[0], a[0], A0_dot_B1, aA1_dot_B1 - Tba[1] - b[1], A0_dot_B0,
565 aA1_dot_B0 - Tba[0], -Tab[0] - bA0_dot_B1)) &&
567 inVoronoi(a[0], b[0], A1_dot_B0, Tab[1] - a[1] + bA1_dot_B1, A0_dot_B0,
568 Tab[0] + bA0_dot_B1, Tba[0] - aA1_dot_B0))) {
569 segCoords(t, u, a[0], b[0], A0_dot_B0, Tab[0] + bA0_dot_B1,
570 Tba[0] - aA1_dot_B0);
572 S[0] = Tab[0] + Rab(0, 1) * b[1] + Rab(0, 0) * u - t;
573 S[1] = Tab[1] + Rab(1, 1) * b[1] + Rab(1, 0) * u - a[1];
574 S[2] = Tab[2] + Rab(2, 1) * b[1] + Rab(2, 0) * u;
587 if ((UA0_ly < 0) && (LB0_uy > a[1])) {
588 if (((UA0_uy < 0) ||
inVoronoi(b[0], a[0], -A0_dot_B1, Tba[1] - aA1_dot_B1,
589 A0_dot_B0, aA1_dot_B0 - Tba[0], -Tab[0])) &&
591 inVoronoi(a[0], b[0], A1_dot_B0, Tab[1] - a[1], A0_dot_B0, Tab[0],
592 Tba[0] - aA1_dot_B0))) {
593 segCoords(t, u, a[0], b[0], A0_dot_B0, Tab[0], Tba[0] - aA1_dot_B0);
595 S[0] = Tab[0] + Rab(0, 0) * u - t;
596 S[1] = Tab[1] + Rab(1, 0) * u - a[1];
597 S[2] = Tab[2] + Rab(2, 0) * u;
610 if ((LA0_uy > b[1]) && (UB0_ly < 0)) {
611 if (((LA0_ly > b[1]) ||
612 inVoronoi(b[0], a[0], A0_dot_B1, -Tba[1] - b[1], A0_dot_B0, -Tba[0],
613 -Tab[0] - bA0_dot_B1)) &&
615 ((UB0_uy < 0) ||
inVoronoi(a[0], b[0], -A1_dot_B0, -Tab[1] - bA1_dot_B1,
616 A0_dot_B0, Tab[0] + bA0_dot_B1, Tba[0]))) {
617 segCoords(t, u, a[0], b[0], A0_dot_B0, Tab[0] + bA0_dot_B1, Tba[0]);
619 S[0] = Tab[0] + Rab(0, 1) * b[1] + Rab(0, 0) * u - t;
620 S[1] = Tab[1] + Rab(1, 1) * b[1] + Rab(1, 0) * u;
621 S[2] = Tab[2] + Rab(2, 1) * b[1] + Rab(2, 0) * u;
634 if ((LA0_ly < 0) && (LB0_ly < 0)) {
635 if (((LA0_uy < 0) ||
inVoronoi(b[0], a[0], -A0_dot_B1, Tba[1], A0_dot_B0,
636 -Tba[0], -Tab[0])) &&
637 ((LB0_uy < 0) ||
inVoronoi(a[0], b[0], -A1_dot_B0, -Tab[1], A0_dot_B0,
639 segCoords(t, u, a[0], b[0], A0_dot_B0, Tab[0], Tba[0]);
641 S[0] = Tab[0] + Rab(0, 0) * u - t;
642 S[1] = Tab[1] + Rab(1, 0) * u;
643 S[2] = Tab[2] + Rab(2, 0) * u;
660 if (Rab(2, 0) < 0.0) sep1 += b[0] * Rab(2, 0);
661 if (Rab(2, 1) < 0.0) sep1 += b[1] * Rab(2, 1);
664 if (Rab(2, 0) > 0.0) sep1 -= b[0] * Rab(2, 0);
665 if (Rab(2, 1) > 0.0) sep1 -= b[1] * Rab(2, 1);
670 if (Rab(0, 2) < 0.0) sep2 += a[0] * Rab(0, 2);
671 if (Rab(1, 2) < 0.0) sep2 += a[1] * Rab(1, 2);
674 if (Rab(0, 2) > 0.0) sep2 -= a[0] * Rab(0, 2);
675 if (Rab(1, 2) > 0.0) sep2 -= a[1] * Rab(1, 2);
678 if (sep1 >= sep2 && sep1 >= 0) {
690 if (sep2 >= sep1 && sep2 >= 0) {
691 Vec3f Q_(Tab[0], Tab[1], Tab[2]);
694 P_[0] = Rab(0, 2) * sep2 + Tab[0];
695 P_[1] = Rab(1, 2) * sep2 + Tab[1];
696 P_[2] = Rab(2, 2) * sep2 + Tab[2];
698 P_[0] = -Rab(0, 2) * sep2 + Tab[0];
699 P_[1] = -Rab(1, 2) * sep2 + Tab[1];
700 P_[2] = -Rab(2, 2) * sep2 + Tab[2];
712 return (sep > 0 ? sep : 0);
737 Vec3f Ttemp(R0.transpose() * (b2.
Tr - T0) - b1.
Tr);
752 Vec3f Ttemp(R0.transpose() * (b2.
Tr - T0) - b1.
Tr);
758 if (dist <= 0)
return true;
759 sqrDistLowerBound = dist * dist;
770 Vec3f proj(proj0, proj1, proj2);
773 if ((proj0 <
length[0]) && (proj0 > 0) && (proj1 <
length[1]) &&
775 return (abs_proj2 <
radius);
776 }
else if ((proj0 <
length[0]) && (proj0 > 0) &&
777 ((proj1 < 0) || (proj1 >
length[1]))) {
781 }
else if ((proj1 <
length[1]) && (proj1 > 0) &&
782 ((proj0 < 0) || (proj0 >
length[0]))) {
800 Vec3f proj(proj0, proj1, proj2);
803 if ((proj0 <
length[0]) && (proj0 > 0) && (proj1 <
length[1]) &&
811 Tr[2] += 0.5 * (abs_proj2 -
radius);
813 Tr[2] -= 0.5 * (abs_proj2 -
radius);
815 }
else if ((proj0 <
length[0]) && (proj0 > 0) &&
816 ((proj1 < 0) || (proj1 >
length[1]))) {
819 FCL_REAL new_r_sqr = (proj -
v).squaredNorm();
823 if (abs_proj2 < radius) {
825 -std::sqrt(radius * radius - proj2 * proj2) + fabs(proj1 - y);
827 if (proj1 < 0) Tr[1] -= delta_y;
831 if (proj1 < 0) Tr[1] -= delta_y;
834 Tr[2] += 0.5 * (abs_proj2 -
radius);
836 Tr[2] -= 0.5 * (abs_proj2 -
radius);
839 }
else if ((proj1 <
length[1]) && (proj1 > 0) &&
840 ((proj0 < 0) || (proj0 >
length[0]))) {
843 FCL_REAL new_r_sqr = (proj -
v).squaredNorm();
847 if (abs_proj2 < radius) {
849 -std::sqrt(radius * radius - proj2 * proj2) + fabs(proj0 - x);
851 if (proj0 < 0) Tr[0] -= delta_x;
855 if (proj0 < 0) Tr[0] -= delta_x;
858 Tr[2] += 0.5 * (abs_proj2 -
radius);
860 Tr[2] -= 0.5 * (abs_proj2 -
radius);
867 FCL_REAL new_r_sqr = (proj -
v).squaredNorm();
871 if (abs_proj2 < radius) {
872 FCL_REAL diag = std::sqrt(new_r_sqr - proj2 * proj2);
874 -std::sqrt(radius * radius - proj2 * proj2) + diag;
876 FCL_REAL delta_x = delta_diag / diag * fabs(proj0 - x);
877 FCL_REAL delta_y = delta_diag / diag * fabs(proj1 - y);
881 if (proj0 < 0 && proj1 < 0) {
892 if (proj0 < 0 && proj1 < 0) {
898 Tr[2] += 0.5 * (abs_proj2 -
radius);
900 Tr[2] -= 0.5 * (abs_proj2 -
radius);
919 v[0].noalias() = other.
Tr + d0_pos + d1_pos + d2_pos;
920 v[1].noalias() = other.
Tr + d0_pos + d1_pos + d2_neg;
921 v[2].noalias() = other.
Tr + d0_pos + d1_neg + d2_pos;
922 v[3].noalias() = other.
Tr + d0_pos + d1_neg + d2_neg;
923 v[4].noalias() = other.
Tr + d0_neg + d1_pos + d2_pos;
924 v[5].noalias() = other.
Tr + d0_neg + d1_pos + d2_neg;
925 v[6].noalias() = other.
Tr + d0_neg + d1_neg + d2_pos;
926 v[7].noalias() = other.
Tr + d0_neg + d1_neg + d2_neg;
935 v[8].noalias() =
Tr + d0_pos + d1_pos + d2_pos;
936 v[9].noalias() =
Tr + d0_pos + d1_pos + d2_neg;
937 v[10].noalias() =
Tr + d0_pos + d1_neg + d2_pos;
938 v[11].noalias() =
Tr + d0_pos + d1_neg + d2_neg;
939 v[12].noalias() =
Tr + d0_neg + d1_pos + d2_pos;
940 v[13].noalias() =
Tr + d0_neg + d1_pos + d2_neg;
941 v[14].noalias() =
Tr + d0_neg + d1_neg + d2_pos;
942 v[15].noalias() =
Tr + d0_neg + d1_neg + d2_neg;
946 Matrix3f::Scalar s[3] = {0, 0, 0};
962 }
else if (s[2] > s[max]) {
970 bv.
axes.col(0) << E[0][max], E[1][max], E[2][max];
971 bv.
axes.col(1) << E[0][mid], E[1][mid], E[2][mid];
972 bv.
axes.col(2) << E[1][max] * E[2][mid] - E[1][mid] * E[2][max],
973 E[0][mid] * E[2][max] - E[0][max] * E[2][mid],
974 E[0][max] * E[1][mid] - E[0][mid] * E[1][max];
bool contain(const Vec3f &p) const
Check whether the RSS contains a point.
void clipToRange(FCL_REAL &val, FCL_REAL a, FCL_REAL b)
Clip value between a and b.
Matrix3f axes
Orientation of RSS. axis[i] is the ith column of the orientation matrix for the RSS; it is also the i...
RSS & operator+=(const Vec3f &p)
A simple way to merge the RSS and a point, not compact.
Eigen::Matrix< FCL_REAL, 3, 3 > Matrix3f
void eigen(const Eigen::MatrixBase< Derived > &m, typename Derived::Scalar dout[3], Vector *vout)
compute the eigen vector and eigen vector of a matrix. dout is the eigen values, vout is the eigen ve...
HPP_FCL_DLLAPI void getRadiusAndOriginAndRectangleSize(Vec3f *ps, Vec3f *ps2, Triangle *ts, unsigned int *indices, unsigned int n, const Matrix3f &axes, Vec3f &origin, FCL_REAL l[2], FCL_REAL &r)
Compute the RSS bounding volume parameters: radius, rectangle size and the origin, given the BV axises.
void segCoords(FCL_REAL &t, FCL_REAL &u, FCL_REAL a, FCL_REAL b, FCL_REAL A_dot_B, FCL_REAL A_dot_T, FCL_REAL B_dot_T)
Finds the parameters t & u corresponding to the two closest points on a pair of line segments. The first segment is defined as Pa + A*t, 0 <= t <= a, where "Pa" is one endpoint of the segment, "A" is a unit vector pointing to the other endpoint, and t is a scalar that produces all the points between the two endpoints. Since "A" is a unit vector, "a" is the segment's length. The second segment is defined as Pb + B*u, 0 <= u <= b. Many of the terms needed by the algorithm are already computed for other purposes,so we just pass these terms into the function instead of complete specifications of each segment. "T" in the dot products is the vector betweeen Pa and Pb. Reference: "On fast computation of distance between line segments." Vladimir J. Lumelsky, in Information Processing Letters, no. 21, pages 55-61, 1985.
request to the collision algorithm
RSS operator+(const RSS &other) const
Return the merged RSS of current RSS and the other one.
HPP_FCL_DLLAPI void getCovariance(Vec3f *ps, Vec3f *ps2, Triangle *ts, unsigned int *indices, unsigned int n, Matrix3f &M)
Compute the covariance matrix for a set or subset of points. if ts = null, then indices refer to poin...
Vec3f Tr
Origin of the rectangle in RSS.
static AABB translate(const AABB &aabb, const Vec3f &t)
translate the center of AABB by t
bool overlap(const RSS &other) const
Check collision between two RSS.
FCL_REAL radius
Radius of sphere summed with rectangle to form RSS.
FCL_REAL distance(const RSS &other, Vec3f *P=NULL, Vec3f *Q=NULL) const
the distance between two RSS; P and Q, if not NULL, return the nearest points
bool inVoronoi(FCL_REAL a, FCL_REAL b, FCL_REAL Anorm_dot_B, FCL_REAL Anorm_dot_T, FCL_REAL A_dot_B, FCL_REAL A_dot_T, FCL_REAL B_dot_T)
Returns whether the nearest point on rectangle edge Pb + B*u, 0 <= u <= b, to the rectangle edge...
FCL_REAL length[2]
Side lengths of rectangle.
Eigen::Matrix< FCL_REAL, 3, 1 > Vec3f
FCL_REAL rectDistance(const Matrix3f &Rab, Vec3f const &Tab, const FCL_REAL a[2], const FCL_REAL b[2], Vec3f *P=NULL, Vec3f *Q=NULL)
Distance between two oriented rectangles; P and Q (optional return values) are the closest points in ...
FCL_REAL security_margin
Distance below which objects are considered in collision. See Collision.