mirror of
https://github.com/luanti-org/luanti.git
synced 2025-08-11 17:51:04 +00:00
Add vector.in_area()
utility function (#13390)
This commit is contained in:
parent
2fc7eb3ea2
commit
68f81ace97
3 changed files with 18 additions and 0 deletions
|
@ -462,4 +462,11 @@ describe("vector", function()
|
|||
end
|
||||
|
||||
end)
|
||||
|
||||
it("in_area()", function()
|
||||
assert.True(vector.in_area(vector.zero(), vector.new(-10, -10, -10), vector.new(10, 10, 10)))
|
||||
assert.True(vector.in_area(vector.new(-2, 5, -8), vector.new(-10, -10, -10), vector.new(10, 10, 10)))
|
||||
assert.True(vector.in_area(vector.new(-10, -10, -10), vector.new(-10, -10, -10), vector.new(10, 10, 10)))
|
||||
assert.False(vector.in_area(vector.new(-10, -10, -10), vector.new(10, 10, 10), vector.new(-11, -10, -10)))
|
||||
end)
|
||||
end)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue