Now I have:
Sprite.SetCenter(Sprite.GetSize() / 2.f);
if (App.GetInput().GetMouseX() <= Sprite.GetPosition().x) {
Sprite.SetRotation (-1* 360 / 3.1415926535 * (atan2( static_cast<double> (Sprite.GetPosition().y - App.GetInput().GetMouseY()) , static_cast<double> (Sprite.GetPosition().x - App.GetInput().GetMouseX()))));
} else {
Sprite.SetRotation (-1* 360 / 3.1415926535 *(atan2( static_cast<double> (Sprite.GetPosition().y - App.GetInput().GetMouseY()) , static_cast<double> (Sprite.GetPosition().x - App.GetInput().GetMouseX()))));
}
App.ConvertCoords(App.GetInput().GetMouseX(), App.GetInput().GetMouseY());
but still doesn't work properly. The same story :/
EDIT:
Success! It must look like this:
Sprite.SetCenter(Sprite.GetSize() / 2.f);
if (App.GetInput().GetMouseX() <= Sprite.GetPosition().x) {
Sprite.SetRotation (((-1* 360 / 3.1415926535 * (atan2( static_cast<double> (Sprite.GetPosition().y - App.GetInput().GetMouseY()) , static_cast<double> (Sprite.GetPosition().x - App.GetInput().GetMouseX()))))/2)+90);
} else {
Sprite.SetRotation (((-1* 360 / 3.1415926535 *(atan2( static_cast<double> (Sprite.GetPosition().y - App.GetInput().GetMouseY()) , static_cast<double> (Sprite.GetPosition().x - App.GetInput().GetMouseX()))))/2)+90);
}
Thanks for help!