From 52705647fd49e08dd1c883f72a43c3577538f25b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ji=C5=99=C3=AD=20Hon?= Date: Mon, 7 Nov 2022 09:56:21 +0100 Subject: [PATCH] JS bindings: convert mesh.triVerts to array of array Convert the items of mesh.triVerts to plain arrays to match the Vec3 type which is [number, number, number]. --- bindings/wasm/bindings.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/bindings/wasm/bindings.js b/bindings/wasm/bindings.js index 5f715bffa..ade743966 100644 --- a/bindings/wasm/bindings.js +++ b/bindings/wasm/bindings.js @@ -157,8 +157,9 @@ Module.setup = function() { const oldHalfedgeTangent = result.halfedgeTangent; const conversion1 = v => ['x', 'y', 'z'].map(f => v[f]); const conversion2 = v => ['x', 'y', 'z', 'w'].map(f => v[f]); + const conversion3 = v => [v[0], v[1], v[2]]; result.vertPos = fromVec(oldVertPos, conversion1); - result.triVerts = fromVec(oldTriVerts); + result.triVerts = fromVec(oldTriVerts, conversion3); result.vertNormal = fromVec(oldVertNormal, conversion1); result.halfedgeTangent = fromVec(oldHalfedgeTangent, conversion2); oldVertPos.delete();