slightly tweaked vec2 new

This commit is contained in:
Max Cahill 2021-07-23 14:38:14 +10:00
parent a61a8a8618
commit 4bb3da7603

View File

@ -18,8 +18,6 @@ end
--ctor
function vec2:new(x, y)
--0 init by default
self:scalar_set(0)
if type(x) == "number" then
self:scalar_set(x, y)
elseif type(x) == "table" then
@ -30,10 +28,12 @@ function vec2:new(x, y)
else
self:scalar_set(x.x, x.y)
end
else
self:scalar_set(0)
end
end
--explicit ctors
--explicit ctors; mostly vestigial at this point
function vec2:copy()
return vec2(self.x, self.y)
end