mirror of
https://github.com/vrld/hump.git
synced 2024-11-23 12:24:19 +00:00
brief(er) vector factory
This commit is contained in:
parent
f78bfa3ca8
commit
7f92f2c4f1
@ -31,9 +31,7 @@ local vector = {}
|
|||||||
vector.__index = vector
|
vector.__index = vector
|
||||||
|
|
||||||
local function new(x,y)
|
local function new(x,y)
|
||||||
local v = {x = x or 0, y = y or 0}
|
return setmetatable({x = x or 0, y = y or 0}, vector)
|
||||||
setmetatable(v, vector)
|
|
||||||
return v
|
|
||||||
end
|
end
|
||||||
|
|
||||||
local function isvector(v)
|
local function isvector(v)
|
||||||
|
Loading…
Reference in New Issue
Block a user