From f3eb6d23adc750c27f4003651ef0ed923ce04837 Mon Sep 17 00:00:00 2001 From: Alexsandro Percy Date: Mon, 17 Jan 2022 09:34:42 -0300 Subject: [PATCH] ramp detection improved --- automobiles/ground_detection.lua | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/automobiles/ground_detection.lua b/automobiles/ground_detection.lua index ad1c5a4..058ce39 100644 --- a/automobiles/ground_detection.lua +++ b/automobiles/ground_detection.lua @@ -9,7 +9,7 @@ function automobiles.ground_get_distances(self, radius, axis_distance) --local mid_axis = (axis_length / 2)/10 local hip = (axis_distance / 10) - minetest.chat_send_all("entre-eixo "..hip) + --minetest.chat_send_all("entre-eixo "..hip) local pitch = self._pitch --+90 for the calculations local yaw = self.object:get_yaw() @@ -50,10 +50,10 @@ function automobiles.ground_get_distances(self, radius, axis_distance) --lets try to get the pitch local deltaX = axis_distance; local deltaY = front_obstacle_level.y - rear_obstacle_level.y; - minetest.chat_send_all("deutaY "..deltaY) + --minetest.chat_send_all("deutaY "..deltaY) local m = (deltaY/deltaX)*10 pitch = math.atan(m) --math.atan2(deltaY, deltaX); - minetest.chat_send_all("m: "..m.." pitch ".. math.deg(pitch)) + --minetest.chat_send_all("m: "..m.." pitch ".. math.deg(pitch)) self._pitch = pitch end