so the value ranges from 0 rad to 2*PI rad that is 0° to 360° Degree while rotation is counter-clockwise.
to transform rad into degree I used math.deg(rot).
since I need the roataion clocwise I used 360-math.deg(rot).
So the full part reads like this:
local look_dir = 360-math.deg(player:get_look_horizontal())
I stored the look dir of the players in a mysql database, to make the players visible on a map.
After a day I took a look into the database and saw the players with rotation values much more then 360 Degree.
- Code: Select all
jerry 711
Psycho_Girl 678
schnico 678
puppy101 631
Jausta 625
x-man 519
Frisk 512
Joker 494
Xnorxor 436
pilouptichou 425
SpursFan 406
adoniram 383
maximus 367
Geater681 360
Hotaru 360
Shavon300 360
424346466 360
Julian2AJ 360
evelina 360
Jare 360
Tequila902 360
natstya 360
000000005555555 360
VeRnO 360
Lleopinopalo 360
addi 358
Delacuesta638 357
penguins 355
roza 355
So what value does player:get_look_horizontal() return and what range does it have?
I could not reproduce the behavior of the > 360° players with my client, so does only older clients report a wrong rotation to the server?