mirror of
https://git.minetest.land/VoxeLibre/VoxeLibre.git
synced 2024-11-26 12:31:05 +01:00
make mob constant for velocity rotate with mob.
this simply makes the constant value for continually adding velocity to a mob rotate when the mob rotates. this is because the constant velocity value was not called often enough.
This commit is contained in:
parent
8778ee6e9e
commit
970011e02b
1 changed files with 6 additions and 0 deletions
|
@ -443,8 +443,14 @@ local set_yaw = function(self, yaw, delay, dtime)
|
||||||
if math.abs(target_shortest_path) > 280*ddtime then
|
if math.abs(target_shortest_path) > 280*ddtime then
|
||||||
if target_shortest_path > 0 then
|
if target_shortest_path > 0 then
|
||||||
self.object:set_yaw(self.object:get_yaw()+3.6*ddtime)
|
self.object:set_yaw(self.object:get_yaw()+3.6*ddtime)
|
||||||
|
if self.acc then
|
||||||
|
self.acc=vector.rotate_around_axis(self.acc,vector.new(0,1,0), 3.6*ddtime)
|
||||||
|
end
|
||||||
else
|
else
|
||||||
self.object:set_yaw(self.object:get_yaw()-3.6*ddtime)
|
self.object:set_yaw(self.object:get_yaw()-3.6*ddtime)
|
||||||
|
if self.acc then
|
||||||
|
self.acc=vector.rotate_around_axis(self.acc,vector.new(0,1,0), -3.6*ddtime)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue