diff --git a/package-lock.json b/package-lock.json index 368499d..48974f5 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,7 +9,7 @@ "version": "0.13.0", "license": "MIT", "dependencies": { - "@wowserhq/format": "^0.10.1" + "@wowserhq/format": "^0.10.2" }, "devDependencies": { "@commitlint/config-conventional": "^18.4.3", @@ -2347,11 +2347,12 @@ } }, "node_modules/@wowserhq/format": { - "version": "0.10.1", - "resolved": "https://registry.npmjs.org/@wowserhq/format/-/format-0.10.1.tgz", - "integrity": "sha512-5HwzBos1/sUKbB8U51j2dj2Gg+mtVon63jMeL0q+AL676RZMHiMxORp7PiujX3Xwes6vzy3xX95Q0Jk1ytyv/w==", + "version": "0.10.2", + "resolved": "https://registry.npmjs.org/@wowserhq/format/-/format-0.10.2.tgz", + "integrity": "sha512-KZ5ZIn7cQMZrRT7vpaqJFgTtNvC/gBuU5d+QlvulkB9wVpmiaFeM17VEs9Wz1HssiR6HdatJQmlTGn5mtq5v2g==", "dependencies": { - "@wowserhq/io": "^2.0.2" + "@wowserhq/io": "^2.0.2", + "gl-matrix": "^3.4.3" } }, "node_modules/@wowserhq/io": { @@ -4524,6 +4525,11 @@ "node": ">=10" } }, + "node_modules/gl-matrix": { + "version": "3.4.3", + "resolved": "https://registry.npmjs.org/gl-matrix/-/gl-matrix-3.4.3.tgz", + "integrity": "sha512-wcCp8vu8FT22BnvKVPjXa/ICBWRq/zjFfdofZy1WSpQZpphblv12/bOQLBC1rMM7SGOFS9ltVmKOHil5+Ml7gA==" + }, "node_modules/glob": { "version": "7.2.3", "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", diff --git a/package.json b/package.json index 8d64846..952524f 100644 --- a/package.json +++ b/package.json @@ -38,7 +38,7 @@ "three.js" ], "dependencies": { - "@wowserhq/format": "^0.10.1" + "@wowserhq/format": "^0.10.2" }, "peerDependencies": { "three": "^0.160.0" diff --git a/src/lib/map/DoodadManager.ts b/src/lib/map/DoodadManager.ts index 9d3cd17..cdd591a 100644 --- a/src/lib/map/DoodadManager.ts +++ b/src/lib/map/DoodadManager.ts @@ -4,8 +4,6 @@ import ModelManager from '../model/ModelManager.js'; import FormatManager from '../FormatManager.js'; import TextureManager from '../texture/TextureManager.js'; -const DEG2RAD = Math.PI / 180; - class DoodadManager { #modelManager: ModelManager; @@ -27,14 +25,8 @@ class DoodadManager { const model = doodadModels[i]; const def = doodadDefs[i]; - model.position.set(def.mapPosition[0], def.mapPosition[1], def.mapPosition[2]); - - // Def rotation is in degrees - model.rotation.set( - def.mapRotation[0] * DEG2RAD, - def.mapRotation[1] * DEG2RAD, - def.mapRotation[2] * DEG2RAD, - ); + model.position.set(def.position[0], def.position[1], def.position[2]); + model.quaternion.set(def.rotation[0], def.rotation[1], def.rotation[2], def.rotation[3]); // Def scale is on all axes and is a fixed precision value model.scale.setScalar(def.scale / 1024);