mirror of
https://github.com/luanti-org/minetest_game.git
synced 2025-05-21 14:53:16 -04:00
WIP: boats: rotate boat driver, during boat rotation
Currently during boat rotation, the boat driver view do not change. With this simple patch the rotation is made also for driver. This way is more natural for vehicles (cars, carts, boats, airplanes etc.)
This commit is contained in:
parent
52c6921cb2
commit
afbee2845a
1 changed files with 4 additions and 0 deletions
|
@ -159,14 +159,18 @@ function boat.on_step(self, dtime)
|
|||
if ctrl.left then
|
||||
if self.v < -0.001 then
|
||||
self.object:set_yaw(self.object:get_yaw() - dtime * 0.9)
|
||||
driver_objref:set_look_horizontal(driver_objref:get_look_horizontal() - dtime * 0.9)
|
||||
else
|
||||
self.object:set_yaw(self.object:get_yaw() + dtime * 0.9)
|
||||
driver_objref:set_look_horizontal(driver_objref:get_look_horizontal() + dtime * 0.9)
|
||||
end
|
||||
elseif ctrl.right then
|
||||
if self.v < -0.001 then
|
||||
self.object:set_yaw(self.object:get_yaw() + dtime * 0.9)
|
||||
driver_objref:set_look_horizontal(driver_objref:get_look_horizontal() + dtime * 0.9)
|
||||
else
|
||||
self.object:set_yaw(self.object:get_yaw() - dtime * 0.9)
|
||||
driver_objref:set_look_horizontal(driver_objref:get_look_horizontal() - dtime * 0.9)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Reference in a new issue