more fixed from abs

This commit is contained in:
Alexsandro Percy 2023-07-08 17:08:15 -03:00
parent 3496cc07d7
commit 22fe149890
2 changed files with 2 additions and 2 deletions

View file

@ -291,7 +291,7 @@ function airutils.getLiftAccel(self, velocity, accel, longit_speed, roll, curr_p
local cross = vector.cross(velocity,hdir)
local lift_dir = vector.normalize(vector.cross(cross,hdir))
local lift_coefficient = (0.24*abs(daoa)*(1/(0.025*daoa+3))^4*math.sign(daoa))
local lift_coefficient = (0.24*math.abs(daoa)*(1/(0.025*daoa+3))^4*math.sign(daoa))
local lift_val = math.abs((lift*(vector.length(striped_velocity)^2)*lift_coefficient)*curr_percent_height)
if lift_val < 1 then lift_val = 1 end -- hipotetical aerodinamic wing will have no "lift" for down
--minetest.chat_send_all('lift: '.. lift_val)

View file

@ -83,7 +83,7 @@ function airutils.control(self, dtime, hull_direction, longit_speed, longit_drag
engineacc = longit_speed * -1
end
end
if abs(longit_speed) < 0.2 then
if math.abs(longit_speed) < 0.2 then
stop = true
end
end