Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: Sprite getRotation returning negative (2RC)  (Read 2091 times)

0 Members and 1 Guest are viewing this topic.

Jove

  • Full Member
  • ***
  • Posts: 114
    • View Profile
    • http://www.jestofevekites.com/
Sprite getRotation returning negative (2RC)
« on: July 15, 2012, 02:26:05 pm »
I looked around first, search wasn't working for me and didn't see anything on the tracker.

When I do a getRotation from a sprite, the result isn't between 0-360.

This...
sf::Sprite test;
test.rotate(-10);
cout << test.getRotation();

...will return a -10 instead of 350.

Getting a View's rotation is ok though.

Apologies if I've missed something, 1.6 had the documented behaviour.
{much better code}

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11030
    • View Profile
    • development blog
    • Email
Re: Sprite getRotation returning negative (2RC)
« Reply #1 on: July 15, 2012, 02:44:47 pm »
I can confirm this bug. :-\

The doc says:
Quote
float sf::Transformable::getRotation() const
get the orientation of the object

The rotation is always in the range [0, 360].

Returns:
Current rotation, in degrees

Since I haven't found an issue on the track, I guess you could create a new issue there.
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Re: Sprite getRotation returning negative (2RC)
« Reply #2 on: July 15, 2012, 02:53:43 pm »
Thanks, it's fixed.
Laurent Gomila - SFML developer

 

anything