New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix Intersector#overlapConvexPolygons #5048
Conversation
I think your fix doesn't work for other cases. Imagine a right triangle (1 angle is 90º) with 2 equal sides resting on one cathetus (short side). The center point of that triangle will be in the middle of the hypotenuse. Imagine now a small rectangle with the same center than the triangle. If I understand your fix correctly in that case MTV will resolve to 0,0 (which is not correct). Now, imagine we move the rectangle diagonally up-right or down-left the MTV will invert but it actually should keep being positive x and y. I think it's a complex geometry problem with complex corner cases. |
So i had also issues with the function |
On a first look it looks a good. I think we can use your SAT algorithm implementation as a base to replace the current buggy implementation. I think there's a some room for improvement (such as using |
…apConvexPolygons in Intersector should now work as expected. -Added graphical test.
Now that we have #5048, can we close this one? |
It will get closed when the PR is merged and closed.
…On Sat, Sep 12, 2020, 10:39 Benjamin Schulte ***@***.***> wrote:
Now that we have #5048 <#5048>, can
we close this one?
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#5048 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AANWDPAJQF3RJX7H3R54BOLSFMXS5ANCNFSM4EKLHBBA>
.
|
In some rare cases it's possible that Intersector#overlapConvexPolygons calculates an incorrect MTV. Currently the direction of the MTV is negated depending on the number of points on either side of the checked edge.
The correct way is to negate the direction of the MTV depending on the direction of the centers of both polygons.