diff --git a/automobiles_motorcycle/models/automobiles_motorcycle_body.b3d b/automobiles_motorcycle/models/automobiles_motorcycle_body.b3d index 525018c..9545c36 100755 Binary files a/automobiles_motorcycle/models/automobiles_motorcycle_body.b3d and b/automobiles_motorcycle/models/automobiles_motorcycle_body.b3d differ diff --git a/automobiles_motorcycle/models/automobiles_motorcycle_body_.b3d b/automobiles_motorcycle/models/automobiles_motorcycle_body_.b3d new file mode 100755 index 0000000..525018c Binary files /dev/null and b/automobiles_motorcycle/models/automobiles_motorcycle_body_.b3d differ diff --git a/automobiles_motorcycle/motorcycle_entities.lua b/automobiles_motorcycle/motorcycle_entities.lua index 2ef3bc6..a683796 100755 --- a/automobiles_motorcycle/motorcycle_entities.lua +++ b/automobiles_motorcycle/motorcycle_entities.lua @@ -462,6 +462,7 @@ minetest.register_entity("automobiles_motorcycle:motorcycle", { if stop == true then self.object:set_acceleration({x=0,y=0,z=0}) self.object:set_velocity({x=0,y=0,z=0}) + if self._longit_speed > 0 then motorcycle.engineSoundPlay(self) end end end @@ -476,7 +477,14 @@ minetest.register_entity("automobiles_motorcycle:motorcycle", { if turn_effect_speed > 10 then turn_effect_speed = 10 end local newroll = (-self._steering_angle/100)*(turn_effect_speed/10) - if newyaw~=yaw or newpitch~=pitch then self.object:set_rotation({x=newpitch,y=newyaw,z=newroll}) end + if is_attached == false then + newroll = math.rad(-12) + self.object:set_bone_position("descanso", {x=0, y=-2.55, z=5.9}, {x=-90, y=0, z=0}) + else + self.object:set_bone_position("descanso", {x=0, y=-2.55, z=5.9}, {x=0, y=0, z=0}) + end + + self.object:set_rotation({x=newpitch,y=newyaw,z=newroll}) --saves last velocity for collision detection (abrupt stop) self.lastvelocity = self.object:get_velocity() @@ -579,7 +587,7 @@ minetest.register_entity("automobiles_motorcycle:motorcycle", { motorcycle.attach_driver_stand(self, clicker) -- sound self.sound_handle = minetest.sound_play({name = "motorcycle_engine"}, - {object = self.object, gain = 4, pitch = 1, max_hear_distance = 10, loop = true,}) + {object = self.object, gain = 1, pitch = 0.5, max_hear_distance = 30, loop = true,}) end else --minetest.chat_send_all("clicou") diff --git a/automobiles_motorcycle/motorcycle_utilities.lua b/automobiles_motorcycle/motorcycle_utilities.lua index 77b16e3..daf5df3 100755 --- a/automobiles_motorcycle/motorcycle_utilities.lua +++ b/automobiles_motorcycle/motorcycle_utilities.lua @@ -46,7 +46,7 @@ end function motorcycle.engine_set_sound_and_animation(self, _longit_speed) --minetest.chat_send_all('test1 ' .. dump(self._engine_running) ) if self.sound_handle then - if (math.abs(self._longit_speed) > math.abs(_longit_speed) + 0.08) or (math.abs(self._longit_speed) + 0.08 < math.abs(_longit_speed)) then + if (math.abs(self._longit_speed) > math.abs(_longit_speed) + 0.06) or (math.abs(self._longit_speed) + 0.06 < math.abs(_longit_speed)) then --minetest.chat_send_all('test2') motorcycle.engineSoundPlay(self) end @@ -58,9 +58,9 @@ function motorcycle.engineSoundPlay(self) if self.sound_handle then minetest.sound_stop(self.sound_handle) end if self.object then self.sound_handle = minetest.sound_play({name = "motorcycle_engine"}, - {object = self.object, gain = 8, - pitch = 1 + ((self._longit_speed/10)/2), - max_hear_distance = 10, + {object = self.object, gain = 1, + pitch = 0.5 + ((self._longit_speed/10)/2), + max_hear_distance = 30, loop = true,}) end end diff --git a/automobiles_motorcycle/sounds/motorcycle_engine.ogg b/automobiles_motorcycle/sounds/motorcycle_engine.ogg index 3284d80..a776126 100644 Binary files a/automobiles_motorcycle/sounds/motorcycle_engine.ogg and b/automobiles_motorcycle/sounds/motorcycle_engine.ogg differ