EPA

Post Reply
omicron
Posts: 8
Joined: Tue Jan 17, 2006 6:27 pm

EPA

Post by omicron »

I have implemented EPA these days and ran it to calculate the penetration depth of two boxes but I'm facing a problem for which I don't have a solution.

Both boxes have extents 1 in all directions and one box is at (0.5f,0.0f,0.0f) and the other is at (-0.5f,0.0f,0.0f). So, the penetration depth should be exactly 1. I started with this very simple example just to avoid all those freaky termination conditions due to floating-point arithmetic.

My GJK implementation ends up with a triangle containing the origin of the CSO of both objects which clearly seems to be ok. Then, I use triangle's normal and its inverse to sample two more support points which I add to the triangle returned by GJK, the result is a hexahedron. From hexahedron's 6 faces only 2 has its closest points as internal points, so, only these faces are added to the priority queue. Then one face is expanded, all new faces have their closest points on their boundaries ( not internal ), so, no new faces are added to priority queue. Now, the second face is expanded and the resulting new faces also have their closest points on their boundaries ( not internal ) So, there's no more faces to expand and the algorithm doesn't a have a valid penetration depth value. The current penetration depth value is one of the closest points from the 2 initial faces that were expanded but this value isn't a correct penetration depth as obvious.

What did I do wrong ? Or what am I missing here ?

Thanks!
omicron
Posts: 8
Joined: Tue Jan 17, 2006 6:27 pm

Post by omicron »

I was following Gino's book to implement EPA and I misunderstood his closest_is_internal function. It's everything ok now. My bad! :oops:


Thanks anyway!
Post Reply