mirror of
https://github.com/appgurueu/modlib.git
synced 2024-08-19 21:04:13 +02:00
Add vector.zeros
This commit is contained in:
parent
9bbbcae162
commit
71b6d9769d
@ -36,6 +36,13 @@ function new(v)
|
|||||||
return setmetatable(v, metatable)
|
return setmetatable(v, metatable)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function zeros(n)
|
||||||
|
local v = {}
|
||||||
|
for i = 1, n do
|
||||||
|
v[i] = 0
|
||||||
|
end
|
||||||
|
return new(v)
|
||||||
|
end
|
||||||
function from_xyzw(v)
|
function from_xyzw(v)
|
||||||
return new{v.x, v.y, v.z, v.w}
|
return new{v.x, v.y, v.z, v.w}
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user