GJK and collision response

Please don't post Bullet support questions here, use the above forums instead.
sbroumley
Posts: 15
Joined: Sun Aug 07, 2005 6:31 am
Location: Austin

GJK and collision response

Post by sbroumley »

I'm researching GJK and I was wondering how to deal with a specific problem that can easily be dealt with using SAT.

Basically, say you have a static plane that is tessellated into triangles and you want to collide a convex polygon primitive with that plane (eg. a box), but you don't want collision response with the internal triangle edges.

Now for SAT, it's very easy to just modify the algorithm so that when searching for the minimum translation distance over the overlapping axis' of the triangle v box, you can easily flag which triangle edges (pre-processed) to include for collision response (normal + penetration depth) results.

Can the same thing be achieved with GJK?

eg. In this dodgey ascii art below, only the * edges and internal plane should be collided with. If each triangle is fed into GJK with a cube, how would collision penetration response exclude internal edges?

********
*\ |\ |\ |\ *
* \| \| \| \*
*----------*
*\ |\ |\ |\ *
* \| \| \| \*
********

I hope my question makes sense. It's related to a game programming gems article where the static world mesh is pre-processed so that only collidable edges are flagged to be included in collision response.

thanks
Steve.
sbroumley
Posts: 15
Joined: Sun Aug 07, 2005 6:31 am
Location: Austin

Post by sbroumley »

Okay - so having thought about this more, I think I have the answer:

Use the regular GJK algorithm for each triangle v box to determine if they overlap (this can be optimized to just return a boolean result - see here for details: https://mollyrocket.com/forums/viewtopic.php?t=245

If they do overlap and collision reponse info is needed, perform a full GJK distance pass, but update the triangle support map function to extend the excluded edges to infinity so that they will never be the closest feature and hence excluded from collision response.

This makes sense to me. The next thing is for me to try it out.

Thoughts anyone?

-Steve.