summaryrefslogtreecommitdiff
path: root/builtin/common/vector.lua
diff options
context:
space:
mode:
Diffstat (limited to 'builtin/common/vector.lua')
-rw-r--r--builtin/common/vector.lua8
1 files changed, 8 insertions, 0 deletions
diff --git a/builtin/common/vector.lua b/builtin/common/vector.lua
index 90010f6de..a08472e32 100644
--- a/builtin/common/vector.lua
+++ b/builtin/common/vector.lua
@@ -110,6 +110,14 @@ function vector.apply(v, func)
)
end
+function vector.combine(a, b, func)
+ return fast_new(
+ func(a.x, b.x),
+ func(a.y, b.y),
+ func(a.z, b.z)
+ )
+end
+
function vector.distance(a, b)
local x = a.x - b.x
local y = a.y - b.y