From ba9a7162b72e6b20466de7dd115719777315b5c2 Mon Sep 17 00:00:00 2001 From: sanine-a Date: Sat, 5 Dec 2020 18:37:44 -0600 Subject: switch meshes to use metamathods --- demo/SpatialShader.lua | 6 +++--- demo/main.lua | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) (limited to 'demo') diff --git a/demo/SpatialShader.lua b/demo/SpatialShader.lua index 699cff2..0c65176 100644 --- a/demo/SpatialShader.lua +++ b/demo/SpatialShader.lua @@ -74,10 +74,10 @@ SpatialShader.prototype.setCamera = function(self, camera) self.shader:setMat4('projection', camera.projection) end -SpatialShader.prototype.drawMesh = function(self, mesh) - self.shader:setMat4('model', mesh.transform) +SpatialShader.prototype.drawMesh = function(self, meshInstance) + self.shader:setMat4('model', meshInstance.transform) self.albedo:use(0) - honey.mesh.draw(mesh.mesh, self.shader) + meshInstance.mesh:draw(self.shader) end -- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/demo/main.lua b/demo/main.lua index 5b19166..8e8d3d3 100644 --- a/demo/main.lua +++ b/demo/main.lua @@ -20,7 +20,7 @@ local lightDirection = honey.glm.vec3{1,1,1} lightDirection:normalize() shader:setVec3('directional_lights[0].direction', lightDirection) shader:setVec3('directional_lights[0].color', honey.glm.vec3{0,1,0}) -local meshes = honey.mesh.load('Suzanne.obj') +local meshes = honey.mesh('Suzanne.obj') local suzanne = MeshInstance.new(sceneRoot, honey.glm.vec3{0,0,3}, honey.glm.vec3{0,math.pi,0}, @@ -41,7 +41,7 @@ local plane2 = MeshInstance.new(suzanne, shader) suzanne.update = function(self, dt) - self:rotate('y', 10*dt) + self:rotate('y', dt) end local total_frames = 0 -- cgit v1.2.1