@roomle/web-sdk 3.6.0 → 3.7.0-alpha.2

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 (149) hide show
  1. package/lib/{BufferGeometry-DLEagG41.mjs → BufferGeometry-C696z6r3.mjs} +2 -2
  2. package/lib/{BufferGeometry-DLEagG41.mjs.map → BufferGeometry-C696z6r3.mjs.map} +1 -1
  3. package/lib/ConfiguratorKernel.js +54 -73
  4. package/lib/ConfiguratorKernel.wasm +0 -0
  5. package/lib/{GLTFExporter-D8qsdwDK.mjs → GLTFExporter-AfQIvZAD.mjs} +141 -141
  6. package/lib/{GLTFExporter-D8qsdwDK.mjs.map → GLTFExporter-AfQIvZAD.mjs.map} +1 -1
  7. package/lib/{Object3D-DSjIOhON.mjs → Object3D-C3wqWk6O.mjs} +1 -1
  8. package/lib/{Object3D-DSjIOhON.mjs.map → Object3D-C3wqWk6O.mjs.map} +1 -1
  9. package/lib/{PointLightHelper-BnjxGaOG.mjs → PointLightHelper-wVSmrAnD.mjs} +4 -4
  10. package/lib/{PointLightHelper-BnjxGaOG.mjs.map → PointLightHelper-wVSmrAnD.mjs.map} +1 -1
  11. package/lib/RoomleCore.js +59 -79
  12. package/lib/RoomleCore.wasm +0 -0
  13. package/lib/RoomleToolsCore.js +54 -74
  14. package/lib/RoomleToolsCore.wasm +0 -0
  15. package/lib/{SpotLightHelper-DqsfqCrs.mjs → SpotLightHelper-C7J95t4f.mjs} +3 -3
  16. package/lib/{SpotLightHelper-DqsfqCrs.mjs.map → SpotLightHelper-C7J95t4f.mjs.map} +1 -1
  17. package/lib/{USDZExporter-DxIqi8St.mjs → USDZExporter-BBk0APeK.mjs} +3 -3
  18. package/lib/{USDZExporter-DxIqi8St.mjs.map → USDZExporter-BBk0APeK.mjs.map} +1 -1
  19. package/lib/{Vector4-DGmBYfpK.mjs → Vector4-DUqY3Egg.mjs} +2 -2
  20. package/lib/{Vector4-DGmBYfpK.mjs.map → Vector4-DUqY3Egg.mjs.map} +1 -1
  21. package/lib/{api-xDJ-Uyom.mjs → api-oYzhcs_W.mjs} +2 -2
  22. package/lib/{api-xDJ-Uyom.mjs.map → api-oYzhcs_W.mjs.map} +1 -1
  23. package/lib/asset-loader.worker-A7nEeQB4.mjs +6 -0
  24. package/lib/asset-loader.worker-A7nEeQB4.mjs.map +1 -0
  25. package/lib/{banana-for-scale-C_iNmlCT.mjs → banana-for-scale-D8t2dmc7.mjs} +4 -4
  26. package/lib/banana-for-scale-D8t2dmc7.mjs.map +1 -0
  27. package/lib/budgeteer.sw-CQWYbQSc.mjs +6 -0
  28. package/lib/budgeteer.sw-CQWYbQSc.mjs.map +1 -0
  29. package/lib/{common-utils-DMSTohiS.mjs → common-utils-qErzZAiR.mjs} +2 -2
  30. package/lib/common-utils-qErzZAiR.mjs.map +1 -0
  31. package/lib/{component-dimensioning-CvRmUja4.mjs → component-dimensioning-DlB7-9Om.mjs} +49 -49
  32. package/lib/{component-dimensioning-CvRmUja4.mjs.map → component-dimensioning-DlB7-9Om.mjs.map} +1 -1
  33. package/lib/{component-raycast-helper-CEp7wy9c.mjs → component-raycast-helper-C6ptEb0K.mjs} +27 -32
  34. package/lib/component-raycast-helper-C6ptEb0K.mjs.map +1 -0
  35. package/lib/component-raycast-helper-LrhRpeDD.mjs +2 -0
  36. package/lib/configurator-CRMunIq7.mjs +45 -0
  37. package/lib/{configurator-CmuhFgC9.mjs.map → configurator-CRMunIq7.mjs.map} +1 -1
  38. package/lib/configurator-DqiW717d.mjs +2 -0
  39. package/lib/{continuous-drawing-helper-v_5UAM9A.mjs → continuous-drawing-helper-BwulJHKj.mjs} +12 -12
  40. package/lib/continuous-drawing-helper-BwulJHKj.mjs.map +1 -0
  41. package/lib/dat.gui.module-CZHqOVGq.mjs +1500 -0
  42. package/lib/dat.gui.module-CZHqOVGq.mjs.map +1 -0
  43. package/lib/{decorate-C1QnXPYw.mjs → decorate-BAtqSPNS.mjs} +3 -3
  44. package/lib/decorate-BAtqSPNS.mjs.map +1 -0
  45. package/lib/{dimensioning-helper-Fwpt1HTT.mjs → dimensioning-helper--Y0Y-Wr1.mjs} +42 -42
  46. package/lib/{dimensioning-helper-Fwpt1HTT.mjs.map → dimensioning-helper--Y0Y-Wr1.mjs.map} +1 -1
  47. package/lib/dimensioning-helper-BpUreWo2.mjs +2 -0
  48. package/lib/{fflate.module-dFNj5UPI.mjs → fflate.module-CBz7CLOg.mjs} +1 -1
  49. package/lib/{fflate.module-dFNj5UPI.mjs.map → fflate.module-CBz7CLOg.mjs.map} +1 -1
  50. package/lib/{glb-viewer-BzNA9-zH.mjs → glb-viewer-CXEoIw1b.mjs} +48 -48
  51. package/lib/glb-viewer-CXEoIw1b.mjs.map +1 -0
  52. package/lib/glb-viewer-IDXgmONx.mjs +2 -0
  53. package/lib/{homag-intelligence-BwGjJEws.mjs → homag-intelligence-gb9MqBrz.mjs} +6 -3
  54. package/lib/{homag-intelligence-BwGjJEws.mjs.map → homag-intelligence-gb9MqBrz.mjs.map} +1 -1
  55. package/lib/{imos-ix-poc-export-helper-CQh94HsO.mjs → imos-ix-poc-export-helper-CW7QZhhn.mjs} +5 -4
  56. package/lib/imos-ix-poc-export-helper-CW7QZhhn.mjs.map +1 -0
  57. package/lib/{kernel-BAQSG9r5.mjs → kernel-C7YDLxq8.mjs} +3 -2
  58. package/lib/kernel-C7YDLxq8.mjs.map +1 -0
  59. package/lib/{kernel-utils-H74uNY1h.mjs → kernel-utils-DCnHzW4n.mjs} +15 -15
  60. package/lib/kernel-utils-DCnHzW4n.mjs.map +1 -0
  61. package/lib/{layer-C_JtkhdO.mjs → layer-CFAr2mK_.mjs} +1 -1
  62. package/lib/{layer-C_JtkhdO.mjs.map → layer-CFAr2mK_.mjs.map} +1 -1
  63. package/lib/{main-CtVIB52l.mjs → main-BJZ9-cDk.mjs} +14470 -14187
  64. package/lib/main-BJZ9-cDk.mjs.map +1 -0
  65. package/lib/{material-viewer-Bq4smZ6f.mjs → material-viewer-D8Nmpwg0.mjs} +41 -41
  66. package/lib/material-viewer-D8Nmpwg0.mjs.map +1 -0
  67. package/lib/packages-Uv53SHfb.mjs +4 -0
  68. package/lib/planner-5VarJrpy.mjs +44 -0
  69. package/lib/{planner-CVw_xzGh.mjs.map → planner-5VarJrpy.mjs.map} +1 -1
  70. package/lib/planner-DJcn-iih.mjs +2 -0
  71. package/lib/{plugin-system-D9K46xJk.mjs → plugin-system-DInww4H_.mjs} +3 -3
  72. package/lib/{plugin-system-D9K46xJk.mjs.map → plugin-system-DInww4H_.mjs.map} +1 -1
  73. package/lib/rolldown-runtime-DgwB9i60.mjs +13 -0
  74. package/lib/roomle-headless-setup-LoBO7UJe.mjs +1150 -0
  75. package/lib/roomle-headless-setup-LoBO7UJe.mjs.map +1 -0
  76. package/lib/roomle-headless.d.ts +9910 -0
  77. package/lib/roomle-headless.js +321 -0
  78. package/lib/roomle-headless.js.map +1 -0
  79. package/lib/roomle-renderer-DVlJsHYn.mjs +49 -0
  80. package/lib/roomle-renderer-DVlJsHYn.mjs.map +1 -0
  81. package/lib/roomle-sdk.d.ts +466 -1129
  82. package/lib/roomle-sdk.js +8 -7
  83. package/lib/roomle-webgpu-renderer-CVxBRv6o.mjs +217 -0
  84. package/lib/roomle-webgpu-renderer-CVxBRv6o.mjs.map +1 -0
  85. package/lib/{scene-renderer-D8HkTFeZ.mjs → scene-renderer-BHZrQYAH.mjs} +501 -518
  86. package/lib/scene-renderer-BHZrQYAH.mjs.map +1 -0
  87. package/lib/script-loader-gpkcl1h-.mjs +86 -0
  88. package/lib/script-loader-gpkcl1h-.mjs.map +1 -0
  89. package/lib/static/roomle-core-hsc/node_modules/roomle-core-hsc/package.json +1 -1
  90. package/lib/static/roomle-core-hsc/node_modules/roomle-core-hsc/src/embind/configuratorCallback.d.ts +3 -3
  91. package/lib/static/roomle-core-hsc/node_modules/roomle-core-hsc/src/embind/configuratorCallback.js +3 -3
  92. package/lib/static/roomle-core-hsc/node_modules/roomle-core-hsc/src/embind/configuratorCallback.js.map +1 -1
  93. package/lib/static/roomle-core-hsc/node_modules/roomle-core-hsc/src/embind/configuratorCoreInterface.d.ts +5 -3
  94. package/lib/static/roomle-core-hsc/node_modules/roomle-core-hsc/src/embind/configuratorCoreInterface.js +1 -1
  95. package/lib/static/roomle-core-hsc/node_modules/roomle-core-hsc/src/embind/configuratorCoreInterface.js.map +1 -1
  96. package/lib/static/roomle-core-hsc/node_modules/roomle-core-hsc/src/embind/plannerCoreCallback.d.ts +1 -0
  97. package/lib/static/roomle-core-hsc/node_modules/roomle-core-hsc/src/embind/plannerCoreCallback.js +3 -0
  98. package/lib/static/roomle-core-hsc/node_modules/roomle-core-hsc/src/embind/plannerCoreCallback.js.map +1 -1
  99. package/lib/static/roomle-core-hsc/node_modules/roomle-core-hsc/src/embind/plannerCoreInterface.d.ts +4 -3
  100. package/lib/static/roomle-core-hsc/node_modules/roomle-core-hsc/src/embind/plannerCoreInterface.js.map +1 -1
  101. package/lib/static/roomle-core-hsc/node_modules/roomle-core-hsc/src/loader/configurationLoader.d.ts +3 -2
  102. package/lib/static/roomle-core-hsc/node_modules/roomle-core-hsc/src/loader/configurationLoader.js +31 -9
  103. package/lib/static/roomle-core-hsc/node_modules/roomle-core-hsc/src/loader/configurationLoader.js.map +1 -1
  104. package/lib/static/roomle-core-hsc/node_modules/roomle-core-hsc/src/loader/configurationManager.js +8 -1
  105. package/lib/static/roomle-core-hsc/node_modules/roomle-core-hsc/src/loader/configurationManager.js.map +1 -1
  106. package/lib/static/roomle-core-hsc/node_modules/roomle-core-hsc/wasm_modern/ConfiguratorKernel.js +54 -73
  107. package/lib/static/roomle-core-hsc/node_modules/roomle-core-hsc/wasm_modern/ConfiguratorKernel.wasm +0 -0
  108. package/lib/static/roomle-core-hsc/node_modules/roomle-core-hsc/wasm_modern/RoomleCore.js +59 -79
  109. package/lib/static/roomle-core-hsc/node_modules/roomle-core-hsc/wasm_modern/RoomleCore.wasm +0 -0
  110. package/lib/static/roomle-core-hsc/node_modules/roomle-core-hsc/wasm_modern/RoomleToolsCore.js +54 -74
  111. package/lib/static/roomle-core-hsc/node_modules/roomle-core-hsc/wasm_modern/RoomleToolsCore.wasm +0 -0
  112. package/lib/{stats-helper-HM0TaIM5.mjs → stats-helper-Cv5SoEWT.mjs} +4 -3
  113. package/lib/{stats-helper-HM0TaIM5.mjs.map → stats-helper-Cv5SoEWT.mjs.map} +1 -1
  114. package/lib/{three.core-CLIofecG.mjs → three.core-mM-jZdgg.mjs} +926 -926
  115. package/lib/{three.core-CLIofecG.mjs.map → three.core-mM-jZdgg.mjs.map} +1 -1
  116. package/lib/{three.module-C4Q1skJQ.mjs → three.module-Bmy3sVQ-.mjs} +1210 -1210
  117. package/lib/{three.module-C4Q1skJQ.mjs.map → three.module-Bmy3sVQ-.mjs.map} +1 -1
  118. package/lib/{three.webgpu-dFspy2yF.mjs → three.webgpu-BbVYfCDp.mjs} +5360 -2940
  119. package/lib/{three.webgpu-dFspy2yF.mjs.map → three.webgpu-BbVYfCDp.mjs.map} +1 -1
  120. package/lib/three.webgpu-Bnp8Whu8.mjs +3 -0
  121. package/lib/threejs-utils-Bq4pVWBA.mjs +753 -0
  122. package/lib/threejs-utils-Bq4pVWBA.mjs.map +1 -0
  123. package/lib/{tools-core-Bf9WsK5v.mjs → tools-core-DqnhFefF.mjs} +6 -6
  124. package/lib/{tools-core-Bf9WsK5v.mjs.map → tools-core-DqnhFefF.mjs.map} +1 -1
  125. package/lib/workers-BJYv3y38.mjs +6 -0
  126. package/lib/workers-BJYv3y38.mjs.map +1 -0
  127. package/package.json +20 -5
  128. package/lib/banana-for-scale-C_iNmlCT.mjs.map +0 -1
  129. package/lib/common-utils-DMSTohiS.mjs.map +0 -1
  130. package/lib/component-raycast-helper-CEp7wy9c.mjs.map +0 -1
  131. package/lib/configurator-BaUt4_LF.mjs +0 -2
  132. package/lib/configurator-CmuhFgC9.mjs +0 -45
  133. package/lib/continuous-drawing-helper-v_5UAM9A.mjs.map +0 -1
  134. package/lib/decorate-C1QnXPYw.mjs.map +0 -1
  135. package/lib/dimensioning-helper-DTcW85Oq.mjs +0 -2
  136. package/lib/glb-viewer-BzNA9-zH.mjs.map +0 -1
  137. package/lib/glb-viewer-DOxBD5k-.mjs +0 -2
  138. package/lib/imos-ix-poc-export-helper-CQh94HsO.mjs.map +0 -1
  139. package/lib/kernel-BAQSG9r5.mjs.map +0 -1
  140. package/lib/kernel-utils-H74uNY1h.mjs.map +0 -1
  141. package/lib/main-CtVIB52l.mjs.map +0 -1
  142. package/lib/material-viewer-Bq4smZ6f.mjs.map +0 -1
  143. package/lib/planner-CVw_xzGh.mjs +0 -44
  144. package/lib/planner-si70gWA2.mjs +0 -2
  145. package/lib/scene-renderer-D8HkTFeZ.mjs.map +0 -1
  146. package/lib/script-loader-D8xCRzTr.mjs +0 -45
  147. package/lib/script-loader-D8xCRzTr.mjs.map +0 -1
  148. package/lib/threejs-utils-jEzvlJF1.mjs +0 -2233
  149. package/lib/threejs-utils-jEzvlJF1.mjs.map +0 -1
