Comments on: EPA (Expanding Polytope Algorithm) http://www.codezealot.org/archives/180 Development blog and open source repository by William Bittle Fri, 25 Jul 2014 18:30:11 +0000 hourly 1 http://wordpress.org/?v=3.9.1 By: Asylum http://www.codezealot.org/archives/180#comment-127020 Sun, 20 Jul 2014 18:43:27 +0000 http://www.codezealot.org/?p=180#comment-127020 Hi!

Yes, I’m debugging it at the moment. The test case is two 1×1 boxes sitting exactly on eachother.

Initial simplex is:
0: (0, 0, 0)
1: (0, 1, 1)
2: (-1, 1, 0)
3: (-1, 0, 1)

The algorithm finds the first face to be the best (0, 1, 2). Normal vector is (-1, -1, 1), therefore the support vertex obtained in this direction will be vertex 4 -> redundancy.

I added a condition, so in the next iteration the algorithm will detect the infinite loop (it didn’t get closer to the origin), however the terminating triangle is not on the surface of the CSO -> contact normal will be bad.

I take a look at your code.

]]>
By: William http://www.codezealot.org/archives/180#comment-127013 Sun, 20 Jul 2014 17:32:07 +0000 http://www.codezealot.org/?p=180#comment-127013 @Asylum

EPA should complete in a finite number of iterations for polytopes, although it could run forever on curved solids. Have you been able to get a reproducible test case that you can debug through? Have you looked through my 2D implementation ?

William

]]>
By: Asylum http://www.codezealot.org/archives/180#comment-126996 Sun, 20 Jul 2014 14:29:12 +0000 http://www.codezealot.org/?p=180#comment-126996 Hi!

I have a little problem with the 3D EPA algorithm. Considering a box-box collision, there are cases when the algorithm doesn’t terminate ever: the polytope is just getting bigger with redundant vertices.

Is there any way to detect this? (besides limiting the number of iterations/vertices)

]]>
By: alleysark http://www.codezealot.org/archives/180#comment-120471 Sat, 24 May 2014 13:52:01 +0000 http://www.codezealot.org/?p=180#comment-120471 Hello, and thank you for this awesome article!!
Well, I had a same question with @ng, but I’ve understood it when I write my question :D
Could you please modify your comment at line 15 of findClosestEdge (“get the vector from the edge towards the origin”). I think it got me and @ng mixed up.
Thanks a lot!!

]]>
By: William http://www.codezealot.org/archives/180#comment-97885 Wed, 11 Dec 2013 12:14:09 +0000 http://www.codezealot.org/?p=180#comment-97885 @ng

Can you point to the place in the post where you think it should be in the opposite direction? More specifically, which iteration and which edge calculation?

I am making some assumptions that may not be apparent that may answer your question:
1. I’m using a
2. When computing the vector from A to B, you subtract the vectors in reverse order: A to B becomes B – A.

William

]]>
By: ng http://www.codezealot.org/archives/180#comment-97855 Wed, 11 Dec 2013 07:52:30 +0000 http://www.codezealot.org/?p=180#comment-97855 when you calculate the distance from origin to the edge shouldn’t a or normal( n ) be in opposite direction?

]]>
By: William http://www.codezealot.org/archives/180#comment-51960 Tue, 22 Jan 2013 12:48:27 +0000 http://www.codezealot.org/?p=180#comment-51960 Sure, but how do you know how much to move them without first knowing how much they are penetrating? In addition, what happens when two bodies at rest (both have zero velocity) and are overlapping?

Can you elaborate a little more on what you are describing?

William

]]>
By: honestann http://www.codezealot.org/archives/180#comment-51895 Tue, 22 Jan 2013 01:59:25 +0000 http://www.codezealot.org/?p=180#comment-51895 After a collision, why not separate objects by moving them back along their velocity vectors? This should get the objects back to their actual positions at the TOI (time of impact), which is clearly more precise.

]]>
By: William http://www.codezealot.org/archives/180#comment-33214 Fri, 08 Jun 2012 12:12:41 +0000 http://www.codezealot.org/?p=180#comment-33214 Awesome! Yeah, I meant to put ab.left() instead of abPerp. I fixed it in the previous comment of mine. Thanks for pointing that out!

William

]]>
By: Quentin http://www.codezealot.org/archives/180#comment-33205 Fri, 08 Jun 2012 08:43:24 +0000 http://www.codezealot.org/?p=180#comment-33205 Thank you so much for this fast and accurate answer William !

I’m in 2D(second case) and it works perfectly !

Just a little thing: in your correction I believe it is ab.left and not abPerp.left as abPerp is “null”.

Thanks a lot !

Quentin

]]>