aboutsummaryrefslogtreecommitdiff
path: root/advtrains/helpers.lua
diff options
context:
space:
mode:
authororwell96 <orwell@bleipb.de>2018-05-17 11:16:04 +0200
committerorwell96 <orwell@bleipb.de>2018-06-14 17:39:42 +0200
commitb420a719398fa0e342d5ee8547464179664ae6b9 (patch)
tree541999867946eea1dc94fe0c9930af67e39434e7 /advtrains/helpers.lua
parentcaf2bda7bc02f0bbe6dbbeb415e7881158d143b9 (diff)
downloadadvtrains-b420a719398fa0e342d5ee8547464179664ae6b9.tar.gz
advtrains-b420a719398fa0e342d5ee8547464179664ae6b9.tar.bz2
advtrains-b420a719398fa0e342d5ee8547464179664ae6b9.zip
Implement a reverse path lookup for trains instead of an occupations window system
Diffstat (limited to 'advtrains/helpers.lua')
-rw-r--r--advtrains/helpers.lua8
1 files changed, 2 insertions, 6 deletions
diff --git a/advtrains/helpers.lua b/advtrains/helpers.lua
index 9add1b8..dc923a5 100644
--- a/advtrains/helpers.lua
+++ b/advtrains/helpers.lua
@@ -109,7 +109,7 @@ end
function advtrains.dir_to_angle(dir)
local uvec = vector.normalize(advtrains.dirToCoord(dir))
- return math.atan2(uvec.z, uvec.x)
+ return math.atan2(uvec.x, uvec.z)
end
local pi, pi2 = math.pi, 2*math.pi
@@ -153,8 +153,6 @@ function advtrains.conn_angle_median(cdir1, cdir2)
return ang1 + advtrains.minAngleDiffRad(ang1, ang2)/2
end
--- TODO removed dumppath, where is this used?
-
function advtrains.merge_tables(a, ...)
local new={}
for _,t in ipairs({a,...}) do
@@ -170,8 +168,6 @@ function advtrains.save_keys(tbl, keys)
return new
end
--- TODO yaw_from_3_positions and get_wagon_yaw removed
-
function advtrains.get_real_index_position(path, index)
if not path or not index then return end
@@ -258,7 +254,7 @@ function advtrains.rotate_conn_by(conn, rotate)
return tmp
end
---TODO use this
+
function advtrains.oppd(dir)
return advtrains.rotate_conn_by(dir, AT_CMAX/2)
end