-
-
Notifications
You must be signed in to change notification settings - Fork 882
core: Fix some issues with hitTest
#7684
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
Conversation
I'll add a test case for this tomorrow; this could use some testing as games are very sensitive to changes here. @Aaron1011 Could you check if this solves the issue in Wonderputt? |
2a46a04
to
7252817
Compare
@Herschel While this branch does fix the specific point tested in my SWF, it unfortunately doesn't seem to resolve the full issue. By moving my mouse around inside the largest empty region, I was able to generate many more incorrect 'hit' points. I've updated https://github.com/Aaron1011/ruffle/tree/hittest-debug to test for these points by default, and to mark each with a purple pixel. Running the SWF in Flash Player traces 'false' for all of those points, while running in on this branch traces 'true' for all of them except the first one (which was fixed by this PR). |
(FWIW this also doesn't fix #4064 yet.) |
This fixes an issue in Steppenwolf 3-1. It was impossible to hide behind the tunnel without jumping: steppen.mp4In Ultimate Flash Sonic, the character seems to get stuck less often. But I also noticed a few regressions: sonic1.mp4sonic2.mp4The game in #5481 (which is not a platformer) doesn't seem to like these changes, as unexpected collisions happen more often even when the file is displayed in its natural dimensions. |
7252817
to
146556e
Compare
hitTest
146556e
to
ea98292
Compare
Wonderputt holes 1 and 14 no longer have false-positive hits with this PR. |
ea98292
to
4c60b5b
Compare
Thanks for testing! I checked with all of the above cases and it seems okay. I also added the Wonderputt shape to the hitTest test. @Toad06 could you give this a bit more testing? |
Looks like #4064 still has some issues. |
No regression found. 👍 This also fixes Monkey Lander, NoName Game (#5481), NoName Game 2 which were impossible to complete. |
4c60b5b
to
b9701a9
Compare
Fixes some issues with our winding # calculation which would cause incorrect results for hitTest. * The convention for handling an intersection at endpoints was not the same between lines and bezier curves. * The bezier curve winding # function was not properly handling some cases where the curve was strictly y-monotonic. * Simplify the code a bit so that ray-curve intersections are returned in a consistent order based on upward/downward crossing.
b9701a9
to
16ae12f
Compare
Fixes some issues with our winding # calculation which would cause incorrect results for
hitTest
.