Skip to content

Commit

Permalink
[GJK] Remove detection of loop that made the algorithm fail to detect…
Browse files Browse the repository at this point in the history
… collision.
  • Loading branch information
florent-lamiraux committed Dec 6, 2018
1 parent 8f71f66 commit 0f95151
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/narrowphase/gjk.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -225,17 +225,17 @@ GJK::Status GJK::evaluate(const MinkowskiDiff& shape_, const Vec3f& guess)
appendVertex(curr_simplex, -ray); // see below, ray points away from origin

// check B: when the new support point is close to previous support points, stop (as the new simplex is degenerated)
Vec3f& w = curr_simplex.vertex[curr_simplex.rank - 1]->w;
const Vec3f& w = curr_simplex.vertex[curr_simplex.rank - 1]->w;
bool found = false;
for(size_t i = 0; i < 4; ++i)
{
if((w - lastw[i]).squaredNorm() < tolerance)
if((w - lastw[i]).squaredNorm() < tolerance * tolerance)
{
found = true; break;
}
}

if(found)
if(false /*found*/)
{
removeVertex(simplices[current]);
break;
Expand Down

0 comments on commit 0f95151

Please sign in to comment.