Hi.
I've got strange problem with sprite rotation to mouse coords.
sf::Vector2i cursor = sf::Mouse::getPosition(game);
sf::Vector2f worldCursor = game.convertCoords(cursor.x, cursor.y);
sf::Vector2f direction = (worldCursor - Player.getPosition());
Player.setRotation(std::atan2(direction.y, direction.x));
Player is not rotating properly.
I found this code on this forum and to compile i need to add sf::Vector2i to worldCursor.
Thanks in advance for help.