]> git.lizzy.rs Git - dragonfireclient.git/blobdiff - builtin/common/vector.lua
Merge branch 'master' of https://github.com/minetest/minetest
[dragonfireclient.git] / builtin / common / vector.lua
index 1fd784ce28884d45c42b9ae6c27a7e67ae18844e..d6437deda20b45e2a51dbab87c7b2a65769704f3 100644 (file)
@@ -137,6 +137,12 @@ function vector.divide(a, b)
        end
 end
 
+function vector.offset(v, x, y, z)
+       return {x = v.x + x,
+               y = v.y + y,
+               z = v.z + z}
+end
+
 function vector.sort(a, b)
        return {x = math.min(a.x, b.x), y = math.min(a.y, b.y), z = math.min(a.z, b.z)},
                {x = math.max(a.x, b.x), y = math.max(a.y, b.y), z = math.max(a.z, b.z)}