@roomle/web-sdk 2.44.0-alpha.1 → 2.44.0-alpha.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.releaserc.json +55 -58
- package/README.md +3 -0
- package/lib/{banana-for-scale-c9b91436.nomodule.js → banana-for-scale-97a65f2f.nomodule.js} +2 -2
- package/lib/{banana-for-scale-c9b91436.nomodule.js.map → banana-for-scale-97a65f2f.nomodule.js.map} +1 -1
- package/lib/{banana-for-scale-1f350acc.js → banana-for-scale-e8876cf0.js} +2 -2
- package/lib/{banana-for-scale-1f350acc.js.map → banana-for-scale-e8876cf0.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-8b90144f.js → component-dimensioning-c495efe5.js} +2 -2
- package/lib/component-dimensioning-c495efe5.js.map +1 -0
- package/lib/{component-dimensioning-11e334e6.nomodule.js → component-dimensioning-c9877d28.nomodule.js} +2 -2
- package/lib/component-dimensioning-c9877d28.nomodule.js.map +1 -0
- package/lib/{component-raycast-helper-d34cf336.js → component-raycast-helper-23393bb6.js} +2 -2
- package/lib/component-raycast-helper-23393bb6.js.map +1 -0
- package/lib/{component-raycast-helper-917c5fce.nomodule.js → component-raycast-helper-3ec360cf.nomodule.js} +2 -2
- package/lib/component-raycast-helper-3ec360cf.nomodule.js.map +1 -0
- package/lib/{configurator-74c366d0.nomodule.js → configurator-6e17bbb4.nomodule.js} +2 -2
- package/lib/configurator-6e17bbb4.nomodule.js.map +1 -0
- package/lib/{configurator-fb2e05ef.js → configurator-a0113de7.js} +2 -2
- package/lib/configurator-a0113de7.js.map +1 -0
- package/lib/configurator-dummy-app.js.map +1 -1
- package/lib/configurator-dummy.html +167 -79
- package/lib/configurator-main-10fa7f9b.js +2 -0
- package/lib/configurator-main-10fa7f9b.js.map +1 -0
- package/lib/configurator-main.nomodule.js +1 -1
- package/lib/{default-light-setting-43be6138.js → default-light-setting-408ac1bd.js} +2 -2
- package/lib/default-light-setting-408ac1bd.js.map +1 -0
- package/lib/{default-light-setting-e2fe40ee.nomodule.js → default-light-setting-f72c0eb6.nomodule.js} +2 -2
- package/lib/default-light-setting-f72c0eb6.nomodule.js.map +1 -0
- package/lib/definitions/common-core/src/lightsetting/dynamic-light-setting-loader.d.ts +1 -1
- package/lib/definitions/common-core/src/main.d.ts +3 -4
- package/lib/definitions/common-core/src/utils/shims.d.ts +2 -2
- package/lib/definitions/configurator-core/src/roomle-configurator.d.ts +70 -70
- package/lib/definitions/configurator-core/src/services/configurator-ui-callback.d.ts +5 -5
- package/lib/definitions/glb-viewer-core/src/roomle-glb-viewer.d.ts +2 -2
- package/lib/definitions/material-viewer/src/roomle-material-viewer.d.ts +2 -2
- package/lib/definitions/planner-core/src/roomle-planner-ui-callback.d.ts +1 -0
- package/lib/{dimensioning-helper-439a1eab.js → dimensioning-helper-be971abb.js} +2 -2
- package/lib/{dimensioning-helper-439a1eab.js.map → dimensioning-helper-be971abb.js.map} +1 -1
- package/lib/{dimensioning-helper-5d68f7b8.nomodule.js → dimensioning-helper-d1ca3c93.nomodule.js} +2 -2
- package/lib/dimensioning-helper-d1ca3c93.nomodule.js.map +1 -0
- package/lib/embedding-dummy.html +122 -94
- package/lib/{glb-viewer-d2d45ce4.js → glb-viewer-1c3b5760.js} +2 -2
- package/lib/{glb-viewer-d2d45ce4.js.map → glb-viewer-1c3b5760.js.map} +1 -1
- package/lib/{glb-viewer-185f0c5b.nomodule.js → glb-viewer-21871044.nomodule.js} +2 -2
- package/lib/{glb-viewer-185f0c5b.nomodule.js.map → glb-viewer-21871044.nomodule.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-main-76258bd6.js +2 -0
- package/lib/glb-viewer-main-76258bd6.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-5bbe2474.legacy.js} +2 -2
- package/lib/legacy/{banana-for-scale-35cca9b6.legacy.js.map → banana-for-scale-5bbe2474.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-19219632.legacy.js} +2 -2
- package/lib/legacy/component-dimensioning-19219632.legacy.js.map +1 -0
- package/lib/legacy/{component-raycast-helper-c9e6fa8a.legacy.js → component-raycast-helper-8f7251fb.legacy.js} +2 -2
- package/lib/legacy/component-raycast-helper-8f7251fb.legacy.js.map +1 -0
- package/lib/legacy/{configurator-0dc9d32c.legacy.js → configurator-25fd6957.legacy.js} +2 -2
- package/lib/legacy/configurator-25fd6957.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-fc14e161.legacy.js} +2 -2
- package/lib/legacy/default-light-setting-fc14e161.legacy.js.map +1 -0
- package/lib/legacy/{dimensioning-helper-9d5a7b3c.legacy.js → dimensioning-helper-3703ce6f.legacy.js} +2 -2
- package/lib/legacy/dimensioning-helper-3703ce6f.legacy.js.map +1 -0
- package/lib/legacy/{glb-viewer-069756aa.legacy.js → glb-viewer-750198d1.legacy.js} +2 -2
- package/lib/legacy/{glb-viewer-069756aa.legacy.js.map → glb-viewer-750198d1.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-85314524.legacy.js} +2 -2
- package/lib/legacy/material-viewer-85314524.legacy.js.map +1 -0
- package/lib/legacy/material-viewer-main.legacy.js +1 -1
- package/lib/legacy/{pixotron-4d1c8db2.legacy.js → pixotron-fe363849.legacy.js} +2 -2
- package/lib/legacy/{pixotron-4d1c8db2.legacy.js.map → pixotron-fe363849.legacy.js.map} +1 -1
- package/lib/legacy/planner-a422d4e7.legacy.js +2 -0
- package/lib/legacy/{planner-3334d9c4.legacy.js.map → planner-a422d4e7.legacy.js.map} +1 -1
- package/lib/legacy/planner-main.legacy.js +1 -1
- package/lib/legacy/{roomle-configurator-cd107a29.legacy.js → roomle-configurator-4ac0dbee.legacy.js} +2 -2
- package/lib/legacy/{roomle-configurator-cd107a29.legacy.js.map → roomle-configurator-4ac0dbee.legacy.js.map} +1 -1
- package/lib/legacy/roomle-dependency-injection-c859bb7b.legacy.js +16 -0
- package/lib/legacy/{roomle-dependency-injection-aa414f84.legacy.js.map → roomle-dependency-injection-c859bb7b.legacy.js.map} +1 -1
- package/lib/legacy/roomle-sdk.legacy.js +1 -1
- package/lib/legacy/{script-loader-37d724e7.legacy.js → script-loader-e0a57fb9.legacy.js} +2 -2
- package/lib/legacy/script-loader-e0a57fb9.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-219b62c099a8555a.json} +1 -1
- package/lib/legacy/{stats-helper-358f1fcc.legacy.js → stats-helper-301dc461.legacy.js} +2 -2
- package/lib/legacy/{stats-helper-358f1fcc.legacy.js.map → stats-helper-301dc461.legacy.js.map} +1 -1
- package/lib/legacy/{tools-core-f3b4d22c.legacy.js → tools-core-762555af.legacy.js} +2 -2
- package/lib/legacy/tools-core-762555af.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-e7514f95.js → material-viewer-4c7564b3.js} +2 -2
- package/lib/material-viewer-4c7564b3.js.map +1 -0
- package/lib/{material-viewer-2db93afe.nomodule.js → material-viewer-5591d60a.nomodule.js} +2 -2
- package/lib/material-viewer-5591d60a.nomodule.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-16e395e9.js +2 -0
- package/lib/material-viewer-main-16e395e9.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-5905d47b.js} +2 -2
- package/lib/{pixotron-e1f44e21.js.map → pixotron-5905d47b.js.map} +1 -1
- package/lib/{pixotron-11d8ecf1.nomodule.js → pixotron-9fe87cf0.nomodule.js} +2 -2
- package/lib/{pixotron-11d8ecf1.nomodule.js.map → pixotron-9fe87cf0.nomodule.js.map} +1 -1
- package/lib/planner-85bd03e6.nomodule.js +2 -0
- package/lib/{planner-2fb083b9.nomodule.js.map → planner-85bd03e6.nomodule.js.map} +1 -1
- package/lib/planner-dummy-app.js.map +1 -1
- package/lib/planner-dummy.html +64 -43
- package/lib/planner-e72d2ec5.js +2 -0
- package/lib/{planner-b9697b33.js.map → planner-e72d2ec5.js.map} +1 -1
- package/lib/planner-main-0d79120f.js +2 -0
- package/lib/planner-main-0d79120f.js.map +1 -0
- package/lib/planner-main.nomodule.js +1 -1
- package/lib/{roomle-configurator-3bc0f646.js → roomle-configurator-43aab7fd.js} +2 -2
- package/lib/{roomle-configurator-3bc0f646.js.map → roomle-configurator-43aab7fd.js.map} +1 -1
- package/lib/{roomle-configurator-e2cafe97.nomodule.js → roomle-configurator-e72d373d.nomodule.js} +2 -2
- package/lib/{roomle-configurator-e2cafe97.nomodule.js.map → roomle-configurator-e72d373d.nomodule.js.map} +1 -1
- package/lib/roomle-dependency-injection-0464676f.js +16 -0
- package/lib/{roomle-dependency-injection-244ed68c.js.map → roomle-dependency-injection-0464676f.js.map} +1 -1
- package/lib/roomle-dependency-injection-07615f35.nomodule.js +16 -0
- package/lib/{roomle-dependency-injection-4c51790a.nomodule.js.map → roomle-dependency-injection-07615f35.nomodule.js.map} +1 -1
- package/lib/{roomle-sdk-9cc773d7.js → roomle-sdk-dd5cc592.js} +2 -2
- package/lib/roomle-sdk-dd5cc592.js.map +1 -0
- package/lib/roomle-sdk.nomodule.js +1 -1
- package/lib/{script-loader-584a0480.js → script-loader-394f7657.js} +2 -2
- package/lib/script-loader-394f7657.js.map +1 -0
- package/lib/{script-loader-ff5cfb68.nomodule.js → script-loader-8efb6055.nomodule.js} +2 -2
- package/lib/script-loader-8efb6055.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-219b62c099a8555a.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-bd19ced2.nomodule.js → stats-helper-13e6116f.nomodule.js} +2 -2
- package/lib/{stats-helper-bd19ced2.nomodule.js.map → stats-helper-13e6116f.nomodule.js.map} +1 -1
- package/lib/{stats-helper-a6263360.js → stats-helper-ab16facc.js} +2 -2
- package/lib/{stats-helper-a6263360.js.map → stats-helper-ab16facc.js.map} +1 -1
- package/lib/{tools-core-4f0c9377.js → tools-core-bef60f9d.js} +2 -2
- package/lib/tools-core-bef60f9d.js.map +1 -0
- package/lib/{tools-core-f609446a.nomodule.js → tools-core-c6126068.nomodule.js} +2 -2
- package/lib/tools-core-c6126068.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/roomle-dependency-injection-aa414f84.legacy.js +0 -16
- 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-244ed68c.js +0 -16
- 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
|
@@ -89,7 +89,7 @@ export default class ConfiguratorUiCallbacks extends UiCallback {
|
|
|
89
89
|
*/
|
|
90
90
|
onConfigurationReady: (partList: KernelPartList, hash: ConfigurationHash, rootComponentLabel: string) => void;
|
|
91
91
|
/**
|
|
92
|
-
* When UI should show the overlay based on the selected tag. Gets triggered when {@link CommonInitData.startTag} is set
|
|
92
|
+
* When UI should show the overlay based on the selected tag. Gets triggered when {@link @roomle/web-sdk/common-core/src/utils/shims#CommonInitData.startTag} is set
|
|
93
93
|
* @param tag
|
|
94
94
|
*/
|
|
95
95
|
onOpenTag: (tag: RapiTagForUi) => void;
|
|
@@ -102,11 +102,11 @@ export default class ConfiguratorUiCallbacks extends UiCallback {
|
|
|
102
102
|
*/
|
|
103
103
|
onClickOutside: () => void;
|
|
104
104
|
/**
|
|
105
|
-
*
|
|
105
|
+
* Is triggered when {@link @roomle/web-sdk/configurator-core/src/roomle-configurator#RoomleConfigurator.previewDockings} has no available dockings
|
|
106
106
|
*/
|
|
107
107
|
onNoDockingsAvailable: () => void;
|
|
108
108
|
/**
|
|
109
|
-
* When the configuration overlaps the UI (defined by {@link CanvasOffset})
|
|
109
|
+
* When the configuration overlaps the UI (defined by {@link @roomle/web-sdk/common-core/src/common-interfaces#CanvasOffset})
|
|
110
110
|
* @param intersections
|
|
111
111
|
*/
|
|
112
112
|
onUiIntersectionChange: (intersections: UIIntersection[]) => void;
|
|
@@ -211,12 +211,12 @@ export default class ConfiguratorUiCallbacks extends UiCallback {
|
|
|
211
211
|
*/
|
|
212
212
|
onConfigurationLoadError: () => void;
|
|
213
213
|
/**
|
|
214
|
-
* When {@link changeTypeChangeTag} as been called and the sync has been started
|
|
214
|
+
* When {@link @roomle/web-sdk/configurator-core/src/roomle-configurator#RoomleConfigurator.changeTypeChangeTag} as been called and the sync has been started
|
|
215
215
|
* @param rapiId
|
|
216
216
|
*/
|
|
217
217
|
onChangeTypeChangeTag: (rapiId: RapiId) => void;
|
|
218
218
|
/**
|
|
219
|
-
* When {@link removeTypeChangeTag} as been called
|
|
219
|
+
* When {@link @roomle/web-sdk/configurator-core/src/roomle-configurator#RoomleConfigurator.removeTypeChangeTag} as been called
|
|
220
220
|
* @param rapiId
|
|
221
221
|
*/
|
|
222
222
|
onRemoveTypeChangeTag: (rapiId: RapiId) => void;
|
|
@@ -57,12 +57,12 @@ export default class RoomleGLBViewer implements GlobalAPI, Context, ExternalEmbe
|
|
|
57
57
|
getCurrentId(): string;
|
|
58
58
|
/**
|
|
59
59
|
* Loads a SceneSettings object, currently it can can contain a light setting definition
|
|
60
|
-
* (see {@link loadDynamicLightSetting}) and an environment definition (see {@link EnvironmentSetting}).
|
|
60
|
+
* (see {@link @roomle/web-sdk/configurator-core/src/roomle-configurator#RoomleConfigurator.loadDynamicLightSetting}) and an environment definition (see {@link @roomle/web-sdk/common-core/src/environment/dynamic-environment-setting-loader#EnvironmentSetting}).
|
|
61
61
|
* @param sceneSettings
|
|
62
62
|
*/
|
|
63
63
|
loadSceneSetting(sceneSettings: SceneSettings): Promise<void>;
|
|
64
64
|
/**
|
|
65
|
-
* Loads a QualitySetting object (see {@link QualitySetting}).
|
|
65
|
+
* Loads a QualitySetting object (see {@link @roomle/web-sdk/common-core/src/dynamic-quality-setting-loader#QualitySetting}).
|
|
66
66
|
* @param qualitySetting
|
|
67
67
|
*/
|
|
68
68
|
loadQualitySetting(qualitySetting: QualitySetting): void;
|
|
@@ -37,12 +37,12 @@ export default class RoomleMaterialViewer implements GlobalAPI, Context, Externa
|
|
|
37
37
|
getMaterialShading(): RapiMaterialShading;
|
|
38
38
|
/**
|
|
39
39
|
* Loads a SceneSettings object, currently it can can contain a light setting definition
|
|
40
|
-
* (see {@link loadDynamicLightSetting}) and an environment definition (see {@link EnvironmentSetting}).
|
|
40
|
+
* (see {@link @roomle/web-sdk/configurator-core/src/roomle-configurator#RoomleConfigurator.loadDynamicLightSetting}) and an environment definition (see {@link @roomle/web-sdk/common-core/src/environment/dynamic-environment-setting-loader#EnvironmentSetting}).
|
|
41
41
|
* @param sceneSettings
|
|
42
42
|
*/
|
|
43
43
|
loadSceneSetting(sceneSettings: SceneSettings): Promise<void>;
|
|
44
44
|
/**
|
|
45
|
-
* Loads a QualitySetting object
|
|
45
|
+
* Loads a QualitySetting object.
|
|
46
46
|
* @param qualitySetting
|
|
47
47
|
*/
|
|
48
48
|
loadQualitySetting(qualitySetting: QualitySetting): void;
|
|
@@ -13,6 +13,7 @@ export interface SelectionPayload {
|
|
|
13
13
|
component?: RapiComponent;
|
|
14
14
|
configurationRuntimeId?: number;
|
|
15
15
|
wall?: WallDimension;
|
|
16
|
+
staticItemRuntimeId?: number;
|
|
16
17
|
}
|
|
17
18
|
export default class RoomlePlannerUiCallback extends UiCallback {
|
|
18
19
|
constructor(creator: string);
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{p as dispose,_ as __decorate,i as inject,O as AsyncGuard,ai as AsyncDependencyLoader}from"./roomle-dependency-injection-244ed68c.js";import"./main-thread-to-worker-e9986fa8.js";const PLANE_MATERIAL="component_dimensioning_plane_material",TEXT_MATERIAL="component_dimensioning_text_material";class TextWithBackground extends THREE.Object3D{constructor(e){super(),this._label="",this._parameters={font:null,size:.1,height:.001,curveSegments:2,bevelEnabled:!0,bevelThickness:.001,bevelSize:.001},this.topDown=!1,this._parameters.font=e,this._position=new THREE.Vector3,this._initMaterials(),this._init(),this._update()}_initMaterials(){this._cacheHolder.materialCache.has(PLANE_MATERIAL)?this._planeMaterial=this._cacheHolder.materialCache.get(PLANE_MATERIAL):(this._planeMaterial=new THREE.MeshBasicMaterial({color:16777215,side:THREE.DoubleSide,opacity:.8,transparent:!0}),this._cacheHolder.materialCache.set(PLANE_MATERIAL,this._planeMaterial)),this._cacheHolder.materialCache.has(TEXT_MATERIAL)?this._textMaterial=this._cacheHolder.materialCache.get(TEXT_MATERIAL):(this._textMaterial=new THREE.MeshPhongMaterial({color:3618615}),this._cacheHolder.materialCache.set(TEXT_MATERIAL,this._textMaterial))}_init(){let e=new THREE.Geometry;this._text=new THREE.Mesh(e,this._textMaterial),this._text.name="text with background text "+this._label,this._plane=new THREE.Mesh(e,this._planeMaterial),this._plane.name="text with background plane "+this._label,this._textGeometry=new THREE.TextGeometry(this._label,this._parameters),this._textGeometry.computeBoundingBox(),this._text.geometry=this._textGeometry,this.add(this._text),this.add(this._plane)}update(e,i,t,s){this._position.copy(e),this._dimensioningType=i,this._cameraPosition=s,this._label=t;const n=this._cameraPosition.distanceTo(this._text.position),h=Math.max(.01,n/100),o=Math.max(5e-4,n/5e3);this._parameters.bevelThickness=o,this._parameters.bevelSize=o,this._parameters.size=h,this._textGeometry=new THREE.TextGeometry(this._label,this._parameters),this._textGeometry.computeBoundingBox(),this._text.geometry=this._textGeometry,this._update()}_update(){if(this.topDown){let e=new THREE.Quaternion;e.setFromAxisAngle(new THREE.Vector3(-1,0,0),Math.PI/2),this._updateText(this._textGeometry,e,new THREE.Vector3)}else if(this._updateText(this._textGeometry,new THREE.Quaternion,new THREE.Vector3),this._cameraPosition){const e=Math.atan2(this._cameraPosition.x-this._position.x,this._cameraPosition.z-this._position.z);this._text.rotation.y=e,this._plane.rotation.y=e}}_updateText(e,i,t){let s=new THREE.Vector3;s.copy(this._position),t.x*=this._getXSign(),s.add(t);let n=e.boundingBox.getSize(new THREE.Vector3);e.center(),this._text.position.copy(s),this._text.quaternion.copy(i);let h=new THREE.PlaneGeometry(n.x+.02,n.y+.02,32);h.center(),this._plane.geometry=h,this._plane.position.copy(s),this._plane.quaternion.copy(i)}_getXSign(){return!this._cameraPosition||this._cameraPosition.x>=0?1:-1}dispose(){dispose(this)}}__decorate([inject],TextWithBackground.prototype,"_cacheHolder",void 0);class DimensioningHelper{constructor(e){this._cameraPosition=new THREE.Vector3,this._textUpdated=!1,this._topDimensions=!1,this._initialized=new AsyncGuard,this._enabled=!1,this._dimensionsVisible=!1,this._creator_=e,this._lineMaterial=new THREE.LineBasicMaterial({color:3618615,linewidth:2});let i=new THREE.Geometry;this._widthLine=new THREE.Line(i,this._lineMaterial),this._widthLine.name="dimension width line",this._heightLine=new THREE.Line(i,this._lineMaterial),this._heightLine.name="dimension height line",this._depthLine=new THREE.Line(i,this._lineMaterial),this._depthLine.name="dimension depth line",this._planeMaterial=new THREE.MeshBasicMaterial({color:16777215,side:THREE.DoubleSide,opacity:.8,transparent:!0}),AsyncDependencyLoader.loadFont("static/rubik_regular_sub-eb3f3b61078695cc.json").then(e=>{this._font=e,this._loaded()})}_loaded(){this.update(!1),this.addToScene(this._scene,this._uiScene),this._initialized.resolve()}_performUpdate(e){this._enabled&&(this._lineBounds||e)&&this._font&&(this._updateHeight(),this._updateWidth(),this._updateDepth())}_updateWidth(){let e=new THREE.Geometry,i=this._getWidthEdge();e.vertices.push(i.start,i.end),this._widthLine.geometry.dispose(),this._widthLine.geometry=e;let t=i.getCenter(new THREE.Vector3);this._widthText||(this._widthText=new TextWithBackground(this._font)),this._widthText.topDown=this._topDimensions;const s=this._unitFormatter.formatMMValueToUnitString(1e3*this._dimensions.x);this._widthText.update(t,0,s,this._cameraPosition)}_updateHeight(){let e=new THREE.Geometry,i=this._getHeightEdge();e.vertices.push(i.start,i.end),this._heightLine.geometry.dispose(),this._heightLine.geometry=e;let t=i.getCenter(new THREE.Vector3);this._heightText||(this._heightText=new TextWithBackground(this._font)),this._heightText.topDown=this._topDimensions;const s=this._unitFormatter.formatMMValueToUnitString(1e3*this._dimensions.y);this._heightText.update(t,1,s,this._cameraPosition)}_updateDepth(){let e=new THREE.Geometry,i=this._getDepthEdge();e.vertices.push(i.start,i.end),this._depthLine.geometry.dispose(),this._depthLine.geometry=e;let t=i.getCenter(new THREE.Vector3);this._depthText||(this._depthText=new TextWithBackground(this._font)),this._depthText.topDown=this._topDimensions;const s=this._unitFormatter.formatMMValueToUnitString(1e3*this._dimensions.z);this._depthText.update(t,2,s,this._cameraPosition)}updateBounds(e){this._dimensions=e.getSize(new THREE.Vector3),this._lineBounds=e.clone();let i=this._lineBounds.min.y<0?this._lineBounds.min.y:0;i-=.01,this._lineBounds.expandByVector(new THREE.Vector3(.05,i,.05)),this._textUpdated=!1,this.update()}update(e=!1){this._enabled&&!this._dimensionsVisible&&(this._dimensionsVisible=!0,this._visibilityChangedCallback()),this._performUpdate(e)}addToScene(e,i){this._widthText&&this._widthLine&&this._heightText&&this._heightLine&&this._heightText&&this._heightLine&&(e.add(this._widthLine),i.add(this._widthText),e.add(this._heightLine),i.add(this._heightText),e.add(this._depthLine),i.add(this._depthText))}removeFromScene(e,i){e.remove(this._widthLine),i.remove(this._widthText),e.remove(this._heightLine),i.remove(this._heightText),e.remove(this._depthLine),i.remove(this._depthText)}_getWidthEdge(){return this._cameraPosition.z>=0?new THREE.Line3(new THREE.Vector3(this._lineBounds.min.x,this._lineBounds.min.y,this._lineBounds.max.z),new THREE.Vector3(this._lineBounds.max.x,this._lineBounds.min.y,this._lineBounds.max.z)):new THREE.Line3(new THREE.Vector3(this._lineBounds.min.x,this._lineBounds.min.y,this._lineBounds.min.z),new THREE.Vector3(this._lineBounds.max.x,this._lineBounds.min.y,this._lineBounds.min.z))}_getDepthEdge(){return this._cameraPosition.x>=0?new THREE.Line3(new THREE.Vector3(this._lineBounds.max.x,this._lineBounds.min.y,this._lineBounds.min.z),new THREE.Vector3(this._lineBounds.max.x,this._lineBounds.min.y,this._lineBounds.max.z)):new THREE.Line3(new THREE.Vector3(this._lineBounds.min.x,this._lineBounds.min.y,this._lineBounds.min.z),new THREE.Vector3(this._lineBounds.min.x,this._lineBounds.min.y,this._lineBounds.max.z))}_getHeightEdge(){return this._cameraPosition.x>=0&&this._cameraPosition.z>=0?new THREE.Line3(new THREE.Vector3(this._lineBounds.max.x,this._lineBounds.min.y,this._lineBounds.max.z),new THREE.Vector3(this._lineBounds.max.x,this._lineBounds.max.y,this._lineBounds.max.z)):this._cameraPosition.x<0&&this._cameraPosition.z>=0?new THREE.Line3(new THREE.Vector3(this._lineBounds.min.x,this._lineBounds.min.y,this._lineBounds.max.z),new THREE.Vector3(this._lineBounds.min.x,this._lineBounds.max.y,this._lineBounds.max.z)):this._cameraPosition.x>=0&&this._cameraPosition.z<0?new THREE.Line3(new THREE.Vector3(this._lineBounds.max.x,this._lineBounds.min.y,this._lineBounds.min.z),new THREE.Vector3(this._lineBounds.max.x,this._lineBounds.max.y,this._lineBounds.min.z)):new THREE.Line3(new THREE.Vector3(this._lineBounds.min.x,this._lineBounds.min.y,this._lineBounds.min.z),new THREE.Vector3(this._lineBounds.min.x,this._lineBounds.max.y,this._lineBounds.min.z))}onDimensionsVisibilityChanged(e){this._onChange=e}enableTopDimensions(){this.enableDimensions(),this._topDimensions=!0,this._heightLine.visible=!1,this._heightText.visible=!1,this.update(!0)}disableTopDimensions(){this._topDimensions=!1,this._heightLine.visible=!0,this._heightText.visible=!0,this.disableDimensions()}enableDimensions(){this._enabled=!0,this.update(!0),this.addToScene(this._scene,this._uiScene)}disableDimensions(){this._enabled=!1,this._dimensionsVisible&&(this._dimensionsVisible=!1,this._visibilityChangedCallback()),this.removeFromScene(this._scene,this._uiScene)}_visibilityChangedCallback(){this._onChange&&this._onChange(this._dimensionsVisible)}_clear(){this._lineMaterial.dispose(),this._planeMaterial.dispose(),this._widthLine.geometry.dispose(),this._heightLine.geometry.dispose(),this._depthLine.geometry.dispose(),this._heightText.dispose(),this._heightText.dispose(),this._depthText.dispose()}getBoundingBox(){const e=new THREE.Box3;return e.expandByObject(this._widthLine),e.expandByObject(this._widthText),e.expandByObject(this._heightLine),e.expandByObject(this._heightText),e.expandByObject(this._depthLine),e.expandByObject(this._depthText),e}setVisibility(e){this._heightLine&&this._widthLine&&this._depthLine&&this._heightText&&this._widthText&&this._depthText&&(this._heightLine.visible=e,this._heightText.visible=e,this._widthLine.visible=e,this._widthText.visible=e,this._depthLine.visible=e,this._depthText.visible=e)}moveCameraStart(e){this.setVisibility(!1),this._cameraPosition=e,this.update()}moveCameraEnd(e){this.setVisibility(!0),this._cameraPosition=e,this.update()}clearScene(e){this._clear()}setScene(e){this._scene=e}setUiScene(e){this._uiScene=e}needsUiScene(){return!0}isInitialized(){return this._initialized.wait()}areDimensionsEnabled(){return this._enabled}}__decorate([inject],DimensioningHelper.prototype,"_unitFormatter",void 0);export default DimensioningHelper;
|
|
2
|
-
//# sourceMappingURL=dimensioning-helper-
|
|
1
|
+
import{p as dispose,_ as __decorate,i as inject,O as AsyncGuard,ai as AsyncDependencyLoader}from"./roomle-dependency-injection-0464676f.js";import"./main-thread-to-worker-88f74244.js";const PLANE_MATERIAL="component_dimensioning_plane_material",TEXT_MATERIAL="component_dimensioning_text_material";class TextWithBackground extends THREE.Object3D{constructor(e){super(),this._label="",this._parameters={font:null,size:.1,height:.001,curveSegments:2,bevelEnabled:!0,bevelThickness:.001,bevelSize:.001},this.topDown=!1,this._parameters.font=e,this._position=new THREE.Vector3,this._initMaterials(),this._init(),this._update()}_initMaterials(){this._cacheHolder.materialCache.has(PLANE_MATERIAL)?this._planeMaterial=this._cacheHolder.materialCache.get(PLANE_MATERIAL):(this._planeMaterial=new THREE.MeshBasicMaterial({color:16777215,side:THREE.DoubleSide,opacity:.8,transparent:!0}),this._cacheHolder.materialCache.set(PLANE_MATERIAL,this._planeMaterial)),this._cacheHolder.materialCache.has(TEXT_MATERIAL)?this._textMaterial=this._cacheHolder.materialCache.get(TEXT_MATERIAL):(this._textMaterial=new THREE.MeshPhongMaterial({color:3618615}),this._cacheHolder.materialCache.set(TEXT_MATERIAL,this._textMaterial))}_init(){let e=new THREE.Geometry;this._text=new THREE.Mesh(e,this._textMaterial),this._text.name="text with background text "+this._label,this._plane=new THREE.Mesh(e,this._planeMaterial),this._plane.name="text with background plane "+this._label,this._textGeometry=new THREE.TextGeometry(this._label,this._parameters),this._textGeometry.computeBoundingBox(),this._text.geometry=this._textGeometry,this.add(this._text),this.add(this._plane)}update(e,i,t,s){this._position.copy(e),this._dimensioningType=i,this._cameraPosition=s,this._label=t;const n=this._cameraPosition.distanceTo(this._text.position),h=Math.max(.01,n/100),o=Math.max(5e-4,n/5e3);this._parameters.bevelThickness=o,this._parameters.bevelSize=o,this._parameters.size=h,this._textGeometry=new THREE.TextGeometry(this._label,this._parameters),this._textGeometry.computeBoundingBox(),this._text.geometry=this._textGeometry,this._update()}_update(){if(this.topDown){let e=new THREE.Quaternion;e.setFromAxisAngle(new THREE.Vector3(-1,0,0),Math.PI/2),this._updateText(this._textGeometry,e,new THREE.Vector3)}else if(this._updateText(this._textGeometry,new THREE.Quaternion,new THREE.Vector3),this._cameraPosition){const e=Math.atan2(this._cameraPosition.x-this._position.x,this._cameraPosition.z-this._position.z);this._text.rotation.y=e,this._plane.rotation.y=e}}_updateText(e,i,t){let s=new THREE.Vector3;s.copy(this._position),t.x*=this._getXSign(),s.add(t);let n=e.boundingBox.getSize(new THREE.Vector3);e.center(),this._text.position.copy(s),this._text.quaternion.copy(i);let h=new THREE.PlaneGeometry(n.x+.02,n.y+.02,32);h.center(),this._plane.geometry=h,this._plane.position.copy(s),this._plane.quaternion.copy(i)}_getXSign(){return!this._cameraPosition||this._cameraPosition.x>=0?1:-1}dispose(){dispose(this)}}__decorate([inject],TextWithBackground.prototype,"_cacheHolder",void 0);class DimensioningHelper{constructor(e){this._cameraPosition=new THREE.Vector3,this._textUpdated=!1,this._topDimensions=!1,this._initialized=new AsyncGuard,this._enabled=!1,this._dimensionsVisible=!1,this._creator_=e,this._lineMaterial=new THREE.LineBasicMaterial({color:3618615,linewidth:2});let i=new THREE.Geometry;this._widthLine=new THREE.Line(i,this._lineMaterial),this._widthLine.name="dimension width line",this._heightLine=new THREE.Line(i,this._lineMaterial),this._heightLine.name="dimension height line",this._depthLine=new THREE.Line(i,this._lineMaterial),this._depthLine.name="dimension depth line",this._planeMaterial=new THREE.MeshBasicMaterial({color:16777215,side:THREE.DoubleSide,opacity:.8,transparent:!0}),AsyncDependencyLoader.loadFont("static/rubik_regular_sub-2dd2d5cca49018c5.json").then(e=>{this._font=e,this._loaded()})}_loaded(){this.update(!1),this.addToScene(this._scene,this._uiScene),this._initialized.resolve()}_performUpdate(e){this._enabled&&(this._lineBounds||e)&&this._font&&(this._updateHeight(),this._updateWidth(),this._updateDepth())}_updateWidth(){let e=new THREE.Geometry,i=this._getWidthEdge();e.vertices.push(i.start,i.end),this._widthLine.geometry.dispose(),this._widthLine.geometry=e;let t=i.getCenter(new THREE.Vector3);this._widthText||(this._widthText=new TextWithBackground(this._font)),this._widthText.topDown=this._topDimensions;const s=this._unitFormatter.formatMMValueToUnitString(1e3*this._dimensions.x);this._widthText.update(t,0,s,this._cameraPosition)}_updateHeight(){let e=new THREE.Geometry,i=this._getHeightEdge();e.vertices.push(i.start,i.end),this._heightLine.geometry.dispose(),this._heightLine.geometry=e;let t=i.getCenter(new THREE.Vector3);this._heightText||(this._heightText=new TextWithBackground(this._font)),this._heightText.topDown=this._topDimensions;const s=this._unitFormatter.formatMMValueToUnitString(1e3*this._dimensions.y);this._heightText.update(t,1,s,this._cameraPosition)}_updateDepth(){let e=new THREE.Geometry,i=this._getDepthEdge();e.vertices.push(i.start,i.end),this._depthLine.geometry.dispose(),this._depthLine.geometry=e;let t=i.getCenter(new THREE.Vector3);this._depthText||(this._depthText=new TextWithBackground(this._font)),this._depthText.topDown=this._topDimensions;const s=this._unitFormatter.formatMMValueToUnitString(1e3*this._dimensions.z);this._depthText.update(t,2,s,this._cameraPosition)}updateBounds(e){this._dimensions=e.getSize(new THREE.Vector3),this._lineBounds=e.clone();let i=this._lineBounds.min.y<0?this._lineBounds.min.y:0;i-=.01,this._lineBounds.expandByVector(new THREE.Vector3(.05,i,.05)),this._textUpdated=!1,this.update()}update(e=!1){this._enabled&&!this._dimensionsVisible&&(this._dimensionsVisible=!0,this._visibilityChangedCallback()),this._performUpdate(e)}addToScene(e,i){this._widthText&&this._widthLine&&this._heightText&&this._heightLine&&this._heightText&&this._heightLine&&(e.add(this._widthLine),i.add(this._widthText),e.add(this._heightLine),i.add(this._heightText),e.add(this._depthLine),i.add(this._depthText))}removeFromScene(e,i){e.remove(this._widthLine),i.remove(this._widthText),e.remove(this._heightLine),i.remove(this._heightText),e.remove(this._depthLine),i.remove(this._depthText)}_getWidthEdge(){return this._cameraPosition.z>=0?new THREE.Line3(new THREE.Vector3(this._lineBounds.min.x,this._lineBounds.min.y,this._lineBounds.max.z),new THREE.Vector3(this._lineBounds.max.x,this._lineBounds.min.y,this._lineBounds.max.z)):new THREE.Line3(new THREE.Vector3(this._lineBounds.min.x,this._lineBounds.min.y,this._lineBounds.min.z),new THREE.Vector3(this._lineBounds.max.x,this._lineBounds.min.y,this._lineBounds.min.z))}_getDepthEdge(){return this._cameraPosition.x>=0?new THREE.Line3(new THREE.Vector3(this._lineBounds.max.x,this._lineBounds.min.y,this._lineBounds.min.z),new THREE.Vector3(this._lineBounds.max.x,this._lineBounds.min.y,this._lineBounds.max.z)):new THREE.Line3(new THREE.Vector3(this._lineBounds.min.x,this._lineBounds.min.y,this._lineBounds.min.z),new THREE.Vector3(this._lineBounds.min.x,this._lineBounds.min.y,this._lineBounds.max.z))}_getHeightEdge(){return this._cameraPosition.x>=0&&this._cameraPosition.z>=0?new THREE.Line3(new THREE.Vector3(this._lineBounds.max.x,this._lineBounds.min.y,this._lineBounds.max.z),new THREE.Vector3(this._lineBounds.max.x,this._lineBounds.max.y,this._lineBounds.max.z)):this._cameraPosition.x<0&&this._cameraPosition.z>=0?new THREE.Line3(new THREE.Vector3(this._lineBounds.min.x,this._lineBounds.min.y,this._lineBounds.max.z),new THREE.Vector3(this._lineBounds.min.x,this._lineBounds.max.y,this._lineBounds.max.z)):this._cameraPosition.x>=0&&this._cameraPosition.z<0?new THREE.Line3(new THREE.Vector3(this._lineBounds.max.x,this._lineBounds.min.y,this._lineBounds.min.z),new THREE.Vector3(this._lineBounds.max.x,this._lineBounds.max.y,this._lineBounds.min.z)):new THREE.Line3(new THREE.Vector3(this._lineBounds.min.x,this._lineBounds.min.y,this._lineBounds.min.z),new THREE.Vector3(this._lineBounds.min.x,this._lineBounds.max.y,this._lineBounds.min.z))}onDimensionsVisibilityChanged(e){this._onChange=e}enableTopDimensions(){this.enableDimensions(),this._topDimensions=!0,this._heightLine.visible=!1,this._heightText.visible=!1,this.update(!0)}disableTopDimensions(){this._topDimensions=!1,this._heightLine.visible=!0,this._heightText.visible=!0,this.disableDimensions()}enableDimensions(){this._enabled=!0,this.update(!0),this.addToScene(this._scene,this._uiScene)}disableDimensions(){this._enabled=!1,this._dimensionsVisible&&(this._dimensionsVisible=!1,this._visibilityChangedCallback()),this.removeFromScene(this._scene,this._uiScene)}_visibilityChangedCallback(){this._onChange&&this._onChange(this._dimensionsVisible)}_clear(){this._lineMaterial.dispose(),this._planeMaterial.dispose(),this._widthLine.geometry.dispose(),this._heightLine.geometry.dispose(),this._depthLine.geometry.dispose(),this._heightText.dispose(),this._heightText.dispose(),this._depthText.dispose()}getBoundingBox(){const e=new THREE.Box3;return e.expandByObject(this._widthLine),e.expandByObject(this._widthText),e.expandByObject(this._heightLine),e.expandByObject(this._heightText),e.expandByObject(this._depthLine),e.expandByObject(this._depthText),e}setVisibility(e){this._heightLine&&this._widthLine&&this._depthLine&&this._heightText&&this._widthText&&this._depthText&&(this._heightLine.visible=e,this._heightText.visible=e,this._widthLine.visible=e,this._widthText.visible=e,this._depthLine.visible=e,this._depthText.visible=e)}moveCameraStart(e){this.setVisibility(!1),this._cameraPosition=e,this.update()}moveCameraEnd(e){this.setVisibility(!0),this._cameraPosition=e,this.update()}clearScene(e){this._clear()}setScene(e){this._scene=e}setUiScene(e){this._uiScene=e}needsUiScene(){return!0}isInitialized(){return this._initialized.wait()}areDimensionsEnabled(){return this._enabled}}__decorate([inject],DimensioningHelper.prototype,"_unitFormatter",void 0);export default DimensioningHelper;
|
|
2
|
+
//# sourceMappingURL=dimensioning-helper-be971abb.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dimensioning-helper-
|
|
1
|
+
{"version":3,"file":"dimensioning-helper-be971abb.js","sources":["../../packages/configurator-core/public/fonts/rubik_regular_sub.json"],"sourcesContent":["export default \"static/rubik_regular_sub-2dd2d5cca49018c5.json\""],"names":[],"mappings":"wuHAAe"}
|
package/lib/{dimensioning-helper-5d68f7b8.nomodule.js → dimensioning-helper-d1ca3c93.nomodule.js}
RENAMED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
System.register(["./roomle-dependency-injection-
|
|
2
|
-
//# sourceMappingURL=dimensioning-helper-
|
|
1
|
+
System.register(["./roomle-dependency-injection-07615f35.nomodule.js","./main-thread-to-worker-6a4eb1ee.nomodule.js"],(function(e){var i,t,s,n,h;return{setters:[function(e){i=e.p,t=e._,s=e.i,n=e.O,h=e.ai},function(){}],execute:function(){const o="component_dimensioning_plane_material",a="component_dimensioning_text_material";class _ extends THREE.Object3D{constructor(e){super(),this._label="",this._parameters={font:null,size:.1,height:.001,curveSegments:2,bevelEnabled:!0,bevelThickness:.001,bevelSize:.001},this.topDown=!1,this._parameters.font=e,this._position=new THREE.Vector3,this._initMaterials(),this._init(),this._update()}_initMaterials(){this._cacheHolder.materialCache.has(o)?this._planeMaterial=this._cacheHolder.materialCache.get(o):(this._planeMaterial=new THREE.MeshBasicMaterial({color:16777215,side:THREE.DoubleSide,opacity:.8,transparent:!0}),this._cacheHolder.materialCache.set(o,this._planeMaterial)),this._cacheHolder.materialCache.has(a)?this._textMaterial=this._cacheHolder.materialCache.get(a):(this._textMaterial=new THREE.MeshPhongMaterial({color:3618615}),this._cacheHolder.materialCache.set(a,this._textMaterial))}_init(){let e=new THREE.Geometry;this._text=new THREE.Mesh(e,this._textMaterial),this._text.name="text with background text "+this._label,this._plane=new THREE.Mesh(e,this._planeMaterial),this._plane.name="text with background plane "+this._label,this._textGeometry=new THREE.TextGeometry(this._label,this._parameters),this._textGeometry.computeBoundingBox(),this._text.geometry=this._textGeometry,this.add(this._text),this.add(this._plane)}update(e,i,t,s){this._position.copy(e),this._dimensioningType=i,this._cameraPosition=s,this._label=t;const n=this._cameraPosition.distanceTo(this._text.position),h=Math.max(.01,n/100),o=Math.max(5e-4,n/5e3);this._parameters.bevelThickness=o,this._parameters.bevelSize=o,this._parameters.size=h,this._textGeometry=new THREE.TextGeometry(this._label,this._parameters),this._textGeometry.computeBoundingBox(),this._text.geometry=this._textGeometry,this._update()}_update(){if(this.topDown){let e=new THREE.Quaternion;e.setFromAxisAngle(new THREE.Vector3(-1,0,0),Math.PI/2),this._updateText(this._textGeometry,e,new THREE.Vector3)}else if(this._updateText(this._textGeometry,new THREE.Quaternion,new THREE.Vector3),this._cameraPosition){const e=Math.atan2(this._cameraPosition.x-this._position.x,this._cameraPosition.z-this._position.z);this._text.rotation.y=e,this._plane.rotation.y=e}}_updateText(e,i,t){let s=new THREE.Vector3;s.copy(this._position),t.x*=this._getXSign(),s.add(t);let n=e.boundingBox.getSize(new THREE.Vector3);e.center(),this._text.position.copy(s),this._text.quaternion.copy(i);let h=new THREE.PlaneGeometry(n.x+.02,n.y+.02,32);h.center(),this._plane.geometry=h,this._plane.position.copy(s),this._plane.quaternion.copy(i)}_getXSign(){return!this._cameraPosition||this._cameraPosition.x>=0?1:-1}dispose(){i(this)}}t([s],_.prototype,"_cacheHolder",void 0);class d{constructor(e){this._cameraPosition=new THREE.Vector3,this._textUpdated=!1,this._topDimensions=!1,this._initialized=new n,this._enabled=!1,this._dimensionsVisible=!1,this._creator_=e,this._lineMaterial=new THREE.LineBasicMaterial({color:3618615,linewidth:2});let i=new THREE.Geometry;this._widthLine=new THREE.Line(i,this._lineMaterial),this._widthLine.name="dimension width line",this._heightLine=new THREE.Line(i,this._lineMaterial),this._heightLine.name="dimension height line",this._depthLine=new THREE.Line(i,this._lineMaterial),this._depthLine.name="dimension depth line",this._planeMaterial=new THREE.MeshBasicMaterial({color:16777215,side:THREE.DoubleSide,opacity:.8,transparent:!0}),h.loadFont("static/rubik_regular_sub-2dd2d5cca49018c5.json").then(e=>{this._font=e,this._loaded()})}_loaded(){this.update(!1),this.addToScene(this._scene,this._uiScene),this._initialized.resolve()}_performUpdate(e){this._enabled&&(this._lineBounds||e)&&this._font&&(this._updateHeight(),this._updateWidth(),this._updateDepth())}_updateWidth(){let e=new THREE.Geometry,i=this._getWidthEdge();e.vertices.push(i.start,i.end),this._widthLine.geometry.dispose(),this._widthLine.geometry=e;let t=i.getCenter(new THREE.Vector3);this._widthText||(this._widthText=new _(this._font)),this._widthText.topDown=this._topDimensions;const s=this._unitFormatter.formatMMValueToUnitString(1e3*this._dimensions.x);this._widthText.update(t,0,s,this._cameraPosition)}_updateHeight(){let e=new THREE.Geometry,i=this._getHeightEdge();e.vertices.push(i.start,i.end),this._heightLine.geometry.dispose(),this._heightLine.geometry=e;let t=i.getCenter(new THREE.Vector3);this._heightText||(this._heightText=new _(this._font)),this._heightText.topDown=this._topDimensions;const s=this._unitFormatter.formatMMValueToUnitString(1e3*this._dimensions.y);this._heightText.update(t,1,s,this._cameraPosition)}_updateDepth(){let e=new THREE.Geometry,i=this._getDepthEdge();e.vertices.push(i.start,i.end),this._depthLine.geometry.dispose(),this._depthLine.geometry=e;let t=i.getCenter(new THREE.Vector3);this._depthText||(this._depthText=new _(this._font)),this._depthText.topDown=this._topDimensions;const s=this._unitFormatter.formatMMValueToUnitString(1e3*this._dimensions.z);this._depthText.update(t,2,s,this._cameraPosition)}updateBounds(e){this._dimensions=e.getSize(new THREE.Vector3),this._lineBounds=e.clone();let i=this._lineBounds.min.y<0?this._lineBounds.min.y:0;i-=.01,this._lineBounds.expandByVector(new THREE.Vector3(.05,i,.05)),this._textUpdated=!1,this.update()}update(e=!1){this._enabled&&!this._dimensionsVisible&&(this._dimensionsVisible=!0,this._visibilityChangedCallback()),this._performUpdate(e)}addToScene(e,i){this._widthText&&this._widthLine&&this._heightText&&this._heightLine&&this._heightText&&this._heightLine&&(e.add(this._widthLine),i.add(this._widthText),e.add(this._heightLine),i.add(this._heightText),e.add(this._depthLine),i.add(this._depthText))}removeFromScene(e,i){e.remove(this._widthLine),i.remove(this._widthText),e.remove(this._heightLine),i.remove(this._heightText),e.remove(this._depthLine),i.remove(this._depthText)}_getWidthEdge(){return this._cameraPosition.z>=0?new THREE.Line3(new THREE.Vector3(this._lineBounds.min.x,this._lineBounds.min.y,this._lineBounds.max.z),new THREE.Vector3(this._lineBounds.max.x,this._lineBounds.min.y,this._lineBounds.max.z)):new THREE.Line3(new THREE.Vector3(this._lineBounds.min.x,this._lineBounds.min.y,this._lineBounds.min.z),new THREE.Vector3(this._lineBounds.max.x,this._lineBounds.min.y,this._lineBounds.min.z))}_getDepthEdge(){return this._cameraPosition.x>=0?new THREE.Line3(new THREE.Vector3(this._lineBounds.max.x,this._lineBounds.min.y,this._lineBounds.min.z),new THREE.Vector3(this._lineBounds.max.x,this._lineBounds.min.y,this._lineBounds.max.z)):new THREE.Line3(new THREE.Vector3(this._lineBounds.min.x,this._lineBounds.min.y,this._lineBounds.min.z),new THREE.Vector3(this._lineBounds.min.x,this._lineBounds.min.y,this._lineBounds.max.z))}_getHeightEdge(){return this._cameraPosition.x>=0&&this._cameraPosition.z>=0?new THREE.Line3(new THREE.Vector3(this._lineBounds.max.x,this._lineBounds.min.y,this._lineBounds.max.z),new THREE.Vector3(this._lineBounds.max.x,this._lineBounds.max.y,this._lineBounds.max.z)):this._cameraPosition.x<0&&this._cameraPosition.z>=0?new THREE.Line3(new THREE.Vector3(this._lineBounds.min.x,this._lineBounds.min.y,this._lineBounds.max.z),new THREE.Vector3(this._lineBounds.min.x,this._lineBounds.max.y,this._lineBounds.max.z)):this._cameraPosition.x>=0&&this._cameraPosition.z<0?new THREE.Line3(new THREE.Vector3(this._lineBounds.max.x,this._lineBounds.min.y,this._lineBounds.min.z),new THREE.Vector3(this._lineBounds.max.x,this._lineBounds.max.y,this._lineBounds.min.z)):new THREE.Line3(new THREE.Vector3(this._lineBounds.min.x,this._lineBounds.min.y,this._lineBounds.min.z),new THREE.Vector3(this._lineBounds.min.x,this._lineBounds.max.y,this._lineBounds.min.z))}onDimensionsVisibilityChanged(e){this._onChange=e}enableTopDimensions(){this.enableDimensions(),this._topDimensions=!0,this._heightLine.visible=!1,this._heightText.visible=!1,this.update(!0)}disableTopDimensions(){this._topDimensions=!1,this._heightLine.visible=!0,this._heightText.visible=!0,this.disableDimensions()}enableDimensions(){this._enabled=!0,this.update(!0),this.addToScene(this._scene,this._uiScene)}disableDimensions(){this._enabled=!1,this._dimensionsVisible&&(this._dimensionsVisible=!1,this._visibilityChangedCallback()),this.removeFromScene(this._scene,this._uiScene)}_visibilityChangedCallback(){this._onChange&&this._onChange(this._dimensionsVisible)}_clear(){this._lineMaterial.dispose(),this._planeMaterial.dispose(),this._widthLine.geometry.dispose(),this._heightLine.geometry.dispose(),this._depthLine.geometry.dispose(),this._heightText.dispose(),this._heightText.dispose(),this._depthText.dispose()}getBoundingBox(){const e=new THREE.Box3;return e.expandByObject(this._widthLine),e.expandByObject(this._widthText),e.expandByObject(this._heightLine),e.expandByObject(this._heightText),e.expandByObject(this._depthLine),e.expandByObject(this._depthText),e}setVisibility(e){this._heightLine&&this._widthLine&&this._depthLine&&this._heightText&&this._widthText&&this._depthText&&(this._heightLine.visible=e,this._heightText.visible=e,this._widthLine.visible=e,this._widthText.visible=e,this._depthLine.visible=e,this._depthText.visible=e)}moveCameraStart(e){this.setVisibility(!1),this._cameraPosition=e,this.update()}moveCameraEnd(e){this.setVisibility(!0),this._cameraPosition=e,this.update()}clearScene(e){this._clear()}setScene(e){this._scene=e}setUiScene(e){this._uiScene=e}needsUiScene(){return!0}isInitialized(){return this._initialized.wait()}areDimensionsEnabled(){return this._enabled}}e("default",d),t([s],d.prototype,"_unitFormatter",void 0)}}}));
|
|
2
|
+
//# sourceMappingURL=dimensioning-helper-d1ca3c93.nomodule.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dimensioning-helper-d1ca3c93.nomodule.js","sources":["../../packages/configurator-core/public/fonts/rubik_regular_sub.json"],"sourcesContent":["export default \"static/rubik_regular_sub-2dd2d5cca49018c5.json\""],"names":[],"mappings":"slHAAe"}
|
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-0464676f.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-5905d47b.js";import{S as ScriptLoader,M as Main}from"./script-loader-394f7657.js";import{D as DefaultLightSetting}from"./default-light-setting-408ac1bd.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-1c3b5760.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"glb-viewer-
|
|
1
|
+
{"version":3,"file":"glb-viewer-1c3b5760.js","sources":["../../node_modules/jszip/dist/jszip.min.js"],"sourcesContent":["export default \"static/jszip.min-dd6c9829408677a1.js\""],"names":[],"mappings":"qySAAe"}
|
|
@@ -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-07615f35.nomodule.js","./main-thread-to-worker-6a4eb1ee.nomodule.js","./pixotron-9fe87cf0.nomodule.js","./script-loader-8efb6055.nomodule.js","./default-light-setting-f72c0eb6.nomodule.js"],(function(e){var t,i,r,n,s,a,o,h,c,l,d,_,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,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,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,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 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),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-21871044.nomodule.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"glb-viewer-
|
|
1
|
+
{"version":3,"file":"glb-viewer-21871044.nomodule.js","sources":["../../node_modules/jszip/dist/jszip.min.js"],"sourcesContent":["export default \"static/jszip.min-dd6c9829408677a1.js\""],"names":[],"mappings":"+6QAAe"}
|
|
@@ -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"}
|