mirror of
https://github.com/APercy/automobiles_pck
synced 2025-08-08 06:15:49 +02:00
turn fine adjust
This commit is contained in:
parent
77d4b66fef
commit
97ac1457db
@ -113,7 +113,7 @@ function automobiles_lib.control(self, dtime, hull_direction, longit_speed, long
|
|||||||
if longit_speed > 0 then
|
if longit_speed > 0 then
|
||||||
local factor = 1
|
local factor = 1
|
||||||
if self._steering_angle > 0 then factor = -1 end
|
if self._steering_angle > 0 then factor = -1 end
|
||||||
local correction = (steering_limit*(longit_speed/100)) * factor
|
local correction = (steering_limit*(longit_speed/75)) * factor
|
||||||
local before_correction = self._steering_angle
|
local before_correction = self._steering_angle
|
||||||
self._steering_angle = self._steering_angle + correction
|
self._steering_angle = self._steering_angle + correction
|
||||||
if math.sign(before_correction) ~= math.sign(self._steering_angle) then self._steering_angle = 0 end
|
if math.sign(before_correction) ~= math.sign(self._steering_angle) then self._steering_angle = 0 end
|
||||||
|
@ -449,7 +449,8 @@ minetest.register_entity("automobiles_roadster:roadster", {
|
|||||||
local steering_angle_max = 30
|
local steering_angle_max = 30
|
||||||
local steering_speed = 40
|
local steering_speed = 40
|
||||||
if math.abs(longit_speed) > 3 then
|
if math.abs(longit_speed) > 3 then
|
||||||
steering_speed = steering_speed / math.abs(longit_speed*0.25)
|
local mid_speed = (steering_speed/2)
|
||||||
|
steering_speed = mid_speed + mid_speed / math.abs(longit_speed*0.25)
|
||||||
end
|
end
|
||||||
accel, stop = automobiles_lib.control(self, dtime, hull_direction, longit_speed, longit_drag, later_drag, accel, roadster.max_acc_factor, roadster.max_speed, steering_angle_max, steering_speed)
|
accel, stop = automobiles_lib.control(self, dtime, hull_direction, longit_speed, longit_drag, later_drag, accel, roadster.max_acc_factor, roadster.max_speed, steering_angle_max, steering_speed)
|
||||||
else
|
else
|
||||||
|
Loading…
Reference in New Issue
Block a user