65 static std::array<S, 6> static_extents{ {0, 0, 0, 10, 10, 10} };
66 return static_extents;
73 return static_solver1;
80 return static_solver2;
100 const auto volume = 4.0 / 3.0 * pi * radius * radius * radius;
107 test_sphere_shape<double>();
110 template <
typename S>
123 S dt = 1.0 / (N - 1);
128 std::vector<bool> result1(N);
129 for(
int i = 0; i < N; ++i)
147 std::vector<bool> result2(N);
149 for(
int i = 0; i < N; ++i)
165 for(std::size_t i = 0; i < result1.size(); ++i)
174 test_gjkcache<double>();
177 template <
typename Shape1,
typename Shape2>
184 bool check_opposite_normal,
185 typename Shape1::S tol)
187 std::cout <<
"Disagreement between " << comparison_type
188 <<
" and expected_" << comparison_type <<
" for "
192 <<
"tf1.linear: \n" << tf1.linear() << std::endl
193 <<
"tf1.translation: " << tf1.translation().transpose() << std::endl
194 <<
"tf2.linear: \n" << tf2.linear() << std::endl
195 <<
"tf2.translation: " << tf2.translation().transpose() << std::endl
196 <<
"expected_" << comparison_type <<
": " << expected_contact_or_normal
197 <<
"actual_" << comparison_type <<
" : " << actual_contact_or_normal << std::endl;
199 if (check_opposite_normal)
200 std::cout <<
" or " << -expected_contact_or_normal;
202 std::cout << std::endl
203 <<
"difference: " << (actual_contact_or_normal - expected_contact_or_normal).norm() << std::endl
204 <<
"tolerance: " << tol << std::endl;
207 template <
typename Shape1,
typename Shape2>
213 typename Shape1::S actual_depth,
214 typename Shape1::S tol)
216 std::cout <<
"Disagreement between " << comparison_type
217 <<
" and expected_" << comparison_type <<
" for "
221 <<
"tf1.linear: \n" << tf1.linear() << std::endl
222 <<
"tf1.translation: " << tf1.translation().transpose() << std::endl
223 <<
"tf2.linear: \n" << tf2.linear() << std::endl
224 <<
"tf2.translation: " << tf2.translation().transpose() << std::endl
226 <<
"actual_depth : " << actual_depth << std::endl
227 <<
"difference: " << std::abs(actual_depth -
expected_depth) << std::endl
228 <<
"tolerance: " << tol << std::endl;
231 template <
typename Shape1,
typename Shape2>
236 bool check_position =
false,
237 bool check_depth =
false,
238 bool check_normal =
false,
239 bool check_opposite_normal =
false,
240 typename Shape1::S tol = 1e-9)
250 bool contact_equal = actual.
pos.isApprox(expected.
pos, tol);
264 bool normal_equal = actual.
normal.isApprox(expected.
normal, tol);
266 if (!normal_equal && check_opposite_normal)
267 normal_equal = actual.
normal.isApprox(-expected.
normal, tol);
276 template <
typename Shape1,
typename Shape2>
282 bool check_position =
false,
283 bool check_depth =
false,
284 bool check_normal =
false,
285 bool check_opposite_normal =
false,
286 typename Shape1::S tol = 1e-9)
288 using S =
typename Shape1::S;
291 bool sameNumContacts = (actual_contacts.size() == expected_contacts.size());
293 if (!sameNumContacts)
296 <<
"===== [ geometric shape collision test failure report ] ======\n"
302 <<
"tf1.linear : \n" << tf1.linear() <<
"\n"
303 <<
"tf1.translation: " << tf1.translation().transpose() <<
"\n"
307 <<
"tf2.linear : \n" << tf2.linear() <<
"\n"
308 <<
"tf2.translation: " << tf2.translation().transpose() <<
"\n"
310 <<
"The numbers of expected contacts '"
311 << expected_contacts.size()
312 <<
"' and the number of actual contacts '"
313 << actual_contacts.size()
314 <<
"' are not equal.\n"
320 const size_t numContacts = actual_contacts.size();
322 std::vector<int> index_to_actual_contacts(numContacts, -1);
323 std::vector<int> index_to_expected_contacts(numContacts, -1);
325 bool foundAll =
true;
326 for (
size_t i = 0; i < numContacts; ++i)
331 for (
size_t j = 0; j < numContacts; ++j)
333 if (index_to_expected_contacts[j] != -1)
339 s1, tf1, s2, tf2, solver_type,
343 check_normal, check_opposite_normal,
348 index_to_actual_contacts[i] = j;
349 index_to_expected_contacts[j] = i;
354 if (index_to_actual_contacts[i] == -1)
361 <<
"===== [ geometric shape collision test failure report ] ======\n"
367 <<
"tf1.linear : \n" << tf1.linear() <<
"\n"
368 <<
"tf1.translation: " << tf1.translation().transpose() <<
"\n"
372 <<
"tf2.linear : \n" << tf2.linear() <<
"\n"
373 <<
"tf2.translation: " << tf2.translation().transpose() <<
"\n"
375 <<
"[ Expected Contacts: " << numContacts <<
" ]\n";
376 for (
size_t i = 0; i < numContacts; ++i)
380 std::cout <<
"(" << i <<
") pos: " << expected.
pos.transpose() <<
", "
381 <<
"normal: " << expected.
normal.transpose() <<
", "
384 if (index_to_actual_contacts[i] != -1)
385 std::cout <<
"found, actual (" << index_to_actual_contacts[i] <<
")\n";
387 std::cout <<
"not found!\n";
390 <<
"[ Actual Contacts: " << numContacts <<
" ]\n";
391 for (
size_t i = 0; i < numContacts; ++i)
395 std::cout <<
"(" << i <<
") pos: " << actual.
pos.transpose() <<
", "
396 <<
"normal: " << actual.
normal.transpose() <<
", "
399 if (index_to_expected_contacts[i] != -1)
400 std::cout <<
"found, expected (" << index_to_expected_contacts[i] <<
")\n";
402 std::cout <<
"not found!\n";
411 template <
typename S>
415 contacts.resize(numContacts);
417 for (
size_t i = 0; i < numContacts; ++i)
421 contacts[i].pos = cnt.pos;
422 contacts[i].normal = cnt.normal;
423 contacts[i].penetration_depth = cnt.penetration_depth;
427 template <
typename Shape1,
typename Shape2>
434 bool check_position =
true,
435 bool check_depth =
true,
436 bool check_normal =
true,
437 bool check_opposite_normal =
false,
438 typename Shape1::S tol = 1e-9)
440 using S =
typename Shape1::S;
447 std::vector<ContactPoint<S>> actual_contacts;
456 res = solver1<S>().shapeIntersect(s1, tf1, s2, tf2,
nullptr);
460 res = solver2<S>().shapeIntersect(s1, tf1, s2, tf2,
nullptr);
464 std::cerr <<
"Invalid GJK solver. Test aborted." << std::endl;
472 res = solver1<S>().shapeIntersect(s1, tf1, s2, tf2, &actual_contacts);
476 res = solver2<S>().shapeIntersect(s1, tf1, s2, tf2, &actual_contacts);
480 std::cerr <<
"Invalid GJK solver. Test aborted." << std::endl;
487 expected_contacts, actual_contacts,
490 check_normal, check_opposite_normal,
499 res = (
collide(&s1, tf1, &s2, tf2, request, result) > 0);
505 res = (
collide(&s1, tf1, &s2, tf2, request, result) > 0);
511 expected_contacts, actual_contacts,
514 check_normal, check_opposite_normal,
543 template <
typename S>
555 std::vector<ContactPoint<S>> contacts;
568 contacts[0].normal << 1, 0, 0;
569 contacts[0].pos << 20, 0, 0;
570 contacts[0].penetration_depth = 0.0;
584 contacts[0].normal << 1, 0, 0;
585 contacts[0].pos << 20.0 - 0.1 * 20.0/(20.0 + 10.0), 0, 0;
586 contacts[0].penetration_depth = 0.1;
594 contacts[0].penetration_depth = 0.1;
600 contacts[0].normal.setZero();
601 contacts[0].pos.setZero();
602 contacts[0].penetration_depth = 20.0 + 10.0;
608 contacts[0].normal.setZero();
610 contacts[0].penetration_depth = 20.0 + 10.0;
616 contacts[0].normal << -1, 0, 0;
617 contacts[0].pos << -20.0 + 0.1 * 20.0/(20.0 + 10.0), 0, 0;
618 contacts[0].penetration_depth = 0.1;
626 contacts[0].penetration_depth = 0.1;
632 contacts[0].normal << -1, 0, 0;
633 contacts[0].pos << -20, 0, 0;
634 contacts[0].penetration_depth = 0.0;
646 GTEST_TEST(FCL_GEOMETRIC_SHAPES, shapeIntersection_spheresphere)
649 test_shapeIntersection_spheresphere<double>();
652 template <
typename S>
655 return c1[2] < c2[2];
658 template <
typename S>
661 return cp1.
pos[2] < cp2.
pos[2];
688 template <
typename Derived>
691 using S =
typename Derived::RealScalar;
697 std::vector<Vector3<S>> vertices(8);
698 vertices[0] << 1, 1, 1;
699 vertices[1] << 1, 1, -1;
700 vertices[2] << 1, -1, 1;
701 vertices[3] << 1, -1, -1;
702 vertices[4] << -1, 1, 1;
703 vertices[5] << -1, 1, -1;
704 vertices[6] << -1, -1, 1;
705 vertices[7] << -1, -1, -1;
707 for (
int i = 0; i < 8; ++i)
709 vertices[i][0] *= 0.5 * s2.
side[0];
710 vertices[i][1] *= 0.5 * s2.
side[1];
711 vertices[i][2] *= 0.5 * s2.
side[2];
717 std::vector<ContactPoint<S>> contacts;
720 bool res = solver1<S>().shapeIntersect(s1, tf1, s2, tf2, &contacts);
724 for (
int i = 0; i < 8; ++i)
725 vertices[i] = tf2 * vertices[i];
728 std::sort(vertices.begin(), vertices.end(), compareContactPointds1<S>);
729 std::sort(contacts.begin(), contacts.end(), compareContactPointds2<S>);
732 size_t numContacts = contacts.size();
733 numContacts =
std::min(
static_cast<size_t>(1), numContacts);
736 for (
size_t i = 0; i < numContacts; ++i)
743 <<
"\n\tExpected: " << contact_pos
744 <<
"\n\tFound: " << contacts[i].pos;
749 template <
typename S>
761 std::vector<ContactPoint<S>> contacts;
769 contacts[0].normal << 1, 0, 0;
770 contacts[1].normal << 1, 0, 0;
771 contacts[2].normal << 1, 0, 0;
772 contacts[3].normal << 1, 0, 0;
817 #if !defined(FCL_OS_MACOS) || !defined(NDEBUG)
819 for (
uint32 i = 0; i < numTests; ++i)
831 test_shapeIntersection_boxbox<double>();
834 template <
typename S>
838 const bool collides =
true;
839 const bool check_position =
true;
840 const bool check_depth =
true;
841 const bool check_normal =
true;
842 const bool check_opposite_normal =
false;
853 std::vector<ContactPoint<S>> contacts;
862 contacts[0].normal << -1, 0, 0;
864 !check_position, !check_depth, check_normal);
870 !check_position, !check_depth, !check_normal);
877 !check_position, !check_depth, !check_normal);
886 contacts[0].normal << 1, 0, 0;
888 !check_position, !check_depth, check_normal);
895 !check_position, !check_depth, check_normal,
896 !check_opposite_normal, 1e-4);
899 GTEST_TEST(FCL_GEOMETRIC_SHAPES, shapeIntersection_spherebox)
902 test_shapeIntersection_spherebox<double>();
905 template <
typename S>
917 std::vector<ContactPoint<S>> contacts;
934 contacts[0].normal << 1, 0, 0;
946 contacts[0].normal << 1, 0, 0;
965 GTEST_TEST(FCL_GEOMETRIC_SHAPES, shapeIntersection_spherecapsule)
968 test_shapeIntersection_spherecapsule<double>();
971 template <
typename S>
983 std::vector<ContactPoint<S>> contacts;
1000 contacts[0].normal << 1, 0, 0;
1004 #if !defined(FCL_OS_MACOS) || !defined(NDEBUG)
1009 testShapeIntersection(s1, tf1, s2, tf2,
GST_LIBCCD,
true, contacts,
false,
false,
true,
false, 1e-5);
1021 GTEST_TEST(FCL_GEOMETRIC_SHAPES, shapeIntersection_cylindercylinder)
1024 test_shapeIntersection_cylindercylinder<double>();
1027 template <
typename S>
1039 std::vector<ContactPoint<S>> contacts;
1056 contacts[0].normal << 1, 0, 0;
1063 testShapeIntersection(s1, tf1, s2, tf2,
GST_LIBCCD,
true, contacts,
false,
false,
true,
false, 5e-5);
1076 contacts[0].normal << 0, 0, 1;
1083 testShapeIntersection(s1, tf1, s2, tf2,
GST_LIBCCD,
true, contacts,
false,
false,
true,
false, 1e-5);
1089 test_shapeIntersection_conecone<double>();
1092 template <
typename S>
1104 std::vector<ContactPoint<S>> contacts;
1121 contacts[0].normal << 1, 0, 0;
1122 testShapeIntersection(s1, tf1, s2, tf2,
GST_LIBCCD,
true, contacts,
false,
false,
true,
false, 0.061);
1128 testShapeIntersection(s1, tf1, s2, tf2,
GST_LIBCCD,
true, contacts,
false,
false,
true,
false, 0.46);
1141 contacts[0].normal << 0, 0, 1;
1148 testShapeIntersection(s1, tf1, s2, tf2,
GST_LIBCCD,
true, contacts,
false,
false,
true,
false, 1e-4);
1162 test_shapeIntersection_cylindercone<double>();
1165 template <
typename S>
1178 std::vector<ContactPoint<S>> contacts;
1235 GTEST_TEST(FCL_GEOMETRIC_SHAPES, shapeIntersection_ellipsoidellipsoid)
1238 test_shapeIntersection_ellipsoidellipsoid<double>();
1241 template <
typename S>
1256 res = solver1<S>().shapeTriangleIntersect(s,
Transform3<S>::Identity(), t[0], t[1], t[2],
nullptr,
nullptr,
nullptr);
1259 res = solver1<S>().shapeTriangleIntersect(s,
transform, t[0], t[1], t[2],
transform,
nullptr,
nullptr,
nullptr);
1264 t[1] << 9.9, -20, 0;
1266 res = solver1<S>().shapeTriangleIntersect(s,
Transform3<S>::Identity(), t[0], t[1], t[2],
nullptr,
nullptr,
nullptr);
1269 res = solver1<S>().shapeTriangleIntersect(s,
transform, t[0], t[1], t[2],
transform,
nullptr,
nullptr,
nullptr);
1272 res = solver1<S>().shapeTriangleIntersect(s,
Transform3<S>::Identity(), t[0], t[1], t[2],
nullptr,
nullptr, &normal);
1276 res = solver1<S>().shapeTriangleIntersect(s,
transform, t[0], t[1], t[2],
transform,
nullptr,
nullptr, &normal);
1281 GTEST_TEST(FCL_GEOMETRIC_SHAPES, shapeIntersection_spheretriangle)
1284 test_shapeIntersection_spheretriangle<double>();
1287 template <
typename S>
1307 res = solver1<S>().shapeTriangleIntersect(hs,
transform, t[0], t[1], t[2],
transform,
nullptr,
nullptr,
nullptr);
1318 #if !defined(FCL_OS_MACOS) || !defined(NDEBUG)
1319 res = solver1<S>().shapeTriangleIntersect(hs,
transform, t[0], t[1], t[2],
transform,
nullptr,
nullptr,
nullptr);
1328 #if !defined(FCL_OS_MACOS) || !defined(NDEBUG)
1329 res = solver1<S>().shapeTriangleIntersect(hs,
transform, t[0], t[1], t[2],
transform,
nullptr,
nullptr, &normal);
1335 GTEST_TEST(FCL_GEOMETRIC_SHAPES, shapeIntersection_halfspacetriangle)
1338 test_shapeIntersection_halfspacetriangle<double>();
1341 template <
typename S>
1361 res = solver1<S>().shapeTriangleIntersect(hs,
transform, t[0], t[1], t[2],
transform,
nullptr,
nullptr,
nullptr);
1366 t[1] << -0.1, -20, 0;
1367 t[2] << -0.1, 20, 0;
1371 res = solver1<S>().shapeTriangleIntersect(hs,
transform, t[0], t[1], t[2],
transform,
nullptr,
nullptr,
nullptr);
1378 res = solver1<S>().shapeTriangleIntersect(hs,
transform, t[0], t[1], t[2],
transform,
nullptr,
nullptr, &normal);
1383 GTEST_TEST(FCL_GEOMETRIC_SHAPES, shapeIntersection_planetriangle)
1386 test_shapeIntersection_planetriangle<double>();
1389 template <
typename S>
1401 std::vector<ContactPoint<S>> contacts;
1406 contacts[0].pos << -5, 0, 0;
1407 contacts[0].penetration_depth = 10;
1408 contacts[0].normal << -1, 0, 0;
1415 contacts[0].penetration_depth = 10;
1422 contacts[0].pos << -2.5, 0, 0;
1423 contacts[0].penetration_depth = 15;
1424 contacts[0].normal << -1, 0, 0;
1431 contacts[0].penetration_depth = 15;
1438 contacts[0].pos << -7.5, 0, 0;
1439 contacts[0].penetration_depth = 5;
1440 contacts[0].normal << -1, 0, 0;
1447 contacts[0].penetration_depth = 5;
1462 contacts[0].pos << 0.05, 0, 0;
1463 contacts[0].penetration_depth = 20.1;
1464 contacts[0].normal << -1, 0, 0;
1471 contacts[0].penetration_depth = 20.1;
1476 GTEST_TEST(FCL_GEOMETRIC_SHAPES, shapeIntersection_halfspacesphere)
1479 test_shapeIntersection_halfspacesphere<double>();
1482 template <
typename S>
1494 std::vector<ContactPoint<S>> contacts;
1499 contacts[0].pos.setZero();
1500 contacts[0].penetration_depth = 10;
1501 contacts[0].normal << 1, 0, 0;
1502 testShapeIntersection(s, tf1, hs, tf2,
GST_LIBCCD,
true, contacts,
true,
true,
true,
true);
1508 contacts[0].penetration_depth = 10;
1510 testShapeIntersection(s, tf1, hs, tf2,
GST_LIBCCD,
true, contacts,
true,
true,
true,
true);
1515 contacts[0].pos << 5, 0, 0;
1516 contacts[0].penetration_depth = 5;
1517 contacts[0].normal << 1, 0, 0;
1524 contacts[0].penetration_depth = 5;
1531 contacts[0].pos << -5, 0, 0;
1532 contacts[0].penetration_depth = 5;
1533 contacts[0].normal << -1, 0, 0;
1540 contacts[0].penetration_depth = 5;
1564 test_shapeIntersection_planesphere<double>();
1567 template <
typename S>
1579 std::vector<ContactPoint<S>> contacts;
1584 contacts[0].pos << -1.25, 0, 0;
1585 contacts[0].penetration_depth = 2.5;
1586 contacts[0].normal << -1, 0, 0;
1593 contacts[0].penetration_depth = 2.5;
1600 contacts[0].pos << -0.625, 0, 0;
1601 contacts[0].penetration_depth = 3.75;
1602 contacts[0].normal << -1, 0, 0;
1609 contacts[0].penetration_depth = 3.75;
1616 contacts[0].pos << -1.875, 0, 0;
1617 contacts[0].penetration_depth = 1.25;
1618 contacts[0].normal << -1, 0, 0;
1625 contacts[0].penetration_depth = 1.25;
1632 contacts[0].pos << 0.005, 0, 0;
1633 contacts[0].penetration_depth = 5.01;
1634 contacts[0].normal << -1, 0, 0;
1641 contacts[0].penetration_depth = 5.01;
1662 test_shapeIntersection_halfspacebox<double>();
1665 template <
typename S>
1677 std::vector<ContactPoint<S>> contacts;
1682 contacts[0].pos << 0, 0, 0;
1683 contacts[0].penetration_depth = 2.5;
1684 contacts[0].normal << 1, 0, 0;
1685 testShapeIntersection(s, tf1, hs, tf2,
GST_LIBCCD,
true, contacts,
true,
true,
true,
true);
1691 contacts[0].penetration_depth = 2.5;
1693 testShapeIntersection(s, tf1, hs, tf2,
GST_LIBCCD,
true, contacts,
true,
true,
true,
true);
1698 contacts[0].pos << 1.25, 0, 0;
1699 contacts[0].penetration_depth = 1.25;
1700 contacts[0].normal << 1, 0, 0;
1707 contacts[0].penetration_depth = 1.25;
1714 contacts[0].pos << -1.25, 0, 0;
1715 contacts[0].penetration_depth = 1.25;
1716 contacts[0].normal << -1, 0, 0;
1723 contacts[0].penetration_depth = 1.25;
1752 test_shapeIntersection_planebox<double>();
1755 template <
typename S>
1767 std::vector<ContactPoint<S>> contacts;
1772 contacts[0].pos << -2.5, 0, 0;
1773 contacts[0].penetration_depth = 5.0;
1774 contacts[0].normal << -1, 0, 0;
1781 contacts[0].penetration_depth = 5.0;
1788 contacts[0].pos << -1.875, 0, 0;
1789 contacts[0].penetration_depth = 6.25;
1790 contacts[0].normal << -1, 0, 0;
1797 contacts[0].penetration_depth = 6.25;
1804 contacts[0].pos << -3.125, 0, 0;
1805 contacts[0].penetration_depth = 3.75;
1806 contacts[0].normal << -1, 0, 0;
1813 contacts[0].penetration_depth = 3.75;
1820 contacts[0].pos << 0.005, 0, 0;
1821 contacts[0].penetration_depth = 10.01;
1822 contacts[0].normal << -1, 0, 0;
1829 contacts[0].penetration_depth = 10.01;
1849 contacts[0].pos << 0, -5.0, 0;
1850 contacts[0].penetration_depth = 10.0;
1851 contacts[0].normal << 0, -1, 0;
1858 contacts[0].penetration_depth = 10.0;
1865 contacts[0].pos << 0, -4.375, 0;
1866 contacts[0].penetration_depth = 11.25;
1867 contacts[0].normal << 0, -1, 0;
1874 contacts[0].penetration_depth = 11.25;
1881 contacts[0].pos << 0, -5.625, 0;
1882 contacts[0].penetration_depth = 8.75;
1883 contacts[0].normal << 0, -1, 0;
1890 contacts[0].penetration_depth = 8.75;
1897 contacts[0].pos << 0, 0.005, 0;
1898 contacts[0].penetration_depth = 20.01;
1899 contacts[0].normal << 0, -1, 0;
1906 contacts[0].penetration_depth = 20.01;
1926 contacts[0].pos << 0, 0, -10.0;
1927 contacts[0].penetration_depth = 20.0;
1928 contacts[0].normal << 0, 0, -1;
1935 contacts[0].penetration_depth = 20.0;
1942 contacts[0].pos << 0, 0, -9.375;
1943 contacts[0].penetration_depth = 21.25;
1944 contacts[0].normal << 0, 0, -1;
1951 contacts[0].penetration_depth = 21.25;
1958 contacts[0].pos << 0, 0, -10.625;
1959 contacts[0].penetration_depth = 18.75;
1960 contacts[0].normal << 0, 0, -1;
1967 contacts[0].penetration_depth = 18.75;
1974 contacts[0].pos << 0, 0, 0.005;
1975 contacts[0].penetration_depth = 40.01;
1976 contacts[0].normal << 0, 0, -1;
1983 contacts[0].penetration_depth = 40.01;
1996 GTEST_TEST(FCL_GEOMETRIC_SHAPES, shapeIntersection_halfspaceellipsoid)
1999 test_shapeIntersection_halfspaceellipsoid<double>();
2002 template <
typename S>
2014 std::vector<ContactPoint<S>> contacts;
2019 contacts[0].pos << 0, 0, 0;
2020 contacts[0].penetration_depth = 5.0;
2021 contacts[0].normal << -1, 0, 0;
2022 testShapeIntersection(s, tf1, hs, tf2,
GST_LIBCCD,
true, contacts,
true,
true,
true,
true);
2028 contacts[0].penetration_depth = 5.0;
2030 testShapeIntersection(s, tf1, hs, tf2,
GST_LIBCCD,
true, contacts,
true,
true,
true,
true);
2035 contacts[0].pos << 1.25, 0, 0;
2036 contacts[0].penetration_depth = 3.75;
2037 contacts[0].normal << 1, 0, 0;
2044 contacts[0].penetration_depth = 3.75;
2051 contacts[0].pos << -1.25, 0, 0;
2052 contacts[0].penetration_depth = 3.75;
2053 contacts[0].normal << -1, 0, 0;
2060 contacts[0].penetration_depth = 3.75;
2088 contacts[0].pos << 0, 0.0, 0;
2089 contacts[0].penetration_depth = 10.0;
2090 contacts[0].normal << 0, -1, 0;
2091 testShapeIntersection(s, tf1, hs, tf2,
GST_LIBCCD,
true, contacts,
true,
true,
true,
true);
2097 contacts[0].penetration_depth = 10.0;
2099 testShapeIntersection(s, tf1, hs, tf2,
GST_LIBCCD,
true, contacts,
true,
true,
true,
true);
2104 contacts[0].pos << 0, 1.25, 0;
2105 contacts[0].penetration_depth = 8.75;
2106 contacts[0].normal << 0, 1, 0;
2113 contacts[0].penetration_depth = 8.75;
2120 contacts[0].pos << 0, -1.25, 0;
2121 contacts[0].penetration_depth = 8.75;
2122 contacts[0].normal << 0, -1, 0;
2129 contacts[0].penetration_depth = 8.75;
2157 contacts[0].pos << 0, 0, 0;
2158 contacts[0].penetration_depth = 20.0;
2159 contacts[0].normal << 0, 0, -1;
2160 testShapeIntersection(s, tf1, hs, tf2,
GST_LIBCCD,
true, contacts,
true,
true,
true,
true);
2166 contacts[0].penetration_depth = 20.0;
2168 testShapeIntersection(s, tf1, hs, tf2,
GST_LIBCCD,
true, contacts,
true,
true,
true,
true);
2173 contacts[0].pos << 0, 0, 1.25;
2174 contacts[0].penetration_depth = 18.75;
2175 contacts[0].normal << 0, 0, 1;
2182 contacts[0].penetration_depth = 18.75;
2189 contacts[0].pos << 0, 0, -1.25;
2190 contacts[0].penetration_depth = 18.75;
2191 contacts[0].normal << 0, 0, -1;
2198 contacts[0].penetration_depth = 18.75;
2219 GTEST_TEST(FCL_GEOMETRIC_SHAPES, shapeIntersection_planeellipsoid)
2222 test_shapeIntersection_planeellipsoid<double>();
2225 template <
typename S>
2237 std::vector<ContactPoint<S>> contacts;
2242 contacts[0].pos << -2.5, 0, 0;
2243 contacts[0].penetration_depth = 5;
2244 contacts[0].normal << -1, 0, 0;
2251 contacts[0].penetration_depth = 5;
2258 contacts[0].pos << -1.25, 0, 0;
2259 contacts[0].penetration_depth = 7.5;
2260 contacts[0].normal << -1, 0, 0;
2267 contacts[0].penetration_depth = 7.5;
2274 contacts[0].pos << -3.75, 0, 0;
2275 contacts[0].penetration_depth = 2.5;
2276 contacts[0].normal << -1, 0, 0;
2283 contacts[0].penetration_depth = 2.5;
2290 contacts[0].pos << 0.05, 0, 0;
2291 contacts[0].penetration_depth = 10.1;
2292 contacts[0].normal << -1, 0, 0;
2299 contacts[0].penetration_depth = 10.1;
2319 contacts[0].pos << 0, -2.5, 0;
2320 contacts[0].penetration_depth = 5;
2321 contacts[0].normal << 0, -1, 0;
2328 contacts[0].penetration_depth = 5;
2335 contacts[0].pos << 0, -1.25, 0;
2336 contacts[0].penetration_depth = 7.5;
2337 contacts[0].normal << 0, -1, 0;
2344 contacts[0].penetration_depth = 7.5;
2351 contacts[0].pos << 0, -3.75, 0;
2352 contacts[0].penetration_depth = 2.5;
2353 contacts[0].normal << 0, -1, 0;
2360 contacts[0].penetration_depth = 2.5;
2367 contacts[0].pos << 0, 0.05, 0;
2368 contacts[0].penetration_depth = 10.1;
2369 contacts[0].normal << 0, -1, 0;
2376 contacts[0].penetration_depth = 10.1;
2396 contacts[0].pos << 0, 0, -5;
2397 contacts[0].penetration_depth = 10;
2398 contacts[0].normal << 0, 0, -1;
2405 contacts[0].penetration_depth = 10;
2412 contacts[0].pos << 0, 0, -3.75;
2413 contacts[0].penetration_depth = 12.5;
2414 contacts[0].normal << 0, 0, -1;
2421 contacts[0].penetration_depth = 12.5;
2428 contacts[0].pos << 0, 0, -6.25;
2429 contacts[0].penetration_depth = 7.5;
2430 contacts[0].normal << 0, 0, -1;
2437 contacts[0].penetration_depth = 7.5;
2444 contacts[0].pos << 0, 0, 0.05;
2445 contacts[0].penetration_depth = 20.1;
2446 contacts[0].normal << 0, 0, -1;
2453 contacts[0].penetration_depth = 20.1;
2466 GTEST_TEST(FCL_GEOMETRIC_SHAPES, shapeIntersection_halfspacecapsule)
2469 test_shapeIntersection_halfspacecapsule<double>();
2472 template <
typename S>
2484 std::vector<ContactPoint<S>> contacts;
2489 contacts[0].pos << 0, 0, 0;
2490 contacts[0].penetration_depth = 5;
2491 contacts[0].normal << 1, 0, 0;
2492 testShapeIntersection(s, tf1, hs, tf2,
GST_LIBCCD,
true, contacts,
true,
true,
true,
true);
2498 contacts[0].penetration_depth = 5;
2500 testShapeIntersection(s, tf1, hs, tf2,
GST_LIBCCD,
true, contacts,
true,
true,
true,
true);
2505 contacts[0].pos << 2.5, 0, 0;
2506 contacts[0].penetration_depth = 2.5;
2507 contacts[0].normal << 1, 0, 0;
2514 contacts[0].penetration_depth = 2.5;
2521 contacts[0].pos << -2.5, 0, 0;
2522 contacts[0].penetration_depth = 2.5;
2523 contacts[0].normal << -1, 0, 0;
2530 contacts[0].penetration_depth = 2.5;
2558 contacts[0].pos << 0, 0, 0;
2559 contacts[0].penetration_depth = 5;
2560 contacts[0].normal << 0, 1, 0;
2561 testShapeIntersection(s, tf1, hs, tf2,
GST_LIBCCD,
true, contacts,
true,
true,
true,
true);
2567 contacts[0].penetration_depth = 5;
2569 testShapeIntersection(s, tf1, hs, tf2,
GST_LIBCCD,
true, contacts,
true,
true,
true,
true);
2574 contacts[0].pos << 0, 2.5, 0;
2575 contacts[0].penetration_depth = 2.5;
2576 contacts[0].normal << 0, 1, 0;
2583 contacts[0].penetration_depth = 2.5;
2590 contacts[0].pos << 0, -2.5, 0;
2591 contacts[0].penetration_depth = 2.5;
2592 contacts[0].normal << 0, -1, 0;
2599 contacts[0].penetration_depth = 2.5;
2627 contacts[0].pos << 0, 0, 0;
2628 contacts[0].penetration_depth = 10;
2629 contacts[0].normal << 0, 0, 1;
2630 testShapeIntersection(s, tf1, hs, tf2,
GST_LIBCCD,
true, contacts,
true,
true,
true,
true);
2636 contacts[0].penetration_depth = 10;
2638 testShapeIntersection(s, tf1, hs, tf2,
GST_LIBCCD,
true, contacts,
true,
true,
true,
true);
2643 contacts[0].pos << 0, 0, 2.5;
2644 contacts[0].penetration_depth = 7.5;
2645 contacts[0].normal << 0, 0, 1;
2652 contacts[0].penetration_depth = 7.5;
2659 contacts[0].pos << 0, 0, -2.5;
2660 contacts[0].penetration_depth = 7.5;
2661 contacts[0].normal << 0, 0, -1;
2668 contacts[0].penetration_depth = 7.5;
2692 test_shapeIntersection_planecapsule<double>();
2695 template <
typename S>
2707 std::vector<ContactPoint<S>> contacts;
2712 contacts[0].pos << -2.5, 0, 0;
2713 contacts[0].penetration_depth = 5;
2714 contacts[0].normal << -1, 0, 0;
2721 contacts[0].penetration_depth = 5;
2728 contacts[0].pos << -1.25, 0, 0;
2729 contacts[0].penetration_depth = 7.5;
2730 contacts[0].normal << -1, 0, 0;
2737 contacts[0].penetration_depth = 7.5;
2744 contacts[0].pos << -3.75, 0, 0;
2745 contacts[0].penetration_depth = 2.5;
2746 contacts[0].normal << -1, 0, 0;
2753 contacts[0].penetration_depth = 2.5;
2760 contacts[0].pos << 0.05, 0, 0;
2761 contacts[0].penetration_depth = 10.1;
2762 contacts[0].normal << -1, 0, 0;
2769 contacts[0].penetration_depth = 10.1;
2789 contacts[0].pos << 0, -2.5, 0;
2790 contacts[0].penetration_depth = 5;
2791 contacts[0].normal << 0, -1, 0;
2798 contacts[0].penetration_depth = 5;
2805 contacts[0].pos << 0, -1.25, 0;
2806 contacts[0].penetration_depth = 7.5;
2807 contacts[0].normal << 0, -1, 0;
2814 contacts[0].penetration_depth = 7.5;
2821 contacts[0].pos << 0, -3.75, 0;
2822 contacts[0].penetration_depth = 2.5;
2823 contacts[0].normal << 0, -1, 0;
2830 contacts[0].penetration_depth = 2.5;
2837 contacts[0].pos << 0, 0.05, 0;
2838 contacts[0].penetration_depth = 10.1;
2839 contacts[0].normal << 0, -1, 0;
2846 contacts[0].penetration_depth = 10.1;
2866 contacts[0].pos << 0, 0, -2.5;
2867 contacts[0].penetration_depth = 5;
2868 contacts[0].normal << 0, 0, -1;
2875 contacts[0].penetration_depth = 5;
2882 contacts[0].pos << 0, 0, -1.25;
2883 contacts[0].penetration_depth = 7.5;
2884 contacts[0].normal << 0, 0, -1;
2891 contacts[0].penetration_depth = 7.5;
2898 contacts[0].pos << 0, 0, -3.75;
2899 contacts[0].penetration_depth = 2.5;
2900 contacts[0].normal << 0, 0, -1;
2907 contacts[0].penetration_depth = 2.5;
2914 contacts[0].pos << 0, 0, 0.05;
2915 contacts[0].penetration_depth = 10.1;
2916 contacts[0].normal << 0, 0, -1;
2923 contacts[0].penetration_depth = 10.1;
2936 GTEST_TEST(FCL_GEOMETRIC_SHAPES, shapeIntersection_halfspacecylinder)
2939 test_shapeIntersection_halfspacecylinder<double>();
2942 template <
typename S>
2954 std::vector<ContactPoint<S>> contacts;
2959 contacts[0].pos << 0, 0, 0;
2960 contacts[0].penetration_depth = 5;
2961 contacts[0].normal << 1, 0, 0;
2962 testShapeIntersection(s, tf1, hs, tf2,
GST_LIBCCD,
true, contacts,
true,
true,
true,
true);
2968 contacts[0].penetration_depth = 5;
2970 testShapeIntersection(s, tf1, hs, tf2,
GST_LIBCCD,
true, contacts,
true,
true,
true,
true);
2975 contacts[0].pos << 2.5, 0, 0;
2976 contacts[0].penetration_depth = 2.5;
2977 contacts[0].normal << 1, 0, 0;
2984 contacts[0].penetration_depth = 2.5;
2991 contacts[0].pos << -2.5, 0, 0;
2992 contacts[0].penetration_depth = 2.5;
2993 contacts[0].normal << -1, 0, 0;
3000 contacts[0].penetration_depth = 2.5;
3028 contacts[0].pos << 0, 0, 0;
3029 contacts[0].penetration_depth = 5;
3030 contacts[0].normal << 0, 1, 0;
3031 testShapeIntersection(s, tf1, hs, tf2,
GST_LIBCCD,
true, contacts,
true,
true,
true,
true);
3037 contacts[0].penetration_depth = 5;
3039 testShapeIntersection(s, tf1, hs, tf2,
GST_LIBCCD,
true, contacts,
true,
true,
true,
true);
3044 contacts[0].pos << 0, 2.5, 0;
3045 contacts[0].penetration_depth = 2.5;
3046 contacts[0].normal << 0, 1, 0;
3053 contacts[0].penetration_depth = 2.5;
3060 contacts[0].pos << 0, -2.5, 0;
3061 contacts[0].penetration_depth = 2.5;
3062 contacts[0].normal << 0, -1, 0;
3069 contacts[0].penetration_depth = 2.5;
3097 contacts[0].pos << 0, 0, 0;
3098 contacts[0].penetration_depth = 5;
3099 contacts[0].normal << 0, 0, 1;
3100 testShapeIntersection(s, tf1, hs, tf2,
GST_LIBCCD,
true, contacts,
true,
true,
true,
true);
3106 contacts[0].penetration_depth = 5;
3108 testShapeIntersection(s, tf1, hs, tf2,
GST_LIBCCD,
true, contacts,
true,
true,
true,
true);
3113 contacts[0].pos << 0, 0, 2.5;
3114 contacts[0].penetration_depth = 2.5;
3115 contacts[0].normal << 0, 0, 1;
3122 contacts[0].penetration_depth = 2.5;
3129 contacts[0].pos << 0, 0, -2.5;
3130 contacts[0].penetration_depth = 2.5;
3131 contacts[0].normal << 0, 0, -1;
3138 contacts[0].penetration_depth = 2.5;
3159 GTEST_TEST(FCL_GEOMETRIC_SHAPES, shapeIntersection_planecylinder)
3162 test_shapeIntersection_planecylinder<double>();
3165 template <
typename S>
3177 std::vector<ContactPoint<S>> contacts;
3182 contacts[0].pos << -2.5, 0, -5;
3183 contacts[0].penetration_depth = 5;
3184 contacts[0].normal << -1, 0, 0;
3191 contacts[0].penetration_depth = 5;
3198 contacts[0].pos << -1.25, 0, -5;
3199 contacts[0].penetration_depth = 7.5;
3200 contacts[0].normal << -1, 0, 0;
3207 contacts[0].penetration_depth = 7.5;
3214 contacts[0].pos << -3.75, 0, -5;
3215 contacts[0].penetration_depth = 2.5;
3216 contacts[0].normal << -1, 0, 0;
3223 contacts[0].penetration_depth = 2.5;
3230 contacts[0].pos << 0.05, 0, -5;
3231 contacts[0].penetration_depth = 10.1;
3232 contacts[0].normal << -1, 0, 0;
3239 contacts[0].penetration_depth = 10.1;
3259 contacts[0].pos << 0, -2.5, -5;
3260 contacts[0].penetration_depth = 5;
3261 contacts[0].normal << 0, -1, 0;
3268 contacts[0].penetration_depth = 5;
3275 contacts[0].pos << 0, -1.25, -5;
3276 contacts[0].penetration_depth = 7.5;
3277 contacts[0].normal << 0, -1, 0;
3284 contacts[0].penetration_depth = 7.5;
3291 contacts[0].pos << 0, -3.75, -5;
3292 contacts[0].penetration_depth = 2.5;
3293 contacts[0].normal << 0, -1, 0;
3300 contacts[0].penetration_depth = 2.5;
3307 contacts[0].pos << 0, 0.05, -5;
3308 contacts[0].penetration_depth = 10.1;
3309 contacts[0].normal << 0, -1, 0;
3316 contacts[0].penetration_depth = 10.1;
3336 contacts[0].pos << 0, 0, -2.5;
3337 contacts[0].penetration_depth = 5;
3338 contacts[0].normal << 0, 0, -1;
3345 contacts[0].penetration_depth = 5;
3352 contacts[0].pos << 0, 0, -1.25;
3353 contacts[0].penetration_depth = 7.5;
3354 contacts[0].normal << 0, 0, -1;
3361 contacts[0].penetration_depth = 7.5;
3368 contacts[0].pos << 0, 0, -3.75;
3369 contacts[0].penetration_depth= 2.5;
3370 contacts[0].normal << 0, 0, -1;
3377 contacts[0].penetration_depth = 2.5;
3384 contacts[0].pos << 0, 0, 0.05;
3385 contacts[0].penetration_depth = 10.1;
3386 contacts[0].normal << 0, 0, -1;
3393 contacts[0].penetration_depth = 10.1;
3406 GTEST_TEST(FCL_GEOMETRIC_SHAPES, shapeIntersection_halfspacecone)
3409 test_shapeIntersection_halfspacecone<double>();
3412 template <
typename S>
3424 std::vector<ContactPoint<S>> contacts;
3429 contacts[0].pos << 0, 0, 0;
3430 contacts[0].penetration_depth = 5;
3431 contacts[0].normal << 1, 0, 0;
3432 testShapeIntersection(s, tf1, hs, tf2,
GST_LIBCCD,
true, contacts,
true,
true,
true,
true);
3438 contacts[0].penetration_depth = 5;
3440 testShapeIntersection(s, tf1, hs, tf2,
GST_LIBCCD,
true, contacts,
true,
true,
true,
true);
3445 contacts[0].pos << 2.5, 0, -2.5;
3446 contacts[0].penetration_depth = 2.5;
3447 contacts[0].normal << 1, 0, 0;
3454 contacts[0].penetration_depth = 2.5;
3461 contacts[0].pos << -2.5, 0, -2.5;
3462 contacts[0].penetration_depth = 2.5;
3463 contacts[0].normal << -1, 0, 0;
3470 contacts[0].penetration_depth = 2.5;
3498 contacts[0].pos << 0, 0, 0;
3499 contacts[0].penetration_depth = 5;
3500 contacts[0].normal << 0, 1, 0;
3501 testShapeIntersection(s, tf1, hs, tf2,
GST_LIBCCD,
true, contacts,
true,
true,
true,
true);
3507 contacts[0].penetration_depth = 5;
3509 testShapeIntersection(s, tf1, hs, tf2,
GST_LIBCCD,
true, contacts,
true,
true,
true,
true);
3514 contacts[0].pos << 0, 2.5, -2.5;
3515 contacts[0].penetration_depth = 2.5;
3516 contacts[0].normal << 0, 1, 0;
3523 contacts[0].penetration_depth = 2.5;
3530 contacts[0].pos << 0, -2.5, -2.5;
3531 contacts[0].penetration_depth = 2.5;
3532 contacts[0].normal << 0, -1, 0;
3539 contacts[0].penetration_depth = 2.5;
3567 contacts[0].pos << 0, 0, 0;
3568 contacts[0].penetration_depth = 5;
3569 contacts[0].normal << 0, 0, 1;
3570 testShapeIntersection(s, tf1, hs, tf2,
GST_LIBCCD,
true, contacts,
true,
true,
true,
true);
3576 contacts[0].penetration_depth = 5;
3578 testShapeIntersection(s, tf1, hs, tf2,
GST_LIBCCD,
true, contacts,
true,
true,
true,
true);
3583 contacts[0].pos << 0, 0, 2.5;
3584 contacts[0].penetration_depth = 2.5;
3585 contacts[0].normal << 0, 0, 1;
3592 contacts[0].penetration_depth = 2.5;
3599 contacts[0].pos << 0, 0, -2.5;
3600 contacts[0].penetration_depth = 2.5;
3601 contacts[0].normal << 0, 0, -1;
3608 contacts[0].penetration_depth = 2.5;
3632 test_shapeIntersection_planecone<double>();
3659 template <
typename S>
3725 test_shapeDistance_spheresphere<double>();
3728 template <
typename S>
3798 test_shapeDistance_boxbox<double>();
3801 template <
typename S>
3841 test_shapeDistance_boxsphere<double>();
3844 template <
typename S>
3884 test_shapeDistance_cylindercylinder<double>();
3887 template <
typename S>
3927 test_shapeDistance_conecone<double>();
3930 template <
typename S>
3970 test_shapeDistance_conecylinder<double>();
3973 template <
typename S>
4036 GTEST_TEST(FCL_GEOMETRIC_SHAPES, shapeDistance_ellipsoidellipsoid)
4039 test_shapeDistance_ellipsoidellipsoid<double>();
4066 template <
typename S>
4078 std::vector<ContactPoint<S>> contacts;
4091 contacts[0].normal << 1, 0, 0;
4092 contacts[0].pos << 20, 0, 0;
4093 contacts[0].penetration_depth = 0.0;
4107 contacts[0].normal << 1, 0, 0;
4108 contacts[0].pos << 20.0 - 0.1 * 20.0/(20.0 + 10.0), 0, 0;
4109 contacts[0].penetration_depth = 0.1;
4117 contacts[0].penetration_depth = 0.1;
4123 contacts[0].normal.setZero();
4124 contacts[0].pos.setZero();
4125 contacts[0].penetration_depth = 20.0 + 10.0;
4131 contacts[0].normal.setZero();
4133 contacts[0].penetration_depth = 20.0 + 10.0;
4139 contacts[0].normal << -1, 0, 0;
4140 contacts[0].pos << -20.0 + 0.1 * 20.0/(20.0 + 10.0), 0, 0;
4141 contacts[0].penetration_depth = 0.1;
4149 contacts[0].penetration_depth = 0.1;
4155 contacts[0].normal << -1, 0, 0;
4156 contacts[0].pos << -20, 0, 0;
4157 contacts[0].penetration_depth = 0.0;
4169 GTEST_TEST(FCL_GEOMETRIC_SHAPES, shapeIntersectionGJK_spheresphere)
4172 test_shapeIntersectionGJK_spheresphere<double>();
4175 template <
typename S>
4187 std::vector<ContactPoint<S>> contacts;
4195 contacts[0].normal << 1, 0, 0;
4196 contacts[1].normal << 1, 0, 0;
4197 contacts[2].normal << 1, 0, 0;
4198 contacts[3].normal << 1, 0, 0;
4246 test_shapeIntersectionGJK_boxbox<double>();
4249 template <
typename S>
4261 std::vector<ContactPoint<S>> contacts;
4278 contacts[0].normal << 1, 0, 0;
4312 contacts[0].normal << 1, 0, 0;
4313 testShapeIntersection(s1, tf1, s2, tf2,
GST_INDEP,
true, contacts,
false,
false,
true,
false, 1e-2);
4326 test_shapeIntersectionGJK_spherebox<double>();
4329 template <
typename S>
4341 std::vector<ContactPoint<S>> contacts;
4358 contacts[0].normal << 1, 0, 0;
4370 contacts[0].normal << 1, 0, 0;
4378 GTEST_TEST(FCL_GEOMETRIC_SHAPES, shapeIntersectionGJK_spherecapsule)
4381 test_shapeIntersectionGJK_spherecapsule<double>();
4384 template <
typename S>
4396 std::vector<ContactPoint<S>> contacts;
4413 contacts[0].normal << 1, 0, 0;
4414 testShapeIntersection(s1, tf1, s2, tf2,
GST_INDEP,
true, contacts,
false,
false,
true,
false, 3e-1);
4426 contacts[0].normal << 1, 0, 0;
4434 GTEST_TEST(FCL_GEOMETRIC_SHAPES, shapeIntersectionGJK_cylindercylinder)
4437 test_shapeIntersectionGJK_cylindercylinder<double>();
4440 template <
typename S>
4452 std::vector<ContactPoint<S>> contacts;
4469 contacts[0].normal << 1, 0, 0;
4470 testShapeIntersection(s1, tf1, s2, tf2,
GST_INDEP,
true, contacts,
false,
false,
true,
false, 5.7e-1);
4490 contacts[0].normal << 0, 0, 1;
4504 test_shapeIntersectionGJK_conecone<double>();
4507 template <
typename S>
4519 std::vector<ContactPoint<S>> contacts;
4555 contacts[0].normal << 0, 0, 1;
4568 contacts[0].normal << 0, 0, 1;
4576 GTEST_TEST(FCL_GEOMETRIC_SHAPES, shapeIntersectionGJK_cylindercone)
4579 test_shapeIntersectionGJK_cylindercone<double>();
4582 template <
typename S>
4595 std::vector<ContactPoint<S>> contacts;
4654 GTEST_TEST(FCL_GEOMETRIC_SHAPES, shapeIntersectionGJK_ellipsoidellipsoid)
4657 test_shapeIntersectionGJK_ellipsoidellipsoid<double>();
4660 template <
typename S>
4677 res = solver2<S>().shapeTriangleIntersect(s,
Transform3<S>::Identity(), t[0], t[1], t[2],
nullptr,
nullptr,
nullptr);
4680 res = solver2<S>().shapeTriangleIntersect(s,
transform, t[0], t[1], t[2],
transform,
nullptr,
nullptr,
nullptr);
4684 t[1] << 9.9, -20, 0;
4686 res = solver2<S>().shapeTriangleIntersect(s,
Transform3<S>::Identity(), t[0], t[1], t[2],
nullptr,
nullptr,
nullptr);
4689 res = solver2<S>().shapeTriangleIntersect(s,
transform, t[0], t[1], t[2],
transform,
nullptr,
nullptr,
nullptr);
4692 res = solver2<S>().shapeTriangleIntersect(s,
Transform3<S>::Identity(), t[0], t[1], t[2],
nullptr,
nullptr, &normal);
4696 res = solver2<S>().shapeTriangleIntersect(s,
transform, t[0], t[1], t[2],
transform,
nullptr,
nullptr, &normal);
4701 GTEST_TEST(FCL_GEOMETRIC_SHAPES, shapeIntersectionGJK_spheretriangle)
4704 test_shapeIntersectionGJK_spheretriangle<double>();
4707 template <
typename S>
4727 res = solver2<S>().shapeTriangleIntersect(hs,
transform, t[0], t[1], t[2],
transform,
nullptr,
nullptr,
nullptr);
4732 t[1] << -0.1, -20, 0;
4733 t[2] << -0.1, 20, 0;
4737 res = solver2<S>().shapeTriangleIntersect(hs,
transform, t[0], t[1], t[2],
transform,
nullptr,
nullptr,
nullptr);
4744 res = solver2<S>().shapeTriangleIntersect(hs,
transform, t[0], t[1], t[2],
transform,
nullptr,
nullptr, &normal);
4749 GTEST_TEST(FCL_GEOMETRIC_SHAPES, shapeIntersectionGJK_halfspacetriangle)
4752 test_shapeIntersectionGJK_halfspacetriangle<double>();
4755 template <
typename S>
4775 res = solver1<S>().shapeTriangleIntersect(hs,
transform, t[0], t[1], t[2],
transform,
nullptr,
nullptr,
nullptr);
4780 t[1] << -0.1, -20, 0;
4781 t[2] << -0.1, 20, 0;
4785 res = solver2<S>().shapeTriangleIntersect(hs,
transform, t[0], t[1], t[2],
transform,
nullptr,
nullptr,
nullptr);
4792 res = solver2<S>().shapeTriangleIntersect(hs,
transform, t[0], t[1], t[2],
transform,
nullptr,
nullptr, &normal);
4797 GTEST_TEST(FCL_GEOMETRIC_SHAPES, shapeIntersectionGJK_planetriangle)
4800 test_shapeIntersectionGJK_planetriangle<double>();
4827 template <
typename S>
4892 test_shapeDistanceGJK_spheresphere<double>();
4895 template <
typename S>
4935 test_shapeDistanceGJK_boxbox<double>();
4938 template <
typename S>