0
\$\begingroup\$

If the bullet GJK (Convex vs convex) collision algorithm has more than four penetrating points, then how is it filtering that down to the four it needs?

What I've tried

  • Staring at the code, but I get confused at this part.
  • I figure it keeps the deepest penetration somehow
\$\endgroup\$
1

1 Answer 1

0
\$\begingroup\$

It uses a heuristic which selects which point of the existing four that should be replaced by the new point. This heuristic function produces a value that's proportional to an approximation of the contact surface area, i.e. two triangles that form the quadrilateral with the four contact points. It goes over each possibility, replacing one point at a time by the new point and finds which configuration maximizes contact area. And yes, it also prioritizes the deepest point. This helps prevent the deepest from being replaced which would result in visible penetration.

Another possible heuristic is to maximize the surface area of the tetrahedron formed by the four points, which is what I do in my physics engine and I get satisfying results. By consequence, this method chooses to keep the deepest point since it results in a bigger tetrahedron with larger surface area.

\$\endgroup\$

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.