gdx-spriter icon indicating copy to clipboard operation
gdx-spriter copied to clipboard

Rotation handled incorrectly when rotation center is changed during animation

Open dantel35 opened this issue 7 years ago • 2 comments

Hi, first of all - thanks a lot for this implementation. Most things are working great and it is a big help handling spriter in libgdx.

Unfortunately there is a bug with the rotation handling logic when you change the rotation center during your animation. Here is an attached example: roundrect_bug_report.zip

If you play that in Spriter it looks like that: example

If you play it in libgdx with this Spriter implementation, it looks like the following: example_libgdx

Notice how at the end the stick is falling back to the point where it started, as it should be, in spriter but is drifting to the right in libgdx.

What happens is that the rotation center is at the left corner of the stick at first until apprx. the middle of the animation and then it is changed to the right side of the stick.

Unfortunately I am not familiar enough with the code to offer a fix but I wanted to point it out anyway.

Cheers.

dantel35 avatar Jun 23 '18 09:06 dantel35

I did some changes to the coordinate handling to fix a problem with my code. Maybe you want to try out the changes from https://github.com/SebastianSchlegel/gdx-spriter/commit/30887348fd85516a5e48df0a9c3d7782b616f2fe

SebastianSchlegel avatar Jul 18 '18 21:07 SebastianSchlegel

@SebastianSchlegel The commit would break any other animation which has pivot positions != (0,0).

Trixt0r avatar Jul 19 '18 07:07 Trixt0r