diff options
Diffstat (limited to 'demo/MeshInstance.lua')
-rw-r--r-- | demo/MeshInstance.lua | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/demo/MeshInstance.lua b/demo/MeshInstance.lua index 6e176fd..7164f18 100644 --- a/demo/MeshInstance.lua +++ b/demo/MeshInstance.lua @@ -6,10 +6,9 @@ MeshInstance.prototype = {} setmetatable(MeshInstance.prototype, { __index = Node.prototype}) MeshInstance.prototype.draw = function(self, shader, camera) - honey.texture.use(self.texture, 0) honey.shader.set_mat4(shader, 'model', self.transform.array) honey.shader.set_mat4(shader, 'view', camera.view.array) - honey.shader.set_mat4(shader, 'projection', camera.view.array) + honey.shader.set_mat4(shader, 'projection', camera.projection.array) honey.mesh.draw(self.mesh, shader) end @@ -21,10 +20,13 @@ MeshInstance.mt.__index = MeshInstance.prototype -- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MeshInstance.new = function(parent, position, rotation, scale, mesh) - local meshinstance = Node.new(parent, postion, rotation, scale) + local meshinstance = Node.new(parent, position, rotation, scale) + setmetatable(meshinstance, MeshInstance.mt) meshinstance.mesh = mesh return meshinstance end + +return MeshInstance |