diff options
author | DS <vorunbekannt75@web.de> | 2020-08-29 17:41:29 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-08-29 16:41:29 +0100 |
commit | 28e87ce9d5fdf163c1eb0daf83279e949f84765d (patch) | |
tree | abf144b7c8e5ee21c5dfbd16495a70e3475a056e /builtin/common/vector.lua | |
parent | 9976f36b18b8d227e3240feb24000dda0916ee44 (diff) | |
download | minetest-28e87ce9d5fdf163c1eb0daf83279e949f84765d.tar.xz |
Add vector.offset (#10321)
Diffstat (limited to 'builtin/common/vector.lua')
-rw-r--r-- | builtin/common/vector.lua | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/builtin/common/vector.lua b/builtin/common/vector.lua index 1fd784ce2..d6437deda 100644 --- a/builtin/common/vector.lua +++ b/builtin/common/vector.lua @@ -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)} |