mirror of
https://github.com/OgelGames/fakelib.git
synced 2024-11-13 07:20:17 +01:00
11 lines
290 B
Lua
11 lines
290 B
Lua
|
|
function fakelib.is_vector(x, add_metatable)
|
|
if type(x) ~= "table" or type(x.x) ~= "number" or type(x.y) ~= "number" or type(x.z) ~= "number" then
|
|
return false
|
|
end
|
|
if add_metatable and getmetatable(x) ~= vector.metatable then
|
|
setmetatable(x, vector.metatable)
|
|
end
|
|
return true
|
|
end
|