GJK/EPA and hollow shapes

Please don't post Bullet support questions here, use the above forums instead.
Numsgil
Posts: 38
Joined: Wed May 14, 2008 5:58 am

GJK/EPA and hollow shapes

Post by Numsgil »

Is there a way to leverage GJK or EPA for hollow shapes?

Imagine this case:
triangleInsideSquare.png
You want to keep the red triangle inside the black square. In the case in the picture you'd want there to be no collision. But vertex A is *almost* touching the edge, so the distance/separating vector should be pretty small.

EPA would return the separating vector from B to the left edge of the square, which is almost what I want but not quite. I'm guessing there's probably something like a modification of EPA that would give the right answer?
You do not have the required permissions to view the files attached to this post.
bone
Posts: 231
Joined: Tue Feb 20, 2007 4:56 pm

Re: GJK/EPA and hollow shapes

Post by bone »

Wouldn't hollow be the same case as concave? In which case, EPA/GJK aren't really suited to the task.
Numsgil
Posts: 38
Joined: Wed May 14, 2008 5:58 am

Re: GJK/EPA and hollow shapes

Post by Numsgil »

It's perhaps similar, but I'd be very surprised if you couldn't get GJK/EPA to work with some modification. I don't think the Minkowski difference is usable, but some sort of erosion CSG type thing might work instead? It should still produce a convex region, which you should still be able to walk with GJK/EPA.