From 06f99406824b8bb03db17029279a0d139808cf6c Mon Sep 17 00:00:00 2001 From: jussi Date: Wed, 25 May 2022 21:52:36 +0300 Subject: Rest of mesh management functions. --- examples/resources/lib/vector2.lua | 2 ++ examples/resources/lib/vector3.lua | 2 ++ 2 files changed, 4 insertions(+) (limited to 'examples/resources/lib') diff --git a/examples/resources/lib/vector2.lua b/examples/resources/lib/vector2.lua index 305f483..862718f 100644 --- a/examples/resources/lib/vector2.lua +++ b/examples/resources/lib/vector2.lua @@ -45,6 +45,8 @@ Vector2.meta = { function Vector2:new( x, y ) if type( x ) == "table" then x, y = table.unpack( x ) + elseif type( x ) == "nil" then + x, y = 0, 0 end local o = { diff --git a/examples/resources/lib/vector3.lua b/examples/resources/lib/vector3.lua index b0f1be9..bf3e4a7 100644 --- a/examples/resources/lib/vector3.lua +++ b/examples/resources/lib/vector3.lua @@ -59,6 +59,8 @@ end function Vector3:set( x, y, z ) if type( x ) == "table" then x, y, z = table.unpack( x ) + elseif type( x ) == "nil" then + x, y, z = 0, 0, 0 end self.x = x -- cgit v1.2.3