mirror of
https://git.minetest.land/VoxeLibre/VoxeLibre.git
synced 2025-01-09 16:49:35 +01:00
Fix orientation of carts on slopes
This commit is contained in:
parent
e28b55c16a
commit
6559bc23f9
1 changed files with 2 additions and 5 deletions
|
@ -469,9 +469,9 @@ function mod.update_cart_orientation(self)
|
||||||
|
|
||||||
-- Forward/backwards tilt (pitch)
|
-- Forward/backwards tilt (pitch)
|
||||||
if dir.y > 0 then
|
if dir.y > 0 then
|
||||||
rot.x = -_quart_pi
|
|
||||||
elseif dir.y < 0 then
|
|
||||||
rot.x = _quart_pi
|
rot.x = _quart_pi
|
||||||
|
elseif dir.y < 0 then
|
||||||
|
rot.x = -_quart_pi
|
||||||
else
|
else
|
||||||
rot.x = 0
|
rot.x = 0
|
||||||
end
|
end
|
||||||
|
@ -479,9 +479,6 @@ function mod.update_cart_orientation(self)
|
||||||
if ( staticdata.rot_adjust or 0 ) < 0.01 then
|
if ( staticdata.rot_adjust or 0 ) < 0.01 then
|
||||||
rot.x = -rot.x
|
rot.x = -rot.x
|
||||||
end
|
end
|
||||||
if dir.z ~= 0 then
|
|
||||||
rot.x = -rot.x
|
|
||||||
end
|
|
||||||
|
|
||||||
rot.y = (rot.y + _half_pi) % _2_pi
|
rot.y = (rot.y + _half_pi) % _2_pi
|
||||||
self.object:set_rotation(rot)
|
self.object:set_rotation(rot)
|
||||||
|
|
Loading…
Reference in a new issue