diff options
author | orwell96 <mono96.mml@gmail.com> | 2016-06-09 17:35:06 +0200 |
---|---|---|
committer | orwell96 <mono96.mml@gmail.com> | 2016-06-09 17:35:06 +0200 |
commit | a879ce8d3c179b5c6b88c9db610d560228d1e5b4 (patch) | |
tree | 477a062c99baca9673b4127e89f49dab3e1d148c /helpers.lua | |
parent | e449704a92c8c1931fb687e58f095bea27db3ddc (diff) | |
download | advtrains-a879ce8d3c179b5c6b88c9db610d560228d1e5b4.tar.gz advtrains-a879ce8d3c179b5c6b88c9db610d560228d1e5b4.tar.bz2 advtrains-a879ce8d3c179b5c6b88c9db610d560228d1e5b4.zip |
Fix train collision and coupling on opposing trains, and try to implement animation (currently does not work)
Diffstat (limited to 'helpers.lua')
-rw-r--r-- | helpers.lua | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/helpers.lua b/helpers.lua index 737d15b..cd67aa9 100644 --- a/helpers.lua +++ b/helpers.lua @@ -219,4 +219,7 @@ function advtrains.get_real_index_position(path, index) end
function advtrains.pos_median(pos1, pos2)
return {x=pos1.x-(pos1.x-pos2.x)*0.5, y=pos1.y-(pos1.y-pos2.y)*0.5, z=pos1.z-(pos1.z-pos2.z)*0.5}
+end
+function advtrains.abs_ceil(i)
+ return math.ceil(math.abs(i))*math.sign(i)
end
\ No newline at end of file |