mirror of
https://github.com/luanti-org/luanti.git
synced 2025-08-01 17:38:41 +00:00
Vector: Add vector.sort(a, b): return box edges
This function returns the box corners of the smallest box that includes the two given coordinates.
This commit is contained in:
parent
d04d8aba70
commit
2d7a6f2cc0
2 changed files with 6 additions and 0 deletions
|
@ -138,3 +138,8 @@ function vector.divide(a, b)
|
|||
z = a.z / b}
|
||||
end
|
||||
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)}
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue