mirror of
https://github.com/ElCeejo/creatura.git
synced 2025-04-30 13:51:41 -04:00
Add limit to bouyancy
This commit is contained in:
parent
738be4d003
commit
fc6a203da2
1 changed files with 3 additions and 1 deletions
|
@ -935,9 +935,11 @@ local function water_physics(self)
|
|||
local submergence = surface_pos.y - floor_pos.y
|
||||
local vel = self.object:get_velocity()
|
||||
local bouyancy = self.bouyancy_multiplier or 1
|
||||
local accel = (submergence - vel.y * abs(vel.y) * 0.4) * bouyancy
|
||||
if accel > 4.9 then accel = 4.9 end
|
||||
self.object:set_acceleration({
|
||||
x = 0,
|
||||
y = (submergence - vel.y * abs(vel.y) * 0.4) * bouyancy,
|
||||
y = accel,
|
||||
z = 0
|
||||
})
|
||||
local hydrodynamics = self.hydrodynamics_multiplier or 0.7
|
||||
|
|
Loading…
Add table
Reference in a new issue