mirror of
https://github.com/luanti-org/luanti.git
synced 2025-08-11 17:51:04 +00:00
Add vector.combine (#11920)
This commit is contained in:
parent
e9e671078c
commit
ae7664597e
4 changed files with 20 additions and 0 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue