mirror of
https://github.com/luanti-org/luanti.git
synced 2025-09-15 18:57:08 +00:00
Add vector.offset (#10321)
This commit is contained in:
parent
9976f36b18
commit
28e87ce9d5
3 changed files with 16 additions and 4 deletions
|
@ -44,6 +44,10 @@ describe("vector", function()
|
|||
assert.same({ x = 2, y = 4, z = 6 }, vector.add(vector.new(1, 2, 3), { x = 1, y = 2, z = 3 }))
|
||||
end)
|
||||
|
||||
it("offset()", function()
|
||||
assert.same({ x = 41, y = 52, z = 63 }, vector.offset(vector.new(1, 2, 3), 40, 50, 60))
|
||||
end)
|
||||
|
||||
-- This function is needed because of floating point imprecision.
|
||||
local function almost_equal(a, b)
|
||||
if type(a) == "number" then
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue