@spiffcommerce/preview 5.7.9-12 → 5.7.9-3
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.esm.js +370 -348
- package/dist/index.umd.js +1 -1
- package/package.json +1 -1
package/dist/index.esm.js
CHANGED
|
@@ -1,35 +1,35 @@
|
|
|
1
1
|
import { ArcRotateCamera as fe } from "@babylonjs/core/Cameras/arcRotateCamera";
|
|
2
2
|
import { Engine as be } from "@babylonjs/core/Engines/engine";
|
|
3
3
|
import { NullEngine as Ce } from "@babylonjs/core/Engines/nullEngine";
|
|
4
|
-
import { HighlightLayer as
|
|
5
|
-
import { SceneLoader as
|
|
4
|
+
import { HighlightLayer as ye } from "@babylonjs/core/Layers/highlightLayer";
|
|
5
|
+
import { SceneLoader as S } from "@babylonjs/core/Loading/sceneLoader";
|
|
6
6
|
import { CubeTexture as ne } from "@babylonjs/core/Materials/Textures/cubeTexture";
|
|
7
|
-
import { Color4 as b, Color3 as
|
|
8
|
-
import { Vector3 as
|
|
7
|
+
import { Color4 as b, Color3 as w } from "@babylonjs/core/Maths/math.color";
|
|
8
|
+
import { Vector3 as p, Quaternion as y, Vector2 as se, Matrix as re } from "@babylonjs/core/Maths/math.vector";
|
|
9
9
|
import { DracoCompression as Ae } from "@babylonjs/core/Meshes/Compression/dracoCompression";
|
|
10
|
-
import { Observable as
|
|
10
|
+
import { Observable as C } from "@babylonjs/core/Misc/observable";
|
|
11
11
|
import { Tools as Me } from "@babylonjs/core/Misc/tools";
|
|
12
|
-
import { Scene as
|
|
12
|
+
import { Scene as xe } from "@babylonjs/core/scene";
|
|
13
13
|
import { GLTF2 as Pe } from "@babylonjs/loaders/glTF";
|
|
14
14
|
import { GLTFLoaderAnimationStartMode as Re } from "@babylonjs/loaders/glTF/glTFFileLoader";
|
|
15
|
-
import { PBRMaterial as
|
|
15
|
+
import { PBRMaterial as B } from "@babylonjs/core/Materials/PBR/pbrMaterial";
|
|
16
16
|
import { MirrorTexture as Ee } from "@babylonjs/core/Materials/Textures/mirrorTexture";
|
|
17
17
|
import { Color3 as Te, Vector3 as ae, Plane as Oe } from "@babylonjs/core/Maths/math";
|
|
18
18
|
import { ReflectionProbe as Le } from "@babylonjs/core/Probes/reflectionProbe";
|
|
19
19
|
import { GlowLayer as Ie } from "@babylonjs/core/Layers/glowLayer";
|
|
20
|
-
import { ActionManager as
|
|
20
|
+
import { ActionManager as R } from "@babylonjs/core/Actions/actionManager";
|
|
21
21
|
import { ExecuteCodeAction as oe } from "@babylonjs/core/Actions/directActions";
|
|
22
22
|
import { Mesh as Fe } from "@babylonjs/core/Meshes/mesh";
|
|
23
23
|
import { TransformNode as Se } from "@babylonjs/core/Meshes/transformNode";
|
|
24
24
|
import { DynamicTexture as Be } from "@babylonjs/core/Materials/Textures/dynamicTexture";
|
|
25
25
|
import { Texture as De } from "@babylonjs/core/Materials/Textures/texture";
|
|
26
|
-
import { Animation as
|
|
26
|
+
import { Animation as v } from "@babylonjs/core/Animations/animation";
|
|
27
27
|
import { QuadraticEase as ke, EasingFunction as ze } from "@babylonjs/core/Animations/easing";
|
|
28
28
|
import { AssetsManager as Ne } from "@babylonjs/core/Misc/assetsManager";
|
|
29
29
|
import { ColorCurves as le } from "@babylonjs/core/Materials/colorCurves";
|
|
30
|
-
import { ImageProcessingConfiguration as
|
|
30
|
+
import { ImageProcessingConfiguration as x } from "@babylonjs/core/Materials/imageProcessingConfiguration";
|
|
31
31
|
import { DefaultRenderingPipeline as qe } from "@babylonjs/core/PostProcesses/RenderPipeline";
|
|
32
|
-
import { DepthOfFieldEffectBlurLevel as
|
|
32
|
+
import { DepthOfFieldEffectBlurLevel as E } from "@babylonjs/core/PostProcesses/depthOfFieldEffect";
|
|
33
33
|
import "@babylonjs/core/Rendering/depthRendererSceneComponent";
|
|
34
34
|
import "@babylonjs/core/Engines/Extensions/engine.views";
|
|
35
35
|
import "@babylonjs/core/Meshes/instancedMesh";
|
|
@@ -40,32 +40,32 @@ 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
|
|
43
|
+
var I = /* @__PURE__ */ ((r) => (r[r.Orbit = 0] = "Orbit", r[r.Pan = 1] = "Pan", r))(I || {}), F = /* @__PURE__ */ ((r) => (r.None = "None", r.RemoveWhenSelected = "RemoveWhenSelected", r.ApplyWhenSelected = "ApplyWhenSelected", r))(F || {});
|
|
44
44
|
const he = /* @__PURE__ */ new Map();
|
|
45
|
-
async function
|
|
46
|
-
const i = await he.get(
|
|
45
|
+
async function D(r, e, t) {
|
|
46
|
+
const i = await he.get(r);
|
|
47
47
|
if (i && i.scene.uid === e.uid)
|
|
48
48
|
return i;
|
|
49
|
-
const
|
|
50
|
-
|
|
49
|
+
const n = S.LoadAssetContainerAsync(
|
|
50
|
+
r,
|
|
51
51
|
void 0,
|
|
52
52
|
e,
|
|
53
53
|
t
|
|
54
54
|
);
|
|
55
|
-
return he.set(
|
|
55
|
+
return he.set(r, n), n;
|
|
56
56
|
}
|
|
57
|
-
|
|
58
|
-
|
|
57
|
+
S.OnPluginActivatedObservable.add((r) => {
|
|
58
|
+
r.name === "gltf" && (r.animationStartMode = Re.NONE);
|
|
59
59
|
});
|
|
60
60
|
class ce {
|
|
61
61
|
constructor(e) {
|
|
62
62
|
this.getSceneClearColor = () => {
|
|
63
|
-
var i,
|
|
64
|
-
const t = (i = this.customOptions) != null && i.transparentBackground || (
|
|
65
|
-
if (this.customOptions && ((
|
|
63
|
+
var i, n, s, o;
|
|
64
|
+
const t = (i = this.customOptions) != null && i.transparentBackground || (n = this.customOptions) != null && n.backgroundImage ? 0 : 1;
|
|
65
|
+
if (this.customOptions && ((s = this.customOptions) != null && s.transparentBackground) || (o = this.customOptions) != null && o.backgroundImage)
|
|
66
66
|
return new b(0, 0, 0, t).toLinearSpace();
|
|
67
67
|
if (this.customOptions && this.customOptions.backgroundColor) {
|
|
68
|
-
const a =
|
|
68
|
+
const a = w.FromHexString(
|
|
69
69
|
this.customOptions.backgroundColor
|
|
70
70
|
);
|
|
71
71
|
return new b(
|
|
@@ -77,11 +77,11 @@ class ce {
|
|
|
77
77
|
}
|
|
78
78
|
return new b(0.98, 0.98, 0.98, t).toLinearSpace();
|
|
79
79
|
}, this.highlightColorFromConfig = () => this.customOptions && this.customOptions.highlightColor ? this.hexToColor4(this.customOptions.highlightColor) : new b(0.98, 0.98, 0.98, 1).toLinearSpace(), this.hexToColor4 = (t, i = 1) => {
|
|
80
|
-
const
|
|
80
|
+
const n = w.FromHexString(t);
|
|
81
81
|
return new b(
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
82
|
+
n.r,
|
|
83
|
+
n.g,
|
|
84
|
+
n.b,
|
|
85
85
|
i
|
|
86
86
|
).toLinearSpace();
|
|
87
87
|
}, this.customOptions = e;
|
|
@@ -97,14 +97,14 @@ class ce {
|
|
|
97
97
|
* Configuration related to the scene
|
|
98
98
|
*/
|
|
99
99
|
get scene() {
|
|
100
|
-
var e, t, i,
|
|
100
|
+
var e, t, i, n, s;
|
|
101
101
|
return {
|
|
102
102
|
clearColor: this.getSceneClearColor(),
|
|
103
103
|
transparentBackground: ((e = this.customOptions) == null ? void 0 : e.transparentBackground) || ((t = this.customOptions) == null ? void 0 : t.backgroundImage),
|
|
104
104
|
environment: {
|
|
105
105
|
file: ((i = this.customOptions) == null ? void 0 : i.environmentFile) ?? "assets/model-viewer/default.env",
|
|
106
|
-
intensity: ((
|
|
107
|
-
rotationY: (((
|
|
106
|
+
intensity: ((n = this.customOptions) == null ? void 0 : n.environmentIntensity) ?? 1,
|
|
107
|
+
rotationY: (((s = this.customOptions) == null ? void 0 : s.environmentRotationY) ?? 0) * (Math.PI / 180)
|
|
108
108
|
// Convert to radians
|
|
109
109
|
}
|
|
110
110
|
};
|
|
@@ -113,7 +113,7 @@ class ce {
|
|
|
113
113
|
* Configuration related to the camera used to view and interact with the scene.
|
|
114
114
|
*/
|
|
115
115
|
get camera() {
|
|
116
|
-
var e, t, i,
|
|
116
|
+
var e, t, i, n, s, o, a, h, l, c, m, u, g;
|
|
117
117
|
return {
|
|
118
118
|
autoOrientation: ((e = this.customOptions) == null ? void 0 : e.disableAutomaticOrientation) ?? !0,
|
|
119
119
|
autoRotation: {
|
|
@@ -122,14 +122,14 @@ class ce {
|
|
|
122
122
|
},
|
|
123
123
|
limits: {
|
|
124
124
|
min: {
|
|
125
|
-
alpha: (
|
|
125
|
+
alpha: (n = this.customOptions) != null && n.lowerAlphaLimitDeg ? ((s = this.customOptions) == null ? void 0 : s.lowerAlphaLimitDeg) * Math.PI / 180 : void 0,
|
|
126
126
|
beta: (o = this.customOptions) != null && o.lowerBetaLimitDeg ? ((a = this.customOptions) == null ? void 0 : a.lowerBetaLimitDeg) * Math.PI / 180 : void 0,
|
|
127
127
|
radius: (h = this.customOptions) == null ? void 0 : h.minZoomOverride
|
|
128
128
|
},
|
|
129
129
|
max: {
|
|
130
130
|
alpha: (l = this.customOptions) != null && l.upperAlphaLimitDeg ? ((c = this.customOptions) == null ? void 0 : c.upperAlphaLimitDeg) * Math.PI / 180 : void 0,
|
|
131
|
-
beta: (
|
|
132
|
-
radius: (
|
|
131
|
+
beta: (m = this.customOptions) != null && m.upperBetaLimitDeg ? ((u = this.customOptions) == null ? void 0 : u.upperBetaLimitDeg) * Math.PI / 180 : void 0,
|
|
132
|
+
radius: (g = this.customOptions) == null ? void 0 : g.maxZoomOverride
|
|
133
133
|
}
|
|
134
134
|
}
|
|
135
135
|
};
|
|
@@ -146,10 +146,10 @@ class ce {
|
|
|
146
146
|
};
|
|
147
147
|
}
|
|
148
148
|
get lighting() {
|
|
149
|
-
var e, t, i,
|
|
149
|
+
var e, t, i, n;
|
|
150
150
|
return {
|
|
151
151
|
exposure: ((t = (e = this.customOptions) == null ? void 0 : e.lighting) == null ? void 0 : t.exposure) ?? 0.9,
|
|
152
|
-
contrast: ((
|
|
152
|
+
contrast: ((n = (i = this.customOptions) == null ? void 0 : i.lighting) == null ? void 0 : n.contrast) ?? 1.6
|
|
153
153
|
};
|
|
154
154
|
}
|
|
155
155
|
get emissiveGlowIntensity() {
|
|
@@ -157,12 +157,12 @@ class ce {
|
|
|
157
157
|
return ((e = this.customOptions) == null ? void 0 : e.emissiveGlowIntensity) ?? 0.5;
|
|
158
158
|
}
|
|
159
159
|
}
|
|
160
|
-
class
|
|
160
|
+
class M {
|
|
161
161
|
/**
|
|
162
162
|
* Returns the resolution expected for generated textures.
|
|
163
163
|
*/
|
|
164
164
|
static getDynamicTextureResolution() {
|
|
165
|
-
return this.getIsMobile() || !
|
|
165
|
+
return this.getIsMobile() || !M.offscreenRenderingSupported() ? {
|
|
166
166
|
width: 1024,
|
|
167
167
|
height: 1024
|
|
168
168
|
} : {
|
|
@@ -270,11 +270,11 @@ class _e {
|
|
|
270
270
|
return this.loader.loadNodeAsync(
|
|
271
271
|
e,
|
|
272
272
|
t,
|
|
273
|
-
function(
|
|
274
|
-
t.extras && Object.keys(t.extras).forEach((
|
|
275
|
-
const o = t.extras[
|
|
276
|
-
|
|
277
|
-
}), i(
|
|
273
|
+
function(n) {
|
|
274
|
+
t.extras && Object.keys(t.extras).forEach((s) => {
|
|
275
|
+
const o = t.extras[s];
|
|
276
|
+
n.metadata[s] = o;
|
|
277
|
+
}), i(n);
|
|
278
278
|
}
|
|
279
279
|
);
|
|
280
280
|
}
|
|
@@ -299,7 +299,7 @@ class _e {
|
|
|
299
299
|
* @param babylonMaterial An instance of a material representation in babylon.
|
|
300
300
|
*/
|
|
301
301
|
enableMaterialExtrasIfRequired(e, t) {
|
|
302
|
-
if (!(!e.extras || !(t instanceof
|
|
302
|
+
if (!(!e.extras || !(t instanceof B))) {
|
|
303
303
|
if (e.extras.sheen) {
|
|
304
304
|
const i = t;
|
|
305
305
|
i.sheen.isEnabled = !0, i.sheen.intensity = e.extras.sheen;
|
|
@@ -332,51 +332,51 @@ class _e {
|
|
|
332
332
|
* @param scene The scene to parse.
|
|
333
333
|
*/
|
|
334
334
|
applyReflections(e) {
|
|
335
|
-
function t(
|
|
335
|
+
function t(s) {
|
|
336
336
|
const o = [];
|
|
337
|
-
return
|
|
337
|
+
return s.transformNodes.forEach((a) => {
|
|
338
338
|
a.metadata && a.metadata.reflective && o.push(...a.getChildMeshes());
|
|
339
|
-
}),
|
|
339
|
+
}), s.meshes.forEach((a) => {
|
|
340
340
|
a.metadata && a.metadata.reflective && !o.includes(a) && o.push(a);
|
|
341
341
|
}), o;
|
|
342
342
|
}
|
|
343
|
-
function i(
|
|
344
|
-
const a =
|
|
343
|
+
function i(s, o = 1) {
|
|
344
|
+
const a = s.material;
|
|
345
345
|
if (!a)
|
|
346
346
|
return;
|
|
347
347
|
const h = new Ee(
|
|
348
348
|
"mirror",
|
|
349
|
-
|
|
349
|
+
M.getMirrorTextureResolution(),
|
|
350
350
|
e,
|
|
351
351
|
!0
|
|
352
352
|
);
|
|
353
353
|
h.renderList = t(e);
|
|
354
|
-
const l =
|
|
354
|
+
const l = s.getVerticesData("normal");
|
|
355
355
|
if (!l)
|
|
356
356
|
throw new Error(
|
|
357
|
-
"Mirror attribute specified on: " +
|
|
357
|
+
"Mirror attribute specified on: " + s.name + "But no normals exist to generate a mirror from!"
|
|
358
358
|
);
|
|
359
|
-
|
|
360
|
-
const c =
|
|
359
|
+
s.computeWorldMatrix(!0);
|
|
360
|
+
const c = s.getWorldMatrix(), m = ae.TransformNormal(
|
|
361
361
|
new ae(l[0], l[1], l[2]),
|
|
362
362
|
c
|
|
363
|
-
).normalize(),
|
|
364
|
-
|
|
365
|
-
|
|
363
|
+
).normalize(), u = Oe.FromPositionAndNormal(
|
|
364
|
+
s.position,
|
|
365
|
+
m.scale(-1)
|
|
366
366
|
);
|
|
367
|
-
h.mirrorPlane =
|
|
367
|
+
h.mirrorPlane = u, h.level = o, a.reflectionTexture = h;
|
|
368
368
|
}
|
|
369
|
-
function
|
|
370
|
-
const o =
|
|
369
|
+
function n(s) {
|
|
370
|
+
const o = s.material, a = new Le(
|
|
371
371
|
"probe-" + o.name,
|
|
372
372
|
Ve,
|
|
373
373
|
e
|
|
374
374
|
);
|
|
375
|
-
a.
|
|
375
|
+
a.attachToMesh(s), a.renderList && a.renderList.push(...t(e)), o.reflectionTexture = a.cubeTexture;
|
|
376
376
|
}
|
|
377
|
-
e.meshes.forEach((
|
|
378
|
-
const o =
|
|
379
|
-
o && (o.mirrorTexture && i(
|
|
377
|
+
e.meshes.forEach((s) => {
|
|
378
|
+
const o = s.metadata;
|
|
379
|
+
o && (o.mirrorTexture && i(s, o.mirrorTexture), o.reflectionProbe && n(s));
|
|
380
380
|
});
|
|
381
381
|
}
|
|
382
382
|
}
|
|
@@ -402,68 +402,90 @@ class Ge {
|
|
|
402
402
|
}
|
|
403
403
|
}
|
|
404
404
|
}
|
|
405
|
-
function He(
|
|
406
|
-
t.forEach((
|
|
407
|
-
const o =
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
405
|
+
function He(r, e, t, i, n = "") {
|
|
406
|
+
t.forEach((s) => {
|
|
407
|
+
const o = s.getID(), a = s.getName(), h = M.getDynamicTextureResolution();
|
|
408
|
+
r.filter((c) => c.name === n + a).forEach((c) => {
|
|
409
|
+
console.log(`attaching textures to material ${c.name}`);
|
|
410
|
+
const m = i.get(o), u = !1;
|
|
411
|
+
if (m)
|
|
412
|
+
de(c, m), console.log(`applying current texture ${m.name}`), m.update(u);
|
|
412
413
|
else {
|
|
413
|
-
const
|
|
414
|
+
const g = Ke(
|
|
414
415
|
a,
|
|
415
416
|
e,
|
|
416
417
|
h.width,
|
|
417
418
|
h.height
|
|
418
419
|
);
|
|
419
|
-
i.set(o,
|
|
420
|
-
|
|
421
|
-
), de(c,
|
|
422
|
-
|
|
420
|
+
console.log(`created new texture ${g.name}`), i.set(o, g), s.setStaticContext(
|
|
421
|
+
g.getContext()
|
|
422
|
+
), de(c, g), g.onLoadObservable.addOnce(() => {
|
|
423
|
+
g.update(u);
|
|
423
424
|
});
|
|
424
425
|
}
|
|
425
426
|
});
|
|
426
|
-
});
|
|
427
|
+
}), Ue(e);
|
|
427
428
|
}
|
|
428
|
-
|
|
429
|
-
const
|
|
430
|
-
|
|
429
|
+
const Ue = (r) => {
|
|
430
|
+
const e = () => r.textures.reduce((i, n) => {
|
|
431
|
+
var o;
|
|
432
|
+
return !r.meshes.some(
|
|
433
|
+
(a) => a.material && a.material.hasTexture(n)
|
|
434
|
+
) && !((o = n == null ? void 0 : n.url) != null && o.includes("data:")) && !n.name.endsWith(".env") && i.push(n), i;
|
|
435
|
+
}, []), t = () => r.materials.reduce((i, n) => (n.getBindedMeshes().length == 0 && i.push(n), i), []);
|
|
436
|
+
e().forEach((i) => {
|
|
437
|
+
try {
|
|
438
|
+
console.log(`disposing texture ${i.name} (${i.url})`), i.dispose();
|
|
439
|
+
} catch {
|
|
440
|
+
console.log(`Failed to dispose texture ${i.name}`);
|
|
441
|
+
}
|
|
442
|
+
}), t().forEach((i) => {
|
|
443
|
+
try {
|
|
444
|
+
console.log(`disposing material ${i.name}`), i.dispose(!0, !0);
|
|
445
|
+
} catch {
|
|
446
|
+
console.log(`Failed to dispose material ${i.name}`);
|
|
447
|
+
}
|
|
448
|
+
});
|
|
449
|
+
};
|
|
450
|
+
function Ke(r, e, t, i) {
|
|
451
|
+
const n = new Be(
|
|
452
|
+
r,
|
|
431
453
|
{ width: t, height: i },
|
|
432
454
|
e,
|
|
433
|
-
|
|
455
|
+
M.shouldMipMap(),
|
|
434
456
|
De.TRILINEAR_SAMPLINGMODE,
|
|
435
457
|
be.TEXTUREFORMAT_RGBA
|
|
436
|
-
),
|
|
437
|
-
return
|
|
458
|
+
), s = n.getContext();
|
|
459
|
+
return s && (s.fillStyle = "#f5f5f5", s.fillRect(0, 0, t, i), n.update()), n;
|
|
438
460
|
}
|
|
439
|
-
function de(
|
|
440
|
-
if (
|
|
441
|
-
const t =
|
|
461
|
+
function de(r, e) {
|
|
462
|
+
if (r instanceof B) {
|
|
463
|
+
const t = r, i = t.albedoTexture;
|
|
442
464
|
i ? (e.wrapU = i.wrapU, e.wrapV = i.wrapV) : (e.wrapU = 1, e.wrapV = 1), t.albedoTexture = e;
|
|
443
465
|
} else {
|
|
444
|
-
const t =
|
|
466
|
+
const t = r, i = t.diffuseTexture;
|
|
445
467
|
i && (e.wrapU = i.wrapU, e.wrapV = i.wrapV), t.diffuseTexture = e;
|
|
446
468
|
}
|
|
447
469
|
}
|
|
448
|
-
function
|
|
449
|
-
const
|
|
450
|
-
return
|
|
470
|
+
function We() {
|
|
471
|
+
const r = () => Math.floor((1 + Math.random()) * 65536).toString(16).substring(1);
|
|
472
|
+
return r() + r() + "-" + r() + "-" + r() + "-" + r() + "-" + r() + r() + r();
|
|
451
473
|
}
|
|
452
|
-
const
|
|
453
|
-
function me(
|
|
454
|
-
return
|
|
474
|
+
const A = 60, ue = 1;
|
|
475
|
+
function me(r) {
|
|
476
|
+
return r.targetedAnimations.map((t) => t.animation.framePerSecond).reduce((t, i) => t + i, 0) / r.targetedAnimations.length || 0;
|
|
455
477
|
}
|
|
456
|
-
function ve(
|
|
457
|
-
const o =
|
|
478
|
+
function ve(r, e, t, i, n, s) {
|
|
479
|
+
const o = n ? r.filter((c) => c.name === n) : r;
|
|
458
480
|
if (o.length === 0) {
|
|
459
|
-
console.warn(`No animations found for name: ${
|
|
481
|
+
console.warn(`No animations found for name: ${n}`);
|
|
460
482
|
return;
|
|
461
483
|
}
|
|
462
484
|
let a = 0;
|
|
463
485
|
const h = () => {
|
|
464
|
-
a++, a === o.length &&
|
|
465
|
-
}, l = (c,
|
|
466
|
-
c.stop(), c.start(
|
|
486
|
+
a++, a === o.length && s && s();
|
|
487
|
+
}, l = (c, m, u, g, f) => {
|
|
488
|
+
c.stop(), c.start(m, u, g, f), s && (m == !1 || m === void 0 && !c.loopAnimation ? c.onAnimationGroupEndObservable.addOnce(() => {
|
|
467
489
|
h();
|
|
468
490
|
}) : c.onAnimationLoopObservable.addOnce(() => {
|
|
469
491
|
h();
|
|
@@ -471,70 +493,70 @@ function ve(s, e, t, i, r, n) {
|
|
|
471
493
|
};
|
|
472
494
|
if (i !== void 0 && t !== void 0 && i === t) {
|
|
473
495
|
o.forEach((c) => {
|
|
474
|
-
const
|
|
475
|
-
l(c, !1, ue,
|
|
496
|
+
const m = me(c), u = i * m;
|
|
497
|
+
l(c, !1, ue, u, u);
|
|
476
498
|
});
|
|
477
499
|
return;
|
|
478
500
|
}
|
|
479
501
|
o.forEach((c) => {
|
|
480
|
-
const
|
|
481
|
-
l(c, e, ue,
|
|
502
|
+
const m = me(c), u = i !== void 0 ? i * m : void 0, g = t !== void 0 ? t * m : void 0;
|
|
503
|
+
l(c, e, ue, u, g);
|
|
482
504
|
});
|
|
483
505
|
}
|
|
484
|
-
function
|
|
506
|
+
function $e(r, e, t) {
|
|
485
507
|
return new Promise((i) => {
|
|
486
|
-
|
|
487
|
-
const
|
|
488
|
-
if (t.target && Object.keys(t.target).length > 0 &&
|
|
489
|
-
|
|
508
|
+
r.stopAnimation(e), e.animations = [], Math.abs(e.alpha) > 2 * Math.PI && (e.alpha = Ye(e.alpha, 0, 2 * Math.PI));
|
|
509
|
+
const n = [], s = t.target, o = 0, a = s ? 1 : 0;
|
|
510
|
+
if (t.target && Object.keys(t.target).length > 0 && n.push(
|
|
511
|
+
P(
|
|
490
512
|
"cameraTargetLerp",
|
|
491
513
|
"target",
|
|
492
|
-
new
|
|
493
|
-
new
|
|
514
|
+
new p().copyFrom(e.target),
|
|
515
|
+
new p(
|
|
494
516
|
t.target.x,
|
|
495
517
|
t.target.y,
|
|
496
518
|
t.target.z
|
|
497
519
|
),
|
|
498
|
-
|
|
520
|
+
v.ANIMATIONTYPE_VECTOR3,
|
|
499
521
|
o
|
|
500
522
|
)
|
|
501
|
-
),
|
|
502
|
-
|
|
523
|
+
), n.push(
|
|
524
|
+
P(
|
|
503
525
|
"cameraAlphaLerp",
|
|
504
526
|
"alpha",
|
|
505
527
|
e.alpha,
|
|
506
528
|
ge(t.lonDeg),
|
|
507
|
-
|
|
529
|
+
v.ANIMATIONTYPE_FLOAT,
|
|
508
530
|
a
|
|
509
531
|
)
|
|
510
|
-
),
|
|
511
|
-
|
|
532
|
+
), n.push(
|
|
533
|
+
P(
|
|
512
534
|
"cameraBetaLerp",
|
|
513
535
|
"beta",
|
|
514
536
|
e.beta,
|
|
515
537
|
ge(t.latDeg),
|
|
516
|
-
|
|
538
|
+
v.ANIMATIONTYPE_FLOAT,
|
|
517
539
|
a
|
|
518
540
|
)
|
|
519
541
|
), t.radius !== void 0) {
|
|
520
542
|
const c = Math.max(0.01, t.radius);
|
|
521
|
-
|
|
522
|
-
|
|
543
|
+
n.push(
|
|
544
|
+
P(
|
|
523
545
|
"cameraRadiusLerp",
|
|
524
546
|
"radius",
|
|
525
547
|
e.radius,
|
|
526
548
|
c,
|
|
527
|
-
|
|
549
|
+
v.ANIMATIONTYPE_FLOAT,
|
|
528
550
|
a
|
|
529
551
|
)
|
|
530
552
|
);
|
|
531
553
|
}
|
|
532
|
-
e.animations.push(...
|
|
554
|
+
e.animations.push(...n);
|
|
533
555
|
const l = e.useAutoRotationBehavior;
|
|
534
|
-
e.disableAutoRotationBehavior(),
|
|
556
|
+
e.disableAutoRotationBehavior(), r.beginAnimation(
|
|
535
557
|
e,
|
|
536
558
|
0,
|
|
537
|
-
|
|
559
|
+
s ? A * 2 : A,
|
|
538
560
|
!1,
|
|
539
561
|
1,
|
|
540
562
|
() => {
|
|
@@ -543,33 +565,33 @@ function We(s, e, t) {
|
|
|
543
565
|
);
|
|
544
566
|
});
|
|
545
567
|
}
|
|
546
|
-
function ge(
|
|
547
|
-
return
|
|
568
|
+
function ge(r) {
|
|
569
|
+
return r * Math.PI / 180;
|
|
548
570
|
}
|
|
549
|
-
function
|
|
571
|
+
function P(r, e, t, i, n, s = 0, o = v.ANIMATIONLOOPMODE_CONSTANT) {
|
|
550
572
|
const a = new ke();
|
|
551
573
|
a.setEasingMode(ze.EASINGMODE_EASEINOUT);
|
|
552
|
-
const h = new
|
|
553
|
-
s,
|
|
554
|
-
e,
|
|
555
|
-
M,
|
|
574
|
+
const h = new v(
|
|
556
575
|
r,
|
|
576
|
+
e,
|
|
577
|
+
A,
|
|
578
|
+
n,
|
|
557
579
|
o
|
|
558
580
|
), l = [];
|
|
559
|
-
return
|
|
560
|
-
frame:
|
|
581
|
+
return s > 0 && l.push({ frame: 0, value: t }), l.push({ frame: A * s, value: t }), l.push({
|
|
582
|
+
frame: A * (s + 1),
|
|
561
583
|
value: i
|
|
562
584
|
}), h.setKeys(l), h.setEasingFunction(a), h;
|
|
563
585
|
}
|
|
564
|
-
function Ye(
|
|
565
|
-
return
|
|
586
|
+
function Ye(r, e, t) {
|
|
587
|
+
return r < e ? r = t - (e - r) % (t - e) : r = e + (r - e) % (t - e);
|
|
566
588
|
}
|
|
567
|
-
function Qe(
|
|
568
|
-
|
|
589
|
+
function Qe(r, e, t) {
|
|
590
|
+
r.forEach((i) => {
|
|
569
591
|
t && i.name !== t || i.goToFrame(e);
|
|
570
592
|
});
|
|
571
593
|
}
|
|
572
|
-
const
|
|
594
|
+
const Ze = {
|
|
573
595
|
albedoTexture: "albedoMap",
|
|
574
596
|
bumpTexture: "normalMap",
|
|
575
597
|
ambientTexture: "ambientMap",
|
|
@@ -579,7 +601,7 @@ const $e = {
|
|
|
579
601
|
refractionTexture: "refractionMap",
|
|
580
602
|
reflectionTexture: "reflectionMap"
|
|
581
603
|
};
|
|
582
|
-
function
|
|
604
|
+
function je(r, e, t, i) {
|
|
583
605
|
[
|
|
584
606
|
"albedoTexture",
|
|
585
607
|
"bumpTexture",
|
|
@@ -589,51 +611,51 @@ function Ze(s, e, t, i) {
|
|
|
589
611
|
"metallicTexture",
|
|
590
612
|
"refractionTexture",
|
|
591
613
|
"reflectionTexture"
|
|
592
|
-
].forEach((
|
|
593
|
-
|
|
594
|
-
n,
|
|
614
|
+
].forEach((s) => {
|
|
615
|
+
Xe(
|
|
595
616
|
s,
|
|
617
|
+
r,
|
|
596
618
|
e,
|
|
597
619
|
t,
|
|
598
620
|
i
|
|
599
621
|
);
|
|
600
|
-
}),
|
|
622
|
+
}), tt(r, e);
|
|
601
623
|
}
|
|
602
|
-
function
|
|
603
|
-
const
|
|
604
|
-
if (!
|
|
624
|
+
function Xe(r, e, t, i, n) {
|
|
625
|
+
const s = Ze[r];
|
|
626
|
+
if (!s)
|
|
605
627
|
throw new Error("Unexpected texture name encountered.");
|
|
606
|
-
const o = e[
|
|
607
|
-
a ?
|
|
608
|
-
|
|
628
|
+
const o = e[s], a = o == null ? void 0 : o.fileLink;
|
|
629
|
+
a ? r === "reflectionTexture" ? a.endsWith(".env") || a.endsWith(".dds") ? i.addCubeTextureTask(
|
|
630
|
+
r,
|
|
609
631
|
a,
|
|
610
632
|
void 0,
|
|
611
633
|
!1,
|
|
612
634
|
void 0,
|
|
613
635
|
!0
|
|
614
636
|
) : a.endsWith(".hdr") ? i.addHDRCubeTextureTask(
|
|
615
|
-
|
|
637
|
+
r,
|
|
616
638
|
a,
|
|
617
639
|
128,
|
|
618
640
|
!1,
|
|
619
641
|
!0,
|
|
620
642
|
!1
|
|
621
|
-
) : i.addTextureTask(
|
|
643
|
+
) : i.addTextureTask(r, a, !1, !1) : i.addTextureTask(r, a, !1, !1) : n && t[r] && (t[r] && t[r].dispose(), t[r] = null, Je(r, t));
|
|
622
644
|
}
|
|
623
|
-
function
|
|
624
|
-
|
|
645
|
+
function Je(r, e) {
|
|
646
|
+
r === "opacityTexture" && (e.useAlphaFromAlbedoTexture = !0), r === "metallicTexture" && (e.useRoughnessFromMetallicTextureAlpha = !1, e.useRoughnessFromMetallicTextureGreen = !1, e.useMetallnessFromMetallicTextureBlue = !1), r === "refractionTexture" && (e.subSurface.isRefractionEnabled = !1, e.subSurface.refractionIntensity = 1), r === "reflectionTexture" && (e.environmentIntensity = 1), r === "emissiveTexture" && (e.emissiveIntensity = 0, e.emissiveColor = new w(0, 0, 0), e.reflectionTexture);
|
|
625
647
|
}
|
|
626
|
-
function
|
|
648
|
+
function et(r, e, t, i) {
|
|
627
649
|
if (!e) {
|
|
628
650
|
console.error("Failed to apply texture to material: material is null.");
|
|
629
651
|
return;
|
|
630
652
|
}
|
|
631
|
-
|
|
653
|
+
r === "opacityTexture" && (e.useAlphaFromAlbedoTexture = !1), r === "metallicTexture" && (e.useRoughnessFromMetallicTextureAlpha = !1, e.useRoughnessFromMetallicTextureGreen = !0, e.useMetallnessFromMetallicTextureBlue = !0), r === "refractionTexture" && (e.subSurface.isRefractionEnabled = !0, e.subSurface.refractionIntensity = t.refractionIntensity || 1), r === "reflectionTexture" && (e.environmentIntensity = t.reflectionIntensity || 1, i.isCube && (i.rotationY = t.reflectionRotation ? t.reflectionRotation * Math.PI / 180 : 0)), e[r] = i, r === "emissiveTexture" && (e.emissiveColor = new w(1, 1, 1), e.emissiveIntensity = 1);
|
|
632
654
|
}
|
|
633
|
-
function
|
|
634
|
-
|
|
655
|
+
function tt(r, e) {
|
|
656
|
+
r.clearCoat && (r.clearCoat === F.RemoveWhenSelected ? (e.clearCoat.isEnabled = !1, e.clearCoat.indexOfRefraction = 1.5) : r.clearCoat === F.ApplyWhenSelected && (e.clearCoat.isEnabled = !0, e.clearCoat.indexOfRefraction = r.clearCoatIOR || e.clearCoat.indexOfRefraction));
|
|
635
657
|
}
|
|
636
|
-
class
|
|
658
|
+
class it {
|
|
637
659
|
constructor(e, t, i) {
|
|
638
660
|
this.materialVariantMap = /* @__PURE__ */ new Map(), this.keysThatRemovedBaseModel = [], this.loadedContainerForKey = /* @__PURE__ */ new Map(), this.loadedMaterialsForKey = /* @__PURE__ */ new Map(), this.scene = e, this.renameClonedAsset = t, this.setBaseModelEnabled = i;
|
|
639
661
|
}
|
|
@@ -646,8 +668,8 @@ class tt {
|
|
|
646
668
|
* instead remove material textures when they aren't defined. this is useful for material editor applications
|
|
647
669
|
* where we want to undo changes are remove effects from display.
|
|
648
670
|
*/
|
|
649
|
-
async applyMaterial(e, t, i,
|
|
650
|
-
return new Promise((
|
|
671
|
+
async applyMaterial(e, t, i, n) {
|
|
672
|
+
return new Promise((s) => {
|
|
651
673
|
const o = this.materialVariantMap.get(e);
|
|
652
674
|
this.materialVariantMap.set(e, {
|
|
653
675
|
...o,
|
|
@@ -657,33 +679,33 @@ class tt {
|
|
|
657
679
|
(c) => c.name === a
|
|
658
680
|
);
|
|
659
681
|
if (h.length === 0) {
|
|
660
|
-
|
|
682
|
+
s();
|
|
661
683
|
return;
|
|
662
684
|
}
|
|
663
685
|
const l = new Ne(this.scene);
|
|
664
686
|
l.useDefaultLoadingScreen = !1, h.forEach(
|
|
665
|
-
(c) =>
|
|
687
|
+
(c) => je(
|
|
666
688
|
t,
|
|
667
689
|
c,
|
|
668
690
|
l,
|
|
669
|
-
|
|
691
|
+
n
|
|
670
692
|
)
|
|
671
|
-
), l.onProgress = (c,
|
|
672
|
-
i && i(c /
|
|
693
|
+
), l.onProgress = (c, m, u) => {
|
|
694
|
+
i && i(c / m * 100, 100, u.name);
|
|
673
695
|
}, l.onFinish = (c) => {
|
|
674
|
-
c.forEach((
|
|
675
|
-
const
|
|
676
|
-
i && i(100, 100,
|
|
677
|
-
(
|
|
678
|
-
).forEach(
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
696
|
+
c.forEach((m) => {
|
|
697
|
+
const u = m;
|
|
698
|
+
i && i(100, 100, m.name), this.scene.materials.filter(
|
|
699
|
+
(f) => f.name === a
|
|
700
|
+
).forEach(
|
|
701
|
+
(f) => et(
|
|
702
|
+
m.name,
|
|
703
|
+
f,
|
|
682
704
|
t,
|
|
683
|
-
|
|
684
|
-
)
|
|
685
|
-
|
|
686
|
-
}),
|
|
705
|
+
u.texture
|
|
706
|
+
)
|
|
707
|
+
);
|
|
708
|
+
}), s();
|
|
687
709
|
}, l.loadAsync();
|
|
688
710
|
});
|
|
689
711
|
}
|
|
@@ -697,41 +719,41 @@ class tt {
|
|
|
697
719
|
* @param getCurrentFrame A function that returns the current frame of the animation.
|
|
698
720
|
* @param getAnimationIsPlaying A function that returns whether the animation is currently playing.
|
|
699
721
|
*/
|
|
700
|
-
async applyModel(e, t, i,
|
|
701
|
-
var
|
|
702
|
-
if (
|
|
703
|
-
return this.keysThatRemovedBaseModel.includes(e) && this.keysThatRemovedBaseModel.length === 1 && await this.setBaseModelEnabled(!0),
|
|
704
|
-
(
|
|
722
|
+
async applyModel(e, t, i, n, s, o, a) {
|
|
723
|
+
var m;
|
|
724
|
+
if (i && t && !this.keysThatRemovedBaseModel.includes(e) && this.keysThatRemovedBaseModel.push(e), !i)
|
|
725
|
+
return this.keysThatRemovedBaseModel.includes(e) && this.keysThatRemovedBaseModel.length === 1 && await this.setBaseModelEnabled(!0), (m = this.loadedContainerForKey.get(e)) == null || m.dispose(), this.loadedContainerForKey.delete(e), this.loadedMaterialsForKey.delete(e), this.keysThatRemovedBaseModel = this.keysThatRemovedBaseModel.filter(
|
|
726
|
+
(u) => u !== e
|
|
705
727
|
), Promise.resolve(void 0);
|
|
706
|
-
const l = (await
|
|
728
|
+
const l = (await D(i, this.scene, n)).instantiateModelsToScene(
|
|
707
729
|
this.renameClonedAsset,
|
|
708
730
|
!0
|
|
709
731
|
);
|
|
710
|
-
if (this.loadedContainerForKey.has(e) && (
|
|
711
|
-
const
|
|
732
|
+
if (this.loadedContainerForKey.has(e) && (this.loadedContainerForKey.get(e).dispose(), this.loadedContainerForKey.delete(e), this.loadedMaterialsForKey.delete(e)), s) {
|
|
733
|
+
const u = o && o(), g = s.name ? this.renameClonedAsset(s.name) : void 0;
|
|
712
734
|
if (ve(
|
|
713
735
|
l.animationGroups,
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
),
|
|
719
|
-
const
|
|
736
|
+
s.loop,
|
|
737
|
+
s.to,
|
|
738
|
+
s.from,
|
|
739
|
+
g
|
|
740
|
+
), u != null) {
|
|
741
|
+
const f = a && a() || !0;
|
|
720
742
|
Qe(
|
|
721
743
|
l.animationGroups,
|
|
722
|
-
|
|
723
|
-
|
|
744
|
+
u + (f ? 2 : 0),
|
|
745
|
+
g
|
|
724
746
|
);
|
|
725
747
|
}
|
|
726
748
|
}
|
|
727
749
|
t && await this.setBaseModelEnabled(!1), this.loadedContainerForKey.set(e, l), this.loadedMaterialsForKey.set(e, we(l));
|
|
728
750
|
const c = [];
|
|
729
|
-
return this.materialVariantMap.forEach(async (
|
|
730
|
-
c.push(this.applyMaterial(
|
|
751
|
+
return this.materialVariantMap.forEach(async (u, g) => {
|
|
752
|
+
c.push(this.applyMaterial(g, u));
|
|
731
753
|
}), await Promise.all(c), l;
|
|
732
754
|
}
|
|
733
755
|
dispose() {
|
|
734
|
-
|
|
756
|
+
this.loadedContainerForKey.forEach((e) => e == null ? void 0 : e.dispose()), this.loadedContainerForKey.clear(), this.loadedMaterialsForKey.forEach(
|
|
735
757
|
(e) => e.forEach((t) => t == null ? void 0 : t.dispose())
|
|
736
758
|
), this.loadedMaterialsForKey.clear(), this.materialVariantMap.clear(), this.keysThatRemovedBaseModel = [];
|
|
737
759
|
}
|
|
@@ -750,36 +772,36 @@ class tt {
|
|
|
750
772
|
}), e;
|
|
751
773
|
}
|
|
752
774
|
}
|
|
753
|
-
function we(
|
|
775
|
+
function we(r) {
|
|
754
776
|
const e = [];
|
|
755
|
-
return
|
|
777
|
+
return r.rootNodes.forEach((t) => {
|
|
756
778
|
t.getChildMeshes().forEach((i) => {
|
|
757
|
-
i.material && !e.includes(i.material) && e.push(i.material), i.subMeshes && i.subMeshes.forEach((
|
|
758
|
-
const
|
|
759
|
-
|
|
779
|
+
i.material && !e.includes(i.material) && e.push(i.material), i.subMeshes && i.subMeshes.forEach((n) => {
|
|
780
|
+
const s = n.getMaterial(!1);
|
|
781
|
+
s && !e.includes(s) && e.push(s);
|
|
760
782
|
});
|
|
761
783
|
});
|
|
762
784
|
}), e;
|
|
763
785
|
}
|
|
764
|
-
function pe(
|
|
765
|
-
return
|
|
786
|
+
function pe(r, e = "") {
|
|
787
|
+
return r.map((t) => ({
|
|
766
788
|
name: t.name.substring(e.length),
|
|
767
789
|
loop: t.loopAnimation,
|
|
768
790
|
to: t.to,
|
|
769
791
|
from: t.from
|
|
770
792
|
}));
|
|
771
793
|
}
|
|
772
|
-
class
|
|
794
|
+
class nt {
|
|
773
795
|
constructor(e) {
|
|
774
|
-
this.metadata = /* @__PURE__ */ new Map(), this.materialSelectedObservable = new
|
|
796
|
+
this.metadata = /* @__PURE__ */ new Map(), this.materialSelectedObservable = new C(), this.materialDeselectedObservable = new C(), this.materialVariantObservable = new C(), this.modelVariantObservable = new C(), this.materialReadyToLoadCallbacks = /* @__PURE__ */ new Map(), this.modelReadyToLoadCallbacks = /* @__PURE__ */ new Map(), this.dynamicTextures = /* @__PURE__ */ new Map(), this.queuedMaterialChanges = /* @__PURE__ */ new Map(), this.materialChangesInProgress = [], this.queuedModelChanges = /* @__PURE__ */ new Map(), this.modelChangesInProgress = [], this.isExecutingAnimation = !1, this.animations = [], this.initialized = !1, this.materials = [];
|
|
775
797
|
const {
|
|
776
798
|
enablePicking: t,
|
|
777
799
|
modelDetails: i,
|
|
778
|
-
previewService:
|
|
779
|
-
progressHandler:
|
|
800
|
+
previewService: n,
|
|
801
|
+
progressHandler: s,
|
|
780
802
|
scene: o
|
|
781
803
|
} = e;
|
|
782
|
-
this.enablePicking = t, this.contextService = i.contextService, this.id =
|
|
804
|
+
this.enablePicking = t, this.contextService = i.contextService, this.id = We(), this.previewService = n, this.scene = o, this.variantManager = new it(
|
|
783
805
|
o,
|
|
784
806
|
this.renameClonedAsset.bind(this),
|
|
785
807
|
this.setBaseModelEnabled.bind(this)
|
|
@@ -789,16 +811,16 @@ class it {
|
|
|
789
811
|
throw new Error(
|
|
790
812
|
"Model container constructed with no URL. This is currently unsupported."
|
|
791
813
|
);
|
|
792
|
-
return this.assetContainer = await
|
|
814
|
+
return this.assetContainer = await D(
|
|
793
815
|
i.model,
|
|
794
816
|
o,
|
|
795
|
-
|
|
817
|
+
s
|
|
796
818
|
), await this.instantiate(), this;
|
|
797
819
|
};
|
|
798
820
|
this.importPromise = a();
|
|
799
821
|
}
|
|
800
822
|
//#region Interface implementation
|
|
801
|
-
async applyMaterialVariant(e, t, i,
|
|
823
|
+
async applyMaterialVariant(e, t, i, n) {
|
|
802
824
|
if (!this.initialized) {
|
|
803
825
|
if (this.materialReadyToLoadCallbacks.has(e)) {
|
|
804
826
|
const o = this.materialReadyToLoadCallbacks.get(e);
|
|
@@ -809,7 +831,7 @@ class it {
|
|
|
809
831
|
e,
|
|
810
832
|
t,
|
|
811
833
|
i,
|
|
812
|
-
|
|
834
|
+
n
|
|
813
835
|
)
|
|
814
836
|
);
|
|
815
837
|
} else {
|
|
@@ -825,13 +847,13 @@ class it {
|
|
|
825
847
|
e,
|
|
826
848
|
t,
|
|
827
849
|
i,
|
|
828
|
-
|
|
850
|
+
n
|
|
829
851
|
)
|
|
830
852
|
);
|
|
831
853
|
}
|
|
832
854
|
return;
|
|
833
855
|
}
|
|
834
|
-
const
|
|
856
|
+
const s = async () => {
|
|
835
857
|
await this.variantManager.applyMaterial(
|
|
836
858
|
e,
|
|
837
859
|
i,
|
|
@@ -842,24 +864,24 @@ class it {
|
|
|
842
864
|
taskName: h
|
|
843
865
|
});
|
|
844
866
|
},
|
|
845
|
-
|
|
867
|
+
n
|
|
846
868
|
);
|
|
847
869
|
};
|
|
848
870
|
if (this.materialChangesInProgress.includes(e)) {
|
|
849
871
|
if (this.queuedMaterialChanges.has(e)) {
|
|
850
872
|
const o = this.queuedMaterialChanges.get(e);
|
|
851
|
-
o == null || o.set(t,
|
|
873
|
+
o == null || o.set(t, s);
|
|
852
874
|
} else {
|
|
853
875
|
this.queuedMaterialChanges.set(
|
|
854
876
|
e,
|
|
855
877
|
/* @__PURE__ */ new Map()
|
|
856
878
|
);
|
|
857
879
|
const o = this.queuedMaterialChanges.get(e);
|
|
858
|
-
o == null || o.set(t,
|
|
880
|
+
o == null || o.set(t, s);
|
|
859
881
|
}
|
|
860
882
|
return;
|
|
861
883
|
}
|
|
862
|
-
if (this.materialChangesInProgress.push(e), await
|
|
884
|
+
if (this.materialChangesInProgress.push(e), await s(), this.queuedMaterialChanges.has(e)) {
|
|
863
885
|
const o = this.queuedMaterialChanges.get(e);
|
|
864
886
|
if (!o)
|
|
865
887
|
throw new Error("Target material is undefined");
|
|
@@ -885,7 +907,7 @@ class it {
|
|
|
885
907
|
);
|
|
886
908
|
return;
|
|
887
909
|
}
|
|
888
|
-
const
|
|
910
|
+
const n = () => this.variantManager.applyModel(
|
|
889
911
|
e,
|
|
890
912
|
i,
|
|
891
913
|
t == null ? void 0 : t.model,
|
|
@@ -900,12 +922,12 @@ class it {
|
|
|
900
922
|
this.getAnimationIsPlaying.bind(this)
|
|
901
923
|
);
|
|
902
924
|
if (this.modelChangesInProgress.includes(e)) {
|
|
903
|
-
this.queuedModelChanges.set(e,
|
|
925
|
+
this.queuedModelChanges.set(e, n);
|
|
904
926
|
return;
|
|
905
927
|
}
|
|
906
928
|
const o = await (async () => {
|
|
907
929
|
this.modelChangesInProgress.push(e);
|
|
908
|
-
let a = await
|
|
930
|
+
let a = await n();
|
|
909
931
|
if (this.queuedModelChanges.has(e)) {
|
|
910
932
|
const h = this.queuedModelChanges.get(e);
|
|
911
933
|
if (!h)
|
|
@@ -921,7 +943,7 @@ class it {
|
|
|
921
943
|
}
|
|
922
944
|
dispose() {
|
|
923
945
|
var e;
|
|
924
|
-
|
|
946
|
+
this.destroyInstance(), this.variantManager.dispose(), this.dynamicTextures.forEach((t) => t == null ? void 0 : t.dispose()), this.dynamicTextures.clear(), this.materials.forEach((t) => t && (t == null ? void 0 : t.dispose())), this.materials = [], (e = this.transformRoot) == null || e.dispose(), this.transformRoot = void 0, this.previewService.modelUnloaded(this);
|
|
925
947
|
}
|
|
926
948
|
executeAnimation(e) {
|
|
927
949
|
if (!this.initialized)
|
|
@@ -929,24 +951,24 @@ class it {
|
|
|
929
951
|
let t = () => {
|
|
930
952
|
};
|
|
931
953
|
const i = async () => {
|
|
932
|
-
this.lastPlayedAnimation = e, this.isExecutingAnimation = !0, await new Promise((
|
|
954
|
+
this.lastPlayedAnimation = e, this.isExecutingAnimation = !0, await new Promise((n) => {
|
|
933
955
|
var o;
|
|
934
|
-
const
|
|
956
|
+
const s = [
|
|
935
957
|
...((o = this.modelInstance) == null ? void 0 : o.animationGroups) || [],
|
|
936
958
|
...this.variantManager.getAnimationGroups()
|
|
937
959
|
];
|
|
938
960
|
ve(
|
|
939
|
-
|
|
961
|
+
s,
|
|
940
962
|
e.loop,
|
|
941
963
|
e.to,
|
|
942
964
|
e.from,
|
|
943
965
|
e.name ? this.renameClonedAsset(e.name) : void 0,
|
|
944
|
-
|
|
966
|
+
n
|
|
945
967
|
);
|
|
946
968
|
}), this.isExecutingAnimation = !1, this.queuedAnimationFunction && this.queuedAnimationFunction(), this.queuedAnimationFunction = void 0, t();
|
|
947
969
|
};
|
|
948
|
-
return this.isExecutingAnimation ? (this.queuedAnimationFunction = i, new Promise((
|
|
949
|
-
t =
|
|
970
|
+
return this.isExecutingAnimation ? (this.queuedAnimationFunction = i, new Promise((n) => {
|
|
971
|
+
t = n;
|
|
950
972
|
})) : i();
|
|
951
973
|
}
|
|
952
974
|
getAnimations(e) {
|
|
@@ -956,7 +978,7 @@ class it {
|
|
|
956
978
|
this.variantManager.getAnimationGroups(),
|
|
957
979
|
this.renameClonedAsset("")
|
|
958
980
|
) : []
|
|
959
|
-
].map((t, i) => ({ ...t, name: t.name || `UNNAMED_ANIMATION_${i}` })).filter((t, i,
|
|
981
|
+
].map((t, i) => ({ ...t, name: t.name || `UNNAMED_ANIMATION_${i}` })).filter((t, i, n) => n.indexOf(n.find((s) => s.name === t.name)) == i);
|
|
960
982
|
}
|
|
961
983
|
getId() {
|
|
962
984
|
return this.id;
|
|
@@ -991,7 +1013,7 @@ class it {
|
|
|
991
1013
|
set position(e) {
|
|
992
1014
|
if (!this.transformRoot)
|
|
993
1015
|
throw new Error("ModelContainer disposed prior to setting position!");
|
|
994
|
-
this.transformRoot.position = new
|
|
1016
|
+
this.transformRoot.position = new p(e.x, e.y, e.z);
|
|
995
1017
|
}
|
|
996
1018
|
get rotation() {
|
|
997
1019
|
var e;
|
|
@@ -1002,7 +1024,7 @@ class it {
|
|
|
1002
1024
|
set rotation(e) {
|
|
1003
1025
|
if (!this.transformRoot)
|
|
1004
1026
|
throw new Error("ModelContainer disposed prior to setting rotation!");
|
|
1005
|
-
this.transformRoot.rotationQuaternion =
|
|
1027
|
+
this.transformRoot.rotationQuaternion = y.FromEulerAngles(
|
|
1006
1028
|
e.x,
|
|
1007
1029
|
e.y,
|
|
1008
1030
|
e.z
|
|
@@ -1016,22 +1038,22 @@ class it {
|
|
|
1016
1038
|
set scale(e) {
|
|
1017
1039
|
if (!this.transformRoot)
|
|
1018
1040
|
throw new Error("ModelContainer disposed prior to setting scale!");
|
|
1019
|
-
this.transformRoot.scaling = new
|
|
1041
|
+
this.transformRoot.scaling = new p(e.x, e.y, e.z);
|
|
1020
1042
|
}
|
|
1021
1043
|
//#endregion
|
|
1022
1044
|
//#region Custom implementation functions
|
|
1023
1045
|
attachPickingHandler(e) {
|
|
1024
1046
|
e.rootNodes.forEach((t) => {
|
|
1025
1047
|
t.getChildMeshes(!1).forEach((i) => {
|
|
1026
|
-
i.name === "targetcube_t" || i.name === "backgroundShell" || (i.actionManager || (i.actionManager = new
|
|
1027
|
-
new oe(
|
|
1028
|
-
|
|
1048
|
+
i.name === "targetcube_t" || i.name === "backgroundShell" || (i.actionManager || (i.actionManager = new R(this.scene)), i.actionManager.registerAction(
|
|
1049
|
+
new oe(R.OnPointerOverTrigger, (n) => {
|
|
1050
|
+
n.meshUnderPointer && i.material && this.materialSelectedObservable.notifyObservers({
|
|
1029
1051
|
id: i.material.id,
|
|
1030
1052
|
name: this.stripIdFromName(i.material.name)
|
|
1031
1053
|
});
|
|
1032
1054
|
})
|
|
1033
1055
|
), i.actionManager.registerAction(
|
|
1034
|
-
new oe(
|
|
1056
|
+
new oe(R.OnPointerOutTrigger, () => {
|
|
1035
1057
|
i.material && this.materialDeselectedObservable.notifyObservers({
|
|
1036
1058
|
id: i.material.id,
|
|
1037
1059
|
name: this.stripIdFromName(i.material.name)
|
|
@@ -1060,23 +1082,23 @@ class it {
|
|
|
1060
1082
|
return this.modelReadyToLoadCallbacks.size;
|
|
1061
1083
|
}
|
|
1062
1084
|
configureGlowLayer() {
|
|
1063
|
-
const e = (i) => i instanceof
|
|
1085
|
+
const e = (i) => i instanceof B && i.emissiveTexture !== null;
|
|
1064
1086
|
this.materials.some(e) || this.variantManager.getAllMaterials().some(e) ? this.previewService.getGlowLayerManager().includeMeshes(this.getAllMeshes()) : this.previewService.getGlowLayerManager().removeMeshes(this.getAllMeshes());
|
|
1065
1087
|
}
|
|
1066
1088
|
configureModelInstance(e) {
|
|
1067
|
-
var
|
|
1089
|
+
var s;
|
|
1068
1090
|
if (!this.transformRoot)
|
|
1069
1091
|
throw new Error(
|
|
1070
1092
|
"Transform disposed! This should never happen unless there is a race condition present!"
|
|
1071
1093
|
);
|
|
1072
|
-
const t = this.transformRoot.position, i = this.transformRoot.rotationQuaternion,
|
|
1073
|
-
this.transformRoot.position =
|
|
1094
|
+
const t = this.transformRoot.position, i = this.transformRoot.rotationQuaternion, n = this.transformRoot.scaling;
|
|
1095
|
+
this.transformRoot.position = p.Zero(), this.transformRoot.rotationQuaternion = y.Identity(), this.transformRoot.scaling = p.One();
|
|
1074
1096
|
for (const o of e.rootNodes) {
|
|
1075
1097
|
o.parent = this.transformRoot;
|
|
1076
1098
|
for (const a of o.getChildMeshes(!1))
|
|
1077
1099
|
a.alwaysSelectAsActiveMesh = !0;
|
|
1078
1100
|
}
|
|
1079
|
-
this.transformRoot.position = t, this.transformRoot.rotationQuaternion = i, this.transformRoot.scaling =
|
|
1101
|
+
this.transformRoot.position = t, this.transformRoot.rotationQuaternion = i, this.transformRoot.scaling = n, this.canvasPanels = ((s = this.contextService) == null ? void 0 : s.getAll()) || /* @__PURE__ */ new Map(), He(
|
|
1080
1102
|
this.materials.concat(this.variantManager.getAllMaterials()),
|
|
1081
1103
|
this.scene,
|
|
1082
1104
|
this.canvasPanels,
|
|
@@ -1120,8 +1142,8 @@ class it {
|
|
|
1120
1142
|
var e;
|
|
1121
1143
|
(e = this.canvasPanels) == null || e.forEach(
|
|
1122
1144
|
(t, i) => {
|
|
1123
|
-
const
|
|
1124
|
-
|
|
1145
|
+
const n = this.dynamicTextures.get(i);
|
|
1146
|
+
n && t.getStaticContextDirty() && n.isReady() && (n.update(!1), t.setStaticContextDirty(!1));
|
|
1125
1147
|
}
|
|
1126
1148
|
);
|
|
1127
1149
|
}
|
|
@@ -1179,17 +1201,17 @@ class it {
|
|
|
1179
1201
|
}
|
|
1180
1202
|
//#endregion
|
|
1181
1203
|
}
|
|
1182
|
-
class
|
|
1183
|
-
constructor(e, t, i,
|
|
1204
|
+
class k extends fe {
|
|
1205
|
+
constructor(e, t, i, n, s, o, a, h) {
|
|
1184
1206
|
super(
|
|
1185
1207
|
e,
|
|
1186
1208
|
t,
|
|
1187
1209
|
i,
|
|
1188
|
-
r,
|
|
1189
1210
|
n,
|
|
1211
|
+
s,
|
|
1190
1212
|
o,
|
|
1191
1213
|
h
|
|
1192
|
-
), this.lastFocus = new
|
|
1214
|
+
), 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(
|
|
1193
1215
|
a.camera.autoRotation.idleTimeMs
|
|
1194
1216
|
));
|
|
1195
1217
|
}
|
|
@@ -1205,7 +1227,7 @@ class N extends fe {
|
|
|
1205
1227
|
this._isRunningFramingBehavior = e, !e && this.framingBehaviourCallback && (this.framingBehaviourCallback(), this.framingBehaviourCallback = void 0);
|
|
1206
1228
|
}
|
|
1207
1229
|
setPanEnabled(e) {
|
|
1208
|
-
this.panEnabled = e, this.panningSensibility = 1e3 / this.panDenominator, this.panningAxis = e ? new
|
|
1230
|
+
this.panEnabled = e, this.panningSensibility = 1e3 / this.panDenominator, this.panningAxis = e ? new p(1, 1, 0) : new p(0, 0, 0);
|
|
1209
1231
|
}
|
|
1210
1232
|
/**
|
|
1211
1233
|
* Returns the framing behavior of this camera.
|
|
@@ -1230,7 +1252,7 @@ class N extends fe {
|
|
|
1230
1252
|
this.useFramingBehavior = !0;
|
|
1231
1253
|
const e = this.getFramingBehavior();
|
|
1232
1254
|
e.attach(this), e.framingTime = 0, e.elevationReturnTime = -1, e.zoomStopsAnimation = !1, this.lowerRadiusLimit = null;
|
|
1233
|
-
const t =
|
|
1255
|
+
const t = T(this._scene);
|
|
1234
1256
|
return e.zoomOnBoundingInfo(t.min, t.max), this.wheelPrecision = 100 / this.radius, this.lowerRadiusLimit === null && (this.lowerRadiusLimit = 0.1), this.lastFocus.copyFrom(this.target), e;
|
|
1235
1257
|
}
|
|
1236
1258
|
/**
|
|
@@ -1242,14 +1264,14 @@ class N extends fe {
|
|
|
1242
1264
|
this._isRunningFramingBehavior = !0, this.framingBehaviourCallback = e;
|
|
1243
1265
|
const i = this.getFramingBehavior();
|
|
1244
1266
|
i.framingTime = t || 800;
|
|
1245
|
-
const
|
|
1267
|
+
const n = () => {
|
|
1246
1268
|
this.isRunningFramingBehavior = !1;
|
|
1247
|
-
},
|
|
1269
|
+
}, s = T(this._scene), o = s.max.subtract(s.min), a = s.min.add(o.scale(0.5));
|
|
1248
1270
|
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(
|
|
1249
|
-
|
|
1250
|
-
|
|
1271
|
+
s.min,
|
|
1272
|
+
s.max,
|
|
1251
1273
|
void 0,
|
|
1252
|
-
|
|
1274
|
+
n
|
|
1253
1275
|
), i.framingTime = 0;
|
|
1254
1276
|
}
|
|
1255
1277
|
/**
|
|
@@ -1281,32 +1303,32 @@ class N extends fe {
|
|
|
1281
1303
|
*/
|
|
1282
1304
|
static create(e, t, i) {
|
|
1283
1305
|
var h;
|
|
1284
|
-
const
|
|
1306
|
+
const n = T(e), s = n.max.subtract(n.min), o = n.min.add(s.scale(0.5)), a = new k(
|
|
1285
1307
|
"ProductCamera",
|
|
1286
1308
|
-(Math.PI / 2),
|
|
1287
1309
|
Math.PI / 2,
|
|
1288
|
-
|
|
1310
|
+
s.length() * 1.5,
|
|
1289
1311
|
o,
|
|
1290
1312
|
e,
|
|
1291
1313
|
t
|
|
1292
1314
|
);
|
|
1293
1315
|
return a.setPanEnabled(
|
|
1294
1316
|
((h = t.options) == null ? void 0 : h.noPan) !== void 0 ? !t.options.noPan : !0
|
|
1295
|
-
), a.panningInertia = 0, a.panningOriginTarget.copyFrom(o), a.panDenominator =
|
|
1317
|
+
), a.panningInertia = 0, a.panningOriginTarget.copyFrom(o), a.panDenominator = s.length(), a.onAfterCheckInputsObservable.addOnce(() => {
|
|
1296
1318
|
a.setPanEnabled(a.panEnabled);
|
|
1297
1319
|
}), i && (e.activeCamera = a), a;
|
|
1298
1320
|
}
|
|
1299
1321
|
}
|
|
1300
|
-
function
|
|
1301
|
-
if (
|
|
1322
|
+
function T(r) {
|
|
1323
|
+
if (r.meshes.length === 0)
|
|
1302
1324
|
return {
|
|
1303
|
-
min: new
|
|
1304
|
-
max: new
|
|
1325
|
+
min: new p(-1, -1, -1),
|
|
1326
|
+
max: new p(1, 1, 1)
|
|
1305
1327
|
};
|
|
1306
|
-
const e =
|
|
1307
|
-
return
|
|
1328
|
+
const e = r.meshes.filter((t) => t.name.toLowerCase().endsWith("_t") || t.name.toLowerCase().includes("_t_"));
|
|
1329
|
+
return r.getWorldExtends((t) => t.isVisible && t.isEnabled() && (e.length === 0 || e.includes(t)));
|
|
1308
1330
|
}
|
|
1309
|
-
class
|
|
1331
|
+
class st {
|
|
1310
1332
|
constructor(e, t = !1, i = void 0) {
|
|
1311
1333
|
this.renderingPipeline = new qe(
|
|
1312
1334
|
"default",
|
|
@@ -1324,42 +1346,42 @@ class nt {
|
|
|
1324
1346
|
return this.currentConfiguration;
|
|
1325
1347
|
}
|
|
1326
1348
|
setConfiguration(e) {
|
|
1327
|
-
var t, i,
|
|
1349
|
+
var t, i, n, s, o, a, h, l, c, m, u, g, f, z, N, q, V, _, G, H, U, K, W, $, Y, Q, Z, j, X, J, ee, te, ie;
|
|
1328
1350
|
if (this.renderingPipeline.isSupported) {
|
|
1329
|
-
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 = ((
|
|
1351
|
+
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 = ((n = e.bloom) == null ? void 0 : n.enabled) ?? d.bloom.enabled, this.renderingPipeline.bloomKernel = ((s = e.bloom) == null ? void 0 : s.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 = ((h = e.bloom) == null ? void 0 : h.weight) ?? d.bloom.weight, this.renderingPipeline.chromaticAberrationEnabled = ((l = e.chromaticAberration) == null ? void 0 : l.enabled) ?? d.chromaticAberration.enabled, this.renderingPipeline.chromaticAberration.aberrationAmount = ((c = e.chromaticAberration) == null ? void 0 : c.aberrationAmount) ?? d.chromaticAberration.aberrationAmount, this.renderingPipeline.chromaticAberration.radialIntensity = ((m = e.chromaticAberration) == null ? void 0 : m.radialIntensity) ?? d.chromaticAberration.radialIntensity, this.renderingPipeline.chromaticAberration.direction = (u = e.chromaticAberration) != null && u.direction ? new se(
|
|
1330
1352
|
e.chromaticAberration.direction.x,
|
|
1331
1353
|
e.chromaticAberration.direction.y
|
|
1332
1354
|
) : new se(
|
|
1333
1355
|
d.chromaticAberration.direction.x,
|
|
1334
1356
|
d.chromaticAberration.direction.y
|
|
1335
|
-
), this.renderingPipeline.imageProcessing.colorCurvesEnabled = ((
|
|
1357
|
+
), this.renderingPipeline.imageProcessing.colorCurvesEnabled = ((g = e.colorCurves) == null ? void 0 : g.enabled) ?? d.colorCurves.enabled, this.renderingPipeline.imageProcessing.colorCurves = e.colorCurves ? this.updateColorCurve(e.colorCurves) : new le(), this.renderingPipeline.depthOfFieldEnabled = ((f = e.depthOfField) == null ? void 0 : f.enabled) ?? d.depthOfField.enabled, e.depthOfField)
|
|
1336
1358
|
switch (e.depthOfField.blurLevel ?? d.depthOfField.blurLevel) {
|
|
1337
1359
|
case "Low":
|
|
1338
|
-
this.renderingPipeline.depthOfFieldBlurLevel =
|
|
1360
|
+
this.renderingPipeline.depthOfFieldBlurLevel = E.Low;
|
|
1339
1361
|
break;
|
|
1340
1362
|
case "Medium":
|
|
1341
|
-
this.renderingPipeline.depthOfFieldBlurLevel =
|
|
1363
|
+
this.renderingPipeline.depthOfFieldBlurLevel = E.Medium;
|
|
1342
1364
|
break;
|
|
1343
1365
|
case "High":
|
|
1344
|
-
this.renderingPipeline.depthOfFieldBlurLevel =
|
|
1366
|
+
this.renderingPipeline.depthOfFieldBlurLevel = E.High;
|
|
1345
1367
|
break;
|
|
1346
1368
|
}
|
|
1347
|
-
if (this.renderingPipeline.depthOfField.focalLength = ((
|
|
1369
|
+
if (this.renderingPipeline.depthOfField.focalLength = ((z = e.depthOfField) == null ? void 0 : z.focalLength) ?? d.depthOfField.focalLength, this.renderingPipeline.depthOfField.fStop = ((N = e.depthOfField) == null ? void 0 : N.fStop) ?? d.depthOfField.fStop, this.renderingPipeline.depthOfField.focusDistance = ((q = e.depthOfField) == null ? void 0 : q.focusDistance) ?? d.depthOfField.focusDistance, this.renderingPipeline.depthOfField.lensSize = ((V = e.depthOfField) == null ? void 0 : V.lensSize) ?? d.depthOfField.lensSize, this.renderingPipeline.grainEnabled = ((_ = e.grain) == null ? void 0 : _.enabled) ?? d.grain.enabled, this.renderingPipeline.grain.animated = ((G = e.grain) == null ? void 0 : G.animated) ?? d.grain.animated, this.renderingPipeline.grain.intensity = ((H = e.grain) == null ? void 0 : H.intensity) ?? d.grain.intensity, this.renderingPipeline.imageProcessing.contrast = ((U = e.misc) == null ? void 0 : U.contrast) ?? d.misc.contrast, this.renderingPipeline.imageProcessing.exposure = ((K = e.misc) == null ? void 0 : K.exposure) ?? d.misc.exposure, this.renderingPipeline.imageProcessing.toneMappingEnabled = ((W = e.misc) == null ? void 0 : W.toneMappingEnabled) ?? d.misc.toneMappingEnabled, this.renderingPipeline.imageProcessing.toneMappingEnabled)
|
|
1348
1370
|
switch (e.misc.toneMappingType ?? d.misc.toneMappingType) {
|
|
1349
1371
|
case "Standard":
|
|
1350
|
-
this.renderingPipeline.imageProcessing.toneMappingType =
|
|
1372
|
+
this.renderingPipeline.imageProcessing.toneMappingType = x.TONEMAPPING_STANDARD;
|
|
1351
1373
|
break;
|
|
1352
1374
|
case "ACES":
|
|
1353
|
-
this.renderingPipeline.imageProcessing.toneMappingType =
|
|
1375
|
+
this.renderingPipeline.imageProcessing.toneMappingType = x.TONEMAPPING_ACES;
|
|
1354
1376
|
break;
|
|
1355
1377
|
}
|
|
1356
|
-
if (this.renderingPipeline.sharpenEnabled = ((
|
|
1378
|
+
if (this.renderingPipeline.sharpenEnabled = (($ = e.sharpen) == null ? void 0 : $.enabled) ?? d.sharpen.enabled, this.renderingPipeline.sharpen.colorAmount = ((Y = e.sharpen) == null ? void 0 : Y.colorAmount) ?? d.sharpen.colorAmount, this.renderingPipeline.sharpen.edgeAmount = ((Q = e.sharpen) == null ? void 0 : Q.edgeAmount) ?? d.sharpen.edgeAmount, this.renderingPipeline.imageProcessing.vignetteEnabled = ((Z = e.vignette) == null ? void 0 : Z.enabled) ?? d.vignette.enabled, (j = e.vignette) != null && j.center ? (this.renderingPipeline.imageProcessing.vignetteCenterX = e.vignette.center.x, this.renderingPipeline.imageProcessing.vignetteCenterY = e.vignette.center.y) : (this.renderingPipeline.imageProcessing.vignetteCenterX = d.vignette.center.x, this.renderingPipeline.imageProcessing.vignetteCenterY = d.vignette.center.y), e.vignette)
|
|
1357
1379
|
switch (((X = e.vignette) == null ? void 0 : X.blendMode) ?? d.vignette.blendMode) {
|
|
1358
1380
|
case "Multiply":
|
|
1359
|
-
this.renderingPipeline.imageProcessing.vignetteBlendMode =
|
|
1381
|
+
this.renderingPipeline.imageProcessing.vignetteBlendMode = x.VIGNETTEMODE_MULTIPLY;
|
|
1360
1382
|
break;
|
|
1361
1383
|
case "Opaque":
|
|
1362
|
-
this.renderingPipeline.imageProcessing.vignetteBlendMode =
|
|
1384
|
+
this.renderingPipeline.imageProcessing.vignetteBlendMode = x.VIGNETTEMODE_OPAQUE;
|
|
1363
1385
|
break;
|
|
1364
1386
|
}
|
|
1365
1387
|
(J = e.vignette) != null && J.colorRgba ? this.renderingPipeline.imageProcessing.vignetteColor = new b(
|
|
@@ -1380,36 +1402,36 @@ class nt {
|
|
|
1380
1402
|
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;
|
|
1381
1403
|
}
|
|
1382
1404
|
}
|
|
1383
|
-
Pe.GLTFLoader.RegisterExtension("glbPostProcessor", function(
|
|
1384
|
-
return new _e(
|
|
1405
|
+
Pe.GLTFLoader.RegisterExtension("glbPostProcessor", function(r) {
|
|
1406
|
+
return new _e(r);
|
|
1385
1407
|
});
|
|
1386
|
-
|
|
1387
|
-
if (
|
|
1388
|
-
const e =
|
|
1408
|
+
S.OnPluginActivatedObservable.add((r) => {
|
|
1409
|
+
if (r.name === "gltf") {
|
|
1410
|
+
const e = r;
|
|
1389
1411
|
e.transparencyAsCoverage = !0;
|
|
1390
1412
|
}
|
|
1391
1413
|
});
|
|
1392
|
-
function
|
|
1393
|
-
return new
|
|
1414
|
+
function O(r) {
|
|
1415
|
+
return new p(r.x, r.y, r.z);
|
|
1394
1416
|
}
|
|
1395
|
-
function
|
|
1396
|
-
return { x:
|
|
1417
|
+
function L(r) {
|
|
1418
|
+
return { x: r.x, y: r.y, z: r.z };
|
|
1397
1419
|
}
|
|
1398
|
-
class
|
|
1420
|
+
class $t {
|
|
1399
1421
|
constructor(e) {
|
|
1400
1422
|
var h;
|
|
1401
|
-
this.focusLostNotified = !1, this.focusLostObservable = new
|
|
1423
|
+
this.focusLostNotified = !1, this.focusLostObservable = new C(), this.modelLoadEventCallbacks = [], this.modelContainers = /* @__PURE__ */ new Map(), this.plugins = [], this.initComplete = !1, this.isAnimatingCamera = !1, this.renderLoop = () => {
|
|
1402
1424
|
if (!this.engine.views)
|
|
1403
1425
|
return;
|
|
1404
|
-
this.modelContainers.forEach((
|
|
1405
|
-
|
|
1426
|
+
this.modelContainers.forEach((m) => {
|
|
1427
|
+
m.updateDynamicTextures();
|
|
1406
1428
|
}), this.scene.autoClear = !0, this.scene.autoClearDepthAndStencil = !0;
|
|
1407
1429
|
const l = this.engine.getRenderingCanvas();
|
|
1408
1430
|
if (l)
|
|
1409
1431
|
if (l.getContext("webgl2") ?? l.getContext("webgl")) {
|
|
1410
|
-
const
|
|
1411
|
-
|
|
1412
|
-
|
|
1432
|
+
const m = this.configuration.scene.clearColor, u = l.getContext("webgl2") ?? l.getContext("webgl");
|
|
1433
|
+
u.clearDepth(1), u.depthFunc(u.LEQUAL), u.clearStencil(0), u.clearColor(m.r, m.g, m.b, m.a), u.clear(
|
|
1434
|
+
u.COLOR_BUFFER_BIT | u.DEPTH_BUFFER_BIT | u.STENCIL_BUFFER_BIT
|
|
1413
1435
|
);
|
|
1414
1436
|
} else
|
|
1415
1437
|
l.getContext("2d") ? l.getContext("2d").clearRect(0, 0, l.width, l.height) : console.error(
|
|
@@ -1422,15 +1444,15 @@ class Wt {
|
|
|
1422
1444
|
const i = (() => {
|
|
1423
1445
|
if (!(e != null && e.noRender))
|
|
1424
1446
|
return this.configuration.createCanvas();
|
|
1425
|
-
})(),
|
|
1447
|
+
})(), n = "1.5.6";
|
|
1426
1448
|
Ae.Configuration = {
|
|
1427
1449
|
decoder: {
|
|
1428
|
-
wasmUrl: `https://www.gstatic.com/draco/versioned/decoders/${
|
|
1429
|
-
wasmBinaryUrl: `https://www.gstatic.com/draco/versioned/decoders/${
|
|
1430
|
-
fallbackUrl: `https://www.gstatic.com/draco/versioned/decoders/${
|
|
1450
|
+
wasmUrl: `https://www.gstatic.com/draco/versioned/decoders/${n}/draco_wasm_wrapper_gltf.js`,
|
|
1451
|
+
wasmBinaryUrl: `https://www.gstatic.com/draco/versioned/decoders/${n}/draco_decoder_gltf.wasm`,
|
|
1452
|
+
fallbackUrl: `https://www.gstatic.com/draco/versioned/decoders/${n}/draco_decoder_gltf.js`
|
|
1431
1453
|
}
|
|
1432
1454
|
}, i && (i.getContext("webgl2") || i.getContext("webgl"));
|
|
1433
|
-
const
|
|
1455
|
+
const s = console.log;
|
|
1434
1456
|
console.log = () => {
|
|
1435
1457
|
};
|
|
1436
1458
|
const o = i ? new be(i, !0, {
|
|
@@ -1442,7 +1464,7 @@ class Wt {
|
|
|
1442
1464
|
stencil: this.configuration.highlights.enabled,
|
|
1443
1465
|
forceSRGBBufferSupportState: !0
|
|
1444
1466
|
}) : new Ce();
|
|
1445
|
-
console.log =
|
|
1467
|
+
console.log = s, o.hideLoadingUI(), window.addEventListener("resize", this.fireResizeEvent.bind(this)), this.engine = o, this.scene = new xe(o), this.camera = k.create(this.scene, this.configuration), this.scene.activeCamera = this.camera, this.renderingPipeline = new st(
|
|
1446
1468
|
this.scene,
|
|
1447
1469
|
!1,
|
|
1448
1470
|
this.camera
|
|
@@ -1451,7 +1473,7 @@ class Wt {
|
|
|
1451
1473
|
this.configuration.scene.environment.file,
|
|
1452
1474
|
this.scene
|
|
1453
1475
|
);
|
|
1454
|
-
a.
|
|
1476
|
+
a.rotationY = this.configuration.scene.environment.rotationY, this.scene.environmentTexture = a, this.scene.environmentIntensity = this.configuration.scene.environment.intensity, (h = this.configuration.options) != null && h.renderingPipelineConfiguration ? this.renderingPipeline.setConfiguration(
|
|
1455
1477
|
this.configuration.options.renderingPipelineConfiguration
|
|
1456
1478
|
) : (this.scene.imageProcessingConfiguration.exposure = this.configuration.lighting.exposure, this.scene.imageProcessingConfiguration.contrast = this.configuration.lighting.contrast), this.glowLayerManager = new Ge(
|
|
1457
1479
|
this.scene,
|
|
@@ -1490,7 +1512,7 @@ class Wt {
|
|
|
1490
1512
|
}
|
|
1491
1513
|
registerView(e) {
|
|
1492
1514
|
const t = e.height, i = e.width;
|
|
1493
|
-
this.engine.registerView(e, void 0, !0), e.setAttribute("height", t.toString()), e.setAttribute("width", i.toString()), this.orbitEnabled() || this.setCameraState(
|
|
1515
|
+
this.engine.registerView(e, void 0, !0), e.setAttribute("height", t.toString()), e.setAttribute("width", i.toString()), this.orbitEnabled() || this.setCameraState(I.Pan), this.reattachControls(e);
|
|
1494
1516
|
}
|
|
1495
1517
|
getNumViewports() {
|
|
1496
1518
|
var e;
|
|
@@ -1503,19 +1525,19 @@ class Wt {
|
|
|
1503
1525
|
this.plugins.forEach((e) => e.dispose(!0)), this.renderingPipeline.dispose(), this.engine && this.engine.dispose(), window.removeEventListener("resize", this.fireResizeEvent);
|
|
1504
1526
|
}
|
|
1505
1527
|
executeCameraAnimation(e) {
|
|
1506
|
-
if (!this.camera || this.scene.activeCamera !== this.camera || this.getAllModels().length === 0 || !this.getAllModels().some((
|
|
1528
|
+
if (!this.camera || this.scene.activeCamera !== this.camera || this.getAllModels().length === 0 || !this.getAllModels().some((n) => n.getIsInitialized()))
|
|
1507
1529
|
return this.queuedCameraAnimation = e, Promise.resolve();
|
|
1508
1530
|
let t = () => {
|
|
1509
1531
|
};
|
|
1510
1532
|
const i = async () => {
|
|
1511
|
-
this.isAnimatingCamera = !0, await
|
|
1533
|
+
this.isAnimatingCamera = !0, await $e(
|
|
1512
1534
|
this.scene,
|
|
1513
1535
|
this.scene.activeCamera,
|
|
1514
1536
|
e
|
|
1515
1537
|
), this.isAnimatingCamera = !1, this.queuedAnimationFunction && this.queuedAnimationFunction(), this.queuedAnimationFunction = void 0, t();
|
|
1516
1538
|
};
|
|
1517
|
-
return this.isAnimatingCamera ? (this.queuedAnimationFunction = i, new Promise((
|
|
1518
|
-
t =
|
|
1539
|
+
return this.isAnimatingCamera ? (this.queuedAnimationFunction = i, new Promise((n) => {
|
|
1540
|
+
t = n;
|
|
1519
1541
|
})) : i();
|
|
1520
1542
|
}
|
|
1521
1543
|
getCameraPose() {
|
|
@@ -1532,7 +1554,7 @@ class Wt {
|
|
|
1532
1554
|
};
|
|
1533
1555
|
}
|
|
1534
1556
|
setCameraPose(e) {
|
|
1535
|
-
this.scene && this.camera && (this.camera.target = new
|
|
1557
|
+
this.scene && this.camera && (this.camera.target = new p(
|
|
1536
1558
|
e.target.x,
|
|
1537
1559
|
e.target.y,
|
|
1538
1560
|
e.target.z
|
|
@@ -1544,7 +1566,7 @@ class Wt {
|
|
|
1544
1566
|
throw new Error(
|
|
1545
1567
|
"No views attached, camera state requires a view to attach controls onto."
|
|
1546
1568
|
);
|
|
1547
|
-
e ===
|
|
1569
|
+
e === I.Orbit ? this.reattachControls(this.engine.views[0].target, 2) : this.reattachControls(this.engine.views[0].target, 0);
|
|
1548
1570
|
}
|
|
1549
1571
|
animateToLastCameraFocus() {
|
|
1550
1572
|
let e = () => {
|
|
@@ -1552,13 +1574,13 @@ class Wt {
|
|
|
1552
1574
|
const t = async () => {
|
|
1553
1575
|
this.isAnimatingCamera = !0, await new Promise((i) => {
|
|
1554
1576
|
this.focusLostNotified = !1;
|
|
1555
|
-
const
|
|
1556
|
-
const
|
|
1577
|
+
const n = () => {
|
|
1578
|
+
const s = this.configuration;
|
|
1557
1579
|
this.camera.rerunFramingBehavior(() => {
|
|
1558
|
-
|
|
1580
|
+
s.camera.limits.min.radius && (this.camera.lowerRadiusLimit = s.camera.limits.min.radius), s.camera.limits.max.radius && (this.camera.upperRadiusLimit = s.camera.limits.max.radius), i();
|
|
1559
1581
|
});
|
|
1560
1582
|
};
|
|
1561
|
-
this.scene.onAfterRenderObservable.addOnce(
|
|
1583
|
+
this.scene.onAfterRenderObservable.addOnce(n);
|
|
1562
1584
|
}), this.isAnimatingCamera = !1, this.queuedAnimationFunction && this.queuedAnimationFunction(), this.queuedAnimationFunction = void 0, e();
|
|
1563
1585
|
};
|
|
1564
1586
|
return this.isAnimatingCamera ? (this.queuedAnimationFunction = t, new Promise((i) => {
|
|
@@ -1585,12 +1607,12 @@ class Wt {
|
|
|
1585
1607
|
0,
|
|
1586
1608
|
0,
|
|
1587
1609
|
0,
|
|
1588
|
-
|
|
1610
|
+
p.Zero(),
|
|
1589
1611
|
this.scene
|
|
1590
1612
|
);
|
|
1591
1613
|
try {
|
|
1592
|
-
const
|
|
1593
|
-
i.target = t.target ? new
|
|
1614
|
+
const n = t.latDeg * Math.PI / 180, s = t.lonDeg * Math.PI / 180;
|
|
1615
|
+
i.target = t.target ? new p(t.target.x, t.target.y, t.target.z) : p.Zero(), i.alpha = s, i.beta = n, i.radius = t.radius || this.camera.radius, i.minZ = 0.01, this.scene.render();
|
|
1594
1616
|
const o = await Me.CreateScreenshotUsingRenderTargetAsync(
|
|
1595
1617
|
this.engine,
|
|
1596
1618
|
i,
|
|
@@ -1608,33 +1630,33 @@ class Wt {
|
|
|
1608
1630
|
const e = this.configuration;
|
|
1609
1631
|
if (!e)
|
|
1610
1632
|
return !0;
|
|
1611
|
-
const t = e.camera.limits.min.alpha, i = e.camera.limits.max.alpha,
|
|
1612
|
-
if (t === void 0 || i === void 0 ||
|
|
1633
|
+
const t = e.camera.limits.min.alpha, i = e.camera.limits.max.alpha, n = e.camera.limits.min.beta, s = e.camera.limits.max.beta;
|
|
1634
|
+
if (t === void 0 || i === void 0 || n === void 0 || s === void 0)
|
|
1613
1635
|
return !0;
|
|
1614
|
-
const o = [t, i], a = [
|
|
1636
|
+
const o = [t, i], a = [n, s], h = o.every((c) => c === t), l = a.every((c) => c === n);
|
|
1615
1637
|
return !h && !l;
|
|
1616
1638
|
}
|
|
1617
1639
|
fireResizeEvent() {
|
|
1618
1640
|
this.getNumViewports() > 0 && this.engine.resize();
|
|
1619
1641
|
}
|
|
1620
1642
|
setHighlights(e, t) {
|
|
1621
|
-
var
|
|
1622
|
-
e.length === 0 && ((
|
|
1643
|
+
var n;
|
|
1644
|
+
e.length === 0 && ((n = this.highlightLayer) == null || n.dispose(), this.highlightLayer = void 0), this.highlightLayer || (this.highlightLayer = new ye("highlights", this.scene, {
|
|
1623
1645
|
isStroke: !0,
|
|
1624
1646
|
blurVerticalSize: 0.85,
|
|
1625
1647
|
blurHorizontalSize: 0.85
|
|
1626
1648
|
}), this.highlightLayer.innerGlow = !0, this.highlightLayer.outerGlow = !1), this.highlightLayer.removeAllMeshes();
|
|
1627
|
-
const i = t ? new
|
|
1628
|
-
e.forEach((
|
|
1649
|
+
const i = t ? new w(t[0], t[1], t[2]).toLinearSpace() : void 0;
|
|
1650
|
+
e.forEach((s) => {
|
|
1629
1651
|
const o = this.scene.materials.find(
|
|
1630
|
-
(a) => a.name ===
|
|
1652
|
+
(a) => a.name === s.name && a.id === s.id
|
|
1631
1653
|
);
|
|
1632
1654
|
o && o.getBindedMeshes().forEach(
|
|
1633
1655
|
(a) => {
|
|
1634
1656
|
var h;
|
|
1635
1657
|
return (h = this.highlightLayer) == null ? void 0 : h.addMesh(
|
|
1636
1658
|
a,
|
|
1637
|
-
i ||
|
|
1659
|
+
i || w.FromHexString("#fcba03")
|
|
1638
1660
|
);
|
|
1639
1661
|
}
|
|
1640
1662
|
);
|
|
@@ -1644,14 +1666,14 @@ class Wt {
|
|
|
1644
1666
|
this.renderingPipeline && this.renderingPipeline.setConfiguration(e);
|
|
1645
1667
|
}
|
|
1646
1668
|
loadModel(e, t) {
|
|
1647
|
-
const { refocusCamera: i = !0, progressHandler:
|
|
1669
|
+
const { refocusCamera: i = !0, progressHandler: n } = t ?? {}, s = new nt({
|
|
1648
1670
|
enablePicking: this.configuration.highlights.enabled,
|
|
1649
1671
|
modelDetails: e,
|
|
1650
1672
|
scene: this.scene,
|
|
1651
1673
|
previewService: this,
|
|
1652
|
-
progressHandler:
|
|
1674
|
+
progressHandler: n
|
|
1653
1675
|
});
|
|
1654
|
-
return
|
|
1676
|
+
return s.getInitializationPromise().then(() => {
|
|
1655
1677
|
if (this.modelContainers.size <= 1 && i) {
|
|
1656
1678
|
const o = this.queuedCameraAnimation;
|
|
1657
1679
|
this.forceStopCameraAnimations(), this.camera.rerunFramingBehavior(() => {
|
|
@@ -1660,17 +1682,17 @@ class Wt {
|
|
|
1660
1682
|
});
|
|
1661
1683
|
}, 1);
|
|
1662
1684
|
}
|
|
1663
|
-
}), this.configuration.highlights.enabled && (
|
|
1685
|
+
}), this.configuration.highlights.enabled && (s.registerMaterialSelectedCallback((o) => {
|
|
1664
1686
|
this.setHighlights([o]);
|
|
1665
|
-
}),
|
|
1687
|
+
}), s.registerMaterialDeselectedCallback(() => {
|
|
1666
1688
|
this.setHighlights([]);
|
|
1667
|
-
})), this.modelContainers.set(
|
|
1689
|
+
})), this.modelContainers.set(s.getId(), s), this.triggerModelLoadEvent({
|
|
1668
1690
|
eventType: "load",
|
|
1669
|
-
modelContainer:
|
|
1670
|
-
}),
|
|
1691
|
+
modelContainer: s
|
|
1692
|
+
}), s;
|
|
1671
1693
|
}
|
|
1672
1694
|
async preloadModel(e) {
|
|
1673
|
-
await
|
|
1695
|
+
await D(e, this.scene);
|
|
1674
1696
|
}
|
|
1675
1697
|
getAllModels() {
|
|
1676
1698
|
return Array.from(this.modelContainers.values());
|
|
@@ -1687,7 +1709,7 @@ class Wt {
|
|
|
1687
1709
|
}
|
|
1688
1710
|
unregisterPlugin(e) {
|
|
1689
1711
|
const t = this.plugins.indexOf(e);
|
|
1690
|
-
t > -1 && this.plugins.splice(t, 1).forEach((
|
|
1712
|
+
t > -1 && this.plugins.splice(t, 1).forEach((n) => n.dispose(!1));
|
|
1691
1713
|
}
|
|
1692
1714
|
getGlowLayerManager() {
|
|
1693
1715
|
return this.glowLayerManager;
|
|
@@ -1705,31 +1727,31 @@ class Wt {
|
|
|
1705
1727
|
* Flips a transform around the origin.
|
|
1706
1728
|
*/
|
|
1707
1729
|
flipTransform(e, t, i) {
|
|
1708
|
-
const
|
|
1709
|
-
|
|
1710
|
-
|
|
1711
|
-
|
|
1730
|
+
const n = re.Compose(
|
|
1731
|
+
O(i || { x: 1, y: 1, z: 1 }),
|
|
1732
|
+
y.FromEulerVector(
|
|
1733
|
+
O(t || { x: 0, y: 0, z: 0 })
|
|
1712
1734
|
),
|
|
1713
|
-
|
|
1714
|
-
),
|
|
1715
|
-
return o.decompose(l, h, a), h.multiplyInPlace(
|
|
1716
|
-
position:
|
|
1717
|
-
rotation:
|
|
1718
|
-
scale:
|
|
1735
|
+
O(e || { x: 0, y: 0, z: 0 })
|
|
1736
|
+
), s = re.RotationAxis(p.Up(), Math.PI), o = n.multiply(s), a = p.Zero(), h = y.Identity(), l = p.Zero();
|
|
1737
|
+
return o.decompose(l, h, a), h.multiplyInPlace(y.FromEulerAngles(0, Math.PI, 0)), {
|
|
1738
|
+
position: L(a),
|
|
1739
|
+
rotation: L(h.toEulerAngles()),
|
|
1740
|
+
scale: L(l)
|
|
1719
1741
|
};
|
|
1720
1742
|
}
|
|
1721
1743
|
updatePreviewOptions(e) {
|
|
1722
|
-
var
|
|
1744
|
+
var n, s;
|
|
1723
1745
|
const t = new ce(e);
|
|
1724
1746
|
this.configuration.highlights.enabled !== t.highlights.enabled && this.engine.setStencilBuffer(t.highlights.enabled), this.scene.clearColor = t.scene.clearColor;
|
|
1725
1747
|
let i = this.scene.environmentTexture;
|
|
1726
1748
|
this.configuration.scene.environment.file !== t.scene.environment.file && (i = ne.CreateFromPrefilteredData(
|
|
1727
1749
|
t.scene.environment.file,
|
|
1728
1750
|
this.scene
|
|
1729
|
-
), i.
|
|
1751
|
+
), i.rotationY = this.configuration.scene.environment.rotationY, this.scene.environmentTexture = i), i.rotationY = t.scene.environment.rotationY, this.scene.environmentIntensity = t.scene.environment.intensity, (n = t.options) != null && n.renderingPipelineConfiguration ? this.renderingPipeline.setConfiguration(
|
|
1730
1752
|
t.options.renderingPipelineConfiguration
|
|
1731
1753
|
) : (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(
|
|
1732
|
-
((
|
|
1754
|
+
((s = t.options) == null ? void 0 : s.noPan) !== void 0 ? !t.options.noPan : !0
|
|
1733
1755
|
), this.configuration = t;
|
|
1734
1756
|
}
|
|
1735
1757
|
/**
|
|
@@ -1747,10 +1769,10 @@ class Wt {
|
|
|
1747
1769
|
}
|
|
1748
1770
|
}
|
|
1749
1771
|
export {
|
|
1750
|
-
|
|
1751
|
-
|
|
1772
|
+
F as MaterialEffectMode,
|
|
1773
|
+
I as ProductCameraRig,
|
|
1752
1774
|
Ve as REFLECTION_PROBE_RESOLUTION,
|
|
1753
|
-
|
|
1754
|
-
|
|
1775
|
+
M as RenderingConfiguration,
|
|
1776
|
+
$t as SpiffCommerce3DPreviewService,
|
|
1755
1777
|
d as renderingPipelineDefaults
|
|
1756
1778
|
};
|