check accell values before apply

master
Alexsandro Percy 2022-08-10 10:44:57 -03:00
parent 8af820a654
commit 7162a0fb35
1 changed files with 4 additions and 1 deletions

View File

@ -76,7 +76,10 @@ function pa28.physics(self)
if new_velocity then
new_velocity = vector.add(new_velocity, vector.multiply(self._last_accell, self.dtime))
if new_velocity.x == nil then new_velocity.x = 0 end
if new_velocity.y == nil then new_velocity.y = 0 end
if new_velocity.z == nil then new_velocity.z = 0 end
--[[
new_velocity correction
under some circunstances the velocity exceeds the max value accepted by set_velocity and