aboutsummaryrefslogtreecommitdiff
path: root/src/GameLoop.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/GameLoop.cpp')
-rw-r--r--src/GameLoop.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/GameLoop.cpp b/src/GameLoop.cpp
index 9aaff92..caa3c1b 100644
--- a/src/GameLoop.cpp
+++ b/src/GameLoop.cpp
@@ -19,6 +19,8 @@
// You should have received a copy of the GNU General Public License
// along with Black Shades. If not, see <https://www.gnu.org/licenses/>.
+#include <cmath>
+
#include "Game.h"
#include "misc.h"
@@ -142,7 +144,7 @@ void handleKey(Game* game, int key, int action, int mods)
XYZ towards = player.playercoords - game->bodycoords;
if (towards.x || towards.z) {
Normalise(&towards);
- camera.rotation = RadiansToDegrees(asin(towards.x));
+ camera.rotation = asin(towards.x) * 180.0f / M_PI;
if (towards.z > 0)
camera.rotation = 180 - camera.rotation;