Is there a way to leverage GJK or EPA for hollow shapes?
Imagine this case:
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?
GJK/EPA and hollow shapes
-
- Posts: 38
- Joined: Wed May 14, 2008 5:58 am
GJK/EPA and hollow shapes
You do not have the required permissions to view the files attached to this post.
-
- Posts: 231
- Joined: Tue Feb 20, 2007 4:56 pm
Re: GJK/EPA and hollow shapes
Wouldn't hollow be the same case as concave? In which case, EPA/GJK aren't really suited to the task.
-
- Posts: 38
- Joined: Wed May 14, 2008 5:58 am
Re: GJK/EPA and hollow shapes
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.