mirror of
https://github.com/APercy/automobiles_pck
synced 2025-10-10 19:23:05 +02:00
fix
This commit is contained in:
parent
9540ab62a6
commit
71d9de0649
@ -63,13 +63,14 @@ function automobiles_lib.ground_get_distances(self, radius, axis_distance)
|
|||||||
|
|
||||||
if mid_car_level then
|
if mid_car_level then
|
||||||
deltaX = axis_distance/2;
|
deltaX = axis_distance/2;
|
||||||
deltaY = mid_car_level.y - rear_obstacle_level.y;
|
if mid_car_level.y ~= nil then
|
||||||
m = (deltaY/deltaX)
|
deltaY = mid_car_level.y - rear_obstacle_level.y;
|
||||||
local midpitch = math.atan(m)
|
m = (deltaY/deltaX)
|
||||||
if math.abs(math.deg(pitch) - math.deg(midpitch)) < 20 then
|
local midpitch = math.atan(m)
|
||||||
pitch = pitch + ((pitch - midpitch) / 2)
|
if math.abs(math.deg(pitch) - math.deg(midpitch)) < 20 then
|
||||||
|
pitch = pitch + ((pitch - midpitch) / 2)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
self._pitch = 0
|
self._pitch = 0
|
||||||
|
Loading…
Reference in New Issue
Block a user