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.
]]>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
]]>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)
]]>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
]]>Can you elaborate a little more on what you are describing?
William
]]>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
]]>