Rotate yaw clockwise (like real compasses)

This commit is contained in:
Wuzzy 2019-09-14 22:21:27 +02:00
parent c74eb0b489
commit e04a9e8b3e

@ -332,7 +332,8 @@ function orienteering.update_hud_displays(player)
str_pos = "" str_pos = ""
end end
local yaw = player:get_look_horizontal()*toDegrees -- Yaw in Minetest goes counter-clockwise, which is opposite of how compasses work
local yaw = 360-player:get_look_horizontal()*toDegrees
local pitch = player:get_look_vertical()*toDegrees local pitch = player:get_look_vertical()*toDegrees
if ((compass or gps) and sextant) or quadcorder then if ((compass or gps) and sextant) or quadcorder then
str_angles = S("Yaw: @1°, pitch: @2°", string.format("%.1f", yaw), string.format("%.1f", pitch)) str_angles = S("Yaw: @1°, pitch: @2°", string.format("%.1f", yaw), string.format("%.1f", pitch))