mirror of
https://github.com/APercy/airutils.git
synced 2025-03-21 18:41:21 +00:00
added lift dead zone parameter
This commit is contained in:
parent
5c50282e94
commit
0b73fa504b
1 changed files with 6 additions and 0 deletions
6
init.lua
6
init.lua
|
@ -340,9 +340,15 @@ function airutils.getLiftAccel(self, velocity, accel, longit_speed, roll, curr_p
|
||||||
local lift_coefficient = (0.24*math.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)
|
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
|
if lift_val < 1 then lift_val = 1 end -- hipotetical aerodinamic wing will have no "lift" for down
|
||||||
|
|
||||||
if self._climb_speed then --for helicopters
|
if self._climb_speed then --for helicopters
|
||||||
if (velocity.y) > self._climb_speed then lift_val = math.abs(airutils.gravity) end
|
if (velocity.y) > self._climb_speed then lift_val = math.abs(airutils.gravity) end
|
||||||
end
|
end
|
||||||
|
if self._lift_dead_zone then
|
||||||
|
if lift_val < (math.abs(airutils.gravity)+self._lift_dead_zone) and lift_val > (math.abs(airutils.gravity)-self._lift_dead_zone) then
|
||||||
|
lift_val = math.abs(airutils.gravity)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
if airutils.show_lift then
|
if airutils.show_lift then
|
||||||
minetest.chat_send_player(airutils.show_lift,core.colorize('#ffff00', " >>> lift: "..lift_val))
|
minetest.chat_send_player(airutils.show_lift,core.colorize('#ffff00', " >>> lift: "..lift_val))
|
||||||
|
|
Loading…
Add table
Reference in a new issue