@roomle/web-sdk 5.1.0-alpha.4 → 5.1.0-alpha.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (137) hide show
  1. package/lib/{BufferGeometry-Bl5whHAB.mjs → BufferGeometry-CxlpBjLq.mjs} +192 -195
  2. package/lib/BufferGeometry-CxlpBjLq.mjs.map +1 -0
  3. package/lib/ConfiguratorKernel.wasm +0 -0
  4. package/lib/{GLTFExporter-yQ7mMauu.mjs → GLTFExporter-DeNw0qAI.mjs} +86 -80
  5. package/lib/GLTFExporter-DeNw0qAI.mjs.map +1 -0
  6. package/lib/GaussianBlurNode-BR1cKBsX.mjs +65 -0
  7. package/lib/GaussianBlurNode-BR1cKBsX.mjs.map +1 -0
  8. package/lib/{Object3D-BHdngbxB.mjs → Object3D-CALIQdg1.mjs} +142 -59
  9. package/lib/Object3D-CALIQdg1.mjs.map +1 -0
  10. package/lib/{Pass-DLiMLT5k.mjs → Pass-DCljS3Z-.mjs} +4 -4
  11. package/lib/{Pass-DLiMLT5k.mjs.map → Pass-DCljS3Z-.mjs.map} +1 -1
  12. package/lib/{PointLightHelper-CuPSBuDU.mjs → PointLightHelper-C_0CYp7R.mjs} +35 -32
  13. package/lib/PointLightHelper-C_0CYp7R.mjs.map +1 -0
  14. package/lib/RoomleCore.wasm +0 -0
  15. package/lib/RoomleToolsCore.wasm +0 -0
  16. package/lib/{SpotLightHelper-m-Rh8vGU.mjs → SpotLightHelper-UUIHn43T.mjs} +22 -19
  17. package/lib/SpotLightHelper-UUIHn43T.mjs.map +1 -0
  18. package/lib/{USDZExporter-MdkuT226.mjs → USDZExporter-BBNw7Hey.mjs} +6 -3
  19. package/lib/USDZExporter-BBNw7Hey.mjs.map +1 -0
  20. package/lib/{Vector4-C7TlIAyy.mjs → Vector4-BOcWTZJI.mjs} +2 -2
  21. package/lib/Vector4-BOcWTZJI.mjs.map +1 -0
  22. package/lib/{api-Bznmr-xZ.mjs → api-ClfVJAUd.mjs} +2 -2
  23. package/lib/{api-Bznmr-xZ.mjs.map → api-ClfVJAUd.mjs.map} +1 -1
  24. package/lib/asset-loader.worker-CzI1oyTY.mjs.map +1 -1
  25. package/lib/{banana-for-scale-DpKXNBt_.mjs → banana-for-scale-Cf41yXTl.mjs} +3 -3
  26. package/lib/{banana-for-scale-DpKXNBt_.mjs.map → banana-for-scale-Cf41yXTl.mjs.map} +1 -1
  27. package/lib/budgeteer.sw-D80jTmYa.mjs.map +1 -1
  28. package/lib/{common-utils-DbL4tku0.mjs → common-utils-OTJQGohe.mjs} +3 -3
  29. package/lib/common-utils-OTJQGohe.mjs.map +1 -0
  30. package/lib/{component-dimensioning-BaUqwqYJ.mjs → component-dimensioning-yPK46Y5o.mjs} +26 -26
  31. package/lib/{component-dimensioning-BaUqwqYJ.mjs.map → component-dimensioning-yPK46Y5o.mjs.map} +1 -1
  32. package/lib/{component-raycast-helper-4i8b4E5B.mjs → component-raycast-helper-CnpnRaFg.mjs} +15 -15
  33. package/lib/{component-raycast-helper-4i8b4E5B.mjs.map → component-raycast-helper-CnpnRaFg.mjs.map} +1 -1
  34. package/lib/{configurator-CDw_c6tB.mjs → configurator-BM31Kt-5.mjs} +4 -4
  35. package/lib/{configurator-CDw_c6tB.mjs.map → configurator-BM31Kt-5.mjs.map} +1 -1
  36. package/lib/configurator-CRQg04Bp.mjs +2 -0
  37. package/lib/{continuous-drawing-helper-DqHIR_qF.mjs → continuous-drawing-helper-CTfGRTfH.mjs} +3 -3
  38. package/lib/{continuous-drawing-helper-DqHIR_qF.mjs.map → continuous-drawing-helper-CTfGRTfH.mjs.map} +1 -1
  39. package/lib/dimensioning-helper-CQlesi-m.mjs +2 -0
  40. package/lib/{dimensioning-helper-CGPjS2hW.mjs → dimensioning-helper-DSlkLDmx.mjs} +42 -36
  41. package/lib/dimensioning-helper-DSlkLDmx.mjs.map +1 -0
  42. package/lib/{glb-viewer-B-Zr743e.mjs → glb-viewer-B2si39v2.mjs} +33 -33
  43. package/lib/{glb-viewer-B-Zr743e.mjs.map → glb-viewer-B2si39v2.mjs.map} +1 -1
  44. package/lib/glb-viewer-DWybhP87.mjs +2 -0
  45. package/lib/{highlight-coordinator-4gkjde82.mjs → highlight-coordinator-DU6oFunq.mjs} +6 -6
  46. package/lib/{highlight-coordinator-4gkjde82.mjs.map → highlight-coordinator-DU6oFunq.mjs.map} +1 -1
  47. package/lib/{homag-intelligence-D7S7r-Gc.mjs → homag-intelligence-CSBo-iks.mjs} +3 -3
  48. package/lib/{homag-intelligence-D7S7r-Gc.mjs.map → homag-intelligence-CSBo-iks.mjs.map} +1 -1
  49. package/lib/{hosek-wilkie-sky-iMar2iw-.mjs → hosek-wilkie-sky-DmTvnxMA.mjs} +33 -33
  50. package/lib/{hosek-wilkie-sky-iMar2iw-.mjs.map → hosek-wilkie-sky-DmTvnxMA.mjs.map} +1 -1
  51. package/lib/{imos-ix-poc-export-helper-CyGqK7nu.mjs → imos-ix-poc-export-helper-BGN97m8W.mjs} +3 -3
  52. package/lib/{imos-ix-poc-export-helper-CyGqK7nu.mjs.map → imos-ix-poc-export-helper-BGN97m8W.mjs.map} +1 -1
  53. package/lib/kernel-BWfRHWkW.mjs.map +1 -1
  54. package/lib/{kernel-utils-BvatnA7U.mjs → kernel-utils-BYKmP0mf.mjs} +13 -13
  55. package/lib/{kernel-utils-BvatnA7U.mjs.map → kernel-utils-BYKmP0mf.mjs.map} +1 -1
  56. package/lib/{material-viewer-CTsSfTfL.mjs → material-viewer-C2Pj4-II.mjs} +18 -18
  57. package/lib/{material-viewer-CTsSfTfL.mjs.map → material-viewer-C2Pj4-II.mjs.map} +1 -1
  58. package/lib/{packages-BXAZEcKa.mjs → packages-C0xavGqP.mjs} +5 -5
  59. package/lib/{packages-BXAZEcKa.mjs.map → packages-C0xavGqP.mjs.map} +1 -1
  60. package/lib/{planner-jvLAnYww.mjs → planner-C1KkZRGk.mjs} +3 -3
  61. package/lib/{planner-jvLAnYww.mjs.map → planner-C1KkZRGk.mjs.map} +1 -1
  62. package/lib/planner-DJE5aZXG.mjs +2 -0
  63. package/lib/{plugin-system-CRaC04G5.mjs → plugin-system-CPf99Zkf.mjs} +2 -2
  64. package/lib/{plugin-system-CRaC04G5.mjs.map → plugin-system-CPf99Zkf.mjs.map} +1 -1
  65. package/lib/{render-cache-DCPIQbO1.mjs → render-cache-CPppt7Rd.mjs} +5 -5
  66. package/lib/{render-cache-DCPIQbO1.mjs.map → render-cache-CPppt7Rd.mjs.map} +1 -1
  67. package/lib/{render-order-BPF2wDMw.mjs → render-order-a0QAbB7Q.mjs} +2 -2
  68. package/lib/{render-order-BPF2wDMw.mjs.map → render-order-a0QAbB7Q.mjs.map} +1 -1
  69. package/lib/roomle-headless.d.ts +13 -11
  70. package/lib/roomle-headless.js +14 -14
  71. package/lib/{roomle-renderer-Ato6RMrd.mjs → roomle-renderer-UJINLYxS.mjs} +2 -2
  72. package/lib/{roomle-renderer-Ato6RMrd.mjs.map → roomle-renderer-UJINLYxS.mjs.map} +1 -1
  73. package/lib/{roomle-sdk-CBwhwX_e.mjs → roomle-sdk-BhHLCbgP.mjs} +1747 -1729
  74. package/lib/roomle-sdk-BhHLCbgP.mjs.map +1 -0
  75. package/lib/roomle-sdk.d.ts +13 -11
  76. package/lib/roomle-sdk.js +7 -7
  77. package/lib/{roomle-webgpu-renderer-BfZKcXSz.mjs → roomle-webgpu-renderer-BSvxbopA.mjs} +900 -707
  78. package/lib/roomle-webgpu-renderer-BSvxbopA.mjs.map +1 -0
  79. package/lib/{scene-renderer-BHYZac3H.mjs → scene-renderer--DzrpIl_.mjs} +309 -309
  80. package/lib/{scene-renderer-BHYZac3H.mjs.map → scene-renderer--DzrpIl_.mjs.map} +1 -1
  81. package/lib/{script-loader-CvnG6LgL.mjs → script-loader-BHniYj5b.mjs} +2 -2
  82. package/lib/{script-loader-CvnG6LgL.mjs.map → script-loader-BHniYj5b.mjs.map} +1 -1
  83. package/lib/{shading-settings-BBhR7KcS.mjs → shading-settings-6v-7O_Sz.mjs} +49 -49
  84. package/lib/{shading-settings-BBhR7KcS.mjs.map → shading-settings-6v-7O_Sz.mjs.map} +1 -1
  85. package/lib/src-6KtBPZXp.mjs +2 -0
  86. package/lib/{src-HhklrVDg.mjs → src-Dg0wYIom.mjs} +150 -150
  87. package/lib/{src-HhklrVDg.mjs.map → src-Dg0wYIom.mjs.map} +1 -1
  88. package/lib/static/roomle-core-hsc/node_modules/roomle-core-hsc/package.json +1 -1
  89. package/lib/static/roomle-core-hsc/node_modules/roomle-core-hsc/src/embind/configuratorCoreInterface.d.ts +4 -1
  90. package/lib/static/roomle-core-hsc/node_modules/roomle-core-hsc/src/embind/plannerCoreInterface.d.ts +5 -0
  91. package/lib/static/roomle-core-hsc/node_modules/roomle-core-hsc/wasm_modern/ConfiguratorKernel.wasm +0 -0
  92. package/lib/static/roomle-core-hsc/node_modules/roomle-core-hsc/wasm_modern/RoomleCore.wasm +0 -0
  93. package/lib/static/roomle-core-hsc/node_modules/roomle-core-hsc/wasm_modern/RoomleToolsCore.wasm +0 -0
  94. package/lib/{stats-helper-PndcZCzL.mjs → stats-helper-DYjPPDnz.mjs} +2 -2
  95. package/lib/{stats-helper-PndcZCzL.mjs.map → stats-helper-DYjPPDnz.mjs.map} +1 -1
  96. package/lib/{three.core-0KaTx8dm.mjs → three.core-BTUCraWz.mjs} +976 -884
  97. package/lib/three.core-BTUCraWz.mjs.map +1 -0
  98. package/lib/{three.module-dym6j3lO.mjs → three.module-DUSFrLM6.mjs} +1789 -1739
  99. package/lib/three.module-DUSFrLM6.mjs.map +1 -0
  100. package/lib/three.tsl-De6A-G56.mjs +158 -0
  101. package/lib/three.tsl-De6A-G56.mjs.map +1 -0
  102. package/lib/three.tsl-DtfvggFX.mjs +2 -0
  103. package/lib/three.webgpu-B1OhMci_.mjs +3 -0
  104. package/lib/{three.webgpu-D3nSEIjD.mjs → three.webgpu-wPiwbpFM.mjs} +5806 -4926
  105. package/lib/three.webgpu-wPiwbpFM.mjs.map +1 -0
  106. package/lib/{threejs-utils-v1uOvccg.mjs → threejs-utils-lVSsgAiQ.mjs} +68 -68
  107. package/lib/{threejs-utils-v1uOvccg.mjs.map → threejs-utils-lVSsgAiQ.mjs.map} +1 -1
  108. package/lib/{tools-core-B29U-88K.mjs → tools-core-QUdVgS4n.mjs} +3 -3
  109. package/lib/{tools-core-B29U-88K.mjs.map → tools-core-QUdVgS4n.mjs.map} +1 -1
  110. package/lib/{webgpu-BHAP6BLI.mjs → webgpu-BxYJfBjz.mjs} +555 -555
  111. package/lib/{webgpu-BHAP6BLI.mjs.map → webgpu-BxYJfBjz.mjs.map} +1 -1
  112. package/package.json +5 -5
  113. package/lib/BufferGeometry-Bl5whHAB.mjs.map +0 -1
  114. package/lib/GLTFExporter-yQ7mMauu.mjs.map +0 -1
  115. package/lib/GaussianBlurNode-DNBEf5-n.mjs +0 -59
  116. package/lib/GaussianBlurNode-DNBEf5-n.mjs.map +0 -1
  117. package/lib/Object3D-BHdngbxB.mjs.map +0 -1
  118. package/lib/PointLightHelper-CuPSBuDU.mjs.map +0 -1
  119. package/lib/SpotLightHelper-m-Rh8vGU.mjs.map +0 -1
  120. package/lib/USDZExporter-MdkuT226.mjs.map +0 -1
  121. package/lib/Vector4-C7TlIAyy.mjs.map +0 -1
  122. package/lib/common-utils-DbL4tku0.mjs.map +0 -1
  123. package/lib/configurator-BYQdWEvf.mjs +0 -2
  124. package/lib/dimensioning-helper-CGPjS2hW.mjs.map +0 -1
  125. package/lib/dimensioning-helper-VndKlIXS.mjs +0 -2
  126. package/lib/glb-viewer-Bd5Xn6Oq.mjs +0 -2
  127. package/lib/planner-DMk3T4ts.mjs +0 -2
  128. package/lib/roomle-sdk-CBwhwX_e.mjs.map +0 -1
  129. package/lib/roomle-webgpu-renderer-BfZKcXSz.mjs.map +0 -1
  130. package/lib/src-Bbq3Hqzn.mjs +0 -2
  131. package/lib/three.core-0KaTx8dm.mjs.map +0 -1
  132. package/lib/three.module-dym6j3lO.mjs.map +0 -1
  133. package/lib/three.tsl-BTc4fg8T.mjs +0 -2
  134. package/lib/three.tsl-Cf0-sCqB.mjs +0 -152
  135. package/lib/three.tsl-Cf0-sCqB.mjs.map +0 -1
  136. package/lib/three.webgpu-ClICiWlK.mjs +0 -3
  137. package/lib/three.webgpu-D3nSEIjD.mjs.map +0 -1
