Fix rotation display.

This commit is contained in:
bʰedoh₂ swé 2024-04-04 23:31:45 +05:00
parent 8169e9e7c3
commit adf47220c7

View File

@ -3,7 +3,7 @@ from numba import jit
from time import time_ns, sleep from time import time_ns, sleep
from cmath import exp, pi from cmath import exp, pi
from math import acos from math import acos, copysign
import pygame import pygame
import pygame.freetype import pygame.freetype
from gyro import * 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] 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] 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 return fps_surf, cPos_surf, cRot_surf