mirror of
https://codeberg.org/SumianVoice/sum_airship.git
synced 2025-03-15 04:11:23 +00:00
use air currents for smoke
This commit is contained in:
parent
de71343291
commit
8bbae029e5
1 changed files with 7 additions and 3 deletions
10
init.lua
10
init.lua
|
@ -348,8 +348,12 @@ function boat.on_step(self, dtime, moveresult)
|
|||
vel = {x=0, y=-0.6, z=0}
|
||||
end
|
||||
|
||||
if has_air_currents and (self._driver or not is_on_floor) then
|
||||
vel = sum_air_currents.apply_wind(vel, p)
|
||||
local wind_vel = vector.new(0,0,0)
|
||||
if has_air_currents then
|
||||
wind_vel = sum_air_currents.get_wind(p)
|
||||
if self._driver or not is_on_floor then
|
||||
vel = vector.add(wind_vel, vel)
|
||||
end
|
||||
end
|
||||
|
||||
local v = self.object:get_velocity()
|
||||
|
@ -379,7 +383,7 @@ function boat.on_step(self, dtime, moveresult)
|
|||
local spread = 0.06
|
||||
minetest.add_particle({
|
||||
pos = vector.offset(chimney_pos, math.random(-1, 1)*spread, 0, math.random(-1, 1)*spread),
|
||||
velocity = {x=0, y=math.random(0.2*100,0.7*100)/100, z=0},
|
||||
velocity = vector.add(wind_vel, {x=0, y=math.random(0.2*100,0.7*100)/100, z=0}),
|
||||
expirationtime = math.random(0.5, 2),
|
||||
size = math.random(0.1, 4),
|
||||
collisiondetection = false,
|
||||
|
|
Loading…
Add table
Reference in a new issue