@@ -1,4 +1,4 @@
1
- import { Ci as e, Hr as t, Ln as n, Mr as r, O as i, Pn as a, S as o, Sn as s, Xt as c, Zr as l, Zt as u, bn as d, in as f, jt as p, m, qt as h, sn as g, w as _, xn as v, yn as y, yt as b } from "./three.core-0KaTx8dm.mjs";
1
+ import { Cn as e, Ei as t, Fn as n, Jt as r, O as i, Pr as a, Qt as o, Rn as s, S as c, Sn as l, Wr as u, Zt as d, an as f, bn as p, cn as m, jt as h, m as g, ui as _, w as v, xn as y, yt as b } from "./three.core-BTUCraWz.mjs";
2
2
  //#region ../../node_modules/three/examples/jsm/exporters/GLTFExporter.js
3
3
  var x = {
4
4
  POSITION: [
@@ -100,13 +100,13 @@ var x = {
100
100
  MIRRORED_REPEAT: 33648,
101
101
  REPEAT: 10497
102
102
  }, w = "KHR_mesh_quantization", T = {};
103
- T[d] = C.NEAREST, T[s] = C.NEAREST_MIPMAP_NEAREST, T[v] = C.NEAREST_MIPMAP_LINEAR, T[h] = C.LINEAR, T[u] = C.LINEAR_MIPMAP_NEAREST, T[c] = C.LINEAR_MIPMAP_LINEAR, T[o] = C.CLAMP_TO_EDGE, T[r] = C.REPEAT, T[y] = C.MIRRORED_REPEAT;
103
+ T[y] = C.NEAREST, T[e] = C.NEAREST_MIPMAP_NEAREST, T[l] = C.NEAREST_MIPMAP_LINEAR, T[r] = C.LINEAR, T[o] = C.LINEAR_MIPMAP_NEAREST, T[d] = C.LINEAR_MIPMAP_LINEAR, T[c] = C.CLAMP_TO_EDGE, T[a] = C.REPEAT, T[p] = C.MIRRORED_REPEAT;
104
104
  var E = {
105
105
  scale: "scale",
106
106
  position: "translation",
107
107
  quaternion: "rotation",
108
108
  morphTargetInfluences: "weights"
109
- }, D = new _(), O = 12, k = 1179937895, A = 2, j = 8, M = 1313821514, N = 5130562;
109
+ }, D = new v(), O = 12, k = 1179937895, A = 2, j = 8, M = 1313821514, N = 5130562;
110
110
  function P(e, t) {
111
111
  return e.length === t.length && e.every(function(e, n) {
112
112
  return e === t[n];
@@ -174,14 +174,15 @@ var H = class {
174
174
  constructor() {
175
175
  this.plugins = [], this.options = {}, this.pending = [], this.buffers = [], this.byteOffset = 0, this.buffers = [], this.nodeMap = /* @__PURE__ */ new Map(), this.skins = [], this.extensionsUsed = {}, this.extensionsRequired = {}, this.uids = /* @__PURE__ */ new Map(), this.uid = 0, this.json = { asset: {
176
176
  version: "2.0",
177
- generator: "THREE.GLTFExporter r185"
177
+ generator: "THREE.GLTFExporter r186"
178
178
  } }, this.cache = {
179
179
  meshes: /* @__PURE__ */ new Map(),
180
180
  attributes: /* @__PURE__ */ new Map(),
181
181
  attributesNormalized: /* @__PURE__ */ new Map(),
182
182
  materials: /* @__PURE__ */ new Map(),
183
183
  textures: /* @__PURE__ */ new Map(),
184
- images: /* @__PURE__ */ new Map()
184
+ images: /* @__PURE__ */ new Map(),
185
+ normalMaps: /* @__PURE__ */ new Map()
185
186
  }, this.textureUtils = null;
186
187
  }
187
188
  setPlugins(e) {
@@ -197,12 +198,13 @@ var H = class {
197
198
  onlyVisible: !0,
198
199
  maxTextureSize: Infinity,
199
200
  animations: [],
200
- includeCustomExtensions: !1
201
+ includeCustomExtensions: !1,
202
+ copyright: null
201
203
  }, n), this.options.animations.length > 0 && (this.options.trs = !0), await this.processInputAsync(e), await Promise.all(this.pending);
202
204
  let r = this, i = r.buffers, a = r.json;
203
205
  n = r.options;
204
206
  let o = r.extensionsUsed, s = r.extensionsRequired, c = new Blob(i, { type: "application/octet-stream" }), l = Object.keys(o), u = Object.keys(s);
205
- if (l.length > 0 && (a.extensionsUsed = l), u.length > 0 && (a.extensionsRequired = u), a.buffers && a.buffers.length > 0 && (a.buffers[0].byteLength = c.size), n.binary === !0) {
207
+ if (l.length > 0 && (a.extensionsUsed = l), u.length > 0 && (a.extensionsRequired = u), a.buffers && a.buffers.length > 0 && (a.buffers[0].byteLength = c.size), n.copyright && (a.asset.copyright = n.copyright), n.binary === !0) {
206
208
  let e = new FileReader();
207
209
  e.readAsArrayBuffer(c), e.onloadend = function() {
208
210
  let n = z(e.result), r = new DataView(new ArrayBuffer(j));
@@ -254,18 +256,18 @@ var H = class {
254
256
  }
255
257
  return this.uids.get(e).get(t);
256
258
  }
257
- isNormalizedNormalAttribute(t) {
258
- if (this.cache.attributesNormalized.has(t)) return !1;
259
- let n = new e();
260
- for (let e = 0, r = t.count; e < r; e++) if (Math.abs(n.fromBufferAttribute(t, e).length() - 1) > 5e-4) return !1;
259
+ isNormalizedNormalAttribute(e) {
260
+ if (this.cache.attributesNormalized.has(e)) return !1;
261
+ let n = new t();
262
+ for (let t = 0, r = e.count; t < r; t++) if (Math.abs(n.fromBufferAttribute(e, t).length() - 1) > 5e-4) return !1;
261
263
  return !0;
262
264
  }
263
- createNormalizedNormalAttribute(t) {
265
+ createNormalizedNormalAttribute(e) {
264
266
  let n = this.cache;
265
- if (n.attributesNormalized.has(t)) return n.attributesNormalized.get(t);
266
- let r = t.clone(), i = new e();
267
+ if (n.attributesNormalized.has(e)) return n.attributesNormalized.get(e);
268
+ let r = e.clone(), i = new t();
267
269
  for (let e = 0, t = r.count; e < t; e++) i.fromBufferAttribute(r, e), i.x === 0 && i.y === 0 && i.z === 0 ? i.setX(1) : i.normalize(), r.setXYZ(e, i.x, i.y, i.z);
268
- return n.attributesNormalized.set(t, r), r;
270
+ return n.attributesNormalized.set(e, r), r;
269
271
  }
270
272
  applyTextureTransform(e, t) {
271
273
  let n = !1, r = {};
@@ -283,22 +285,22 @@ var H = class {
283
285
  e instanceof i && (e = await this.decompressTextureAsync(e)), t instanceof i && (t = await this.decompressTextureAsync(t));
284
286
  let r = e ? e.image : null, a = t ? t.image : null, o = Math.max(r ? r.width : 0, a ? a.width : 0), s = Math.max(r ? r.height : 0, a ? a.height : 0), c = B();
285
287
  c.width = o, c.height = s;
286
- let u = c.getContext("2d", { willReadFrequently: !0 });
287
- u.fillStyle = "#00ffff", u.fillRect(0, 0, o, s);
288
- let d = u.getImageData(0, 0, o, s);
288
+ let l = c.getContext("2d", { willReadFrequently: !0 });
289
+ l.fillStyle = "#00ffff", l.fillRect(0, 0, o, s);
290
+ let u = l.getImageData(0, 0, o, s);
289
291
  if (r) {
290
- u.drawImage(r, 0, 0, o, s);
291
- let t = n(e), i = u.getImageData(0, 0, o, s).data;
292
- for (let e = 2; e < i.length; e += 4) d.data[e] = t(i[e] / 256) * 256;
292
+ l.drawImage(r, 0, 0, o, s);
293
+ let t = n(e), i = l.getImageData(0, 0, o, s).data;
294
+ for (let e = 2; e < i.length; e += 4) u.data[e] = t(i[e] / 256) * 256;
293
295
  }
294
296
  if (a) {
295
- u.drawImage(a, 0, 0, o, s);
296
- let e = n(t), r = u.getImageData(0, 0, o, s).data;
297
- for (let t = 1; t < r.length; t += 4) d.data[t] = e(r[t] / 256) * 256;
297
+ l.drawImage(a, 0, 0, o, s);
298
+ let e = n(t), r = l.getImageData(0, 0, o, s).data;
299
+ for (let t = 1; t < r.length; t += 4) u.data[t] = e(r[t] / 256) * 256;
298
300
  }
299
- u.putImageData(d, 0, 0);
300
- let f = (e || t).clone();
301
- return f.source = new l(c), f.colorSpace = "", f.channel = (e || t).channel, e && t && e.channel !== t.channel && console.warn("THREE.GLTFExporter: UV channels for metalnessMap and roughnessMap textures must match."), console.warn("THREE.GLTFExporter: Merged metalnessMap and roughnessMap textures."), f;
301
+ l.putImageData(u, 0, 0);
302
+ let d = (e || t).clone();
303
+ return d.source = new _(c), d.colorSpace = "", d.channel = (e || t).channel, e && t && e.channel !== t.channel && console.warn("THREE.GLTFExporter: UV channels for metalnessMap and roughnessMap textures must match."), console.warn("THREE.GLTFExporter: Merged metalnessMap and roughnessMap textures."), d;
302
304
  }
303
305
  async buildNormalMapTextureAsync(e, t, n) {
304
306
  e instanceof i && (e = await this.decompressTextureAsync(e));
@@ -309,8 +311,8 @@ var H = class {
309
311
  let s = o.getImageData(0, 0, a.width, a.height), c = s.data;
310
312
  for (let e = 0; e < c.length; e += 4) t && (c[e + 0] = 255 - c[e + 0]), n && (c[e + 1] = 255 - c[e + 1]);
311
313
  o.putImageData(s, 0, 0);
312
- let u = e.clone();
313
- return u.source = new l(a), u;
314
+ let l = e.clone();
315
+ return l.source = new _(a), l;
314
316
  }
315
317
  async decompressTextureAsync(e, t = Infinity) {
316
318
  if (this.textureUtils === null) throw Error("THREE.GLTFExporter: setTextureUtils() must be called to process compressed textures.");
@@ -484,13 +486,17 @@ var H = class {
484
486
  }
485
487
  }
486
488
  if (e.normalMap) {
487
- let t = e.normalScale, n = t.x < 0, r = i ? t.y < 0 : t.y > 0, a = e.normalMap;
488
- (n || r) && (a = await this.buildNormalMapTextureAsync(e.normalMap, n, r));
489
- let s = {
490
- index: await this.processTextureAsync(a),
489
+ let t = e.normalScale, r = t.x < 0, a = i ? t.y < 0 : t.y > 0, s = e.normalMap;
490
+ if (r || a) {
491
+ n.normalMaps.has(e.normalMap) === !1 && n.normalMaps.set(e.normalMap, {});
492
+ let t = n.normalMaps.get(e.normalMap), i = `${r}:${a}`;
493
+ t[i] === void 0 && (t[i] = await this.buildNormalMapTextureAsync(e.normalMap, r, a)), s = t[i];
494
+ }
495
+ let c = {
496
+ index: await this.processTextureAsync(s),
491
497
  texCoord: e.normalMap.channel
492
498
  };
493
- Math.abs(t.x) !== 1 && (s.scale = Math.abs(t.x)), this.applyTextureTransform(s, e.normalMap), o.normalTexture = s;
499
+ Math.abs(t.x) !== 1 && (c.scale = Math.abs(t.x)), this.applyTextureTransform(c, e.normalMap), o.normalTexture = c;
494
500
  }
495
501
  if (e.aoMap) {
496
502
  let t = {
@@ -631,46 +637,46 @@ var H = class {
631
637
  }, e.name !== "" && (r.name = e.type), t.cameras.push(r) - 1;
632
638
  }
633
639
  processAnimation(e, t) {
634
- let n = this.json, r = this.nodeMap;
635
- n.animations ||= [], e = S.Utils.mergeMorphTargetTracks(e.clone(), t);
636
- let i = e.tracks, o = [], s = [];
637
- for (let e = 0; e < i.length; ++e) {
638
- let n = i[e], c = a.parseTrackName(n.name), l = a.findNode(t, c.nodeName), u = E[c.propertyName];
640
+ let r = this.json, i = this.nodeMap;
641
+ r.animations ||= [], e = S.Utils.mergeMorphTargetTracks(e.clone(), t);
642
+ let a = e.tracks, o = [], s = [];
643
+ for (let e = 0; e < a.length; ++e) {
644
+ let r = a[e], c = n.parseTrackName(r.name), l = n.findNode(t, c.nodeName), u = E[c.propertyName];
639
645
  if (c.objectName === "bones" && (l = l.isSkinnedMesh === !0 ? l.skeleton.getBoneByName(c.objectIndex) : void 0), !l || !u) {
640
- console.warn("THREE.GLTFExporter: Could not export animation track \"%s\".", n.name);
646
+ console.warn("THREE.GLTFExporter: Could not export animation track \"%s\".", r.name);
641
647
  continue;
642
648
  }
643
- let d = n.values.length / n.times.length;
649
+ let d = r.values.length / r.times.length;
644
650
  u === E.morphTargetInfluences && (d /= l.morphTargetInfluences.length);
645
651
  let f;
646
- n.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline === !0 ? (f = "CUBICSPLINE", d /= 3) : f = n.getInterpolation() === 2300 ? "STEP" : "LINEAR", s.push({
647
- input: this.processAccessor(new m(n.times, 1)),
648
- output: this.processAccessor(new m(n.values, d)),
652
+ r.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline === !0 ? (f = "CUBICSPLINE", d /= 3) : f = r.getInterpolation() === 2300 ? "STEP" : "LINEAR", s.push({
653
+ input: this.processAccessor(new g(r.times, 1)),
654
+ output: this.processAccessor(new g(r.values, d)),
649
655
  interpolation: f
650
656
  }), o.push({
651
657
  sampler: s.length - 1,
652
658
  target: {
653
- node: r.get(l),
659
+ node: i.get(l),
654
660
  path: u
655
661
  }
656
662
  });
657
663
  }
658
664
  let c = {
659
- name: e.name || "clip_" + n.animations.length,
665
+ name: e.name || "clip_" + r.animations.length,
660
666
  samplers: s,
661
667
  channels: o
662
668
  };
663
- return this.serializeUserData(e, c), n.animations.push(c), n.animations.length - 1;
669
+ return this.serializeUserData(e, c), r.animations.push(c), r.animations.length - 1;
664
670
  }
665
671
  processSkin(e) {
666
672
  let t = this.json, n = this.nodeMap, r = t.nodes[n.get(e)], i = e.skeleton;
667
673
  if (i === void 0) return null;
668
674
  let a = e.skeleton.bones[0];
669
675
  if (a === void 0) return null;
670
- let o = [], s = new Float32Array(i.bones.length * 16), c = new g();
676
+ let o = [], s = new Float32Array(i.bones.length * 16), c = new m();
671
677
  for (let t = 0; t < i.bones.length; ++t) o.push(n.get(i.bones[t])), c.copy(i.boneInverses[t]), c.multiply(e.bindMatrix).toArray(s, t * 16);
672
678
  return t.skins === void 0 && (t.skins = []), t.skins.push({
673
- inverseBindMatrices: this.processAccessor(new m(s, 16)),
679
+ inverseBindMatrices: this.processAccessor(new g(s, 16)),
674
680
  joints: o,
675
681
  skeleton: n.get(a)
676
682
  }), r.skin = t.skins.length - 1;
@@ -785,24 +791,24 @@ var H = class {
785
791
  i.length > 0 && (r.nodes = i), this.serializeUserData(e, r);
786
792
  }
787
793
  async processObjectsAsync(e) {
788
- let n = new t();
789
- n.name = "AuxScene";
790
- for (let t = 0; t < e.length; t++) n.children.push(e[t]);
791
- await this.processSceneAsync(n);
794
+ let t = new u();
795
+ t.name = "AuxScene";
796
+ for (let n = 0; n < e.length; n++) t.children.push(e[n]);
797
+ await this.processSceneAsync(t);
792
798
  }
793
799
  async processInputAsync(e) {
794
- let n = this.options;
800
+ let t = this.options;
795
801
  e = e instanceof Array ? e : [e], await this._invokeAllAsync(function(t) {
796
802
  t.beforeParse && t.beforeParse(e);
797
803
  });
798
- let r = [];
799
- for (let n = 0; n < e.length; n++) e[n] instanceof t ? await this.processSceneAsync(e[n]) : r.push(e[n]);
800
- r.length > 0 && await this.processObjectsAsync(r);
804
+ let n = [];
805
+ for (let t = 0; t < e.length; t++) e[t] instanceof u ? await this.processSceneAsync(e[t]) : n.push(e[t]);
806
+ n.length > 0 && await this.processObjectsAsync(n);
801
807
  for (let e = 0; e < this.skins.length; ++e) this.processSkin(this.skins[e]);
802
- if (e.length === 1) for (let t = 0; t < n.animations.length; ++t) this.processAnimation(n.animations[t], e[0]);
803
- else for (let t = 0; t < e.length; t++) {
804
- let r = n.animations[t] || [];
805
- for (let n = 0; n < r.length; ++n) this.processAnimation(r[n], e[t]);
808
+ if (e.length === 1) for (let n = 0; n < t.animations.length; ++n) this.processAnimation(t.animations[n], e[0]);
809
+ else for (let n = 0; n < e.length; n++) {
810
+ let r = t.animations[n] || [];
811
+ for (let t = 0; t < r.length; ++t) this.processAnimation(r[t], e[n]);
806
812
  }
807
813
  await this._invokeAllAsync(function(t) {
808
814
  t.afterParse && t.afterParse(e);
@@ -1026,16 +1032,16 @@ var H = class {
1026
1032
  constructor(e) {
1027
1033
  this.writer = e, this.name = "EXT_mesh_gpu_instancing";
1028
1034
  }
1029
- writeNode(t, r) {
1030
- if (!t.isInstancedMesh) return;
1031
- let i = this.writer, a = t, o = new Float32Array(a.count * 3), s = new Float32Array(a.count * 4), c = new Float32Array(a.count * 3), l = new g(), u = new e(), d = new n(), f = new e();
1032
- for (let e = 0; e < a.count; e++) a.getMatrixAt(e, l), l.decompose(u, d, f), u.toArray(o, e * 3), d.toArray(s, e * 4), f.toArray(c, e * 3);
1035
+ writeNode(e, n) {
1036
+ if (!e.isInstancedMesh) return;
1037
+ let r = this.writer, i = e, a = new Float32Array(i.count * 3), o = new Float32Array(i.count * 4), c = new Float32Array(i.count * 3), l = new m(), u = new t(), d = new s(), f = new t();
1038
+ for (let e = 0; e < i.count; e++) i.getMatrixAt(e, l), l.decompose(u, d, f), u.toArray(a, e * 3), d.toArray(o, e * 4), f.toArray(c, e * 3);
1033
1039
  let p = {
1034
- TRANSLATION: i.processAccessor(new m(o, 3)),
1035
- ROTATION: i.processAccessor(new m(s, 4)),
1036
- SCALE: i.processAccessor(new m(c, 3))
1040
+ TRANSLATION: r.processAccessor(new g(a, 3)),
1041
+ ROTATION: r.processAccessor(new g(o, 4)),
1042
+ SCALE: r.processAccessor(new g(c, 3))
1037
1043
  };
1038
- a.instanceColor && (p._COLOR_0 = i.processAccessor(a.instanceColor)), r.extensions = r.extensions || {}, r.extensions[this.name] = { attributes: p }, i.extensionsUsed[this.name] = !0, i.extensionsRequired[this.name] = !0;
1044
+ i.instanceColor && (p._COLOR_0 = r.processAccessor(i.instanceColor)), n.extensions = n.extensions || {}, n.extensions[this.name] = { attributes: p }, r.extensionsUsed[this.name] = !0, r.extensionsRequired[this.name] = !0;
1039
1045
  }
1040
1046
  };
1041
1047
  S.Utils = {
@@ -1061,39 +1067,39 @@ S.Utils = {
1061
1067
  return e.times = i, e.values = a, s;
1062
1068
  },
1063
1069
  mergeMorphTargetTracks: function(e, t) {
1064
- let n = [], r = {}, i = e.tracks;
1065
- for (let e = 0; e < i.length; ++e) {
1066
- let o = i[e], s = a.parseTrackName(o.name), c = a.findNode(t, s.nodeName);
1070
+ let r = [], i = {}, a = e.tracks;
1071
+ for (let e = 0; e < a.length; ++e) {
1072
+ let o = a[e], s = n.parseTrackName(o.name), c = n.findNode(t, s.nodeName);
1067
1073
  if (s.propertyName !== "morphTargetInfluences" || s.propertyIndex === void 0) {
1068
- n.push(o);
1074
+ r.push(o);
1069
1075
  continue;
1070
1076
  }
1071
1077
  if (o.createInterpolant !== o.InterpolantFactoryMethodDiscrete && o.createInterpolant !== o.InterpolantFactoryMethodLinear) {
1072
1078
  if (o.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline) throw Error("THREE.GLTFExporter: Cannot merge tracks with glTF CUBICSPLINE interpolation.");
1073
- console.warn("THREE.GLTFExporter: Morph target interpolation mode not yet supported. Using LINEAR instead."), o = o.clone(), o.setInterpolation(p);
1079
+ console.warn("THREE.GLTFExporter: Morph target interpolation mode not yet supported. Using LINEAR instead."), o = o.clone(), o.setInterpolation(h);
1074
1080
  }
1075
1081
  let l = c.morphTargetInfluences.length, u = c.morphTargetDictionary[s.propertyIndex];
1076
1082
  if (u === void 0) throw Error("THREE.GLTFExporter: Morph target name not found: " + s.propertyIndex);
1077
1083
  let d;
1078
- if (r[c.uuid] === void 0) {
1084
+ if (i[c.uuid] === void 0) {
1079
1085
  d = o.clone();
1080
1086
  let e = new d.ValueBufferType(l * d.times.length);
1081
1087
  for (let t = 0; t < d.times.length; t++) e[t * l + u] = d.values[t];
1082
- d.name = (s.nodeName || "") + ".morphTargetInfluences", d.values = e, r[c.uuid] = d, n.push(d);
1088
+ d.name = (s.nodeName || "") + ".morphTargetInfluences", d.values = e, i[c.uuid] = d, r.push(d);
1083
1089
  continue;
1084
1090
  }
1085
1091
  let f = o.createInterpolant(new o.ValueBufferType(1));
1086
- d = r[c.uuid];
1092
+ d = i[c.uuid];
1087
1093
  for (let e = 0; e < d.times.length; e++) d.values[e * l + u] = f.evaluate(d.times[e]);
1088
1094
  for (let e = 0; e < o.times.length; e++) {
1089
1095
  let t = this.insertKeyframe(d, o.times[e]);
1090
1096
  d.values[t * l + u] = o.values[e];
1091
1097
  }
1092
1098
  }
1093
- return e.tracks = n, e;
1099
+ return e.tracks = r, e;
1094
1100
  },
1095
1101
  toTypedBufferAttribute: function(e, t) {
1096
- let n = new m(new t(e.count * e.itemSize), e.itemSize, !1);
1102
+ let n = new g(new t(e.count * e.itemSize), e.itemSize, !1);
1097
1103
  if (!e.normalized && !e.isInterleavedBufferAttribute) return n.array.set(e.array), n;
1098
1104
  for (let t = 0, r = e.count; t < r; t++) for (let r = 0; r < e.itemSize; r++) n.setComponent(t, r, e.getComponent(t, r));
1099
1105
  return n;
@@ -1102,4 +1108,4 @@ S.Utils = {
1102
1108
  //#endregion
1103
1109
  export { S as GLTFExporter };
1104
1110
 
1105
- //# sourceMappingURL=GLTFExporter-yQ7mMauu.mjs.map
1111
+ //# sourceMappingURL=GLTFExporter-DeNw0qAI.mjs.map