From 631321b1cf214cfce52a572cb38286c51aba539a Mon Sep 17 00:00:00 2001 From: Alexsandro Percy Date: Sun, 29 May 2022 14:10:51 -0300 Subject: [PATCH] improved --- physics_lib.lua | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/physics_lib.lua b/physics_lib.lua index df92c39..fb5d38d 100755 --- a/physics_lib.lua +++ b/physics_lib.lua @@ -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)