mirror of
https://github.com/APercy/ap_airship.git
synced 2025-07-04 05:36:55 -04:00
improve physics
This commit is contained in:
parent
a000c0aa51
commit
54cc258cca
1 changed files with 7 additions and 1 deletions
|
@ -81,7 +81,13 @@ function ap_airship.physics(self)
|
|||
self.object:set_velocity(velocity)
|
||||
end
|
||||
--minetest.chat_send_all("_baloon_buoyancy: "..self._baloon_buoyancy.." - dtime: "..self.dtime.." - ideal: "..ap_airship.ideal_step)
|
||||
airutils.set_acceleration(self.object,{x=0,y=y_accel,z=0})
|
||||
|
||||
local max_y_speed = 1.5
|
||||
local curr_y_speed = vel.y
|
||||
if curr_y_speed < max_y_speed then
|
||||
airutils.set_acceleration(self.object,{x=0,y=y_accel,z=0})
|
||||
else
|
||||
airutils.set_acceleration(self.object,{x=0,y=0,z=0})
|
||||
end
|
||||
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue