1
0
mirror of https://github.com/SmallJoker/boost_cart.git synced 2024-12-24 18:00:18 +01:00

Reduce eye position, rotation update frequency

This commit is contained in:
SmallJoker 2017-10-28 17:22:47 +02:00
parent 9a2a2b9d69
commit e19d8701ce

View File

@ -307,6 +307,7 @@ function cart_entity:on_step(dtime)
self.object:set_acceleration(new_acc) self.object:set_acceleration(new_acc)
self.old_pos = vector.round(pos) self.old_pos = vector.round(pos)
local old_y_dir = self.old_dir.y
if not vector.equals(dir, {x=0, y=0, z=0}) and not stop_wiggle then if not vector.equals(dir, {x=0, y=0, z=0}) and not stop_wiggle then
self.old_dir = dir self.old_dir = dir
end end
@ -351,7 +352,7 @@ function cart_entity:on_step(dtime)
anim = {x=2, y=2} anim = {x=2, y=2}
end end
self.object:set_animation(anim, 1, 0) self.object:set_animation(anim, 1, 0)
if player then if player and dir.y ~= old_y_dir then
local feet = {x=0, y=0, z=0} local feet = {x=0, y=0, z=0}
local eye = {x=0, y=-4, z=0} local eye = {x=0, y=-4, z=0}
feet.y = boost_cart.old_player_model and 6 or -4.2 feet.y = boost_cart.old_player_model and 6 or -4.2