@spiffcommerce/preview 5.7.9-7 → 5.7.9-9
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 +306 -326
- package/dist/index.umd.js +1 -1
- package/package.json +1 -1
package/dist/index.esm.js
CHANGED
|
@@ -1,34 +1,34 @@
|
|
|
1
|
-
import { ArcRotateCamera as
|
|
2
|
-
import { Engine as
|
|
3
|
-
import { NullEngine as
|
|
4
|
-
import { HighlightLayer as
|
|
5
|
-
import { SceneLoader as
|
|
6
|
-
import { CubeTexture as
|
|
1
|
+
import { ArcRotateCamera as pe } from "@babylonjs/core/Cameras/arcRotateCamera";
|
|
2
|
+
import { Engine as fe } from "@babylonjs/core/Engines/engine";
|
|
3
|
+
import { NullEngine as we } from "@babylonjs/core/Engines/nullEngine";
|
|
4
|
+
import { HighlightLayer as Ce } from "@babylonjs/core/Layers/highlightLayer";
|
|
5
|
+
import { SceneLoader as S } from "@babylonjs/core/Loading/sceneLoader";
|
|
6
|
+
import { CubeTexture as ne } from "@babylonjs/core/Materials/Textures/cubeTexture";
|
|
7
7
|
import { Color4 as b, Color3 as w } from "@babylonjs/core/Maths/math.color";
|
|
8
|
-
import { Vector3 as p, Quaternion as
|
|
9
|
-
import { DracoCompression as
|
|
8
|
+
import { Vector3 as p, Quaternion as A, Vector2 as se, Matrix as re } from "@babylonjs/core/Maths/math.vector";
|
|
9
|
+
import { DracoCompression as Ae } from "@babylonjs/core/Meshes/Compression/dracoCompression";
|
|
10
10
|
import { Observable as C } from "@babylonjs/core/Misc/observable";
|
|
11
|
-
import { Tools as
|
|
12
|
-
import { Scene as
|
|
13
|
-
import { GLTF2 as
|
|
14
|
-
import { GLTFLoaderAnimationStartMode as
|
|
15
|
-
import { PBRMaterial as
|
|
16
|
-
import { MirrorTexture as
|
|
17
|
-
import { Color3 as
|
|
18
|
-
import { ReflectionProbe as
|
|
19
|
-
import { GlowLayer as
|
|
11
|
+
import { Tools as xe } from "@babylonjs/core/Misc/tools";
|
|
12
|
+
import { Scene as ye } from "@babylonjs/core/scene";
|
|
13
|
+
import { GLTF2 as Me } from "@babylonjs/loaders/glTF";
|
|
14
|
+
import { GLTFLoaderAnimationStartMode as Pe } from "@babylonjs/loaders/glTF/glTFFileLoader";
|
|
15
|
+
import { PBRMaterial as B } from "@babylonjs/core/Materials/PBR/pbrMaterial";
|
|
16
|
+
import { MirrorTexture as Re } from "@babylonjs/core/Materials/Textures/mirrorTexture";
|
|
17
|
+
import { Color3 as Ee, Vector3 as ae, Plane as Te } from "@babylonjs/core/Maths/math";
|
|
18
|
+
import { ReflectionProbe as Oe } from "@babylonjs/core/Probes/reflectionProbe";
|
|
19
|
+
import { GlowLayer as Le } from "@babylonjs/core/Layers/glowLayer";
|
|
20
20
|
import { ActionManager as R } from "@babylonjs/core/Actions/actionManager";
|
|
21
|
-
import { ExecuteCodeAction as
|
|
22
|
-
import { Mesh as
|
|
23
|
-
import { TransformNode as
|
|
24
|
-
import { DynamicTexture as
|
|
25
|
-
import { Texture as
|
|
21
|
+
import { ExecuteCodeAction as oe } from "@babylonjs/core/Actions/directActions";
|
|
22
|
+
import { Mesh as Ie } from "@babylonjs/core/Meshes/mesh";
|
|
23
|
+
import { TransformNode as Fe } from "@babylonjs/core/Meshes/transformNode";
|
|
24
|
+
import { DynamicTexture as Se } from "@babylonjs/core/Materials/Textures/dynamicTexture";
|
|
25
|
+
import { Texture as Be } from "@babylonjs/core/Materials/Textures/texture";
|
|
26
26
|
import { Animation as v } from "@babylonjs/core/Animations/animation";
|
|
27
|
-
import { QuadraticEase as
|
|
28
|
-
import { AssetsManager as
|
|
29
|
-
import { ColorCurves as
|
|
30
|
-
import { ImageProcessingConfiguration as
|
|
31
|
-
import { DefaultRenderingPipeline as
|
|
27
|
+
import { QuadraticEase as De, EasingFunction as ke } from "@babylonjs/core/Animations/easing";
|
|
28
|
+
import { AssetsManager as ze } from "@babylonjs/core/Misc/assetsManager";
|
|
29
|
+
import { ColorCurves as le } from "@babylonjs/core/Materials/colorCurves";
|
|
30
|
+
import { ImageProcessingConfiguration as M } from "@babylonjs/core/Materials/imageProcessingConfiguration";
|
|
31
|
+
import { DefaultRenderingPipeline as Ne } from "@babylonjs/core/PostProcesses/RenderPipeline";
|
|
32
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";
|
|
@@ -40,54 +40,43 @@ 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
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
console.log(
|
|
47
|
-
`asset cache currently has ${T.size} entries, seeking ${s} for scene ${e.uid}`
|
|
48
|
-
);
|
|
49
|
-
const i = await T.get(s);
|
|
50
|
-
if (i && i.scene.uid === e.uid)
|
|
51
|
-
return i;
|
|
52
|
-
console.log(
|
|
53
|
-
`existing container belonged to scene ${i == null ? void 0 : i.scene.uid}`
|
|
54
|
-
);
|
|
55
|
-
const r = B.LoadAssetContainerAsync(
|
|
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
|
+
async function D(s, e, t) {
|
|
45
|
+
return S.LoadAssetContainerAsync(
|
|
56
46
|
s,
|
|
57
47
|
void 0,
|
|
58
48
|
e,
|
|
59
49
|
t
|
|
60
50
|
);
|
|
61
|
-
return T.set(s, r), r;
|
|
62
51
|
}
|
|
63
|
-
|
|
64
|
-
s.name === "gltf" && (s.animationStartMode =
|
|
52
|
+
S.OnPluginActivatedObservable.add((s) => {
|
|
53
|
+
s.name === "gltf" && (s.animationStartMode = Pe.NONE);
|
|
65
54
|
});
|
|
66
|
-
class
|
|
55
|
+
class he {
|
|
67
56
|
constructor(e) {
|
|
68
57
|
this.getSceneClearColor = () => {
|
|
69
|
-
var i,
|
|
70
|
-
const t = (i = this.customOptions) != null && i.transparentBackground || (
|
|
58
|
+
var i, a, n, o;
|
|
59
|
+
const t = (i = this.customOptions) != null && i.transparentBackground || (a = this.customOptions) != null && a.backgroundImage ? 0 : 1;
|
|
71
60
|
if (this.customOptions && ((n = this.customOptions) != null && n.transparentBackground) || (o = this.customOptions) != null && o.backgroundImage)
|
|
72
61
|
return new b(0, 0, 0, t).toLinearSpace();
|
|
73
62
|
if (this.customOptions && this.customOptions.backgroundColor) {
|
|
74
|
-
const
|
|
63
|
+
const r = w.FromHexString(
|
|
75
64
|
this.customOptions.backgroundColor
|
|
76
65
|
);
|
|
77
66
|
return new b(
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
67
|
+
r.r,
|
|
68
|
+
r.g,
|
|
69
|
+
r.b,
|
|
81
70
|
t
|
|
82
71
|
).toLinearSpace();
|
|
83
72
|
}
|
|
84
73
|
return new b(0.98, 0.98, 0.98, t).toLinearSpace();
|
|
85
74
|
}, 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) => {
|
|
86
|
-
const
|
|
75
|
+
const a = w.FromHexString(t);
|
|
87
76
|
return new b(
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
77
|
+
a.r,
|
|
78
|
+
a.g,
|
|
79
|
+
a.b,
|
|
91
80
|
i
|
|
92
81
|
).toLinearSpace();
|
|
93
82
|
}, this.customOptions = e;
|
|
@@ -103,13 +92,13 @@ class ce {
|
|
|
103
92
|
* Configuration related to the scene
|
|
104
93
|
*/
|
|
105
94
|
get scene() {
|
|
106
|
-
var e, t, i,
|
|
95
|
+
var e, t, i, a, n;
|
|
107
96
|
return {
|
|
108
97
|
clearColor: this.getSceneClearColor(),
|
|
109
98
|
transparentBackground: ((e = this.customOptions) == null ? void 0 : e.transparentBackground) || ((t = this.customOptions) == null ? void 0 : t.backgroundImage),
|
|
110
99
|
environment: {
|
|
111
100
|
file: ((i = this.customOptions) == null ? void 0 : i.environmentFile) ?? "assets/model-viewer/default.env",
|
|
112
|
-
intensity: ((
|
|
101
|
+
intensity: ((a = this.customOptions) == null ? void 0 : a.environmentIntensity) ?? 1,
|
|
113
102
|
rotationY: (((n = this.customOptions) == null ? void 0 : n.environmentRotationY) ?? 0) * (Math.PI / 180)
|
|
114
103
|
// Convert to radians
|
|
115
104
|
}
|
|
@@ -119,7 +108,7 @@ class ce {
|
|
|
119
108
|
* Configuration related to the camera used to view and interact with the scene.
|
|
120
109
|
*/
|
|
121
110
|
get camera() {
|
|
122
|
-
var e, t, i,
|
|
111
|
+
var e, t, i, a, n, o, r, h, l, c, m, u, g;
|
|
123
112
|
return {
|
|
124
113
|
autoOrientation: ((e = this.customOptions) == null ? void 0 : e.disableAutomaticOrientation) ?? !0,
|
|
125
114
|
autoRotation: {
|
|
@@ -128,8 +117,8 @@ class ce {
|
|
|
128
117
|
},
|
|
129
118
|
limits: {
|
|
130
119
|
min: {
|
|
131
|
-
alpha: (
|
|
132
|
-
beta: (o = this.customOptions) != null && o.lowerBetaLimitDeg ? ((
|
|
120
|
+
alpha: (a = this.customOptions) != null && a.lowerAlphaLimitDeg ? ((n = this.customOptions) == null ? void 0 : n.lowerAlphaLimitDeg) * Math.PI / 180 : void 0,
|
|
121
|
+
beta: (o = this.customOptions) != null && o.lowerBetaLimitDeg ? ((r = this.customOptions) == null ? void 0 : r.lowerBetaLimitDeg) * Math.PI / 180 : void 0,
|
|
133
122
|
radius: (h = this.customOptions) == null ? void 0 : h.minZoomOverride
|
|
134
123
|
},
|
|
135
124
|
max: {
|
|
@@ -152,10 +141,10 @@ class ce {
|
|
|
152
141
|
};
|
|
153
142
|
}
|
|
154
143
|
get lighting() {
|
|
155
|
-
var e, t, i,
|
|
144
|
+
var e, t, i, a;
|
|
156
145
|
return {
|
|
157
146
|
exposure: ((t = (e = this.customOptions) == null ? void 0 : e.lighting) == null ? void 0 : t.exposure) ?? 0.9,
|
|
158
|
-
contrast: ((
|
|
147
|
+
contrast: ((a = (i = this.customOptions) == null ? void 0 : i.lighting) == null ? void 0 : a.contrast) ?? 1.6
|
|
159
148
|
};
|
|
160
149
|
}
|
|
161
150
|
get emissiveGlowIntensity() {
|
|
@@ -163,12 +152,12 @@ class ce {
|
|
|
163
152
|
return ((e = this.customOptions) == null ? void 0 : e.emissiveGlowIntensity) ?? 0.5;
|
|
164
153
|
}
|
|
165
154
|
}
|
|
166
|
-
class
|
|
155
|
+
class y {
|
|
167
156
|
/**
|
|
168
157
|
* Returns the resolution expected for generated textures.
|
|
169
158
|
*/
|
|
170
159
|
static getDynamicTextureResolution() {
|
|
171
|
-
return this.getIsMobile() || !
|
|
160
|
+
return this.getIsMobile() || !y.offscreenRenderingSupported() ? {
|
|
172
161
|
width: 1024,
|
|
173
162
|
height: 1024
|
|
174
163
|
} : {
|
|
@@ -204,7 +193,7 @@ class A {
|
|
|
204
193
|
}
|
|
205
194
|
}
|
|
206
195
|
}
|
|
207
|
-
const
|
|
196
|
+
const qe = 128, d = {
|
|
208
197
|
antiAliasing: {
|
|
209
198
|
samples: 4,
|
|
210
199
|
fxaaEnabled: !1
|
|
@@ -261,7 +250,7 @@ const Ve = 128, d = {
|
|
|
261
250
|
weight: 1
|
|
262
251
|
}
|
|
263
252
|
};
|
|
264
|
-
class
|
|
253
|
+
class Ve {
|
|
265
254
|
constructor(e) {
|
|
266
255
|
this.name = "glbPostProcessor", this.enabled = !0, this.loader = e;
|
|
267
256
|
}
|
|
@@ -276,11 +265,11 @@ class _e {
|
|
|
276
265
|
return this.loader.loadNodeAsync(
|
|
277
266
|
e,
|
|
278
267
|
t,
|
|
279
|
-
function(
|
|
268
|
+
function(a) {
|
|
280
269
|
t.extras && Object.keys(t.extras).forEach((n) => {
|
|
281
270
|
const o = t.extras[n];
|
|
282
|
-
|
|
283
|
-
}), i(
|
|
271
|
+
a.metadata[n] = o;
|
|
272
|
+
}), i(a);
|
|
284
273
|
}
|
|
285
274
|
);
|
|
286
275
|
}
|
|
@@ -305,14 +294,14 @@ class _e {
|
|
|
305
294
|
* @param babylonMaterial An instance of a material representation in babylon.
|
|
306
295
|
*/
|
|
307
296
|
enableMaterialExtrasIfRequired(e, t) {
|
|
308
|
-
if (!(!e.extras || !(t instanceof
|
|
297
|
+
if (!(!e.extras || !(t instanceof B))) {
|
|
309
298
|
if (e.extras.sheen) {
|
|
310
299
|
const i = t;
|
|
311
300
|
i.sheen.isEnabled = !0, i.sheen.intensity = e.extras.sheen;
|
|
312
301
|
}
|
|
313
302
|
if (e.extras.translucency) {
|
|
314
303
|
const i = t;
|
|
315
|
-
i.subSurface.isTranslucencyEnabled = !0, i.subSurface.translucencyIntensity = e.extras.translucency, e.extras.translucencyR && e.extras.translucencyG && e.extras.translucencyB && (i.subSurface.tintColor = new
|
|
304
|
+
i.subSurface.isTranslucencyEnabled = !0, i.subSurface.translucencyIntensity = e.extras.translucency, e.extras.translucencyR && e.extras.translucencyG && e.extras.translucencyB && (i.subSurface.tintColor = new Ee(
|
|
316
305
|
e.extras.translucencyR,
|
|
317
306
|
e.extras.translucencyG,
|
|
318
307
|
e.extras.translucencyB
|
|
@@ -340,19 +329,19 @@ class _e {
|
|
|
340
329
|
applyReflections(e) {
|
|
341
330
|
function t(n) {
|
|
342
331
|
const o = [];
|
|
343
|
-
return n.transformNodes.forEach((
|
|
344
|
-
|
|
345
|
-
}), n.meshes.forEach((
|
|
346
|
-
|
|
332
|
+
return n.transformNodes.forEach((r) => {
|
|
333
|
+
r.metadata && r.metadata.reflective && o.push(...r.getChildMeshes());
|
|
334
|
+
}), n.meshes.forEach((r) => {
|
|
335
|
+
r.metadata && r.metadata.reflective && !o.includes(r) && o.push(r);
|
|
347
336
|
}), o;
|
|
348
337
|
}
|
|
349
338
|
function i(n, o = 1) {
|
|
350
|
-
const
|
|
351
|
-
if (!
|
|
339
|
+
const r = n.material;
|
|
340
|
+
if (!r)
|
|
352
341
|
return;
|
|
353
|
-
const h = new
|
|
342
|
+
const h = new Re(
|
|
354
343
|
"mirror",
|
|
355
|
-
|
|
344
|
+
y.getMirrorTextureResolution(),
|
|
356
345
|
e,
|
|
357
346
|
!0
|
|
358
347
|
);
|
|
@@ -363,30 +352,30 @@ class _e {
|
|
|
363
352
|
"Mirror attribute specified on: " + n.name + "But no normals exist to generate a mirror from!"
|
|
364
353
|
);
|
|
365
354
|
n.computeWorldMatrix(!0);
|
|
366
|
-
const c = n.getWorldMatrix(), m =
|
|
367
|
-
new
|
|
355
|
+
const c = n.getWorldMatrix(), m = ae.TransformNormal(
|
|
356
|
+
new ae(l[0], l[1], l[2]),
|
|
368
357
|
c
|
|
369
|
-
).normalize(), u =
|
|
358
|
+
).normalize(), u = Te.FromPositionAndNormal(
|
|
370
359
|
n.position,
|
|
371
360
|
m.scale(-1)
|
|
372
361
|
);
|
|
373
|
-
h.mirrorPlane = u, h.level = o,
|
|
362
|
+
h.mirrorPlane = u, h.level = o, r.reflectionTexture = h;
|
|
374
363
|
}
|
|
375
|
-
function
|
|
376
|
-
const o = n.material,
|
|
364
|
+
function a(n) {
|
|
365
|
+
const o = n.material, r = new Oe(
|
|
377
366
|
"probe-" + o.name,
|
|
378
|
-
|
|
367
|
+
qe,
|
|
379
368
|
e
|
|
380
369
|
);
|
|
381
|
-
|
|
370
|
+
r.cubeTexture.name = "reflection-probe-cube-texture", r.attachToMesh(n), r.renderList && r.renderList.push(...t(e)), o.reflectionTexture = r.cubeTexture;
|
|
382
371
|
}
|
|
383
372
|
e.meshes.forEach((n) => {
|
|
384
373
|
const o = n.metadata;
|
|
385
|
-
o && (o.mirrorTexture && i(n, o.mirrorTexture), o.reflectionProbe &&
|
|
374
|
+
o && (o.mirrorTexture && i(n, o.mirrorTexture), o.reflectionProbe && a(n));
|
|
386
375
|
});
|
|
387
376
|
}
|
|
388
377
|
}
|
|
389
|
-
class
|
|
378
|
+
class _e {
|
|
390
379
|
constructor(e, t) {
|
|
391
380
|
this.scene = e, this.intensity = t, this.meshCount = 0;
|
|
392
381
|
}
|
|
@@ -395,7 +384,7 @@ class Ge {
|
|
|
395
384
|
}
|
|
396
385
|
includeMeshes(e) {
|
|
397
386
|
if (e) {
|
|
398
|
-
this.glowLayer || (this.glowLayer = new
|
|
387
|
+
this.glowLayer || (this.glowLayer = new Le("glow", this.scene), this.glowLayer.intensity = this.intensity);
|
|
399
388
|
for (const t of e)
|
|
400
389
|
this.glowLayer.hasMesh(t) || (this.glowLayer.addIncludedOnlyMesh(t), this.meshCount++);
|
|
401
390
|
}
|
|
@@ -408,51 +397,42 @@ class Ge {
|
|
|
408
397
|
}
|
|
409
398
|
}
|
|
410
399
|
}
|
|
411
|
-
function
|
|
400
|
+
function Ge(s, e, t, i, a = "") {
|
|
412
401
|
t.forEach((n) => {
|
|
413
|
-
const o = n.getID(),
|
|
414
|
-
s.filter((c) => c.name ===
|
|
402
|
+
const o = n.getID(), r = n.getName(), h = y.getDynamicTextureResolution();
|
|
403
|
+
s.filter((c) => c.name === a + r).forEach((c) => {
|
|
415
404
|
const m = i.get(o), u = !1;
|
|
416
405
|
if (m)
|
|
417
|
-
|
|
406
|
+
ce(c, m), m.update(u);
|
|
418
407
|
else {
|
|
419
|
-
const g =
|
|
420
|
-
|
|
408
|
+
const g = He(
|
|
409
|
+
r,
|
|
421
410
|
e,
|
|
422
411
|
h.width,
|
|
423
412
|
h.height
|
|
424
413
|
);
|
|
425
414
|
i.set(o, g), n.setStaticContext(
|
|
426
415
|
g.getContext()
|
|
427
|
-
),
|
|
416
|
+
), ce(c, g), g.onLoadObservable.addOnce(() => {
|
|
428
417
|
g.update(u);
|
|
429
418
|
});
|
|
430
419
|
}
|
|
431
420
|
});
|
|
432
|
-
}), Ue(e);
|
|
433
|
-
}
|
|
434
|
-
const Ue = (s) => {
|
|
435
|
-
(() => s.materials.reduce((t, i) => (i.getBindedMeshes().length == 0 && t.push(i), t), []))().forEach((t) => {
|
|
436
|
-
try {
|
|
437
|
-
console.log(`disposing material ${t.name}`), t.dispose(!0, !0);
|
|
438
|
-
} catch {
|
|
439
|
-
console.log(`Failed to dispose material ${t.name}`);
|
|
440
|
-
}
|
|
441
421
|
});
|
|
442
|
-
}
|
|
443
|
-
function
|
|
444
|
-
const
|
|
422
|
+
}
|
|
423
|
+
function He(s, e, t, i) {
|
|
424
|
+
const a = new Se(
|
|
445
425
|
s,
|
|
446
426
|
{ width: t, height: i },
|
|
447
427
|
e,
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
), n =
|
|
452
|
-
return n && (n.fillStyle = "#f5f5f5", n.fillRect(0, 0, t, i),
|
|
428
|
+
y.shouldMipMap(),
|
|
429
|
+
Be.TRILINEAR_SAMPLINGMODE,
|
|
430
|
+
fe.TEXTUREFORMAT_RGBA
|
|
431
|
+
), n = a.getContext();
|
|
432
|
+
return n && (n.fillStyle = "#f5f5f5", n.fillRect(0, 0, t, i), a.update()), a;
|
|
453
433
|
}
|
|
454
|
-
function
|
|
455
|
-
if (s instanceof
|
|
434
|
+
function ce(s, e) {
|
|
435
|
+
if (s instanceof B) {
|
|
456
436
|
const t = s, i = t.albedoTexture;
|
|
457
437
|
i ? (e.wrapU = i.wrapU, e.wrapV = i.wrapV) : (e.wrapU = 1, e.wrapV = 1), t.albedoTexture = e;
|
|
458
438
|
} else {
|
|
@@ -460,23 +440,23 @@ function de(s, e) {
|
|
|
460
440
|
i && (e.wrapU = i.wrapU, e.wrapV = i.wrapV), t.diffuseTexture = e;
|
|
461
441
|
}
|
|
462
442
|
}
|
|
463
|
-
function
|
|
443
|
+
function Ue() {
|
|
464
444
|
const s = () => Math.floor((1 + Math.random()) * 65536).toString(16).substring(1);
|
|
465
445
|
return s() + s() + "-" + s() + "-" + s() + "-" + s() + "-" + s() + s() + s();
|
|
466
446
|
}
|
|
467
|
-
const
|
|
468
|
-
function
|
|
447
|
+
const x = 60, de = 1;
|
|
448
|
+
function ue(s) {
|
|
469
449
|
return s.targetedAnimations.map((t) => t.animation.framePerSecond).reduce((t, i) => t + i, 0) / s.targetedAnimations.length || 0;
|
|
470
450
|
}
|
|
471
|
-
function
|
|
472
|
-
const o =
|
|
451
|
+
function be(s, e, t, i, a, n) {
|
|
452
|
+
const o = a ? s.filter((c) => c.name === a) : s;
|
|
473
453
|
if (o.length === 0) {
|
|
474
|
-
console.warn(`No animations found for name: ${
|
|
454
|
+
console.warn(`No animations found for name: ${a}`);
|
|
475
455
|
return;
|
|
476
456
|
}
|
|
477
|
-
let
|
|
457
|
+
let r = 0;
|
|
478
458
|
const h = () => {
|
|
479
|
-
|
|
459
|
+
r++, r === o.length && n && n();
|
|
480
460
|
}, l = (c, m, u, g, f) => {
|
|
481
461
|
c.stop(), c.start(m, u, g, f), n && (m == !1 || m === void 0 && !c.loopAnimation ? c.onAnimationGroupEndObservable.addOnce(() => {
|
|
482
462
|
h();
|
|
@@ -486,21 +466,21 @@ function ve(s, e, t, i, r, n) {
|
|
|
486
466
|
};
|
|
487
467
|
if (i !== void 0 && t !== void 0 && i === t) {
|
|
488
468
|
o.forEach((c) => {
|
|
489
|
-
const m =
|
|
490
|
-
l(c, !1,
|
|
469
|
+
const m = ue(c), u = i * m;
|
|
470
|
+
l(c, !1, de, u, u);
|
|
491
471
|
});
|
|
492
472
|
return;
|
|
493
473
|
}
|
|
494
474
|
o.forEach((c) => {
|
|
495
|
-
const m =
|
|
496
|
-
l(c, e,
|
|
475
|
+
const m = ue(c), u = i !== void 0 ? i * m : void 0, g = t !== void 0 ? t * m : void 0;
|
|
476
|
+
l(c, e, de, u, g);
|
|
497
477
|
});
|
|
498
478
|
}
|
|
499
|
-
function
|
|
479
|
+
function Ke(s, e, t) {
|
|
500
480
|
return new Promise((i) => {
|
|
501
|
-
s.stopAnimation(e), e.animations = [], Math.abs(e.alpha) > 2 * Math.PI && (e.alpha =
|
|
502
|
-
const
|
|
503
|
-
if (t.target && Object.keys(t.target).length > 0 &&
|
|
481
|
+
s.stopAnimation(e), e.animations = [], Math.abs(e.alpha) > 2 * Math.PI && (e.alpha = We(e.alpha, 0, 2 * Math.PI));
|
|
482
|
+
const a = [], n = t.target, o = 0, r = n ? 1 : 0;
|
|
483
|
+
if (t.target && Object.keys(t.target).length > 0 && a.push(
|
|
504
484
|
P(
|
|
505
485
|
"cameraTargetLerp",
|
|
506
486
|
"target",
|
|
@@ -513,43 +493,43 @@ function Ye(s, e, t) {
|
|
|
513
493
|
v.ANIMATIONTYPE_VECTOR3,
|
|
514
494
|
o
|
|
515
495
|
)
|
|
516
|
-
),
|
|
496
|
+
), a.push(
|
|
517
497
|
P(
|
|
518
498
|
"cameraAlphaLerp",
|
|
519
499
|
"alpha",
|
|
520
500
|
e.alpha,
|
|
521
|
-
|
|
501
|
+
me(t.lonDeg),
|
|
522
502
|
v.ANIMATIONTYPE_FLOAT,
|
|
523
|
-
|
|
503
|
+
r
|
|
524
504
|
)
|
|
525
|
-
),
|
|
505
|
+
), a.push(
|
|
526
506
|
P(
|
|
527
507
|
"cameraBetaLerp",
|
|
528
508
|
"beta",
|
|
529
509
|
e.beta,
|
|
530
|
-
|
|
510
|
+
me(t.latDeg),
|
|
531
511
|
v.ANIMATIONTYPE_FLOAT,
|
|
532
|
-
|
|
512
|
+
r
|
|
533
513
|
)
|
|
534
514
|
), t.radius !== void 0) {
|
|
535
515
|
const c = Math.max(0.01, t.radius);
|
|
536
|
-
|
|
516
|
+
a.push(
|
|
537
517
|
P(
|
|
538
518
|
"cameraRadiusLerp",
|
|
539
519
|
"radius",
|
|
540
520
|
e.radius,
|
|
541
521
|
c,
|
|
542
522
|
v.ANIMATIONTYPE_FLOAT,
|
|
543
|
-
|
|
523
|
+
r
|
|
544
524
|
)
|
|
545
525
|
);
|
|
546
526
|
}
|
|
547
|
-
e.animations.push(...
|
|
527
|
+
e.animations.push(...a);
|
|
548
528
|
const l = e.useAutoRotationBehavior;
|
|
549
529
|
e.disableAutoRotationBehavior(), s.beginAnimation(
|
|
550
530
|
e,
|
|
551
531
|
0,
|
|
552
|
-
n ?
|
|
532
|
+
n ? x * 2 : x,
|
|
553
533
|
!1,
|
|
554
534
|
1,
|
|
555
535
|
() => {
|
|
@@ -558,33 +538,33 @@ function Ye(s, e, t) {
|
|
|
558
538
|
);
|
|
559
539
|
});
|
|
560
540
|
}
|
|
561
|
-
function
|
|
541
|
+
function me(s) {
|
|
562
542
|
return s * Math.PI / 180;
|
|
563
543
|
}
|
|
564
|
-
function P(s, e, t, i,
|
|
565
|
-
const
|
|
566
|
-
|
|
544
|
+
function P(s, e, t, i, a, n = 0, o = v.ANIMATIONLOOPMODE_CONSTANT) {
|
|
545
|
+
const r = new De();
|
|
546
|
+
r.setEasingMode(ke.EASINGMODE_EASEINOUT);
|
|
567
547
|
const h = new v(
|
|
568
548
|
s,
|
|
569
549
|
e,
|
|
570
|
-
|
|
571
|
-
|
|
550
|
+
x,
|
|
551
|
+
a,
|
|
572
552
|
o
|
|
573
553
|
), l = [];
|
|
574
|
-
return n > 0 && l.push({ frame: 0, value: t }), l.push({ frame:
|
|
575
|
-
frame:
|
|
554
|
+
return n > 0 && l.push({ frame: 0, value: t }), l.push({ frame: x * n, value: t }), l.push({
|
|
555
|
+
frame: x * (n + 1),
|
|
576
556
|
value: i
|
|
577
|
-
}), h.setKeys(l), h.setEasingFunction(
|
|
557
|
+
}), h.setKeys(l), h.setEasingFunction(r), h;
|
|
578
558
|
}
|
|
579
|
-
function
|
|
559
|
+
function We(s, e, t) {
|
|
580
560
|
return s < e ? s = t - (e - s) % (t - e) : s = e + (s - e) % (t - e);
|
|
581
561
|
}
|
|
582
|
-
function
|
|
562
|
+
function Ye(s, e, t) {
|
|
583
563
|
s.forEach((i) => {
|
|
584
564
|
t && i.name !== t || i.goToFrame(e);
|
|
585
565
|
});
|
|
586
566
|
}
|
|
587
|
-
const
|
|
567
|
+
const Qe = {
|
|
588
568
|
albedoTexture: "albedoMap",
|
|
589
569
|
bumpTexture: "normalMap",
|
|
590
570
|
ambientTexture: "ambientMap",
|
|
@@ -594,7 +574,7 @@ const Ze = {
|
|
|
594
574
|
refractionTexture: "refractionMap",
|
|
595
575
|
reflectionTexture: "reflectionMap"
|
|
596
576
|
};
|
|
597
|
-
function
|
|
577
|
+
function $e(s, e, t, i) {
|
|
598
578
|
[
|
|
599
579
|
"albedoTexture",
|
|
600
580
|
"bumpTexture",
|
|
@@ -605,50 +585,50 @@ function je(s, e, t, i) {
|
|
|
605
585
|
"refractionTexture",
|
|
606
586
|
"reflectionTexture"
|
|
607
587
|
].forEach((n) => {
|
|
608
|
-
|
|
588
|
+
Ze(
|
|
609
589
|
n,
|
|
610
590
|
s,
|
|
611
591
|
e,
|
|
612
592
|
t,
|
|
613
593
|
i
|
|
614
594
|
);
|
|
615
|
-
}),
|
|
595
|
+
}), Je(s, e);
|
|
616
596
|
}
|
|
617
|
-
function
|
|
618
|
-
const n =
|
|
597
|
+
function Ze(s, e, t, i, a) {
|
|
598
|
+
const n = Qe[s];
|
|
619
599
|
if (!n)
|
|
620
600
|
throw new Error("Unexpected texture name encountered.");
|
|
621
|
-
const o = e[n],
|
|
622
|
-
|
|
601
|
+
const o = e[n], r = o == null ? void 0 : o.fileLink;
|
|
602
|
+
r ? s === "reflectionTexture" ? r.endsWith(".env") || r.endsWith(".dds") ? i.addCubeTextureTask(
|
|
623
603
|
s,
|
|
624
|
-
|
|
604
|
+
r,
|
|
625
605
|
void 0,
|
|
626
606
|
!1,
|
|
627
607
|
void 0,
|
|
628
608
|
!0
|
|
629
|
-
) :
|
|
609
|
+
) : r.endsWith(".hdr") ? i.addHDRCubeTextureTask(
|
|
630
610
|
s,
|
|
631
|
-
|
|
611
|
+
r,
|
|
632
612
|
128,
|
|
633
613
|
!1,
|
|
634
614
|
!0,
|
|
635
615
|
!1
|
|
636
|
-
) : i.addTextureTask(s,
|
|
616
|
+
) : i.addTextureTask(s, r, !1, !1) : i.addTextureTask(s, r, !1, !1) : a && t[s] && (t[s] && t[s].dispose(), t[s] = null, je(s, t));
|
|
637
617
|
}
|
|
638
|
-
function
|
|
618
|
+
function je(s, e) {
|
|
639
619
|
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);
|
|
640
620
|
}
|
|
641
|
-
function
|
|
621
|
+
function Xe(s, e, t, i) {
|
|
642
622
|
if (!e) {
|
|
643
623
|
console.error("Failed to apply texture to material: material is null.");
|
|
644
624
|
return;
|
|
645
625
|
}
|
|
646
626
|
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);
|
|
647
627
|
}
|
|
648
|
-
function
|
|
649
|
-
s.clearCoat && (s.clearCoat ===
|
|
628
|
+
function Je(s, e) {
|
|
629
|
+
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));
|
|
650
630
|
}
|
|
651
|
-
class
|
|
631
|
+
class et {
|
|
652
632
|
constructor(e, t, i) {
|
|
653
633
|
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;
|
|
654
634
|
}
|
|
@@ -661,27 +641,27 @@ class it {
|
|
|
661
641
|
* instead remove material textures when they aren't defined. this is useful for material editor applications
|
|
662
642
|
* where we want to undo changes are remove effects from display.
|
|
663
643
|
*/
|
|
664
|
-
async applyMaterial(e, t, i,
|
|
644
|
+
async applyMaterial(e, t, i, a) {
|
|
665
645
|
return new Promise((n) => {
|
|
666
646
|
const o = this.materialVariantMap.get(e);
|
|
667
647
|
this.materialVariantMap.set(e, {
|
|
668
648
|
...o,
|
|
669
649
|
...t
|
|
670
650
|
});
|
|
671
|
-
const
|
|
672
|
-
(c) => c.name ===
|
|
651
|
+
const r = this.renameClonedAsset(e), h = this.scene.materials.filter(
|
|
652
|
+
(c) => c.name === r
|
|
673
653
|
);
|
|
674
654
|
if (h.length === 0) {
|
|
675
655
|
n();
|
|
676
656
|
return;
|
|
677
657
|
}
|
|
678
|
-
const l = new
|
|
658
|
+
const l = new ze(this.scene);
|
|
679
659
|
l.useDefaultLoadingScreen = !1, h.forEach(
|
|
680
|
-
(c) =>
|
|
660
|
+
(c) => $e(
|
|
681
661
|
t,
|
|
682
662
|
c,
|
|
683
663
|
l,
|
|
684
|
-
|
|
664
|
+
a
|
|
685
665
|
)
|
|
686
666
|
), l.onProgress = (c, m, u) => {
|
|
687
667
|
i && i(c / m * 100, 100, u.name);
|
|
@@ -689,9 +669,9 @@ class it {
|
|
|
689
669
|
c.forEach((m) => {
|
|
690
670
|
const u = m;
|
|
691
671
|
i && i(100, 100, m.name), this.scene.materials.filter(
|
|
692
|
-
(f) => f.name ===
|
|
672
|
+
(f) => f.name === r
|
|
693
673
|
).forEach((f) => {
|
|
694
|
-
|
|
674
|
+
Xe(
|
|
695
675
|
m.name,
|
|
696
676
|
f,
|
|
697
677
|
t,
|
|
@@ -712,34 +692,34 @@ class it {
|
|
|
712
692
|
* @param getCurrentFrame A function that returns the current frame of the animation.
|
|
713
693
|
* @param getAnimationIsPlaying A function that returns whether the animation is currently playing.
|
|
714
694
|
*/
|
|
715
|
-
async applyModel(e, t, i,
|
|
695
|
+
async applyModel(e, t, i, a, n, o, r) {
|
|
716
696
|
var m;
|
|
717
697
|
if (i && t && !this.keysThatRemovedBaseModel.includes(e) && this.keysThatRemovedBaseModel.push(e), !i)
|
|
718
698
|
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(
|
|
719
699
|
(u) => u !== e
|
|
720
700
|
), Promise.resolve(void 0);
|
|
721
|
-
const l = (await
|
|
701
|
+
const l = (await D(i, this.scene, a)).instantiateModelsToScene(
|
|
722
702
|
this.renameClonedAsset,
|
|
723
703
|
!0
|
|
724
704
|
);
|
|
725
705
|
if (this.loadedContainerForKey.has(e) && (this.loadedContainerForKey.get(e).dispose(), this.loadedContainerForKey.delete(e), this.loadedMaterialsForKey.delete(e)), n) {
|
|
726
706
|
const u = o && o(), g = n.name ? this.renameClonedAsset(n.name) : void 0;
|
|
727
|
-
if (
|
|
707
|
+
if (be(
|
|
728
708
|
l.animationGroups,
|
|
729
709
|
n.loop,
|
|
730
710
|
n.to,
|
|
731
711
|
n.from,
|
|
732
712
|
g
|
|
733
713
|
), u != null) {
|
|
734
|
-
const f =
|
|
735
|
-
|
|
714
|
+
const f = r && r() || !0;
|
|
715
|
+
Ye(
|
|
736
716
|
l.animationGroups,
|
|
737
717
|
u + (f ? 2 : 0),
|
|
738
718
|
g
|
|
739
719
|
);
|
|
740
720
|
}
|
|
741
721
|
}
|
|
742
|
-
t && await this.setBaseModelEnabled(!1), this.loadedContainerForKey.set(e, l), this.loadedMaterialsForKey.set(e,
|
|
722
|
+
t && await this.setBaseModelEnabled(!1), this.loadedContainerForKey.set(e, l), this.loadedMaterialsForKey.set(e, ve(l));
|
|
743
723
|
const c = [];
|
|
744
724
|
return this.materialVariantMap.forEach(async (u, g) => {
|
|
745
725
|
c.push(this.applyMaterial(g, u));
|
|
@@ -765,18 +745,18 @@ class it {
|
|
|
765
745
|
}), e;
|
|
766
746
|
}
|
|
767
747
|
}
|
|
768
|
-
function
|
|
748
|
+
function ve(s) {
|
|
769
749
|
const e = [];
|
|
770
750
|
return s.rootNodes.forEach((t) => {
|
|
771
751
|
t.getChildMeshes().forEach((i) => {
|
|
772
|
-
i.material && !e.includes(i.material) && e.push(i.material), i.subMeshes && i.subMeshes.forEach((
|
|
773
|
-
const n =
|
|
752
|
+
i.material && !e.includes(i.material) && e.push(i.material), i.subMeshes && i.subMeshes.forEach((a) => {
|
|
753
|
+
const n = a.getMaterial(!1);
|
|
774
754
|
n && !e.includes(n) && e.push(n);
|
|
775
755
|
});
|
|
776
756
|
});
|
|
777
757
|
}), e;
|
|
778
758
|
}
|
|
779
|
-
function
|
|
759
|
+
function ge(s, e = "") {
|
|
780
760
|
return s.map((t) => ({
|
|
781
761
|
name: t.name.substring(e.length),
|
|
782
762
|
loop: t.loopAnimation,
|
|
@@ -784,36 +764,36 @@ function pe(s, e = "") {
|
|
|
784
764
|
from: t.from
|
|
785
765
|
}));
|
|
786
766
|
}
|
|
787
|
-
class
|
|
767
|
+
class tt {
|
|
788
768
|
constructor(e) {
|
|
789
769
|
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 = [];
|
|
790
770
|
const {
|
|
791
771
|
enablePicking: t,
|
|
792
772
|
modelDetails: i,
|
|
793
|
-
previewService:
|
|
773
|
+
previewService: a,
|
|
794
774
|
progressHandler: n,
|
|
795
775
|
scene: o
|
|
796
776
|
} = e;
|
|
797
|
-
this.enablePicking = t, this.contextService = i.contextService, this.id =
|
|
777
|
+
this.enablePicking = t, this.contextService = i.contextService, this.id = Ue(), this.previewService = a, this.scene = o, this.variantManager = new et(
|
|
798
778
|
o,
|
|
799
779
|
this.renameClonedAsset.bind(this),
|
|
800
780
|
this.setBaseModelEnabled.bind(this)
|
|
801
|
-
), this.transformRoot = new
|
|
802
|
-
const
|
|
781
|
+
), this.transformRoot = new Fe("root", this.scene);
|
|
782
|
+
const r = async () => {
|
|
803
783
|
if (!i.model)
|
|
804
784
|
throw new Error(
|
|
805
785
|
"Model container constructed with no URL. This is currently unsupported."
|
|
806
786
|
);
|
|
807
|
-
return this.assetContainer = await
|
|
787
|
+
return this.assetContainer = await D(
|
|
808
788
|
i.model,
|
|
809
789
|
o,
|
|
810
790
|
n
|
|
811
791
|
), await this.instantiate(), this;
|
|
812
792
|
};
|
|
813
|
-
this.importPromise =
|
|
793
|
+
this.importPromise = r();
|
|
814
794
|
}
|
|
815
795
|
//#region Interface implementation
|
|
816
|
-
async applyMaterialVariant(e, t, i,
|
|
796
|
+
async applyMaterialVariant(e, t, i, a) {
|
|
817
797
|
if (!this.initialized) {
|
|
818
798
|
if (this.materialReadyToLoadCallbacks.has(e)) {
|
|
819
799
|
const o = this.materialReadyToLoadCallbacks.get(e);
|
|
@@ -824,7 +804,7 @@ class nt {
|
|
|
824
804
|
e,
|
|
825
805
|
t,
|
|
826
806
|
i,
|
|
827
|
-
|
|
807
|
+
a
|
|
828
808
|
)
|
|
829
809
|
);
|
|
830
810
|
} else {
|
|
@@ -840,7 +820,7 @@ class nt {
|
|
|
840
820
|
e,
|
|
841
821
|
t,
|
|
842
822
|
i,
|
|
843
|
-
|
|
823
|
+
a
|
|
844
824
|
)
|
|
845
825
|
);
|
|
846
826
|
}
|
|
@@ -850,14 +830,14 @@ class nt {
|
|
|
850
830
|
await this.variantManager.applyMaterial(
|
|
851
831
|
e,
|
|
852
832
|
i,
|
|
853
|
-
(o,
|
|
833
|
+
(o, r, h) => {
|
|
854
834
|
this.materialVariantObservable.notifyObservers({
|
|
855
835
|
remainingCount: o,
|
|
856
|
-
totalCount:
|
|
836
|
+
totalCount: r,
|
|
857
837
|
taskName: h
|
|
858
838
|
});
|
|
859
839
|
},
|
|
860
|
-
|
|
840
|
+
a
|
|
861
841
|
);
|
|
862
842
|
};
|
|
863
843
|
if (this.materialChangesInProgress.includes(e)) {
|
|
@@ -878,8 +858,8 @@ class nt {
|
|
|
878
858
|
const o = this.queuedMaterialChanges.get(e);
|
|
879
859
|
if (!o)
|
|
880
860
|
throw new Error("Target material is undefined");
|
|
881
|
-
o.forEach(async (
|
|
882
|
-
await
|
|
861
|
+
o.forEach(async (r) => {
|
|
862
|
+
await r();
|
|
883
863
|
}), this.queuedMaterialChanges.delete(e);
|
|
884
864
|
}
|
|
885
865
|
this.materialChangesInProgress.splice(
|
|
@@ -900,13 +880,13 @@ class nt {
|
|
|
900
880
|
);
|
|
901
881
|
return;
|
|
902
882
|
}
|
|
903
|
-
const
|
|
883
|
+
const a = () => this.variantManager.applyModel(
|
|
904
884
|
e,
|
|
905
885
|
i,
|
|
906
886
|
t == null ? void 0 : t.model,
|
|
907
|
-
(
|
|
887
|
+
(r) => {
|
|
908
888
|
this.modelVariantObservable.notifyObservers({
|
|
909
|
-
...
|
|
889
|
+
...r,
|
|
910
890
|
key: e
|
|
911
891
|
});
|
|
912
892
|
},
|
|
@@ -915,22 +895,22 @@ class nt {
|
|
|
915
895
|
this.getAnimationIsPlaying.bind(this)
|
|
916
896
|
);
|
|
917
897
|
if (this.modelChangesInProgress.includes(e)) {
|
|
918
|
-
this.queuedModelChanges.set(e,
|
|
898
|
+
this.queuedModelChanges.set(e, a);
|
|
919
899
|
return;
|
|
920
900
|
}
|
|
921
901
|
const o = await (async () => {
|
|
922
902
|
this.modelChangesInProgress.push(e);
|
|
923
|
-
let
|
|
903
|
+
let r = await a();
|
|
924
904
|
if (this.queuedModelChanges.has(e)) {
|
|
925
905
|
const h = this.queuedModelChanges.get(e);
|
|
926
906
|
if (!h)
|
|
927
907
|
throw new Error("Queued change resolved undefined");
|
|
928
|
-
|
|
908
|
+
r = await h(), this.queuedModelChanges.delete(e);
|
|
929
909
|
}
|
|
930
910
|
return this.modelChangesInProgress.splice(
|
|
931
911
|
this.modelChangesInProgress.indexOf(e),
|
|
932
912
|
1
|
|
933
|
-
),
|
|
913
|
+
), r;
|
|
934
914
|
})();
|
|
935
915
|
this.contextService || (this.contextService = t == null ? void 0 : t.contextService), o ? this.configureModelInstance(o) : this.configureGlowLayer();
|
|
936
916
|
}
|
|
@@ -944,34 +924,34 @@ class nt {
|
|
|
944
924
|
let t = () => {
|
|
945
925
|
};
|
|
946
926
|
const i = async () => {
|
|
947
|
-
this.lastPlayedAnimation = e, this.isExecutingAnimation = !0, await new Promise((
|
|
927
|
+
this.lastPlayedAnimation = e, this.isExecutingAnimation = !0, await new Promise((a) => {
|
|
948
928
|
var o;
|
|
949
929
|
const n = [
|
|
950
930
|
...((o = this.modelInstance) == null ? void 0 : o.animationGroups) || [],
|
|
951
931
|
...this.variantManager.getAnimationGroups()
|
|
952
932
|
];
|
|
953
|
-
|
|
933
|
+
be(
|
|
954
934
|
n,
|
|
955
935
|
e.loop,
|
|
956
936
|
e.to,
|
|
957
937
|
e.from,
|
|
958
938
|
e.name ? this.renameClonedAsset(e.name) : void 0,
|
|
959
|
-
|
|
939
|
+
a
|
|
960
940
|
);
|
|
961
941
|
}), this.isExecutingAnimation = !1, this.queuedAnimationFunction && this.queuedAnimationFunction(), this.queuedAnimationFunction = void 0, t();
|
|
962
942
|
};
|
|
963
|
-
return this.isExecutingAnimation ? (this.queuedAnimationFunction = i, new Promise((
|
|
964
|
-
t =
|
|
943
|
+
return this.isExecutingAnimation ? (this.queuedAnimationFunction = i, new Promise((a) => {
|
|
944
|
+
t = a;
|
|
965
945
|
})) : i();
|
|
966
946
|
}
|
|
967
947
|
getAnimations(e) {
|
|
968
948
|
return [
|
|
969
949
|
...this.animations,
|
|
970
|
-
...e ?
|
|
950
|
+
...e ? ge(
|
|
971
951
|
this.variantManager.getAnimationGroups(),
|
|
972
952
|
this.renameClonedAsset("")
|
|
973
953
|
) : []
|
|
974
|
-
].map((t, i) => ({ ...t, name: t.name || `UNNAMED_ANIMATION_${i}` })).filter((t, i,
|
|
954
|
+
].map((t, i) => ({ ...t, name: t.name || `UNNAMED_ANIMATION_${i}` })).filter((t, i, a) => a.indexOf(a.find((n) => n.name === t.name)) == i);
|
|
975
955
|
}
|
|
976
956
|
getId() {
|
|
977
957
|
return this.id;
|
|
@@ -1017,7 +997,7 @@ class nt {
|
|
|
1017
997
|
set rotation(e) {
|
|
1018
998
|
if (!this.transformRoot)
|
|
1019
999
|
throw new Error("ModelContainer disposed prior to setting rotation!");
|
|
1020
|
-
this.transformRoot.rotationQuaternion =
|
|
1000
|
+
this.transformRoot.rotationQuaternion = A.FromEulerAngles(
|
|
1021
1001
|
e.x,
|
|
1022
1002
|
e.y,
|
|
1023
1003
|
e.z
|
|
@@ -1039,14 +1019,14 @@ class nt {
|
|
|
1039
1019
|
e.rootNodes.forEach((t) => {
|
|
1040
1020
|
t.getChildMeshes(!1).forEach((i) => {
|
|
1041
1021
|
i.name === "targetcube_t" || i.name === "backgroundShell" || (i.actionManager || (i.actionManager = new R(this.scene)), i.actionManager.registerAction(
|
|
1042
|
-
new
|
|
1043
|
-
|
|
1022
|
+
new oe(R.OnPointerOverTrigger, (a) => {
|
|
1023
|
+
a.meshUnderPointer && i.material && this.materialSelectedObservable.notifyObservers({
|
|
1044
1024
|
id: i.material.id,
|
|
1045
1025
|
name: this.stripIdFromName(i.material.name)
|
|
1046
1026
|
});
|
|
1047
1027
|
})
|
|
1048
1028
|
), i.actionManager.registerAction(
|
|
1049
|
-
new
|
|
1029
|
+
new oe(R.OnPointerOutTrigger, () => {
|
|
1050
1030
|
i.material && this.materialDeselectedObservable.notifyObservers({
|
|
1051
1031
|
id: i.material.id,
|
|
1052
1032
|
name: this.stripIdFromName(i.material.name)
|
|
@@ -1075,7 +1055,7 @@ class nt {
|
|
|
1075
1055
|
return this.modelReadyToLoadCallbacks.size;
|
|
1076
1056
|
}
|
|
1077
1057
|
configureGlowLayer() {
|
|
1078
|
-
const e = (i) => i instanceof
|
|
1058
|
+
const e = (i) => i instanceof B && i.emissiveTexture !== null;
|
|
1079
1059
|
this.materials.some(e) || this.variantManager.getAllMaterials().some(e) ? this.previewService.getGlowLayerManager().includeMeshes(this.getAllMeshes()) : this.previewService.getGlowLayerManager().removeMeshes(this.getAllMeshes());
|
|
1080
1060
|
}
|
|
1081
1061
|
configureModelInstance(e) {
|
|
@@ -1084,14 +1064,14 @@ class nt {
|
|
|
1084
1064
|
throw new Error(
|
|
1085
1065
|
"Transform disposed! This should never happen unless there is a race condition present!"
|
|
1086
1066
|
);
|
|
1087
|
-
const t = this.transformRoot.position, i = this.transformRoot.rotationQuaternion,
|
|
1088
|
-
this.transformRoot.position = p.Zero(), this.transformRoot.rotationQuaternion =
|
|
1067
|
+
const t = this.transformRoot.position, i = this.transformRoot.rotationQuaternion, a = this.transformRoot.scaling;
|
|
1068
|
+
this.transformRoot.position = p.Zero(), this.transformRoot.rotationQuaternion = A.Identity(), this.transformRoot.scaling = p.One();
|
|
1089
1069
|
for (const o of e.rootNodes) {
|
|
1090
1070
|
o.parent = this.transformRoot;
|
|
1091
|
-
for (const
|
|
1092
|
-
|
|
1071
|
+
for (const r of o.getChildMeshes(!1))
|
|
1072
|
+
r.alwaysSelectAsActiveMesh = !0;
|
|
1093
1073
|
}
|
|
1094
|
-
this.transformRoot.position = t, this.transformRoot.rotationQuaternion = i, this.transformRoot.scaling =
|
|
1074
|
+
this.transformRoot.position = t, this.transformRoot.rotationQuaternion = i, this.transformRoot.scaling = a, this.canvasPanels = ((n = this.contextService) == null ? void 0 : n.getAll()) || /* @__PURE__ */ new Map(), Ge(
|
|
1095
1075
|
this.materials.concat(this.variantManager.getAllMaterials()),
|
|
1096
1076
|
this.scene,
|
|
1097
1077
|
this.canvasPanels,
|
|
@@ -1109,7 +1089,7 @@ class nt {
|
|
|
1109
1089
|
getAllMeshes() {
|
|
1110
1090
|
var e;
|
|
1111
1091
|
return (e = this.modelInstance) == null ? void 0 : e.rootNodes.map(
|
|
1112
|
-
(t) => t.getChildMeshes(!1).filter((i) => i instanceof
|
|
1092
|
+
(t) => t.getChildMeshes(!1).filter((i) => i instanceof Ie)
|
|
1113
1093
|
).flat();
|
|
1114
1094
|
}
|
|
1115
1095
|
async instantiate() {
|
|
@@ -1120,7 +1100,7 @@ class nt {
|
|
|
1120
1100
|
this.modelInstance = this.assetContainer.instantiateModelsToScene(
|
|
1121
1101
|
this.renameClonedAsset.bind(this),
|
|
1122
1102
|
!0
|
|
1123
|
-
), this.materials =
|
|
1103
|
+
), this.materials = ve(this.modelInstance), this.configureModelInstance(this.modelInstance), this.animations = ge(
|
|
1124
1104
|
this.modelInstance.animationGroups,
|
|
1125
1105
|
this.renameClonedAsset("")
|
|
1126
1106
|
), this.initialized = !0, await this.processQueuedEvents();
|
|
@@ -1135,8 +1115,8 @@ class nt {
|
|
|
1135
1115
|
var e;
|
|
1136
1116
|
(e = this.canvasPanels) == null || e.forEach(
|
|
1137
1117
|
(t, i) => {
|
|
1138
|
-
const
|
|
1139
|
-
|
|
1118
|
+
const a = this.dynamicTextures.get(i);
|
|
1119
|
+
a && t.getStaticContextDirty() && a.isReady() && (a.update(!1), t.setStaticContextDirty(!1));
|
|
1140
1120
|
}
|
|
1141
1121
|
);
|
|
1142
1122
|
}
|
|
@@ -1194,18 +1174,18 @@ class nt {
|
|
|
1194
1174
|
}
|
|
1195
1175
|
//#endregion
|
|
1196
1176
|
}
|
|
1197
|
-
class
|
|
1198
|
-
constructor(e, t, i,
|
|
1177
|
+
class k extends pe {
|
|
1178
|
+
constructor(e, t, i, a, n, o, r, h) {
|
|
1199
1179
|
super(
|
|
1200
1180
|
e,
|
|
1201
1181
|
t,
|
|
1202
1182
|
i,
|
|
1203
|
-
|
|
1183
|
+
a,
|
|
1204
1184
|
n,
|
|
1205
1185
|
o,
|
|
1206
1186
|
h
|
|
1207
|
-
), 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,
|
|
1208
|
-
|
|
1187
|
+
), 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, r.camera.autoOrientation && (this.alpha += Math.PI), r && (r.camera.limits.min.beta && (this.lowerBetaLimit = r.camera.limits.min.beta), r.camera.limits.max.beta && (this.upperBetaLimit = r.camera.limits.max.beta), r.camera.limits.min.alpha && (this.lowerAlphaLimit = r.camera.limits.min.alpha), r.camera.limits.max.alpha && (this.upperAlphaLimit = r.camera.limits.max.alpha), r.camera.limits.min.radius && (this.lowerRadiusLimit = r.camera.limits.min.radius), r.camera.limits.max.radius && (this.upperRadiusLimit = r.camera.limits.max.radius), r.camera.autoRotation.enabled && this.enableAutoRotationBehavior(
|
|
1188
|
+
r.camera.autoRotation.idleTimeMs
|
|
1209
1189
|
));
|
|
1210
1190
|
}
|
|
1211
1191
|
updateConfiguration(e) {
|
|
@@ -1245,7 +1225,7 @@ class z extends fe {
|
|
|
1245
1225
|
this.useFramingBehavior = !0;
|
|
1246
1226
|
const e = this.getFramingBehavior();
|
|
1247
1227
|
e.attach(this), e.framingTime = 0, e.elevationReturnTime = -1, e.zoomStopsAnimation = !1, this.lowerRadiusLimit = null;
|
|
1248
|
-
const t =
|
|
1228
|
+
const t = T(this._scene);
|
|
1249
1229
|
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;
|
|
1250
1230
|
}
|
|
1251
1231
|
/**
|
|
@@ -1257,14 +1237,14 @@ class z extends fe {
|
|
|
1257
1237
|
this._isRunningFramingBehavior = !0, this.framingBehaviourCallback = e;
|
|
1258
1238
|
const i = this.getFramingBehavior();
|
|
1259
1239
|
i.framingTime = t || 800;
|
|
1260
|
-
const
|
|
1240
|
+
const a = () => {
|
|
1261
1241
|
this.isRunningFramingBehavior = !1;
|
|
1262
|
-
}, n =
|
|
1263
|
-
this.updateRadiusBounds(o.length() * 1.5), this.wheelPrecision = 100 / this.radius, this.panningInertia = 0, this.panningOriginTarget.copyFrom(
|
|
1242
|
+
}, n = T(this._scene), o = n.max.subtract(n.min), r = n.min.add(o.scale(0.5));
|
|
1243
|
+
this.updateRadiusBounds(o.length() * 1.5), this.wheelPrecision = 100 / this.radius, this.panningInertia = 0, this.panningOriginTarget.copyFrom(r), this.panDenominator = o.length(), this.lastFocus.copyFrom(r), i.zoomOnBoundingInfo(
|
|
1264
1244
|
n.min,
|
|
1265
1245
|
n.max,
|
|
1266
1246
|
void 0,
|
|
1267
|
-
|
|
1247
|
+
a
|
|
1268
1248
|
), i.framingTime = 0;
|
|
1269
1249
|
}
|
|
1270
1250
|
/**
|
|
@@ -1296,7 +1276,7 @@ class z extends fe {
|
|
|
1296
1276
|
*/
|
|
1297
1277
|
static create(e, t, i) {
|
|
1298
1278
|
var h;
|
|
1299
|
-
const
|
|
1279
|
+
const a = T(e), n = a.max.subtract(a.min), o = a.min.add(n.scale(0.5)), r = new k(
|
|
1300
1280
|
"ProductCamera",
|
|
1301
1281
|
-(Math.PI / 2),
|
|
1302
1282
|
Math.PI / 2,
|
|
@@ -1305,14 +1285,14 @@ class z extends fe {
|
|
|
1305
1285
|
e,
|
|
1306
1286
|
t
|
|
1307
1287
|
);
|
|
1308
|
-
return
|
|
1288
|
+
return r.setPanEnabled(
|
|
1309
1289
|
((h = t.options) == null ? void 0 : h.noPan) !== void 0 ? !t.options.noPan : !0
|
|
1310
|
-
),
|
|
1311
|
-
|
|
1312
|
-
}), i && (e.activeCamera =
|
|
1290
|
+
), r.panningInertia = 0, r.panningOriginTarget.copyFrom(o), r.panDenominator = n.length(), r.onAfterCheckInputsObservable.addOnce(() => {
|
|
1291
|
+
r.setPanEnabled(r.panEnabled);
|
|
1292
|
+
}), i && (e.activeCamera = r), r;
|
|
1313
1293
|
}
|
|
1314
1294
|
}
|
|
1315
|
-
function
|
|
1295
|
+
function T(s) {
|
|
1316
1296
|
if (s.meshes.length === 0)
|
|
1317
1297
|
return {
|
|
1318
1298
|
min: new p(-1, -1, -1),
|
|
@@ -1321,9 +1301,9 @@ function O(s) {
|
|
|
1321
1301
|
const e = s.meshes.filter((t) => t.name.toLowerCase().endsWith("_t") || t.name.toLowerCase().includes("_t_"));
|
|
1322
1302
|
return s.getWorldExtends((t) => t.isVisible && t.isEnabled() && (e.length === 0 || e.includes(t)));
|
|
1323
1303
|
}
|
|
1324
|
-
class
|
|
1304
|
+
class it {
|
|
1325
1305
|
constructor(e, t = !1, i = void 0) {
|
|
1326
|
-
this.renderingPipeline = new
|
|
1306
|
+
this.renderingPipeline = new Ne(
|
|
1327
1307
|
"default",
|
|
1328
1308
|
t,
|
|
1329
1309
|
e,
|
|
@@ -1339,15 +1319,15 @@ class st {
|
|
|
1339
1319
|
return this.currentConfiguration;
|
|
1340
1320
|
}
|
|
1341
1321
|
setConfiguration(e) {
|
|
1342
|
-
var t, i,
|
|
1322
|
+
var t, i, a, n, o, r, 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;
|
|
1343
1323
|
if (this.renderingPipeline.isSupported) {
|
|
1344
|
-
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 = ((
|
|
1324
|
+
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 = ((a = e.bloom) == null ? void 0 : a.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 = ((r = e.bloom) == null ? void 0 : r.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(
|
|
1345
1325
|
e.chromaticAberration.direction.x,
|
|
1346
1326
|
e.chromaticAberration.direction.y
|
|
1347
|
-
) : new
|
|
1327
|
+
) : new se(
|
|
1348
1328
|
d.chromaticAberration.direction.x,
|
|
1349
1329
|
d.chromaticAberration.direction.y
|
|
1350
|
-
), 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
|
|
1330
|
+
), 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)
|
|
1351
1331
|
switch (e.depthOfField.blurLevel ?? d.depthOfField.blurLevel) {
|
|
1352
1332
|
case "Low":
|
|
1353
1333
|
this.renderingPipeline.depthOfFieldBlurLevel = E.Low;
|
|
@@ -1359,58 +1339,58 @@ class st {
|
|
|
1359
1339
|
this.renderingPipeline.depthOfFieldBlurLevel = E.High;
|
|
1360
1340
|
break;
|
|
1361
1341
|
}
|
|
1362
|
-
if (this.renderingPipeline.depthOfField.focalLength = ((
|
|
1342
|
+
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)
|
|
1363
1343
|
switch (e.misc.toneMappingType ?? d.misc.toneMappingType) {
|
|
1364
1344
|
case "Standard":
|
|
1365
|
-
this.renderingPipeline.imageProcessing.toneMappingType =
|
|
1345
|
+
this.renderingPipeline.imageProcessing.toneMappingType = M.TONEMAPPING_STANDARD;
|
|
1366
1346
|
break;
|
|
1367
1347
|
case "ACES":
|
|
1368
|
-
this.renderingPipeline.imageProcessing.toneMappingType =
|
|
1348
|
+
this.renderingPipeline.imageProcessing.toneMappingType = M.TONEMAPPING_ACES;
|
|
1369
1349
|
break;
|
|
1370
1350
|
}
|
|
1371
|
-
if (this.renderingPipeline.sharpenEnabled = ((
|
|
1372
|
-
switch (((
|
|
1351
|
+
if (this.renderingPipeline.sharpenEnabled = ((Y = e.sharpen) == null ? void 0 : Y.enabled) ?? d.sharpen.enabled, this.renderingPipeline.sharpen.colorAmount = ((Q = e.sharpen) == null ? void 0 : Q.colorAmount) ?? d.sharpen.colorAmount, this.renderingPipeline.sharpen.edgeAmount = (($ = e.sharpen) == null ? void 0 : $.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)
|
|
1352
|
+
switch (((X = e.vignette) == null ? void 0 : X.blendMode) ?? d.vignette.blendMode) {
|
|
1373
1353
|
case "Multiply":
|
|
1374
|
-
this.renderingPipeline.imageProcessing.vignetteBlendMode =
|
|
1354
|
+
this.renderingPipeline.imageProcessing.vignetteBlendMode = M.VIGNETTEMODE_MULTIPLY;
|
|
1375
1355
|
break;
|
|
1376
1356
|
case "Opaque":
|
|
1377
|
-
this.renderingPipeline.imageProcessing.vignetteBlendMode =
|
|
1357
|
+
this.renderingPipeline.imageProcessing.vignetteBlendMode = M.VIGNETTEMODE_OPAQUE;
|
|
1378
1358
|
break;
|
|
1379
1359
|
}
|
|
1380
|
-
(
|
|
1360
|
+
(J = e.vignette) != null && J.colorRgba ? this.renderingPipeline.imageProcessing.vignetteColor = new b(
|
|
1381
1361
|
e.vignette.colorRgba.r,
|
|
1382
1362
|
e.vignette.colorRgba.g,
|
|
1383
1363
|
e.vignette.colorRgba.b,
|
|
1384
1364
|
e.vignette.colorRgba.a
|
|
1385
|
-
) : (
|
|
1365
|
+
) : (ee = e.vignette) != null && ee.colorHex ? this.renderingPipeline.imageProcessing.vignetteColor = b.FromHexString(e.vignette.colorHex) : this.renderingPipeline.imageProcessing.vignetteColor = new b(
|
|
1386
1366
|
d.vignette.colorRgba.r,
|
|
1387
1367
|
d.vignette.colorRgba.g,
|
|
1388
1368
|
d.vignette.colorRgba.b,
|
|
1389
1369
|
d.vignette.colorRgba.a
|
|
1390
|
-
), this.renderingPipeline.imageProcessing.vignetteStretch = ((
|
|
1370
|
+
), this.renderingPipeline.imageProcessing.vignetteStretch = ((te = e.vignette) == null ? void 0 : te.stretch) ?? d.vignette.stretch, this.renderingPipeline.imageProcessing.vignetteWeight = ((ie = e.vignette) == null ? void 0 : ie.weight) ?? d.vignette.weight, this.renderingPipeline.prepare(), this.currentConfiguration = e;
|
|
1391
1371
|
}
|
|
1392
1372
|
}
|
|
1393
1373
|
updateColorCurve(e) {
|
|
1394
|
-
const t = new
|
|
1374
|
+
const t = new le();
|
|
1395
1375
|
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;
|
|
1396
1376
|
}
|
|
1397
1377
|
}
|
|
1398
|
-
|
|
1399
|
-
return new
|
|
1378
|
+
Me.GLTFLoader.RegisterExtension("glbPostProcessor", function(s) {
|
|
1379
|
+
return new Ve(s);
|
|
1400
1380
|
});
|
|
1401
|
-
|
|
1381
|
+
S.OnPluginActivatedObservable.add((s) => {
|
|
1402
1382
|
if (s.name === "gltf") {
|
|
1403
1383
|
const e = s;
|
|
1404
1384
|
e.transparencyAsCoverage = !0;
|
|
1405
1385
|
}
|
|
1406
1386
|
});
|
|
1407
|
-
function
|
|
1387
|
+
function O(s) {
|
|
1408
1388
|
return new p(s.x, s.y, s.z);
|
|
1409
1389
|
}
|
|
1410
|
-
function
|
|
1390
|
+
function L(s) {
|
|
1411
1391
|
return { x: s.x, y: s.y, z: s.z };
|
|
1412
1392
|
}
|
|
1413
|
-
class
|
|
1393
|
+
class Kt {
|
|
1414
1394
|
constructor(e) {
|
|
1415
1395
|
var h;
|
|
1416
1396
|
this.focusLostNotified = !1, this.focusLostObservable = new C(), this.modelLoadEventCallbacks = [], this.modelContainers = /* @__PURE__ */ new Map(), this.plugins = [], this.initComplete = !1, this.isAnimatingCamera = !1, this.renderLoop = () => {
|
|
@@ -1433,22 +1413,22 @@ class Yt {
|
|
|
1433
1413
|
this.scene.render(), this.camera.isRunningFramingBehavior && this.camera.getFramingBehavior().isUserIsMoving && (this.camera.isRunningFramingBehavior = !1);
|
|
1434
1414
|
const c = Math.max((this.camera.lowerRadiusLimit ?? 1) * 0.01, 1e-3);
|
|
1435
1415
|
!this.camera.isRunningFramingBehavior && !this.camera.target.equalsWithEpsilon(this.camera.lastFocus, c) && !this.focusLostNotified && (this.focusLostObservable.notifyObservers(void 0), this.focusLostNotified = !0), this.screenshotPrepareResolve && (this.screenshotPrepareResolve(), this.screenshotPrepareResolve = void 0);
|
|
1436
|
-
}, this.configuration = new
|
|
1416
|
+
}, this.configuration = new he(e);
|
|
1437
1417
|
const i = (() => {
|
|
1438
1418
|
if (!(e != null && e.noRender))
|
|
1439
1419
|
return this.configuration.createCanvas();
|
|
1440
|
-
})(),
|
|
1441
|
-
|
|
1420
|
+
})(), a = "1.5.6";
|
|
1421
|
+
Ae.Configuration = {
|
|
1442
1422
|
decoder: {
|
|
1443
|
-
wasmUrl: `https://www.gstatic.com/draco/versioned/decoders/${
|
|
1444
|
-
wasmBinaryUrl: `https://www.gstatic.com/draco/versioned/decoders/${
|
|
1445
|
-
fallbackUrl: `https://www.gstatic.com/draco/versioned/decoders/${
|
|
1423
|
+
wasmUrl: `https://www.gstatic.com/draco/versioned/decoders/${a}/draco_wasm_wrapper_gltf.js`,
|
|
1424
|
+
wasmBinaryUrl: `https://www.gstatic.com/draco/versioned/decoders/${a}/draco_decoder_gltf.wasm`,
|
|
1425
|
+
fallbackUrl: `https://www.gstatic.com/draco/versioned/decoders/${a}/draco_decoder_gltf.js`
|
|
1446
1426
|
}
|
|
1447
1427
|
}, i && (i.getContext("webgl2") || i.getContext("webgl"));
|
|
1448
1428
|
const n = console.log;
|
|
1449
1429
|
console.log = () => {
|
|
1450
1430
|
};
|
|
1451
|
-
const o = i ? new
|
|
1431
|
+
const o = i ? new fe(i, !0, {
|
|
1452
1432
|
adaptToDeviceRatio: !0,
|
|
1453
1433
|
limitDeviceRatio: 2,
|
|
1454
1434
|
premultipliedAlpha: !1,
|
|
@@ -1456,19 +1436,19 @@ class Yt {
|
|
|
1456
1436
|
audioEngine: !1,
|
|
1457
1437
|
stencil: this.configuration.highlights.enabled,
|
|
1458
1438
|
forceSRGBBufferSupportState: !0
|
|
1459
|
-
}) : new
|
|
1460
|
-
console.log = n, o.hideLoadingUI(), window.addEventListener("resize", this.fireResizeEvent.bind(this)), this.engine = o, this.scene = new
|
|
1439
|
+
}) : new we();
|
|
1440
|
+
console.log = n, o.hideLoadingUI(), window.addEventListener("resize", this.fireResizeEvent.bind(this)), this.engine = o, this.scene = new ye(o), this.camera = k.create(this.scene, this.configuration), this.scene.activeCamera = this.camera, this.renderingPipeline = new it(
|
|
1461
1441
|
this.scene,
|
|
1462
1442
|
!1,
|
|
1463
1443
|
this.camera
|
|
1464
1444
|
), this.scene.clearColor = this.configuration.scene.clearColor;
|
|
1465
|
-
const
|
|
1445
|
+
const r = ne.CreateFromPrefilteredData(
|
|
1466
1446
|
this.configuration.scene.environment.file,
|
|
1467
1447
|
this.scene
|
|
1468
1448
|
);
|
|
1469
|
-
|
|
1449
|
+
r.name = "initial-environment-cube", r.rotationY = this.configuration.scene.environment.rotationY, this.scene.environmentTexture = r, this.scene.environmentIntensity = this.configuration.scene.environment.intensity, (h = this.configuration.options) != null && h.renderingPipelineConfiguration ? this.renderingPipeline.setConfiguration(
|
|
1470
1450
|
this.configuration.options.renderingPipelineConfiguration
|
|
1471
|
-
) : (this.scene.imageProcessingConfiguration.exposure = this.configuration.lighting.exposure, this.scene.imageProcessingConfiguration.contrast = this.configuration.lighting.contrast), this.glowLayerManager = new
|
|
1451
|
+
) : (this.scene.imageProcessingConfiguration.exposure = this.configuration.lighting.exposure, this.scene.imageProcessingConfiguration.contrast = this.configuration.lighting.contrast), this.glowLayerManager = new _e(
|
|
1472
1452
|
this.scene,
|
|
1473
1453
|
this.configuration.emissiveGlowIntensity
|
|
1474
1454
|
), this.initPromise = new Promise((l) => {
|
|
@@ -1505,7 +1485,7 @@ class Yt {
|
|
|
1505
1485
|
}
|
|
1506
1486
|
registerView(e) {
|
|
1507
1487
|
const t = e.height, i = e.width;
|
|
1508
|
-
this.engine.registerView(e, void 0, !0), e.setAttribute("height", t.toString()), e.setAttribute("width", i.toString()), this.orbitEnabled() || this.setCameraState(
|
|
1488
|
+
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);
|
|
1509
1489
|
}
|
|
1510
1490
|
getNumViewports() {
|
|
1511
1491
|
var e;
|
|
@@ -1518,19 +1498,19 @@ class Yt {
|
|
|
1518
1498
|
this.plugins.forEach((e) => e.dispose(!0)), this.renderingPipeline.dispose(), this.engine && this.engine.dispose(), window.removeEventListener("resize", this.fireResizeEvent);
|
|
1519
1499
|
}
|
|
1520
1500
|
executeCameraAnimation(e) {
|
|
1521
|
-
if (!this.camera || this.scene.activeCamera !== this.camera || this.getAllModels().length === 0 || !this.getAllModels().some((
|
|
1501
|
+
if (!this.camera || this.scene.activeCamera !== this.camera || this.getAllModels().length === 0 || !this.getAllModels().some((a) => a.getIsInitialized()))
|
|
1522
1502
|
return this.queuedCameraAnimation = e, Promise.resolve();
|
|
1523
1503
|
let t = () => {
|
|
1524
1504
|
};
|
|
1525
1505
|
const i = async () => {
|
|
1526
|
-
this.isAnimatingCamera = !0, await
|
|
1506
|
+
this.isAnimatingCamera = !0, await Ke(
|
|
1527
1507
|
this.scene,
|
|
1528
1508
|
this.scene.activeCamera,
|
|
1529
1509
|
e
|
|
1530
1510
|
), this.isAnimatingCamera = !1, this.queuedAnimationFunction && this.queuedAnimationFunction(), this.queuedAnimationFunction = void 0, t();
|
|
1531
1511
|
};
|
|
1532
|
-
return this.isAnimatingCamera ? (this.queuedAnimationFunction = i, new Promise((
|
|
1533
|
-
t =
|
|
1512
|
+
return this.isAnimatingCamera ? (this.queuedAnimationFunction = i, new Promise((a) => {
|
|
1513
|
+
t = a;
|
|
1534
1514
|
})) : i();
|
|
1535
1515
|
}
|
|
1536
1516
|
getCameraPose() {
|
|
@@ -1559,7 +1539,7 @@ class Yt {
|
|
|
1559
1539
|
throw new Error(
|
|
1560
1540
|
"No views attached, camera state requires a view to attach controls onto."
|
|
1561
1541
|
);
|
|
1562
|
-
e ===
|
|
1542
|
+
e === I.Orbit ? this.reattachControls(this.engine.views[0].target, 2) : this.reattachControls(this.engine.views[0].target, 0);
|
|
1563
1543
|
}
|
|
1564
1544
|
animateToLastCameraFocus() {
|
|
1565
1545
|
let e = () => {
|
|
@@ -1567,13 +1547,13 @@ class Yt {
|
|
|
1567
1547
|
const t = async () => {
|
|
1568
1548
|
this.isAnimatingCamera = !0, await new Promise((i) => {
|
|
1569
1549
|
this.focusLostNotified = !1;
|
|
1570
|
-
const
|
|
1550
|
+
const a = () => {
|
|
1571
1551
|
const n = this.configuration;
|
|
1572
1552
|
this.camera.rerunFramingBehavior(() => {
|
|
1573
1553
|
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();
|
|
1574
1554
|
});
|
|
1575
1555
|
};
|
|
1576
|
-
this.scene.onAfterRenderObservable.addOnce(
|
|
1556
|
+
this.scene.onAfterRenderObservable.addOnce(a);
|
|
1577
1557
|
}), this.isAnimatingCamera = !1, this.queuedAnimationFunction && this.queuedAnimationFunction(), this.queuedAnimationFunction = void 0, e();
|
|
1578
1558
|
};
|
|
1579
1559
|
return this.isAnimatingCamera ? (this.queuedAnimationFunction = t, new Promise((i) => {
|
|
@@ -1595,7 +1575,7 @@ class Yt {
|
|
|
1595
1575
|
async renderSceneScreenshot(e, t) {
|
|
1596
1576
|
if (!this.camera)
|
|
1597
1577
|
throw new Error("Missing product camera, cannot render screenshot!");
|
|
1598
|
-
const i = new
|
|
1578
|
+
const i = new pe(
|
|
1599
1579
|
"screenshotCamera",
|
|
1600
1580
|
0,
|
|
1601
1581
|
0,
|
|
@@ -1604,9 +1584,9 @@ class Yt {
|
|
|
1604
1584
|
this.scene
|
|
1605
1585
|
);
|
|
1606
1586
|
try {
|
|
1607
|
-
const
|
|
1608
|
-
i.target = t.target ? new p(t.target.x, t.target.y, t.target.z) : p.Zero(), i.alpha = n, i.beta =
|
|
1609
|
-
const o = await
|
|
1587
|
+
const a = t.latDeg * Math.PI / 180, n = t.lonDeg * Math.PI / 180;
|
|
1588
|
+
i.target = t.target ? new p(t.target.x, t.target.y, t.target.z) : p.Zero(), i.alpha = n, i.beta = a, i.radius = t.radius || this.camera.radius, i.minZ = 0.01, this.scene.render();
|
|
1589
|
+
const o = await xe.CreateScreenshotUsingRenderTargetAsync(
|
|
1610
1590
|
this.engine,
|
|
1611
1591
|
i,
|
|
1612
1592
|
e,
|
|
@@ -1623,18 +1603,18 @@ class Yt {
|
|
|
1623
1603
|
const e = this.configuration;
|
|
1624
1604
|
if (!e)
|
|
1625
1605
|
return !0;
|
|
1626
|
-
const t = e.camera.limits.min.alpha, i = e.camera.limits.max.alpha,
|
|
1627
|
-
if (t === void 0 || i === void 0 ||
|
|
1606
|
+
const t = e.camera.limits.min.alpha, i = e.camera.limits.max.alpha, a = e.camera.limits.min.beta, n = e.camera.limits.max.beta;
|
|
1607
|
+
if (t === void 0 || i === void 0 || a === void 0 || n === void 0)
|
|
1628
1608
|
return !0;
|
|
1629
|
-
const o = [t, i],
|
|
1609
|
+
const o = [t, i], r = [a, n], h = o.every((c) => c === t), l = r.every((c) => c === a);
|
|
1630
1610
|
return !h && !l;
|
|
1631
1611
|
}
|
|
1632
1612
|
fireResizeEvent() {
|
|
1633
1613
|
this.getNumViewports() > 0 && this.engine.resize();
|
|
1634
1614
|
}
|
|
1635
1615
|
setHighlights(e, t) {
|
|
1636
|
-
var
|
|
1637
|
-
e.length === 0 && ((
|
|
1616
|
+
var a;
|
|
1617
|
+
e.length === 0 && ((a = this.highlightLayer) == null || a.dispose(), this.highlightLayer = void 0), this.highlightLayer || (this.highlightLayer = new Ce("highlights", this.scene, {
|
|
1638
1618
|
isStroke: !0,
|
|
1639
1619
|
blurVerticalSize: 0.85,
|
|
1640
1620
|
blurHorizontalSize: 0.85
|
|
@@ -1642,13 +1622,13 @@ class Yt {
|
|
|
1642
1622
|
const i = t ? new w(t[0], t[1], t[2]).toLinearSpace() : void 0;
|
|
1643
1623
|
e.forEach((n) => {
|
|
1644
1624
|
const o = this.scene.materials.find(
|
|
1645
|
-
(
|
|
1625
|
+
(r) => r.name === n.name && r.id === n.id
|
|
1646
1626
|
);
|
|
1647
1627
|
o && o.getBindedMeshes().forEach(
|
|
1648
|
-
(
|
|
1628
|
+
(r) => {
|
|
1649
1629
|
var h;
|
|
1650
1630
|
return (h = this.highlightLayer) == null ? void 0 : h.addMesh(
|
|
1651
|
-
|
|
1631
|
+
r,
|
|
1652
1632
|
i || w.FromHexString("#fcba03")
|
|
1653
1633
|
);
|
|
1654
1634
|
}
|
|
@@ -1659,12 +1639,12 @@ class Yt {
|
|
|
1659
1639
|
this.renderingPipeline && this.renderingPipeline.setConfiguration(e);
|
|
1660
1640
|
}
|
|
1661
1641
|
loadModel(e, t) {
|
|
1662
|
-
const { refocusCamera: i = !0, progressHandler:
|
|
1642
|
+
const { refocusCamera: i = !0, progressHandler: a } = t ?? {}, n = new tt({
|
|
1663
1643
|
enablePicking: this.configuration.highlights.enabled,
|
|
1664
1644
|
modelDetails: e,
|
|
1665
1645
|
scene: this.scene,
|
|
1666
1646
|
previewService: this,
|
|
1667
|
-
progressHandler:
|
|
1647
|
+
progressHandler: a
|
|
1668
1648
|
});
|
|
1669
1649
|
return n.getInitializationPromise().then(() => {
|
|
1670
1650
|
if (this.modelContainers.size <= 1 && i) {
|
|
@@ -1679,13 +1659,13 @@ class Yt {
|
|
|
1679
1659
|
this.setHighlights([o]);
|
|
1680
1660
|
}), n.registerMaterialDeselectedCallback(() => {
|
|
1681
1661
|
this.setHighlights([]);
|
|
1682
|
-
})), this.modelContainers.set(n.getId(), n), this.triggerModelLoadEvent({
|
|
1662
|
+
})), console.log(`loading model container ${n.getId()}`), this.modelContainers.set(n.getId(), n), this.triggerModelLoadEvent({
|
|
1683
1663
|
eventType: "load",
|
|
1684
1664
|
modelContainer: n
|
|
1685
1665
|
}), n;
|
|
1686
1666
|
}
|
|
1687
1667
|
async preloadModel(e) {
|
|
1688
|
-
await
|
|
1668
|
+
await D(e, this.scene);
|
|
1689
1669
|
}
|
|
1690
1670
|
getAllModels() {
|
|
1691
1671
|
return Array.from(this.modelContainers.values());
|
|
@@ -1702,13 +1682,13 @@ class Yt {
|
|
|
1702
1682
|
}
|
|
1703
1683
|
unregisterPlugin(e) {
|
|
1704
1684
|
const t = this.plugins.indexOf(e);
|
|
1705
|
-
t > -1 && this.plugins.splice(t, 1).forEach((
|
|
1685
|
+
t > -1 && this.plugins.splice(t, 1).forEach((a) => a.dispose(!1));
|
|
1706
1686
|
}
|
|
1707
1687
|
getGlowLayerManager() {
|
|
1708
1688
|
return this.glowLayerManager;
|
|
1709
1689
|
}
|
|
1710
1690
|
modelUnloaded(e) {
|
|
1711
|
-
this.modelContainers.delete(e.getId()), this.triggerModelLoadEvent({
|
|
1691
|
+
console.log(`unloaded ${e.getId()}`), this.modelContainers.delete(e.getId()), this.triggerModelLoadEvent({
|
|
1712
1692
|
eventType: "unload",
|
|
1713
1693
|
modelContainer: e
|
|
1714
1694
|
});
|
|
@@ -1720,28 +1700,28 @@ class Yt {
|
|
|
1720
1700
|
* Flips a transform around the origin.
|
|
1721
1701
|
*/
|
|
1722
1702
|
flipTransform(e, t, i) {
|
|
1723
|
-
const
|
|
1724
|
-
|
|
1725
|
-
|
|
1726
|
-
|
|
1703
|
+
const a = re.Compose(
|
|
1704
|
+
O(i || { x: 1, y: 1, z: 1 }),
|
|
1705
|
+
A.FromEulerVector(
|
|
1706
|
+
O(t || { x: 0, y: 0, z: 0 })
|
|
1727
1707
|
),
|
|
1728
|
-
|
|
1729
|
-
), n =
|
|
1730
|
-
return o.decompose(l, h,
|
|
1731
|
-
position:
|
|
1732
|
-
rotation:
|
|
1733
|
-
scale:
|
|
1708
|
+
O(e || { x: 0, y: 0, z: 0 })
|
|
1709
|
+
), n = re.RotationAxis(p.Up(), Math.PI), o = a.multiply(n), r = p.Zero(), h = A.Identity(), l = p.Zero();
|
|
1710
|
+
return o.decompose(l, h, r), h.multiplyInPlace(A.FromEulerAngles(0, Math.PI, 0)), {
|
|
1711
|
+
position: L(r),
|
|
1712
|
+
rotation: L(h.toEulerAngles()),
|
|
1713
|
+
scale: L(l)
|
|
1734
1714
|
};
|
|
1735
1715
|
}
|
|
1736
1716
|
updatePreviewOptions(e) {
|
|
1737
|
-
var
|
|
1738
|
-
const t = new
|
|
1717
|
+
var a, n;
|
|
1718
|
+
const t = new he(e);
|
|
1739
1719
|
this.configuration.highlights.enabled !== t.highlights.enabled && this.engine.setStencilBuffer(t.highlights.enabled), this.scene.clearColor = t.scene.clearColor;
|
|
1740
1720
|
let i = this.scene.environmentTexture;
|
|
1741
|
-
this.configuration.scene.environment.file !== t.scene.environment.file && (i =
|
|
1721
|
+
this.configuration.scene.environment.file !== t.scene.environment.file && (i = ne.CreateFromPrefilteredData(
|
|
1742
1722
|
t.scene.environment.file,
|
|
1743
1723
|
this.scene
|
|
1744
|
-
), i.name = "updated-environment-cube", i.rotationY = this.configuration.scene.environment.rotationY, this.scene.environmentTexture = i), i.rotationY = t.scene.environment.rotationY, this.scene.environmentIntensity = t.scene.environment.intensity, (
|
|
1724
|
+
), i.name = "updated-environment-cube", i.rotationY = this.configuration.scene.environment.rotationY, this.scene.environmentTexture = i), i.rotationY = t.scene.environment.rotationY, this.scene.environmentIntensity = t.scene.environment.intensity, (a = t.options) != null && a.renderingPipelineConfiguration ? this.renderingPipeline.setConfiguration(
|
|
1745
1725
|
t.options.renderingPipelineConfiguration
|
|
1746
1726
|
) : (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(
|
|
1747
1727
|
((n = t.options) == null ? void 0 : n.noPan) !== void 0 ? !t.options.noPan : !0
|
|
@@ -1762,10 +1742,10 @@ class Yt {
|
|
|
1762
1742
|
}
|
|
1763
1743
|
}
|
|
1764
1744
|
export {
|
|
1765
|
-
|
|
1766
|
-
|
|
1767
|
-
|
|
1768
|
-
|
|
1769
|
-
|
|
1745
|
+
F as MaterialEffectMode,
|
|
1746
|
+
I as ProductCameraRig,
|
|
1747
|
+
qe as REFLECTION_PROBE_RESOLUTION,
|
|
1748
|
+
y as RenderingConfiguration,
|
|
1749
|
+
Kt as SpiffCommerce3DPreviewService,
|
|
1770
1750
|
d as renderingPipelineDefaults
|
|
1771
1751
|
};
|