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

Inconsitent rotation directions #1088

Closed
einarf opened this issue Feb 6, 2022 · 5 comments · Fixed by #1624
Closed

Inconsitent rotation directions #1088

einarf opened this issue Feb 6, 2022 · 5 comments · Fixed by #1624
Labels
Milestone

Comments

@einarf
Copy link
Member

einarf commented Feb 6, 2022

draw_rectangle_filled rotates clockwise while draw_rectangle_outline rotates counter-clockwise with the same angle values. This might be related to how rotate_points works.

This needs more investigation since a lot of things use rotate_point in arcde.

EDIT: This is because the outline version calls rotate_points while shapes are rotated in shader

EDIT: The conclusion is that rotations have historically been counter clockwise in arcade. In 2.4 some shapes started to rotate in the other direction due to shader rewrite and optimizations.

We have two variants of rotation matrices in shaders:

    mat2 rot = mat2(
        cos(angle), -sin(angle),
        sin(angle),  cos(angle)
    );
    mat2 rot = mat2(
        cos(angle), sin(angle),
        -sin(angle), cos(angle)
    );

.. and rotate_point is counter clockwise by default.

@pvcraven pvcraven added the bug label Feb 6, 2022
@einarf
Copy link
Member Author

einarf commented Feb 7, 2022

scissor

@einarf einarf changed the title draw_rectangle_filled / draw_rectangle_outline angle Inconsitent rotation directions Feb 7, 2022
@einarf
Copy link
Member Author

einarf commented Feb 7, 2022

Sprites rotate counter clockwise including the hit box points:
rotate

@einarf
Copy link
Member Author

einarf commented Feb 7, 2022

Arcade 2.2
old_arcade

@einarf einarf added this to the 2.7 milestone Apr 3, 2022
@einarf
Copy link
Member Author

einarf commented Feb 28, 2023

@pvcraven This was fixed and everything is counter-clockwise now right?

@einarf
Copy link
Member Author

einarf commented Mar 7, 2023

#1624

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants