Skip to content
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

Fixes collision detection with the function overlapConvexPolygons #6184

Closed
wants to merge 1 commit into from

Conversation

kdenzel
Copy link
Contributor

@kdenzel kdenzel commented Sep 11, 2020

Hello everyone, this should fix #5048

Sorry for not adding a non graphical test but the magic happens in the SAT Algorithm. If you are familiar with the algorithm the placement and the orientation of the minimum translation vector happens on the one dimensional axis.
The magic happens when we project the axis of the max and min points of the polygon and based on the scalar value (dot product) of this values i calculate the direction of the minimum translation vector. You can see this with the red line in the graphical Test.

TL;DR i added no functional Test because of math magic. It is hard to predict the assert value so a graphical test with debug output says more than 1mio asserts.

Also you see in the code and in the graphical test i also handle edge cases like when one polygon contains another.

@kdenzel
Copy link
Contributor Author

kdenzel commented Sep 11, 2020

WTF, I did something wrong >.> it just updated the changes file >.<

@kdenzel kdenzel closed this Sep 11, 2020
@kdenzel kdenzel deleted the patch-1 branch September 11, 2020 20:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant