@roomle/web-sdk 2.44.0-alpha.1 → 2.44.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/.releaserc.json +55 -58
- package/README.md +3 -0
- package/lib/{banana-for-scale-c9b91436.nomodule.js → banana-for-scale-58aa07e7.nomodule.js} +2 -2
- package/lib/{banana-for-scale-c9b91436.nomodule.js.map → banana-for-scale-58aa07e7.nomodule.js.map} +1 -1
- package/lib/{banana-for-scale-1f350acc.js → banana-for-scale-b0cad920.js} +2 -2
- package/lib/{banana-for-scale-1f350acc.js.map → banana-for-scale-b0cad920.js.map} +1 -1
- package/lib/{budgeteer-measure-1e85a5b9.js → budgeteer-measure-23a42ba1.js} +2 -2
- package/lib/budgeteer-measure-23a42ba1.js.map +1 -0
- package/lib/budgeteer-measure.nomodule.js +1 -1
- package/lib/budgeteer-measure.nomodule.js.map +1 -1
- package/lib/{component-dimensioning-11e334e6.nomodule.js → component-dimensioning-3e2b21b8.nomodule.js} +2 -2
- package/lib/component-dimensioning-3e2b21b8.nomodule.js.map +1 -0
- package/lib/{component-dimensioning-8b90144f.js → component-dimensioning-c2294a31.js} +2 -2
- package/lib/component-dimensioning-c2294a31.js.map +1 -0
- package/lib/{component-raycast-helper-917c5fce.nomodule.js → component-raycast-helper-0b429141.nomodule.js} +2 -2
- package/lib/component-raycast-helper-0b429141.nomodule.js.map +1 -0
- package/lib/{component-raycast-helper-d34cf336.js → component-raycast-helper-96be30dc.js} +2 -2
- package/lib/component-raycast-helper-96be30dc.js.map +1 -0
- package/lib/{configurator-fb2e05ef.js → configurator-1a9502eb.js} +2 -2
- package/lib/configurator-1a9502eb.js.map +1 -0
- package/lib/{configurator-74c366d0.nomodule.js → configurator-ad930002.nomodule.js} +2 -2
- package/lib/configurator-ad930002.nomodule.js.map +1 -0
- package/lib/configurator-dummy-app.js.map +1 -1
- package/lib/configurator-dummy.html +167 -79
- package/lib/configurator-main-d4d311c0.js +2 -0
- package/lib/configurator-main-d4d311c0.js.map +1 -0
- package/lib/configurator-main.nomodule.js +1 -1
- package/lib/{default-light-setting-43be6138.js → default-light-setting-17aeb133.js} +2 -2
- package/lib/default-light-setting-17aeb133.js.map +1 -0
- package/lib/{default-light-setting-e2fe40ee.nomodule.js → default-light-setting-917cc079.nomodule.js} +2 -2
- package/lib/default-light-setting-917cc079.nomodule.js.map +1 -0
- package/lib/definitions/common-core/src/lightsetting/dynamic-light-setting-loader.d.ts +1 -1
- package/lib/definitions/configurator-core/src/roomle-configurator.d.ts +58 -58
- package/lib/definitions/planner-core/src/roomle-planner-ui-callback.d.ts +1 -0
- package/lib/{dimensioning-helper-5d68f7b8.nomodule.js → dimensioning-helper-0995e4b8.nomodule.js} +2 -2
- package/lib/dimensioning-helper-0995e4b8.nomodule.js.map +1 -0
- package/lib/{dimensioning-helper-439a1eab.js → dimensioning-helper-b166264a.js} +2 -2
- package/lib/{dimensioning-helper-439a1eab.js.map → dimensioning-helper-b166264a.js.map} +1 -1
- package/lib/embedding-dummy.html +122 -94
- package/lib/{glb-viewer-d2d45ce4.js → glb-viewer-45e04caa.js} +2 -2
- package/lib/{glb-viewer-d2d45ce4.js.map → glb-viewer-45e04caa.js.map} +1 -1
- package/lib/glb-viewer-dummy-app.js.map +1 -1
- package/lib/glb-viewer-dummy.html +44 -30
- package/lib/{glb-viewer-185f0c5b.nomodule.js → glb-viewer-f5f9a050.nomodule.js} +2 -2
- package/lib/{glb-viewer-185f0c5b.nomodule.js.map → glb-viewer-f5f9a050.nomodule.js.map} +1 -1
- package/lib/glb-viewer-main-be603c6d.js +2 -0
- package/lib/glb-viewer-main-be603c6d.js.map +1 -0
- package/lib/glb-viewer-main.nomodule.js +1 -1
- package/lib/legacy/{banana-for-scale-35cca9b6.legacy.js → banana-for-scale-2021b8ce.legacy.js} +2 -2
- package/lib/legacy/{banana-for-scale-35cca9b6.legacy.js.map → banana-for-scale-2021b8ce.legacy.js.map} +1 -1
- package/lib/legacy/budgeteer-measure.legacy.js +1 -1
- package/lib/legacy/budgeteer-measure.legacy.js.map +1 -1
- package/lib/legacy/{component-dimensioning-9aeb85f3.legacy.js → component-dimensioning-f4289533.legacy.js} +2 -2
- package/lib/legacy/component-dimensioning-f4289533.legacy.js.map +1 -0
- package/lib/legacy/{component-raycast-helper-c9e6fa8a.legacy.js → component-raycast-helper-afb624ed.legacy.js} +2 -2
- package/lib/legacy/component-raycast-helper-afb624ed.legacy.js.map +1 -0
- package/lib/legacy/{configurator-0dc9d32c.legacy.js → configurator-431855b5.legacy.js} +2 -2
- package/lib/legacy/configurator-431855b5.legacy.js.map +1 -0
- package/lib/legacy/configurator-main.legacy.js +1 -1
- package/lib/legacy/{default-light-setting-bb797007.legacy.js → default-light-setting-29282b63.legacy.js} +2 -2
- package/lib/legacy/default-light-setting-29282b63.legacy.js.map +1 -0
- package/lib/legacy/{dimensioning-helper-9d5a7b3c.legacy.js → dimensioning-helper-b5001288.legacy.js} +2 -2
- package/lib/legacy/dimensioning-helper-b5001288.legacy.js.map +1 -0
- package/lib/legacy/{glb-viewer-069756aa.legacy.js → glb-viewer-0020898e.legacy.js} +2 -2
- package/lib/legacy/{glb-viewer-069756aa.legacy.js.map → glb-viewer-0020898e.legacy.js.map} +1 -1
- package/lib/legacy/glb-viewer-main.legacy.js +1 -1
- package/lib/legacy/{main-thread-to-worker-f535fe2c.legacy.js → main-thread-to-worker-cc24f989.legacy.js} +1 -1
- package/lib/legacy/main-thread-to-worker-cc24f989.legacy.js.map +1 -0
- package/lib/legacy/{material-viewer-a96582f6.legacy.js → material-viewer-51065b97.legacy.js} +2 -2
- package/lib/legacy/material-viewer-51065b97.legacy.js.map +1 -0
- package/lib/legacy/material-viewer-main.legacy.js +1 -1
- package/lib/legacy/{pixotron-4d1c8db2.legacy.js → pixotron-e0f1cf47.legacy.js} +2 -2
- package/lib/legacy/{pixotron-4d1c8db2.legacy.js.map → pixotron-e0f1cf47.legacy.js.map} +1 -1
- package/lib/legacy/planner-1af4bef2.legacy.js +2 -0
- package/lib/legacy/{planner-3334d9c4.legacy.js.map → planner-1af4bef2.legacy.js.map} +1 -1
- package/lib/legacy/planner-main.legacy.js +1 -1
- package/lib/legacy/{roomle-configurator-cd107a29.legacy.js → roomle-configurator-40f860e2.legacy.js} +2 -2
- package/lib/legacy/{roomle-configurator-cd107a29.legacy.js.map → roomle-configurator-40f860e2.legacy.js.map} +1 -1
- package/lib/legacy/roomle-dependency-injection-c465c69e.legacy.js +16 -0
- package/lib/legacy/{roomle-dependency-injection-aa414f84.legacy.js.map → roomle-dependency-injection-c465c69e.legacy.js.map} +1 -1
- package/lib/legacy/roomle-sdk.legacy.js +1 -1
- package/lib/legacy/{script-loader-37d724e7.legacy.js → script-loader-f53b8215.legacy.js} +2 -2
- package/lib/legacy/script-loader-f53b8215.legacy.js.map +1 -0
- package/lib/legacy/static/DepthShadowGenerator-a3a9d85ff2c3d24c.js +266 -0
- package/lib/legacy/static/Tween-5ebfb82307807fdc.js +767 -0
- package/lib/legacy/static/{asset-loader.worker-7fdd71efd75f50d4.js → asset-loader.worker-caa87aba0f76ce49.js} +1 -1
- package/lib/legacy/static/{budgeteer.sw-6e3fb7e14289ed96.js → budgeteer.sw-0a8d4e36e18346a5.js} +1 -1
- package/lib/legacy/static/camera-05824b47cdb951e4.json +39 -0
- package/lib/legacy/static/dat.gui.min-24a0d861d5534d62.js +2447 -0
- package/lib/legacy/static/rubik_regular-bc008a7de2daee79.json +3535 -0
- package/lib/legacy/static/rubik_regular_sub-2dd2d5cca49018c5.json +168 -0
- package/lib/{static/shaders-af852933f81878aa.json → legacy/static/shaders-88030e4fbae39928.json} +1 -1
- package/lib/legacy/{stats-helper-358f1fcc.legacy.js → stats-helper-951a6039.legacy.js} +2 -2
- package/lib/legacy/{stats-helper-358f1fcc.legacy.js.map → stats-helper-951a6039.legacy.js.map} +1 -1
- package/lib/legacy/{tools-core-f3b4d22c.legacy.js → tools-core-8e9fd5dd.legacy.js} +2 -2
- package/lib/legacy/tools-core-8e9fd5dd.legacy.js.map +1 -0
- package/lib/{main-thread-to-worker-31ec8d3a.nomodule.js → main-thread-to-worker-6a4eb1ee.nomodule.js} +1 -1
- package/lib/main-thread-to-worker-6a4eb1ee.nomodule.js.map +1 -0
- package/lib/{main-thread-to-worker-e9986fa8.js → main-thread-to-worker-88f74244.js} +1 -1
- package/lib/main-thread-to-worker-88f74244.js.map +1 -0
- package/lib/{material-viewer-2db93afe.nomodule.js → material-viewer-2df0572f.nomodule.js} +2 -2
- package/lib/material-viewer-2df0572f.nomodule.js.map +1 -0
- package/lib/{material-viewer-e7514f95.js → material-viewer-ca21925a.js} +2 -2
- package/lib/material-viewer-ca21925a.js.map +1 -0
- package/lib/material-viewer-dummy-app.js.map +1 -1
- package/lib/material-viewer-dummy.html +39 -22
- package/lib/material-viewer-main-5b2d8fb1.js +2 -0
- package/lib/material-viewer-main-5b2d8fb1.js.map +1 -0
- package/lib/material-viewer-main.nomodule.js +1 -1
- package/lib/measure.html +27 -34
- package/lib/{pixotron-e1f44e21.js → pixotron-32c4e05d.js} +2 -2
- package/lib/{pixotron-e1f44e21.js.map → pixotron-32c4e05d.js.map} +1 -1
- package/lib/{pixotron-11d8ecf1.nomodule.js → pixotron-3be821e5.nomodule.js} +2 -2
- package/lib/{pixotron-11d8ecf1.nomodule.js.map → pixotron-3be821e5.nomodule.js.map} +1 -1
- package/lib/planner-07dfff6d.js +2 -0
- package/lib/{planner-b9697b33.js.map → planner-07dfff6d.js.map} +1 -1
- package/lib/planner-21a6fccd.nomodule.js +2 -0
- package/lib/{planner-2fb083b9.nomodule.js.map → planner-21a6fccd.nomodule.js.map} +1 -1
- package/lib/planner-dummy-app.js.map +1 -1
- package/lib/planner-dummy.html +64 -43
- package/lib/planner-main-8a56d68d.js +2 -0
- package/lib/planner-main-8a56d68d.js.map +1 -0
- package/lib/planner-main.nomodule.js +1 -1
- package/lib/{roomle-configurator-e2cafe97.nomodule.js → roomle-configurator-072f6af1.nomodule.js} +2 -2
- package/lib/{roomle-configurator-e2cafe97.nomodule.js.map → roomle-configurator-072f6af1.nomodule.js.map} +1 -1
- package/lib/{roomle-configurator-3bc0f646.js → roomle-configurator-21e1c87c.js} +2 -2
- package/lib/{roomle-configurator-3bc0f646.js.map → roomle-configurator-21e1c87c.js.map} +1 -1
- package/lib/{roomle-dependency-injection-244ed68c.js → roomle-dependency-injection-8d66ecac.js} +3 -3
- package/lib/{roomle-dependency-injection-244ed68c.js.map → roomle-dependency-injection-8d66ecac.js.map} +1 -1
- package/lib/{legacy/roomle-dependency-injection-aa414f84.legacy.js → roomle-dependency-injection-f0b933f6.nomodule.js} +13 -13
- package/lib/{roomle-dependency-injection-4c51790a.nomodule.js.map → roomle-dependency-injection-f0b933f6.nomodule.js.map} +1 -1
- package/lib/{roomle-sdk-9cc773d7.js → roomle-sdk-038a1704.js} +2 -2
- package/lib/roomle-sdk-038a1704.js.map +1 -0
- package/lib/roomle-sdk.nomodule.js +1 -1
- package/lib/{script-loader-584a0480.js → script-loader-a1d7afdd.js} +2 -2
- package/lib/script-loader-a1d7afdd.js.map +1 -0
- package/lib/{script-loader-ff5cfb68.nomodule.js → script-loader-c56ceed8.nomodule.js} +2 -2
- package/lib/script-loader-c56ceed8.nomodule.js.map +1 -0
- package/lib/static/{DepthShadowGenerator-4c4b06f0801c4034.js → DepthShadowGenerator-a3a9d85ff2c3d24c.js} +0 -0
- package/lib/static/DepthShadowGenerator-a3a9d85ff2c3d24c.js.map +1 -0
- package/lib/static/{Tween-d024b02fe34f25ab.js → Tween-5ebfb82307807fdc.js} +0 -0
- package/lib/static/Tween-5ebfb82307807fdc.js.map +1 -0
- package/lib/static/{asset-loader.worker-7fdd71efd75f50d4.js → asset-loader.worker-caa87aba0f76ce49.js} +1 -1
- package/lib/static/{asset-loader.worker-7fdd71efd75f50d4.js.map → asset-loader.worker-caa87aba0f76ce49.js.map} +0 -0
- package/lib/static/asset-loader.worker.js +1 -1
- package/lib/static/{budgeteer.sw-6e3fb7e14289ed96.js → budgeteer.sw-0a8d4e36e18346a5.js} +1 -1
- package/lib/static/{budgeteer.sw-6e3fb7e14289ed96.js.map → budgeteer.sw-0a8d4e36e18346a5.js.map} +0 -0
- package/lib/static/budgeteer.sw.js +1 -1
- package/lib/static/camera-05824b47cdb951e4.json +39 -0
- package/lib/static/{dat.gui.min-b5cbb61e5c62f0bf.js → dat.gui.min-24a0d861d5534d62.js} +0 -0
- package/lib/static/dat.gui.min-24a0d861d5534d62.js.map +1 -0
- package/lib/static/rubik_regular-bc008a7de2daee79.json +3535 -0
- package/lib/static/rubik_regular_sub-2dd2d5cca49018c5.json +168 -0
- package/lib/{legacy/static/shaders-af852933f81878aa.json → static/shaders-88030e4fbae39928.json} +1 -1
- package/lib/static/worker-to-main-thread-3ad1cee7.js +1 -0
- package/lib/static/worker-to-main-thread-3ad1cee7.js.map +1 -0
- package/lib/{stats-helper-a6263360.js → stats-helper-53909b17.js} +2 -2
- package/lib/{stats-helper-a6263360.js.map → stats-helper-53909b17.js.map} +1 -1
- package/lib/{stats-helper-bd19ced2.nomodule.js → stats-helper-a75dc3da.nomodule.js} +2 -2
- package/lib/{stats-helper-bd19ced2.nomodule.js.map → stats-helper-a75dc3da.nomodule.js.map} +1 -1
- package/lib/{tools-core-4f0c9377.js → tools-core-4e24e712.js} +2 -2
- package/lib/tools-core-4e24e712.js.map +1 -0
- package/lib/{tools-core-f609446a.nomodule.js → tools-core-865f89df.nomodule.js} +2 -2
- package/lib/tools-core-865f89df.nomodule.js.map +1 -0
- package/package.json +2 -2
- package/scripts/copy-assets-sdk.js +66 -54
- package/lib/budgeteer-measure-1e85a5b9.js.map +0 -1
- package/lib/component-dimensioning-11e334e6.nomodule.js.map +0 -1
- package/lib/component-dimensioning-8b90144f.js.map +0 -1
- package/lib/component-raycast-helper-917c5fce.nomodule.js.map +0 -1
- package/lib/component-raycast-helper-d34cf336.js.map +0 -1
- package/lib/configurator-74c366d0.nomodule.js.map +0 -1
- package/lib/configurator-fb2e05ef.js.map +0 -1
- package/lib/configurator-main-082f03f0.js +0 -2
- package/lib/configurator-main-082f03f0.js.map +0 -1
- package/lib/default-light-setting-43be6138.js.map +0 -1
- package/lib/default-light-setting-e2fe40ee.nomodule.js.map +0 -1
- package/lib/dimensioning-helper-5d68f7b8.nomodule.js.map +0 -1
- package/lib/glb-viewer-main-e2508ced.js +0 -2
- package/lib/glb-viewer-main-e2508ced.js.map +0 -1
- package/lib/legacy/component-dimensioning-9aeb85f3.legacy.js.map +0 -1
- package/lib/legacy/component-raycast-helper-c9e6fa8a.legacy.js.map +0 -1
- package/lib/legacy/configurator-0dc9d32c.legacy.js.map +0 -1
- package/lib/legacy/default-light-setting-bb797007.legacy.js.map +0 -1
- package/lib/legacy/dimensioning-helper-9d5a7b3c.legacy.js.map +0 -1
- package/lib/legacy/main-thread-to-worker-f535fe2c.legacy.js.map +0 -1
- package/lib/legacy/material-viewer-a96582f6.legacy.js.map +0 -1
- package/lib/legacy/planner-3334d9c4.legacy.js +0 -2
- package/lib/legacy/script-loader-37d724e7.legacy.js.map +0 -1
- package/lib/legacy/static/DepthShadowGenerator-4c4b06f0801c4034.js +0 -262
- package/lib/legacy/static/Tween-d024b02fe34f25ab.js +0 -913
- package/lib/legacy/static/camera-f4cef679615485dc.json +0 -39
- package/lib/legacy/static/dat.gui.min-b5cbb61e5c62f0bf.js +0 -13
- package/lib/legacy/static/rubik_regular-75bd7bb699e9e39d.json +0 -1
- package/lib/legacy/static/rubik_regular_sub-eb3f3b61078695cc.json +0 -1
- package/lib/legacy/tools-core-f3b4d22c.legacy.js.map +0 -1
- package/lib/main-thread-to-worker-31ec8d3a.nomodule.js.map +0 -1
- package/lib/main-thread-to-worker-e9986fa8.js.map +0 -1
- package/lib/material-viewer-2db93afe.nomodule.js.map +0 -1
- package/lib/material-viewer-e7514f95.js.map +0 -1
- package/lib/material-viewer-main-50c85f10.js +0 -2
- package/lib/material-viewer-main-50c85f10.js.map +0 -1
- package/lib/planner-2fb083b9.nomodule.js +0 -2
- package/lib/planner-b9697b33.js +0 -2
- package/lib/planner-main-ac348208.js +0 -2
- package/lib/planner-main-ac348208.js.map +0 -1
- package/lib/roomle-dependency-injection-4c51790a.nomodule.js +0 -16
- package/lib/roomle-sdk-9cc773d7.js.map +0 -1
- package/lib/script-loader-584a0480.js.map +0 -1
- package/lib/script-loader-ff5cfb68.nomodule.js.map +0 -1
- package/lib/static/DepthShadowGenerator-4c4b06f0801c4034.js.map +0 -1
- package/lib/static/Tween-d024b02fe34f25ab.js.map +0 -1
- package/lib/static/camera-f4cef679615485dc.json +0 -39
- package/lib/static/dat.gui.min-b5cbb61e5c62f0bf.js.map +0 -1
- package/lib/static/rubik_regular-75bd7bb699e9e39d.json +0 -1
- package/lib/static/rubik_regular_sub-eb3f3b61078695cc.json +0 -1
- package/lib/tools-core-4f0c9377.js.map +0 -1
- package/lib/tools-core-f609446a.nomodule.js.map +0 -1
package/lib/embedding-dummy.html
CHANGED
|
@@ -1,113 +1,141 @@
|
|
|
1
1
|
<!DOCTYPE html>
|
|
2
2
|
<html>
|
|
3
|
-
<head>
|
|
4
|
-
<meta charset="utf-8"
|
|
5
|
-
<meta http-equiv="X-UA-Compatible" content="IE=edge"
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="utf-8" />
|
|
5
|
+
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
|
|
6
6
|
<title>Embedding Dummy</title>
|
|
7
|
-
<meta name="description" content=""
|
|
8
|
-
<meta name="viewport" content="width=device-width, initial-scale=1"
|
|
9
|
-
</head>
|
|
10
|
-
<body>
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
.plan {
|
|
7
|
+
<meta name="description" content="" />
|
|
8
|
+
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
9
|
+
</head>
|
|
10
|
+
<body>
|
|
11
|
+
<style>
|
|
12
|
+
.plan {
|
|
14
13
|
border: 1px dotted grey;
|
|
15
14
|
width: 534px;
|
|
16
15
|
height: 300px;
|
|
17
|
-
|
|
18
|
-
|
|
16
|
+
}
|
|
17
|
+
iframe {
|
|
19
18
|
width: 100%;
|
|
20
19
|
height: 100%;
|
|
21
20
|
border: none;
|
|
22
|
-
|
|
23
|
-
</style>
|
|
24
|
-
<p>Interaction</p>
|
|
25
|
-
<div>
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
<
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
<p>
|
|
44
|
-
<div id="
|
|
45
|
-
<hr
|
|
46
|
-
<p>Plan
|
|
47
|
-
<div id="
|
|
48
|
-
<hr
|
|
49
|
-
|
|
50
|
-
<
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
<script>
|
|
54
|
-
var appjsLoaded = async function (event) {
|
|
21
|
+
}
|
|
22
|
+
</style>
|
|
23
|
+
<p>Interaction</p>
|
|
24
|
+
<div>
|
|
25
|
+
<button id="init-plan1">Start Plan 1</button>
|
|
26
|
+
<button id="init-plan2">Start Plan 2</button>
|
|
27
|
+
|
|
28
|
+
<button id="area-plan1" disabled>Total floor area plan 1</button>
|
|
29
|
+
<button id="area-plan2" disabled>Total floor area plan 2</button>
|
|
30
|
+
|
|
31
|
+
<button id="overview-plan1" disabled>Plan overview 1</button>
|
|
32
|
+
<button id="overview-plan2" disabled>Plan overview 2</button>
|
|
33
|
+
|
|
34
|
+
<button id="planObjects-plan1" disabled>Plan objects plan 1</button>
|
|
35
|
+
<button id="planObjects-plan2" disabled>Plan objects plan 2</button>
|
|
36
|
+
|
|
37
|
+
<button id="clear">Clear results</button>
|
|
38
|
+
</div>
|
|
39
|
+
<p>Result</p>
|
|
40
|
+
<div id="result"></div>
|
|
41
|
+
<hr />
|
|
42
|
+
<p>Plan 1</p>
|
|
43
|
+
<div id="plan1" class="plan"></div>
|
|
44
|
+
<hr />
|
|
45
|
+
<p>Plan 2</p>
|
|
46
|
+
<div id="plan2" class="plan"></div>
|
|
47
|
+
<hr />
|
|
48
|
+
|
|
49
|
+
<script>
|
|
50
|
+
var appjsLoaded = async function (event) {
|
|
55
51
|
console.log('ON LOAD DONE');
|
|
56
|
-
const initPlanner = async (id, planId)=> {
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
52
|
+
const initPlanner = async (id, planId) => {
|
|
53
|
+
document.getElementById('init-' + id).disabled = true;
|
|
54
|
+
window[id] = await RoomleEmbedding.initPlanner(
|
|
55
|
+
'embedding_id',
|
|
56
|
+
document.getElementById(id)
|
|
57
|
+
);
|
|
58
|
+
window[id].callbacks.onCompletelyLoaded = async () => {
|
|
59
|
+
const planOverview = await window[id].getPlanOverview();
|
|
60
|
+
console.log(planOverview);
|
|
61
|
+
planOverview.rooms.forEach((room) => {
|
|
62
|
+
room.objects.forEach((object) => {
|
|
63
|
+
if (object.parts.fullList.length) {
|
|
64
|
+
console.log('object has part list', { object, room });
|
|
65
|
+
}
|
|
66
|
+
});
|
|
67
|
+
});
|
|
68
|
+
};
|
|
69
|
+
await window[id].loadPlan(planId);
|
|
70
|
+
document.getElementById('area-' + id).disabled = false;
|
|
71
|
+
document.getElementById('planObjects-' + id).disabled = false;
|
|
72
|
+
document.getElementById('overview-' + id).disabled = false;
|
|
73
|
+
document.getElementById('init-' + id).style.display = 'none';
|
|
75
74
|
};
|
|
76
75
|
|
|
77
|
-
const getTotalFloorArea = async (id)=> {
|
|
78
|
-
|
|
79
|
-
|
|
76
|
+
const getTotalFloorArea = async (id) => {
|
|
77
|
+
const area = await window[id].getTotalFloorArea();
|
|
78
|
+
document.getElementById('result').innerText = 'Area in mm2: ' + area;
|
|
80
79
|
};
|
|
81
80
|
|
|
82
|
-
const getPlanObjects = async (id)=> {
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
81
|
+
const getPlanObjects = async (id) => {
|
|
82
|
+
const objects = await window[id].getPlanObjects();
|
|
83
|
+
let string = '<div>';
|
|
84
|
+
objects.forEach((object) => (string += object.id + '<br>'));
|
|
85
|
+
string += '</div>';
|
|
86
|
+
document.getElementById('result').innerHTML =
|
|
87
|
+
'<strong>Objects</strong>: ' + string;
|
|
88
88
|
};
|
|
89
89
|
|
|
90
|
-
const getPlanOverview = async (id)=> {
|
|
91
|
-
|
|
92
|
-
|
|
90
|
+
const getPlanOverview = async (id) => {
|
|
91
|
+
const objects = await window[id].getPlanOverview();
|
|
92
|
+
console.log(objects);
|
|
93
93
|
};
|
|
94
94
|
|
|
95
|
-
document
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
document
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
95
|
+
document
|
|
96
|
+
.getElementById('init-plan1')
|
|
97
|
+
.addEventListener('click', () =>
|
|
98
|
+
initPlanner('plan1', 'fjl0v1agco04478pbt17ajc5huo4oza6')
|
|
99
|
+
);
|
|
100
|
+
document
|
|
101
|
+
.getElementById('init-plan2')
|
|
102
|
+
.addEventListener('click', () =>
|
|
103
|
+
initPlanner('plan2', 'f0tirbdakqokfgabbqtmko2kfusn4me')
|
|
104
|
+
);
|
|
105
|
+
|
|
106
|
+
document
|
|
107
|
+
.getElementById('area-plan1')
|
|
108
|
+
.addEventListener('click', () => getTotalFloorArea('plan1'));
|
|
109
|
+
document
|
|
110
|
+
.getElementById('area-plan2')
|
|
111
|
+
.addEventListener('click', () => getTotalFloorArea('plan2'));
|
|
112
|
+
|
|
113
|
+
document
|
|
114
|
+
.getElementById('overview-plan1')
|
|
115
|
+
.addEventListener('click', () => getPlanOverview('plan1'));
|
|
116
|
+
document
|
|
117
|
+
.getElementById('overview-plan2')
|
|
118
|
+
.addEventListener('click', () => getPlanOverview('plan2'));
|
|
119
|
+
|
|
120
|
+
document
|
|
121
|
+
.getElementById('planObjects-plan1')
|
|
122
|
+
.addEventListener('click', () => getPlanObjects('plan1'));
|
|
123
|
+
document
|
|
124
|
+
.getElementById('planObjects-plan2')
|
|
125
|
+
.addEventListener('click', () => getPlanObjects('plan2'));
|
|
126
|
+
document
|
|
127
|
+
.getElementById('clear')
|
|
128
|
+
.addEventListener(
|
|
129
|
+
'click',
|
|
130
|
+
() => (document.getElementById('result').innerHTML = '')
|
|
131
|
+
);
|
|
132
|
+
};
|
|
133
|
+
</script>
|
|
134
|
+
<script
|
|
135
|
+
src="roomle-embedding.js"
|
|
136
|
+
id="appjs"
|
|
137
|
+
type="module"
|
|
138
|
+
onload="appjsLoaded();"
|
|
139
|
+
></script>
|
|
140
|
+
</body>
|
|
113
141
|
</html>
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import"./query-params-helper-a271f9dc.js";import{a7 as InputManager,D as DependencyInjectionAssignment,L as Logger,R as RapiAccess,h as getGUI,_ as __decorate,i as inject,l as CANVAS_ID,n as DynamicLightSettingLoader,o as PREDEFINED_LIGHTSETTING,p as dispose,a5 as GLTF_LOADER_FILE_NAME,a6 as DRACO_LOADER_FILE_NAME,b as RoomleDependencyInjection}from"./roomle-dependency-injection-244ed68c.js";import{f as getGlbUrl}from"./main-thread-to-worker-e9986fa8.js";import{C as CameraControl3D,L as LightSetting,S as SceneManager,B as BakedShadowEnvironment,T as TWEEN_FILE_NAME,P as PIXOTRON_EFFETCS,c as PIXOTRON_FILE_NAME}from"./pixotron-e1f44e21.js";import{S as ScriptLoader,M as Main}from"./script-loader-584a0480.js";import{D as DefaultLightSetting}from"./default-light-setting-43be6138.js";const INJECTABLES=[new DependencyInjectionAssignment("script-loader",ScriptLoader),new DependencyInjectionAssignment("glb-input-manager",class extends InputManager{},1),new DependencyInjectionAssignment("logger",Logger),new DependencyInjectionAssignment("rapi-access",RapiAccess)];class AdjustableCameraControl3D extends CameraControl3D{constructor(){super(...arguments),this.shouldIgnoreStandardBehavior=!1}adjust(e,t,r,i,n){let s=new THREE.Vector3(-e.x/2,0,-e.z/2),a=new THREE.Vector3(e.x/2,e.y,e.z/2);this._boundingBox=new THREE.Box3(s,a);let o=new THREE.Euler(-Math.PI/2+i,r,0,"ZYX"),c=(new THREE.Quaternion).setFromEuler(o);this._camera.updateProjectionMatrix(),this._camera.quaternion.copy(c),this._camera.position.copy(t)}_update(e){this.shouldIgnoreStandardBehavior?this._saveYawAndPitch():super._update(e)}animateCamera(e){return!!this.shouldIgnoreStandardBehavior||super.animateCamera(e)}}class GLBViewerLightSetting extends LightSetting{constructor(e,t){super(e,t),this._params={ambientLight:{color:"#ffffff"}},this._ambientLight=new THREE.AmbientLight(new THREE.Color(this._params.ambientLight.color),.5),this.addToScene()}addToScene(){this._scene.add(this._ambientLight)}removeFromScene(){this._scene.remove(this._ambientLight)}reload(){this.removeFromScene(),this.addToScene()}showGUI(){let e=getGUI();if(e&&this._ambientLight){let t=e.addFolder("Ambient Light");t.add(this._ambientLight,"visible"),t.add(this._ambientLight,"intensity").min(0).max(5).step(.1),t.addColor(this._params.ambientLight,"color").onChange(e=>{this._ambientLight.color=new THREE.Color(e)})}}}class GLBViewerSceneManager extends SceneManager{constructor(e,t){super(e,t,CANVAS_ID.GLB),this._itemsCount=0,this._standardSceneBackgroundColor=this._scene.background,this._renderer.capabilities.maxTextures>8?this.loadDynamicLightSetting(DynamicLightSettingLoader.createDynamicLightSettingSource(null,PREDEFINED_LIGHTSETTING.CAMERA)):(console.warn("this device has a maximum of 8 texture units thus we are using a simpler light setting"),this._lightSetting=new GLBViewerLightSetting(this._scene)),this._setEnvironment(new BakedShadowEnvironment(this._scene,this._environment))}createCameraControl(e,t){this._cameraControl=new AdjustableCameraControl3D(this._creator_,this._getInputManager(),new THREE.Vector3(-1,1,1))}_getInputManager(){return this._glbInputManager}async loadStaticItem(e,t){const r=await this._rapiAccess.getItem(e);if(r.configuration)return Promise.reject();const i=getGlbUrl(r);return i?this.loadGLB(i,!0,void 0,t):Promise.reject(new Error("GLB Url not detected"))}loadGLB(e,t=!0,r=new THREE.Vector3(1,1,1),i){return this.clearScene(),new Promise((n,s)=>{this._loadGLB(e,new THREE.Vector3(0,0,0),0,void 0,r,void 0,void 0,i).then(e=>{this._currentGLB=e,this._scene.add(this._currentGLB);let r=(new THREE.Box3).setFromObject(this._currentGLB);if(t){let e=r.getCenter(new THREE.Vector3);this._cameraControl instanceof AdjustableCameraControl3D&&(this._cameraControl.updateToBounds(r,!1,!0,e),this._cameraControl.reset(r,e,-15,0))}this._updateBounds(r,!0),n()},s)})}preparePerspectiveImage(e,t,r){return new Promise(i=>{t||(t=1e3),r||(r=1e3),e||((e=new THREE.WebGLRenderer({antialias:!0})).setSize(t,r),e.outputEncoding=THREE.sRGBEncoding,e.autoClear=!1,e.shadowMap.enabled=!0,e.shadowMap.type=THREE.BasicShadowMap);let n=this._cameraControl.getCamera().clone();n instanceof THREE.PerspectiveCamera&&(n.aspect=t/r,n.updateProjectionMatrix()),this._lightSetting.removeFromScene();let s=new DefaultLightSetting(this._scene);e.render(this._scene,n);let a=e.domElement.toDataURL();e.domElement.toBlob(e=>{i({image:a,width:t,height:r,blob:e})},"image/png"),s.removeFromScene(),this._lightSetting.addToScene()})}adjustCamera(e,t,r,i){if(this._cameraControl instanceof AdjustableCameraControl3D){let n=(new THREE.Box3).setFromObject(this._scene).getSize(new THREE.Vector3);this._cameraControl.adjust(n,e,t,r,i),this._requestRender()}}onStart(e){this._itemsCount=e,this._scene.background=null,this._cameraControl instanceof AdjustableCameraControl3D&&(this._cameraControl.shouldIgnoreStandardBehavior=!0)}onElementFinished(e){this._itemsCount,Math.round(100/this._itemsCount*e)}onFinished(e){this._scene.background=this._standardSceneBackgroundColor,this._cameraControl instanceof AdjustableCameraControl3D&&(this._cameraControl.shouldIgnoreStandardBehavior=!1)}clearScene(){this._currentGLB&&(this._scene.remove(this._currentGLB),dispose(this._currentGLB),this._currentGLB=null),super.clearScene()}enableHD(){super.enableHD(),this._pixotron.enableAA=!1,this._pixotron.getSAOPass().enabled=!0}sceneChanged(){}getPixotronParams(){return{saoparams:{intensity:.25,occlusionWorldRadius:.4,smoothTransition:!0,samplesPerFrame:4,bias:.016,numSamples:200,accumulative:!1,falloff:1.5},shadowparams:{shadowMapResolution:1024,shadowRadius:3,shadowQuality:1,smoothTransition:!0,enableAccumulation:!0,shadowBiasMultiplier:.6,nearPlane:.01,farPlane:50,fov:110,side:THREE.FrontSide,numSamples:100}}}getBakedShadowParams(){return{enable:!0,shadowMapResolution:512,smoothTransition:!0,numSamples:500,numSamplesPerFrame:4,bShadowMaterial:!0,falloff:1.5,darkness:.2,size:1.6,lightDirection:new THREE.Vector3(0,1,.5),lightSolidAngle:40}}getBounds(){return this._currentGLB?(new THREE.Box3).setFromObject(this._currentGLB):null}}__decorate([inject],GLBViewerSceneManager.prototype,"_glbInputManager",void 0),__decorate([inject],GLBViewerSceneManager.prototype,"_rapiAccess",void 0);class GLBRenderWorker{constructor(e,t,r){this._prefix="https://furniture.roomle.com/3d/glb/",this._listeners=new Set,this._finishedItems=0,this._sceneManager=e,this._renderer=new THREE.WebGLRenderer({antialias:!0,alpha:!0}),this._width=t,this._height=r,this._renderer.setSize(t,r),this._renderer.setClearColor(16777215,0),this._renderer.outputEncoding=THREE.sRGBEncoding}addListener(e){this._listeners.add(e)}removeListener(e){this._listeners.delete(e)}start(e){return this._entries=[],e.forEach(e=>{this._entries.push(this._transform(e))}),this._finishedItems=0,this._listeners.forEach(e=>e.onStart(this._entries.length)),this._zip=new window.JSZip,this._doNextEntry(),new Promise(e=>{this._resolve=e})}_transform(e){return{name:e.path.replace(".glb",".png"),url:this._prefix+e.path,position:new THREE.Vector3(e.camera.position.x,e.camera.position.z,-e.camera.position.y),fov:2*e.camera.fieldOfView,yaw:e.camera.rotation.z,pitch:e.camera.rotation.x}}_doNextEntry(){0===this._entries.length?(this._listeners.forEach(e=>e.onFinished(this._zip)),this._resolve(this._zip)):this._processEntry(this._entries[0])}_processEntry(e){this._sceneManager.loadGLB(e.url,!1,void 0).then(()=>{this._sceneManager.adjustCamera(e.position,e.yaw,e.pitch,e.fov),this._sceneManager.preparePerspectiveImage(this._renderer,this._width,this._height).then(t=>{this._entryFinished(e,t)})})}_entryFinished(e,t){let r=this._entries.indexOf(e);r>-1&&this._entries.splice(r,1),this._finishedItems++,this._listeners.forEach(e=>e.onElementFinished(this._finishedItems)),this._zip.file(e.name,t.blob),this._doNextEntry()}}class RoomleGLBViewer{constructor(e){this._currentIdOrUrl=null,this._creator_=e}setCameraOffset(e){this._sceneManager.setCameraOffset(e)}getCameraOffset(){return this._sceneManager.getCameraOffset()}init(e,t){return this.setOverrides(t),this._domHelper.setDomElement(e),this._sceneManager?(this._lifeCycleManager.resume(),Promise.resolve()):new Promise(this._initPromiseCallback.bind(this))}_initPromiseCallback(e,t){this._threeLoader.fetch().then(()=>{let t=this._scriptLoader.fetch(GLTF_LOADER_FILE_NAME,{id:"gltf-loader"}),r=this._scriptLoader.fetch(DRACO_LOADER_FILE_NAME,{id:"draco-loader"}),i=this._scriptLoader.fetch(TWEEN_FILE_NAME,{id:"tween-js"});Promise.all([t,r,i]).then(()=>{this._sceneManager=new GLBViewerSceneManager(this._creator_,{left:0,top:1,right:1,bottom:0}),this.enableHD(),e()})})}enableHD(){return new Promise((e,t)=>{const r=()=>{this._sceneManager.enableHD(),e()};Promise.all(PIXOTRON_EFFETCS.map(e=>this._scriptLoader.fetch(e,{id:e}))).then(()=>{this._scriptLoader.fetch(PIXOTRON_FILE_NAME,{id:"pi-js"}).then(r,t)},t)})}clearScene(){this._sceneManager.clearScene()}loadGLB(e,t=1,r){return this._currentIdOrUrl=e,this._rapiAccess.trackView(e),this._sceneManager.loadGLB(e,!0,new THREE.Vector3(t,t,t),r)}loadStaticItem(e,t){return this._currentIdOrUrl=e,this._rapiAccess.trackView(e),this._sceneManager.loadStaticItem(e,t)}getCurrentId(){return this._currentIdOrUrl}loadSceneSetting(e){return this._sceneManager.loadSceneSettings(e)}loadQualitySetting(e){this._sceneManager.loadQualitySetting(e)}preparePerspectiveImage(){return this._sceneManager.preparePerspectiveImage()}processRenderList(e,t=320,r=320){let i=JSON.parse(e);this._scriptLoader.fetch("static/jszip.min-dd6c9829408677a1.js",{id:"jszip-js"}).then(()=>{let e=new GLBRenderWorker(this._sceneManager,t,r);e.addListener(this._sceneManager),e.start(i.items).then(t=>{t.generateAsync({type:"blob"}).then(t=>{let r=document.createElement("a");r.href=URL.createObjectURL(t),r.download="content.zip",r.style.display="none",document.body.appendChild(r),r.click(),document.body.removeChild(r),e.removeListener(this._sceneManager)})})})}setOverrides(e){e&&(this._initData.setOverrides(e),this._globalInitData.setOverrides(e))}updateSize(){this._sceneManager.updateCamera()}getMain(){}resumeTest(e){this._domHelper.setDomElement(e),this._lifeCycleManager.resume()}pauseTest(){this._lifeCycleManager.pause()}showGUI(){this._sceneManager.showGUI()}get callbacks(){return{}}getScene(){return this._sceneManager.getScene()}updateScene(){this._sceneManager.updateScene()}getUnitFormatter(){return this._unitFormatter}}__decorate([inject],RoomleGLBViewer.prototype,"_rapiAccess",void 0),__decorate([inject],RoomleGLBViewer.prototype,"_domHelper",void 0),__decorate([inject],RoomleGLBViewer.prototype,"_scriptLoader",void 0),__decorate([inject],RoomleGLBViewer.prototype,"_lifeCycleManager",void 0),__decorate([inject],RoomleGLBViewer.prototype,"_threeLoader",void 0),__decorate([inject],RoomleGLBViewer.prototype,"_initData",void 0),__decorate([inject],RoomleGLBViewer.prototype,"_globalInitData",void 0),__decorate([inject],RoomleGLBViewer.prototype,"_unitFormatter",void 0);class GlbViewer extends Main{setupGlobals(){}setupDependencies(){RoomleDependencyInjection.setup(INJECTABLES),this.lookup("logger",this._context)}cleanUpGlobals(){throw new Error("Method not implemented.")}cleanUpDependencies(){throw new Error("Method not implemented.")}bootFinished(){this._viewer=new RoomleGLBViewer(this._context),window.RoomleGLBViewer||(window.RoomleGLBViewer=this._viewer)}getApi(){return this._viewer}getContextName(){return"glb-viewer"}}export{GlbViewer};
|
|
2
|
-
//# sourceMappingURL=glb-viewer-
|
|
1
|
+
import"./query-params-helper-a271f9dc.js";import{a7 as InputManager,D as DependencyInjectionAssignment,L as Logger,R as RapiAccess,h as getGUI,_ as __decorate,i as inject,l as CANVAS_ID,n as DynamicLightSettingLoader,o as PREDEFINED_LIGHTSETTING,p as dispose,a5 as GLTF_LOADER_FILE_NAME,a6 as DRACO_LOADER_FILE_NAME,b as RoomleDependencyInjection}from"./roomle-dependency-injection-8d66ecac.js";import{f as getGlbUrl}from"./main-thread-to-worker-88f74244.js";import{C as CameraControl3D,L as LightSetting,S as SceneManager,B as BakedShadowEnvironment,T as TWEEN_FILE_NAME,P as PIXOTRON_EFFETCS,c as PIXOTRON_FILE_NAME}from"./pixotron-32c4e05d.js";import{S as ScriptLoader,M as Main}from"./script-loader-a1d7afdd.js";import{D as DefaultLightSetting}from"./default-light-setting-17aeb133.js";const INJECTABLES=[new DependencyInjectionAssignment("script-loader",ScriptLoader),new DependencyInjectionAssignment("glb-input-manager",class extends InputManager{},1),new DependencyInjectionAssignment("logger",Logger),new DependencyInjectionAssignment("rapi-access",RapiAccess)];class AdjustableCameraControl3D extends CameraControl3D{constructor(){super(...arguments),this.shouldIgnoreStandardBehavior=!1}adjust(e,t,r,i,n){let s=new THREE.Vector3(-e.x/2,0,-e.z/2),a=new THREE.Vector3(e.x/2,e.y,e.z/2);this._boundingBox=new THREE.Box3(s,a);let o=new THREE.Euler(-Math.PI/2+i,r,0,"ZYX"),c=(new THREE.Quaternion).setFromEuler(o);this._camera.updateProjectionMatrix(),this._camera.quaternion.copy(c),this._camera.position.copy(t)}_update(e){this.shouldIgnoreStandardBehavior?this._saveYawAndPitch():super._update(e)}animateCamera(e){return!!this.shouldIgnoreStandardBehavior||super.animateCamera(e)}}class GLBViewerLightSetting extends LightSetting{constructor(e,t){super(e,t),this._params={ambientLight:{color:"#ffffff"}},this._ambientLight=new THREE.AmbientLight(new THREE.Color(this._params.ambientLight.color),.5),this.addToScene()}addToScene(){this._scene.add(this._ambientLight)}removeFromScene(){this._scene.remove(this._ambientLight)}reload(){this.removeFromScene(),this.addToScene()}showGUI(){let e=getGUI();if(e&&this._ambientLight){let t=e.addFolder("Ambient Light");t.add(this._ambientLight,"visible"),t.add(this._ambientLight,"intensity").min(0).max(5).step(.1),t.addColor(this._params.ambientLight,"color").onChange(e=>{this._ambientLight.color=new THREE.Color(e)})}}}class GLBViewerSceneManager extends SceneManager{constructor(e,t){super(e,t,CANVAS_ID.GLB),this._itemsCount=0,this._standardSceneBackgroundColor=this._scene.background,this._renderer.capabilities.maxTextures>8?this.loadDynamicLightSetting(DynamicLightSettingLoader.createDynamicLightSettingSource(null,PREDEFINED_LIGHTSETTING.CAMERA)):(console.warn("this device has a maximum of 8 texture units thus we are using a simpler light setting"),this._lightSetting=new GLBViewerLightSetting(this._scene)),this._setEnvironment(new BakedShadowEnvironment(this._scene,this._environment))}createCameraControl(e,t){this._cameraControl=new AdjustableCameraControl3D(this._creator_,this._getInputManager(),new THREE.Vector3(-1,1,1))}_getInputManager(){return this._glbInputManager}async loadStaticItem(e,t){const r=await this._rapiAccess.getItem(e);if(r.configuration)return Promise.reject();const i=getGlbUrl(r);return i?this.loadGLB(i,!0,void 0,t):Promise.reject(new Error("GLB Url not detected"))}loadGLB(e,t=!0,r=new THREE.Vector3(1,1,1),i){return this.clearScene(),new Promise((n,s)=>{this._loadGLB(e,new THREE.Vector3(0,0,0),0,void 0,r,void 0,void 0,i).then(e=>{this._currentGLB=e,this._scene.add(this._currentGLB);let r=(new THREE.Box3).setFromObject(this._currentGLB);if(t){let e=r.getCenter(new THREE.Vector3);this._cameraControl instanceof AdjustableCameraControl3D&&(this._cameraControl.updateToBounds(r,!1,!0,e),this._cameraControl.reset(r,e,-15,0))}this._updateBounds(r,!0),n()},s)})}preparePerspectiveImage(e,t,r){return new Promise(i=>{t||(t=1e3),r||(r=1e3),e||((e=new THREE.WebGLRenderer({antialias:!0})).setSize(t,r),e.outputEncoding=THREE.sRGBEncoding,e.autoClear=!1,e.shadowMap.enabled=!0,e.shadowMap.type=THREE.BasicShadowMap);let n=this._cameraControl.getCamera().clone();n instanceof THREE.PerspectiveCamera&&(n.aspect=t/r,n.updateProjectionMatrix()),this._lightSetting.removeFromScene();let s=new DefaultLightSetting(this._scene);e.render(this._scene,n);let a=e.domElement.toDataURL();e.domElement.toBlob(e=>{i({image:a,width:t,height:r,blob:e})},"image/png"),s.removeFromScene(),this._lightSetting.addToScene()})}adjustCamera(e,t,r,i){if(this._cameraControl instanceof AdjustableCameraControl3D){let n=(new THREE.Box3).setFromObject(this._scene).getSize(new THREE.Vector3);this._cameraControl.adjust(n,e,t,r,i),this._requestRender()}}onStart(e){this._itemsCount=e,this._scene.background=null,this._cameraControl instanceof AdjustableCameraControl3D&&(this._cameraControl.shouldIgnoreStandardBehavior=!0)}onElementFinished(e){this._itemsCount,Math.round(100/this._itemsCount*e)}onFinished(e){this._scene.background=this._standardSceneBackgroundColor,this._cameraControl instanceof AdjustableCameraControl3D&&(this._cameraControl.shouldIgnoreStandardBehavior=!1)}clearScene(){this._currentGLB&&(this._scene.remove(this._currentGLB),dispose(this._currentGLB),this._currentGLB=null),super.clearScene()}enableHD(){super.enableHD(),this._pixotron.enableAA=!1,this._pixotron.getSAOPass().enabled=!0}sceneChanged(){}getPixotronParams(){return{saoparams:{intensity:.25,occlusionWorldRadius:.4,smoothTransition:!0,samplesPerFrame:4,bias:.016,numSamples:200,accumulative:!1,falloff:1.5},shadowparams:{shadowMapResolution:1024,shadowRadius:3,shadowQuality:1,smoothTransition:!0,enableAccumulation:!0,shadowBiasMultiplier:.6,nearPlane:.01,farPlane:50,fov:110,side:THREE.FrontSide,numSamples:100}}}getBakedShadowParams(){return{enable:!0,shadowMapResolution:512,smoothTransition:!0,numSamples:500,numSamplesPerFrame:4,bShadowMaterial:!0,falloff:1.5,darkness:.2,size:1.6,lightDirection:new THREE.Vector3(0,1,.5),lightSolidAngle:40}}getBounds(){return this._currentGLB?(new THREE.Box3).setFromObject(this._currentGLB):null}}__decorate([inject],GLBViewerSceneManager.prototype,"_glbInputManager",void 0),__decorate([inject],GLBViewerSceneManager.prototype,"_rapiAccess",void 0);class GLBRenderWorker{constructor(e,t,r){this._prefix="https://furniture.roomle.com/3d/glb/",this._listeners=new Set,this._finishedItems=0,this._sceneManager=e,this._renderer=new THREE.WebGLRenderer({antialias:!0,alpha:!0}),this._width=t,this._height=r,this._renderer.setSize(t,r),this._renderer.setClearColor(16777215,0),this._renderer.outputEncoding=THREE.sRGBEncoding}addListener(e){this._listeners.add(e)}removeListener(e){this._listeners.delete(e)}start(e){return this._entries=[],e.forEach(e=>{this._entries.push(this._transform(e))}),this._finishedItems=0,this._listeners.forEach(e=>e.onStart(this._entries.length)),this._zip=new window.JSZip,this._doNextEntry(),new Promise(e=>{this._resolve=e})}_transform(e){return{name:e.path.replace(".glb",".png"),url:this._prefix+e.path,position:new THREE.Vector3(e.camera.position.x,e.camera.position.z,-e.camera.position.y),fov:2*e.camera.fieldOfView,yaw:e.camera.rotation.z,pitch:e.camera.rotation.x}}_doNextEntry(){0===this._entries.length?(this._listeners.forEach(e=>e.onFinished(this._zip)),this._resolve(this._zip)):this._processEntry(this._entries[0])}_processEntry(e){this._sceneManager.loadGLB(e.url,!1,void 0).then(()=>{this._sceneManager.adjustCamera(e.position,e.yaw,e.pitch,e.fov),this._sceneManager.preparePerspectiveImage(this._renderer,this._width,this._height).then(t=>{this._entryFinished(e,t)})})}_entryFinished(e,t){let r=this._entries.indexOf(e);r>-1&&this._entries.splice(r,1),this._finishedItems++,this._listeners.forEach(e=>e.onElementFinished(this._finishedItems)),this._zip.file(e.name,t.blob),this._doNextEntry()}}class RoomleGLBViewer{constructor(e){this._currentIdOrUrl=null,this._creator_=e}setCameraOffset(e){this._sceneManager.setCameraOffset(e)}getCameraOffset(){return this._sceneManager.getCameraOffset()}init(e,t){return this.setOverrides(t),this._domHelper.setDomElement(e),this._sceneManager?(this._lifeCycleManager.resume(),Promise.resolve()):new Promise(this._initPromiseCallback.bind(this))}_initPromiseCallback(e,t){this._threeLoader.fetch().then(()=>{let t=this._scriptLoader.fetch(GLTF_LOADER_FILE_NAME,{id:"gltf-loader"}),r=this._scriptLoader.fetch(DRACO_LOADER_FILE_NAME,{id:"draco-loader"}),i=this._scriptLoader.fetch(TWEEN_FILE_NAME,{id:"tween-js"});Promise.all([t,r,i]).then(()=>{this._sceneManager=new GLBViewerSceneManager(this._creator_,{left:0,top:1,right:1,bottom:0}),this.enableHD(),e()})})}enableHD(){return new Promise((e,t)=>{const r=()=>{this._sceneManager.enableHD(),e()};Promise.all(PIXOTRON_EFFETCS.map(e=>this._scriptLoader.fetch(e,{id:e}))).then(()=>{this._scriptLoader.fetch(PIXOTRON_FILE_NAME,{id:"pi-js"}).then(r,t)},t)})}clearScene(){this._sceneManager.clearScene()}loadGLB(e,t=1,r){return this._currentIdOrUrl=e,this._rapiAccess.trackView(e),this._sceneManager.loadGLB(e,!0,new THREE.Vector3(t,t,t),r)}loadStaticItem(e,t){return this._currentIdOrUrl=e,this._rapiAccess.trackView(e),this._sceneManager.loadStaticItem(e,t)}getCurrentId(){return this._currentIdOrUrl}loadSceneSetting(e){return this._sceneManager.loadSceneSettings(e)}loadQualitySetting(e){this._sceneManager.loadQualitySetting(e)}preparePerspectiveImage(){return this._sceneManager.preparePerspectiveImage()}processRenderList(e,t=320,r=320){let i=JSON.parse(e);this._scriptLoader.fetch("static/jszip.min-dd6c9829408677a1.js",{id:"jszip-js"}).then(()=>{let e=new GLBRenderWorker(this._sceneManager,t,r);e.addListener(this._sceneManager),e.start(i.items).then(t=>{t.generateAsync({type:"blob"}).then(t=>{let r=document.createElement("a");r.href=URL.createObjectURL(t),r.download="content.zip",r.style.display="none",document.body.appendChild(r),r.click(),document.body.removeChild(r),e.removeListener(this._sceneManager)})})})}setOverrides(e){e&&(this._initData.setOverrides(e),this._globalInitData.setOverrides(e))}updateSize(){this._sceneManager.updateCamera()}getMain(){}resumeTest(e){this._domHelper.setDomElement(e),this._lifeCycleManager.resume()}pauseTest(){this._lifeCycleManager.pause()}showGUI(){this._sceneManager.showGUI()}get callbacks(){return{}}getScene(){return this._sceneManager.getScene()}updateScene(){this._sceneManager.updateScene()}getUnitFormatter(){return this._unitFormatter}}__decorate([inject],RoomleGLBViewer.prototype,"_rapiAccess",void 0),__decorate([inject],RoomleGLBViewer.prototype,"_domHelper",void 0),__decorate([inject],RoomleGLBViewer.prototype,"_scriptLoader",void 0),__decorate([inject],RoomleGLBViewer.prototype,"_lifeCycleManager",void 0),__decorate([inject],RoomleGLBViewer.prototype,"_threeLoader",void 0),__decorate([inject],RoomleGLBViewer.prototype,"_initData",void 0),__decorate([inject],RoomleGLBViewer.prototype,"_globalInitData",void 0),__decorate([inject],RoomleGLBViewer.prototype,"_unitFormatter",void 0);class GlbViewer extends Main{setupGlobals(){}setupDependencies(){RoomleDependencyInjection.setup(INJECTABLES),this.lookup("logger",this._context)}cleanUpGlobals(){throw new Error("Method not implemented.")}cleanUpDependencies(){throw new Error("Method not implemented.")}bootFinished(){this._viewer=new RoomleGLBViewer(this._context),window.RoomleGLBViewer||(window.RoomleGLBViewer=this._viewer)}getApi(){return this._viewer}getContextName(){return"glb-viewer"}}export{GlbViewer};
|
|
2
|
+
//# sourceMappingURL=glb-viewer-45e04caa.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"glb-viewer-
|
|
1
|
+
{"version":3,"file":"glb-viewer-45e04caa.js","sources":["../../node_modules/jszip/dist/jszip.min.js"],"sourcesContent":["export default \"static/jszip.min-dd6c9829408677a1.js\""],"names":[],"mappings":"qySAAe"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["0"],"names":["changeButtonDisabled","isDisabled","document","querySelectorAll","forEach","button","disabled","getElementById","addEventListener","input","value","window","RoomleGLBViewer","loadGLB","then","loadStaticItem","preparePerspectiveImage","base64Image","imgId","old","body","removeChild","img","createElement","src","image","id","style","width","height","appendChild","processRenderList","glbViewerElement","firstChild","pauseTest","resumeTest","init","success","error"],"mappings":"AAAA,IAAIA,qBAAuB,SAAUC,
|
|
1
|
+
{"version":3,"sources":["0"],"names":["changeButtonDisabled","isDisabled","document","querySelectorAll","forEach","button","disabled","getElementById","addEventListener","input","value","window","RoomleGLBViewer","loadGLB","then","loadStaticItem","preparePerspectiveImage","base64Image","imgId","old","body","removeChild","img","createElement","src","image","id","style","width","height","appendChild","processRenderList","glbViewerElement","firstChild","pauseTest","resumeTest","init","success","error"],"mappings":"AAAA,IAAIA,qBAAuB,SAAUC,GACnCC,SAASC,iBAAiB,UAAUC,SAAQ,SAAUC,GACpDA,EAAOC,SAAWL,MA2DtBC,SACGK,eAAe,gBACfC,iBAAiB,QAAS,IArDb,WACd,MAAMC,EAAQP,SAASK,eAAe,aAAaG,MAC9CD,GAAmB,KAAVA,IAGdT,sBAAqB,GACrBW,OAAOC,gBAAgBC,QAAQJ,GAAOK,KAAK,IAAMd,sBAAqB,KA+CrCa,IACnCX,SACGK,eAAe,oBACfC,iBAAiB,QAAS,IA/CN,WACrB,MAAMC,EAAQP,SAASK,eAAe,aAAaG,MAC9CD,GAAmB,KAAVA,IAGdT,sBAAqB,GACrBW,OAAOC,gBAAgBG,eAAeN,GAAOK,KAAK,IAChDd,sBAAqB,KAwCUe,IACnCb,SACGK,eAAe,kBACfC,iBAAiB,QAAS,KAtC3BG,OAAOC,gBAAgBI,0BAA0BF,KAAMG,IACrD,MAAMC,EAAQ,cACRC,EAAMjB,SAASK,eAAeW,GAChCC,GACFjB,SAASkB,KAAKC,YAAYF,GAE5B,MAAMG,EAAMpB,SAASqB,cAAc,OACnCD,EAAIE,IAAMP,EAAYQ,MACtBH,EAAII,GAAKR,EACTI,EAAIK,MACF,UACAV,EAAYW,MACZ,aACAX,EAAYY,OACZ,+DACF3B,SAASkB,KAAKU,YAAYR,GAC1BA,EAAId,iBAAiB,QAAS,KAC5BN,SAASkB,KAAKC,YAAYnB,SAASK,eAAeW,UAsBxDhB,SACGK,eAAe,gBACfC,iBAAiB,QAAS,IAnBH,WACxB,MAAMC,EAAQP,SAASK,eAAe,aAAaG,MAC9CD,GAAmB,KAAVA,GAGdE,OAAOC,gBAAgBmB,kBAAkBtB,GAcRsB,IAEnC7B,SAASK,eAAe,SAASC,iBAAiB,QAAS,KAEzD,IADA,IAAIwB,EAAmB9B,SAASK,eAAe,qBACxCyB,EAAiBC,YACtBD,EAAiBX,YAAYW,EAAiBC,YAEhDrB,gBAAgBsB,cAElBhC,SACGK,eAAe,UACfC,iBAAiB,QAAS,IACzBI,gBAAgBuB,WAAWjC,SAASK,eAAe,uBAGvDI,OAAOC,gBAAgBwB,KAAKlC,SAASK,eAAe,sBAAsBO,KACvEuB,IACCrC,sBAAqB,IAEtBsC"}
|
|
@@ -1,41 +1,55 @@
|
|
|
1
1
|
<!DOCTYPE html>
|
|
2
2
|
<html>
|
|
3
|
-
<head>
|
|
4
|
-
<meta charset="utf-8"
|
|
5
|
-
<meta http-equiv="X-UA-Compatible" content="IE=edge"
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="utf-8" />
|
|
5
|
+
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
|
|
6
6
|
<title>GLB Viewer Dummy</title>
|
|
7
|
-
<meta name="description" content=""
|
|
8
|
-
<meta name="viewport" content="width=device-width, initial-scale=1"
|
|
9
|
-
</head>
|
|
10
|
-
<body>
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
.loadConfiguration {
|
|
7
|
+
<meta name="description" content="" />
|
|
8
|
+
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
9
|
+
</head>
|
|
10
|
+
<body>
|
|
11
|
+
<style>
|
|
12
|
+
.loadConfiguration {
|
|
14
13
|
background-color: lightblue;
|
|
15
|
-
|
|
14
|
+
}
|
|
16
15
|
|
|
17
|
-
|
|
16
|
+
.loadConfigurableItem {
|
|
18
17
|
background-color: lightsalmon;
|
|
19
|
-
|
|
20
|
-
</style>
|
|
21
|
-
<div>
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
</
|
|
30
|
-
<
|
|
31
|
-
|
|
18
|
+
}
|
|
19
|
+
</style>
|
|
20
|
+
<div>
|
|
21
|
+
<textarea type="text" id="input-url">brands_3:44032500</textarea>
|
|
22
|
+
<button id="load-glb-url" disabled="disabled">Load GLB URL</button>
|
|
23
|
+
<button id="load-static-item" disabled="disabled">
|
|
24
|
+
Load Static Item
|
|
25
|
+
</button>
|
|
26
|
+
<button id="generate-image" disabled="disabled">Generate Image</button>
|
|
27
|
+
<button id="process-json" disabled="disabled">Process JSON</button>
|
|
28
|
+
<button disabled="disabled" id="pause">Pause</button>
|
|
29
|
+
<button disabled="disabled" id="resume">Resume</button>
|
|
30
|
+
</div>
|
|
31
|
+
<script>
|
|
32
|
+
var appjsLoaded = function load(event) {
|
|
32
33
|
console.log('ON LOAD DONE');
|
|
33
34
|
const script = document.createElement('script');
|
|
34
35
|
script.src = 'glb-viewer-dummy-app.js';
|
|
35
36
|
document.body.appendChild(script);
|
|
36
|
-
|
|
37
|
-
</script>
|
|
38
|
-
<div
|
|
39
|
-
|
|
40
|
-
|
|
37
|
+
};
|
|
38
|
+
</script>
|
|
39
|
+
<div
|
|
40
|
+
id="roomle-glb-viewer"
|
|
41
|
+
style="
|
|
42
|
+
height: 100vh;
|
|
43
|
+
width: 100%;
|
|
44
|
+
background-color: white;
|
|
45
|
+
border: solid 1px gray;
|
|
46
|
+
"
|
|
47
|
+
></div>
|
|
48
|
+
<script
|
|
49
|
+
src="glb-viewer-main.js"
|
|
50
|
+
id="appjs"
|
|
51
|
+
type="module"
|
|
52
|
+
onload="appjsLoaded();"
|
|
53
|
+
></script>
|
|
54
|
+
</body>
|
|
41
55
|
</html>
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
System.register(["./query-params-helper-c231e1b8.nomodule.js","./roomle-dependency-injection-4c51790a.nomodule.js","./main-thread-to-worker-31ec8d3a.nomodule.js","./pixotron-11d8ecf1.nomodule.js","./script-loader-ff5cfb68.nomodule.js","./default-light-setting-e2fe40ee.nomodule.js"],(function(e){var t,i,r,n,s,a,o,h,c,d,l,_,m,u,p,g,w,f,E,b,S,v,L,C,M;return{setters:[function(){},function(e){t=e.a7,i=e.D,r=e.L,n=e.R,s=e.h,a=e._,o=e.i,h=e.l,c=e.n,d=e.o,l=e.p,_=e.a5,m=e.a6,u=e.b},function(e){p=e.f},function(e){g=e.C,w=e.L,f=e.S,E=e.B,b=e.T,S=e.P,v=e.c},function(e){L=e.S,C=e.M},function(e){M=e.D}],execute:function(){const y=[new i("script-loader",L),new i("glb-input-manager",class extends t{},1),new i("logger",r),new i("rapi-access",n)];class R extends g{constructor(){super(...arguments),this.shouldIgnoreStandardBehavior=!1}adjust(e,t,i,r,n){let s=new THREE.Vector3(-e.x/2,0,-e.z/2),a=new THREE.Vector3(e.x/2,e.y,e.z/2);this._boundingBox=new THREE.Box3(s,a);let o=new THREE.Euler(-Math.PI/2+r,i,0,"ZYX"),h=(new THREE.Quaternion).setFromEuler(o);this._camera.updateProjectionMatrix(),this._camera.quaternion.copy(h),this._camera.position.copy(t)}_update(e){this.shouldIgnoreStandardBehavior?this._saveYawAndPitch():super._update(e)}animateCamera(e){return!!this.shouldIgnoreStandardBehavior||super.animateCamera(e)}}class B extends w{constructor(e,t){super(e,t),this._params={ambientLight:{color:"#ffffff"}},this._ambientLight=new THREE.AmbientLight(new THREE.Color(this._params.ambientLight.color),.5),this.addToScene()}addToScene(){this._scene.add(this._ambientLight)}removeFromScene(){this._scene.remove(this._ambientLight)}reload(){this.removeFromScene(),this.addToScene()}showGUI(){let e=s();if(e&&this._ambientLight){let t=e.addFolder("Ambient Light");t.add(this._ambientLight,"visible"),t.add(this._ambientLight,"intensity").min(0).max(5).step(.1),t.addColor(this._params.ambientLight,"color").onChange(e=>{this._ambientLight.color=new THREE.Color(e)})}}}class T extends f{constructor(e,t){super(e,t,h.GLB),this._itemsCount=0,this._standardSceneBackgroundColor=this._scene.background,this._renderer.capabilities.maxTextures>8?this.loadDynamicLightSetting(c.createDynamicLightSettingSource(null,d.CAMERA)):(console.warn("this device has a maximum of 8 texture units thus we are using a simpler light setting"),this._lightSetting=new B(this._scene)),this._setEnvironment(new E(this._scene,this._environment))}createCameraControl(e,t){this._cameraControl=new R(this._creator_,this._getInputManager(),new THREE.Vector3(-1,1,1))}_getInputManager(){return this._glbInputManager}async loadStaticItem(e,t){const i=await this._rapiAccess.getItem(e);if(i.configuration)return Promise.reject();const r=p(i);return r?this.loadGLB(r,!0,void 0,t):Promise.reject(new Error("GLB Url not detected"))}loadGLB(e,t=!0,i=new THREE.Vector3(1,1,1),r){return this.clearScene(),new Promise((n,s)=>{this._loadGLB(e,new THREE.Vector3(0,0,0),0,void 0,i,void 0,void 0,r).then(e=>{this._currentGLB=e,this._scene.add(this._currentGLB);let i=(new THREE.Box3).setFromObject(this._currentGLB);if(t){let e=i.getCenter(new THREE.Vector3);this._cameraControl instanceof R&&(this._cameraControl.updateToBounds(i,!1,!0,e),this._cameraControl.reset(i,e,-15,0))}this._updateBounds(i,!0),n()},s)})}preparePerspectiveImage(e,t,i){return new Promise(r=>{t||(t=1e3),i||(i=1e3),e||((e=new THREE.WebGLRenderer({antialias:!0})).setSize(t,i),e.outputEncoding=THREE.sRGBEncoding,e.autoClear=!1,e.shadowMap.enabled=!0,e.shadowMap.type=THREE.BasicShadowMap);let n=this._cameraControl.getCamera().clone();n instanceof THREE.PerspectiveCamera&&(n.aspect=t/i,n.updateProjectionMatrix()),this._lightSetting.removeFromScene();let s=new M(this._scene);e.render(this._scene,n);let a=e.domElement.toDataURL();e.domElement.toBlob(e=>{r({image:a,width:t,height:i,blob:e})},"image/png"),s.removeFromScene(),this._lightSetting.addToScene()})}adjustCamera(e,t,i,r){if(this._cameraControl instanceof R){let n=(new THREE.Box3).setFromObject(this._scene).getSize(new THREE.Vector3);this._cameraControl.adjust(n,e,t,i,r),this._requestRender()}}onStart(e){this._itemsCount=e,this._scene.background=null,this._cameraControl instanceof R&&(this._cameraControl.shouldIgnoreStandardBehavior=!0)}onElementFinished(e){this._itemsCount,Math.round(100/this._itemsCount*e)}onFinished(e){this._scene.background=this._standardSceneBackgroundColor,this._cameraControl instanceof R&&(this._cameraControl.shouldIgnoreStandardBehavior=!1)}clearScene(){this._currentGLB&&(this._scene.remove(this._currentGLB),l(this._currentGLB),this._currentGLB=null),super.clearScene()}enableHD(){super.enableHD(),this._pixotron.enableAA=!1,this._pixotron.getSAOPass().enabled=!0}sceneChanged(){}getPixotronParams(){return{saoparams:{intensity:.25,occlusionWorldRadius:.4,smoothTransition:!0,samplesPerFrame:4,bias:.016,numSamples:200,accumulative:!1,falloff:1.5},shadowparams:{shadowMapResolution:1024,shadowRadius:3,shadowQuality:1,smoothTransition:!0,enableAccumulation:!0,shadowBiasMultiplier:.6,nearPlane:.01,farPlane:50,fov:110,side:THREE.FrontSide,numSamples:100}}}getBakedShadowParams(){return{enable:!0,shadowMapResolution:512,smoothTransition:!0,numSamples:500,numSamplesPerFrame:4,bShadowMaterial:!0,falloff:1.5,darkness:.2,size:1.6,lightDirection:new THREE.Vector3(0,1,.5),lightSolidAngle:40}}getBounds(){return this._currentGLB?(new THREE.Box3).setFromObject(this._currentGLB):null}}a([o],T.prototype,"_glbInputManager",void 0),a([o],T.prototype,"_rapiAccess",void 0);class x{constructor(e,t,i){this._prefix="https://furniture.roomle.com/3d/glb/",this._listeners=new Set,this._finishedItems=0,this._sceneManager=e,this._renderer=new THREE.WebGLRenderer({antialias:!0,alpha:!0}),this._width=t,this._height=i,this._renderer.setSize(t,i),this._renderer.setClearColor(16777215,0),this._renderer.outputEncoding=THREE.sRGBEncoding}addListener(e){this._listeners.add(e)}removeListener(e){this._listeners.delete(e)}start(e){return this._entries=[],e.forEach(e=>{this._entries.push(this._transform(e))}),this._finishedItems=0,this._listeners.forEach(e=>e.onStart(this._entries.length)),this._zip=new window.JSZip,this._doNextEntry(),new Promise(e=>{this._resolve=e})}_transform(e){return{name:e.path.replace(".glb",".png"),url:this._prefix+e.path,position:new THREE.Vector3(e.camera.position.x,e.camera.position.z,-e.camera.position.y),fov:2*e.camera.fieldOfView,yaw:e.camera.rotation.z,pitch:e.camera.rotation.x}}_doNextEntry(){0===this._entries.length?(this._listeners.forEach(e=>e.onFinished(this._zip)),this._resolve(this._zip)):this._processEntry(this._entries[0])}_processEntry(e){this._sceneManager.loadGLB(e.url,!1,void 0).then(()=>{this._sceneManager.adjustCamera(e.position,e.yaw,e.pitch,e.fov),this._sceneManager.preparePerspectiveImage(this._renderer,this._width,this._height).then(t=>{this._entryFinished(e,t)})})}_entryFinished(e,t){let i=this._entries.indexOf(e);i>-1&&this._entries.splice(i,1),this._finishedItems++,this._listeners.forEach(e=>e.onElementFinished(this._finishedItems)),this._zip.file(e.name,t.blob),this._doNextEntry()}}class H{constructor(e){this._currentIdOrUrl=null,this._creator_=e}setCameraOffset(e){this._sceneManager.setCameraOffset(e)}getCameraOffset(){return this._sceneManager.getCameraOffset()}init(e,t){return this.setOverrides(t),this._domHelper.setDomElement(e),this._sceneManager?(this._lifeCycleManager.resume(),Promise.resolve()):new Promise(this._initPromiseCallback.bind(this))}_initPromiseCallback(e,t){this._threeLoader.fetch().then(()=>{let t=this._scriptLoader.fetch(_,{id:"gltf-loader"}),i=this._scriptLoader.fetch(m,{id:"draco-loader"}),r=this._scriptLoader.fetch(b,{id:"tween-js"});Promise.all([t,i,r]).then(()=>{this._sceneManager=new T(this._creator_,{left:0,top:1,right:1,bottom:0}),this.enableHD(),e()})})}enableHD(){return new Promise((e,t)=>{const i=()=>{this._sceneManager.enableHD(),e()};Promise.all(S.map(e=>this._scriptLoader.fetch(e,{id:e}))).then(()=>{this._scriptLoader.fetch(v,{id:"pi-js"}).then(i,t)},t)})}clearScene(){this._sceneManager.clearScene()}loadGLB(e,t=1,i){return this._currentIdOrUrl=e,this._rapiAccess.trackView(e),this._sceneManager.loadGLB(e,!0,new THREE.Vector3(t,t,t),i)}loadStaticItem(e,t){return this._currentIdOrUrl=e,this._rapiAccess.trackView(e),this._sceneManager.loadStaticItem(e,t)}getCurrentId(){return this._currentIdOrUrl}loadSceneSetting(e){return this._sceneManager.loadSceneSettings(e)}loadQualitySetting(e){this._sceneManager.loadQualitySetting(e)}preparePerspectiveImage(){return this._sceneManager.preparePerspectiveImage()}processRenderList(e,t=320,i=320){let r=JSON.parse(e);this._scriptLoader.fetch("static/jszip.min-dd6c9829408677a1.js",{id:"jszip-js"}).then(()=>{let e=new x(this._sceneManager,t,i);e.addListener(this._sceneManager),e.start(r.items).then(t=>{t.generateAsync({type:"blob"}).then(t=>{let i=document.createElement("a");i.href=URL.createObjectURL(t),i.download="content.zip",i.style.display="none",document.body.appendChild(i),i.click(),document.body.removeChild(i),e.removeListener(this._sceneManager)})})})}setOverrides(e){e&&(this._initData.setOverrides(e),this._globalInitData.setOverrides(e))}updateSize(){this._sceneManager.updateCamera()}getMain(){}resumeTest(e){this._domHelper.setDomElement(e),this._lifeCycleManager.resume()}pauseTest(){this._lifeCycleManager.pause()}showGUI(){this._sceneManager.showGUI()}get callbacks(){return{}}getScene(){return this._sceneManager.getScene()}updateScene(){this._sceneManager.updateScene()}getUnitFormatter(){return this._unitFormatter}}a([o],H.prototype,"_rapiAccess",void 0),a([o],H.prototype,"_domHelper",void 0),a([o],H.prototype,"_scriptLoader",void 0),a([o],H.prototype,"_lifeCycleManager",void 0),a([o],H.prototype,"_threeLoader",void 0),a([o],H.prototype,"_initData",void 0),a([o],H.prototype,"_globalInitData",void 0),a([o],H.prototype,"_unitFormatter",void 0),e("GlbViewer",class extends C{setupGlobals(){}setupDependencies(){u.setup(y),this.lookup("logger",this._context)}cleanUpGlobals(){throw new Error("Method not implemented.")}cleanUpDependencies(){throw new Error("Method not implemented.")}bootFinished(){this._viewer=new H(this._context),window.RoomleGLBViewer||(window.RoomleGLBViewer=this._viewer)}getApi(){return this._viewer}getContextName(){return"glb-viewer"}})}}}));
|
|
2
|
-
//# sourceMappingURL=glb-viewer-
|
|
1
|
+
System.register(["./query-params-helper-c231e1b8.nomodule.js","./roomle-dependency-injection-f0b933f6.nomodule.js","./main-thread-to-worker-6a4eb1ee.nomodule.js","./pixotron-3be821e5.nomodule.js","./script-loader-c56ceed8.nomodule.js","./default-light-setting-917cc079.nomodule.js"],(function(e){var t,i,r,n,s,a,o,h,c,l,d,_,m,u,p,g,w,E,f,b,S,v,L,C,M;return{setters:[function(){},function(e){t=e.a7,i=e.D,r=e.L,n=e.R,s=e.h,a=e._,o=e.i,h=e.l,c=e.n,l=e.o,d=e.p,_=e.a5,m=e.a6,u=e.b},function(e){p=e.f},function(e){g=e.C,w=e.L,E=e.S,f=e.B,b=e.T,S=e.P,v=e.c},function(e){L=e.S,C=e.M},function(e){M=e.D}],execute:function(){const y=[new i("script-loader",L),new i("glb-input-manager",class extends t{},1),new i("logger",r),new i("rapi-access",n)];class R extends g{constructor(){super(...arguments),this.shouldIgnoreStandardBehavior=!1}adjust(e,t,i,r,n){let s=new THREE.Vector3(-e.x/2,0,-e.z/2),a=new THREE.Vector3(e.x/2,e.y,e.z/2);this._boundingBox=new THREE.Box3(s,a);let o=new THREE.Euler(-Math.PI/2+r,i,0,"ZYX"),h=(new THREE.Quaternion).setFromEuler(o);this._camera.updateProjectionMatrix(),this._camera.quaternion.copy(h),this._camera.position.copy(t)}_update(e){this.shouldIgnoreStandardBehavior?this._saveYawAndPitch():super._update(e)}animateCamera(e){return!!this.shouldIgnoreStandardBehavior||super.animateCamera(e)}}class B extends w{constructor(e,t){super(e,t),this._params={ambientLight:{color:"#ffffff"}},this._ambientLight=new THREE.AmbientLight(new THREE.Color(this._params.ambientLight.color),.5),this.addToScene()}addToScene(){this._scene.add(this._ambientLight)}removeFromScene(){this._scene.remove(this._ambientLight)}reload(){this.removeFromScene(),this.addToScene()}showGUI(){let e=s();if(e&&this._ambientLight){let t=e.addFolder("Ambient Light");t.add(this._ambientLight,"visible"),t.add(this._ambientLight,"intensity").min(0).max(5).step(.1),t.addColor(this._params.ambientLight,"color").onChange(e=>{this._ambientLight.color=new THREE.Color(e)})}}}class T extends E{constructor(e,t){super(e,t,h.GLB),this._itemsCount=0,this._standardSceneBackgroundColor=this._scene.background,this._renderer.capabilities.maxTextures>8?this.loadDynamicLightSetting(c.createDynamicLightSettingSource(null,l.CAMERA)):(console.warn("this device has a maximum of 8 texture units thus we are using a simpler light setting"),this._lightSetting=new B(this._scene)),this._setEnvironment(new f(this._scene,this._environment))}createCameraControl(e,t){this._cameraControl=new R(this._creator_,this._getInputManager(),new THREE.Vector3(-1,1,1))}_getInputManager(){return this._glbInputManager}async loadStaticItem(e,t){const i=await this._rapiAccess.getItem(e);if(i.configuration)return Promise.reject();const r=p(i);return r?this.loadGLB(r,!0,void 0,t):Promise.reject(new Error("GLB Url not detected"))}loadGLB(e,t=!0,i=new THREE.Vector3(1,1,1),r){return this.clearScene(),new Promise((n,s)=>{this._loadGLB(e,new THREE.Vector3(0,0,0),0,void 0,i,void 0,void 0,r).then(e=>{this._currentGLB=e,this._scene.add(this._currentGLB);let i=(new THREE.Box3).setFromObject(this._currentGLB);if(t){let e=i.getCenter(new THREE.Vector3);this._cameraControl instanceof R&&(this._cameraControl.updateToBounds(i,!1,!0,e),this._cameraControl.reset(i,e,-15,0))}this._updateBounds(i,!0),n()},s)})}preparePerspectiveImage(e,t,i){return new Promise(r=>{t||(t=1e3),i||(i=1e3),e||((e=new THREE.WebGLRenderer({antialias:!0})).setSize(t,i),e.outputEncoding=THREE.sRGBEncoding,e.autoClear=!1,e.shadowMap.enabled=!0,e.shadowMap.type=THREE.BasicShadowMap);let n=this._cameraControl.getCamera().clone();n instanceof THREE.PerspectiveCamera&&(n.aspect=t/i,n.updateProjectionMatrix()),this._lightSetting.removeFromScene();let s=new M(this._scene);e.render(this._scene,n);let a=e.domElement.toDataURL();e.domElement.toBlob(e=>{r({image:a,width:t,height:i,blob:e})},"image/png"),s.removeFromScene(),this._lightSetting.addToScene()})}adjustCamera(e,t,i,r){if(this._cameraControl instanceof R){let n=(new THREE.Box3).setFromObject(this._scene).getSize(new THREE.Vector3);this._cameraControl.adjust(n,e,t,i,r),this._requestRender()}}onStart(e){this._itemsCount=e,this._scene.background=null,this._cameraControl instanceof R&&(this._cameraControl.shouldIgnoreStandardBehavior=!0)}onElementFinished(e){this._itemsCount,Math.round(100/this._itemsCount*e)}onFinished(e){this._scene.background=this._standardSceneBackgroundColor,this._cameraControl instanceof R&&(this._cameraControl.shouldIgnoreStandardBehavior=!1)}clearScene(){this._currentGLB&&(this._scene.remove(this._currentGLB),d(this._currentGLB),this._currentGLB=null),super.clearScene()}enableHD(){super.enableHD(),this._pixotron.enableAA=!1,this._pixotron.getSAOPass().enabled=!0}sceneChanged(){}getPixotronParams(){return{saoparams:{intensity:.25,occlusionWorldRadius:.4,smoothTransition:!0,samplesPerFrame:4,bias:.016,numSamples:200,accumulative:!1,falloff:1.5},shadowparams:{shadowMapResolution:1024,shadowRadius:3,shadowQuality:1,smoothTransition:!0,enableAccumulation:!0,shadowBiasMultiplier:.6,nearPlane:.01,farPlane:50,fov:110,side:THREE.FrontSide,numSamples:100}}}getBakedShadowParams(){return{enable:!0,shadowMapResolution:512,smoothTransition:!0,numSamples:500,numSamplesPerFrame:4,bShadowMaterial:!0,falloff:1.5,darkness:.2,size:1.6,lightDirection:new THREE.Vector3(0,1,.5),lightSolidAngle:40}}getBounds(){return this._currentGLB?(new THREE.Box3).setFromObject(this._currentGLB):null}}a([o],T.prototype,"_glbInputManager",void 0),a([o],T.prototype,"_rapiAccess",void 0);class x{constructor(e,t,i){this._prefix="https://furniture.roomle.com/3d/glb/",this._listeners=new Set,this._finishedItems=0,this._sceneManager=e,this._renderer=new THREE.WebGLRenderer({antialias:!0,alpha:!0}),this._width=t,this._height=i,this._renderer.setSize(t,i),this._renderer.setClearColor(16777215,0),this._renderer.outputEncoding=THREE.sRGBEncoding}addListener(e){this._listeners.add(e)}removeListener(e){this._listeners.delete(e)}start(e){return this._entries=[],e.forEach(e=>{this._entries.push(this._transform(e))}),this._finishedItems=0,this._listeners.forEach(e=>e.onStart(this._entries.length)),this._zip=new window.JSZip,this._doNextEntry(),new Promise(e=>{this._resolve=e})}_transform(e){return{name:e.path.replace(".glb",".png"),url:this._prefix+e.path,position:new THREE.Vector3(e.camera.position.x,e.camera.position.z,-e.camera.position.y),fov:2*e.camera.fieldOfView,yaw:e.camera.rotation.z,pitch:e.camera.rotation.x}}_doNextEntry(){0===this._entries.length?(this._listeners.forEach(e=>e.onFinished(this._zip)),this._resolve(this._zip)):this._processEntry(this._entries[0])}_processEntry(e){this._sceneManager.loadGLB(e.url,!1,void 0).then(()=>{this._sceneManager.adjustCamera(e.position,e.yaw,e.pitch,e.fov),this._sceneManager.preparePerspectiveImage(this._renderer,this._width,this._height).then(t=>{this._entryFinished(e,t)})})}_entryFinished(e,t){let i=this._entries.indexOf(e);i>-1&&this._entries.splice(i,1),this._finishedItems++,this._listeners.forEach(e=>e.onElementFinished(this._finishedItems)),this._zip.file(e.name,t.blob),this._doNextEntry()}}class H{constructor(e){this._currentIdOrUrl=null,this._creator_=e}setCameraOffset(e){this._sceneManager.setCameraOffset(e)}getCameraOffset(){return this._sceneManager.getCameraOffset()}init(e,t){return this.setOverrides(t),this._domHelper.setDomElement(e),this._sceneManager?(this._lifeCycleManager.resume(),Promise.resolve()):new Promise(this._initPromiseCallback.bind(this))}_initPromiseCallback(e,t){this._threeLoader.fetch().then(()=>{let t=this._scriptLoader.fetch(_,{id:"gltf-loader"}),i=this._scriptLoader.fetch(m,{id:"draco-loader"}),r=this._scriptLoader.fetch(b,{id:"tween-js"});Promise.all([t,i,r]).then(()=>{this._sceneManager=new T(this._creator_,{left:0,top:1,right:1,bottom:0}),this.enableHD(),e()})})}enableHD(){return new Promise((e,t)=>{const i=()=>{this._sceneManager.enableHD(),e()};Promise.all(S.map(e=>this._scriptLoader.fetch(e,{id:e}))).then(()=>{this._scriptLoader.fetch(v,{id:"pi-js"}).then(i,t)},t)})}clearScene(){this._sceneManager.clearScene()}loadGLB(e,t=1,i){return this._currentIdOrUrl=e,this._rapiAccess.trackView(e),this._sceneManager.loadGLB(e,!0,new THREE.Vector3(t,t,t),i)}loadStaticItem(e,t){return this._currentIdOrUrl=e,this._rapiAccess.trackView(e),this._sceneManager.loadStaticItem(e,t)}getCurrentId(){return this._currentIdOrUrl}loadSceneSetting(e){return this._sceneManager.loadSceneSettings(e)}loadQualitySetting(e){this._sceneManager.loadQualitySetting(e)}preparePerspectiveImage(){return this._sceneManager.preparePerspectiveImage()}processRenderList(e,t=320,i=320){let r=JSON.parse(e);this._scriptLoader.fetch("static/jszip.min-dd6c9829408677a1.js",{id:"jszip-js"}).then(()=>{let e=new x(this._sceneManager,t,i);e.addListener(this._sceneManager),e.start(r.items).then(t=>{t.generateAsync({type:"blob"}).then(t=>{let i=document.createElement("a");i.href=URL.createObjectURL(t),i.download="content.zip",i.style.display="none",document.body.appendChild(i),i.click(),document.body.removeChild(i),e.removeListener(this._sceneManager)})})})}setOverrides(e){e&&(this._initData.setOverrides(e),this._globalInitData.setOverrides(e))}updateSize(){this._sceneManager.updateCamera()}getMain(){}resumeTest(e){this._domHelper.setDomElement(e),this._lifeCycleManager.resume()}pauseTest(){this._lifeCycleManager.pause()}showGUI(){this._sceneManager.showGUI()}get callbacks(){return{}}getScene(){return this._sceneManager.getScene()}updateScene(){this._sceneManager.updateScene()}getUnitFormatter(){return this._unitFormatter}}a([o],H.prototype,"_rapiAccess",void 0),a([o],H.prototype,"_domHelper",void 0),a([o],H.prototype,"_scriptLoader",void 0),a([o],H.prototype,"_lifeCycleManager",void 0),a([o],H.prototype,"_threeLoader",void 0),a([o],H.prototype,"_initData",void 0),a([o],H.prototype,"_globalInitData",void 0),a([o],H.prototype,"_unitFormatter",void 0),e("GlbViewer",class extends C{setupGlobals(){}setupDependencies(){u.setup(y),this.lookup("logger",this._context)}cleanUpGlobals(){throw new Error("Method not implemented.")}cleanUpDependencies(){throw new Error("Method not implemented.")}bootFinished(){this._viewer=new H(this._context),window.RoomleGLBViewer||(window.RoomleGLBViewer=this._viewer)}getApi(){return this._viewer}getContextName(){return"glb-viewer"}})}}}));
|
|
2
|
+
//# sourceMappingURL=glb-viewer-f5f9a050.nomodule.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"glb-viewer-
|
|
1
|
+
{"version":3,"file":"glb-viewer-f5f9a050.nomodule.js","sources":["../../node_modules/jszip/dist/jszip.min.js"],"sourcesContent":["export default \"static/jszip.min-dd6c9829408677a1.js\""],"names":[],"mappings":"+6QAAe"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import"./query-params-helper-a271f9dc.js";import"./roomle-dependency-injection-8d66ecac.js";import"./main-thread-to-worker-88f74244.js";import"./pixotron-32c4e05d.js";import"./script-loader-a1d7afdd.js";import"./default-light-setting-17aeb133.js";import{GlbViewer}from"./glb-viewer-45e04caa.js";(new GlbViewer).boot();
|
|
2
|
+
//# sourceMappingURL=glb-viewer-main-be603c6d.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"glb-viewer-main-be603c6d.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
System.register(["./query-params-helper-c231e1b8.nomodule.js","./roomle-dependency-injection-
|
|
1
|
+
System.register(["./query-params-helper-c231e1b8.nomodule.js","./roomle-dependency-injection-f0b933f6.nomodule.js","./main-thread-to-worker-6a4eb1ee.nomodule.js","./pixotron-3be821e5.nomodule.js","./script-loader-c56ceed8.nomodule.js","./default-light-setting-917cc079.nomodule.js","./glb-viewer-f5f9a050.nomodule.js"],(function(){var e;return{setters:[function(){},function(){},function(){},function(){},function(){},function(){},function(n){e=n.GlbViewer}],execute:function(){(new e).boot()}}}));
|
|
2
2
|
//# sourceMappingURL=glb-viewer-main.nomodule.js.map
|
package/lib/legacy/{banana-for-scale-35cca9b6.legacy.js → banana-for-scale-2021b8ce.legacy.js}
RENAMED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
System.register(["./roomle-dependency-injection-
|
|
2
|
-
//# sourceMappingURL=banana-for-scale-
|
|
1
|
+
System.register(["./roomle-dependency-injection-c465c69e.legacy.js","./main-thread-to-worker-cc24f989.legacy.js"],(function(e){var n,t,a,s;return{setters:[function(e){n=e.aj,t=e._,a=e.i},function(e){s=e.g}],execute:function(){class i extends n{setScene(e){this._scene=e,this._staticItemLoader.loadGLB(s()+"static/banana_div2-1351c98ec2986be1.glb").then(e=>{this._banana=e,this.updateBounds(null)})}updateBounds(e){if(e&&(this._bounds=e),this._bounds){if(this._banana){const e=this._bounds.getSize(new THREE.Vector3),n=this._bounds.getCenter(new THREE.Vector3).clone();n.x-=e.x/2+.18,n.z+=e.z/2+.05,n.y=0;let t=.03;this._banana.scale.copy(new THREE.Vector3(t,t,t)),this._banana.rotation.y=.6,this._banana.position.copy(n)}this._scene.children.includes(this._banana)||this.addToScene()}}clearScene(e,n){super.clearScene(e,n),this.removeFromScene()}addToScene(){this._scene&&this._banana&&this._scene.add(this._banana)}removeFromScene(){this._scene&&this._banana&&this._scene.remove(this._banana)}}e("default",i),t([a],i.prototype,"_staticItemLoader",void 0)}}}));
|
|
2
|
+
//# sourceMappingURL=banana-for-scale-2021b8ce.legacy.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"banana-for-scale-
|
|
1
|
+
{"version":3,"file":"banana-for-scale-2021b8ce.legacy.js","sources":["../../../packages/configurator-core/public/geometry/banana_div2.glb"],"sourcesContent":["export default \"static/banana_div2-1351c98ec2986be1.glb\""],"names":[],"mappings":"iTAAe"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
System.register(["./query-params-helper-8c00a872.legacy.js","./main-thread-to-worker-
|
|
1
|
+
System.register(["./query-params-helper-8c00a872.legacy.js","./main-thread-to-worker-cc24f989.legacy.js"],(function(){var e,r,t;return{setters:[function(r){e=r.g},function(e){r=e.M,t=e.g}],execute:function(){new class{_addIframe(){const r="website-to-measure";if(document.getElementById(r))return void console.error("Iframe already added! Check how this can happen");const t=e();if(!t.checkUrl)return void console.error("CAN NOT MEASURE WITHOUT A URL, add checkUrl queryParam. To encode call BudgeteerMeasure.encodeUrl(url: string)");let o=this.decodeUrl(t.checkUrl);const i=window.location.origin;if(!o.startsWith(i))return void console.error("CAN ONLY MEASURE SAME ORIGIN PLEASE CHECK",{origin:i,src:o});const n=e(o),a=Object.keys(n).length?"&":"?";n._measureTraffic||(o+=a+"_measureTraffic=true");const s=document.createElement("iframe");s.id=r,s.src=o,document.body.appendChild(s)}_isAlreadyActive(){return navigator.serviceWorker.controller&&-1!==navigator.serviceWorker.controller.scriptURL.indexOf("budgeteer.sw")&&"activated"===navigator.serviceWorker.controller.state}_handleActiveSw(){this._mainThreadToWorker.setEventPoster(navigator.serviceWorker.controller),this._addIframe(),this._alreadyAdded=!0}constructor(){this._inLimbo=!1,this._alreadyAdded=!1,window.addEventListener("beforeunload",()=>this._inLimbo=!0),this._mainThreadToWorker=new r(this,navigator.serviceWorker),this._isAlreadyActive()?this._handleActiveSw():navigator.serviceWorker.register(t()+"static/budgeteer.sw-0a8d4e36e18346a5.js",{scope:"../../"}).then(e=>{this._isAlreadyActive()&&this._handleActiveSw()},e=>console.error("Budgeteer registration failed: ",e)),navigator.serviceWorker.addEventListener("controllerchange",()=>this._mainThreadToWorker.setEventPoster(navigator.serviceWorker.controller)),window.BudgeteerMeasure={encodeUrl:this.encodeUrl}}encodeUrl(e){return encodeURIComponent(e)}decodeUrl(e){return decodeURIComponent(e)}onCommand(e){if(!this._inLimbo)switch(e){case 6:this._alreadyAdded||this._addIframe()}}}}}}));
|
|
2
2
|
//# sourceMappingURL=budgeteer-measure.legacy.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"budgeteer-measure.legacy.js","sources":["../../../packages/workers/generated/budgeteer.sw.js"],"sourcesContent":["export default \"static/budgeteer.sw-
|
|
1
|
+
{"version":3,"file":"budgeteer-measure.legacy.js","sources":["../../../packages/workers/generated/budgeteer.sw.js"],"sourcesContent":["export default \"static/budgeteer.sw-0a8d4e36e18346a5.js\""],"names":[],"mappings":"87CAAe"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
System.register(["./roomle-dependency-injection-
|
|
2
|
-
//# sourceMappingURL=component-dimensioning-
|
|
1
|
+
System.register(["./roomle-dependency-injection-c465c69e.legacy.js","./main-thread-to-worker-cc24f989.legacy.js"],(function(e){var i,t;return{setters:[function(e){i=e._,t=e.i},function(){}],execute:function(){const n="component_dimensioning_line_material",s="component_dimensioning_plane_material",o="component_dimensioning_text_material";class a extends THREE.Object3D{constructor(e,i,t,n){super(),this._center=i.getCenter(new THREE.Vector3),this._size=i.getSize(new THREE.Vector3),this._origin=this._center.clone().sub(this._size.clone().multiplyScalar(.5)),this._dimensioning=e,this._level=this._dimensioning.maxLevel-this._dimensioning.level,this._font=t,this._cameraPosition=n,this._init()}_initMaterials(){this._cacheHolder.materialCache.has(n)?this._lineMaterial=this._cacheHolder.materialCache.get(n):(this._lineMaterial=new THREE.LineBasicMaterial({color:3618615}),this._cacheHolder.materialCache.set(n,this._lineMaterial)),this._cacheHolder.materialCache.has(s)?this._planeMaterial=this._cacheHolder.materialCache.get(s):(this._planeMaterial=new THREE.MeshBasicMaterial({color:16777215,side:THREE.DoubleSide,opacity:.8,transparent:!0}),this._cacheHolder.materialCache.set(s,this._planeMaterial)),this._cacheHolder.materialCache.has(o)?this._textMaterial=this._cacheHolder.materialCache.get(o):(this._textMaterial=new THREE.MeshPhongMaterial({color:3618615}),this._cacheHolder.materialCache.set(o,this._textMaterial))}_init(){this._initMaterials();let e=new THREE.Geometry;this._line=new THREE.Line(e,this._lineMaterial),this._line.name="component dimension line "+this._dimensioning.type.value,this._text=new THREE.Mesh(e,this._textMaterial),this._text.name="component dimension text "+this._dimensioning.type.value,this._plane=new THREE.Mesh(e,this._planeMaterial),this._plane.name="component dimension plane "+this._dimensioning.type.value;let i,t=new THREE.Geometry,n=Math.round(Math.max(this._size.y,this._size.x,this._size.z)),s=Math.abs(this._dimensioning.to-this._dimensioning.from),o=.025+(n<4?0:.005*n);s<.3&&(o*=.5+s);let a={font:this._font,size:o,height:.001,curveSegments:2,bevelEnabled:!0,bevelThickness:.001,bevelSize:.001},h=this._dimensioning.label?this._dimensioning.label:this._unitFormatter.formatMMValueToUnitString(1e3*s),_=new THREE.TextGeometry(h,a);_.computeBoundingBox();let l=_.boundingBox.getSize(new THREE.Vector3).y;if(0===this._dimensioning.type.value&&(i=this._getXEdge(l),this._addXEdgeSideLines(l)),1===this._dimensioning.type.value&&(i=this._getYEdge(l),this._addYEdgeSideLines(l)),2===this._dimensioning.type.value&&(i=this._getZEdge(l),this._addZEdgeSideLines(l)),t.vertices.push(i.start,i.end),this._line.geometry.dispose(),this._line.geometry=t,this.add(this._line),this._text.geometry=_,0===this._dimensioning.type.value&&this._addText(i,_,new THREE.Quaternion,new THREE.Vector3(0,.04,0)),1===this._dimensioning.type.value){let e=new THREE.Quaternion,t=this._getXSign()>0?Math.PI/2:Math.PI/2*3;e.setFromAxisAngle(new THREE.Vector3(0,0,1),t),this._addText(i,_,e,new THREE.Vector3(.04,0,0))}if(2===this._dimensioning.type.value){let e=this._getXSign()>0?Math.PI/2:Math.PI/2*3,t=(new THREE.Quaternion).setFromAxisAngle(new THREE.Vector3(-1,0,0),Math.PI/2),n=(new THREE.Quaternion).setFromAxisAngle(new THREE.Vector3(0,0,1),e);this._addText(i,_,t.multiply(n),new THREE.Vector3(.04,0,0))}}_getXEdge(e){let i=this._size.y+.05+(.06+e)*this._level;const t=new THREE.Vector3(0,this._origin.y,this._origin.z);let n=t.clone().add(new THREE.Vector3(this._dimensioning.from,i,0)),s=t.clone().add(new THREE.Vector3(this._dimensioning.to,i,0));return new THREE.Line3(n,s)}_addXEdgeSideLines(e){let i=this._size.y+.05+(.06+e)*(this._level-.5),t=this._size.y+.05+(.06+e)*this._level;const n=new THREE.Vector3(0,this._origin.y,this._origin.z);let s=n.clone().add(new THREE.Vector3(this._dimensioning.from,i,0)),o=n.clone().add(new THREE.Vector3(this._dimensioning.from,t,0)),a=n.clone().add(new THREE.Vector3(this._dimensioning.to,i,0)),h=n.clone().add(new THREE.Vector3(this._dimensioning.to,t,0));this._addLine(s,o),this._addLine(a,h)}_getZEdge(e){let i=(this._getXSign()>0?this._size.x:0)+.05+(.06+e)*this._level;i*=this._getXSign();const t=new THREE.Vector3(this._origin.x,this._origin.y,0);let n=t.clone().add(new THREE.Vector3(i,0,this._dimensioning.from)),s=t.clone().add(new THREE.Vector3(i,0,this._dimensioning.to));return new THREE.Line3(n,s)}_addZEdgeSideLines(e){let i=this._getXSign()>0?this._size.x:0,t=i+.05+(.06+e)*(this._level-.5),n=i+.05+(.06+e)*this._level;t*=this._getXSign(),n*=this._getXSign();const s=new THREE.Vector3(this._origin.x,this._origin.y,0);let o=s.clone().add(new THREE.Vector3(t,0,this._dimensioning.from)),a=s.clone().add(new THREE.Vector3(n,0,this._dimensioning.from)),h=s.clone().add(new THREE.Vector3(t,0,this._dimensioning.to)),_=s.clone().add(new THREE.Vector3(n,0,this._dimensioning.to));this._addLine(o,a),this._addLine(h,_)}_getYEdge(e){let i=(this._getXSign()>0?this._size.x:0)+.05+(.06+e)*this._level;i*=this._getXSign();const t=new THREE.Vector3(this._origin.x,0,this._origin.z);let n=t.clone().add(new THREE.Vector3(i,this._dimensioning.from,0)),s=t.clone().add(new THREE.Vector3(i,this._dimensioning.to,0));return new THREE.Line3(n,s)}_addYEdgeSideLines(e){let i=this._getXSign()>0?this._size.x:0,t=i+.05+(.06+e)*(this._level-.5),n=i+.05+(.06+e)*this._level;t*=this._getXSign(),n*=this._getXSign();const s=new THREE.Vector3(this._origin.x,0,this._origin.z);let o=s.clone().add(new THREE.Vector3(t,this._dimensioning.from,0)),a=s.clone().add(new THREE.Vector3(n,this._dimensioning.from,0)),h=s.clone().add(new THREE.Vector3(t,this._dimensioning.to,0)),_=s.clone().add(new THREE.Vector3(n,this._dimensioning.to,0));this._addLine(o,a),this._addLine(h,_)}_addLine(e,i){let t=new THREE.Geometry;t.vertices.push(e,i),this.add(new THREE.Line(t,this._lineMaterial))}_addText(e,i,t,n){let s=e.getCenter(new THREE.Vector3);n.x*=this._getXSign(),s.add(n);let o=i.boundingBox.getSize(new THREE.Vector3);i.center(),this._text.position.copy(s),this._text.quaternion.copy(t),this.add(this._text);let a=new THREE.PlaneGeometry(o.x+.02,o.y+.02,32);a.center(),this._plane.geometry=a,this._plane.position.copy(s),this._plane.quaternion.copy(t),this.add(this._plane)}_getXSign(){return this._cameraPosition.x>=0?1:-1}}e("default",a),i([t],a.prototype,"_cacheHolder",void 0),i([t],a.prototype,"_unitFormatter",void 0)}}}));
|
|
2
|
+
//# sourceMappingURL=component-dimensioning-f4289533.legacy.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"component-dimensioning-f4289533.legacy.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
System.register(["./roomle-dependency-injection-
|
|
2
|
-
//# sourceMappingURL=component-raycast-helper-
|
|
1
|
+
System.register(["./roomle-dependency-injection-c465c69e.legacy.js","./main-thread-to-worker-cc24f989.legacy.js"],(function(e){var t,i;return{setters:[function(e){t=e.a0},function(e){i=e.t}],execute:function(){e("default",class{constructor(){this._nonTransparentComponent=null,this._raycaster=new THREE.Raycaster,this._raycaster.near=.1,this._raycaster.layers.enable(3)}init(e,t){this._scene=e,this._camera=t,this.checkComponentVisibility=i(this.checkComponentVisibility,100).bind(this),this.checkPreviewVisibility=i(this.checkPreviewVisibility,100).bind(this)}changeMaterialsOnSelect(e,t,i=!1){t!==this._nonTransparentComponent&&(this._nonTransparentComponent=t,this._changeMaterialsOnSelect(e,t,i))}_changeMaterialsOnSelect(e,i,s=!1){if(e.children.length>0&&e.children.forEach(t=>{const n=i&&e.id===i.id||s,a=!(t instanceof THREE.Mesh);this._changeMaterialsOnSelect(t,i,(!n||!a)&&n)}),i)e instanceof THREE.Mesh&&e.material instanceof THREE.MeshStandardMaterial&&!e.userData.oldMaterial&&(e.userData.oldMaterial=e.material,e.material=e.material.clone(),s||t(e,{opacity:.2,transparent:!0}));else if(e.userData.oldMaterial&&e instanceof THREE.Mesh&&e.material instanceof THREE.MeshStandardMaterial){const{opacity:i,transparent:s}=e.userData.oldMaterial;t(e,{opacity:i,transparent:s}),e.userData.oldMaterial=void 0}}isComponentVisible(e){const t=[];e.traverse(e=>t.push(e.uuid));const i=(new THREE.Box3).setFromObject(e).getCenter(new THREE.Vector3),s=(new THREE.Vector3).subVectors(i,this._camera.position).normalize();this._raycaster.set(this._camera.position,s),this._raycaster.far=this._camera.position.distanceTo(i);const n=[];return this._raycaster.intersectObjects(this._scene.children,!0).forEach(e=>{e.object.material.visible&&(t.includes(e.object.uuid)||e.object.userData.ignoreComponentRaycast||n.push(e))}),0===n.length}checkComponentAndPreviewVisibility(e,t){e.hasSelection()?this.checkComponentVisibility(e,t):t.hasPreviews()?this.checkPreviewVisibility(t):this.changeMaterialsOnSelect(this._scene,null)}checkComponentVisibility(e,t){if(!e.hasSelection())return;const i=t.getComponentsForIds(e.getSelectedRuntimeComponentIds());if(i.length>1)return;const s=i[0];this.isComponentVisible(s)?this.changeMaterialsOnSelect(this._scene,null):this.changeMaterialsOnSelect(this._scene,s)}areAllPreviewsVisible(e){if(!e.hasPreviews())return!0;const t=e.getPreviews();return 0===t.length||t.map(e=>this.isComponentVisible(e)).reduce((e,t)=>e&&t)}checkPreviewVisibility(e){this.areAllPreviewsVisible(e)?this.changeMaterialsOnSelect(this._scene,null):this.changeMaterialsOnSelect(this._scene,{id:-1})}})}}}));
|
|
2
|
+
//# sourceMappingURL=component-raycast-helper-afb624ed.legacy.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"component-raycast-helper-afb624ed.legacy.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
System.register(["./query-params-helper-8c00a872.legacy.js","./roomle-dependency-injection-
|
|
2
|
-
//# sourceMappingURL=configurator-
|
|
1
|
+
System.register(["./query-params-helper-8c00a872.legacy.js","./roomle-dependency-injection-c465c69e.legacy.js","./main-thread-to-worker-cc24f989.legacy.js","./roomle-configurator-40f860e2.legacy.js","./pixotron-e0f1cf47.legacy.js","./script-loader-f53b8215.legacy.js","./component-raycast-helper-afb624ed.legacy.js","./default-light-setting-29282b63.legacy.js"],(function(e){var n,o,t,c,r,a,i,s,l,u,p,g,f,h;return{setters:[function(){},function(e){n=e.D,o=e.L,t=e.R,c=e.a,r=e.C,a=e.b,i=e.A},function(){},function(e){s=e.C,l=e.R},function(e){u=e.C,p=e.a},function(e){g=e.S,f=e.M},function(e){h=e.default},function(){}],execute:function(){const d=[new n("logger",o),new n("rapi-access",t),new n("script-loader",g),new n("camera-control-3d",u),new n("camera-control",p),new n("data-syncer",c),new n("configurator-scene-manager",s,1),new n("configurator-view-model",r,1),new n("component-raycast-helper",h,0)];e("Configurator",class extends f{setupDependencies(){a.setup(d),this.lookup("planner-kernel-access",this._context).init(1),this.lookup("rapi-access",this._context),this.lookup("script-loader",this._context),this.lookup("logger",this._context)}cleanUpGlobals(){delete window.RoomleConfigurator}cleanUpDependencies(){const e=this.lookup("script-loader"),n=this.lookup("rapi-access"),o=(this.lookup("dom-helper"),this.lookup("configurator-scene-manager"));e&&e.cleanUp(),n&&n.cleanUp(),o&&o.cleanUp()}setupGlobals(e){const{kernelInstance:n,kernelContainer:o,planObjectId:t}=e||{};i.init({kernelInstance:n,kernelContainer:o,planObjectId:t})}getApi(){return this._configurator}bootFinished(){this._configurator=new l(this._context),this._configurator.getMain=()=>this,window.RoomleConfigurator||(window.RoomleConfigurator=this._configurator)}getContextName(){return"configurator"}})}}}));
|
|
2
|
+
//# sourceMappingURL=configurator-431855b5.legacy.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"configurator-431855b5.legacy.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
System.register(["./query-params-helper-8c00a872.legacy.js","./roomle-dependency-injection-
|
|
1
|
+
System.register(["./query-params-helper-8c00a872.legacy.js","./roomle-dependency-injection-c465c69e.legacy.js","./main-thread-to-worker-cc24f989.legacy.js","./roomle-configurator-40f860e2.legacy.js","./pixotron-e0f1cf47.legacy.js","./script-loader-f53b8215.legacy.js","./component-raycast-helper-afb624ed.legacy.js","./default-light-setting-29282b63.legacy.js","./configurator-431855b5.legacy.js"],(function(){var e;return{setters:[function(){},function(){},function(){},function(){},function(){},function(){},function(){},function(){},function(n){e=n.Configurator}],execute:function(){(new e).boot(),window.requestIdleCallback||(window.requestIdleCallback=e=>setTimeout(()=>{let n=Date.now();e({didTimeout:!1,timeRemaining:()=>Math.max(0,50-(Date.now()-n))})},1)),window.cancelIdleCallback||(window.cancelIdleCallback=window.cancelIdleCallback||function(e){clearTimeout(e)})}}}));
|
|
2
2
|
//# sourceMappingURL=configurator-main.legacy.js.map
|