@roomle/web-sdk 3.6.0 → 3.7.0-alpha.1
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.
- package/lib/{BufferGeometry-DLEagG41.mjs → BufferGeometry-BLeRuMkh.mjs} +1 -1
- package/lib/{BufferGeometry-DLEagG41.mjs.map → BufferGeometry-BLeRuMkh.mjs.map} +1 -1
- package/lib/ConfiguratorKernel.js +54 -73
- package/lib/ConfiguratorKernel.wasm +0 -0
- package/lib/{GLTFExporter-D8qsdwDK.mjs → GLTFExporter-CFXCqoLa.mjs} +141 -141
- package/lib/{GLTFExporter-D8qsdwDK.mjs.map → GLTFExporter-CFXCqoLa.mjs.map} +1 -1
- package/lib/{PointLightHelper-BnjxGaOG.mjs → PointLightHelper-BEJEy6l_.mjs} +2 -2
- package/lib/{PointLightHelper-BnjxGaOG.mjs.map → PointLightHelper-BEJEy6l_.mjs.map} +1 -1
- package/lib/RoomleCore.js +59 -79
- package/lib/RoomleCore.wasm +0 -0
- package/lib/RoomleToolsCore.js +54 -74
- package/lib/RoomleToolsCore.wasm +0 -0
- package/lib/{SpotLightHelper-DqsfqCrs.mjs → SpotLightHelper-aXFW8qaJ.mjs} +2 -2
- package/lib/{SpotLightHelper-DqsfqCrs.mjs.map → SpotLightHelper-aXFW8qaJ.mjs.map} +1 -1
- package/lib/{USDZExporter-DxIqi8St.mjs → USDZExporter-B4hsiwhd.mjs} +2 -2
- package/lib/{USDZExporter-DxIqi8St.mjs.map → USDZExporter-B4hsiwhd.mjs.map} +1 -1
- package/lib/{api-xDJ-Uyom.mjs → api-C2-6Jm5W.mjs} +2 -2
- package/lib/{api-xDJ-Uyom.mjs.map → api-C2-6Jm5W.mjs.map} +1 -1
- package/lib/{banana-for-scale-C_iNmlCT.mjs → banana-for-scale-BV_na-g3.mjs} +4 -4
- package/lib/banana-for-scale-BV_na-g3.mjs.map +1 -0
- package/lib/chunk-C97zSiVS.mjs +20 -0
- package/lib/{common-utils-DMSTohiS.mjs → common-utils-qErzZAiR.mjs} +2 -2
- package/lib/common-utils-qErzZAiR.mjs.map +1 -0
- package/lib/{component-dimensioning-CvRmUja4.mjs → component-dimensioning-DCQTqssC.mjs} +49 -49
- package/lib/{component-dimensioning-CvRmUja4.mjs.map → component-dimensioning-DCQTqssC.mjs.map} +1 -1
- package/lib/{component-raycast-helper-CEp7wy9c.mjs → component-raycast-helper-B3WXp3oq.mjs} +20 -24
- package/lib/component-raycast-helper-B3WXp3oq.mjs.map +1 -0
- package/lib/configurator-CrNkzBp9.mjs +2 -0
- package/lib/configurator-Dx6kcXY_.mjs +45 -0
- package/lib/{configurator-CmuhFgC9.mjs.map → configurator-Dx6kcXY_.mjs.map} +1 -1
- package/lib/{continuous-drawing-helper-v_5UAM9A.mjs → continuous-drawing-helper-DzULJ9d1.mjs} +12 -12
- package/lib/continuous-drawing-helper-DzULJ9d1.mjs.map +1 -0
- package/lib/{decorate-C1QnXPYw.mjs → decorate-BIflHDAa.mjs} +1 -1
- package/lib/{decorate-C1QnXPYw.mjs.map → decorate-BIflHDAa.mjs.map} +1 -1
- package/lib/{dimensioning-helper-Fwpt1HTT.mjs → dimensioning-helper-Cj20VTW0.mjs} +66 -57
- package/lib/{dimensioning-helper-Fwpt1HTT.mjs.map → dimensioning-helper-Cj20VTW0.mjs.map} +1 -1
- package/lib/{glb-viewer-BzNA9-zH.mjs → glb-viewer-BqFcaUlb.mjs} +52 -52
- package/lib/glb-viewer-BqFcaUlb.mjs.map +1 -0
- package/lib/glb-viewer-FYw7R-ya.mjs +2 -0
- package/lib/{homag-intelligence-BwGjJEws.mjs → homag-intelligence-Dkz0AhB4.mjs} +3 -3
- package/lib/{homag-intelligence-BwGjJEws.mjs.map → homag-intelligence-Dkz0AhB4.mjs.map} +1 -1
- package/lib/{imos-ix-poc-export-helper-CQh94HsO.mjs → imos-ix-poc-export-helper-BjIgAfUu.mjs} +4 -3
- package/lib/imos-ix-poc-export-helper-BjIgAfUu.mjs.map +1 -0
- package/lib/kernel-BAQSG9r5.mjs.map +1 -1
- package/lib/{kernel-utils-H74uNY1h.mjs → kernel-utils-CfGzR_WC.mjs} +15 -15
- package/lib/{kernel-utils-H74uNY1h.mjs.map → kernel-utils-CfGzR_WC.mjs.map} +1 -1
- package/lib/{layer-C_JtkhdO.mjs → layer-CFAr2mK_.mjs} +1 -1
- package/lib/{layer-C_JtkhdO.mjs.map → layer-CFAr2mK_.mjs.map} +1 -1
- package/lib/{main-CtVIB52l.mjs → main-DMIVdAcT.mjs} +14471 -14300
- package/lib/main-DMIVdAcT.mjs.map +1 -0
- package/lib/{material-viewer-Bq4smZ6f.mjs → material-viewer-BkwvhHbQ.mjs} +40 -40
- package/lib/material-viewer-BkwvhHbQ.mjs.map +1 -0
- package/lib/planner-BPlxsTRJ.mjs +44 -0
- package/lib/{planner-CVw_xzGh.mjs.map → planner-BPlxsTRJ.mjs.map} +1 -1
- package/lib/planner-oj08ktHE.mjs +2 -0
- package/lib/{plugin-system-D9K46xJk.mjs → plugin-system-XhOJU1MI.mjs} +3 -3
- package/lib/{plugin-system-D9K46xJk.mjs.map → plugin-system-XhOJU1MI.mjs.map} +1 -1
- package/lib/roomle-renderer-BwPvUqSW.mjs +49 -0
- package/lib/roomle-renderer-BwPvUqSW.mjs.map +1 -0
- package/lib/roomle-sdk.d.ts +114 -1116
- package/lib/roomle-sdk.js +6 -6
- package/lib/roomle-webgpu-renderer-CSC5zFdC.mjs +217 -0
- package/lib/roomle-webgpu-renderer-CSC5zFdC.mjs.map +1 -0
- package/lib/{scene-renderer-D8HkTFeZ.mjs → scene-renderer-DWY_zPvU.mjs} +496 -513
- package/lib/scene-renderer-DWY_zPvU.mjs.map +1 -0
- package/lib/{script-loader-D8xCRzTr.mjs → script-loader-CA-XHFKN.mjs} +3 -3
- package/lib/{script-loader-D8xCRzTr.mjs.map → script-loader-CA-XHFKN.mjs.map} +1 -1
- package/lib/static/roomle-core-hsc/node_modules/roomle-core-hsc/package.json +1 -1
- package/lib/static/roomle-core-hsc/node_modules/roomle-core-hsc/src/embind/configuratorCoreInterface.d.ts +0 -1
- package/lib/static/roomle-core-hsc/node_modules/roomle-core-hsc/src/embind/plannerCoreInterface.d.ts +3 -3
- package/lib/static/roomle-core-hsc/node_modules/roomle-core-hsc/wasm_modern/ConfiguratorKernel.js +54 -73
- package/lib/static/roomle-core-hsc/node_modules/roomle-core-hsc/wasm_modern/ConfiguratorKernel.wasm +0 -0
- package/lib/static/roomle-core-hsc/node_modules/roomle-core-hsc/wasm_modern/RoomleCore.js +59 -79
- package/lib/static/roomle-core-hsc/node_modules/roomle-core-hsc/wasm_modern/RoomleCore.wasm +0 -0
- package/lib/static/roomle-core-hsc/node_modules/roomle-core-hsc/wasm_modern/RoomleToolsCore.js +54 -74
- package/lib/static/roomle-core-hsc/node_modules/roomle-core-hsc/wasm_modern/RoomleToolsCore.wasm +0 -0
- package/lib/{stats-helper-HM0TaIM5.mjs → stats-helper-C954Cfgh.mjs} +4 -3
- package/lib/{stats-helper-HM0TaIM5.mjs.map → stats-helper-C954Cfgh.mjs.map} +1 -1
- package/lib/{three.core-CLIofecG.mjs → three.core-mM-jZdgg.mjs} +926 -926
- package/lib/{three.core-CLIofecG.mjs.map → three.core-mM-jZdgg.mjs.map} +1 -1
- package/lib/{three.module-C4Q1skJQ.mjs → three.module-Bmy3sVQ-.mjs} +1210 -1210
- package/lib/{three.module-C4Q1skJQ.mjs.map → three.module-Bmy3sVQ-.mjs.map} +1 -1
- package/lib/{three.webgpu-dFspy2yF.mjs → three.webgpu-0l2TztLa.mjs} +5355 -2935
- package/lib/{three.webgpu-dFspy2yF.mjs.map → three.webgpu-0l2TztLa.mjs.map} +1 -1
- package/lib/{threejs-utils-jEzvlJF1.mjs → threejs-utils-8zlxt158.mjs} +430 -431
- package/lib/threejs-utils-8zlxt158.mjs.map +1 -0
- package/lib/{tools-core-Bf9WsK5v.mjs → tools-core-BzhFD2Wk.mjs} +3 -3
- package/lib/{tools-core-Bf9WsK5v.mjs.map → tools-core-BzhFD2Wk.mjs.map} +1 -1
- package/package.json +1 -1
- package/lib/banana-for-scale-C_iNmlCT.mjs.map +0 -1
- package/lib/common-utils-DMSTohiS.mjs.map +0 -1
- package/lib/component-raycast-helper-CEp7wy9c.mjs.map +0 -1
- package/lib/configurator-BaUt4_LF.mjs +0 -2
- package/lib/configurator-CmuhFgC9.mjs +0 -45
- package/lib/continuous-drawing-helper-v_5UAM9A.mjs.map +0 -1
- package/lib/dimensioning-helper-DTcW85Oq.mjs +0 -2
- package/lib/glb-viewer-BzNA9-zH.mjs.map +0 -1
- package/lib/glb-viewer-DOxBD5k-.mjs +0 -2
- package/lib/imos-ix-poc-export-helper-CQh94HsO.mjs.map +0 -1
- package/lib/main-CtVIB52l.mjs.map +0 -1
- package/lib/material-viewer-Bq4smZ6f.mjs.map +0 -1
- package/lib/planner-CVw_xzGh.mjs +0 -44
- package/lib/planner-si70gWA2.mjs +0 -2
- package/lib/scene-renderer-D8HkTFeZ.mjs.map +0 -1
- package/lib/threejs-utils-jEzvlJF1.mjs.map +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
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[
|
|
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
|
|
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,
|
|
139
|
-
let
|
|
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
|
|
144
|
-
let
|
|
145
|
-
e.itemSize > 4 ?
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
284
|
-
let
|
|
285
|
-
|
|
286
|
-
let
|
|
287
|
-
|
|
288
|
-
let
|
|
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
|
-
|
|
296
|
-
let
|
|
297
|
-
for (let
|
|
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
|
-
|
|
300
|
-
|
|
301
|
-
|
|
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
|
|
312
|
-
let
|
|
313
|
-
|
|
314
|
-
let
|
|
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
|
-
|
|
318
|
+
o = 1;
|
|
319
319
|
break;
|
|
320
320
|
case C.SHORT:
|
|
321
321
|
case C.UNSIGNED_SHORT:
|
|
322
|
-
|
|
322
|
+
o = 2;
|
|
323
323
|
break;
|
|
324
|
-
default:
|
|
324
|
+
default: o = 4;
|
|
325
325
|
}
|
|
326
|
-
let
|
|
327
|
-
|
|
328
|
-
let
|
|
329
|
-
for (let
|
|
330
|
-
for (let
|
|
331
|
-
let
|
|
332
|
-
e.itemSize > 4 ?
|
|
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
|
-
|
|
334
|
+
u % s !== 0 && (u += s - u % s);
|
|
335
335
|
}
|
|
336
|
-
let
|
|
337
|
-
buffer: this.processBuffer(
|
|
336
|
+
let d = {
|
|
337
|
+
buffer: this.processBuffer(l.buffer),
|
|
338
338
|
byteOffset: this.byteOffset,
|
|
339
|
-
byteLength:
|
|
339
|
+
byteLength: c
|
|
340
340
|
};
|
|
341
|
-
return
|
|
342
|
-
id:
|
|
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
|
|
392
|
-
if (
|
|
393
|
-
let
|
|
394
|
-
|
|
395
|
-
let
|
|
396
|
-
if (u
|
|
397
|
-
|
|
398
|
-
let
|
|
399
|
-
|
|
400
|
-
let
|
|
401
|
-
if (
|
|
402
|
-
|
|
403
|
-
let
|
|
404
|
-
for (let
|
|
405
|
-
|
|
406
|
-
} else if (typeof HTMLImageElement < "u" &&
|
|
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
|
-
|
|
409
|
-
|
|
410
|
-
})) :
|
|
411
|
-
let
|
|
412
|
-
return u
|
|
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,
|
|
428
|
-
if (
|
|
429
|
-
|
|
430
|
-
let
|
|
431
|
-
|
|
432
|
-
let
|
|
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,
|
|
434
|
+
source: this.processImage(e.image, e.format, e.flipY, a)
|
|
435
435
|
};
|
|
436
|
-
e.name && (
|
|
437
|
-
t.writeTexture && await t.writeTexture(e,
|
|
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
|
|
440
|
-
return
|
|
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
|
|
612
|
-
return
|
|
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
|
-
} :
|
|
617
|
+
} : r.perspective = {
|
|
618
618
|
aspectRatio: e.aspect,
|
|
619
|
-
yfov:
|
|
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 !== "" && (
|
|
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,
|
|
627
|
+
let i = e.tracks, o = [], s = [];
|
|
628
628
|
for (let e = 0; e < i.length; ++e) {
|
|
629
|
-
let n = i[e],
|
|
630
|
-
if (
|
|
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
|
|
635
|
-
|
|
636
|
-
let
|
|
637
|
-
n.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline === !0 ? (
|
|
638
|
-
input: this.processAccessor(new
|
|
639
|
-
output: this.processAccessor(new
|
|
640
|
-
interpolation:
|
|
641
|
-
}),
|
|
642
|
-
sampler:
|
|
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(
|
|
645
|
-
path:
|
|
644
|
+
node: r.get(l),
|
|
645
|
+
path: u
|
|
646
646
|
}
|
|
647
647
|
});
|
|
648
648
|
}
|
|
649
|
-
let
|
|
649
|
+
let c = {
|
|
650
650
|
name: e.name || "clip_" + n.animations.length,
|
|
651
|
-
samplers:
|
|
652
|
-
channels:
|
|
651
|
+
samplers: s,
|
|
652
|
+
channels: o
|
|
653
653
|
};
|
|
654
|
-
return this.serializeUserData(e,
|
|
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 = [],
|
|
662
|
-
for (let t = 0; t < i.bones.length; ++t) o.push(n.get(i.bones[t])),
|
|
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
|
|
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
|
|
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
|
|
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,
|
|
1019
|
-
for (let e = 0; e <
|
|
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
|
|
1022
|
-
ROTATION: n.processAccessor(new
|
|
1023
|
-
SCALE: n.processAccessor(new
|
|
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
|
-
|
|
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(
|
|
1051
|
-
let
|
|
1052
|
-
for (let
|
|
1053
|
-
let
|
|
1054
|
-
if (
|
|
1055
|
-
|
|
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 (
|
|
1059
|
-
if (
|
|
1060
|
-
console.warn("THREE.GLTFExporter: Morph target interpolation mode not yet supported. Using LINEAR instead."),
|
|
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
|
|
1063
|
-
if (
|
|
1064
|
-
let
|
|
1065
|
-
if (
|
|
1066
|
-
|
|
1067
|
-
let e = new
|
|
1068
|
-
for (let t = 0; t <
|
|
1069
|
-
|
|
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
|
|
1073
|
-
|
|
1074
|
-
for (let e = 0; e <
|
|
1075
|
-
for (let e = 0; e <
|
|
1076
|
-
let t = this.insertKeyframe(
|
|
1077
|
-
|
|
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
|
|
1080
|
+
return t.tracks = r, t;
|
|
1081
1081
|
},
|
|
1082
1082
|
toTypedBufferAttribute: function(e, t) {
|
|
1083
|
-
let n = new
|
|
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-
|
|
1092
|
+
//# sourceMappingURL=GLTFExporter-CFXCqoLa.mjs.map
|