Split speed into horizontal and vetical components

This commit is contained in:
Wuzzy 2016-10-27 23:49:59 +02:00
parent 76492972fb
commit f3b8c92db1
3 changed files with 16 additions and 9 deletions

@ -278,15 +278,21 @@ function update_hud_displays(player)
str_time = ""
end
local speed
local speed_hor, speed_ver
local v
local attach = player:get_attach()
if attach == nil then
speed = vector.length(player:get_player_velocity())
v = player:get_player_velocity()
else
speed = vector.length(attach:getvelocity())
v = attach:getvelocity()
end
speed_ver = v.y
v.y = 0
speed_hor = vector.length(v)
if speedometer or quadcorder then
str_speed = string.format(S("Speed: %.1f %s"), speed, orienteering.settings.speed_unit)
local u = orienteering.settings.speed_unit
str_speed = string.format(S("Speed: hor.: %.1f %s, vert.: %.1f %s"), speed_hor, u, speed_ver, u)
else
str_speed = ""
end
@ -337,7 +343,7 @@ if minetest.get_modpath("doc_items") ~= nil then
["orienteering:altimeter"] = S("It shows you your current elevation (Y)."),
["orienteering:triangulator"] = S("It shows you the coordinates of your current position in the horizontal plane (X and Z)."),
["orienteering:gps"] = S("The GPS device shows you your coordinates (X, Y and Z), your yaw (horizontal viewing angle) and the time."),
["orienteering:speedometer"] = S("It shows you your current speed in meters per second, where one meter is the side length of a single cube."),
["orienteering:speedometer"] = S("It shows you your current horizontal (“hor.”) and vertical (“ver.”) speed in meters per second, where one meter is the side length of a single cube."),
["orienteering:watch"] = S("It shows you the current time."),
["orienteering:quadcorder"] = S("This is the ultimate orientieering tool. It shows you your coordinates (X, Y and Z), shows your yaw and pitch (horizontal and vertical viewing angles), the current time, your current speed and it enables you to access the minimap."),
["orienteering:automapper"] = S("The automapper automatically creates a map of the area around you and enables you to view a minimap of your surroundings. It also has a built-in radar."),

@ -19,7 +19,7 @@ a.m. = AM
Time: %i:%02i %s = Uhrzeit: %i:%02i %s
Time: %02i:%02i = Uhrzeit: %02i:%02i
Speed: %.1f %s = Tempo: %.1f %s
Speed: hor.: %.1f %s, vert.: %.1f %s = Tempo: hor.: %.1f %s, vert.: %.1f %s
m = m
m/s = m/s
@ -36,7 +36,7 @@ It shows you your pitch (vertical viewing angle) in degrees. = Er zeigt Ihnen Ih
It shows you your current elevation (Y). = Er zeigt Ihnen Ihre momentane Höhe (Y).
It shows you the coordinates of your current position in the horizontal plane (X and Z). = Er zeigt Ihnen die Koordinaten Ihrer aktuellen Position auf der horizontalen Ebene (X und Z).
The GPS device shows you your coordinates (X, Y and Z), your yaw (horizontal viewing angle) and the time. = Das GPS-Gerät zeigt Ihnen Ihre Koordinaten (X, Y und Z), Ihre Gierung (horizontaler Blickwinkel) und die Zeit.
It shows you your current speed in meters per second, where one meter is the side length of a single cube. = Er zeigt Ihnen ihre aktuelle Geschwindigkeit in Metern pro Sekunde, wobei hier ein Meter die Kantenlänge eines einzelnen Würfels ist.
It shows you your current horizontal (“hor.”) and vertical (“ver.”) speed in meters per second, where one meter is the side length of a single cube. = Er zeigt Ihnen ihre aktuelle horizontale (»hor.«) und vertikale (»vert.«) Geschwindigkeit in Metern pro Sekunde, wobei hier ein Meter die Kantenlänge eines einzelnen Würfels ist.
It shows you the current time. = Es zeigt Ihnen die aktuelle Uhrzeit.
This is the ultimate orientieering tool. It shows you your coordinates (X, Y and Z), shows your yaw and pitch (horizontal and vertical viewing angles), the current time, your current speed and it enables you to access the minimap. = Dies ist das ultimative Werkzeug für die Orientierung. Es zeigt Ihnen Ihre aktuellen Koordinaten (X, Y, und Z), zeigt Ihren Gier- und Nickwinkel (horizontaler und vertikaler Blickwinkel), die aktuelle Uhrzeit, Ihre aktuelle Geschwindigkeit und es ermöglicht es Ihnen, auf die Kleinkarte zuzugreifen.
The automapper automatically creates a map of the area around you and enables you to view a minimap of your surroundings. It also has a built-in radar. = Der Autokartierer erstellt automatisch eine Karte von Ihrer näheren Umgebung und ermöglicht es Ihnen, eine Kleinkarte davon zu betrachten. Er hat außerdem einen eingebauten Radar.

@ -36,7 +36,8 @@ m
m/s
# %.1f will be replaced by number, %s will be replaced by speed unit
Speed: %.1f %s
# "hor." = "horizontal"; "vert." = "vertical"
Speed: hor.: %.1f %s, vert.: %.1f %s
# awards
Master of Orienteering
@ -48,7 +49,7 @@ It shows you your pitch (vertical viewing angle) in degrees.
It shows you your current elevation (Y).
It shows you the coordinates of your current position in the horizontal plane (X and Z).
The GPS device shows you your coordinates (X, Y and Z), your yaw (horizontal viewing angle) and the time.
It shows you your current speed in meters per second, where one meter is the side length of a single cube.
It shows you your current horizontal (“hor.”) and vertical (“ver.”) speed in meters per second, where one meter is the side length of a single cube.
It shows you the current time.
This is the ultimate orientieering tool. It shows you your coordinates (X, Y and Z), shows your yaw and pitch (horizontal and vertical viewing angles), the current time, your current speed and it enables you to access the minimap.
The automapper automatically creates a map of the area around you and enables you to view a minimap of your surroundings. It also has a built-in radar.