From be49795636e5a9ede3742d077701f48e9316e121 Mon Sep 17 00:00:00 2001 From: sanine-a Date: Mon, 30 Nov 2020 13:28:20 -0600 Subject: fix bug in glm binding memory allocators --- demo/Node.lua | 5 +++-- demo/main.lua | 11 ++++++++++- 2 files changed, 13 insertions(+), 3 deletions(-) (limited to 'demo') diff --git a/demo/Node.lua b/demo/Node.lua index 300679c..5af745b 100644 --- a/demo/Node.lua +++ b/demo/Node.lua @@ -6,7 +6,7 @@ local Node = {} Node.prototype = {} Node.prototype.updateTransform = function(self) - honey.cglm.mat4.identity(self.transform.array) + self.transform:eye() self.transform:translate(self.position) @@ -87,7 +87,8 @@ Node.new = function(parent, position, rotation, scale) parent.children[index + 1] = node end - node.transform = Matrix.Mat4.eye() + node.transform = honey.glm.mat4() + node.transform:eye() node:updateTransform() return node diff --git a/demo/main.lua b/demo/main.lua index ec5746a..3fabe00 100644 --- a/demo/main.lua +++ b/demo/main.lua @@ -1,3 +1,12 @@ -local v = honey.glm.vec3() +local v = honey.glm.vec3{1, 2, 3} + +local M = honey.glm.mat3() +M:set(1,3, 1) + +print(M:mulv(v)) + +print(v) +print(honey.glm.vec3{2, 0.001, 0}) +print(honey.glm.vec4{100, 0, 0, 20.44}) v.dot(v, v) -- cgit v1.2.1