From 16bcc6daab84373cac0f4125c1580d3cb1261baf Mon Sep 17 00:00:00 2001 From: sanine-a Date: Wed, 22 Mar 2023 12:12:31 -0500 Subject: move ecs systems into separate module --- honey/mat4.lua | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'honey/mat4.lua') diff --git a/honey/mat4.lua b/honey/mat4.lua index 8ea73d4..6ea17fd 100644 --- a/honey/mat4.lua +++ b/honey/mat4.lua @@ -57,13 +57,6 @@ end setmetatable(Mat4, {__call=Mat4.new}) -function Mat4.Identity() - local m = Mat4() - m:identity() - return m -end - - function Mat4.__index(self, key) if type(key) == "number" then return RowLookup(key, self.data) @@ -111,40 +104,49 @@ end function Mat4.identity(self) glm.mat4_identity(self.data) + return self end function Mat4.zero(self) glm.mat4_zero(self.data) + return self end function Mat4.translate(self, vec) glm.translate(self.data, vec.data) + return self end function Mat4.rotateX(self, angle) glm.rotate_x(self.data, angle, self.data) + return self end function Mat4.rotateY(self, angle) glm.rotate_y(self.data, angle, self.data) + return self end function Mat4.rotateZ(self, angle) glm.rotate_z(self.data, angle, self.data) + return self end function Mat4.scale(self, vec) glm.scale(self.data, vec.data) + return self end function Mat4.perspective(self, fovy, aspect, near, far) glm.perspective(fovy, aspect, near, far, self.data) + return self end function Mat4.perspectiveResize(self, aspect) glm.perspective_resize(aspect, self.data) + return self end -- cgit v1.2.1