@@ -1,4 +1,4 @@
1
- import { $ as e, $n as t, At as n, Ct as r, Gt as i, Jt as a, Kt as o, Nt as s, Rr as c, St as l, _r as u, an as d, c as f, h as p, lr as m, on as h, p as g, qt as _, ut as v, v as y, wt as b } from "./three.core-CLIofecG.mjs";
1
+ import { At as e, C as t, D as n, In as r, Kt as i, Nn as a, Vr as o, Xr as s, Xt as c, Yt as l, bn as u, jr as d, on as f, p, rn as m, vn as h, vt as g, x as _, xi as v, xn as y, yn as b } from "./three.core-mM-jZdgg.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[o] = C.NEAREST, T[a] = C.NEAREST_MIPMAP_NEAREST, T[_] = C.NEAREST_MIPMAP_LINEAR, T[l] = C.LINEAR, T[b] = C.LINEAR_MIPMAP_NEAREST, T[r] = C.LINEAR_MIPMAP_LINEAR, T[g] = C.CLAMP_TO_EDGE, T[t] = C.REPEAT, T[i] = C.MIRRORED_REPEAT;
103
+ T[b] = C.NEAREST, T[y] = C.NEAREST_MIPMAP_NEAREST, T[u] = C.NEAREST_MIPMAP_LINEAR, T[i] = C.LINEAR, T[c] = C.LINEAR_MIPMAP_NEAREST, T[l] = C.LINEAR_MIPMAP_LINEAR, T[_] = C.CLAMP_TO_EDGE, T[d] = C.REPEAT, T[h] = 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 p(), O = 12, k = 1179937895, A = 2, j = 8, M = 1313821514, N = 5130562;
109
+ }, D = new t(), 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];
@@ -135,16 +135,16 @@ function I(e) {
135
135
  1
136
136
  ]);
