mirror of
https://github.com/APercy/automobiles_pck
synced 2025-11-16 03:37:59 +01:00
removing commented lines
This commit is contained in:
parent
d8e3258333
commit
bcf97bafc0
@ -32,31 +32,6 @@ function automobiles_lib.ground_get_distances(self, radius, axis_distance)
|
||||
local front_obstacle_level = automobiles_lib.get_obstacle(front_axis)
|
||||
--minetest.chat_send_all("front"..dump(front_obstacle_level))
|
||||
|
||||
--[[ here lets someting to smooth the detection using the middle os the car as reference]]--
|
||||
--[[f_x, f_z = automobiles_lib.get_xz_from_hipotenuse(pos.x, pos.z, yaw, hip/2)
|
||||
f_y = pos.y
|
||||
--x, f_y = automobiles_lib.get_xz_from_hipotenuse(f_x, r_y, pitch - math.rad(90), hip/2) --the x is only a mock
|
||||
--minetest.chat_send_all("r: "..r_y.." f: "..f_y .." - "..math.deg(pitch))
|
||||
local mid_car = {x=f_x, y=f_y, z=f_z}
|
||||
local mid_car_level = automobiles_lib.get_obstacle(mid_car)]]--
|
||||
|
||||
|
||||
--[[local left_front = {x=0, y=f_y, z=0}
|
||||
left_front.x, left_front.z = automobiles_lib.get_xz_from_hipotenuse(f_x, f_z, yaw+math.rad(90), mid_axis)
|
||||
|
||||
local right_front = {x=0, y=f_y, z=0}
|
||||
right_front.x, right_front.z = automobiles_lib.get_xz_from_hipotenuse(f_x, f_z, yaw-math.rad(90), mid_axis)]]--
|
||||
|
||||
--[[
|
||||
|
||||
local rear_obstacle_level = automobiles_lib.get_obstacle(rear_axis, 0.2, 0.25)]]--
|
||||
|
||||
--[[local left_rear = {x=0, y=r_y, z=0}
|
||||
left_rear.x, left_rear.z = automobiles_lib.get_xz_from_hipotenuse(r_x, r_z, yaw+math.rad(90), mid_axis)
|
||||
|
||||
local right_rear = {x=0, y=r_y, z=0}
|
||||
right_rear.x, right_rear.z = automobiles_lib.get_xz_from_hipotenuse(r_x, r_z, yaw-math.rad(90), mid_axis)]]--
|
||||
|
||||
--lets try to get the pitch
|
||||
if front_obstacle_level.y ~= nil and rear_obstacle_level.y ~= nil then
|
||||
if (front_obstacle_level.y-self._last_front_detection) <= self.initial_properties.stepheight then
|
||||
@ -67,22 +42,6 @@ function automobiles_lib.ground_get_distances(self, radius, axis_distance)
|
||||
local m = (deltaY/deltaX)
|
||||
pitch = math.atan(m) --math.atan2(deltaY, deltaX);
|
||||
--minetest.chat_send_all("m: "..m.." pitch ".. math.deg(pitch))
|
||||
|
||||
--[[if mid_car_level then
|
||||
deltaX = axis_distance/2;
|
||||
if mid_car_level.y ~= nil then
|
||||
local deltaY_mid = mid_car_level.y - rear_obstacle_level.y;
|
||||
if deltaY >= 1 and deltaY_mid < (deltaY / 2) then
|
||||
--self.initial_properties.stepheight
|
||||
pitch = math.rad(0)
|
||||
end
|
||||
--[[m = (deltaY_mid/deltaX)
|
||||
local midpitch = math.atan(m)
|
||||
if math.abs(math.deg(pitch) - math.deg(midpitch)) < 20 then
|
||||
pitch = pitch + ((pitch - midpitch) / 2)
|
||||
end]]--
|
||||
--[[end
|
||||
end]]--
|
||||
else
|
||||
self._last_front_detection = rear_obstacle_level.y
|
||||
--here we need to set the collision effect
|
||||
|
||||
Loading…
Reference in New Issue
Block a user