Merge branch 'APercy:main' into main

This commit is contained in:
Gundul 2023-10-12 18:18:46 +02:00 committed by GitHub
commit 505abdda0a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 6 deletions

View file

@ -51,6 +51,7 @@ function airutils.physics(self)
new_velocity = {x=new_velocity.x*friction,
y=new_velocity.y,
z=new_velocity.z*friction}
-- bounciness
if self.springiness and self.springiness > 0 and self.buoyancy >= 1 then
local vnew = vector.new(new_velocity)
@ -82,7 +83,10 @@ function airutils.physics(self)
end --damage the plane if it have hard friction
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

View file

@ -481,11 +481,12 @@ function airutils.logic(self)
if stop ~= true then --maybe == nil
self._last_accell = new_accel
self.object:move_to(curr_pos)
--self.object:set_velocity(velocity)
--[[if player then
airutils.attach(self, player, self._instruction_mode)
end]]--
airutils.set_acceleration(self.object, new_accel)
--airutils.set_acceleration(self.object, new_accel)
local limit = 100
local vel_to_add = vector.multiply(new_accel,self.dtime)
vel_to_add.y = 0
self.object:add_velocity(vel_to_add)
self.object:set_acceleration({x=0,y=new_accel.y, z=0})
else
if stop == true then
self._last_accell = self.object:get_acceleration()