137
137
  }
138
- function L(e, t, r) {
139
- let i = {
138
+ function L(e, t, n) {
139
+ let r = {
140
140
  min: Array(e.itemSize).fill(Infinity),
141
141
  max: Array(e.itemSize).fill(-Infinity)
142
142
  };
143
- for (let a = t; a < t + r; a++) for (let t = 0; t < e.itemSize; t++) {
144
- let r;
145
- e.itemSize > 4 ? r = e.array[a * e.itemSize + t] : (t === 0 ? r = e.getX(a) : t === 1 ? r = e.getY(a) : t === 2 ? r = e.getZ(a) : t === 3 && (r = e.getW(a)), e.normalized === !0 && (r = n.normalize(r, e.array))), i.min[t] = Math.min(i.min[t], r), i.max[t] = Math.max(i.max[t], r);
143
+ for (let i = t; i < t + n; i++) for (let t = 0; t < e.itemSize; t++) {
144
+ let n;
145
+ e.itemSize > 4 ? n = e.array[i * e.itemSize + t] : (t === 0 ? n = e.getX(i) : t === 1 ? n = e.getY(i) : t === 2 ? n = e.getZ(i) : t === 3 && (n = e.getW(i)), e.normalized === !0 && (n = m.normalize(n, e.array))), r.min[t] = Math.min(r.min[t], n), r.max[t] = Math.max(r.max[t], n);
146
146
  }
147
- return i;
147
+ return r;
148
148
  }
149
149
  function R(e) {
150
150
  return Math.ceil(e / 4) * 4;
@@ -256,14 +256,14 @@ var H = class {
256
256
  }
257
257
  isNormalizedNormalAttribute(e) {
258
258
  if (this.cache.attributesNormalized.has(e)) return !1;
259
- let t = new c();
259
+ let t = new v();
260
260
  for (let n = 0, r = e.count; n < r; n++) if (Math.abs(t.fromBufferAttribute(e, n).length() - 1) > 5e-4) return !1;
261
261
  return !0;
262
262
  }
263
263
  createNormalizedNormalAttribute(e) {
264
264
  let t = this.cache;
265
265
  if (t.attributesNormalized.has(e)) return t.attributesNormalized.get(e);
266
- let n = e.clone(), r = new c();
266
+ let n = e.clone(), r = new v();
267
267
  for (let e = 0, t = n.count; e < t; e++) r.fromBufferAttribute(n, e), r.x === 0 && r.y === 0 && r.z === 0 ? r.setX(1) : r.normalize(), n.setXYZ(e, r.x, r.y, r.z);
268
268
  return t.attributesNormalized.set(e, n), n;
269
269
  }
@@ -273,32 +273,32 @@ var H = class {
273
273
  }
274
274
  async buildMetalRoughTextureAsync(e, t) {
275
275
  if (e === t) return e;
276
- function n(e) {
276
+ function r(e) {
277
277
  return e.colorSpace === "srgb" ? function(e) {
278
278
  return e < .04045 ? e * .0773993808 : (e * .9478672986 + .0521327014) ** 2.4;
279
279
  } : function(e) {
280
280
  return e;
281
281
  };
282
282
  }
283
- e instanceof y && (e = await this.decompressTextureAsync(e)), t instanceof y && (t = await this.decompressTextureAsync(t));
284
- let r = e ? e.image : null, i = t ? t.image : null, a = Math.max(r ? r.width : 0, i ? i.width : 0), o = Math.max(r ? r.height : 0, i ? i.height : 0), s = B();
285
- s.width = a, s.height = o;
286
- let c = s.getContext("2d", { willReadFrequently: !0 });
287
- c.fillStyle = "#00ffff", c.fillRect(0, 0, a, o);
288
- let l = c.getImageData(0, 0, a, o);
289
- if (r) {
290
- c.drawImage(r, 0, 0, a, o);
291
- let t = n(e), i = c.getImageData(0, 0, a, o).data;
292
- for (let e = 2; e < i.length; e += 4) l.data[e] = t(i[e] / 256) * 256;
293
- }
283
+ e instanceof n && (e = await this.decompressTextureAsync(e)), t instanceof n && (t = await this.decompressTextureAsync(t));
284
+ let i = e ? e.image : null, a = t ? t.image : null, o = Math.max(i ? i.width : 0, a ? a.width : 0), c = Math.max(i ? i.height : 0, a ? a.height : 0), l = B();
285
+ l.width = o, l.height = c;
286
+ let u = l.getContext("2d", { willReadFrequently: !0 });
287
+ u.fillStyle = "#00ffff", u.fillRect(0, 0, o, c);
288
+ let d = u.getImageData(0, 0, o, c);
294
289
  if (i) {
295
- c.drawImage(i, 0, 0, a, o);
296
- let e = n(t), r = c.getImageData(0, 0, a, o).data;
297
- for (let t = 1; t < r.length; t += 4) l.data[t] = e(r[t] / 256) * 256;
290
+ u.drawImage(i, 0, 0, o, c);
291
+ let t = r(e), n = u.getImageData(0, 0, o, c).data;
292
+ for (let e = 2; e < n.length; e += 4) d.data[e] = t(n[e] / 256) * 256;
298
293
  }
299
- c.putImageData(l, 0, 0);
300
- let d = (e || t).clone();
301
- return d.source = new u(s), 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;
294
+ if (a) {
295
+ u.drawImage(a, 0, 0, o, c);
296
+ let e = r(t), n = u.getImageData(0, 0, o, c).data;
297
+ for (let t = 1; t < n.length; t += 4) d.data[t] = e(n[t] / 256) * 256;
298
+ }
299
+ u.putImageData(d, 0, 0);
300
+ let f = (e || t).clone();
301
+ return f.source = new s(l), 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;
302
302
  }
303
303
  async decompressTextureAsync(e, t = Infinity) {
304
304
  if (this.textureUtils === null) throw Error("THREE.GLTFExporter: setTextureUtils() must be called to process compressed textures.");
@@ -308,38 +308,38 @@ var H = class {
308
308
  let t = this.json, n = this.buffers;
309
309
  return t.buffers ||= [{ byteLength: 0 }], n.push(e), 0;
310
310
  }
311
- processBufferView(e, t, r, i, a) {
312
- let o = this.json;
313
- o.bufferViews ||= [];
314
- let s;
311
+ processBufferView(e, t, n, r, i) {
312
+ let a = this.json;
313
+ a.bufferViews ||= [];
314
+ let o;
315
315
  switch (t) {
316
316
  case C.BYTE:
317
317
  case C.UNSIGNED_BYTE:
318
- s = 1;
318
+ o = 1;
319
319
  break;
320
320
  case C.SHORT:
321
321
  case C.UNSIGNED_SHORT:
322
- s = 2;
322
+ o = 2;
323
323
  break;
324
- default: s = 4;
324
+ default: o = 4;
325
325
  }
326
- let c = e.itemSize * s;
327
- a === C.ARRAY_BUFFER && (c = Math.ceil(c / 4) * 4);
328
- let l = R(i * c), u = new DataView(new ArrayBuffer(l)), d = 0;
329
- for (let a = r; a < r + i; a++) {
330
- for (let r = 0; r < e.itemSize; r++) {
331
- let i;
332
- e.itemSize > 4 ? i = e.array[a * e.itemSize + r] : (r === 0 ? i = e.getX(a) : r === 1 ? i = e.getY(a) : r === 2 ? i = e.getZ(a) : r === 3 && (i = e.getW(a)), e.normalized === !0 && (i = n.normalize(i, e.array))), t === C.FLOAT ? u.setFloat32(d, i, !0) : t === C.INT ? u.setInt32(d, i, !0) : t === C.UNSIGNED_INT ? u.setUint32(d, i, !0) : t === C.SHORT ? u.setInt16(d, i, !0) : t === C.UNSIGNED_SHORT ? u.setUint16(d, i, !0) : t === C.BYTE ? u.setInt8(d, i) : t === C.UNSIGNED_BYTE && u.setUint8(d, i), d += s;
326
+ let s = e.itemSize * o;
327
+ i === C.ARRAY_BUFFER && (s = Math.ceil(s / 4) * 4);
328
+ let c = R(r * s), l = new DataView(new ArrayBuffer(c)), u = 0;
329
+ for (let i = n; i < n + r; i++) {
330
+ for (let n = 0; n < e.itemSize; n++) {
331
+ let r;
332
+ e.itemSize > 4 ? r = e.array[i * e.itemSize + n] : (n === 0 ? r = e.getX(i) : n === 1 ? r = e.getY(i) : n === 2 ? r = e.getZ(i) : n === 3 && (r = e.getW(i)), e.normalized === !0 && (r = m.normalize(r, e.array))), t === C.FLOAT ? l.setFloat32(u, r, !0) : t === C.INT ? l.setInt32(u, r, !0) : t === C.UNSIGNED_INT ? l.setUint32(u, r, !0) : t === C.SHORT ? l.setInt16(u, r, !0) : t === C.UNSIGNED_SHORT ? l.setUint16(u, r, !0) : t === C.BYTE ? l.setInt8(u, r) : t === C.UNSIGNED_BYTE && l.setUint8(u, r), u += o;
333
333
  }
334
- d % c !== 0 && (d += c - d % c);
334
+ u % s !== 0 && (u += s - u % s);
335
335
  }
336
- let f = {
337
- buffer: this.processBuffer(u.buffer),
336
+ let d = {
337
+ buffer: this.processBuffer(l.buffer),
338
338
  byteOffset: this.byteOffset,
339
- byteLength: l
339
+ byteLength: c
340
340
  };
341
- return a !== void 0 && (f.target = a), a === C.ARRAY_BUFFER && (f.byteStride = c), this.byteOffset += l, o.bufferViews.push(f), {
342
- id: o.bufferViews.length - 1,
341
+ return i !== void 0 && (d.target = i), i === C.ARRAY_BUFFER && (d.byteStride = s), this.byteOffset += c, a.bufferViews.push(d), {
342
+ id: a.bufferViews.length - 1,
343
343
  byteLength: 0
344
344
  };
345
345
  }
@@ -388,28 +388,28 @@ var H = class {
388
388
  };
389
389
  return e.normalized === !0 && (u.normalized = !0), i.accessors ||= [], i.accessors.push(u) - 1;
390
390
  }
391
- processImage(t, n, r, i = "image/png") {
392
- if (t !== null) {
393
- let a = this, o = a.cache, s = a.json, c = a.options, l = a.pending;
394
- o.images.has(t) || o.images.set(t, {});
395
- let u = o.images.get(t), d = i + ":flipY/" + r.toString();
396
- if (u[d] !== void 0) return u[d];
397
- s.images ||= [];
398
- let f = { mimeType: i }, p = B();
399
- p.width = Math.min(t.width, c.maxTextureSize), p.height = Math.min(t.height, c.maxTextureSize);
400
- let m = p.getContext("2d", { willReadFrequently: !0 });
401
- if (r === !0 && (m.translate(0, p.height), m.scale(1, -1)), t.data !== void 0) {
402
- n !== 1023 && console.error("GLTFExporter: Only RGBAFormat is supported.", n), (t.width > c.maxTextureSize || t.height > c.maxTextureSize) && console.warn("GLTFExporter: Image size is bigger than maxTextureSize", t);
403
- let e = new Uint8ClampedArray(t.height * t.width * 4);
404
- for (let n = 0; n < e.length; n += 4) e[n + 0] = t.data[n + 0], e[n + 1] = t.data[n + 1], e[n + 2] = t.data[n + 2], e[n + 3] = t.data[n + 3];
405
- m.putImageData(new ImageData(e, t.width, t.height), 0, 0);
406
- } else if (typeof HTMLImageElement < "u" && t instanceof HTMLImageElement || typeof HTMLCanvasElement < "u" && t instanceof HTMLCanvasElement || typeof ImageBitmap < "u" && t instanceof ImageBitmap || typeof OffscreenCanvas < "u" && t instanceof OffscreenCanvas) m.drawImage(t, 0, 0, p.width, p.height);
391
+ processImage(e, t, n, r = "image/png") {
392
+ if (e !== null) {
393
+ let i = this, a = i.cache, o = i.json, s = i.options, c = i.pending;
394
+ a.images.has(e) || a.images.set(e, {});
395
+ let l = a.images.get(e), u = r + ":flipY/" + n.toString();
396
+ if (l[u] !== void 0) return l[u];
397
+ o.images ||= [];
398
+ let d = { mimeType: r }, f = B();
399
+ f.width = Math.min(e.width, s.maxTextureSize), f.height = Math.min(e.height, s.maxTextureSize);
400
+ let p = f.getContext("2d", { willReadFrequently: !0 });
401
+ if (n === !0 && (p.translate(0, f.height), p.scale(1, -1)), e.data !== void 0) {
402
+ t !== 1023 && console.error("GLTFExporter: Only RGBAFormat is supported.", t), (e.width > s.maxTextureSize || e.height > s.maxTextureSize) && console.warn("GLTFExporter: Image size is bigger than maxTextureSize", e);
403
+ let n = new Uint8ClampedArray(e.height * e.width * 4);
404
+ for (let t = 0; t < n.length; t += 4) n[t + 0] = e.data[t + 0], n[t + 1] = e.data[t + 1], n[t + 2] = e.data[t + 2], n[t + 3] = e.data[t + 3];
405
+ p.putImageData(new ImageData(n, e.width, e.height), 0, 0);
406
+ } else if (typeof HTMLImageElement < "u" && e instanceof HTMLImageElement || typeof HTMLCanvasElement < "u" && e instanceof HTMLCanvasElement || typeof ImageBitmap < "u" && e instanceof ImageBitmap || typeof OffscreenCanvas < "u" && e instanceof OffscreenCanvas) p.drawImage(e, 0, 0, f.width, f.height);
407
407
  else throw Error("THREE.GLTFExporter: Invalid image type. Use HTMLImageElement, HTMLCanvasElement, ImageBitmap or OffscreenCanvas.");
408
- c.binary === !0 ? l.push(V(p, i).then((e) => a.processBufferViewImage(e)).then((e) => {
409
- f.bufferView = e;
410
- })) : f.uri = e.getDataURL(p, i);
411
- let h = s.images.push(f) - 1;
412
- return u[d] = h, h;
408
+ s.binary === !0 ? c.push(V(f, r).then((e) => i.processBufferViewImage(e)).then((e) => {
409
+ d.bufferView = e;
410
+ })) : d.uri = g.getDataURL(f, r);
411
+ let m = o.images.push(d) - 1;
412
+ return l[u] = m, m;
413
413
  } else throw Error("THREE.GLTFExporter: No valid image data found. Unable to process texture.");
414
414
  }
415
415
  processSampler(e) {
@@ -424,20 +424,20 @@ var H = class {
424
424
  return t.samplers.push(n) - 1;
425
425
  }
426
426
  async processTextureAsync(e) {
427
- let t = this.options, n = this.cache, r = this.json;
428
- if (n.textures.has(e)) return n.textures.get(e);
429
- r.textures ||= [], e instanceof y && (e = await this.decompressTextureAsync(e, t.maxTextureSize));
430
- let i = e.userData.mimeType;
431
- i === "image/webp" && (i = "image/png");
432
- let a = {
427
+ let t = this.options, r = this.cache, i = this.json;
428
+ if (r.textures.has(e)) return r.textures.get(e);
429
+ i.textures ||= [], e instanceof n && (e = await this.decompressTextureAsync(e, t.maxTextureSize));
430
+ let a = e.userData.mimeType;
431
+ a === "image/webp" && (a = "image/png");
432
+ let o = {
433
433
  sampler: this.processSampler(e),
434
- source: this.processImage(e.image, e.format, e.flipY, i)
434
+ source: this.processImage(e.image, e.format, e.flipY, a)
435
435
  };
436
- e.name && (a.name = e.name), await this._invokeAllAsync(async function(t) {
437
- t.writeTexture && await t.writeTexture(e, a);
436
+ e.name && (o.name = e.name), await this._invokeAllAsync(async function(t) {
437
+ t.writeTexture && await t.writeTexture(e, o);
438
438
  });
439
- let o = r.textures.push(a) - 1;
440
- return n.textures.set(e, o), o;
439
+ let s = i.textures.push(o) - 1;
440
+ return r.textures.set(e, s), s;
441
441
  }
442
442
  async processMaterialAsync(e) {
443
443
  let t = this.cache, n = this.json;
@@ -608,60 +608,60 @@ var H = class {
608
608
  processCamera(e) {
609
609
  let t = this.json;
610
610
  t.cameras ||= [];
611
- let r = e.isOrthographicCamera, i = { type: r ? "orthographic" : "perspective" };
612
- return r ? i.orthographic = {
611
+ let n = e.isOrthographicCamera, r = { type: n ? "orthographic" : "perspective" };
612
+ return n ? r.orthographic = {
613
613
  xmag: e.right * 2,
614
614
  ymag: e.top * 2,
615
615
  zfar: e.far <= 0 ? .001 : e.far,
616
616
  znear: e.near < 0 ? 0 : e.near
617
- } : i.perspective = {
617
+ } : r.perspective = {
618
618
  aspectRatio: e.aspect,
619
- yfov: n.degToRad(e.fov),
619
+ yfov: m.degToRad(e.fov),
620
620
  zfar: e.far <= 0 ? .001 : e.far,
621
621
  znear: e.near < 0 ? 0 : e.near
622
- }, e.name !== "" && (i.name = e.type), t.cameras.push(i) - 1;
622
+ }, e.name !== "" && (r.name = e.type), t.cameras.push(r) - 1;
623
623
  }
624
624
  processAnimation(e, t) {
625
625
  let n = this.json, r = this.nodeMap;
626
626
  n.animations ||= [], e = S.Utils.mergeMorphTargetTracks(e.clone(), t);
627
- let i = e.tracks, a = [], o = [];
627
+ let i = e.tracks, o = [], s = [];
628
628
  for (let e = 0; e < i.length; ++e) {
629
- let n = i[e], s = d.parseTrackName(n.name), c = d.findNode(t, s.nodeName), l = E[s.propertyName];
630
- if (s.objectName === "bones" && (c = c.isSkinnedMesh === !0 ? c.skeleton.getBoneByName(s.objectIndex) : void 0), !c || !l) {
629
+ let n = i[e], c = a.parseTrackName(n.name), l = a.findNode(t, c.nodeName), u = E[c.propertyName];
630
+ if (c.objectName === "bones" && (l = l.isSkinnedMesh === !0 ? l.skeleton.getBoneByName(c.objectIndex) : void 0), !l || !u) {
631
631
  console.warn("THREE.GLTFExporter: Could not export animation track \"%s\".", n.name);
632
632
  continue;
633
633
  }
634
- let u = n.values.length / n.times.length;
635
- l === E.morphTargetInfluences && (u /= c.morphTargetInfluences.length);
636
- let p;
637
- n.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline === !0 ? (p = "CUBICSPLINE", u /= 3) : p = n.getInterpolation() === 2300 ? "STEP" : "LINEAR", o.push({
638
- input: this.processAccessor(new f(n.times, 1)),
639
- output: this.processAccessor(new f(n.values, u)),
640
- interpolation: p
641
- }), a.push({
642
- sampler: o.length - 1,
634
+ let d = n.values.length / n.times.length;
635
+ u === E.morphTargetInfluences && (d /= l.morphTargetInfluences.length);
636
+ let f;
637
+ n.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline === !0 ? (f = "CUBICSPLINE", d /= 3) : f = n.getInterpolation() === 2300 ? "STEP" : "LINEAR", s.push({
638
+ input: this.processAccessor(new p(n.times, 1)),
639
+ output: this.processAccessor(new p(n.values, d)),
640
+ interpolation: f
641
+ }), o.push({
642
+ sampler: s.length - 1,
643
643
  target: {
644
- node: r.get(c),
645
- path: l
644
+ node: r.get(l),
645
+ path: u
646
646
  }
647
647
  });
648
648
  }
649
- let s = {
649
+ let c = {
650
650
  name: e.name || "clip_" + n.animations.length,
651
- samplers: o,
652
- channels: a
651
+ samplers: s,
652
+ channels: o
653
653
  };
654
- return this.serializeUserData(e, s), n.animations.push(s), n.animations.length - 1;
654
+ return this.serializeUserData(e, c), n.animations.push(c), n.animations.length - 1;
655
655
  }
656
656
  processSkin(e) {
657
657
  let t = this.json, n = this.nodeMap, r = t.nodes[n.get(e)], i = e.skeleton;
658
658
  if (i === void 0) return null;
659
659
  let a = e.skeleton.bones[0];
660
660
  if (a === void 0) return null;
661
- let o = [], c = new Float32Array(i.bones.length * 16), l = new s();
662
- for (let t = 0; t < i.bones.length; ++t) o.push(n.get(i.bones[t])), l.copy(i.boneInverses[t]), l.multiply(e.bindMatrix).toArray(c, t * 16);
661
+ let o = [], s = new Float32Array(i.bones.length * 16), c = new f();
662
+ 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);
663
663
  return t.skins === void 0 && (t.skins = []), t.skins.push({
664
- inverseBindMatrices: this.processAccessor(new f(c, 16)),
664
+ inverseBindMatrices: this.processAccessor(new p(s, 16)),
665
665
  joints: o,
666
666
  skeleton: n.get(a)
667
667
  }), r.skin = t.skins.length - 1;
@@ -776,7 +776,7 @@ var H = class {
776
776
  i.length > 0 && (r.nodes = i), this.serializeUserData(e, r);
777
777
  }
778
778
  async processObjectsAsync(e) {
779
- let t = new m();
779
+ let t = new o();
780
780
  t.name = "AuxScene";
781
781
  for (let n = 0; n < e.length; n++) t.children.push(e[n]);
782
782
  await this.processSceneAsync(t);
@@ -787,7 +787,7 @@ var H = class {
787
787
  t.beforeParse && t.beforeParse(e);
788
788
  });
789
789
  let n = [];
790
- for (let t = 0; t < e.length; t++) e[t] instanceof m ? await this.processSceneAsync(e[t]) : n.push(e[t]);
790
+ for (let t = 0; t < e.length; t++) e[t] instanceof o ? await this.processSceneAsync(e[t]) : n.push(e[t]);
791
791
  n.length > 0 && await this.processObjectsAsync(n);
792
792
  for (let e = 0; e < this.skins.length; ++e) this.processSkin(this.skins[e]);
793
793
  for (let n = 0; n < t.animations.length; ++n) this.processAnimation(t.animations[n], e[0]);
@@ -1015,14 +1015,14 @@ var H = class {
1015
1015
  }
1016
1016
  writeNode(e, t) {
1017
1017
  if (!e.isInstancedMesh) return;
1018
- let n = this.writer, r = e, i = new Float32Array(r.count * 3), a = new Float32Array(r.count * 4), o = new Float32Array(r.count * 3), l = new s(), u = new c(), d = new h(), p = new c();
1019
- for (let e = 0; e < r.count; e++) r.getMatrixAt(e, l), l.decompose(u, d, p), u.toArray(i, e * 3), d.toArray(a, e * 4), p.toArray(o, e * 3);
1018
+ let n = this.writer, i = e, a = new Float32Array(i.count * 3), o = new Float32Array(i.count * 4), s = new Float32Array(i.count * 3), c = new f(), l = new v(), u = new r(), d = new v();
1019
+ for (let e = 0; e < i.count; e++) i.getMatrixAt(e, c), c.decompose(l, u, d), l.toArray(a, e * 3), u.toArray(o, e * 4), d.toArray(s, e * 3);
1020
1020
  let m = {
1021
- TRANSLATION: n.processAccessor(new f(i, 3)),
1022
- ROTATION: n.processAccessor(new f(a, 4)),
1023
- SCALE: n.processAccessor(new f(o, 3))
1021
+ TRANSLATION: n.processAccessor(new p(a, 3)),
1022
+ ROTATION: n.processAccessor(new p(o, 4)),
1023
+ SCALE: n.processAccessor(new p(s, 3))
1024
1024
  };
1025
- r.instanceColor && (m._COLOR_0 = n.processAccessor(r.instanceColor)), t.extensions = t.extensions || {}, t.extensions[this.name] = { attributes: m }, n.extensionsUsed[this.name] = !0, n.extensionsRequired[this.name] = !0;
1025
+ i.instanceColor && (m._COLOR_0 = n.processAccessor(i.instanceColor)), t.extensions = t.extensions || {}, t.extensions[this.name] = { attributes: m }, n.extensionsUsed[this.name] = !0, n.extensionsRequired[this.name] = !0;
1026
1026
  }
1027
1027
  };
1028
1028
  S.Utils = {
@@ -1047,40 +1047,40 @@ S.Utils = {
1047
1047
  }
1048
1048
  return e.times = i, e.values = a, s;
1049
1049
  },
1050
- mergeMorphTargetTracks: function(e, t) {
1051
- let n = [], r = {}, i = e.tracks;
1052
- for (let e = 0; e < i.length; ++e) {
1053
- let a = i[e], o = d.parseTrackName(a.name), s = d.findNode(t, o.nodeName);
1054
- if (o.propertyName !== "morphTargetInfluences" || o.propertyIndex === void 0) {
1055
- n.push(a);
1050
+ mergeMorphTargetTracks: function(t, n) {
1051
+ let r = [], i = {}, o = t.tracks;
1052
+ for (let t = 0; t < o.length; ++t) {
1053
+ let s = o[t], c = a.parseTrackName(s.name), l = a.findNode(n, c.nodeName);
1054
+ if (c.propertyName !== "morphTargetInfluences" || c.propertyIndex === void 0) {
1055
+ r.push(s);
1056
1056
  continue;
1057
1057
  }
1058
- if (a.createInterpolant !== a.InterpolantFactoryMethodDiscrete && a.createInterpolant !== a.InterpolantFactoryMethodLinear) {
1059
- if (a.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline) throw Error("THREE.GLTFExporter: Cannot merge tracks with glTF CUBICSPLINE interpolation.");
1060
- console.warn("THREE.GLTFExporter: Morph target interpolation mode not yet supported. Using LINEAR instead."), a = a.clone(), a.setInterpolation(v);
1058
+ if (s.createInterpolant !== s.InterpolantFactoryMethodDiscrete && s.createInterpolant !== s.InterpolantFactoryMethodLinear) {
1059
+ if (s.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline) throw Error("THREE.GLTFExporter: Cannot merge tracks with glTF CUBICSPLINE interpolation.");
1060
+ console.warn("THREE.GLTFExporter: Morph target interpolation mode not yet supported. Using LINEAR instead."), s = s.clone(), s.setInterpolation(e);
1061
1061
  }
1062
- let c = s.morphTargetInfluences.length, l = s.morphTargetDictionary[o.propertyIndex];
1063
- if (l === void 0) throw Error("THREE.GLTFExporter: Morph target name not found: " + o.propertyIndex);
1064
- let u;
1065
- if (r[s.uuid] === void 0) {
1066
- u = a.clone();
1067
- let e = new u.ValueBufferType(c * u.times.length);
1068
- for (let t = 0; t < u.times.length; t++) e[t * c + l] = u.values[t];
1069
- u.name = (o.nodeName || "") + ".morphTargetInfluences", u.values = e, r[s.uuid] = u, n.push(u);
1062
+ let u = l.morphTargetInfluences.length, d = l.morphTargetDictionary[c.propertyIndex];
1063
+ if (d === void 0) throw Error("THREE.GLTFExporter: Morph target name not found: " + c.propertyIndex);
1064
+ let f;
1065
+ if (i[l.uuid] === void 0) {
1066
+ f = s.clone();
1067
+ let e = new f.ValueBufferType(u * f.times.length);
1068
+ for (let t = 0; t < f.times.length; t++) e[t * u + d] = f.values[t];
1069
+ f.name = (c.nodeName || "") + ".morphTargetInfluences", f.values = e, i[l.uuid] = f, r.push(f);
1070
1070
  continue;
1071
1071
  }
1072
- let f = a.createInterpolant(new a.ValueBufferType(1));
1073
- u = r[s.uuid];
1074
- for (let e = 0; e < u.times.length; e++) u.values[e * c + l] = f.evaluate(u.times[e]);
1075
- for (let e = 0; e < a.times.length; e++) {
1076
- let t = this.insertKeyframe(u, a.times[e]);
1077
- u.values[t * c + l] = a.values[e];
1072
+ let p = s.createInterpolant(new s.ValueBufferType(1));
1073
+ f = i[l.uuid];
1074
+ for (let e = 0; e < f.times.length; e++) f.values[e * u + d] = p.evaluate(f.times[e]);
1075
+ for (let e = 0; e < s.times.length; e++) {
1076
+ let t = this.insertKeyframe(f, s.times[e]);
1077
+ f.values[t * u + d] = s.values[e];
1078
1078
  }
1079
1079
  }
1080
- return e.tracks = n, e;
1080
+ return t.tracks = r, t;
1081
1081
  },
1082
1082
  toTypedBufferAttribute: function(e, t) {
1083
- let n = new f(new t(e.count * e.itemSize), e.itemSize, !1);
1083
+ let n = new p(new t(e.count * e.itemSize), e.itemSize, !1);
1084
1084
  if (!e.normalized && !e.isInterleavedBufferAttribute) return n.array.set(e.array), n;
1085
1085
  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));
1086
1086
  return n;
@@ -1089,4 +1089,4 @@ S.Utils = {
1089
1089
  //#endregion
1090
1090
  export { S as GLTFExporter };
1091
1091
 
1092
- //# sourceMappingURL=GLTFExporter-D8qsdwDK.mjs.map
1092
+ //# sourceMappingURL=GLTFExporter-AfQIvZAD.mjs.map