diff options
author | sanine-a <sanine.not@pm.me> | 2020-12-05 18:37:44 -0600 |
---|---|---|
committer | sanine-a <sanine.not@pm.me> | 2020-12-05 18:37:44 -0600 |
commit | ba9a7162b72e6b20466de7dd115719777315b5c2 (patch) | |
tree | 80ecd412817ca85adcb0ec944ab4a28be7b4737c /demo | |
parent | 09a96abe4d6933eb473b0dd8a7027cc0cb04ac63 (diff) |
switch meshes to use metamathods
Diffstat (limited to 'demo')
-rw-r--r-- | demo/SpatialShader.lua | 6 | ||||
-rw-r--r-- | demo/main.lua | 4 |
2 files changed, 5 insertions, 5 deletions
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 |