-
Notifications
You must be signed in to change notification settings - Fork 18
FlxU.rotatePoint() #53
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
Comments
Comment by: Beeblerox This should be |
Comment by: axcho This is a major issue. I believe that @scaven is correct in his proposed solution: Update: |
Comment by: avoxgames Simple test: rotatePoint(X, Y, 0, 0, 0) should return (X, Y), not (X, -Y) |
I have been playing around with this, and I pushed some test code to the Sandbox. The fix (though, Adam's math is confusing me a bit, and I'm not a fan of all those arbitrary values just thrown in, but I'll live. Also the accuracy is off by a bit, but the difference is tiny, and is understandable if you are incrementing gradually thousands of times rather than setting rotations by a specific value. Developers should expect this.)
I have tested, and
|
Alternatively (and this I believe looks more "symmetrical" code-wise) we can use this code which also fixes the issue: var dx:Number = X-PivotX;
var dy:Number = Y-PivotY;
Point.x = PivotX + cos*dx + sin*dy;
Point.y = PivotY - sin*dx + cos*dy; |
There's already a pull request with your proposed fix: #128 |
Yep, but it seems like SeiferTim is a tad busy at the moment, which is why I'm picking this issue up. I was going to try my hand at fixing the pathfinding, and there also seemed to be some line break issues in the pull request which I would see if I could avoid. Would you happen to have any of the "testing code" you used for the pathfinding left? |
Any pathfinding code should show the problem. You can use the flixel pathfinding demo: https://code.google.com/p/mightiesthero-flash-game-dev-tips/source/browse/FlxPathFinding/src/PlayState.as |
I'm moving this issue to the "future release" milestone. If we fix |
Issue #178 by: scaven
line 569:
var dy:Number = PivotY+Y; //Y axis is inverted in flash, normally this would be a subtract operation
should clearly be subtract operation (err.. maybe normality changed recently?)
change to:
var dy:Number = PivotY-Y;
The text was updated successfully, but these errors were encountered: