From adf47220c7b4db6f641674e996bb9c6ac556cccb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?b=CA=B0edoh=E2=82=82=20sw=C3=A9?= Date: Thu, 4 Apr 2024 23:31:45 +0500 Subject: [PATCH] Fix rotation display. --- main.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/main.py b/main.py index d13e44b..2c77a27 100755 --- a/main.py +++ b/main.py @@ -3,7 +3,7 @@ from numba import jit from time import time_ns, sleep from cmath import exp, pi -from math import acos +from math import acos, copysign import pygame import pygame.freetype from gyro import * @@ -80,7 +80,7 @@ def renderDebugInfo(gPlayer, clock, fontSize = 18): fps_surf = font.render("FPS: " + str(int(clock.get_fps())), font_fg, font_bg)[0] cPos_surf = font.render("cPos: " + str(gPlayer.cPos), font_fg, font_bg)[0] - cRot_surf = font.render("cRot: " + str(acos(gPlayer.cRot.real) / pi * 180), font_fg, font_bg)[0] + cRot_surf = font.render("cRot: " + str(copysign(acos(gPlayer.cRot.real),gPlayer.cRot.imag) / pi * 180), font_fg, font_bg)[0] return fps_surf, cPos_surf, cRot_surf