mirror of
https://github.com/APercy/airutils.git
synced 2025-03-21 18:41:21 +00:00
changed custom physics to use add_velocity instead of set_velocity
This commit is contained in:
parent
f36c129d64
commit
3f12d89a8d
1 changed files with 5 additions and 1 deletions
|
@ -51,6 +51,7 @@ function airutils.physics(self)
|
||||||
new_velocity = {x=new_velocity.x*friction,
|
new_velocity = {x=new_velocity.x*friction,
|
||||||
y=new_velocity.y,
|
y=new_velocity.y,
|
||||||
z=new_velocity.z*friction}
|
z=new_velocity.z*friction}
|
||||||
|
|
||||||
-- bounciness
|
-- bounciness
|
||||||
if self.springiness and self.springiness > 0 and self.buoyancy >= 1 then
|
if self.springiness and self.springiness > 0 and self.buoyancy >= 1 then
|
||||||
local vnew = vector.new(new_velocity)
|
local vnew = vector.new(new_velocity)
|
||||||
|
@ -82,7 +83,10 @@ function airutils.physics(self)
|
||||||
end --damage the plane if it have hard friction
|
end --damage the plane if it have hard friction
|
||||||
end
|
end
|
||||||
|
|
||||||
self.object:set_velocity(new_velocity)
|
--self.object:set_velocity(new_velocity)
|
||||||
|
local vel_sum = vector.subtract(new_velocity,vel)
|
||||||
|
self.object:add_velocity(vel_sum)
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
Loading…
Add table
Reference in a new issue