This commit is contained in:
Alexsandro Percy 2022-05-29 14:10:51 -03:00
parent fb043c76a8
commit 631321b1cf
1 changed files with 4 additions and 0 deletions

View File

@ -11,6 +11,10 @@ local min = math.min
local tan = math.tan
local pow = math.pow
local sign = function(x)
return (x<0) and -1 or 1
end
function airutils.rot_to_dir(rot) -- keep rot within <-pi/2,pi/2>
local dir = minetest.yaw_to_dir(rot.y)
dir.y = dir.y+tan(rot.x)*vector.length(dir)