Commit c0ebf022 authored by Joseph Mirabel's avatar Joseph Mirabel
Browse files

[test] add a unit test for the GJK guess

parent e35c3430
......@@ -366,9 +366,17 @@ void test_gjk_triangle_capsule (Vec3f T, bool expect_collision,
if (expect_collision)
BOOST_CHECK_EQUAL(status, details::GJK::Inside);
else
else {
BOOST_CHECK_EQUAL(status, details::GJK::Valid);
// Check that guess works as expected
Vec3f guess = gjk.getGuessFromSimplex();
// TODO the max number of iteration should be 0
details::GJK gjk2 (0, 1e-6);
details::GJK::Status status2 = gjk2.evaluate(shape, guess);
BOOST_CHECK_EQUAL(status2, details::GJK::Valid);
}
Vec3f w0, w1;
if (status == details::GJK::Valid || gjk.hasPenetrationInformation(shape)) {
gjk.getClosestPoints (shape, w0, w1);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment