@roomle/web-sdk 3.6.0 → 3.7.0-alpha.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/{BufferGeometry-DLEagG41.mjs → BufferGeometry-C696z6r3.mjs} +2 -2
- package/lib/{BufferGeometry-DLEagG41.mjs.map → BufferGeometry-C696z6r3.mjs.map} +1 -1
- package/lib/ConfiguratorKernel.js +54 -73
- package/lib/ConfiguratorKernel.wasm +0 -0
- package/lib/{GLTFExporter-D8qsdwDK.mjs → GLTFExporter-AfQIvZAD.mjs} +141 -141
- package/lib/{GLTFExporter-D8qsdwDK.mjs.map → GLTFExporter-AfQIvZAD.mjs.map} +1 -1
- package/lib/{Object3D-DSjIOhON.mjs → Object3D-C3wqWk6O.mjs} +1 -1
- package/lib/{Object3D-DSjIOhON.mjs.map → Object3D-C3wqWk6O.mjs.map} +1 -1
- package/lib/{PointLightHelper-BnjxGaOG.mjs → PointLightHelper-wVSmrAnD.mjs} +4 -4
- package/lib/{PointLightHelper-BnjxGaOG.mjs.map → PointLightHelper-wVSmrAnD.mjs.map} +1 -1
- package/lib/RoomleCore.js +59 -79
- package/lib/RoomleCore.wasm +0 -0
- package/lib/RoomleToolsCore.js +54 -74
- package/lib/RoomleToolsCore.wasm +0 -0
- package/lib/{SpotLightHelper-DqsfqCrs.mjs → SpotLightHelper-C7J95t4f.mjs} +3 -3
- package/lib/{SpotLightHelper-DqsfqCrs.mjs.map → SpotLightHelper-C7J95t4f.mjs.map} +1 -1
- package/lib/{USDZExporter-DxIqi8St.mjs → USDZExporter-BBk0APeK.mjs} +3 -3
- package/lib/{USDZExporter-DxIqi8St.mjs.map → USDZExporter-BBk0APeK.mjs.map} +1 -1
- package/lib/{Vector4-DGmBYfpK.mjs → Vector4-DUqY3Egg.mjs} +2 -2
- package/lib/{Vector4-DGmBYfpK.mjs.map → Vector4-DUqY3Egg.mjs.map} +1 -1
- package/lib/{api-xDJ-Uyom.mjs → api-oYzhcs_W.mjs} +2 -2
- package/lib/{api-xDJ-Uyom.mjs.map → api-oYzhcs_W.mjs.map} +1 -1
- package/lib/asset-loader.worker-A7nEeQB4.mjs +6 -0
- package/lib/asset-loader.worker-A7nEeQB4.mjs.map +1 -0
- package/lib/{banana-for-scale-C_iNmlCT.mjs → banana-for-scale-D8t2dmc7.mjs} +4 -4
- package/lib/banana-for-scale-D8t2dmc7.mjs.map +1 -0
- package/lib/budgeteer.sw-CQWYbQSc.mjs +6 -0
- package/lib/budgeteer.sw-CQWYbQSc.mjs.map +1 -0
- package/lib/{common-utils-DMSTohiS.mjs → common-utils-qErzZAiR.mjs} +2 -2
- package/lib/common-utils-qErzZAiR.mjs.map +1 -0
- package/lib/{component-dimensioning-CvRmUja4.mjs → component-dimensioning-DlB7-9Om.mjs} +49 -49
- package/lib/{component-dimensioning-CvRmUja4.mjs.map → component-dimensioning-DlB7-9Om.mjs.map} +1 -1
- package/lib/{component-raycast-helper-CEp7wy9c.mjs → component-raycast-helper-C6ptEb0K.mjs} +27 -32
- package/lib/component-raycast-helper-C6ptEb0K.mjs.map +1 -0
- package/lib/component-raycast-helper-LrhRpeDD.mjs +2 -0
- package/lib/configurator-CRMunIq7.mjs +45 -0
- package/lib/{configurator-CmuhFgC9.mjs.map → configurator-CRMunIq7.mjs.map} +1 -1
- package/lib/configurator-DqiW717d.mjs +2 -0
- package/lib/{continuous-drawing-helper-v_5UAM9A.mjs → continuous-drawing-helper-BwulJHKj.mjs} +12 -12
- package/lib/continuous-drawing-helper-BwulJHKj.mjs.map +1 -0
- package/lib/dat.gui.module-CZHqOVGq.mjs +1500 -0
- package/lib/dat.gui.module-CZHqOVGq.mjs.map +1 -0
- package/lib/{decorate-C1QnXPYw.mjs → decorate-BAtqSPNS.mjs} +3 -3
- package/lib/decorate-BAtqSPNS.mjs.map +1 -0
- package/lib/{dimensioning-helper-Fwpt1HTT.mjs → dimensioning-helper--Y0Y-Wr1.mjs} +42 -42
- package/lib/{dimensioning-helper-Fwpt1HTT.mjs.map → dimensioning-helper--Y0Y-Wr1.mjs.map} +1 -1
- package/lib/dimensioning-helper-BpUreWo2.mjs +2 -0
- package/lib/{fflate.module-dFNj5UPI.mjs → fflate.module-CBz7CLOg.mjs} +1 -1
- package/lib/{fflate.module-dFNj5UPI.mjs.map → fflate.module-CBz7CLOg.mjs.map} +1 -1
- package/lib/{glb-viewer-BzNA9-zH.mjs → glb-viewer-CXEoIw1b.mjs} +48 -48
- package/lib/glb-viewer-CXEoIw1b.mjs.map +1 -0
- package/lib/glb-viewer-IDXgmONx.mjs +2 -0
- package/lib/{homag-intelligence-BwGjJEws.mjs → homag-intelligence-gb9MqBrz.mjs} +6 -3
- package/lib/{homag-intelligence-BwGjJEws.mjs.map → homag-intelligence-gb9MqBrz.mjs.map} +1 -1
- package/lib/{imos-ix-poc-export-helper-CQh94HsO.mjs → imos-ix-poc-export-helper-CW7QZhhn.mjs} +5 -4
- package/lib/imos-ix-poc-export-helper-CW7QZhhn.mjs.map +1 -0
- package/lib/{kernel-BAQSG9r5.mjs → kernel-C7YDLxq8.mjs} +3 -2
- package/lib/kernel-C7YDLxq8.mjs.map +1 -0
- package/lib/{kernel-utils-H74uNY1h.mjs → kernel-utils-DCnHzW4n.mjs} +15 -15
- package/lib/kernel-utils-DCnHzW4n.mjs.map +1 -0
- package/lib/{layer-C_JtkhdO.mjs → layer-CFAr2mK_.mjs} +1 -1
- package/lib/{layer-C_JtkhdO.mjs.map → layer-CFAr2mK_.mjs.map} +1 -1
- package/lib/{main-CtVIB52l.mjs → main-BJZ9-cDk.mjs} +14470 -14187
- package/lib/main-BJZ9-cDk.mjs.map +1 -0
- package/lib/{material-viewer-Bq4smZ6f.mjs → material-viewer-D8Nmpwg0.mjs} +41 -41
- package/lib/material-viewer-D8Nmpwg0.mjs.map +1 -0
- package/lib/packages-Uv53SHfb.mjs +4 -0
- package/lib/planner-5VarJrpy.mjs +44 -0
- package/lib/{planner-CVw_xzGh.mjs.map → planner-5VarJrpy.mjs.map} +1 -1
- package/lib/planner-DJcn-iih.mjs +2 -0
- package/lib/{plugin-system-D9K46xJk.mjs → plugin-system-DInww4H_.mjs} +3 -3
- package/lib/{plugin-system-D9K46xJk.mjs.map → plugin-system-DInww4H_.mjs.map} +1 -1
- package/lib/rolldown-runtime-DgwB9i60.mjs +13 -0
- package/lib/roomle-headless-setup-LoBO7UJe.mjs +1150 -0
- package/lib/roomle-headless-setup-LoBO7UJe.mjs.map +1 -0
- package/lib/roomle-headless.d.ts +9910 -0
- package/lib/roomle-headless.js +321 -0
- package/lib/roomle-headless.js.map +1 -0
- package/lib/roomle-renderer-DVlJsHYn.mjs +49 -0
- package/lib/roomle-renderer-DVlJsHYn.mjs.map +1 -0
- package/lib/roomle-sdk.d.ts +466 -1129
- package/lib/roomle-sdk.js +8 -7
- package/lib/roomle-webgpu-renderer-CVxBRv6o.mjs +217 -0
- package/lib/roomle-webgpu-renderer-CVxBRv6o.mjs.map +1 -0
- package/lib/{scene-renderer-D8HkTFeZ.mjs → scene-renderer-BHZrQYAH.mjs} +501 -518
- package/lib/scene-renderer-BHZrQYAH.mjs.map +1 -0
- package/lib/script-loader-gpkcl1h-.mjs +86 -0
- package/lib/script-loader-gpkcl1h-.mjs.map +1 -0
- package/lib/static/roomle-core-hsc/node_modules/roomle-core-hsc/package.json +1 -1
- package/lib/static/roomle-core-hsc/node_modules/roomle-core-hsc/src/embind/configuratorCallback.d.ts +3 -3
- package/lib/static/roomle-core-hsc/node_modules/roomle-core-hsc/src/embind/configuratorCallback.js +3 -3
- package/lib/static/roomle-core-hsc/node_modules/roomle-core-hsc/src/embind/configuratorCallback.js.map +1 -1
- package/lib/static/roomle-core-hsc/node_modules/roomle-core-hsc/src/embind/configuratorCoreInterface.d.ts +5 -3
- package/lib/static/roomle-core-hsc/node_modules/roomle-core-hsc/src/embind/configuratorCoreInterface.js +1 -1
- package/lib/static/roomle-core-hsc/node_modules/roomle-core-hsc/src/embind/configuratorCoreInterface.js.map +1 -1
- package/lib/static/roomle-core-hsc/node_modules/roomle-core-hsc/src/embind/plannerCoreCallback.d.ts +1 -0
- package/lib/static/roomle-core-hsc/node_modules/roomle-core-hsc/src/embind/plannerCoreCallback.js +3 -0
- package/lib/static/roomle-core-hsc/node_modules/roomle-core-hsc/src/embind/plannerCoreCallback.js.map +1 -1
- package/lib/static/roomle-core-hsc/node_modules/roomle-core-hsc/src/embind/plannerCoreInterface.d.ts +4 -3
- package/lib/static/roomle-core-hsc/node_modules/roomle-core-hsc/src/embind/plannerCoreInterface.js.map +1 -1
- package/lib/static/roomle-core-hsc/node_modules/roomle-core-hsc/src/loader/configurationLoader.d.ts +3 -2
- package/lib/static/roomle-core-hsc/node_modules/roomle-core-hsc/src/loader/configurationLoader.js +31 -9
- package/lib/static/roomle-core-hsc/node_modules/roomle-core-hsc/src/loader/configurationLoader.js.map +1 -1
- package/lib/static/roomle-core-hsc/node_modules/roomle-core-hsc/src/loader/configurationManager.js +8 -1
- package/lib/static/roomle-core-hsc/node_modules/roomle-core-hsc/src/loader/configurationManager.js.map +1 -1
- package/lib/static/roomle-core-hsc/node_modules/roomle-core-hsc/wasm_modern/ConfiguratorKernel.js +54 -73
- package/lib/static/roomle-core-hsc/node_modules/roomle-core-hsc/wasm_modern/ConfiguratorKernel.wasm +0 -0
- package/lib/static/roomle-core-hsc/node_modules/roomle-core-hsc/wasm_modern/RoomleCore.js +59 -79
- package/lib/static/roomle-core-hsc/node_modules/roomle-core-hsc/wasm_modern/RoomleCore.wasm +0 -0
- package/lib/static/roomle-core-hsc/node_modules/roomle-core-hsc/wasm_modern/RoomleToolsCore.js +54 -74
- package/lib/static/roomle-core-hsc/node_modules/roomle-core-hsc/wasm_modern/RoomleToolsCore.wasm +0 -0
- package/lib/{stats-helper-HM0TaIM5.mjs → stats-helper-Cv5SoEWT.mjs} +4 -3
- package/lib/{stats-helper-HM0TaIM5.mjs.map → stats-helper-Cv5SoEWT.mjs.map} +1 -1
- package/lib/{three.core-CLIofecG.mjs → three.core-mM-jZdgg.mjs} +926 -926
- package/lib/{three.core-CLIofecG.mjs.map → three.core-mM-jZdgg.mjs.map} +1 -1
- package/lib/{three.module-C4Q1skJQ.mjs → three.module-Bmy3sVQ-.mjs} +1210 -1210
- package/lib/{three.module-C4Q1skJQ.mjs.map → three.module-Bmy3sVQ-.mjs.map} +1 -1
- package/lib/{three.webgpu-dFspy2yF.mjs → three.webgpu-BbVYfCDp.mjs} +5360 -2940
- package/lib/{three.webgpu-dFspy2yF.mjs.map → three.webgpu-BbVYfCDp.mjs.map} +1 -1
- package/lib/three.webgpu-Bnp8Whu8.mjs +3 -0
- package/lib/threejs-utils-Bq4pVWBA.mjs +753 -0
- package/lib/threejs-utils-Bq4pVWBA.mjs.map +1 -0
- package/lib/{tools-core-Bf9WsK5v.mjs → tools-core-DqnhFefF.mjs} +6 -6
- package/lib/{tools-core-Bf9WsK5v.mjs.map → tools-core-DqnhFefF.mjs.map} +1 -1
- package/lib/workers-BJYv3y38.mjs +6 -0
- package/lib/workers-BJYv3y38.mjs.map +1 -0
- package/package.json +20 -5
- package/lib/banana-for-scale-C_iNmlCT.mjs.map +0 -1
- package/lib/common-utils-DMSTohiS.mjs.map +0 -1
- package/lib/component-raycast-helper-CEp7wy9c.mjs.map +0 -1
- package/lib/configurator-BaUt4_LF.mjs +0 -2
- package/lib/configurator-CmuhFgC9.mjs +0 -45
- package/lib/continuous-drawing-helper-v_5UAM9A.mjs.map +0 -1
- package/lib/decorate-C1QnXPYw.mjs.map +0 -1
- package/lib/dimensioning-helper-DTcW85Oq.mjs +0 -2
- package/lib/glb-viewer-BzNA9-zH.mjs.map +0 -1
- package/lib/glb-viewer-DOxBD5k-.mjs +0 -2
- package/lib/imos-ix-poc-export-helper-CQh94HsO.mjs.map +0 -1
- package/lib/kernel-BAQSG9r5.mjs.map +0 -1
- package/lib/kernel-utils-H74uNY1h.mjs.map +0 -1
- package/lib/main-CtVIB52l.mjs.map +0 -1
- package/lib/material-viewer-Bq4smZ6f.mjs.map +0 -1
- package/lib/planner-CVw_xzGh.mjs +0 -44
- package/lib/planner-si70gWA2.mjs +0 -2
- package/lib/scene-renderer-D8HkTFeZ.mjs.map +0 -1
- package/lib/script-loader-D8xCRzTr.mjs +0 -45
- package/lib/script-loader-D8xCRzTr.mjs.map +0 -1
- package/lib/threejs-utils-jEzvlJF1.mjs +0 -2233
- package/lib/threejs-utils-jEzvlJF1.mjs.map +0 -1
|
@@ -0,0 +1,753 @@
|
|
|
1
|
+
import { B as e, C as t, In as n, Vr as r, Wn as i, cn as a, d as o, gn as s, hn as c, jr as l, oi as u, on as d, sn as f, ut as p, xi as m, zr as h } from "./three.core-mM-jZdgg.mjs";
|
|
2
|
+
import { r as g } from "./three.module-Bmy3sVQ-.mjs";
|
|
3
|
+
import { V as _, b as v } from "./common-utils-qErzZAiR.mjs";
|
|
4
|
+
import { a as y } from "./kernel-utils-DCnHzW4n.mjs";
|
|
5
|
+
//#region packages/common-core/src/utils/math-helper.ts
|
|
6
|
+
var b = function(e) {
|
|
7
|
+
return Math.PI / 180 * e;
|
|
8
|
+
}, x = function(e) {
|
|
9
|
+
return 180 / Math.PI * e;
|
|
10
|
+
}, ee = function(e) {
|
|
11
|
+
return e >= 0 ? -180 + (e + 180) % 360 : 180 - (-e + 180) % 360;
|
|
12
|
+
}, te = function(e, t, n, r, i, a) {
|
|
13
|
+
e = Math.sqrt(e * e + n * n);
|
|
14
|
+
let o = i / a || 1, s = 2 * Math.atan(Math.tan(r * Math.PI / 180 / 2) * o) * 180 / Math.PI, c = b(r), l = t / 2 / Math.tan(c / 2), u = e / (2 * Math.atan(Math.PI * s / 360));
|
|
15
|
+
return Math.max(l, u);
|
|
16
|
+
}, S = function(e) {
|
|
17
|
+
return Math.round(e * 1e3) / 1e3;
|
|
18
|
+
}, ne = function(e, t) {
|
|
19
|
+
return Math.abs(e.y - t.y) + Math.abs(e.x - t.x);
|
|
20
|
+
}, re = function(e, t) {
|
|
21
|
+
return Math.atan2(t.y - e.y, t.x - e.x);
|
|
22
|
+
}, ie = function(e) {
|
|
23
|
+
let t = x(e);
|
|
24
|
+
return t < 0 && (t = 180 + (180 + t)), t;
|
|
25
|
+
}, C = /* @__PURE__ */ function(e) {
|
|
26
|
+
return e[e.NODE = 0] = "NODE", e[e.WALL = 1] = "WALL", e[e.OBJECT = 2] = "OBJECT", e[e.FLOOR = 3] = "FLOOR", e[e.TEXT = 4] = "TEXT", e[e.MEASURE = 5] = "MEASURE", e[e.IMAGE = 6] = "IMAGE", e[e.CEILING = 7] = "CEILING", e;
|
|
27
|
+
}({}), ae = {
|
|
28
|
+
LEFT: 0,
|
|
29
|
+
RIGHT: 1,
|
|
30
|
+
MIDDLE: 2
|
|
31
|
+
}, oe = /* @__PURE__ */ function(e) {
|
|
32
|
+
return e[e.None = 0] = "None", e[e.CatalogItem = 1] = "CatalogItem", e[e.Material = 2] = "Material", e[e.RgbValue = 3] = "RgbValue", e;
|
|
33
|
+
}({}), se = /* @__PURE__ */ function(e) {
|
|
34
|
+
return e[e.CONTINOUS = 0] = "CONTINOUS", e[e.CLICK_PER_CLICK = 1] = "CLICK_PER_CLICK", e;
|
|
35
|
+
}({}), ce = {
|
|
36
|
+
CONFIGURATOR: 0,
|
|
37
|
+
PLANNER: 1
|
|
38
|
+
}, le = {
|
|
39
|
+
NONE: 0,
|
|
40
|
+
WALL_SNAP_LEVEL: 1,
|
|
41
|
+
WALL_SNAP_LEVEL_SNAPPED: 2,
|
|
42
|
+
WALL_EDGE: 3,
|
|
43
|
+
DOCKING_VECTOR: 4,
|
|
44
|
+
OBJECT_CONTOUR: 5
|
|
45
|
+
}, w = /* @__PURE__ */ function(e) {
|
|
46
|
+
return e[e.StandAloneWall = 0] = "StandAloneWall", e[e.OuterWallLeft = 1] = "OuterWallLeft", e[e.OuterWallRight = 2] = "OuterWallRight", e[e.InnerWall = 3] = "InnerWall", e;
|
|
47
|
+
}({}), T = class {
|
|
48
|
+
static createMeshPhysicalMaterial(e) {
|
|
49
|
+
return new c(e);
|
|
50
|
+
}
|
|
51
|
+
static createMeshStandardMaterial(e) {
|
|
52
|
+
return new s(e);
|
|
53
|
+
}
|
|
54
|
+
}, E = Object.freeze({
|
|
55
|
+
Linear: Object.freeze({
|
|
56
|
+
None: function(e) {
|
|
57
|
+
return e;
|
|
58
|
+
},
|
|
59
|
+
In: function(e) {
|
|
60
|
+
return e;
|
|
61
|
+
},
|
|
62
|
+
Out: function(e) {
|
|
63
|
+
return e;
|
|
64
|
+
},
|
|
65
|
+
InOut: function(e) {
|
|
66
|
+
return e;
|
|
67
|
+
}
|
|
68
|
+
}),
|
|
69
|
+
Quadratic: Object.freeze({
|
|
70
|
+
In: function(e) {
|
|
71
|
+
return e * e;
|
|
72
|
+
},
|
|
73
|
+
Out: function(e) {
|
|
74
|
+
return e * (2 - e);
|
|
75
|
+
},
|
|
76
|
+
InOut: function(e) {
|
|
77
|
+
return (e *= 2) < 1 ? .5 * e * e : -.5 * (--e * (e - 2) - 1);
|
|
78
|
+
}
|
|
79
|
+
}),
|
|
80
|
+
Cubic: Object.freeze({
|
|
81
|
+
In: function(e) {
|
|
82
|
+
return e * e * e;
|
|
83
|
+
},
|
|
84
|
+
Out: function(e) {
|
|
85
|
+
return --e * e * e + 1;
|
|
86
|
+
},
|
|
87
|
+
InOut: function(e) {
|
|
88
|
+
return (e *= 2) < 1 ? .5 * e * e * e : .5 * ((e -= 2) * e * e + 2);
|
|
89
|
+
}
|
|
90
|
+
}),
|
|
91
|
+
Quartic: Object.freeze({
|
|
92
|
+
In: function(e) {
|
|
93
|
+
return e * e * e * e;
|
|
94
|
+
},
|
|
95
|
+
Out: function(e) {
|
|
96
|
+
return 1 - --e * e * e * e;
|
|
97
|
+
},
|
|
98
|
+
InOut: function(e) {
|
|
99
|
+
return (e *= 2) < 1 ? .5 * e * e * e * e : -.5 * ((e -= 2) * e * e * e - 2);
|
|
100
|
+
}
|
|
101
|
+
}),
|
|
102
|
+
Quintic: Object.freeze({
|
|
103
|
+
In: function(e) {
|
|
104
|
+
return e * e * e * e * e;
|
|
105
|
+
},
|
|
106
|
+
Out: function(e) {
|
|
107
|
+
return --e * e * e * e * e + 1;
|
|
108
|
+
},
|
|
109
|
+
InOut: function(e) {
|
|
110
|
+
return (e *= 2) < 1 ? .5 * e * e * e * e * e : .5 * ((e -= 2) * e * e * e * e + 2);
|
|
111
|
+
}
|
|
112
|
+
}),
|
|
113
|
+
Sinusoidal: Object.freeze({
|
|
114
|
+
In: function(e) {
|
|
115
|
+
return 1 - Math.sin((1 - e) * Math.PI / 2);
|
|
116
|
+
},
|
|
117
|
+
Out: function(e) {
|
|
118
|
+
return Math.sin(e * Math.PI / 2);
|
|
119
|
+
},
|
|
120
|
+
InOut: function(e) {
|
|
121
|
+
return .5 * (1 - Math.sin(Math.PI * (.5 - e)));
|
|
122
|
+
}
|
|
123
|
+
}),
|
|
124
|
+
Exponential: Object.freeze({
|
|
125
|
+
In: function(e) {
|
|
126
|
+
return e === 0 ? 0 : 1024 ** (e - 1);
|
|
127
|
+
},
|
|
128
|
+
Out: function(e) {
|
|
129
|
+
return e === 1 ? 1 : 1 - 2 ** (-10 * e);
|
|
130
|
+
},
|
|
131
|
+
InOut: function(e) {
|
|
132
|
+
return e === 0 ? 0 : e === 1 ? 1 : (e *= 2) < 1 ? .5 * 1024 ** (e - 1) : .5 * (-(2 ** (-10 * (e - 1))) + 2);
|
|
133
|
+
}
|
|
134
|
+
}),
|
|
135
|
+
Circular: Object.freeze({
|
|
136
|
+
In: function(e) {
|
|
137
|
+
return 1 - Math.sqrt(1 - e * e);
|
|
138
|
+
},
|
|
139
|
+
Out: function(e) {
|
|
140
|
+
return Math.sqrt(1 - --e * e);
|
|
141
|
+
},
|
|
142
|
+
InOut: function(e) {
|
|
143
|
+
return (e *= 2) < 1 ? -.5 * (Math.sqrt(1 - e * e) - 1) : .5 * (Math.sqrt(1 - (e -= 2) * e) + 1);
|
|
144
|
+
}
|
|
145
|
+
}),
|
|
146
|
+
Elastic: Object.freeze({
|
|
147
|
+
In: function(e) {
|
|
148
|
+
return e === 0 ? 0 : e === 1 ? 1 : -(2 ** (10 * (e - 1))) * Math.sin((e - 1.1) * 5 * Math.PI);
|
|
149
|
+
},
|
|
150
|
+
Out: function(e) {
|
|
151
|
+
return e === 0 ? 0 : e === 1 ? 1 : 2 ** (-10 * e) * Math.sin((e - .1) * 5 * Math.PI) + 1;
|
|
152
|
+
},
|
|
153
|
+
InOut: function(e) {
|
|
154
|
+
return e === 0 ? 0 : e === 1 ? 1 : (e *= 2, e < 1 ? -.5 * 2 ** (10 * (e - 1)) * Math.sin((e - 1.1) * 5 * Math.PI) : .5 * 2 ** (-10 * (e - 1)) * Math.sin((e - 1.1) * 5 * Math.PI) + 1);
|
|
155
|
+
}
|
|
156
|
+
}),
|
|
157
|
+
Back: Object.freeze({
|
|
158
|
+
In: function(e) {
|
|
159
|
+
var t = 1.70158;
|
|
160
|
+
return e === 1 ? 1 : e * e * ((t + 1) * e - t);
|
|
161
|
+
},
|
|
162
|
+
Out: function(e) {
|
|
163
|
+
var t = 1.70158;
|
|
164
|
+
return e === 0 ? 0 : --e * e * ((t + 1) * e + t) + 1;
|
|
165
|
+
},
|
|
166
|
+
InOut: function(e) {
|
|
167
|
+
var t = 1.70158 * 1.525;
|
|
168
|
+
return (e *= 2) < 1 ? .5 * (e * e * ((t + 1) * e - t)) : .5 * ((e -= 2) * e * ((t + 1) * e + t) + 2);
|
|
169
|
+
}
|
|
170
|
+
}),
|
|
171
|
+
Bounce: Object.freeze({
|
|
172
|
+
In: function(e) {
|
|
173
|
+
return 1 - E.Bounce.Out(1 - e);
|
|
174
|
+
},
|
|
175
|
+
Out: function(e) {
|
|
176
|
+
return e < 1 / 2.75 ? 7.5625 * e * e : e < 2 / 2.75 ? 7.5625 * (e -= 1.5 / 2.75) * e + .75 : e < 2.5 / 2.75 ? 7.5625 * (e -= 2.25 / 2.75) * e + .9375 : 7.5625 * (e -= 2.625 / 2.75) * e + .984375;
|
|
177
|
+
},
|
|
178
|
+
InOut: function(e) {
|
|
179
|
+
return e < .5 ? E.Bounce.In(e * 2) * .5 : E.Bounce.Out(e * 2 - 1) * .5 + .5;
|
|
180
|
+
}
|
|
181
|
+
}),
|
|
182
|
+
generatePow: function(e) {
|
|
183
|
+
return e === void 0 && (e = 4), e = e < 2 ** -52 ? 2 ** -52 : e, e = e > 1e4 ? 1e4 : e, {
|
|
184
|
+
In: function(t) {
|
|
185
|
+
return t ** +e;
|
|
186
|
+
},
|
|
187
|
+
Out: function(t) {
|
|
188
|
+
return 1 - (1 - t) ** e;
|
|
189
|
+
},
|
|
190
|
+
InOut: function(t) {
|
|
191
|
+
return t < .5 ? (t * 2) ** e / 2 : (1 - (2 - t * 2) ** e) / 2 + .5;
|
|
192
|
+
}
|
|
193
|
+
};
|
|
194
|
+
}
|
|
195
|
+
}), D = function() {
|
|
196
|
+
return performance.now();
|
|
197
|
+
}, O = function() {
|
|
198
|
+
function e() {
|
|
199
|
+
var e = [...arguments];
|
|
200
|
+
this._tweens = {}, this._tweensAddedDuringUpdate = {}, this.add.apply(this, e);
|
|
201
|
+
}
|
|
202
|
+
return e.prototype.getAll = function() {
|
|
203
|
+
var e = this;
|
|
204
|
+
return Object.keys(this._tweens).map(function(t) {
|
|
205
|
+
return e._tweens[t];
|
|
206
|
+
});
|
|
207
|
+
}, e.prototype.removeAll = function() {
|
|
208
|
+
this._tweens = {};
|
|
209
|
+
}, e.prototype.add = function() {
|
|
210
|
+
for (var e, t = [], n = 0; n < arguments.length; n++) t[n] = arguments[n];
|
|
211
|
+
for (var r = 0, i = t; r < i.length; r++) {
|
|
212
|
+
var a = i[r];
|
|
213
|
+
(e = a._group) == null || e.remove(a), a._group = this, this._tweens[a.getId()] = a, this._tweensAddedDuringUpdate[a.getId()] = a;
|
|
214
|
+
}
|
|
215
|
+
}, e.prototype.remove = function() {
|
|
216
|
+
for (var e = [...arguments], t = 0, n = e; t < n.length; t++) {
|
|
217
|
+
var r = n[t];
|
|
218
|
+
r._group = void 0, delete this._tweens[r.getId()], delete this._tweensAddedDuringUpdate[r.getId()];
|
|
219
|
+
}
|
|
220
|
+
}, e.prototype.allStopped = function() {
|
|
221
|
+
return this.getAll().every(function(e) {
|
|
222
|
+
return !e.isPlaying();
|
|
223
|
+
});
|
|
224
|
+
}, e.prototype.update = function(e, t) {
|
|
225
|
+
e === void 0 && (e = D()), t === void 0 && (t = !0);
|
|
226
|
+
var n = Object.keys(this._tweens);
|
|
227
|
+
if (n.length !== 0) for (; n.length > 0;) {
|
|
228
|
+
this._tweensAddedDuringUpdate = {};
|
|
229
|
+
for (var r = 0; r < n.length; r++) {
|
|
230
|
+
var i = this._tweens[n[r]], a = !t;
|
|
231
|
+
i && i.update(e, a) === !1 && !t && this.remove(i);
|
|
232
|
+
}
|
|
233
|
+
n = Object.keys(this._tweensAddedDuringUpdate);
|
|
234
|
+
}
|
|
235
|
+
}, e;
|
|
236
|
+
}(), k = {
|
|
237
|
+
Linear: function(e, t) {
|
|
238
|
+
var n = e.length - 1, r = n * t, i = Math.floor(r), a = k.Utils.Linear;
|
|
239
|
+
return t < 0 ? a(e[0], e[1], r) : t > 1 ? a(e[n], e[n - 1], n - r) : a(e[i], e[i + 1 > n ? n : i + 1], r - i);
|
|
240
|
+
},
|
|
241
|
+
Bezier: function(e, t) {
|
|
242
|
+
for (var n = 0, r = e.length - 1, i = Math.pow, a = k.Utils.Bernstein, o = 0; o <= r; o++) n += i(1 - t, r - o) * i(t, o) * e[o] * a(r, o);
|
|
243
|
+
return n;
|
|
244
|
+
},
|
|
245
|
+
CatmullRom: function(e, t) {
|
|
246
|
+
var n = e.length - 1, r = n * t, i = Math.floor(r), a = k.Utils.CatmullRom;
|
|
247
|
+
return e[0] === e[n] ? (t < 0 && (i = Math.floor(r = n * (1 + t))), a(e[(i - 1 + n) % n], e[i], e[(i + 1) % n], e[(i + 2) % n], r - i)) : t < 0 ? e[0] - (a(e[0], e[0], e[1], e[1], -r) - e[0]) : t > 1 ? e[n] - (a(e[n], e[n], e[n - 1], e[n - 1], r - n) - e[n]) : a(e[i ? i - 1 : 0], e[i], e[n < i + 1 ? n : i + 1], e[n < i + 2 ? n : i + 2], r - i);
|
|
248
|
+
},
|
|
249
|
+
Utils: {
|
|
250
|
+
Linear: function(e, t, n) {
|
|
251
|
+
return (t - e) * n + e;
|
|
252
|
+
},
|
|
253
|
+
Bernstein: function(e, t) {
|
|
254
|
+
var n = k.Utils.Factorial;
|
|
255
|
+
return n(e) / n(t) / n(e - t);
|
|
256
|
+
},
|
|
257
|
+
Factorial: (function() {
|
|
258
|
+
var e = [1];
|
|
259
|
+
return function(t) {
|
|
260
|
+
var n = 1;
|
|
261
|
+
if (e[t]) return e[t];
|
|
262
|
+
for (var r = t; r > 1; r--) n *= r;
|
|
263
|
+
return e[t] = n, n;
|
|
264
|
+
};
|
|
265
|
+
})(),
|
|
266
|
+
CatmullRom: function(e, t, n, r, i) {
|
|
267
|
+
var a = (n - e) * .5, o = (r - t) * .5, s = i * i, c = i * s;
|
|
268
|
+
return (2 * t - 2 * n + a + o) * c + (-3 * t + 3 * n - 2 * a - o) * s + a * i + t;
|
|
269
|
+
}
|
|
270
|
+
}
|
|
271
|
+
}, A = function() {
|
|
272
|
+
function e() {}
|
|
273
|
+
return e.nextId = function() {
|
|
274
|
+
return e._nextId++;
|
|
275
|
+
}, e._nextId = 0, e;
|
|
276
|
+
}(), j = new O(), M = function() {
|
|
277
|
+
function e(e, t) {
|
|
278
|
+
this._isPaused = !1, this._pauseStart = 0, this._valuesStart = {}, this._valuesEnd = {}, this._valuesStartRepeat = {}, this._duration = 1e3, this._isDynamic = !1, this._initialRepeat = 0, this._repeat = 0, this._yoyo = !1, this._isPlaying = !1, this._reversed = !1, this._delayTime = 0, this._startTime = 0, this._easingFunction = E.Linear.None, this._interpolationFunction = k.Linear, this._chainedTweens = [], this._onStartCallbackFired = !1, this._onEveryStartCallbackFired = !1, this._id = A.nextId(), this._isChainStopped = !1, this._propertiesAreSetUp = !1, this._goToEnd = !1, this._object = e, typeof t == "object" ? (this._group = t, t.add(this)) : t === !0 && (this._group = j, j.add(this));
|
|
279
|
+
}
|
|
280
|
+
return e.prototype.getId = function() {
|
|
281
|
+
return this._id;
|
|
282
|
+
}, e.prototype.isPlaying = function() {
|
|
283
|
+
return this._isPlaying;
|
|
284
|
+
}, e.prototype.isPaused = function() {
|
|
285
|
+
return this._isPaused;
|
|
286
|
+
}, e.prototype.getDuration = function() {
|
|
287
|
+
return this._duration;
|
|
288
|
+
}, e.prototype.to = function(e, t) {
|
|
289
|
+
if (t === void 0 && (t = 1e3), this._isPlaying) throw Error("Can not call Tween.to() while Tween is already started or paused. Stop the Tween first.");
|
|
290
|
+
return this._valuesEnd = e, this._propertiesAreSetUp = !1, this._duration = t < 0 ? 0 : t, this;
|
|
291
|
+
}, e.prototype.duration = function(e) {
|
|
292
|
+
return e === void 0 && (e = 1e3), this._duration = e < 0 ? 0 : e, this;
|
|
293
|
+
}, e.prototype.dynamic = function(e) {
|
|
294
|
+
return e === void 0 && (e = !1), this._isDynamic = e, this;
|
|
295
|
+
}, e.prototype.start = function(e, t) {
|
|
296
|
+
if (e === void 0 && (e = D()), t === void 0 && (t = !1), this._isPlaying) return this;
|
|
297
|
+
if (this._repeat = this._initialRepeat, this._reversed) for (var n in this._reversed = !1, this._valuesStartRepeat) this._swapEndStartRepeatValues(n), this._valuesStart[n] = this._valuesStartRepeat[n];
|
|
298
|
+
if (this._isPlaying = !0, this._isPaused = !1, this._onStartCallbackFired = !1, this._onEveryStartCallbackFired = !1, this._isChainStopped = !1, this._startTime = e, this._startTime += this._delayTime, !this._propertiesAreSetUp || t) {
|
|
299
|
+
if (this._propertiesAreSetUp = !0, !this._isDynamic) {
|
|
300
|
+
var r = {};
|
|
301
|
+
for (var i in this._valuesEnd) r[i] = this._valuesEnd[i];
|
|
302
|
+
this._valuesEnd = r;
|
|
303
|
+
}
|
|
304
|
+
this._setupProperties(this._object, this._valuesStart, this._valuesEnd, this._valuesStartRepeat, t);
|
|
305
|
+
}
|
|
306
|
+
return this;
|
|
307
|
+
}, e.prototype.startFromCurrentValues = function(e) {
|
|
308
|
+
return this.start(e, !0);
|
|
309
|
+
}, e.prototype._setupProperties = function(e, t, n, r, i) {
|
|
310
|
+
for (var a in n) {
|
|
311
|
+
var o = e[a], s = Array.isArray(o), c = s ? "array" : typeof o, l = !s && Array.isArray(n[a]);
|
|
312
|
+
if (!(c === "undefined" || c === "function")) {
|
|
313
|
+
if (l) {
|
|
314
|
+
var u = n[a];
|
|
315
|
+
if (u.length === 0) continue;
|
|
316
|
+
for (var d = [o], f = 0, p = u.length; f < p; f += 1) {
|
|
317
|
+
var m = this._handleRelativeValue(o, u[f]);
|
|
318
|
+
if (isNaN(m)) {
|
|
319
|
+
l = !1, console.warn("Found invalid interpolation list. Skipping.");
|
|
320
|
+
break;
|
|
321
|
+
}
|
|
322
|
+
d.push(m);
|
|
323
|
+
}
|
|
324
|
+
l && (n[a] = d);
|
|
325
|
+
}
|
|
326
|
+
if ((c === "object" || s) && o && !l) {
|
|
327
|
+
t[a] = s ? [] : {};
|
|
328
|
+
var h = o;
|
|
329
|
+
for (var g in h) t[a][g] = h[g];
|
|
330
|
+
r[a] = s ? [] : {};
|
|
331
|
+
var u = n[a];
|
|
332
|
+
if (!this._isDynamic) {
|
|
333
|
+
var _ = {};
|
|
334
|
+
for (var g in u) _[g] = u[g];
|
|
335
|
+
n[a] = u = _;
|
|
336
|
+
}
|
|
337
|
+
this._setupProperties(h, t[a], u, r[a], i);
|
|
338
|
+
} else (t[a] === void 0 || i) && (t[a] = o), s || (t[a] *= 1), l ? r[a] = n[a].slice().reverse() : r[a] = t[a] || 0;
|
|
339
|
+
}
|
|
340
|
+
}
|
|
341
|
+
}, e.prototype.stop = function() {
|
|
342
|
+
return this._isChainStopped || (this._isChainStopped = !0, this.stopChainedTweens()), this._isPlaying ? (this._isPlaying = !1, this._isPaused = !1, this._onStopCallback && this._onStopCallback(this._object), this) : this;
|
|
343
|
+
}, e.prototype.end = function() {
|
|
344
|
+
return this._goToEnd = !0, this.update(this._startTime + this._duration), this;
|
|
345
|
+
}, e.prototype.pause = function(e) {
|
|
346
|
+
return e === void 0 && (e = D()), this._isPaused || !this._isPlaying ? this : (this._isPaused = !0, this._pauseStart = e, this);
|
|
347
|
+
}, e.prototype.resume = function(e) {
|
|
348
|
+
return e === void 0 && (e = D()), !this._isPaused || !this._isPlaying ? this : (this._isPaused = !1, this._startTime += e - this._pauseStart, this._pauseStart = 0, this);
|
|
349
|
+
}, e.prototype.stopChainedTweens = function() {
|
|
350
|
+
for (var e = 0, t = this._chainedTweens.length; e < t; e++) this._chainedTweens[e].stop();
|
|
351
|
+
return this;
|
|
352
|
+
}, e.prototype.group = function(e) {
|
|
353
|
+
return e ? (e.add(this), this) : (console.warn("tween.group() without args has been removed, use group.add(tween) instead."), this);
|
|
354
|
+
}, e.prototype.remove = function() {
|
|
355
|
+
var e;
|
|
356
|
+
return (e = this._group) == null || e.remove(this), this;
|
|
357
|
+
}, e.prototype.delay = function(e) {
|
|
358
|
+
return e === void 0 && (e = 0), this._delayTime = e, this;
|
|
359
|
+
}, e.prototype.repeat = function(e) {
|
|
360
|
+
return e === void 0 && (e = 0), this._initialRepeat = e, this._repeat = e, this;
|
|
361
|
+
}, e.prototype.repeatDelay = function(e) {
|
|
362
|
+
return this._repeatDelayTime = e, this;
|
|
363
|
+
}, e.prototype.yoyo = function(e) {
|
|
364
|
+
return e === void 0 && (e = !1), this._yoyo = e, this;
|
|
365
|
+
}, e.prototype.easing = function(e) {
|
|
366
|
+
return e === void 0 && (e = E.Linear.None), this._easingFunction = e, this;
|
|
367
|
+
}, e.prototype.interpolation = function(e) {
|
|
368
|
+
return e === void 0 && (e = k.Linear), this._interpolationFunction = e, this;
|
|
369
|
+
}, e.prototype.chain = function() {
|
|
370
|
+
return this._chainedTweens = [...arguments], this;
|
|
371
|
+
}, e.prototype.onStart = function(e) {
|
|
372
|
+
return this._onStartCallback = e, this;
|
|
373
|
+
}, e.prototype.onEveryStart = function(e) {
|
|
374
|
+
return this._onEveryStartCallback = e, this;
|
|
375
|
+
}, e.prototype.onUpdate = function(e) {
|
|
376
|
+
return this._onUpdateCallback = e, this;
|
|
377
|
+
}, e.prototype.onRepeat = function(e) {
|
|
378
|
+
return this._onRepeatCallback = e, this;
|
|
379
|
+
}, e.prototype.onComplete = function(e) {
|
|
380
|
+
return this._onCompleteCallback = e, this;
|
|
381
|
+
}, e.prototype.onStop = function(e) {
|
|
382
|
+
return this._onStopCallback = e, this;
|
|
383
|
+
}, e.prototype.update = function(t, n) {
|
|
384
|
+
var r = this;
|
|
385
|
+
if (t === void 0 && (t = D()), n === void 0 && (n = e.autoStartOnUpdate), this._isPaused) return !0;
|
|
386
|
+
var i;
|
|
387
|
+
if (!this._goToEnd && !this._isPlaying) if (n) this.start(t, !0);
|
|
388
|
+
else return !1;
|
|
389
|
+
if (this._goToEnd = !1, t < this._startTime) return !0;
|
|
390
|
+
this._onStartCallbackFired === !1 && (this._onStartCallback && this._onStartCallback(this._object), this._onStartCallbackFired = !0), this._onEveryStartCallbackFired === !1 && (this._onEveryStartCallback && this._onEveryStartCallback(this._object), this._onEveryStartCallbackFired = !0);
|
|
391
|
+
var a = t - this._startTime, o = this._duration + (this._repeatDelayTime ?? this._delayTime), s = this._duration + this._repeat * o, c = function() {
|
|
392
|
+
if (r._duration === 0 || a > s) return 1;
|
|
393
|
+
var e = a - Math.trunc(a / o) * o, t = Math.min(e / r._duration, 1);
|
|
394
|
+
return t === 0 && a === r._duration ? 1 : t;
|
|
395
|
+
}(), l = this._easingFunction(c);
|
|
396
|
+
if (this._updateProperties(this._object, this._valuesStart, this._valuesEnd, l), this._onUpdateCallback && this._onUpdateCallback(this._object, c), this._duration === 0 || a >= this._duration) if (this._repeat > 0) {
|
|
397
|
+
var u = Math.min(Math.trunc((a - this._duration) / o) + 1, this._repeat);
|
|
398
|
+
for (i in isFinite(this._repeat) && (this._repeat -= u), this._valuesStartRepeat) !this._yoyo && typeof this._valuesEnd[i] == "string" && (this._valuesStartRepeat[i] = this._valuesStartRepeat[i] + parseFloat(this._valuesEnd[i])), this._yoyo && this._swapEndStartRepeatValues(i), this._valuesStart[i] = this._valuesStartRepeat[i];
|
|
399
|
+
return this._yoyo && (this._reversed = !this._reversed), this._startTime += o * u, this._onRepeatCallback && this._onRepeatCallback(this._object), this._onEveryStartCallbackFired = !1, !0;
|
|
400
|
+
} else {
|
|
401
|
+
this._onCompleteCallback && this._onCompleteCallback(this._object);
|
|
402
|
+
for (var d = 0, f = this._chainedTweens.length; d < f; d++) this._chainedTweens[d].start(this._startTime + this._duration, !1);
|
|
403
|
+
return this._isPlaying = !1, !1;
|
|
404
|
+
}
|
|
405
|
+
return !0;
|
|
406
|
+
}, e.prototype._updateProperties = function(e, t, n, r) {
|
|
407
|
+
for (var i in n) if (t[i] !== void 0) {
|
|
408
|
+
var a = t[i] || 0, o = n[i];
|
|
409
|
+
!Array.isArray(e[i]) && Array.isArray(o) ? e[i] = this._interpolationFunction(o, r) : typeof o == "object" && o ? this._updateProperties(e[i], a, o, r) : (o = this._handleRelativeValue(a, o), typeof o == "number" && (e[i] = a + (o - a) * r));
|
|
410
|
+
}
|
|
411
|
+
}, e.prototype._handleRelativeValue = function(e, t) {
|
|
412
|
+
return typeof t == "string" ? t.charAt(0) === "+" || t.charAt(0) === "-" ? e + parseFloat(t) : parseFloat(t) : t;
|
|
413
|
+
}, e.prototype._swapEndStartRepeatValues = function(e) {
|
|
414
|
+
var t = this._valuesStartRepeat[e], n = this._valuesEnd[e];
|
|
415
|
+
typeof n == "string" ? this._valuesStartRepeat[e] = this._valuesStartRepeat[e] + parseFloat(n) : this._valuesStartRepeat[e] = this._valuesEnd[e], this._valuesEnd[e] = t;
|
|
416
|
+
}, e.autoStartOnUpdate = !1, e;
|
|
417
|
+
}();
|
|
418
|
+
A.nextId;
|
|
419
|
+
var N = j;
|
|
420
|
+
N.getAll.bind(N), N.removeAll.bind(N), N.add.bind(N), N.remove.bind(N), N.update.bind(N);
|
|
421
|
+
//#endregion
|
|
422
|
+
//#region packages/common-core/src/utils/threejs-utils.ts
|
|
423
|
+
var P = null;
|
|
424
|
+
globalThis.window !== void 0 && import("./dat.gui.module-CZHqOVGq.mjs").then((e) => {
|
|
425
|
+
P = e.GUI;
|
|
426
|
+
}).catch(() => {});
|
|
427
|
+
var ue = .4, de = "#DDDDDD", fe = .4, pe = "#7B7B7B", me = "#B1B1B1", he = .8, ge = .9, _e = (e) => e instanceof g ? e.capabilities.maxSamples : 16, F = (e) => e instanceof g ? e.capabilities.maxTextures : 16, I = (e) => e instanceof g ? e.capabilities.getMaxAnisotropy() : 16, ve = (e, t, n, r) => {
|
|
428
|
+
if (!e || !t || n === 0 || r === 0) return new m();
|
|
429
|
+
let i = e.clone(), a = n / 2, o = r / 2;
|
|
430
|
+
return i.project(t), i.x = Math.floor(i.x * a + a), i.y = Math.floor(-(i.y * o) + o), i.z = e.distanceTo(t.position), i;
|
|
431
|
+
}, ye = (e, t) => {
|
|
432
|
+
t ||= new m(0, 0, 0);
|
|
433
|
+
let n = new m(e.size.x / 1e3, e.size.z / 1e3, e.size.y / 1e3), r = new m(e.origin.x / 1e3, e.origin.z / 1e3, e.origin.y / -1e3);
|
|
434
|
+
return new o(new m(0, 0, -n.z).add(r).sub(t), new m(n.x, n.y, 0).add(r).add(t));
|
|
435
|
+
}, be = (e) => (e.from /= 1e3, e.to /= 1e3, e), xe = (e, t) => {
|
|
436
|
+
let n = S(e.x), r = S(e.y), i = S(e.z), a = S(t.x), o = S(t.y), s = S(t.z);
|
|
437
|
+
return n === a && r === o && i === s;
|
|
438
|
+
}, Se = (e, t) => {
|
|
439
|
+
let n = S(e.w), r = S(e.x), i = S(e.y), a = S(e.z), o = S(t.w), s = S(t.x), c = S(t.y), l = S(t.z);
|
|
440
|
+
return n === o && r === s && i === c && a === l;
|
|
441
|
+
}, Ce = (e, t) => {
|
|
442
|
+
let n = S(e.x), r = S(e.y), i = S(t.x), a = S(t.y);
|
|
443
|
+
return n === i && r === a;
|
|
444
|
+
}, L = null, R = () => {
|
|
445
|
+
if (L) return L;
|
|
446
|
+
let t = new Uint8Array(4);
|
|
447
|
+
for (let e = 0; e < 1; e++) {
|
|
448
|
+
let n = e * 4;
|
|
449
|
+
t[n] = 255, t[n + 1] = 255, t[n + 2] = 255, t[n + 3] = 255;
|
|
450
|
+
}
|
|
451
|
+
let n = new e(t, 1, 1, i);
|
|
452
|
+
return n.needsUpdate = !0, n;
|
|
453
|
+
}, we = (e) => z(null, e), z = (e, t) => {
|
|
454
|
+
e ||= De(), e.name = t.id ? t.id.toString() : "";
|
|
455
|
+
let n = t.shading.version === "2" || t.shading.version?.startsWith("2.");
|
|
456
|
+
return e = n ? Ee(e, t) : Te(e, t), e.userData.materialVersion = n ? 2 : 1, e.map || (L ||= R(), e.map = L), e;
|
|
457
|
+
}, Te = (e, t) => {
|
|
458
|
+
t.shading.metallic !== void 0 && (e.metalness = t.shading.metallic === 1 ? 1 : .5, e.reflectivity = v(t.shading.metallic, .5));
|
|
459
|
+
let n = !1;
|
|
460
|
+
return t.shading.transmission && t.shading.transmission > 0 ? (e.opacity = 1 - t.shading.transmission, e.transparent = !0, e.depthWrite = !1, e.metalness = 0, n = !0) : t.shading.alpha !== void 0 && t.shading.alpha < 1 && (e.transparent = t.shading.alpha < 1, e.opacity = t.shading.alpha, e.depthWrite = t.shading.alpha >= 1, e.metalness = .5 * Math.max(0, t.shading.alpha), n = !0), e.aoMapIntensity = v(t.shading.occlusion, 1), e.roughness = v(t.shading.roughness, .5), e.alphaTest = v(t.shading.alphaCutoff, 0), B(e.color, t.shading.basecolor), n || t.shading.doubleSided ? e.side = 2 : e.side = 0, e;
|
|
461
|
+
}, Ee = (e, t) => {
|
|
462
|
+
let n = !1;
|
|
463
|
+
return t.shading.alpha !== void 0 && t.shading.alpha < 1 ? (e.transparent = !0, e.opacity = t.shading.alpha, e.depthWrite = !1, n = !0) : (e.transparent = !1, e.opacity = 1, e.depthWrite = !0), e.alphaTest = t.shading.alphaCutoff ?? 0, B(e.color, t.shading.basecolor), e.transmission = t.shading.transmission ?? 0, e.ior = Math.max(1, Math.min(2.33, t.shading.transmissionIOR ?? 1.5)), e.metalness = t.shading.metallic ?? 0, B(e.specularColor, t.shading.specularColor), e.specularIntensity = t.shading.specularity ?? 1, e.roughness = t.shading.roughness ?? 0, e.aoMapIntensity = t.shading.occlusion ?? 1, B(e.emissive, t.shading.emissiveColor), e.emissiveIntensity = t.shading.emissiveIntensity ?? 1, e.clearcoat = t.shading.clearcoatIntensity ?? 0, e.clearcoatRoughness = t.shading.clearcoatRoughness ?? 0, e.clearcoatNormalScale.setScalar(t.shading.clearcoatNormalScale ?? 1), B(e.sheenColor, t.shading.sheenColor), e.sheen = t.shading.sheenIntensity ?? 1, e.sheenRoughness = t.shading.sheenRoughness ?? 1, e.thickness = t.shading.thicknessFactor ?? 0, B(e.attenuationColor, t.shading.attenuationColor), t.shading.attenuationDistance && (e.attenuationDistance = t.shading.attenuationDistance), e.side = n || t.shading.doubleSided ? 2 : 0, e;
|
|
464
|
+
}, De = () => T.createMeshPhysicalMaterial({}), Oe = (e, t = 1) => t === 2 ? Ae(e) : ke(e), ke = (e) => {
|
|
465
|
+
let t = {
|
|
466
|
+
alpha: e.opacity,
|
|
467
|
+
metallic: e.reflectivity,
|
|
468
|
+
basecolor: V(e.color),
|
|
469
|
+
roughness: e.roughness,
|
|
470
|
+
doubleSided: e.side === 2,
|
|
471
|
+
alphaCutoff: e.alphaTest,
|
|
472
|
+
transmission: e.transmission
|
|
473
|
+
};
|
|
474
|
+
return e.metalness === 1 ? t.metallic = 1 : t.metallic = e.reflectivity, t;
|
|
475
|
+
}, Ae = (e) => ({
|
|
476
|
+
version: "2.0.0",
|
|
477
|
+
alpha: e.opacity,
|
|
478
|
+
alphaCutoff: e.alphaTest,
|
|
479
|
+
basecolor: V(e.color),
|
|
480
|
+
transmission: e.transmission,
|
|
481
|
+
transmissionIOR: e.ior,
|
|
482
|
+
metallic: e.metalness,
|
|
483
|
+
doubleSided: e.side === 2,
|
|
484
|
+
specularColor: V(e.specularColor),
|
|
485
|
+
specularity: e.specularIntensity,
|
|
486
|
+
roughness: e.roughness,
|
|
487
|
+
occlusion: e.aoMapIntensity,
|
|
488
|
+
emissiveColor: V(e.emissive),
|
|
489
|
+
emissiveIntensity: e.emissiveIntensity,
|
|
490
|
+
clearcoatIntensity: e.clearcoat,
|
|
491
|
+
clearcoatRoughness: e.clearcoatRoughness,
|
|
492
|
+
clearcoatNormalScale: e.clearcoatNormalScale.x,
|
|
493
|
+
sheenColor: V(e.sheenColor),
|
|
494
|
+
sheenIntensity: e.sheen,
|
|
495
|
+
sheenRoughness: e.sheenRoughness,
|
|
496
|
+
thicknessFactor: e.thickness,
|
|
497
|
+
attenuationColor: V(e.attenuationColor),
|
|
498
|
+
attenuationDistance: e.attenuationDistance
|
|
499
|
+
}), B = (e, n) => {
|
|
500
|
+
if (n !== void 0) {
|
|
501
|
+
let r = new t(n.r, n.g, n.b);
|
|
502
|
+
e.copy(r.convertSRGBToLinear());
|
|
503
|
+
}
|
|
504
|
+
}, V = (e) => {
|
|
505
|
+
let t = e.clone().convertLinearToSRGB();
|
|
506
|
+
return {
|
|
507
|
+
r: t.r,
|
|
508
|
+
g: t.g,
|
|
509
|
+
b: t.b
|
|
510
|
+
};
|
|
511
|
+
}, H = null, je = (e, t, n, r, i, a, o = 16) => {
|
|
512
|
+
H || (H = new u(), H.crossOrigin = "");
|
|
513
|
+
let s = H;
|
|
514
|
+
return new Promise((c, l) => {
|
|
515
|
+
if (!e) {
|
|
516
|
+
console.warn("trying to add a texture without image", t), c();
|
|
517
|
+
return;
|
|
518
|
+
}
|
|
519
|
+
s.load(e, (e) => {
|
|
520
|
+
U(e, t, n, r, i, a, o), c();
|
|
521
|
+
}, (e) => {
|
|
522
|
+
l(e);
|
|
523
|
+
});
|
|
524
|
+
});
|
|
525
|
+
}, U = (e, n, r, i, a, o, s = 16) => {
|
|
526
|
+
if (e.anisotropy = i, e.wrapS = l, e.wrapT = l, s <= 8 && [
|
|
527
|
+
_.ORM,
|
|
528
|
+
_.EMRGB,
|
|
529
|
+
_.CCRG,
|
|
530
|
+
_.CCXYZ,
|
|
531
|
+
_.SHRGBA,
|
|
532
|
+
_.SPRGBA,
|
|
533
|
+
_.TTRG
|
|
534
|
+
].includes(n.mapping)) {
|
|
535
|
+
console.warn("ORM maps are not supported on devices with only " + s + " texture units");
|
|
536
|
+
return;
|
|
537
|
+
}
|
|
538
|
+
e.repeat.set(a, o), Me(e, n, r), n.mapping === _.RGBA && (r.transparent = !0, r.userData.materialVersion === 1 && r.name.includes("glow") && (r.emissiveIntensity = .5, r.emissive = new t(16777215), r.emissiveMap = r.map)), r.needsUpdate = !0;
|
|
539
|
+
}, Me = (e, t, n) => {
|
|
540
|
+
t.mapping === _.XYZ ? (n.normalMap = e, n.map === R() && (n.map = null)) : t.mapping === _.ORM ? (n.aoMap = e, n.roughnessMap = e, n.metalnessMap = e) : t.mapping === _.EMRGB ? n.emissiveMap = e : t.mapping === _.CCRG ? (n.clearcoatMap = e, n.clearcoatRoughnessMap = e) : t.mapping === _.CCXYZ ? n.clearcoatNormalMap = e : t.mapping === _.SHRGBA ? (n.sheenColorMap = e, n.sheenRoughnessMap = e) : t.mapping === _.SPRGBA ? (n.specularColorMap = e, n.specularIntensityMap = e) : t.mapping === _.TTRG ? (n.transmissionMap = e, n.thicknessMap = e) : (e.colorSpace = h, n.map = e);
|
|
541
|
+
}, Ne = (e = !0) => {
|
|
542
|
+
if (!window.__RML_GUI__) {
|
|
543
|
+
if (!P) return null;
|
|
544
|
+
try {
|
|
545
|
+
window.__RML_GUI__ = new P({ autoPlace: e });
|
|
546
|
+
} catch {
|
|
547
|
+
return null;
|
|
548
|
+
}
|
|
549
|
+
}
|
|
550
|
+
return window.__RML_GUI__ ?? null;
|
|
551
|
+
}, Pe = (e, t) => {
|
|
552
|
+
let n = !1;
|
|
553
|
+
for (let r of t) {
|
|
554
|
+
let t = r.getKernelObject(), i;
|
|
555
|
+
t.wallType.value === w.OuterWallRight && (i = y(t.rightNormal)), t.wallType.value === w.OuterWallLeft && (i = y(t.leftNormal));
|
|
556
|
+
let a = !0;
|
|
557
|
+
if (i) {
|
|
558
|
+
let t = y(r.getPlanElement().getCenter());
|
|
559
|
+
t = t.applyMatrix4(e.matrixWorldInverse), i = i.transformDirection(e.matrixWorldInverse), a = t.dot(i) >= 0;
|
|
560
|
+
}
|
|
561
|
+
a !== r.getContainer().visible && (n = !0), a ? r.setContainerVisibility(!0) : r.isSelected || r.setContainerVisibility(!1);
|
|
562
|
+
}
|
|
563
|
+
return n;
|
|
564
|
+
}, Fe = (e, t, n = !0) => {
|
|
565
|
+
if (!e.userData.tween) if (t) if (e.transparent = !0, !n) e.opacity = .2;
|
|
566
|
+
else {
|
|
567
|
+
let t = { opacity: 1 };
|
|
568
|
+
e.userData.tween = !0;
|
|
569
|
+
let n = new M(t).to({ opacity: .2 }, 400).easing(E.Sinusoidal.In).onUpdate(() => {
|
|
570
|
+
e.opacity = t.opacity;
|
|
571
|
+
}).onComplete(() => {
|
|
572
|
+
e.userData.tween = !1, window.TWEEN?.remove(n);
|
|
573
|
+
}).start();
|
|
574
|
+
window.TWEEN?.add(n);
|
|
575
|
+
}
|
|
576
|
+
else if (!n) e.opacity = 1, e.transparent = !1;
|
|
577
|
+
else {
|
|
578
|
+
let t = { opacity: .2 };
|
|
579
|
+
e.userData.tween = !0;
|
|
580
|
+
let n = new M(t).to({ opacity: 1 }, 400).easing(E.Sinusoidal.In).onUpdate(() => {
|
|
581
|
+
e.opacity = t.opacity;
|
|
582
|
+
}).onComplete(() => {
|
|
583
|
+
e.transparent = !1, e.userData.tween = !1, window.TWEEN?.remove(n);
|
|
584
|
+
}).start();
|
|
585
|
+
window.TWEEN?.add(n);
|
|
586
|
+
}
|
|
587
|
+
}, Ie = (e, t, n, r, i, a) => {
|
|
588
|
+
let o = Le(n, r), s = i.clone().multiply(r).multiply(t), c = o.clone().invert(), l = c.clone().multiply(n), u = c.clone().multiply(r), d = { t: 0 }, f = new M(d).to({ t: 1 }, 400).easing(E.Quadratic.InOut).onUpdate(() => {
|
|
589
|
+
let n = Re(l, u, d.t);
|
|
590
|
+
G(e, i.clone().multiply(o).multiply(n).multiply(t)), a && a();
|
|
591
|
+
}).onComplete(() => {
|
|
592
|
+
G(e, s), a && a(), window.TWEEN?.remove(f);
|
|
593
|
+
}).onStop(() => {
|
|
594
|
+
window.TWEEN?.remove(f);
|
|
595
|
+
}).start();
|
|
596
|
+
return window.TWEEN?.add(f), f;
|
|
597
|
+
}, Le = (e, t) => {
|
|
598
|
+
let r = e.clone().invert().clone().multiply(t), i = new m(), a = new n();
|
|
599
|
+
r.decompose(i, a, new m());
|
|
600
|
+
let o = W(a), s = o.axis;
|
|
601
|
+
if (i.length() < .001 || Math.abs(o.angleRad) < .001 || s.length() < .001) return new d().identity();
|
|
602
|
+
let c = new m().setFromMatrixPosition(e), l = new m().setFromMatrixPosition(t), u = c.clone().sub(l), f = u.length(), p = new m().crossVectors(s, u).normalize();
|
|
603
|
+
u = new m().crossVectors(p, s).normalize();
|
|
604
|
+
let h = c.clone().add(l).multiplyScalar(.5);
|
|
605
|
+
return h = h.sub(p.clone().multiplyScalar(f * .5 / Math.tan(o.angleRad * .5))), new d().makeBasis(p, s, u).setPosition(h);
|
|
606
|
+
}, W = (e) => {
|
|
607
|
+
let t = Math.sqrt(1 - e.w * e.w);
|
|
608
|
+
return {
|
|
609
|
+
axis: new m(e.x, e.y, e.z).multiplyScalar(t === 0 ? 1 : 1 / t),
|
|
610
|
+
angleRad: 2 * Math.acos(e.w)
|
|
611
|
+
};
|
|
612
|
+
}, G = (e, t) => {
|
|
613
|
+
e.updateMatrix(), t.multiply(e.matrix.clone().invert()), e.applyMatrix4(t), e.updateMatrix();
|
|
614
|
+
}, Re = (e, t, r) => {
|
|
615
|
+
let i = new m(), a = new n(), o = new m();
|
|
616
|
+
e.decompose(i, a, o);
|
|
617
|
+
let s = new m(), c = new n(), l = new m();
|
|
618
|
+
t.decompose(s, c, l);
|
|
619
|
+
let u = new m().lerpVectors(i, s, r), f = new n().slerpQuaternions(a, c, r), p = W(a.clone().conjugate().multiply(c));
|
|
620
|
+
if (p.angleRad > Math.PI && (p.angleRad -= 2 * Math.PI), Math.abs(p.angleRad) > b(1) && i.length() > .001 && s.length() > .001) {
|
|
621
|
+
let e = i.clone().normalize().dot(s.clone().normalize());
|
|
622
|
+
if (Math.abs(e) < .999) {
|
|
623
|
+
let t = new m().crossVectors(i, s), a = new n().setFromAxisAngle(t.normalize(), Math.acos(e) * r), o = i.length() * r + s.length() * (1 - r);
|
|
624
|
+
u = i.applyQuaternion(a).normalize().multiplyScalar(o);
|
|
625
|
+
}
|
|
626
|
+
}
|
|
627
|
+
let h = new m().lerpVectors(o, l, r), g = new d();
|
|
628
|
+
return g.compose(u, f, h), g;
|
|
629
|
+
}, ze = (e) => {
|
|
630
|
+
let n = new t();
|
|
631
|
+
return n.setRGB((e >> 16) / 255, (e >> 8 & 255) / 255, (e >> 0 & 255) / 255), n;
|
|
632
|
+
}, K = (e, t) => {
|
|
633
|
+
t.transparent || (e.transparent = t.transparent, delete e.userData.postProcessingMaterialPlugin), e.opacity = t.opacity, e.needsUpdate = !0;
|
|
634
|
+
}, Be = (e, t) => new Promise((n) => {
|
|
635
|
+
e.traverse((e) => {
|
|
636
|
+
if (e instanceof f) {
|
|
637
|
+
let r = e.material;
|
|
638
|
+
e.userData.tween && e.userData.tween.stop();
|
|
639
|
+
let i = { opacity: r.opacity };
|
|
640
|
+
t.transparent && (r.transparent = t.transparent);
|
|
641
|
+
let a = new M(i);
|
|
642
|
+
a.toJSON = () => void 0, e.userData.tween = a, window.TWEEN?.add(a.to(t, 250).easing(E.Linear.None).onUpdate(() => {
|
|
643
|
+
r.opacity = i.opacity;
|
|
644
|
+
}).onStop(() => {
|
|
645
|
+
K(r, t), e.userData.tween = void 0;
|
|
646
|
+
}).onComplete(() => {
|
|
647
|
+
K(r, t), e.userData.tween = void 0, window.TWEEN?.remove(a), n();
|
|
648
|
+
}).start());
|
|
649
|
+
}
|
|
650
|
+
});
|
|
651
|
+
}), Ve = (e) => {
|
|
652
|
+
e.traverse((e) => {
|
|
653
|
+
if (e instanceof f) {
|
|
654
|
+
let t = e.material;
|
|
655
|
+
if (t.opacity === 0) return;
|
|
656
|
+
let n = {
|
|
657
|
+
opacity: 0,
|
|
658
|
+
transparent: !0
|
|
659
|
+
}, r = {
|
|
660
|
+
opacity: t.opacity,
|
|
661
|
+
transparent: t.transparent
|
|
662
|
+
};
|
|
663
|
+
t.transparent = n.transparent, t.opacity = n.opacity;
|
|
664
|
+
let i = new M(n).to(r, 500).easing(E.Linear.None).onUpdate(() => {
|
|
665
|
+
t.opacity = n.opacity;
|
|
666
|
+
}).onComplete(() => {
|
|
667
|
+
t.transparent = r.transparent, window.TWEEN?.remove(i);
|
|
668
|
+
}).start();
|
|
669
|
+
window.TWEEN?.add(i);
|
|
670
|
+
}
|
|
671
|
+
});
|
|
672
|
+
}, He = (e, t) => {
|
|
673
|
+
let n = new o().setFromObject(e), r = n.getSize(new m()), i = Math.min(r.x, r.y, r.z), a = !0;
|
|
674
|
+
return i > 5 && (console.warn("GLB seems to be too big (" + i + ")", t), a = !1), n.min.y < -.01 && (console.warn("GLB seems to be under the floor (" + n.min.y + "): ", t), a = !1), a;
|
|
675
|
+
}, Ue = (e) => {
|
|
676
|
+
e.type === "Mesh" ? J(e) : q(e);
|
|
677
|
+
}, q = (e) => {
|
|
678
|
+
!e || !e.children || e.children.length === 0 || e.children.forEach((e) => {
|
|
679
|
+
J(e);
|
|
680
|
+
});
|
|
681
|
+
}, J = (e) => {
|
|
682
|
+
e && (e.material && X(e.material), e.geometry && Y(e.geometry), e.children && e.children.length > 0 && q(e));
|
|
683
|
+
}, Y = (e) => {
|
|
684
|
+
e && e.dispose();
|
|
685
|
+
}, X = (e) => {
|
|
686
|
+
e && (e.map && e.map.dispose(), e.normalMap && e.normalMap.dispose(), e.dispose());
|
|
687
|
+
}, Z, We = () => (Z || (Z = new a(), Z.visible = !1), Z), Q, Ge = (e) => (Q ||= T.createMeshStandardMaterial({
|
|
688
|
+
color: e || "#FF0000",
|
|
689
|
+
transparent: !0,
|
|
690
|
+
opacity: .5,
|
|
691
|
+
visible: !0,
|
|
692
|
+
polygonOffset: !0,
|
|
693
|
+
polygonOffsetFactor: -1
|
|
694
|
+
}), Q), Ke = (e) => e.x === 0 && e.y === 0 && e.z === 0, qe = (e, t) => {
|
|
695
|
+
let n = "";
|
|
696
|
+
return !e && e !== "" ? null : (e.materialId && e.materialId !== "" ? n = e.materialId : e.catalogItemId && e.catalogItemId !== "" ? n = e.catalogItemId : e.rgbValue > 0 ? n = "rgb" + JSON.stringify(e.rgbValue) : e.length > 0 ? n = e : t && t.value === C.WALL ? n = "default_wall_material_" + e.getSourceType().value : t && t.value === C.CEILING && (n = "default_ceiling_material_" + e.getSourceType().value), n);
|
|
697
|
+
}, Je = (e) => {
|
|
698
|
+
let t = e.getWorldDirection(new m()).clone();
|
|
699
|
+
t.y = 0, t.lengthSq() < .01 && (t = new m(0, 1, 0), t.applyQuaternion(e.quaternion), t.y = 0), t.normalize();
|
|
700
|
+
let n = Math.asin(t.x);
|
|
701
|
+
return t.z < 0 && (n = Math.PI - n), n < 0 && (n += Math.PI * 2), n;
|
|
702
|
+
}, $ = (e, t) => {
|
|
703
|
+
if (!e || !t) return 0;
|
|
704
|
+
let n = e.clone().expandByScalar(.001).containsBox(t), r = t.clone().expandByScalar(.001).containsBox(e);
|
|
705
|
+
return r && n || !r && !n ? 0 : n === !0 ? 1 : -1;
|
|
706
|
+
}, Ye = (e, t) => {
|
|
707
|
+
if (!e || !t) return 0;
|
|
708
|
+
let n = e.clone().expandByScalar(.001).containsBox(t), r = t.clone().expandByScalar(.001).containsBox(e);
|
|
709
|
+
if (r && n) return 0;
|
|
710
|
+
if (!r && !n) {
|
|
711
|
+
let n = Xe(e, t);
|
|
712
|
+
return n === .5 ? 0 : n > .5 ? -1 : 1;
|
|
713
|
+
}
|
|
714
|
+
return n === !0 ? 1 : -1;
|
|
715
|
+
}, Xe = (e, t) => {
|
|
716
|
+
let n = new o();
|
|
717
|
+
if (n.copy(e).intersect(t), n.isEmpty()) return 0;
|
|
718
|
+
let r = (e) => {
|
|
719
|
+
let t = new m();
|
|
720
|
+
return e.getSize(t), t.x * t.y * t.z;
|
|
721
|
+
}, i = r(e), a = r(n);
|
|
722
|
+
return i === 0 ? 0 : a / i;
|
|
723
|
+
}, Ze = (e) => e[0] === 1 && e[1] === 0 && e[2] === 0 && e[3] === 1 && e[4] === 0 && e[5] === 0, Qe = (e, t, n, r = 1) => {
|
|
724
|
+
let i = t > n, a = i ? 15 : 0, s = i ? 0 : 10, c = e.getSize(new m()), l = e.getCenter(new m()), u = c.x > 2 * a ? c.x / 2 : a, d = c.z > 2 * s ? c.z / 2 : s;
|
|
725
|
+
return u *= r, d *= r, new o(new m(l.x - u, l.y, l.z - d), new m(l.x + u, l.y, l.z + d));
|
|
726
|
+
}, $e = (e) => {
|
|
727
|
+
let { x: t, y: n } = e;
|
|
728
|
+
return {
|
|
729
|
+
x: t,
|
|
730
|
+
y: n
|
|
731
|
+
};
|
|
732
|
+
}, et = (e) => {
|
|
733
|
+
let { x: t, y: n, z: r } = e;
|
|
734
|
+
return {
|
|
735
|
+
x: t,
|
|
736
|
+
y: n,
|
|
737
|
+
z: r
|
|
738
|
+
};
|
|
739
|
+
}, tt = (e, t, n) => new m().setFromSphericalCoords(e, Math.PI * (1 - n), Math.PI * 2 * (1 - t)), nt = (e) => {
|
|
740
|
+
let t = new r();
|
|
741
|
+
return e.environment && (t.environment = e.environment.clone()), e.userData.environmentDefinition && (t.userData.environmentDefinition = e.userData.environmentDefinition.clone()), t.userData.shadowFromEnvironment = e.userData.shadowFromEnvironment, t;
|
|
742
|
+
}, rt = (e, t) => {
|
|
743
|
+
let n = new p(), r = new d().multiplyMatrices(e.projectionMatrix, e.matrixWorldInverse);
|
|
744
|
+
n.setFromProjectionMatrix(r);
|
|
745
|
+
let i = t.getCenter(new m());
|
|
746
|
+
return n.containsPoint(i);
|
|
747
|
+
}, it = (e) => {
|
|
748
|
+
e.lights_fragment_begin = "\n vec3 geometryPosition = - vViewPosition;\n vec3 geometryNormal = normal;\n vec3 geometryViewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( vViewPosition );\n vec3 geometryClearcoatNormal = vec3( 0.0 );\n #ifdef USE_CLEARCOAT\n geometryClearcoatNormal = clearcoatNormal;\n #endif\n\n // OPTIMIZATION: Early exit for transparent/invisible materials\n #ifdef USE_ALPHATEST\n if ( diffuseColor.a < alphaTest ) discard;\n #endif\n\n // OPTIMIZATION: Cache expensive calculations\n float NdotV = saturate( dot( geometryNormal, geometryViewDir ) );\n\n #ifdef USE_IRIDESCENCE\n float dotNVi = NdotV; // Reuse calculated value\n if ( material.iridescenceThickness == 0.0 ) {\n material.iridescence = 0.0;\n } else {\n material.iridescence = saturate( material.iridescence );\n }\n // OPTIMIZATION: Skip iridescence calculations if effect is minimal\n if ( material.iridescence > 0.01 ) {\n material.iridescenceFresnel = evalIridescence( 1.0, material.iridescenceIOR, dotNVi, material.iridescenceThickness, material.specularColor );\n material.iridescenceF0 = Schlick_to_F0( material.iridescenceFresnel, 1.0, dotNVi );\n }\n #endif\n\n IncidentLight directLight;\n\n // OPTIMIZATION: Early exit if material has no metalness or roughness variation\n #ifdef USE_ROUGHNESSMAP\n bool hasRoughnessVariation = true;\n #else\n bool hasRoughnessVariation = false;\n #endif\n\n #ifdef USE_METALNESSMAP\n bool hasMetalnessVariation = true;\n #else\n bool hasMetalnessVariation = false;\n #endif\n\n #if ( NUM_POINT_LIGHTS > 0 ) && defined( RE_Direct )\n PointLight pointLight;\n #if defined( USE_SHADOWMAP ) && NUM_POINT_LIGHT_SHADOWS > 0\n PointLightShadow pointLightShadow;\n #endif\n #pragma unroll_loop_start\n for ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n pointLight = pointLights[ i ];\n getPointLightInfo( pointLight, geometryPosition, directLight );\n\n // OPTIMIZATION: Enhanced visibility and distance checks\n #if defined( RE_Direct )\n if ( directLight.visible ) {\n // OPTIMIZATION: Skip lights with negligible contribution based on color intensity\n float lightIntensity = dot( directLight.color, vec3( 0.299, 0.587, 0.114 ) );\n if ( lightIntensity > 0.001 ) {\n #if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_POINT_LIGHT_SHADOWS )\n pointLightShadow = pointLightShadows[ i ];\n directLight.color *= ( directLight.visible && receiveShadow ) ? getPointShadow( pointShadowMap[ i ], pointLightShadow.shadowMapSize, pointLightShadow.shadowIntensity, pointLightShadow.shadowBias, pointLightShadow.shadowRadius, vPointShadowCoord[ i ], pointLightShadow.shadowCameraNear, pointLightShadow.shadowCameraFar ) : 1.0;\n #endif\n RE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );\n }\n }\n #endif\n }\n #pragma unroll_loop_end\n #endif\n\n #if ( NUM_SPOT_LIGHTS > 0 ) && defined( RE_Direct )\n SpotLight spotLight;\n vec4 spotColor;\n vec3 spotLightCoord;\n bool inSpotLightMap;\n #if defined( USE_SHADOWMAP ) && NUM_SPOT_LIGHT_SHADOWS > 0\n SpotLightShadow spotLightShadow;\n #endif\n #pragma unroll_loop_start\n for ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n spotLight = spotLights[ i ];\n getSpotLightInfo( spotLight, geometryPosition, directLight );\n\n // OPTIMIZATION: Enhanced visibility checks for spot lights\n #if defined( RE_Direct )\n if ( directLight.visible ) {\n // OPTIMIZATION: Skip spot light map calculation if light contribution is minimal\n float lightIntensity = dot( directLight.color, vec3( 0.299, 0.587, 0.114 ) );\n if ( lightIntensity > 0.001 ) {\n #if ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS )\n #define SPOT_LIGHT_MAP_INDEX UNROLLED_LOOP_INDEX\n #elif ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )\n #define SPOT_LIGHT_MAP_INDEX NUM_SPOT_LIGHT_MAPS\n #else\n #define SPOT_LIGHT_MAP_INDEX ( UNROLLED_LOOP_INDEX - NUM_SPOT_LIGHT_SHADOWS + NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS )\n #endif\n #if ( SPOT_LIGHT_MAP_INDEX < NUM_SPOT_LIGHT_MAPS )\n spotLightCoord = vSpotLightCoord[ i ].xyz / vSpotLightCoord[ i ].w;\n inSpotLightMap = all( lessThan( abs( spotLightCoord * 2. - 1. ), vec3( 1.0 ) ) );\n if ( inSpotLightMap ) {\n spotColor = texture2D( spotLightMap[ SPOT_LIGHT_MAP_INDEX ], spotLightCoord.xy );\n directLight.color = directLight.color * spotColor.rgb;\n }\n #endif\n #undef SPOT_LIGHT_MAP_INDEX\n #if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )\n spotLightShadow = spotLightShadows[ i ];\n directLight.color *= ( directLight.visible && receiveShadow ) ? getShadow( spotShadowMap[ i ], spotLightShadow.shadowMapSize, spotLightShadow.shadowIntensity, spotLightShadow.shadowBias, spotLightShadow.shadowRadius, vSpotLightCoord[ i ] ) : 1.0;\n #endif\n RE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );\n }\n }\n #endif\n }\n #pragma unroll_loop_end\n #endif\n\n #if ( NUM_DIR_LIGHTS > 0 ) && defined( RE_Direct )\n DirectionalLight directionalLight;\n #if defined( USE_SHADOWMAP ) && NUM_DIR_LIGHT_SHADOWS > 0\n DirectionalLightShadow directionalLightShadow;\n #endif\n #pragma unroll_loop_start\n for ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n directionalLight = directionalLights[ i ];\n getDirectionalLightInfo( directionalLight, directLight );\n\n // OPTIMIZATION: Skip very dim directional lights\n #if defined( RE_Direct )\n float lightIntensity = dot( directLight.color, vec3( 0.299, 0.587, 0.114 ) );\n if ( directLight.visible && lightIntensity > 0.001 ) {\n #if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_DIR_LIGHT_SHADOWS )\n directionalLightShadow = directionalLightShadows[ i ];\n directLight.color *= ( directLight.visible && receiveShadow ) ? getShadow( directionalShadowMap[ i ], directionalLightShadow.shadowMapSize, directionalLightShadow.shadowIntensity, directionalLightShadow.shadowBias, directionalLightShadow.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n #endif\n RE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );\n }\n #endif\n }\n #pragma unroll_loop_end\n #endif\n\n #if ( NUM_RECT_AREA_LIGHTS > 0 ) && defined( RE_Direct_RectArea )\n RectAreaLight rectAreaLight;\n #pragma unroll_loop_start\n for ( int i = 0; i < NUM_RECT_AREA_LIGHTS; i ++ ) {\n rectAreaLight = rectAreaLights[ i ];\n // OPTIMIZATION: Simple rect area light processing - Three.js handles distance internally\n RE_Direct_RectArea( rectAreaLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );\n }\n #pragma unroll_loop_end\n #endif\n\n // OPTIMIZATION: Streamlined indirect lighting with early exits\n #if defined( RE_IndirectDiffuse )\n vec3 iblIrradiance = vec3( 0.0 );\n vec3 irradiance = getAmbientLightIrradiance( ambientLightColor );\n\n // OPTIMIZATION: Skip light probe calculation if ambient is sufficient\n float ambientIntensity = dot( irradiance, vec3( 0.299, 0.587, 0.114 ) );\n\n #if defined( USE_LIGHT_PROBES )\n if ( ambientIntensity < 0.9 ) {\n irradiance += getLightProbeIrradiance( lightProbe, geometryNormal );\n }\n #endif\n\n #if ( NUM_HEMI_LIGHTS > 0 )\n if ( ambientIntensity < 0.9 ) {\n #pragma unroll_loop_start\n for ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\n vec3 hemiContribution = getHemisphereLightIrradiance( hemisphereLights[ i ], geometryNormal );\n // OPTIMIZATION: Skip negligible hemisphere light contributions\n if ( dot( hemiContribution, vec3( 0.299, 0.587, 0.114 ) ) > 0.001 ) {\n irradiance += hemiContribution;\n }\n }\n #pragma unroll_loop_end\n }\n #endif\n #endif\n\n #if defined( RE_IndirectSpecular )\n vec3 radiance = vec3( 0.0 );\n vec3 clearcoatRadiance = vec3( 0.0 );\n #endif", e.lights_pars_begin = e.lights_pars_begin.replace("light.color = pointLight.color;", "\n light.color = pointLight.color * step( lightDistance, pointLight.distance );\n ");
|
|
749
|
+
};
|
|
750
|
+
//#endregion
|
|
751
|
+
export { M as $, _e as A, Ce as B, ze as C, qe as D, Ne as E, rt as F, Fe as G, Se as H, Ze as I, Be as J, $e as K, ye as L, ve as M, Je as N, Oe as O, Pe as P, O as Q, be as R, Ye as S, Qe as T, z as U, xe as V, G as W, tt as X, Ke as Y, E as Z, X as _, me as a, C as at, Ve as b, U as c, ne as ct, He as d, ie as dt, T as et, $ as f, x as ft, Y as g, Ue as h, pe as i, oe as it, F as j, I as k, je as l, te as lt, we as m, ge as n, ce as nt, ue as o, ae as ot, nt as p, b as pt, et as q, fe as r, se as rt, de as s, re as st, he as t, le as tt, Ie as u, ee as ut, J as v, Ge as w, We as x, q as y, it as z };
|
|
752
|
+
|
|
753
|
+
//# sourceMappingURL=threejs-utils-Bq4pVWBA.mjs.map
|