0 Members and 1 Guest are viewing this topic.
sf::Vector2f mTP = sf::Vector2f(WMain.GetInput().GetMouseX()-tTurrTankS.GetPosition().x,WMain.GetInput().GetMouseY()-tTurrTankS.GetPosition().y); float fAngle = atan(mTP.x/mTP.y); if(mTP.x == 0 && mTP.y == 0) fAngle = 0; fAngle *= 180/3.14159; if(mTP.y >= 0) fAngle += 180; tTurrTankS.SetRotation(fAngle);