@roomle/web-sdk 5.1.0-alpha.4 → 5.1.0-alpha.5
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-Bl5whHAB.mjs → BufferGeometry-CxlpBjLq.mjs} +192 -195
- package/lib/BufferGeometry-CxlpBjLq.mjs.map +1 -0
- package/lib/ConfiguratorKernel.wasm +0 -0
- package/lib/{GLTFExporter-yQ7mMauu.mjs → GLTFExporter-DeNw0qAI.mjs} +86 -80
- package/lib/GLTFExporter-DeNw0qAI.mjs.map +1 -0
- package/lib/GaussianBlurNode-BR1cKBsX.mjs +65 -0
- package/lib/GaussianBlurNode-BR1cKBsX.mjs.map +1 -0
- package/lib/{Object3D-BHdngbxB.mjs → Object3D-CALIQdg1.mjs} +142 -59
- package/lib/Object3D-CALIQdg1.mjs.map +1 -0
- package/lib/{Pass-DLiMLT5k.mjs → Pass-DCljS3Z-.mjs} +4 -4
- package/lib/{Pass-DLiMLT5k.mjs.map → Pass-DCljS3Z-.mjs.map} +1 -1
- package/lib/{PointLightHelper-CuPSBuDU.mjs → PointLightHelper-C_0CYp7R.mjs} +35 -32
- package/lib/PointLightHelper-C_0CYp7R.mjs.map +1 -0
- package/lib/RoomleCore.wasm +0 -0
- package/lib/RoomleToolsCore.wasm +0 -0
- package/lib/{SpotLightHelper-m-Rh8vGU.mjs → SpotLightHelper-UUIHn43T.mjs} +22 -19
- package/lib/SpotLightHelper-UUIHn43T.mjs.map +1 -0
- package/lib/{USDZExporter-MdkuT226.mjs → USDZExporter-BBNw7Hey.mjs} +6 -3
- package/lib/USDZExporter-BBNw7Hey.mjs.map +1 -0
- package/lib/{Vector4-C7TlIAyy.mjs → Vector4-BOcWTZJI.mjs} +2 -2
- package/lib/Vector4-BOcWTZJI.mjs.map +1 -0
- package/lib/{api-Bznmr-xZ.mjs → api-CwEjmjrn.mjs} +2 -2
- package/lib/{api-Bznmr-xZ.mjs.map → api-CwEjmjrn.mjs.map} +1 -1
- package/lib/{banana-for-scale-DpKXNBt_.mjs → banana-for-scale-Cf41yXTl.mjs} +3 -3
- package/lib/{banana-for-scale-DpKXNBt_.mjs.map → banana-for-scale-Cf41yXTl.mjs.map} +1 -1
- package/lib/{common-utils-DbL4tku0.mjs → common-utils-OTJQGohe.mjs} +3 -3
- package/lib/common-utils-OTJQGohe.mjs.map +1 -0
- package/lib/{component-dimensioning-BaUqwqYJ.mjs → component-dimensioning-yPK46Y5o.mjs} +26 -26
- package/lib/{component-dimensioning-BaUqwqYJ.mjs.map → component-dimensioning-yPK46Y5o.mjs.map} +1 -1
- package/lib/{component-raycast-helper-4i8b4E5B.mjs → component-raycast-helper-CnpnRaFg.mjs} +15 -15
- package/lib/{component-raycast-helper-4i8b4E5B.mjs.map → component-raycast-helper-CnpnRaFg.mjs.map} +1 -1
- package/lib/{configurator-CDw_c6tB.mjs → configurator-iYlO_buA.mjs} +4 -4
- package/lib/{configurator-CDw_c6tB.mjs.map → configurator-iYlO_buA.mjs.map} +1 -1
- package/lib/configurator-y7zIaUe_.mjs +2 -0
- package/lib/{continuous-drawing-helper-DqHIR_qF.mjs → continuous-drawing-helper-CTfGRTfH.mjs} +3 -3
- package/lib/{continuous-drawing-helper-DqHIR_qF.mjs.map → continuous-drawing-helper-CTfGRTfH.mjs.map} +1 -1
- package/lib/dimensioning-helper-CQlesi-m.mjs +2 -0
- package/lib/{dimensioning-helper-CGPjS2hW.mjs → dimensioning-helper-DSlkLDmx.mjs} +42 -36
- package/lib/dimensioning-helper-DSlkLDmx.mjs.map +1 -0
- package/lib/{glb-viewer-B-Zr743e.mjs → glb-viewer-AGV-_xKd.mjs} +33 -33
- package/lib/{glb-viewer-B-Zr743e.mjs.map → glb-viewer-AGV-_xKd.mjs.map} +1 -1
- package/lib/glb-viewer-DSzNR4CI.mjs +2 -0
- package/lib/{highlight-coordinator-4gkjde82.mjs → highlight-coordinator-DU6oFunq.mjs} +6 -6
- package/lib/{highlight-coordinator-4gkjde82.mjs.map → highlight-coordinator-DU6oFunq.mjs.map} +1 -1
- package/lib/{homag-intelligence-D7S7r-Gc.mjs → homag-intelligence-D_yBv0ig.mjs} +3 -3
- package/lib/{homag-intelligence-D7S7r-Gc.mjs.map → homag-intelligence-D_yBv0ig.mjs.map} +1 -1
- package/lib/{hosek-wilkie-sky-iMar2iw-.mjs → hosek-wilkie-sky-DmTvnxMA.mjs} +33 -33
- package/lib/{hosek-wilkie-sky-iMar2iw-.mjs.map → hosek-wilkie-sky-DmTvnxMA.mjs.map} +1 -1
- package/lib/{imos-ix-poc-export-helper-CyGqK7nu.mjs → imos-ix-poc-export-helper-BGN97m8W.mjs} +3 -3
- package/lib/{imos-ix-poc-export-helper-CyGqK7nu.mjs.map → imos-ix-poc-export-helper-BGN97m8W.mjs.map} +1 -1
- package/lib/{kernel-utils-BvatnA7U.mjs → kernel-utils-BYKmP0mf.mjs} +13 -13
- package/lib/{kernel-utils-BvatnA7U.mjs.map → kernel-utils-BYKmP0mf.mjs.map} +1 -1
- package/lib/{material-viewer-CTsSfTfL.mjs → material-viewer-BuBSXGw6.mjs} +18 -18
- package/lib/{material-viewer-CTsSfTfL.mjs.map → material-viewer-BuBSXGw6.mjs.map} +1 -1
- package/lib/{packages-BXAZEcKa.mjs → packages-CduZDHYG.mjs} +5 -5
- package/lib/{packages-BXAZEcKa.mjs.map → packages-CduZDHYG.mjs.map} +1 -1
- package/lib/planner-B-SWR4R8.mjs +2 -0
- package/lib/{planner-jvLAnYww.mjs → planner-BuBkFbra.mjs} +3 -3
- package/lib/{planner-jvLAnYww.mjs.map → planner-BuBkFbra.mjs.map} +1 -1
- package/lib/{plugin-system-CRaC04G5.mjs → plugin-system-CPf99Zkf.mjs} +2 -2
- package/lib/{plugin-system-CRaC04G5.mjs.map → plugin-system-CPf99Zkf.mjs.map} +1 -1
- package/lib/{render-cache-DCPIQbO1.mjs → render-cache-CPppt7Rd.mjs} +5 -5
- package/lib/{render-cache-DCPIQbO1.mjs.map → render-cache-CPppt7Rd.mjs.map} +1 -1
- package/lib/{render-order-BPF2wDMw.mjs → render-order-a0QAbB7Q.mjs} +2 -2
- package/lib/{render-order-BPF2wDMw.mjs.map → render-order-a0QAbB7Q.mjs.map} +1 -1
- package/lib/roomle-headless.d.ts +0 -2
- package/lib/roomle-headless.js +14 -14
- package/lib/{roomle-renderer-Ato6RMrd.mjs → roomle-renderer-UJINLYxS.mjs} +2 -2
- package/lib/{roomle-renderer-Ato6RMrd.mjs.map → roomle-renderer-UJINLYxS.mjs.map} +1 -1
- package/lib/{roomle-sdk-CBwhwX_e.mjs → roomle-sdk-CcNdTp_n.mjs} +1844 -1889
- package/lib/roomle-sdk-CcNdTp_n.mjs.map +1 -0
- package/lib/roomle-sdk.d.ts +0 -2
- package/lib/roomle-sdk.js +7 -7
- package/lib/{roomle-webgpu-renderer-BfZKcXSz.mjs → roomle-webgpu-renderer-BSvxbopA.mjs} +900 -707
- package/lib/roomle-webgpu-renderer-BSvxbopA.mjs.map +1 -0
- package/lib/{scene-renderer-BHYZac3H.mjs → scene-renderer--DzrpIl_.mjs} +309 -309
- package/lib/{scene-renderer-BHYZac3H.mjs.map → scene-renderer--DzrpIl_.mjs.map} +1 -1
- package/lib/{script-loader-CvnG6LgL.mjs → script-loader-D6i0wQ_j.mjs} +2 -2
- package/lib/{script-loader-CvnG6LgL.mjs.map → script-loader-D6i0wQ_j.mjs.map} +1 -1
- package/lib/{shading-settings-BBhR7KcS.mjs → shading-settings-6v-7O_Sz.mjs} +49 -49
- package/lib/{shading-settings-BBhR7KcS.mjs.map → shading-settings-6v-7O_Sz.mjs.map} +1 -1
- package/lib/src-6KtBPZXp.mjs +2 -0
- package/lib/{src-HhklrVDg.mjs → src-Dg0wYIom.mjs} +150 -150
- package/lib/{src-HhklrVDg.mjs.map → src-Dg0wYIom.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/wasm_modern/ConfiguratorKernel.wasm +0 -0
- 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.wasm +0 -0
- package/lib/{stats-helper-PndcZCzL.mjs → stats-helper-DYjPPDnz.mjs} +2 -2
- package/lib/{stats-helper-PndcZCzL.mjs.map → stats-helper-DYjPPDnz.mjs.map} +1 -1
- package/lib/{three.core-0KaTx8dm.mjs → three.core-BTUCraWz.mjs} +976 -884
- package/lib/three.core-BTUCraWz.mjs.map +1 -0
- package/lib/{three.module-dym6j3lO.mjs → three.module-DUSFrLM6.mjs} +1789 -1739
- package/lib/three.module-DUSFrLM6.mjs.map +1 -0
- package/lib/three.tsl-De6A-G56.mjs +158 -0
- package/lib/three.tsl-De6A-G56.mjs.map +1 -0
- package/lib/three.tsl-DtfvggFX.mjs +2 -0
- package/lib/three.webgpu-B1OhMci_.mjs +3 -0
- package/lib/{three.webgpu-D3nSEIjD.mjs → three.webgpu-wPiwbpFM.mjs} +5806 -4926
- package/lib/three.webgpu-wPiwbpFM.mjs.map +1 -0
- package/lib/{threejs-utils-v1uOvccg.mjs → threejs-utils-lVSsgAiQ.mjs} +68 -68
- package/lib/{threejs-utils-v1uOvccg.mjs.map → threejs-utils-lVSsgAiQ.mjs.map} +1 -1
- package/lib/{tools-core-B29U-88K.mjs → tools-core-CRGER_KC.mjs} +3 -3
- package/lib/{tools-core-B29U-88K.mjs.map → tools-core-CRGER_KC.mjs.map} +1 -1
- package/lib/{webgpu-BHAP6BLI.mjs → webgpu-BxYJfBjz.mjs} +555 -555
- package/lib/{webgpu-BHAP6BLI.mjs.map → webgpu-BxYJfBjz.mjs.map} +1 -1
- package/package.json +5 -5
- package/lib/BufferGeometry-Bl5whHAB.mjs.map +0 -1
- package/lib/GLTFExporter-yQ7mMauu.mjs.map +0 -1
- package/lib/GaussianBlurNode-DNBEf5-n.mjs +0 -59
- package/lib/GaussianBlurNode-DNBEf5-n.mjs.map +0 -1
- package/lib/Object3D-BHdngbxB.mjs.map +0 -1
- package/lib/PointLightHelper-CuPSBuDU.mjs.map +0 -1
- package/lib/SpotLightHelper-m-Rh8vGU.mjs.map +0 -1
- package/lib/USDZExporter-MdkuT226.mjs.map +0 -1
- package/lib/Vector4-C7TlIAyy.mjs.map +0 -1
- package/lib/common-utils-DbL4tku0.mjs.map +0 -1
- package/lib/configurator-BYQdWEvf.mjs +0 -2
- package/lib/dimensioning-helper-CGPjS2hW.mjs.map +0 -1
- package/lib/dimensioning-helper-VndKlIXS.mjs +0 -2
- package/lib/glb-viewer-Bd5Xn6Oq.mjs +0 -2
- package/lib/planner-DMk3T4ts.mjs +0 -2
- package/lib/roomle-sdk-CBwhwX_e.mjs.map +0 -1
- package/lib/roomle-webgpu-renderer-BfZKcXSz.mjs.map +0 -1
- package/lib/src-Bbq3Hqzn.mjs +0 -2
- package/lib/three.core-0KaTx8dm.mjs.map +0 -1
- package/lib/three.module-dym6j3lO.mjs.map +0 -1
- package/lib/three.tsl-BTc4fg8T.mjs +0 -2
- package/lib/three.tsl-Cf0-sCqB.mjs +0 -152
- package/lib/three.tsl-Cf0-sCqB.mjs.map +0 -1
- package/lib/three.webgpu-ClICiWlK.mjs +0 -3
- package/lib/three.webgpu-D3nSEIjD.mjs.map +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
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[
|
|
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
|
|
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
|
|
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(
|
|
258
|
-
if (this.cache.attributesNormalized.has(
|
|
259
|
-
let n = new
|
|
260
|
-
for (let
|
|
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(
|
|
265
|
+
createNormalizedNormalAttribute(e) {
|
|
264
266
|
let n = this.cache;
|
|
265
|
-
if (n.attributesNormalized.has(
|
|
266
|
-
let r =
|
|
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(
|
|
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
|
|
287
|
-
|
|
288
|
-
let
|
|
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
|
-
|
|
291
|
-
let t = n(e), i =
|
|
292
|
-
for (let e = 2; e < i.length; e += 4)
|
|
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
|
-
|
|
296
|
-
let e = n(t), r =
|
|
297
|
-
for (let t = 1; t < r.length; t += 4)
|
|
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
|
-
|
|
300
|
-
let
|
|
301
|
-
return
|
|
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
|
|
313
|
-
return
|
|
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,
|
|
488
|
-
(
|
|
489
|
-
|
|
490
|
-
|
|
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 && (
|
|
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
|
|
635
|
-
|
|
636
|
-
let
|
|
637
|
-
for (let e = 0; e <
|
|
638
|
-
let
|
|
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\".",
|
|
646
|
+
console.warn("THREE.GLTFExporter: Could not export animation track \"%s\".", r.name);
|
|
641
647
|
continue;
|
|
642
648
|
}
|
|
643
|
-
let d =
|
|
649
|
+
let d = r.values.length / r.times.length;
|
|
644
650
|
u === E.morphTargetInfluences && (d /= l.morphTargetInfluences.length);
|
|
645
651
|
let f;
|
|
646
|
-
|
|
647
|
-
input: this.processAccessor(new
|
|
648
|
-
output: this.processAccessor(new
|
|
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:
|
|
659
|
+
node: i.get(l),
|
|
654
660
|
path: u
|
|
655
661
|
}
|
|
656
662
|
});
|
|
657
663
|
}
|
|
658
664
|
let c = {
|
|
659
|
-
name: e.name || "clip_" +
|
|
665
|
+
name: e.name || "clip_" + r.animations.length,
|
|
660
666
|
samplers: s,
|
|
661
667
|
channels: o
|
|
662
668
|
};
|
|
663
|
-
return this.serializeUserData(e, c),
|
|
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
|
|
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
|
|
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
|
|
789
|
-
|
|
790
|
-
for (let
|
|
791
|
-
await this.processSceneAsync(
|
|
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
|
|
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
|
|
799
|
-
for (let
|
|
800
|
-
|
|
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
|
|
803
|
-
else for (let
|
|
804
|
-
let r =
|
|
805
|
-
for (let
|
|
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(
|
|
1030
|
-
if (!
|
|
1031
|
-
let
|
|
1032
|
-
for (let e = 0; e <
|
|
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:
|
|
1035
|
-
ROTATION:
|
|
1036
|
-
SCALE:
|
|
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
|
-
|
|
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
|
|
1065
|
-
for (let e = 0; e <
|
|
1066
|
-
let o =
|
|
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
|
-
|
|
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(
|
|
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 (
|
|
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,
|
|
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 =
|
|
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 =
|
|
1099
|
+
return e.tracks = r, e;
|
|
1094
1100
|
},
|
|
1095
1101
|
toTypedBufferAttribute: function(e, t) {
|
|
1096
|
-
let n = new
|
|
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-
|
|
1111
|
+
//# sourceMappingURL=GLTFExporter-DeNw0qAI.mjs.map
|