@spiffcommerce/preview 5.6.0 → 5.7.0-alpha.0
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/dist/index.d.mts +17 -3
- package/dist/{index.mjs → index.esm.js} +158 -158
- package/dist/index.umd.js +1 -1
- package/package.json +17 -19
- package/dist/index.d.ts +0 -1170
|
@@ -40,31 +40,31 @@ import "@babylonjs/core/Animations/animatable";
|
|
|
40
40
|
import "@babylonjs/core/Misc/screenshotTools";
|
|
41
41
|
import "@babylonjs/core/Rendering/boundingBoxRenderer";
|
|
42
42
|
import "@babylonjs/loaders/glTF/2.0/Extensions";
|
|
43
|
-
var I = /* @__PURE__ */ ((
|
|
43
|
+
var I = /* @__PURE__ */ ((s) => (s[s.Orbit = 0] = "Orbit", s[s.Pan = 1] = "Pan", s))(I || {}), F = /* @__PURE__ */ ((s) => (s.None = "None", s.RemoveWhenSelected = "RemoveWhenSelected", s.ApplyWhenSelected = "ApplyWhenSelected", s))(F || {});
|
|
44
44
|
const he = /* @__PURE__ */ new Map();
|
|
45
|
-
async function D(
|
|
46
|
-
const i = he.get(
|
|
45
|
+
async function D(s, e, t) {
|
|
46
|
+
const i = he.get(s);
|
|
47
47
|
if (i)
|
|
48
48
|
return i;
|
|
49
49
|
{
|
|
50
50
|
const r = S.LoadAssetContainerAsync(
|
|
51
|
-
|
|
51
|
+
s,
|
|
52
52
|
void 0,
|
|
53
53
|
e,
|
|
54
54
|
t
|
|
55
55
|
);
|
|
56
|
-
return he.set(
|
|
56
|
+
return he.set(s, r), r;
|
|
57
57
|
}
|
|
58
58
|
}
|
|
59
|
-
S.OnPluginActivatedObservable.add((
|
|
60
|
-
|
|
59
|
+
S.OnPluginActivatedObservable.add((s) => {
|
|
60
|
+
s.name === "gltf" && (s.animationStartMode = Re.NONE);
|
|
61
61
|
});
|
|
62
62
|
class ce {
|
|
63
63
|
constructor(e) {
|
|
64
64
|
this.getSceneClearColor = () => {
|
|
65
|
-
var i, r,
|
|
65
|
+
var i, r, n, o;
|
|
66
66
|
const t = (i = this.customOptions) != null && i.transparentBackground || (r = this.customOptions) != null && r.backgroundImage ? 0 : 1;
|
|
67
|
-
if (this.customOptions && ((
|
|
67
|
+
if (this.customOptions && ((n = this.customOptions) != null && n.transparentBackground) || (o = this.customOptions) != null && o.backgroundImage)
|
|
68
68
|
return new b(0, 0, 0, t).toLinearSpace();
|
|
69
69
|
if (this.customOptions && this.customOptions.backgroundColor) {
|
|
70
70
|
const a = w.FromHexString(
|
|
@@ -99,14 +99,14 @@ class ce {
|
|
|
99
99
|
* Configuration related to the scene
|
|
100
100
|
*/
|
|
101
101
|
get scene() {
|
|
102
|
-
var e, t, i, r,
|
|
102
|
+
var e, t, i, r, n;
|
|
103
103
|
return {
|
|
104
104
|
clearColor: this.getSceneClearColor(),
|
|
105
105
|
transparentBackground: ((e = this.customOptions) == null ? void 0 : e.transparentBackground) || ((t = this.customOptions) == null ? void 0 : t.backgroundImage),
|
|
106
106
|
environment: {
|
|
107
107
|
file: ((i = this.customOptions) == null ? void 0 : i.environmentFile) ?? "assets/model-viewer/default.env",
|
|
108
108
|
intensity: ((r = this.customOptions) == null ? void 0 : r.environmentIntensity) ?? 1,
|
|
109
|
-
rotationY: (((
|
|
109
|
+
rotationY: (((n = this.customOptions) == null ? void 0 : n.environmentRotationY) ?? 0) * (Math.PI / 180)
|
|
110
110
|
// Convert to radians
|
|
111
111
|
}
|
|
112
112
|
};
|
|
@@ -115,7 +115,7 @@ class ce {
|
|
|
115
115
|
* Configuration related to the camera used to view and interact with the scene.
|
|
116
116
|
*/
|
|
117
117
|
get camera() {
|
|
118
|
-
var e, t, i, r,
|
|
118
|
+
var e, t, i, r, n, o, a, l, c, h, u, m, g;
|
|
119
119
|
return {
|
|
120
120
|
autoOrientation: ((e = this.customOptions) == null ? void 0 : e.disableAutomaticOrientation) ?? !0,
|
|
121
121
|
autoRotation: {
|
|
@@ -124,7 +124,7 @@ class ce {
|
|
|
124
124
|
},
|
|
125
125
|
limits: {
|
|
126
126
|
min: {
|
|
127
|
-
alpha: (r = this.customOptions) != null && r.lowerAlphaLimitDeg ? ((
|
|
127
|
+
alpha: (r = this.customOptions) != null && r.lowerAlphaLimitDeg ? ((n = this.customOptions) == null ? void 0 : n.lowerAlphaLimitDeg) * Math.PI / 180 : void 0,
|
|
128
128
|
beta: (o = this.customOptions) != null && o.lowerBetaLimitDeg ? ((a = this.customOptions) == null ? void 0 : a.lowerBetaLimitDeg) * Math.PI / 180 : void 0,
|
|
129
129
|
radius: (l = this.customOptions) == null ? void 0 : l.minZoomOverride
|
|
130
130
|
},
|
|
@@ -273,9 +273,9 @@ class Ge {
|
|
|
273
273
|
e,
|
|
274
274
|
t,
|
|
275
275
|
function(r) {
|
|
276
|
-
t.extras && Object.keys(t.extras).forEach((
|
|
277
|
-
const o = t.extras[
|
|
278
|
-
r.metadata[
|
|
276
|
+
t.extras && Object.keys(t.extras).forEach((n) => {
|
|
277
|
+
const o = t.extras[n];
|
|
278
|
+
r.metadata[n] = o;
|
|
279
279
|
}), i(r);
|
|
280
280
|
}
|
|
281
281
|
);
|
|
@@ -334,16 +334,16 @@ class Ge {
|
|
|
334
334
|
* @param scene The scene to parse.
|
|
335
335
|
*/
|
|
336
336
|
applyReflections(e) {
|
|
337
|
-
function t(
|
|
337
|
+
function t(n) {
|
|
338
338
|
const o = [];
|
|
339
|
-
return
|
|
339
|
+
return n.transformNodes.forEach((a) => {
|
|
340
340
|
a.metadata && a.metadata.reflective && o.push(...a.getChildMeshes());
|
|
341
|
-
}),
|
|
341
|
+
}), n.meshes.forEach((a) => {
|
|
342
342
|
a.metadata && a.metadata.reflective && !o.includes(a) && o.push(a);
|
|
343
343
|
}), o;
|
|
344
344
|
}
|
|
345
|
-
function i(
|
|
346
|
-
const a =
|
|
345
|
+
function i(n, o = 1) {
|
|
346
|
+
const a = n.material;
|
|
347
347
|
if (!a)
|
|
348
348
|
return;
|
|
349
349
|
const l = new Ee(
|
|
@@ -353,32 +353,32 @@ class Ge {
|
|
|
353
353
|
!0
|
|
354
354
|
);
|
|
355
355
|
l.renderList = t(e);
|
|
356
|
-
const c =
|
|
356
|
+
const c = n.getVerticesData("normal");
|
|
357
357
|
if (!c)
|
|
358
358
|
throw new Error(
|
|
359
|
-
"Mirror attribute specified on: " +
|
|
359
|
+
"Mirror attribute specified on: " + n.name + "But no normals exist to generate a mirror from!"
|
|
360
360
|
);
|
|
361
|
-
|
|
362
|
-
const h =
|
|
361
|
+
n.computeWorldMatrix(!0);
|
|
362
|
+
const h = n.getWorldMatrix(), u = ae.TransformNormal(
|
|
363
363
|
new ae(c[0], c[1], c[2]),
|
|
364
364
|
h
|
|
365
365
|
).normalize(), m = Oe.FromPositionAndNormal(
|
|
366
|
-
|
|
366
|
+
n.position,
|
|
367
367
|
u.scale(-1)
|
|
368
368
|
);
|
|
369
369
|
l.mirrorPlane = m, l.level = o, a.reflectionTexture = l;
|
|
370
370
|
}
|
|
371
|
-
function r(
|
|
372
|
-
const o =
|
|
371
|
+
function r(n) {
|
|
372
|
+
const o = n.material, a = new Le(
|
|
373
373
|
"probe-" + o.name,
|
|
374
374
|
Ne,
|
|
375
375
|
e
|
|
376
376
|
);
|
|
377
|
-
a.attachToMesh(
|
|
377
|
+
a.attachToMesh(n), a.renderList && a.renderList.push(...t(e)), o.reflectionTexture = a.cubeTexture;
|
|
378
378
|
}
|
|
379
|
-
e.meshes.forEach((
|
|
380
|
-
const o =
|
|
381
|
-
o && (o.mirrorTexture && i(
|
|
379
|
+
e.meshes.forEach((n) => {
|
|
380
|
+
const o = n.metadata;
|
|
381
|
+
o && (o.mirrorTexture && i(n, o.mirrorTexture), o.reflectionProbe && r(n));
|
|
382
382
|
});
|
|
383
383
|
}
|
|
384
384
|
}
|
|
@@ -404,10 +404,10 @@ class _e {
|
|
|
404
404
|
}
|
|
405
405
|
}
|
|
406
406
|
}
|
|
407
|
-
function He(
|
|
408
|
-
t.forEach((
|
|
409
|
-
const o =
|
|
410
|
-
|
|
407
|
+
function He(s, e, t, i, r = "") {
|
|
408
|
+
t.forEach((n) => {
|
|
409
|
+
const o = n.getID(), a = n.getName(), l = A.getDynamicTextureResolution();
|
|
410
|
+
s.filter((h) => h.name === r + a).forEach((h) => {
|
|
411
411
|
const u = i.get(o), m = !1;
|
|
412
412
|
if (u)
|
|
413
413
|
de(h, u), u.update(m);
|
|
@@ -418,7 +418,7 @@ function He(n, e, t, i, r = "") {
|
|
|
418
418
|
l.width,
|
|
419
419
|
l.height
|
|
420
420
|
);
|
|
421
|
-
i.set(o, g),
|
|
421
|
+
i.set(o, g), n.setStaticContext(
|
|
422
422
|
g.getContext()
|
|
423
423
|
), de(h, g), g.onLoadObservable.addOnce(() => {
|
|
424
424
|
g.update(m);
|
|
@@ -427,45 +427,45 @@ function He(n, e, t, i, r = "") {
|
|
|
427
427
|
});
|
|
428
428
|
});
|
|
429
429
|
}
|
|
430
|
-
function Ke(
|
|
430
|
+
function Ke(s, e, t, i) {
|
|
431
431
|
const r = new Be(
|
|
432
|
-
|
|
432
|
+
s,
|
|
433
433
|
{ width: t, height: i },
|
|
434
434
|
e,
|
|
435
435
|
A.shouldMipMap(),
|
|
436
436
|
De.TRILINEAR_SAMPLINGMODE,
|
|
437
437
|
be.TEXTUREFORMAT_RGBA
|
|
438
|
-
),
|
|
439
|
-
return
|
|
438
|
+
), n = r.getContext();
|
|
439
|
+
return n && (n.fillStyle = "#f5f5f5", n.fillRect(0, 0, t, i), r.update()), r;
|
|
440
440
|
}
|
|
441
|
-
function de(
|
|
442
|
-
if (
|
|
443
|
-
const t =
|
|
441
|
+
function de(s, e) {
|
|
442
|
+
if (s instanceof B) {
|
|
443
|
+
const t = s, i = t.albedoTexture;
|
|
444
444
|
i ? (e.wrapU = i.wrapU, e.wrapV = i.wrapV) : (e.wrapU = 1, e.wrapV = 1), t.albedoTexture = e;
|
|
445
445
|
} else {
|
|
446
|
-
const t =
|
|
446
|
+
const t = s, i = t.diffuseTexture;
|
|
447
447
|
i && (e.wrapU = i.wrapU, e.wrapV = i.wrapV), t.diffuseTexture = e;
|
|
448
448
|
}
|
|
449
449
|
}
|
|
450
450
|
function Ue() {
|
|
451
|
-
const
|
|
452
|
-
return
|
|
451
|
+
const s = () => Math.floor((1 + Math.random()) * 65536).toString(16).substring(1);
|
|
452
|
+
return s() + s() + "-" + s() + "-" + s() + "-" + s() + "-" + s() + s() + s();
|
|
453
453
|
}
|
|
454
454
|
const M = 60, ue = 1;
|
|
455
|
-
function me(
|
|
456
|
-
return
|
|
455
|
+
function me(s) {
|
|
456
|
+
return s.targetedAnimations.map((t) => t.animation.framePerSecond).reduce((t, i) => t + i, 0) / s.targetedAnimations.length || 0;
|
|
457
457
|
}
|
|
458
|
-
function ve(
|
|
459
|
-
const o = r ?
|
|
458
|
+
function ve(s, e, t, i, r, n) {
|
|
459
|
+
const o = r ? s.filter((h) => h.name === r) : s;
|
|
460
460
|
if (o.length === 0) {
|
|
461
461
|
console.warn(`No animations found for name: ${r}`);
|
|
462
462
|
return;
|
|
463
463
|
}
|
|
464
464
|
let a = 0;
|
|
465
465
|
const l = () => {
|
|
466
|
-
a++, a === o.length &&
|
|
466
|
+
a++, a === o.length && n && n();
|
|
467
467
|
}, c = (h, u, m, g, f) => {
|
|
468
|
-
h.stop(), h.start(u, m, g, f),
|
|
468
|
+
h.stop(), h.start(u, m, g, f), n && (u == !1 || u === void 0 && !h.loopAnimation ? h.onAnimationGroupEndObservable.addOnce(() => {
|
|
469
469
|
l();
|
|
470
470
|
}) : h.onAnimationLoopObservable.addOnce(() => {
|
|
471
471
|
l();
|
|
@@ -483,10 +483,10 @@ function ve(n, e, t, i, r, s) {
|
|
|
483
483
|
c(h, e, ue, m, g);
|
|
484
484
|
});
|
|
485
485
|
}
|
|
486
|
-
function We(
|
|
486
|
+
function We(s, e, t) {
|
|
487
487
|
return new Promise((i) => {
|
|
488
|
-
|
|
489
|
-
const r = [],
|
|
488
|
+
s.stopAnimation(e), e.animations = [], Math.abs(e.alpha) > 2 * Math.PI && (e.alpha = Ye(e.alpha, 0, 2 * Math.PI));
|
|
489
|
+
const r = [], n = t.target, o = 0, a = n ? 1 : 0;
|
|
490
490
|
if (t.target && Object.keys(t.target).length > 0 && r.push(
|
|
491
491
|
x(
|
|
492
492
|
"cameraTargetLerp",
|
|
@@ -533,10 +533,10 @@ function We(n, e, t) {
|
|
|
533
533
|
}
|
|
534
534
|
e.animations.push(...r);
|
|
535
535
|
const c = e.useAutoRotationBehavior;
|
|
536
|
-
e.disableAutoRotationBehavior(),
|
|
536
|
+
e.disableAutoRotationBehavior(), s.beginAnimation(
|
|
537
537
|
e,
|
|
538
538
|
0,
|
|
539
|
-
|
|
539
|
+
n ? M * 2 : M,
|
|
540
540
|
!1,
|
|
541
541
|
1,
|
|
542
542
|
() => {
|
|
@@ -545,29 +545,29 @@ function We(n, e, t) {
|
|
|
545
545
|
);
|
|
546
546
|
});
|
|
547
547
|
}
|
|
548
|
-
function ge(
|
|
549
|
-
return
|
|
548
|
+
function ge(s) {
|
|
549
|
+
return s * Math.PI / 180;
|
|
550
550
|
}
|
|
551
|
-
function x(
|
|
551
|
+
function x(s, e, t, i, r, n = 0, o = v.ANIMATIONLOOPMODE_CONSTANT) {
|
|
552
552
|
const a = new ke();
|
|
553
553
|
a.setEasingMode(ze.EASINGMODE_EASEINOUT);
|
|
554
554
|
const l = new v(
|
|
555
|
-
|
|
555
|
+
s,
|
|
556
556
|
e,
|
|
557
557
|
M,
|
|
558
558
|
r,
|
|
559
559
|
o
|
|
560
560
|
), c = [];
|
|
561
|
-
return
|
|
562
|
-
frame: M * (
|
|
561
|
+
return n > 0 && c.push({ frame: 0, value: t }), c.push({ frame: M * n, value: t }), c.push({
|
|
562
|
+
frame: M * (n + 1),
|
|
563
563
|
value: i
|
|
564
564
|
}), l.setKeys(c), l.setEasingFunction(a), l;
|
|
565
565
|
}
|
|
566
|
-
function Ye(
|
|
567
|
-
return
|
|
566
|
+
function Ye(s, e, t) {
|
|
567
|
+
return s < e ? s = t - (e - s) % (t - e) : s = e + (s - e) % (t - e);
|
|
568
568
|
}
|
|
569
|
-
function Qe(
|
|
570
|
-
|
|
569
|
+
function Qe(s, e, t) {
|
|
570
|
+
s.forEach((i) => {
|
|
571
571
|
t && i.name !== t || i.goToFrame(e);
|
|
572
572
|
});
|
|
573
573
|
}
|
|
@@ -581,7 +581,7 @@ const Ze = {
|
|
|
581
581
|
refractionTexture: "refractionMap",
|
|
582
582
|
reflectionTexture: "reflectionMap"
|
|
583
583
|
};
|
|
584
|
-
function $e(
|
|
584
|
+
function $e(s, e, t, i) {
|
|
585
585
|
[
|
|
586
586
|
"albedoTexture",
|
|
587
587
|
"bumpTexture",
|
|
@@ -591,49 +591,49 @@ function $e(n, e, t, i) {
|
|
|
591
591
|
"metallicTexture",
|
|
592
592
|
"refractionTexture",
|
|
593
593
|
"reflectionTexture"
|
|
594
|
-
].forEach((
|
|
594
|
+
].forEach((n) => {
|
|
595
595
|
je(
|
|
596
|
-
s,
|
|
597
596
|
n,
|
|
597
|
+
s,
|
|
598
598
|
e,
|
|
599
599
|
t,
|
|
600
600
|
i
|
|
601
601
|
);
|
|
602
|
-
}), et(
|
|
602
|
+
}), et(s, e);
|
|
603
603
|
}
|
|
604
|
-
function je(
|
|
605
|
-
const
|
|
606
|
-
if (!
|
|
604
|
+
function je(s, e, t, i, r) {
|
|
605
|
+
const n = Ze[s];
|
|
606
|
+
if (!n)
|
|
607
607
|
throw new Error("Unexpected texture name encountered.");
|
|
608
|
-
const o = e[
|
|
609
|
-
a ?
|
|
610
|
-
|
|
608
|
+
const o = e[n], a = o == null ? void 0 : o.fileLink;
|
|
609
|
+
a ? s === "reflectionTexture" ? a.endsWith(".env") || a.endsWith(".dds") ? i.addCubeTextureTask(
|
|
610
|
+
s,
|
|
611
611
|
a,
|
|
612
612
|
void 0,
|
|
613
613
|
!1,
|
|
614
614
|
void 0,
|
|
615
615
|
!0
|
|
616
616
|
) : a.endsWith(".hdr") ? i.addHDRCubeTextureTask(
|
|
617
|
-
|
|
617
|
+
s,
|
|
618
618
|
a,
|
|
619
619
|
128,
|
|
620
620
|
!1,
|
|
621
621
|
!0,
|
|
622
622
|
!1
|
|
623
|
-
) : i.addTextureTask(
|
|
623
|
+
) : i.addTextureTask(s, a, !1, !1) : i.addTextureTask(s, a, !1, !1) : r && t[s] && (t[s] && t[s].dispose(), t[s] = null, Xe(s, t));
|
|
624
624
|
}
|
|
625
|
-
function Xe(
|
|
626
|
-
|
|
625
|
+
function Xe(s, e) {
|
|
626
|
+
s === "opacityTexture" && (e.useAlphaFromAlbedoTexture = !0), s === "metallicTexture" && (e.useRoughnessFromMetallicTextureAlpha = !1, e.useRoughnessFromMetallicTextureGreen = !1, e.useMetallnessFromMetallicTextureBlue = !1), s === "refractionTexture" && (e.subSurface.isRefractionEnabled = !1, e.subSurface.refractionIntensity = 1), s === "reflectionTexture" && (e.environmentIntensity = 1), s === "emissiveTexture" && (e.emissiveIntensity = 0, e.emissiveColor = new w(0, 0, 0), e.reflectionTexture);
|
|
627
627
|
}
|
|
628
|
-
function Je(
|
|
628
|
+
function Je(s, e, t, i) {
|
|
629
629
|
if (!e) {
|
|
630
630
|
console.error("Failed to apply texture to material: material is null.");
|
|
631
631
|
return;
|
|
632
632
|
}
|
|
633
|
-
|
|
633
|
+
s === "opacityTexture" && (e.useAlphaFromAlbedoTexture = !1), s === "metallicTexture" && (e.useRoughnessFromMetallicTextureAlpha = !1, e.useRoughnessFromMetallicTextureGreen = !0, e.useMetallnessFromMetallicTextureBlue = !0), s === "refractionTexture" && (e.subSurface.isRefractionEnabled = !0, e.subSurface.refractionIntensity = t.refractionIntensity || 1), s === "reflectionTexture" && (e.environmentIntensity = t.reflectionIntensity || 1, i.isCube && (i.rotationY = t.reflectionRotation ? t.reflectionRotation * Math.PI / 180 : 0)), e[s] = i, s === "emissiveTexture" && (e.emissiveColor = new w(1, 1, 1), e.emissiveIntensity = 1);
|
|
634
634
|
}
|
|
635
|
-
function et(
|
|
636
|
-
|
|
635
|
+
function et(s, e) {
|
|
636
|
+
s.clearCoat && (s.clearCoat === F.RemoveWhenSelected ? (e.clearCoat.isEnabled = !1, e.clearCoat.indexOfRefraction = 1.5) : s.clearCoat === F.ApplyWhenSelected && (e.clearCoat.isEnabled = !0, e.clearCoat.indexOfRefraction = s.clearCoatIOR || e.clearCoat.indexOfRefraction));
|
|
637
637
|
}
|
|
638
638
|
class tt {
|
|
639
639
|
constructor(e, t, i) {
|
|
@@ -649,7 +649,7 @@ class tt {
|
|
|
649
649
|
* where we want to undo changes are remove effects from display.
|
|
650
650
|
*/
|
|
651
651
|
async applyMaterial(e, t, i, r) {
|
|
652
|
-
return new Promise((
|
|
652
|
+
return new Promise((n) => {
|
|
653
653
|
const o = this.materialVariantMap.get(e);
|
|
654
654
|
this.materialVariantMap.set(e, {
|
|
655
655
|
...o,
|
|
@@ -659,7 +659,7 @@ class tt {
|
|
|
659
659
|
(h) => h.name === a
|
|
660
660
|
);
|
|
661
661
|
if (l.length === 0) {
|
|
662
|
-
|
|
662
|
+
n();
|
|
663
663
|
return;
|
|
664
664
|
}
|
|
665
665
|
const c = new Ve(this.scene);
|
|
@@ -685,7 +685,7 @@ class tt {
|
|
|
685
685
|
m.texture
|
|
686
686
|
)
|
|
687
687
|
);
|
|
688
|
-
}),
|
|
688
|
+
}), n();
|
|
689
689
|
}, c.loadAsync();
|
|
690
690
|
});
|
|
691
691
|
}
|
|
@@ -699,7 +699,7 @@ class tt {
|
|
|
699
699
|
* @param getCurrentFrame A function that returns the current frame of the animation.
|
|
700
700
|
* @param getAnimationIsPlaying A function that returns whether the animation is currently playing.
|
|
701
701
|
*/
|
|
702
|
-
async applyModel(e, t, i, r,
|
|
702
|
+
async applyModel(e, t, i, r, n, o, a) {
|
|
703
703
|
var u;
|
|
704
704
|
if (i && t && !this.keysThatRemovedBaseModel.includes(e) && this.keysThatRemovedBaseModel.push(e), !i)
|
|
705
705
|
return this.keysThatRemovedBaseModel.includes(e) && this.keysThatRemovedBaseModel.length === 1 && await this.setBaseModelEnabled(!0), (u = this.loadedContainerForKey.get(e)) == null || u.dispose(), this.loadedContainerForKey.delete(e), this.loadedMaterialsForKey.delete(e), this.keysThatRemovedBaseModel = this.keysThatRemovedBaseModel.filter(
|
|
@@ -709,13 +709,13 @@ class tt {
|
|
|
709
709
|
this.renameClonedAsset,
|
|
710
710
|
!0
|
|
711
711
|
);
|
|
712
|
-
if (this.loadedContainerForKey.has(e) && (this.loadedContainerForKey.get(e).dispose(), this.loadedContainerForKey.delete(e), this.loadedMaterialsForKey.delete(e)),
|
|
713
|
-
const m = o && o(), g =
|
|
712
|
+
if (this.loadedContainerForKey.has(e) && (this.loadedContainerForKey.get(e).dispose(), this.loadedContainerForKey.delete(e), this.loadedMaterialsForKey.delete(e)), n) {
|
|
713
|
+
const m = o && o(), g = n.name ? this.renameClonedAsset(n.name) : void 0;
|
|
714
714
|
if (ve(
|
|
715
715
|
c.animationGroups,
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
716
|
+
n.loop,
|
|
717
|
+
n.to,
|
|
718
|
+
n.from,
|
|
719
719
|
g
|
|
720
720
|
), m != null) {
|
|
721
721
|
const f = a && a() || !0;
|
|
@@ -752,19 +752,19 @@ class tt {
|
|
|
752
752
|
}), e;
|
|
753
753
|
}
|
|
754
754
|
}
|
|
755
|
-
function we(
|
|
755
|
+
function we(s) {
|
|
756
756
|
const e = [];
|
|
757
|
-
return
|
|
757
|
+
return s.rootNodes.forEach((t) => {
|
|
758
758
|
t.getChildMeshes().forEach((i) => {
|
|
759
759
|
i.material && !e.includes(i.material) && e.push(i.material), i.subMeshes && i.subMeshes.forEach((r) => {
|
|
760
|
-
const
|
|
761
|
-
|
|
760
|
+
const n = r.getMaterial(!1);
|
|
761
|
+
n && !e.includes(n) && e.push(n);
|
|
762
762
|
});
|
|
763
763
|
});
|
|
764
764
|
}), e;
|
|
765
765
|
}
|
|
766
|
-
function pe(
|
|
767
|
-
return
|
|
766
|
+
function pe(s, e = "") {
|
|
767
|
+
return s.map((t) => ({
|
|
768
768
|
name: t.name.substring(e.length),
|
|
769
769
|
loop: t.loopAnimation,
|
|
770
770
|
to: t.to,
|
|
@@ -778,7 +778,7 @@ class it {
|
|
|
778
778
|
enablePicking: t,
|
|
779
779
|
modelDetails: i,
|
|
780
780
|
previewService: r,
|
|
781
|
-
progressHandler:
|
|
781
|
+
progressHandler: n,
|
|
782
782
|
scene: o
|
|
783
783
|
} = e;
|
|
784
784
|
this.enablePicking = t, this.contextService = i.contextService, this.id = Ue(), this.previewService = r, this.scene = o, this.variantManager = new tt(
|
|
@@ -794,7 +794,7 @@ class it {
|
|
|
794
794
|
return this.assetContainer = await D(
|
|
795
795
|
i.model,
|
|
796
796
|
o,
|
|
797
|
-
|
|
797
|
+
n
|
|
798
798
|
), await this.instantiate(), this;
|
|
799
799
|
};
|
|
800
800
|
this.importPromise = a();
|
|
@@ -833,7 +833,7 @@ class it {
|
|
|
833
833
|
}
|
|
834
834
|
return;
|
|
835
835
|
}
|
|
836
|
-
const
|
|
836
|
+
const n = async () => {
|
|
837
837
|
await this.variantManager.applyMaterial(
|
|
838
838
|
e,
|
|
839
839
|
i,
|
|
@@ -850,18 +850,18 @@ class it {
|
|
|
850
850
|
if (this.materialChangesInProgress.includes(e)) {
|
|
851
851
|
if (this.queuedMaterialChanges.has(e)) {
|
|
852
852
|
const o = this.queuedMaterialChanges.get(e);
|
|
853
|
-
o == null || o.set(t,
|
|
853
|
+
o == null || o.set(t, n);
|
|
854
854
|
} else {
|
|
855
855
|
this.queuedMaterialChanges.set(
|
|
856
856
|
e,
|
|
857
857
|
/* @__PURE__ */ new Map()
|
|
858
858
|
);
|
|
859
859
|
const o = this.queuedMaterialChanges.get(e);
|
|
860
|
-
o == null || o.set(t,
|
|
860
|
+
o == null || o.set(t, n);
|
|
861
861
|
}
|
|
862
862
|
return;
|
|
863
863
|
}
|
|
864
|
-
if (this.materialChangesInProgress.push(e), await
|
|
864
|
+
if (this.materialChangesInProgress.push(e), await n(), this.queuedMaterialChanges.has(e)) {
|
|
865
865
|
const o = this.queuedMaterialChanges.get(e);
|
|
866
866
|
if (!o)
|
|
867
867
|
throw new Error("Target material is undefined");
|
|
@@ -933,12 +933,12 @@ class it {
|
|
|
933
933
|
const i = async () => {
|
|
934
934
|
this.lastPlayedAnimation = e, this.isExecutingAnimation = !0, await new Promise((r) => {
|
|
935
935
|
var o;
|
|
936
|
-
const
|
|
936
|
+
const n = [
|
|
937
937
|
...((o = this.modelInstance) == null ? void 0 : o.animationGroups) || [],
|
|
938
938
|
...this.variantManager.getAnimationGroups()
|
|
939
939
|
];
|
|
940
940
|
ve(
|
|
941
|
-
|
|
941
|
+
n,
|
|
942
942
|
e.loop,
|
|
943
943
|
e.to,
|
|
944
944
|
e.from,
|
|
@@ -1066,7 +1066,7 @@ class it {
|
|
|
1066
1066
|
this.materials.some(e) || this.variantManager.getAllMaterials().some(e) ? this.previewService.getGlowLayerManager().includeMeshes(this.getAllMeshes()) : this.previewService.getGlowLayerManager().removeMeshes(this.getAllMeshes());
|
|
1067
1067
|
}
|
|
1068
1068
|
configureModelInstance(e) {
|
|
1069
|
-
var
|
|
1069
|
+
var n;
|
|
1070
1070
|
if (!this.transformRoot)
|
|
1071
1071
|
throw new Error(
|
|
1072
1072
|
"Transform disposed! This should never happen unless there is a race condition present!"
|
|
@@ -1078,7 +1078,7 @@ class it {
|
|
|
1078
1078
|
for (const a of o.getChildMeshes(!1))
|
|
1079
1079
|
a.alwaysSelectAsActiveMesh = !0;
|
|
1080
1080
|
}
|
|
1081
|
-
this.transformRoot.position = t, this.transformRoot.rotationQuaternion = i, this.transformRoot.scaling = r, this.canvasPanels = ((
|
|
1081
|
+
this.transformRoot.position = t, this.transformRoot.rotationQuaternion = i, this.transformRoot.scaling = r, this.canvasPanels = ((n = this.contextService) == null ? void 0 : n.getAll()) || /* @__PURE__ */ new Map(), He(
|
|
1082
1082
|
this.materials.concat(this.variantManager.getAllMaterials()),
|
|
1083
1083
|
this.scene,
|
|
1084
1084
|
this.canvasPanels,
|
|
@@ -1182,13 +1182,13 @@ class it {
|
|
|
1182
1182
|
//#endregion
|
|
1183
1183
|
}
|
|
1184
1184
|
class k extends fe {
|
|
1185
|
-
constructor(e, t, i, r,
|
|
1185
|
+
constructor(e, t, i, r, n, o, a, l) {
|
|
1186
1186
|
super(
|
|
1187
1187
|
e,
|
|
1188
1188
|
t,
|
|
1189
1189
|
i,
|
|
1190
1190
|
r,
|
|
1191
|
-
|
|
1191
|
+
n,
|
|
1192
1192
|
o,
|
|
1193
1193
|
l
|
|
1194
1194
|
), this.lastFocus = new p(0, 0, 0), this._isRunningFramingBehavior = !1, this.panDenominator = 1, this.panEnabled = !0, this.minZ = 0.01, this.updateRadiusBounds(this.radius), this.enableFramingBehavior(), this.wheelDeltaPercentage = 0.01, this.pinchDeltaPercentage = 5e-3, this.useNaturalPinchZoom = !0, a.camera.autoOrientation && (this.alpha += Math.PI), a && (a.camera.limits.min.beta && (this.lowerBetaLimit = a.camera.limits.min.beta), a.camera.limits.max.beta && (this.upperBetaLimit = a.camera.limits.max.beta), a.camera.limits.min.alpha && (this.lowerAlphaLimit = a.camera.limits.min.alpha), a.camera.limits.max.alpha && (this.upperAlphaLimit = a.camera.limits.max.alpha), a.camera.limits.min.radius && (this.lowerRadiusLimit = a.camera.limits.min.radius), a.camera.limits.max.radius && (this.upperRadiusLimit = a.camera.limits.max.radius), a.camera.autoRotation.enabled && this.enableAutoRotationBehavior(
|
|
@@ -1246,10 +1246,10 @@ class k extends fe {
|
|
|
1246
1246
|
i.framingTime = t || 800;
|
|
1247
1247
|
const r = () => {
|
|
1248
1248
|
this.isRunningFramingBehavior = !1;
|
|
1249
|
-
},
|
|
1249
|
+
}, n = T(this._scene), o = n.max.subtract(n.min), a = n.min.add(o.scale(0.5));
|
|
1250
1250
|
this.updateRadiusBounds(o.length() * 1.5), this.wheelPrecision = 100 / this.radius, this.panningInertia = 0, this.panningOriginTarget.copyFrom(a), this.panDenominator = o.length(), this.lastFocus.copyFrom(a), i.zoomOnBoundingInfo(
|
|
1251
|
-
|
|
1252
|
-
|
|
1251
|
+
n.min,
|
|
1252
|
+
n.max,
|
|
1253
1253
|
void 0,
|
|
1254
1254
|
r
|
|
1255
1255
|
), i.framingTime = 0;
|
|
@@ -1283,30 +1283,30 @@ class k extends fe {
|
|
|
1283
1283
|
*/
|
|
1284
1284
|
static create(e, t, i) {
|
|
1285
1285
|
var l;
|
|
1286
|
-
const r = T(e),
|
|
1286
|
+
const r = T(e), n = r.max.subtract(r.min), o = r.min.add(n.scale(0.5)), a = new k(
|
|
1287
1287
|
"ProductCamera",
|
|
1288
1288
|
-(Math.PI / 2),
|
|
1289
1289
|
Math.PI / 2,
|
|
1290
|
-
|
|
1290
|
+
n.length() * 1.5,
|
|
1291
1291
|
o,
|
|
1292
1292
|
e,
|
|
1293
1293
|
t
|
|
1294
1294
|
);
|
|
1295
1295
|
return a.setPanEnabled(
|
|
1296
1296
|
((l = t.options) == null ? void 0 : l.noPan) !== void 0 ? !t.options.noPan : !0
|
|
1297
|
-
), a.panningInertia = 0, a.panningOriginTarget.copyFrom(o), a.panDenominator =
|
|
1297
|
+
), a.panningInertia = 0, a.panningOriginTarget.copyFrom(o), a.panDenominator = n.length(), a.onAfterCheckInputsObservable.addOnce(() => {
|
|
1298
1298
|
a.setPanEnabled(a.panEnabled);
|
|
1299
1299
|
}), i && (e.activeCamera = a), a;
|
|
1300
1300
|
}
|
|
1301
1301
|
}
|
|
1302
|
-
function T(
|
|
1303
|
-
if (
|
|
1302
|
+
function T(s) {
|
|
1303
|
+
if (s.meshes.length === 0)
|
|
1304
1304
|
return {
|
|
1305
1305
|
min: new p(-1, -1, -1),
|
|
1306
1306
|
max: new p(1, 1, 1)
|
|
1307
1307
|
};
|
|
1308
|
-
const e =
|
|
1309
|
-
return
|
|
1308
|
+
const e = s.meshes.filter((t) => t.name.toLowerCase().endsWith("_t") || t.name.toLowerCase().includes("_t_"));
|
|
1309
|
+
return s.getWorldExtends((t) => t.isVisible && t.isEnabled() && (e.length === 0 || e.includes(t)));
|
|
1310
1310
|
}
|
|
1311
1311
|
class nt {
|
|
1312
1312
|
constructor(e, t = !1, i = void 0) {
|
|
@@ -1326,9 +1326,9 @@ class nt {
|
|
|
1326
1326
|
return this.currentConfiguration;
|
|
1327
1327
|
}
|
|
1328
1328
|
setConfiguration(e) {
|
|
1329
|
-
var t, i, r,
|
|
1329
|
+
var t, i, r, n, o, a, l, c, h, u, m, g, f, z, V, q, N, G, _, H, K, U, W, Y, Q, Z, $, j, X, J, ee, te, ie;
|
|
1330
1330
|
if (this.renderingPipeline.isSupported) {
|
|
1331
|
-
if (this.renderingPipeline.samples = ((t = e.antiAliasing) == null ? void 0 : t.samples) ?? d.antiAliasing.samples, this.renderingPipeline.fxaaEnabled = ((i = e.antiAliasing) == null ? void 0 : i.fxaaEnabled) ?? d.antiAliasing.fxaaEnabled, this.renderingPipeline.bloomEnabled = ((r = e.bloom) == null ? void 0 : r.enabled) ?? d.bloom.enabled, this.renderingPipeline.bloomKernel = ((
|
|
1331
|
+
if (this.renderingPipeline.samples = ((t = e.antiAliasing) == null ? void 0 : t.samples) ?? d.antiAliasing.samples, this.renderingPipeline.fxaaEnabled = ((i = e.antiAliasing) == null ? void 0 : i.fxaaEnabled) ?? d.antiAliasing.fxaaEnabled, this.renderingPipeline.bloomEnabled = ((r = e.bloom) == null ? void 0 : r.enabled) ?? d.bloom.enabled, this.renderingPipeline.bloomKernel = ((n = e.bloom) == null ? void 0 : n.kernel) ?? d.bloom.kernel, this.renderingPipeline.bloomScale = ((o = e.bloom) == null ? void 0 : o.scale) ?? d.bloom.scale, this.renderingPipeline.bloomThreshold = ((a = e.bloom) == null ? void 0 : a.threshold) ?? d.bloom.threshold, this.renderingPipeline.bloomWeight = ((l = e.bloom) == null ? void 0 : l.weight) ?? d.bloom.weight, this.renderingPipeline.chromaticAberrationEnabled = ((c = e.chromaticAberration) == null ? void 0 : c.enabled) ?? d.chromaticAberration.enabled, this.renderingPipeline.chromaticAberration.aberrationAmount = ((h = e.chromaticAberration) == null ? void 0 : h.aberrationAmount) ?? d.chromaticAberration.aberrationAmount, this.renderingPipeline.chromaticAberration.radialIntensity = ((u = e.chromaticAberration) == null ? void 0 : u.radialIntensity) ?? d.chromaticAberration.radialIntensity, this.renderingPipeline.chromaticAberration.direction = (m = e.chromaticAberration) != null && m.direction ? new se(
|
|
1332
1332
|
e.chromaticAberration.direction.x,
|
|
1333
1333
|
e.chromaticAberration.direction.y
|
|
1334
1334
|
) : new se(
|
|
@@ -1382,20 +1382,20 @@ class nt {
|
|
|
1382
1382
|
return t.globalDensity = e.globalDensity ?? t.globalDensity, t.globalExposure = e.globalExposure ?? t.globalExposure, t.globalHue = e.globalHue ?? t.globalHue, t.globalSaturation = e.globalSaturation ?? t.globalSaturation, t.highlightsDensity = e.highlightsDensity ?? t.highlightsDensity, t.highlightsExposure = e.highlightsExposure ?? t.highlightsExposure, t.highlightsHue = e.highlightsHue ?? t.highlightsHue, t.highlightsSaturation = e.highlightsSaturation ?? t.highlightsSaturation, t.midtonesDensity = e.midtonesDensity ?? t.midtonesDensity, t.midtonesExposure = e.midtonesExposure ?? t.midtonesExposure, t.midtonesHue = e.midtonesHue ?? t.midtonesHue, t.midtonesSaturation = e.midtonesSaturation ?? t.midtonesSaturation, t.shadowsDensity = e.shadowsDensity ?? t.shadowsDensity, t.shadowsExposure = e.shadowsExposure ?? t.shadowsExposure, t.shadowsHue = e.shadowsHue ?? t.shadowsHue, t.shadowsSaturation = e.shadowsSaturation ?? t.shadowsSaturation, t;
|
|
1383
1383
|
}
|
|
1384
1384
|
}
|
|
1385
|
-
xe.GLTFLoader.RegisterExtension("glbPostProcessor", function(
|
|
1386
|
-
return new Ge(
|
|
1385
|
+
xe.GLTFLoader.RegisterExtension("glbPostProcessor", function(s) {
|
|
1386
|
+
return new Ge(s);
|
|
1387
1387
|
});
|
|
1388
|
-
S.OnPluginActivatedObservable.add((
|
|
1389
|
-
if (
|
|
1390
|
-
const e =
|
|
1388
|
+
S.OnPluginActivatedObservable.add((s) => {
|
|
1389
|
+
if (s.name === "gltf") {
|
|
1390
|
+
const e = s;
|
|
1391
1391
|
e.transparencyAsCoverage = !0;
|
|
1392
1392
|
}
|
|
1393
1393
|
});
|
|
1394
|
-
function O(
|
|
1395
|
-
return new p(
|
|
1394
|
+
function O(s) {
|
|
1395
|
+
return new p(s.x, s.y, s.z);
|
|
1396
1396
|
}
|
|
1397
|
-
function L(
|
|
1398
|
-
return { x:
|
|
1397
|
+
function L(s) {
|
|
1398
|
+
return { x: s.x, y: s.y, z: s.z };
|
|
1399
1399
|
}
|
|
1400
1400
|
class Wt {
|
|
1401
1401
|
constructor(e) {
|
|
@@ -1420,7 +1420,7 @@ class Wt {
|
|
|
1420
1420
|
fallbackUrl: `https://www.gstatic.com/draco/versioned/decoders/${r}/draco_decoder_gltf.js`
|
|
1421
1421
|
}
|
|
1422
1422
|
}, i && (i.getContext("webgl2") || i.getContext("webgl"));
|
|
1423
|
-
const
|
|
1423
|
+
const n = console.log;
|
|
1424
1424
|
console.log = () => {
|
|
1425
1425
|
};
|
|
1426
1426
|
const o = i ? new be(i, !0, {
|
|
@@ -1432,7 +1432,7 @@ class Wt {
|
|
|
1432
1432
|
stencil: this.configuration.highlights.enabled,
|
|
1433
1433
|
forceSRGBBufferSupportState: !0
|
|
1434
1434
|
}) : new Ce();
|
|
1435
|
-
console.log =
|
|
1435
|
+
console.log = n, o.hideLoadingUI(), window.addEventListener("resize", this.fireResizeEvent.bind(this)), this.engine = o, this.scene = new Pe(o), this.camera = k.create(this.scene, this.configuration), this.scene.activeCamera = this.camera, this.renderingPipeline = new nt(
|
|
1436
1436
|
this.scene,
|
|
1437
1437
|
!1,
|
|
1438
1438
|
this.camera
|
|
@@ -1543,9 +1543,9 @@ class Wt {
|
|
|
1543
1543
|
this.isAnimatingCamera = !0, await new Promise((i) => {
|
|
1544
1544
|
this.focusLostNotified = !1;
|
|
1545
1545
|
const r = () => {
|
|
1546
|
-
const
|
|
1546
|
+
const n = this.configuration;
|
|
1547
1547
|
this.camera.rerunFramingBehavior(() => {
|
|
1548
|
-
|
|
1548
|
+
n.camera.limits.min.radius && (this.camera.lowerRadiusLimit = n.camera.limits.min.radius), n.camera.limits.max.radius && (this.camera.upperRadiusLimit = n.camera.limits.max.radius), i();
|
|
1549
1549
|
});
|
|
1550
1550
|
};
|
|
1551
1551
|
this.scene.onAfterRenderObservable.addOnce(r);
|
|
@@ -1575,8 +1575,8 @@ class Wt {
|
|
|
1575
1575
|
this.scene
|
|
1576
1576
|
);
|
|
1577
1577
|
try {
|
|
1578
|
-
const r = t.latDeg * Math.PI / 180,
|
|
1579
|
-
i.target = t.target ? new p(t.target.x, t.target.y, t.target.z) : p.Zero(), i.alpha =
|
|
1578
|
+
const r = t.latDeg * Math.PI / 180, n = t.lonDeg * Math.PI / 180;
|
|
1579
|
+
i.target = t.target ? new p(t.target.x, t.target.y, t.target.z) : p.Zero(), i.alpha = n, i.beta = r, i.radius = t.radius || this.camera.radius, i.minZ = 0.01, this.scene.render();
|
|
1580
1580
|
const o = await Ae.CreateScreenshotUsingRenderTargetAsync(
|
|
1581
1581
|
this.engine,
|
|
1582
1582
|
i,
|
|
@@ -1594,10 +1594,10 @@ class Wt {
|
|
|
1594
1594
|
const e = this.configuration;
|
|
1595
1595
|
if (!e)
|
|
1596
1596
|
return !0;
|
|
1597
|
-
const t = e.camera.limits.min.alpha, i = e.camera.limits.max.alpha, r = e.camera.limits.min.beta,
|
|
1598
|
-
if (t === void 0 || i === void 0 || r === void 0 ||
|
|
1597
|
+
const t = e.camera.limits.min.alpha, i = e.camera.limits.max.alpha, r = e.camera.limits.min.beta, n = e.camera.limits.max.beta;
|
|
1598
|
+
if (t === void 0 || i === void 0 || r === void 0 || n === void 0)
|
|
1599
1599
|
return !0;
|
|
1600
|
-
const o = [t, i], a = [r,
|
|
1600
|
+
const o = [t, i], a = [r, n], l = o.every((h) => h === t), c = a.every((h) => h === r);
|
|
1601
1601
|
return !l && !c;
|
|
1602
1602
|
}
|
|
1603
1603
|
fireResizeEvent() {
|
|
@@ -1611,9 +1611,9 @@ class Wt {
|
|
|
1611
1611
|
blurHorizontalSize: 0.85
|
|
1612
1612
|
}), this.highlightLayer.innerGlow = !0, this.highlightLayer.outerGlow = !1), this.highlightLayer.removeAllMeshes();
|
|
1613
1613
|
const i = t ? new w(t[0], t[1], t[2]).toLinearSpace() : void 0;
|
|
1614
|
-
e.forEach((
|
|
1614
|
+
e.forEach((n) => {
|
|
1615
1615
|
const o = this.scene.materials.find(
|
|
1616
|
-
(a) => a.name ===
|
|
1616
|
+
(a) => a.name === n.name && a.id === n.id
|
|
1617
1617
|
);
|
|
1618
1618
|
o && o.getBindedMeshes().forEach(
|
|
1619
1619
|
(a) => {
|
|
@@ -1630,27 +1630,27 @@ class Wt {
|
|
|
1630
1630
|
this.renderingPipeline && this.renderingPipeline.setConfiguration(e);
|
|
1631
1631
|
}
|
|
1632
1632
|
loadModel(e, t) {
|
|
1633
|
-
const i = new it({
|
|
1633
|
+
const { refocusCamera: i = !0, progressHandler: r } = t ?? {}, n = new it({
|
|
1634
1634
|
enablePicking: this.configuration.highlights.enabled,
|
|
1635
1635
|
modelDetails: e,
|
|
1636
1636
|
scene: this.scene,
|
|
1637
1637
|
previewService: this,
|
|
1638
|
-
progressHandler:
|
|
1638
|
+
progressHandler: r
|
|
1639
1639
|
});
|
|
1640
|
-
return
|
|
1641
|
-
this.modelContainers.size <= 1 && this.camera.rerunFramingBehavior(() => {
|
|
1640
|
+
return n.getInitializationPromise().then(() => {
|
|
1641
|
+
this.modelContainers.size <= 1 && i && this.camera.rerunFramingBehavior(() => {
|
|
1642
1642
|
this.scene.onAfterRenderObservable.addOnce(() => {
|
|
1643
1643
|
this.queuedCameraAnimation && (this.executeCameraAnimation(this.queuedCameraAnimation), this.queuedCameraAnimation = void 0);
|
|
1644
1644
|
});
|
|
1645
1645
|
}, 1);
|
|
1646
|
-
}), this.configuration.highlights.enabled && (
|
|
1647
|
-
this.setHighlights([
|
|
1648
|
-
}),
|
|
1646
|
+
}), this.configuration.highlights.enabled && (n.registerMaterialSelectedCallback((o) => {
|
|
1647
|
+
this.setHighlights([o]);
|
|
1648
|
+
}), n.registerMaterialDeselectedCallback(() => {
|
|
1649
1649
|
this.setHighlights([]);
|
|
1650
|
-
})), this.modelContainers.set(
|
|
1650
|
+
})), this.modelContainers.set(n.getId(), n), this.triggerModelLoadEvent({
|
|
1651
1651
|
eventType: "load",
|
|
1652
|
-
modelContainer:
|
|
1653
|
-
}),
|
|
1652
|
+
modelContainer: n
|
|
1653
|
+
}), n;
|
|
1654
1654
|
}
|
|
1655
1655
|
async preloadModel(e) {
|
|
1656
1656
|
await D(e, this.scene);
|
|
@@ -1694,7 +1694,7 @@ class Wt {
|
|
|
1694
1694
|
O(t || { x: 0, y: 0, z: 0 })
|
|
1695
1695
|
),
|
|
1696
1696
|
O(e || { x: 0, y: 0, z: 0 })
|
|
1697
|
-
),
|
|
1697
|
+
), n = re.RotationAxis(p.Up(), Math.PI), o = r.multiply(n), a = p.Zero(), l = y.Identity(), c = p.Zero();
|
|
1698
1698
|
return o.decompose(c, l, a), l.multiplyInPlace(y.FromEulerAngles(0, Math.PI, 0)), {
|
|
1699
1699
|
position: L(a),
|
|
1700
1700
|
rotation: L(l.toEulerAngles()),
|
|
@@ -1702,7 +1702,7 @@ class Wt {
|
|
|
1702
1702
|
};
|
|
1703
1703
|
}
|
|
1704
1704
|
updatePreviewOptions(e) {
|
|
1705
|
-
var r,
|
|
1705
|
+
var r, n;
|
|
1706
1706
|
const t = new ce(e);
|
|
1707
1707
|
this.configuration.highlights.enabled !== t.highlights.enabled && this.engine.setStencilBuffer(t.highlights.enabled), this.scene.clearColor = t.scene.clearColor;
|
|
1708
1708
|
let i = this.scene.environmentTexture;
|
|
@@ -1712,7 +1712,7 @@ class Wt {
|
|
|
1712
1712
|
), i.rotationY = this.configuration.scene.environment.rotationY, this.scene.environmentTexture = i), i.rotationY = t.scene.environment.rotationY, this.scene.environmentIntensity = t.scene.environment.intensity, (r = t.options) != null && r.renderingPipelineConfiguration ? this.renderingPipeline.setConfiguration(
|
|
1713
1713
|
t.options.renderingPipelineConfiguration
|
|
1714
1714
|
) : (this.scene.imageProcessingConfiguration.exposure = t.lighting.exposure, this.scene.imageProcessingConfiguration.contrast = t.lighting.contrast), this.glowLayerManager.setIntensity(t.emissiveGlowIntensity), this.camera.updateConfiguration(t), this.camera.setPanEnabled(
|
|
1715
|
-
((
|
|
1715
|
+
((n = t.options) == null ? void 0 : n.noPan) !== void 0 ? !t.options.noPan : !0
|
|
1716
1716
|
), this.scene.autoClear = !0, this.scene.autoClearDepthAndStencil = !0, this.configuration = t;
|
|
1717
1717
|
}
|
|
1718
1718
|
/**
|