@roomle/web-sdk 2.70.0-alpha.7 → 2.70.0-alpha.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/{TextGeometry-9c63883e.js → TextGeometry-1f9a5413.js} +2 -2
- package/lib/{TextGeometry-9c63883e.js.map → TextGeometry-1f9a5413.js.map} +1 -1
- package/lib/{TextGeometry-22809d6e.nomodule.js → TextGeometry-270a3996.nomodule.js} +2 -2
- package/lib/{TextGeometry-22809d6e.nomodule.js.map → TextGeometry-270a3996.nomodule.js.map} +1 -1
- package/lib/{banana-for-scale-4f38a3b3.js → banana-for-scale-2f220824.js} +2 -2
- package/lib/{banana-for-scale-4f38a3b3.js.map → banana-for-scale-2f220824.js.map} +1 -1
- package/lib/{banana-for-scale-1031ea37.nomodule.js → banana-for-scale-a1b28b55.nomodule.js} +2 -2
- package/lib/{banana-for-scale-1031ea37.nomodule.js.map → banana-for-scale-a1b28b55.nomodule.js.map} +1 -1
- package/lib/{budgeteer-measure-8682bae0.js → budgeteer-measure-41b9cd52.js} +2 -2
- package/lib/{budgeteer-measure-8682bae0.js.map → budgeteer-measure-41b9cd52.js.map} +1 -1
- package/lib/budgeteer-measure.nomodule.js +1 -1
- package/lib/camera-behaviour-152f3965.js +2 -0
- package/lib/camera-behaviour-152f3965.js.map +1 -0
- package/lib/camera-behaviour-510b2914.nomodule.js +2 -0
- package/lib/camera-behaviour-510b2914.nomodule.js.map +1 -0
- package/lib/{component-dimensioning-986a384d.nomodule.js → component-dimensioning-a2a1575f.nomodule.js} +2 -2
- package/lib/component-dimensioning-a2a1575f.nomodule.js.map +1 -0
- package/lib/{component-dimensioning-339798db.js → component-dimensioning-dc970add.js} +2 -2
- package/lib/component-dimensioning-dc970add.js.map +1 -0
- package/lib/component-raycast-helper-98c7ea75.js +2 -0
- package/lib/component-raycast-helper-98c7ea75.js.map +1 -0
- package/lib/component-raycast-helper-db211262.nomodule.js +2 -0
- package/lib/component-raycast-helper-db211262.nomodule.js.map +1 -0
- package/lib/configurator-b9f1a342.nomodule.js +2 -0
- package/lib/configurator-b9f1a342.nomodule.js.map +1 -0
- package/lib/configurator-d18eebaf.js +2 -0
- package/lib/configurator-d18eebaf.js.map +1 -0
- package/lib/configurator-main-c1770888.js +2 -0
- package/lib/configurator-main-c1770888.js.map +1 -0
- package/lib/configurator-main.nomodule.js +1 -1
- package/lib/{continuous-drawing-helper-8a3e0e97.nomodule.js → continuous-drawing-helper-050a88a8.nomodule.js} +2 -2
- package/lib/continuous-drawing-helper-050a88a8.nomodule.js.map +1 -0
- package/lib/{continuous-drawing-helper-afce61ab.js → continuous-drawing-helper-8bc1129a.js} +2 -2
- package/lib/continuous-drawing-helper-8bc1129a.js.map +1 -0
- package/lib/default-light-setting-701866d7.js +2 -0
- package/lib/default-light-setting-701866d7.js.map +1 -0
- package/lib/default-light-setting-998bc8a2.nomodule.js +2 -0
- package/lib/default-light-setting-998bc8a2.nomodule.js.map +1 -0
- package/lib/definitions/common-core/src/cameracontrol/camera-behaviour-state.d.ts +8 -0
- package/lib/definitions/common-core/src/cameracontrol/camera-behaviour.d.ts +14 -0
- package/lib/definitions/common-core/src/cameracontrol/camera-control-3d.d.ts +1 -0
- package/lib/definitions/common-core/src/cameracontrol/camera-control.d.ts +1 -0
- package/lib/definitions/common-core/src/cameracontrol/configurator-camera-behaviour.d.ts +21 -0
- package/lib/definitions/common-core/src/cameracontrol/glb-viewer-camera-behaviour.d.ts +7 -0
- package/lib/definitions/common-core/src/cameracontrol/material-viewer-camera-behaviour.d.ts +5 -0
- package/lib/definitions/common-core/src/cameracontrol/planner-2d-camera-behaviour.d.ts +15 -0
- package/lib/definitions/common-core/src/cameracontrol/planner-3d-camera-behaviour.d.ts +17 -0
- package/lib/definitions/common-core/src/cameracontrol/planner-camera-behaviour.d.ts +14 -0
- package/lib/definitions/common-core/src/cameracontrol/planner-fp-camera-behaviour.d.ts +14 -0
- package/lib/definitions/common-core/src/utils/common-utils.d.ts +6 -0
- package/lib/definitions/common-core/src/webgl/image-renderer.d.ts +1 -0
- package/lib/definitions/common-core/src/webgl/scene-manager.d.ts +10 -7
- package/lib/definitions/configurator-core/src/roomle-configurator.d.ts +0 -1
- package/lib/definitions/configurator-core/src/utils/component-raycast-helper.d.ts +1 -0
- package/lib/definitions/configurator-core/src/webgl/configurator-scene-manager.d.ts +12 -11
- package/lib/definitions/glb-viewer-core/src/webgl/glb-viewer-scene-manager.d.ts +2 -0
- package/lib/definitions/planner-core/src/webgl/planner-scene-manager.d.ts +11 -11
- package/lib/{dimensioning-helper-33920736.js → dimensioning-helper-536acbc5.js} +2 -2
- package/lib/{dimensioning-helper-33920736.js.map → dimensioning-helper-536acbc5.js.map} +1 -1
- package/lib/{dimensioning-helper-1c271ac1.nomodule.js → dimensioning-helper-96c4407e.nomodule.js} +2 -2
- package/lib/{dimensioning-helper-1c271ac1.nomodule.js.map → dimensioning-helper-96c4407e.nomodule.js.map} +1 -1
- package/lib/glb-viewer-01ce04fe.nomodule.js +2 -0
- package/lib/{glb-viewer-e9927fe6.nomodule.js.map → glb-viewer-01ce04fe.nomodule.js.map} +1 -1
- package/lib/glb-viewer-394c707d.js +2 -0
- package/lib/{glb-viewer-8efd5328.js.map → glb-viewer-394c707d.js.map} +1 -1
- package/lib/glb-viewer-camera-behaviour-6493fd42.js +2 -0
- package/lib/glb-viewer-camera-behaviour-6493fd42.js.map +1 -0
- package/lib/glb-viewer-camera-behaviour-fde73c18.nomodule.js +2 -0
- package/lib/glb-viewer-camera-behaviour-fde73c18.nomodule.js.map +1 -0
- package/lib/glb-viewer-main-d031b69b.js +2 -0
- package/lib/glb-viewer-main-d031b69b.js.map +1 -0
- package/lib/glb-viewer-main.nomodule.js +1 -1
- package/lib/legacy/{TextGeometry-98b17031.legacy.js → TextGeometry-c0ae932c.legacy.js} +2 -2
- package/lib/legacy/{TextGeometry-98b17031.legacy.js.map → TextGeometry-c0ae932c.legacy.js.map} +1 -1
- package/lib/legacy/{banana-for-scale-bbc9f6d7.legacy.js → banana-for-scale-42179567.legacy.js} +2 -2
- package/lib/legacy/{banana-for-scale-bbc9f6d7.legacy.js.map → banana-for-scale-42179567.legacy.js.map} +1 -1
- package/lib/legacy/budgeteer-measure.legacy.js +1 -1
- package/lib/legacy/camera-behaviour-12bf66b1.legacy.js +2 -0
- package/lib/legacy/camera-behaviour-12bf66b1.legacy.js.map +1 -0
- package/lib/legacy/{component-dimensioning-64c72cb3.legacy.js → component-dimensioning-500eddfe.legacy.js} +2 -2
- package/lib/legacy/component-dimensioning-500eddfe.legacy.js.map +1 -0
- package/lib/legacy/component-raycast-helper-b58fb547.legacy.js +2 -0
- package/lib/legacy/component-raycast-helper-b58fb547.legacy.js.map +1 -0
- package/lib/legacy/configurator-a319db55.legacy.js +2 -0
- package/lib/legacy/configurator-a319db55.legacy.js.map +1 -0
- package/lib/legacy/configurator-main.legacy.js +1 -1
- package/lib/legacy/{continuous-drawing-helper-65a73633.legacy.js → continuous-drawing-helper-b59b2e3b.legacy.js} +2 -2
- package/lib/legacy/continuous-drawing-helper-b59b2e3b.legacy.js.map +1 -0
- package/lib/legacy/default-light-setting-894d1404.legacy.js +2 -0
- package/lib/legacy/default-light-setting-894d1404.legacy.js.map +1 -0
- package/lib/legacy/{dimensioning-helper-c15b8df2.legacy.js → dimensioning-helper-f6ac8c56.legacy.js} +2 -2
- package/lib/legacy/{dimensioning-helper-c15b8df2.legacy.js.map → dimensioning-helper-f6ac8c56.legacy.js.map} +1 -1
- package/lib/legacy/glb-viewer-446d3bac.legacy.js +2 -0
- package/lib/legacy/{glb-viewer-f053973c.legacy.js.map → glb-viewer-446d3bac.legacy.js.map} +1 -1
- package/lib/legacy/glb-viewer-camera-behaviour-27f99511.legacy.js +2 -0
- package/lib/legacy/glb-viewer-camera-behaviour-27f99511.legacy.js.map +1 -0
- package/lib/legacy/glb-viewer-main.legacy.js +1 -1
- package/lib/legacy/{main-thread-to-worker-fd41ac1a.legacy.js → main-thread-to-worker-b6add17c.legacy.js} +3 -3
- package/lib/legacy/{main-thread-to-worker-fd41ac1a.legacy.js.map → main-thread-to-worker-b6add17c.legacy.js.map} +1 -1
- package/lib/legacy/material-viewer-d003e6d1.legacy.js +2 -0
- package/lib/legacy/material-viewer-d003e6d1.legacy.js.map +1 -0
- package/lib/legacy/material-viewer-main.legacy.js +1 -1
- package/lib/legacy/planner-b8a0e3fc.legacy.js +2 -0
- package/lib/legacy/{planner-6478ac63.legacy.js.map → planner-b8a0e3fc.legacy.js.map} +1 -1
- package/lib/legacy/planner-main.legacy.js +1 -1
- package/lib/legacy/{query-params-helper-8cebf03e.legacy.js → query-params-helper-a1e13324.legacy.js} +2 -2
- package/lib/legacy/query-params-helper-a1e13324.legacy.js.map +1 -0
- package/lib/legacy/roomle-configurator-9aaf9f85.legacy.js +2 -0
- package/lib/legacy/roomle-configurator-9aaf9f85.legacy.js.map +1 -0
- package/lib/legacy/{roomle-dependency-injection-85d9c55c.legacy.js → roomle-dependency-injection-4023fe40.legacy.js} +3 -3
- package/lib/legacy/{roomle-dependency-injection-85d9c55c.legacy.js.map → roomle-dependency-injection-4023fe40.legacy.js.map} +1 -1
- package/lib/legacy/roomle-sdk.legacy.js +1 -1
- package/lib/legacy/{script-loader-e0ac631b.legacy.js → script-loader-f80cbdd3.legacy.js} +2 -2
- package/lib/legacy/script-loader-f80cbdd3.legacy.js.map +1 -0
- package/lib/legacy/{stats-helper-98211cf9.legacy.js → stats-helper-78c9a3b5.legacy.js} +2 -2
- package/lib/legacy/stats-helper-78c9a3b5.legacy.js.map +1 -0
- package/lib/legacy/{tools-core-b14cd303.legacy.js → tools-core-c0680579.legacy.js} +2 -2
- package/lib/legacy/tools-core-c0680579.legacy.js.map +1 -0
- package/lib/{main-thread-to-worker-052750d8.js → main-thread-to-worker-2003c1d9.js} +2 -2
- package/lib/{main-thread-to-worker-052750d8.js.map → main-thread-to-worker-2003c1d9.js.map} +1 -1
- package/lib/{main-thread-to-worker-285afcc7.nomodule.js → main-thread-to-worker-4d246b8d.nomodule.js} +2 -2
- package/lib/{main-thread-to-worker-285afcc7.nomodule.js.map → main-thread-to-worker-4d246b8d.nomodule.js.map} +1 -1
- package/lib/material-viewer-bde3d81b.nomodule.js +2 -0
- package/lib/material-viewer-bde3d81b.nomodule.js.map +1 -0
- package/lib/material-viewer-fc2707dd.js +2 -0
- package/lib/material-viewer-fc2707dd.js.map +1 -0
- package/lib/material-viewer-main-2fe0a62e.js +2 -0
- package/lib/material-viewer-main-2fe0a62e.js.map +1 -0
- package/lib/material-viewer-main.nomodule.js +1 -1
- package/lib/planner-3fcfe328.js +2 -0
- package/lib/{planner-44a3ac8d.js.map → planner-3fcfe328.js.map} +1 -1
- package/lib/planner-9c9e9ebf.nomodule.js +2 -0
- package/lib/{planner-bfc01b4c.nomodule.js.map → planner-9c9e9ebf.nomodule.js.map} +1 -1
- package/lib/planner-dummy-app.js +1 -1
- package/lib/planner-dummy-app.js.map +1 -1
- package/lib/planner-dummy.html +1 -0
- package/lib/planner-main-4bb772b8.js +2 -0
- package/lib/planner-main-4bb772b8.js.map +1 -0
- package/lib/planner-main.nomodule.js +1 -1
- package/lib/{query-params-helper-32a044de.js → query-params-helper-8d88a29e.js} +2 -2
- package/lib/query-params-helper-8d88a29e.js.map +1 -0
- package/lib/{query-params-helper-887400ad.nomodule.js → query-params-helper-bf0b71cd.nomodule.js} +2 -2
- package/lib/query-params-helper-bf0b71cd.nomodule.js.map +1 -0
- package/lib/roomle-configurator-41a3faa0.js +2 -0
- package/lib/roomle-configurator-41a3faa0.js.map +1 -0
- package/lib/roomle-configurator-5517851a.nomodule.js +2 -0
- package/lib/roomle-configurator-5517851a.nomodule.js.map +1 -0
- package/lib/{roomle-dependency-injection-d22f5f7b.js → roomle-dependency-injection-9001109d.js} +3 -3
- package/lib/{roomle-dependency-injection-d22f5f7b.js.map → roomle-dependency-injection-9001109d.js.map} +1 -1
- package/lib/{roomle-dependency-injection-7cca6f7d.nomodule.js → roomle-dependency-injection-9ceffa50.nomodule.js} +3 -3
- package/lib/{roomle-dependency-injection-7cca6f7d.nomodule.js.map → roomle-dependency-injection-9ceffa50.nomodule.js.map} +1 -1
- package/lib/{roomle-sdk-d311d2b6.js → roomle-sdk-d74e16ec.js} +2 -2
- package/lib/roomle-sdk-d74e16ec.js.map +1 -0
- package/lib/roomle-sdk.nomodule.js +1 -1
- package/lib/{script-loader-6bbdf4a1.nomodule.js → script-loader-4c75ff92.nomodule.js} +2 -2
- package/lib/script-loader-4c75ff92.nomodule.js.map +1 -0
- package/lib/{script-loader-6eec4640.js → script-loader-8a74aea8.js} +2 -2
- package/lib/script-loader-8a74aea8.js.map +1 -0
- package/lib/{stats-helper-f0604290.js → stats-helper-3708d4f9.js} +2 -2
- package/lib/stats-helper-3708d4f9.js.map +1 -0
- package/lib/{stats-helper-37488d9f.nomodule.js → stats-helper-89760893.nomodule.js} +2 -2
- package/lib/stats-helper-89760893.nomodule.js.map +1 -0
- package/lib/{tools-core-e6b4d85b.nomodule.js → tools-core-50092b0e.nomodule.js} +2 -2
- package/lib/tools-core-50092b0e.nomodule.js.map +1 -0
- package/lib/{tools-core-08dc84da.js → tools-core-9f14130e.js} +2 -2
- package/lib/tools-core-9f14130e.js.map +1 -0
- package/package.json +2 -2
- package/lib/component-dimensioning-339798db.js.map +0 -1
- package/lib/component-dimensioning-986a384d.nomodule.js.map +0 -1
- package/lib/component-raycast-helper-21fa8594.js +0 -2
- package/lib/component-raycast-helper-21fa8594.js.map +0 -1
- package/lib/component-raycast-helper-eaff5fc1.nomodule.js +0 -2
- package/lib/component-raycast-helper-eaff5fc1.nomodule.js.map +0 -1
- package/lib/configurator-79fa0ff7.js +0 -2
- package/lib/configurator-79fa0ff7.js.map +0 -1
- package/lib/configurator-951eec6f.nomodule.js +0 -2
- package/lib/configurator-951eec6f.nomodule.js.map +0 -1
- package/lib/configurator-main-74732111.js +0 -2
- package/lib/configurator-main-74732111.js.map +0 -1
- package/lib/continuous-drawing-helper-8a3e0e97.nomodule.js.map +0 -1
- package/lib/continuous-drawing-helper-afce61ab.js.map +0 -1
- package/lib/default-light-setting-8cf51c50.js +0 -2
- package/lib/default-light-setting-8cf51c50.js.map +0 -1
- package/lib/default-light-setting-e94e862e.nomodule.js +0 -2
- package/lib/default-light-setting-e94e862e.nomodule.js.map +0 -1
- package/lib/glb-viewer-8efd5328.js +0 -2
- package/lib/glb-viewer-e9927fe6.nomodule.js +0 -2
- package/lib/glb-viewer-main-84d740e9.js +0 -2
- package/lib/glb-viewer-main-84d740e9.js.map +0 -1
- package/lib/legacy/component-dimensioning-64c72cb3.legacy.js.map +0 -1
- package/lib/legacy/component-raycast-helper-7ff762fb.legacy.js +0 -2
- package/lib/legacy/component-raycast-helper-7ff762fb.legacy.js.map +0 -1
- package/lib/legacy/configurator-c0799fdf.legacy.js +0 -2
- package/lib/legacy/configurator-c0799fdf.legacy.js.map +0 -1
- package/lib/legacy/continuous-drawing-helper-65a73633.legacy.js.map +0 -1
- package/lib/legacy/default-light-setting-05b1581d.legacy.js +0 -2
- package/lib/legacy/default-light-setting-05b1581d.legacy.js.map +0 -1
- package/lib/legacy/glb-viewer-f053973c.legacy.js +0 -2
- package/lib/legacy/material-viewer-7a1be594.legacy.js +0 -2
- package/lib/legacy/material-viewer-7a1be594.legacy.js.map +0 -1
- package/lib/legacy/planner-6478ac63.legacy.js +0 -2
- package/lib/legacy/query-params-helper-8cebf03e.legacy.js.map +0 -1
- package/lib/legacy/roomle-configurator-5e6fe9e5.legacy.js +0 -2
- package/lib/legacy/roomle-configurator-5e6fe9e5.legacy.js.map +0 -1
- package/lib/legacy/scene-manager-e3b3fce1.legacy.js +0 -2
- package/lib/legacy/scene-manager-e3b3fce1.legacy.js.map +0 -1
- package/lib/legacy/script-loader-e0ac631b.legacy.js.map +0 -1
- package/lib/legacy/stats-helper-98211cf9.legacy.js.map +0 -1
- package/lib/legacy/tools-core-b14cd303.legacy.js.map +0 -1
- package/lib/material-viewer-16487bf6.nomodule.js +0 -2
- package/lib/material-viewer-16487bf6.nomodule.js.map +0 -1
- package/lib/material-viewer-d2e1ff7a.js +0 -2
- package/lib/material-viewer-d2e1ff7a.js.map +0 -1
- package/lib/material-viewer-main-309890cc.js +0 -2
- package/lib/material-viewer-main-309890cc.js.map +0 -1
- package/lib/planner-44a3ac8d.js +0 -2
- package/lib/planner-bfc01b4c.nomodule.js +0 -2
- package/lib/planner-main-f05908a9.js +0 -2
- package/lib/planner-main-f05908a9.js.map +0 -1
- package/lib/query-params-helper-32a044de.js.map +0 -1
- package/lib/query-params-helper-887400ad.nomodule.js.map +0 -1
- package/lib/roomle-configurator-8b10fc46.nomodule.js +0 -2
- package/lib/roomle-configurator-8b10fc46.nomodule.js.map +0 -1
- package/lib/roomle-configurator-db2763e9.js +0 -2
- package/lib/roomle-configurator-db2763e9.js.map +0 -1
- package/lib/roomle-sdk-d311d2b6.js.map +0 -1
- package/lib/scene-manager-048834f4.nomodule.js +0 -2
- package/lib/scene-manager-048834f4.nomodule.js.map +0 -1
- package/lib/scene-manager-6d3a180f.js +0 -2
- package/lib/scene-manager-6d3a180f.js.map +0 -1
- package/lib/script-loader-6bbdf4a1.nomodule.js.map +0 -1
- package/lib/script-loader-6eec4640.js.map +0 -1
- package/lib/stats-helper-37488d9f.nomodule.js.map +0 -1
- package/lib/stats-helper-f0604290.js.map +0 -1
- package/lib/tools-core-08dc84da.js.map +0 -1
- package/lib/tools-core-e6b4d85b.nomodule.js.map +0 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{b as RoomleDependencyInjection,D as DependencyInjectionAssignment,R as RapiAccess,az as GlobalCallback,aA as GlobalInitData,aB as InitData}from"./roomle-dependency-injection-
|
|
2
|
-
//# sourceMappingURL=roomle-sdk-
|
|
1
|
+
import{b as RoomleDependencyInjection,D as DependencyInjectionAssignment,R as RapiAccess,az as GlobalCallback,aA as GlobalInitData,aB as InitData}from"./roomle-dependency-injection-9001109d.js";import"./main-thread-to-worker-2003c1d9.js";class RoomleSdk{static getConfigurator(e,n){return n=this._setupDI("configurator",e,n),new Promise((e,t)=>import("./configurator-d18eebaf.js").then(({Configurator:t})=>e(new t(n)),t))}static getPlanner(e,n){return n=this._setupDI("planner",e,n),new Promise((e,t)=>import("./planner-3fcfe328.js").then(({Planner:t})=>e(new t(n)),t))}static async getGlbViewer(e,n){return n=this._setupDI("glb-viewer",e,n),new Promise((e,t)=>import("./glb-viewer-394c707d.js").then(({GlbViewer:t})=>e(new t(n)),t))}static getMaterialViewer(e,n){return n=this._setupDI("configurator",e,n),new Promise((e,t)=>import("./material-viewer-fc2707dd.js").then(({MaterialViewer:t})=>e(new t(n)),t))}static getCoreTools(e,n){return n=this._setupDI("tools-core",e,n),new Promise((e,t)=>import("./tools-core-9f14130e.js").then(({ToolsCore:t})=>{const o=new t(n);o.boot(),e(o)},t))}static getRapiAccess(){return RoomleDependencyInjection.addToContainer([new DependencyInjectionAssignment("rapi-access",RapiAccess,0),new DependencyInjectionAssignment("global-callback",GlobalCallback,0)]),Promise.resolve(RoomleDependencyInjection.lookup("rapi-access"))}static get callbacks(){return RoomleDependencyInjection.addToContainer([new DependencyInjectionAssignment("global-callback",GlobalCallback,0)]),Promise.resolve(RoomleDependencyInjection.lookup("global-callback"))}static setGlobalInitData(e){e&&(RoomleDependencyInjection.addToContainer([new DependencyInjectionAssignment("global-init-data",GlobalInitData,0)]),RoomleDependencyInjection.lookup("global-init-data").setOverrides(e))}static getContext(e){return RoomleDependencyInjection.getContext(e)}static _setupDI(e,n,t){return n&&(RoomleDependencyInjection.addToContainer([new DependencyInjectionAssignment("init-data",InitData,1)]),t||(t=RoomleDependencyInjection.getContext(e)),RoomleDependencyInjection.lookup("init-data",t).setOverrides(n)),t}}export{RoomleSdk as default};
|
|
2
|
+
//# sourceMappingURL=roomle-sdk-d74e16ec.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"roomle-sdk-d74e16ec.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
System.register(["./roomle-dependency-injection-
|
|
1
|
+
System.register(["./roomle-dependency-injection-9ceffa50.nomodule.js","./main-thread-to-worker-4d246b8d.nomodule.js"],(function(e,t){var o,n,r,a,i,s;return{setters:[function(e){o=e.b,n=e.D,r=e.R,a=e.az,i=e.aA,s=e.aB},function(){}],execute:function(){e("default",class{static getConfigurator(e,o){return o=this._setupDI("configurator",e,o),new Promise((e,n)=>t.import("./configurator-b9f1a342.nomodule.js").then(({Configurator:t})=>e(new t(o)),n))}static getPlanner(e,o){return o=this._setupDI("planner",e,o),new Promise((e,n)=>t.import("./planner-9c9e9ebf.nomodule.js").then(({Planner:t})=>e(new t(o)),n))}static async getGlbViewer(e,o){return o=this._setupDI("glb-viewer",e,o),new Promise((e,n)=>t.import("./glb-viewer-01ce04fe.nomodule.js").then(({GlbViewer:t})=>e(new t(o)),n))}static getMaterialViewer(e,o){return o=this._setupDI("configurator",e,o),new Promise((e,n)=>t.import("./material-viewer-bde3d81b.nomodule.js").then(({MaterialViewer:t})=>e(new t(o)),n))}static getCoreTools(e,o){return o=this._setupDI("tools-core",e,o),new Promise((e,n)=>t.import("./tools-core-50092b0e.nomodule.js").then(({ToolsCore:t})=>{const n=new t(o);n.boot(),e(n)},n))}static getRapiAccess(){return o.addToContainer([new n("rapi-access",r,0),new n("global-callback",a,0)]),Promise.resolve(o.lookup("rapi-access"))}static get callbacks(){return o.addToContainer([new n("global-callback",a,0)]),Promise.resolve(o.lookup("global-callback"))}static setGlobalInitData(e){e&&(o.addToContainer([new n("global-init-data",i,0)]),o.lookup("global-init-data").setOverrides(e))}static getContext(e){return o.getContext(e)}static _setupDI(e,t,r){return t&&(o.addToContainer([new n("init-data",s,1)]),r||(r=o.getContext(e)),o.lookup("init-data",r).setOverrides(t)),r}})}}}));
|
|
2
2
|
//# sourceMappingURL=roomle-sdk.nomodule.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
System.register(["./query-params-helper-
|
|
2
|
-
//# sourceMappingURL=script-loader-
|
|
1
|
+
System.register(["./query-params-helper-bf0b71cd.nomodule.js","./roomle-dependency-injection-9ceffa50.nomodule.js","./main-thread-to-worker-4d246b8d.nomodule.js"],(function(e){var t,o,n,i,_,s,r;return{setters:[function(e){t=e.g},function(e){o=e.b,n=e.B,i=e.I,_=e._,s=e.i},function(e){r=e.g}],execute:function(){e("M",class{constructor(e){this._context=e||o.getContext(this.getContextName()),n.start("loadingTime")}_setupCommonGlobals(){window.__RML__DEBUG__||(window.__RML__DEBUG__={}),window.__RML__ENV__||(window.__RML__ENV__={},window.__RML__ENV__.assetPath||(window.__RML__ENV__.assetPath=""))}_setupCommonDependencies(){o.setup(i);const e=t();this.lookup("global-init-data").setOverrides(e),this.lookup("init-data",this._context).setOverrides(e)}_cleanUpCommonGlobals(){window.__RML__DEBUG__&&(window.__RML__DEBUG__.Kernel&&window.__RML__DEBUG__.Kernel.clearAll&&window.__RML__DEBUG__.Kernel.clearAll(),delete window.__RML__DEBUG__),delete window.__RML__ENV__;for(const e in window.THREE)if(window.hasOwnProperty(e))try{delete window.THREE[e]}catch(e){console.error(e)}window.THREE=void 0}_cleanUpCommonDependencies(){}boot(e){this._setupCommonGlobals(),this._setupCommonDependencies(),this.setupGlobals(e),this.setupDependencies(),this.bootFinished()}lookup(e,t){return window.__RML__DI__.lookup(e,t)}teardown(){this.cleanUpDependencies(),this._cleanUpCommonDependencies(),this.cleanUpGlobals(),this._cleanUpCommonGlobals(),window.__RML__DI__&&delete window.__RML__DI__}pause(){this.lookup("life-cycle-manager",this._context).pause(),window.TWEEN&&TWEEN.removeAll()}resume(e){e&&this.lookup("dom-helper",this._context).setDomElement(e),this.lookup("life-cycle-manager",this._context).resume()}destroy(){this.pause(),this.lookup("life-cycle-manager",this._context).destroy(),o.cleanUp(this._context)}getRapiAccess(){return this.lookup("rapi-access",this._context)}});let l={},c={};class d{constructor(e){this._creator_=e}fetch(e,t){return this._singlePromiseFactory.create(5,e,(o,i)=>{!function(e,t,o,i){if(-1===e.indexOf("http")&&(e=r()+e),l[e])return o();if(t.id&&c[t.id])return i(new Error('There is already a script with ID "'+t.id+'"'));n.start("load_"+t.id.replace(/-/g,"_"));const _=document.createElement("script");_.async=!1,_.src=e,_.id=t.id,_.onload=()=>{l[e]=!0,c[t.id]=!0,Object.defineProperty(o,"name",{value:"resolve-"+t.id}),o()},_.onerror=e=>{i(e)},document.body.appendChild(_)}(e,t,o,i)})}loadScripts(e){const t=[];return e.forEach(e=>{let o=this.fetch(e.name,{id:e.id});t.push(o)}),Promise.all(t)}cleanUp(){for(let e in c)if(c.hasOwnProperty(e)){const t=document.getElementById(e);t&&t.parentElement.removeChild(t)}l={},c={}}}e("S",d),_([s],d.prototype,"_singlePromiseFactory",void 0)}}}));
|
|
2
|
+
//# sourceMappingURL=script-loader-4c75ff92.nomodule.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"script-loader-4c75ff92.nomodule.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{g as getAllParameters}from"./query-params-helper-
|
|
2
|
-
//# sourceMappingURL=script-loader-
|
|
1
|
+
import{g as getAllParameters}from"./query-params-helper-8d88a29e.js";import{b as RoomleDependencyInjection,B as Benchmark,I as INJECTABLES,_ as __decorate,i as inject}from"./roomle-dependency-injection-9001109d.js";import{g as getAssetPath}from"./main-thread-to-worker-2003c1d9.js";class Main{constructor(e){this._context=e||RoomleDependencyInjection.getContext(this.getContextName()),Benchmark.start("loadingTime")}_setupCommonGlobals(){window.__RML__DEBUG__||(window.__RML__DEBUG__={}),window.__RML__ENV__||(window.__RML__ENV__={},window.__RML__ENV__.assetPath||(window.__RML__ENV__.assetPath=""))}_setupCommonDependencies(){RoomleDependencyInjection.setup(INJECTABLES);const e=getAllParameters();this.lookup("global-init-data").setOverrides(e),this.lookup("init-data",this._context).setOverrides(e)}_cleanUpCommonGlobals(){window.__RML__DEBUG__&&(window.__RML__DEBUG__.Kernel&&window.__RML__DEBUG__.Kernel.clearAll&&window.__RML__DEBUG__.Kernel.clearAll(),delete window.__RML__DEBUG__),delete window.__RML__ENV__;for(const e in window.THREE)if(window.hasOwnProperty(e))try{delete window.THREE[e]}catch(e){console.error(e)}window.THREE=void 0}_cleanUpCommonDependencies(){}boot(e){this._setupCommonGlobals(),this._setupCommonDependencies(),this.setupGlobals(e),this.setupDependencies(),this.bootFinished()}lookup(e,t){return window.__RML__DI__.lookup(e,t)}teardown(){this.cleanUpDependencies(),this._cleanUpCommonDependencies(),this.cleanUpGlobals(),this._cleanUpCommonGlobals(),window.__RML__DI__&&delete window.__RML__DI__}pause(){this.lookup("life-cycle-manager",this._context).pause(),window.TWEEN&&TWEEN.removeAll()}resume(e){e&&this.lookup("dom-helper",this._context).setDomElement(e),this.lookup("life-cycle-manager",this._context).resume()}destroy(){this.pause(),this.lookup("life-cycle-manager",this._context).destroy(),RoomleDependencyInjection.cleanUp(this._context)}getRapiAccess(){return this.lookup("rapi-access",this._context)}}let _scriptCache={},_idCache={};class ScriptLoader{constructor(e){this._creator_=e}fetch(e,t){return this._singlePromiseFactory.create(5,e,(o,n)=>{!function(e,t,o,n){if(-1===e.indexOf("http")&&(e=getAssetPath()+e),_scriptCache[e])return o();if(t.id&&_idCache[t.id])return n(new Error('There is already a script with ID "'+t.id+'"'));Benchmark.start("load_"+t.id.replace(/-/g,"_"));const i=document.createElement("script");i.async=!1,i.src=e,i.id=t.id,i.onload=()=>{_scriptCache[e]=!0,_idCache[t.id]=!0,Object.defineProperty(o,"name",{value:"resolve-"+t.id}),o()},i.onerror=e=>{n(e)},document.body.appendChild(i)}(e,t,o,n)})}loadScripts(e){const t=[];return e.forEach(e=>{let o=this.fetch(e.name,{id:e.id});t.push(o)}),Promise.all(t)}cleanUp(){for(let e in _idCache)if(_idCache.hasOwnProperty(e)){const t=document.getElementById(e);t&&t.parentElement.removeChild(t)}_scriptCache={},_idCache={}}}__decorate([inject],ScriptLoader.prototype,"_singlePromiseFactory",void 0);export{Main as M,ScriptLoader as S};
|
|
2
|
+
//# sourceMappingURL=script-loader-8a74aea8.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"script-loader-8a74aea8.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{_ as __decorate,i as inject}from"./roomle-dependency-injection-
|
|
2
|
-
//# sourceMappingURL=stats-helper-
|
|
1
|
+
import{_ as __decorate,i as inject}from"./roomle-dependency-injection-9001109d.js";import"./main-thread-to-worker-2003c1d9.js";class StatsHelper{constructor(){this._statPanels=[]}_init(){let e=new Stats;e.showPanel(0),e.dom.style.cssText="position:absolute;top:0px;left:0px;z-index:110;",document.body.appendChild(e.dom),this._statPanels.push(e);let t=new Stats;t.showPanel(2),t.dom.style.cssText="position:absolute;top:50px;left:0px;z-index:110;",document.body.appendChild(t.dom),this._statPanels.push(t);let a=new Stats;this._drawPanel=a.addPanel(new Stats.Panel("draw","#0f0","#000")),a.showPanel(3),a.dom.style.cssText="position:absolute;top:100px;left:0px;z-index:110;",document.body.appendChild(a.dom),this._statPanels.push(a);let s=new Stats;this._trianglesPanel=s.addPanel(new Stats.Panel("poly","#0f0","#000")),s.showPanel(3),s.dom.style.cssText="position:absolute;top:150px;left:0px;z-index:110;",document.body.appendChild(s.dom),this._statPanels.push(s);let l=new Stats;this._geometryPanel=l.addPanel(new Stats.Panel("geo","#f00","#000")),l.showPanel(3),l.dom.style.cssText="position:absolute;top:200px;left:0px;z-index:110;",document.body.appendChild(l.dom),this._statPanels.push(l);let n=new Stats;this._texturePanel=n.addPanel(new Stats.Panel("tex","#f00","#000")),n.showPanel(3),n.dom.style.cssText="position:absolute;top:250px;left:0px;z-index:110;",document.body.appendChild(n.dom),this._statPanels.push(n);let o=new Stats;this._materialPanel=o.addPanel(new Stats.Panel("mat","#f00","#000")),o.showPanel(3),o.dom.style.cssText="position:absolute;top:300px;left:0px;z-index:110;",document.body.appendChild(o.dom),this._statPanels.push(o);let d=new Stats;this._qualityPanel=d.addPanel(new Stats.Panel("quality","#fff","#000")),d.showPanel(3),d.dom.style.cssText="position:absolute;top:350px;left:0px;z-index:110;",document.body.appendChild(d.dom),this._statPanels.push(d)}updateRenderInfo(e){this._drawPanel&&e.render.calls>0&&this._drawPanel.update(e.render.calls,500),this._trianglesPanel&&e.render.triangles>0&&this._trianglesPanel.update(e.render.triangles,1e4),this._geometryPanel&&e.memory.geometries>0&&this._geometryPanel.update(e.memory.geometries,1e4),this._texturePanel&&e.memory.textures>0&&this._texturePanel.update(e.memory.textures,1e4),this._materialPanel&&this._cacheHolder.materialCache.size>0&&this._materialPanel.update(this._cacheHolder.materialCache.size,1e3),this._statPanels.length>0&&this._statPanels.forEach(e=>e.update())}updateQualityInfo(e){this._qualityPanel&&e&&this._qualityPanel.update(e.getQuality(),5)}}__decorate([inject],StatsHelper.prototype,"_cacheHolder",void 0);export{StatsHelper as default};
|
|
2
|
+
//# sourceMappingURL=stats-helper-3708d4f9.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stats-helper-3708d4f9.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
System.register(["./roomle-dependency-injection-
|
|
2
|
-
//# sourceMappingURL=stats-helper-
|
|
1
|
+
System.register(["./roomle-dependency-injection-9ceffa50.nomodule.js","./main-thread-to-worker-4d246b8d.nomodule.js"],(function(e){var t,a;return{setters:[function(e){t=e._,a=e.i},function(){}],execute:function(){class s{constructor(){this._statPanels=[]}_init(){let e=new Stats;e.showPanel(0),e.dom.style.cssText="position:absolute;top:0px;left:0px;z-index:110;",document.body.appendChild(e.dom),this._statPanels.push(e);let t=new Stats;t.showPanel(2),t.dom.style.cssText="position:absolute;top:50px;left:0px;z-index:110;",document.body.appendChild(t.dom),this._statPanels.push(t);let a=new Stats;this._drawPanel=a.addPanel(new Stats.Panel("draw","#0f0","#000")),a.showPanel(3),a.dom.style.cssText="position:absolute;top:100px;left:0px;z-index:110;",document.body.appendChild(a.dom),this._statPanels.push(a);let s=new Stats;this._trianglesPanel=s.addPanel(new Stats.Panel("poly","#0f0","#000")),s.showPanel(3),s.dom.style.cssText="position:absolute;top:150px;left:0px;z-index:110;",document.body.appendChild(s.dom),this._statPanels.push(s);let n=new Stats;this._geometryPanel=n.addPanel(new Stats.Panel("geo","#f00","#000")),n.showPanel(3),n.dom.style.cssText="position:absolute;top:200px;left:0px;z-index:110;",document.body.appendChild(n.dom),this._statPanels.push(n);let l=new Stats;this._texturePanel=l.addPanel(new Stats.Panel("tex","#f00","#000")),l.showPanel(3),l.dom.style.cssText="position:absolute;top:250px;left:0px;z-index:110;",document.body.appendChild(l.dom),this._statPanels.push(l);let o=new Stats;this._materialPanel=o.addPanel(new Stats.Panel("mat","#f00","#000")),o.showPanel(3),o.dom.style.cssText="position:absolute;top:300px;left:0px;z-index:110;",document.body.appendChild(o.dom),this._statPanels.push(o);let d=new Stats;this._qualityPanel=d.addPanel(new Stats.Panel("quality","#fff","#000")),d.showPanel(3),d.dom.style.cssText="position:absolute;top:350px;left:0px;z-index:110;",document.body.appendChild(d.dom),this._statPanels.push(d)}updateRenderInfo(e){this._drawPanel&&e.render.calls>0&&this._drawPanel.update(e.render.calls,500),this._trianglesPanel&&e.render.triangles>0&&this._trianglesPanel.update(e.render.triangles,1e4),this._geometryPanel&&e.memory.geometries>0&&this._geometryPanel.update(e.memory.geometries,1e4),this._texturePanel&&e.memory.textures>0&&this._texturePanel.update(e.memory.textures,1e4),this._materialPanel&&this._cacheHolder.materialCache.size>0&&this._materialPanel.update(this._cacheHolder.materialCache.size,1e3),this._statPanels.length>0&&this._statPanels.forEach(e=>e.update())}updateQualityInfo(e){this._qualityPanel&&e&&this._qualityPanel.update(e.getQuality(),5)}}e("default",s),t([a],s.prototype,"_cacheHolder",void 0)}}}));
|
|
2
|
+
//# sourceMappingURL=stats-helper-89760893.nomodule.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stats-helper-89760893.nomodule.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
System.register(["./script-loader-
|
|
2
|
-
//# sourceMappingURL=tools-core-
|
|
1
|
+
System.register(["./script-loader-4c75ff92.nomodule.js","./roomle-dependency-injection-9ceffa50.nomodule.js","./query-params-helper-bf0b71cd.nomodule.js","./main-thread-to-worker-4d246b8d.nomodule.js"],(function(o){var e,t,s,n;return{setters:[function(o){e=o.S,t=o.M},function(o){s=o.D,n=o.b},function(){},function(){}],execute:function(){const l=[new s("script-loader",e)];o("ToolsCore",class extends t{setupGlobals(){}setupDependencies(){n.setup(l),this.lookup("logger",this._context)}cleanUpGlobals(){this._tools=void 0,window.RoomleToolsCore&&delete window.RoomleToolsCore}cleanUpDependencies(){const o=this.lookup("script-loader");o&&o.cleanUp()}bootFinished(){this._tools=this.lookup("roomle-tools-core",this._context),window.RoomleToolsCore||(window.RoomleToolsCore=this._tools)}getApi(){return this._tools}getContextName(){return"tools-core"}})}}}));
|
|
2
|
+
//# sourceMappingURL=tools-core-50092b0e.nomodule.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tools-core-50092b0e.nomodule.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{S as ScriptLoader,M as Main}from"./script-loader-
|
|
2
|
-
//# sourceMappingURL=tools-core-
|
|
1
|
+
import{S as ScriptLoader,M as Main}from"./script-loader-8a74aea8.js";import{D as DependencyInjectionAssignment,b as RoomleDependencyInjection}from"./roomle-dependency-injection-9001109d.js";import"./query-params-helper-8d88a29e.js";import"./main-thread-to-worker-2003c1d9.js";const INJECTABLES=[new DependencyInjectionAssignment("script-loader",ScriptLoader)];class ToolsCore extends Main{setupGlobals(){}setupDependencies(){RoomleDependencyInjection.setup(INJECTABLES),this.lookup("logger",this._context)}cleanUpGlobals(){this._tools=void 0,window.RoomleToolsCore&&delete window.RoomleToolsCore}cleanUpDependencies(){const o=this.lookup("script-loader");o&&o.cleanUp()}bootFinished(){this._tools=this.lookup("roomle-tools-core",this._context),window.RoomleToolsCore||(window.RoomleToolsCore=this._tools)}getApi(){return this._tools}getContextName(){return"tools-core"}}export{ToolsCore};
|
|
2
|
+
//# sourceMappingURL=tools-core-9f14130e.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tools-core-9f14130e.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
package/package.json
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@roomle/web-sdk",
|
|
3
|
-
"version": "2.70.0-alpha.
|
|
3
|
+
"version": "2.70.0-alpha.8",
|
|
4
4
|
"description": "Roomle Web SDK",
|
|
5
5
|
"author": "Roomle Development",
|
|
6
|
-
"main": "lib/roomle-sdk-
|
|
6
|
+
"main": "lib/roomle-sdk-d74e16ec.js",
|
|
7
7
|
"scripts": {
|
|
8
8
|
"release": "semantic-release && cd ../packages/eslint-plugin-roomle && npm i && npm run release && cd ../../dist",
|
|
9
9
|
"postinstall": "node scripts/copy-assets-sdk.js"
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"component-dimensioning-339798db.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"component-dimensioning-986a384d.nomodule.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{bx as Raycaster,bM as throttle,z as Mesh,v as MeshStandardMaterial,ad as Box3,a as Vector3,bN as Frustum,k as Matrix4}from"./main-thread-to-worker-052750d8.js";import{$ as transitionTransparencyOfMaterial}from"./roomle-dependency-injection-d22f5f7b.js";class ComponentRaycastHelper{constructor(){this._nonTransparentComponent=null,this._raycaster=new Raycaster,this._raycaster.near=.1,this._raycaster.layers.enable(3)}init(e,t){this._scene=e,this._camera=t,this.checkComponentVisibility=throttle(this.checkComponentVisibility,100).bind(this),this.checkPreviewVisibility=throttle(this.checkPreviewVisibility,100).bind(this)}changeMaterialsOnSelect(e,t,i=!1){t!==this._nonTransparentComponent&&(this._nonTransparentComponent=t,this._changeMaterialsOnSelect(e,t,i))}_changeMaterialsOnSelect(e,t,i=!1){if(e.children.length>0&&e.children.forEach(a=>{const s=t&&e.id===t.id||i,n=!(a instanceof Mesh);this._changeMaterialsOnSelect(a,t,(!s||!n)&&s)}),t)e instanceof Mesh&&e.material instanceof MeshStandardMaterial&&!e.userData.oldMaterial&&(e.userData.oldMaterial=e.material,e.material=e.material.clone(),i||transitionTransparencyOfMaterial(e,{opacity:.2,transparent:!0}));else if(e.userData.oldMaterial&&e instanceof Mesh&&e.material instanceof MeshStandardMaterial){const{opacity:t,transparent:i}=e.userData.oldMaterial;transitionTransparencyOfMaterial(e,{opacity:t,transparent:i}),e.userData.oldMaterial=void 0}}isComponentVisible(e){const t=[];e.traverse(e=>t.push(e.uuid));const i=(new Box3).setFromObject(e).getCenter(new Vector3),a=(new Vector3).subVectors(i,this._camera.position).normalize();this._raycaster.set(this._camera.position,a),this._raycaster.far=this._camera.position.distanceTo(i);const s=[];return this._raycaster.intersectObjects(this._scene.children,!0).forEach(e=>{e.object.material.visible&&(t.includes(e.object.uuid)||e.object.userData.ignoreComponentRaycast||s.push(e))}),0===s.length}checkComponentAndPreviewVisibility(e,t){e.hasSelection()?this.checkComponentVisibility(e,t):t.hasPreviews()?this.checkPreviewVisibility(t):this.changeMaterialsOnSelect(this._scene,null)}checkComponentVisibility(e,t){if(!e.hasSelection())return;const i=t.getComponentsForIds(e.getSelectedRuntimeComponentIds());if(i.length>1)return;const a=i[0];this.isComponentVisible(a)?this.changeMaterialsOnSelect(this._scene,null):this.changeMaterialsOnSelect(this._scene,a)}areAllPreviewsVisible(e){if(!e.hasPreviews())return!0;const t=e.getPreviews();return 0===t.length||t.map(e=>this.isComponentVisible(e)).reduce((e,t)=>e&&t)}areAllComponentsInFrustum(e){if(0===e.length)return!0;const t=new Frustum,i=(new Matrix4).multiplyMatrices(this._camera.projectionMatrix,this._camera.matrixWorldInverse),a=new Box3;return t.setFromProjectionMatrix(i),e.map(e=>(e=>{const i=a.setFromObject(e).getCenter(new Vector3);return t.containsPoint(i)})(e)).reduce((e,t)=>e&&t)}checkPreviewVisibility(e){e.hasPreviewLines()||(this.areAllPreviewsVisible(e)?this.changeMaterialsOnSelect(this._scene,null):this.changeMaterialsOnSelect(this._scene,{id:-1}))}}export{ComponentRaycastHelper as default};
|
|
2
|
-
//# sourceMappingURL=component-raycast-helper-21fa8594.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"component-raycast-helper-21fa8594.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
System.register(["./main-thread-to-worker-285afcc7.nomodule.js","./roomle-dependency-injection-7cca6f7d.nomodule.js"],(function(e){var t,i,n,s,a,r,c,o,l;return{setters:[function(e){t=e.bx,i=e.bM,n=e.z,s=e.v,a=e.ad,r=e.a,c=e.bN,o=e.k},function(e){l=e.$}],execute:function(){e("default",class{constructor(){this._nonTransparentComponent=null,this._raycaster=new t,this._raycaster.near=.1,this._raycaster.layers.enable(3)}init(e,t){this._scene=e,this._camera=t,this.checkComponentVisibility=i(this.checkComponentVisibility,100).bind(this),this.checkPreviewVisibility=i(this.checkPreviewVisibility,100).bind(this)}changeMaterialsOnSelect(e,t,i=!1){t!==this._nonTransparentComponent&&(this._nonTransparentComponent=t,this._changeMaterialsOnSelect(e,t,i))}_changeMaterialsOnSelect(e,t,i=!1){if(e.children.length>0&&e.children.forEach(s=>{const a=t&&e.id===t.id||i,r=!(s instanceof n);this._changeMaterialsOnSelect(s,t,(!a||!r)&&a)}),t)e instanceof n&&e.material instanceof s&&!e.userData.oldMaterial&&(e.userData.oldMaterial=e.material,e.material=e.material.clone(),i||l(e,{opacity:.2,transparent:!0}));else if(e.userData.oldMaterial&&e instanceof n&&e.material instanceof s){const{opacity:t,transparent:i}=e.userData.oldMaterial;l(e,{opacity:t,transparent:i}),e.userData.oldMaterial=void 0}}isComponentVisible(e){const t=[];e.traverse(e=>t.push(e.uuid));const i=(new a).setFromObject(e).getCenter(new r),n=(new r).subVectors(i,this._camera.position).normalize();this._raycaster.set(this._camera.position,n),this._raycaster.far=this._camera.position.distanceTo(i);const s=[];return this._raycaster.intersectObjects(this._scene.children,!0).forEach(e=>{e.object.material.visible&&(t.includes(e.object.uuid)||e.object.userData.ignoreComponentRaycast||s.push(e))}),0===s.length}checkComponentAndPreviewVisibility(e,t){e.hasSelection()?this.checkComponentVisibility(e,t):t.hasPreviews()?this.checkPreviewVisibility(t):this.changeMaterialsOnSelect(this._scene,null)}checkComponentVisibility(e,t){if(!e.hasSelection())return;const i=t.getComponentsForIds(e.getSelectedRuntimeComponentIds());if(i.length>1)return;const n=i[0];this.isComponentVisible(n)?this.changeMaterialsOnSelect(this._scene,null):this.changeMaterialsOnSelect(this._scene,n)}areAllPreviewsVisible(e){if(!e.hasPreviews())return!0;const t=e.getPreviews();return 0===t.length||t.map(e=>this.isComponentVisible(e)).reduce((e,t)=>e&&t)}areAllComponentsInFrustum(e){if(0===e.length)return!0;const t=new c,i=(new o).multiplyMatrices(this._camera.projectionMatrix,this._camera.matrixWorldInverse),n=new a;return t.setFromProjectionMatrix(i),e.map(e=>(e=>{const i=n.setFromObject(e).getCenter(new r);return t.containsPoint(i)})(e)).reduce((e,t)=>e&&t)}checkPreviewVisibility(e){e.hasPreviewLines()||(this.areAllPreviewsVisible(e)?this.changeMaterialsOnSelect(this._scene,null):this.changeMaterialsOnSelect(this._scene,{id:-1}))}})}}}));
|
|
2
|
-
//# sourceMappingURL=component-raycast-helper-eaff5fc1.nomodule.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"component-raycast-helper-eaff5fc1.nomodule.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{S as ScriptLoader,M as Main}from"./script-loader-6eec4640.js";import{D as DependencyInjectionAssignment,L as Logger,R as RapiAccess,a as DataSyncer,C as ConfiguratorViewModel,b as RoomleDependencyInjection,A as AppContext}from"./roomle-dependency-injection-d22f5f7b.js";import{C as CameraControl3D,a as CameraControl}from"./scene-manager-6d3a180f.js";import ComponentRaycastHelper from"./component-raycast-helper-21fa8594.js";import{C as ConfiguratorSceneManager,R as RoomleConfigurator}from"./roomle-configurator-db2763e9.js";import"./query-params-helper-32a044de.js";import"./main-thread-to-worker-052750d8.js";import"./default-light-setting-8cf51c50.js";const INJECTABLES=[new DependencyInjectionAssignment("logger",Logger),new DependencyInjectionAssignment("rapi-access",RapiAccess),new DependencyInjectionAssignment("script-loader",ScriptLoader),new DependencyInjectionAssignment("camera-control-3d",CameraControl3D),new DependencyInjectionAssignment("camera-control",CameraControl),new DependencyInjectionAssignment("data-syncer",DataSyncer),new DependencyInjectionAssignment("configurator-scene-manager",ConfiguratorSceneManager,1),new DependencyInjectionAssignment("configurator-view-model",ConfiguratorViewModel,1),new DependencyInjectionAssignment("component-raycast-helper",ComponentRaycastHelper,0)];class Configurator extends Main{setupDependencies(){RoomleDependencyInjection.setup(INJECTABLES),this.lookup("planner-kernel-access",this._context).init(1),this.lookup("rapi-access",this._context),this.lookup("script-loader",this._context),this.lookup("logger",this._context)}cleanUpGlobals(){delete window.RoomleConfigurator}cleanUpDependencies(){const e=this.lookup("script-loader"),n=this.lookup("rapi-access");this.lookup("dom-helper");const o=this.lookup("configurator-scene-manager");e&&e.cleanUp(),n&&n.cleanUp(),o&&o.cleanUp()}setupGlobals(e){const{kernelInstance:n,kernelContainer:o,planObjectId:t}=e||{};AppContext.init({kernelInstance:n,kernelContainer:o,planObjectId:t})}getApi(){return this._configurator}bootFinished(){this._configurator=new RoomleConfigurator(this._context),this._configurator.getMain=()=>this,window.RoomleConfigurator||(window.RoomleConfigurator=this._configurator)}getContextName(){return"configurator"}}export{Configurator};
|
|
2
|
-
//# sourceMappingURL=configurator-79fa0ff7.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"configurator-79fa0ff7.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
System.register(["./script-loader-6bbdf4a1.nomodule.js","./roomle-dependency-injection-7cca6f7d.nomodule.js","./scene-manager-048834f4.nomodule.js","./component-raycast-helper-eaff5fc1.nomodule.js","./roomle-configurator-8b10fc46.nomodule.js","./query-params-helper-887400ad.nomodule.js","./main-thread-to-worker-285afcc7.nomodule.js","./default-light-setting-e94e862e.nomodule.js"],(function(e){var n,o,t,r,c,a,i,s,l,u,p,d,f,g;return{setters:[function(e){n=e.S,o=e.M},function(e){t=e.D,r=e.L,c=e.R,a=e.a,i=e.C,s=e.b,l=e.A},function(e){u=e.C,p=e.a},function(e){d=e.default},function(e){f=e.C,g=e.R},function(){},function(){},function(){}],execute:function(){const m=[new t("logger",r),new t("rapi-access",c),new t("script-loader",n),new t("camera-control-3d",u),new t("camera-control",p),new t("data-syncer",a),new t("configurator-scene-manager",f,1),new t("configurator-view-model",i,1),new t("component-raycast-helper",d,0)];e("Configurator",class extends o{setupDependencies(){s.setup(m),this.lookup("planner-kernel-access",this._context).init(1),this.lookup("rapi-access",this._context),this.lookup("script-loader",this._context),this.lookup("logger",this._context)}cleanUpGlobals(){delete window.RoomleConfigurator}cleanUpDependencies(){const e=this.lookup("script-loader"),n=this.lookup("rapi-access");this.lookup("dom-helper");const o=this.lookup("configurator-scene-manager");e&&e.cleanUp(),n&&n.cleanUp(),o&&o.cleanUp()}setupGlobals(e){const{kernelInstance:n,kernelContainer:o,planObjectId:t}=e||{};l.init({kernelInstance:n,kernelContainer:o,planObjectId:t})}getApi(){return this._configurator}bootFinished(){this._configurator=new g(this._context),this._configurator.getMain=()=>this,window.RoomleConfigurator||(window.RoomleConfigurator=this._configurator)}getContextName(){return"configurator"}})}}}));
|
|
2
|
-
//# sourceMappingURL=configurator-951eec6f.nomodule.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"configurator-951eec6f.nomodule.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{Configurator}from"./configurator-79fa0ff7.js";import"./script-loader-6eec4640.js";import"./query-params-helper-32a044de.js";import"./main-thread-to-worker-052750d8.js";import"./roomle-dependency-injection-d22f5f7b.js";import"./scene-manager-6d3a180f.js";import"./component-raycast-helper-21fa8594.js";import"./roomle-configurator-db2763e9.js";import"./default-light-setting-8cf51c50.js";(new Configurator).boot(),window.requestIdleCallback||(window.requestIdleCallback=e=>setTimeout(()=>{let o=Date.now();e({didTimeout:!1,timeRemaining:()=>Math.max(0,50-(Date.now()-o))})},1)),window.cancelIdleCallback||(window.cancelIdleCallback=window.cancelIdleCallback||function(e){clearTimeout(e)});
|
|
2
|
-
//# sourceMappingURL=configurator-main-74732111.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"configurator-main-74732111.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"continuous-drawing-helper-8a3e0e97.nomodule.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"continuous-drawing-helper-afce61ab.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{L as LightSetting}from"./scene-manager-6d3a180f.js";import{Q as getGUI}from"./roomle-dependency-injection-d22f5f7b.js";import{D as DirectionalLight,C as Color,V as Vector2,a as Vector3,A as AmbientLight}from"./main-thread-to-worker-052750d8.js";class DefaultLightSetting extends LightSetting{constructor(i,t){super(i,t),this._params={ambientLight:{color:"#ffffff"},mainDirLight:{position:{x:-3,y:4,z:4},color:"#ffffff"},secondDirLight:{position:{x:3,y:4,z:3},color:"#ffffff"}},this._mainDirectionalLight=new DirectionalLight(new Color(this._params.mainDirLight.color),.8),this._mainDirectionalLight.position.set(this._params.mainDirLight.position.x,this._params.mainDirLight.position.y,this._params.mainDirLight.position.z),this._mainDirectionalLight.layers.set(1),this._mainDirectionalLight.castShadow=!0,this._mainDirectionalLight.shadow.camera.near=.1,this._mainDirectionalLight.shadow.camera.far=100,this._mainDirectionalLight.shadow.mapSize=new Vector2(1024,1024),this._mainDirectionalLight.visible=!0,this._mainDirectionalLight.lookAt(new Vector3(0,0,0)),this._secondDirectionalLight=new DirectionalLight(new Color(this._params.secondDirLight.color),.2),this._secondDirectionalLight.position.set(this._params.secondDirLight.position.x,this._params.secondDirLight.position.y,this._params.secondDirLight.position.z),this._secondDirectionalLight.layers.set(1),this._secondDirectionalLight.castShadow=!1,this._secondDirectionalLight.shadow.camera.near=.1,this._secondDirectionalLight.shadow.camera.far=100,this._secondDirectionalLight.shadow.mapSize=new Vector2(1024,1024),this._secondDirectionalLight.visible=!0,this._secondDirectionalLight.lookAt(new Vector3(0,0,0)),this._ambientLight=new AmbientLight(new Color(this._params.ambientLight.color),.5),this._ambientLight.layers.set(1),this.addToScene()}needsBounds(){return!0}updateBounds(i){const t=i.getSize(new Vector3),a=Math.max(Math.max(t.x,t.y),t.z)+1,o=a/2;this._mainDirectionalLight.shadow.camera.top=o,this._mainDirectionalLight.shadow.camera.bottom=-o,this._mainDirectionalLight.shadow.camera.left=-o,this._mainDirectionalLight.shadow.camera.right=o,this._mainDirectionalLight.shadow.camera.near=.01,this._mainDirectionalLight.shadow.camera.far=4*a,this._mainDirectionalLight.shadow.camera.updateProjectionMatrix(),this._secondDirectionalLight.shadow.camera.top=o,this._secondDirectionalLight.shadow.camera.bottom=-o,this._secondDirectionalLight.shadow.camera.left=-o,this._secondDirectionalLight.shadow.camera.right=o,this._secondDirectionalLight.shadow.camera.near=.01,this._secondDirectionalLight.shadow.camera.far=4*a,this._secondDirectionalLight.shadow.camera.updateProjectionMatrix()}addToScene(){this._scene.add(this._mainDirectionalLight),this._scene.add(this._secondDirectionalLight),this._scene.add(this._ambientLight)}removeFromScene(){this._scene.remove(this._mainDirectionalLight),this._scene.remove(this._secondDirectionalLight),this._scene.remove(this._ambientLight)}reload(){this.removeFromScene(),this.addToScene()}showGUI(){let i=getGUI();if(i){if(this._ambientLight){let t=i.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(i=>this._ambientLight.color=new Color(i))}if(this._mainDirectionalLight){let t=i.addFolder("Main Directional Light");t.add(this._mainDirectionalLight,"visible"),t.add(this._mainDirectionalLight,"intensity").min(0).max(10).step(.1),t.add(this._mainDirectionalLight,"castShadow"),t.addColor(this._params.mainDirLight,"color").onChange(i=>this._mainDirectionalLight.color=new Color(i)),t.add(this._mainDirectionalLight.position,"x").min(-10).max(10).step(.1).onChange(()=>this._mainDirectionalLight.lookAt(new Vector3(0,0,0))),t.add(this._mainDirectionalLight.position,"y").min(-10).max(50).step(.1).onChange(()=>this._mainDirectionalLight.lookAt(new Vector3(0,0,0))),t.add(this._mainDirectionalLight.position,"z").min(-10).max(10).step(.1).onChange(()=>this._mainDirectionalLight.lookAt(new Vector3(0,0,0)))}if(this._secondDirectionalLight){let t=i.addFolder("Second Directional Light");t.add(this._secondDirectionalLight,"visible"),t.add(this._secondDirectionalLight,"intensity").min(0).max(10).step(.1),t.add(this._secondDirectionalLight,"castShadow"),t.addColor(this._params.mainDirLight,"color").onChange(i=>this._mainDirectionalLight.color=new Color(i)),t.add(this._secondDirectionalLight.position,"x").min(-10).max(10).step(.1).onChange(()=>this._mainDirectionalLight.lookAt(new Vector3(0,0,0))),t.add(this._secondDirectionalLight.position,"y").min(-10).max(50).step(.1).onChange(()=>this._mainDirectionalLight.lookAt(new Vector3(0,0,0))),t.add(this._secondDirectionalLight.position,"z").min(-10).max(10).step(.1).onChange(()=>this._mainDirectionalLight.lookAt(new Vector3(0,0,0)))}}}}export{DefaultLightSetting as D};
|
|
2
|
-
//# sourceMappingURL=default-light-setting-8cf51c50.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"default-light-setting-8cf51c50.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
System.register(["./scene-manager-048834f4.nomodule.js","./roomle-dependency-injection-7cca6f7d.nomodule.js","./main-thread-to-worker-285afcc7.nomodule.js"],(function(i){var t,a,e,n,o,s,h;return{setters:[function(i){t=i.L},function(i){a=i.Q},function(i){e=i.D,n=i.C,o=i.V,s=i.a,h=i.A}],execute:function(){i("D",class extends t{constructor(i,t){super(i,t),this._params={ambientLight:{color:"#ffffff"},mainDirLight:{position:{x:-3,y:4,z:4},color:"#ffffff"},secondDirLight:{position:{x:3,y:4,z:3},color:"#ffffff"}},this._mainDirectionalLight=new e(new n(this._params.mainDirLight.color),.8),this._mainDirectionalLight.position.set(this._params.mainDirLight.position.x,this._params.mainDirLight.position.y,this._params.mainDirLight.position.z),this._mainDirectionalLight.layers.set(1),this._mainDirectionalLight.castShadow=!0,this._mainDirectionalLight.shadow.camera.near=.1,this._mainDirectionalLight.shadow.camera.far=100,this._mainDirectionalLight.shadow.mapSize=new o(1024,1024),this._mainDirectionalLight.visible=!0,this._mainDirectionalLight.lookAt(new s(0,0,0)),this._secondDirectionalLight=new e(new n(this._params.secondDirLight.color),.2),this._secondDirectionalLight.position.set(this._params.secondDirLight.position.x,this._params.secondDirLight.position.y,this._params.secondDirLight.position.z),this._secondDirectionalLight.layers.set(1),this._secondDirectionalLight.castShadow=!1,this._secondDirectionalLight.shadow.camera.near=.1,this._secondDirectionalLight.shadow.camera.far=100,this._secondDirectionalLight.shadow.mapSize=new o(1024,1024),this._secondDirectionalLight.visible=!0,this._secondDirectionalLight.lookAt(new s(0,0,0)),this._ambientLight=new h(new n(this._params.ambientLight.color),.5),this._ambientLight.layers.set(1),this.addToScene()}needsBounds(){return!0}updateBounds(i){const t=i.getSize(new s),a=Math.max(Math.max(t.x,t.y),t.z)+1,e=a/2;this._mainDirectionalLight.shadow.camera.top=e,this._mainDirectionalLight.shadow.camera.bottom=-e,this._mainDirectionalLight.shadow.camera.left=-e,this._mainDirectionalLight.shadow.camera.right=e,this._mainDirectionalLight.shadow.camera.near=.01,this._mainDirectionalLight.shadow.camera.far=4*a,this._mainDirectionalLight.shadow.camera.updateProjectionMatrix(),this._secondDirectionalLight.shadow.camera.top=e,this._secondDirectionalLight.shadow.camera.bottom=-e,this._secondDirectionalLight.shadow.camera.left=-e,this._secondDirectionalLight.shadow.camera.right=e,this._secondDirectionalLight.shadow.camera.near=.01,this._secondDirectionalLight.shadow.camera.far=4*a,this._secondDirectionalLight.shadow.camera.updateProjectionMatrix()}addToScene(){this._scene.add(this._mainDirectionalLight),this._scene.add(this._secondDirectionalLight),this._scene.add(this._ambientLight)}removeFromScene(){this._scene.remove(this._mainDirectionalLight),this._scene.remove(this._secondDirectionalLight),this._scene.remove(this._ambientLight)}reload(){this.removeFromScene(),this.addToScene()}showGUI(){let i=a();if(i){if(this._ambientLight){let t=i.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(i=>this._ambientLight.color=new n(i))}if(this._mainDirectionalLight){let t=i.addFolder("Main Directional Light");t.add(this._mainDirectionalLight,"visible"),t.add(this._mainDirectionalLight,"intensity").min(0).max(10).step(.1),t.add(this._mainDirectionalLight,"castShadow"),t.addColor(this._params.mainDirLight,"color").onChange(i=>this._mainDirectionalLight.color=new n(i)),t.add(this._mainDirectionalLight.position,"x").min(-10).max(10).step(.1).onChange(()=>this._mainDirectionalLight.lookAt(new s(0,0,0))),t.add(this._mainDirectionalLight.position,"y").min(-10).max(50).step(.1).onChange(()=>this._mainDirectionalLight.lookAt(new s(0,0,0))),t.add(this._mainDirectionalLight.position,"z").min(-10).max(10).step(.1).onChange(()=>this._mainDirectionalLight.lookAt(new s(0,0,0)))}if(this._secondDirectionalLight){let t=i.addFolder("Second Directional Light");t.add(this._secondDirectionalLight,"visible"),t.add(this._secondDirectionalLight,"intensity").min(0).max(10).step(.1),t.add(this._secondDirectionalLight,"castShadow"),t.addColor(this._params.mainDirLight,"color").onChange(i=>this._mainDirectionalLight.color=new n(i)),t.add(this._secondDirectionalLight.position,"x").min(-10).max(10).step(.1).onChange(()=>this._mainDirectionalLight.lookAt(new s(0,0,0))),t.add(this._secondDirectionalLight.position,"y").min(-10).max(50).step(.1).onChange(()=>this._mainDirectionalLight.lookAt(new s(0,0,0))),t.add(this._secondDirectionalLight.position,"z").min(-10).max(10).step(.1).onChange(()=>this._mainDirectionalLight.lookAt(new s(0,0,0)))}}}})}}}));
|
|
2
|
-
//# sourceMappingURL=default-light-setting-e94e862e.nomodule.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"default-light-setting-e94e862e.nomodule.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{S as ScriptLoader,M as Main}from"./script-loader-6eec4640.js";import{as as InputManager,D as DependencyInjectionAssignment,L as Logger,R as RapiAccess,Q as getGUI,_ as __decorate,i as inject,e as CANVAS_ID,j as DynamicLightSettingLoader,k as PREDEFINED_LIGHTSETTING,n as dispose,b as RoomleDependencyInjection}from"./roomle-dependency-injection-d22f5f7b.js";import{C as CameraControl3D,L as LightSetting,S as SceneManager,T as TWEEN_FILE_NAME}from"./scene-manager-6d3a180f.js";import{a as Vector3,ad as Box3,ag as Euler,Q as Quaternion,A as AmbientLight,C as Color,aE as CAMERA_TYPE,aO as getGlbUrl,bw as WebGLRenderer,i as SRGBColorSpace,bk as BasicShadowMap,N as PerspectiveCamera,bL as download}from"./main-thread-to-worker-052750d8.js";import{D as DefaultLightSetting}from"./default-light-setting-8cf51c50.js";import"./query-params-helper-32a044de.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 Vector3(-e.x/2,0,-e.z/2),a=new Vector3(e.x/2,e.y,e.z/2);this._boundingBox=new Box3(s,a);let o=new Euler(-Math.PI/2+i,r,0,"ZYX"),c=(new 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 AmbientLight(new 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 Color(e)})}}}class GLBViewerSceneManager extends SceneManager{constructor(e,t){super(e,t,CANVAS_ID.GLB,CAMERA_TYPE.CAMERA_3D),this._itemsCount=0,this._standardSceneBackgroundColor=this._scene.background,this._initData.legacyLight&&(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)))}createCameraControl(e,t){this._cameraControl=new AdjustableCameraControl3D(this._creator_,this._getInputManager(),new 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 Vector3(1,1,1),i){return this.clearScene(),new Promise((n,s)=>{this._loadGLB(e,new 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 Box3).setFromObject(this._currentGLB);if(t){let e=r.getCenter(new Vector3);this._cameraControl instanceof AdjustableCameraControl3D&&(this._cameraControl.updateToBounds(r,!1,!0,e),this._cameraControl.reset(r,e,-15,0))}this._updateBounds(r,null,!0),n()},s)})}preparePerspectiveImage(e,t,r){return new Promise(i=>{t||(t=1e3),r||(r=1e3),e||((e=new WebGLRenderer({antialias:!0})).setSize(t,r),e.outputColorSpace=SRGBColorSpace,e.autoClear=!1,e.shadowMap.enabled=!0,e.shadowMap.type=BasicShadowMap);let n=this._cameraControl.getCamera().clone();n instanceof 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 Box3).setFromObject(this._scene).getSize(new 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()}sceneChanged(){}getBounds(){return this._currentGLB?(new Box3).setFromObject(this._currentGLB):null}getGeometryBounds(){return 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 WebGLRenderer({antialias:!0,alpha:!0}),this._width=t,this._height=r,this._renderer.setSize(t,r),this._renderer.setClearColor(16777215,0),this._renderer.outputColorSpace=SRGBColorSpace}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 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){Promise.all([this._scriptLoader.fetch(TWEEN_FILE_NAME,{id:"tween-js"})]).then(()=>{this._sceneManager=new GLBViewerSceneManager(this._creator_,{left:0,top:1,right:1,bottom:0}),this._sceneManager.enableHD(),e()})}clearScene(){this._sceneManager.clearScene()}loadGLB(e,t=1,r){return this._currentIdOrUrl=e,this._rapiAccess.trackView(e),this._sceneManager.loadGLB(e,!0,new 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)}preparePerspectiveImage(){return this._sceneManager.preparePerspectiveImage()}processRenderList(e,t=320,r=320){let i=JSON.parse(e);this._scriptLoader.fetch("static/jszip.min-c96375d50e72b199.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=>{download("content.zip",URL.createObjectURL(t)),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}getStorage(){return this._idbManager}setEnvironmentMap(e){const{url:t,intensity:r,rotation:i,maxLightSources:n}=e;this._sceneManager.setEnvironmentMap(t,r,i,n)}}__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,"_initData",void 0),__decorate([inject],RoomleGLBViewer.prototype,"_globalInitData",void 0),__decorate([inject],RoomleGLBViewer.prototype,"_unitFormatter",void 0),__decorate([inject],RoomleGLBViewer.prototype,"_idbManager",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-8efd5328.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
System.register(["./script-loader-6bbdf4a1.nomodule.js","./roomle-dependency-injection-7cca6f7d.nomodule.js","./scene-manager-048834f4.nomodule.js","./main-thread-to-worker-285afcc7.nomodule.js","./default-light-setting-e94e862e.nomodule.js","./query-params-helper-887400ad.nomodule.js"],(function(e){var t,r,i,n,s,a,o,h,c,l,d,_,m,u,p,g,w,f,b,S,v,C,L,M,y,B,I,x,G,j,E,O;return{setters:[function(e){t=e.S,r=e.M},function(e){i=e.as,n=e.D,s=e.L,a=e.R,o=e.Q,h=e._,c=e.i,l=e.e,d=e.j,_=e.k,m=e.n,u=e.b},function(e){p=e.C,g=e.L,w=e.S,f=e.T},function(e){b=e.a,S=e.ad,v=e.ag,C=e.Q,L=e.A,M=e.C,y=e.aE,B=e.aO,I=e.bw,x=e.i,G=e.bk,j=e.N,E=e.bL},function(e){O=e.D},function(){}],execute:function(){const F=[new n("script-loader",t),new n("glb-input-manager",class extends i{},1),new n("logger",s),new n("rapi-access",a)];class D extends p{constructor(){super(...arguments),this.shouldIgnoreStandardBehavior=!1}adjust(e,t,r,i,n){let s=new b(-e.x/2,0,-e.z/2),a=new b(e.x/2,e.y,e.z/2);this._boundingBox=new S(s,a);let o=new v(-Math.PI/2+i,r,0,"ZYX"),h=(new C).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 P extends g{constructor(e,t){super(e,t),this._params={ambientLight:{color:"#ffffff"}},this._ambientLight=new L(new M(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=o();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 M(e)})}}}class z extends w{constructor(e,t){super(e,t,l.GLB,y.CAMERA_3D),this._itemsCount=0,this._standardSceneBackgroundColor=this._scene.background,this._initData.legacyLight&&(this._renderer.capabilities.maxTextures>8?this.loadDynamicLightSetting(d.createDynamicLightSettingSource(null,_.CAMERA)):(console.warn("this device has a maximum of 8 texture units thus we are using a simpler light setting"),this._lightSetting=new P(this._scene)))}createCameraControl(e,t){this._cameraControl=new D(this._creator_,this._getInputManager(),new b(-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=B(r);return i?this.loadGLB(i,!0,void 0,t):Promise.reject(new Error("GLB Url not detected"))}loadGLB(e,t=!0,r=new b(1,1,1),i){return this.clearScene(),new Promise((n,s)=>{this._loadGLB(e,new b(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 S).setFromObject(this._currentGLB);if(t){let e=r.getCenter(new b);this._cameraControl instanceof D&&(this._cameraControl.updateToBounds(r,!1,!0,e),this._cameraControl.reset(r,e,-15,0))}this._updateBounds(r,null,!0),n()},s)})}preparePerspectiveImage(e,t,r){return new Promise(i=>{t||(t=1e3),r||(r=1e3),e||((e=new I({antialias:!0})).setSize(t,r),e.outputColorSpace=x,e.autoClear=!1,e.shadowMap.enabled=!0,e.shadowMap.type=G);let n=this._cameraControl.getCamera().clone();n instanceof j&&(n.aspect=t/r,n.updateProjectionMatrix()),this._lightSetting.removeFromScene();let s=new O(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 D){let n=(new S).setFromObject(this._scene).getSize(new b);this._cameraControl.adjust(n,e,t,r,i),this._requestRender()}}onStart(e){this._itemsCount=e,this._scene.background=null,this._cameraControl instanceof D&&(this._cameraControl.shouldIgnoreStandardBehavior=!0)}onElementFinished(e){this._itemsCount,Math.round(100/this._itemsCount*e)}onFinished(e){this._scene.background=this._standardSceneBackgroundColor,this._cameraControl instanceof D&&(this._cameraControl.shouldIgnoreStandardBehavior=!1)}clearScene(){this._currentGLB&&(this._scene.remove(this._currentGLB),m(this._currentGLB),this._currentGLB=null),super.clearScene()}enableHD(){super.enableHD()}sceneChanged(){}getBounds(){return this._currentGLB?(new S).setFromObject(this._currentGLB):null}getGeometryBounds(){return null}}h([c],z.prototype,"_glbInputManager",void 0),h([c],z.prototype,"_rapiAccess",void 0);class k{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 I({antialias:!0,alpha:!0}),this._width=t,this._height=r,this._renderer.setSize(t,r),this._renderer.setClearColor(16777215,0),this._renderer.outputColorSpace=x}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 b(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 A{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){Promise.all([this._scriptLoader.fetch(f,{id:"tween-js"})]).then(()=>{this._sceneManager=new z(this._creator_,{left:0,top:1,right:1,bottom:0}),this._sceneManager.enableHD(),e()})}clearScene(){this._sceneManager.clearScene()}loadGLB(e,t=1,r){return this._currentIdOrUrl=e,this._rapiAccess.trackView(e),this._sceneManager.loadGLB(e,!0,new b(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)}preparePerspectiveImage(){return this._sceneManager.preparePerspectiveImage()}processRenderList(e,t=320,r=320){let i=JSON.parse(e);this._scriptLoader.fetch("static/jszip.min-c96375d50e72b199.js",{id:"jszip-js"}).then(()=>{let e=new k(this._sceneManager,t,r);e.addListener(this._sceneManager),e.start(i.items).then(t=>{t.generateAsync({type:"blob"}).then(t=>{E("content.zip",URL.createObjectURL(t)),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}getStorage(){return this._idbManager}setEnvironmentMap(e){const{url:t,intensity:r,rotation:i,maxLightSources:n}=e;this._sceneManager.setEnvironmentMap(t,r,i,n)}}h([c],A.prototype,"_rapiAccess",void 0),h([c],A.prototype,"_domHelper",void 0),h([c],A.prototype,"_scriptLoader",void 0),h([c],A.prototype,"_lifeCycleManager",void 0),h([c],A.prototype,"_initData",void 0),h([c],A.prototype,"_globalInitData",void 0),h([c],A.prototype,"_unitFormatter",void 0),h([c],A.prototype,"_idbManager",void 0),e("GlbViewer",class extends r{setupGlobals(){}setupDependencies(){u.setup(F),this.lookup("logger",this._context)}cleanUpGlobals(){throw new Error("Method not implemented.")}cleanUpDependencies(){throw new Error("Method not implemented.")}bootFinished(){this._viewer=new A(this._context),window.RoomleGLBViewer||(window.RoomleGLBViewer=this._viewer)}getApi(){return this._viewer}getContextName(){return"glb-viewer"}})}}}));
|
|
2
|
-
//# sourceMappingURL=glb-viewer-e9927fe6.nomodule.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{GlbViewer}from"./glb-viewer-8efd5328.js";import"./script-loader-6eec4640.js";import"./query-params-helper-32a044de.js";import"./main-thread-to-worker-052750d8.js";import"./roomle-dependency-injection-d22f5f7b.js";import"./scene-manager-6d3a180f.js";import"./default-light-setting-8cf51c50.js";(new GlbViewer).boot();
|
|
2
|
-
//# sourceMappingURL=glb-viewer-main-84d740e9.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"glb-viewer-main-84d740e9.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"component-dimensioning-64c72cb3.legacy.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
System.register(["./main-thread-to-worker-fd41ac1a.legacy.js","./roomle-dependency-injection-85d9c55c.legacy.js"],(function(e){var t,i,n,s,a,r,c,o,l;return{setters:[function(e){t=e.bH,i=e.bW,n=e.J,s=e.z,a=e.ak,r=e.a,c=e.bX,o=e.o},function(e){l=e.$}],execute:function(){e("default",class{constructor(){this._nonTransparentComponent=null,this._raycaster=new t,this._raycaster.near=.1,this._raycaster.layers.enable(3)}init(e,t){this._scene=e,this._camera=t,this.checkComponentVisibility=i(this.checkComponentVisibility,100).bind(this),this.checkPreviewVisibility=i(this.checkPreviewVisibility,100).bind(this)}changeMaterialsOnSelect(e,t,i=!1){t!==this._nonTransparentComponent&&(this._nonTransparentComponent=t,this._changeMaterialsOnSelect(e,t,i))}_changeMaterialsOnSelect(e,t,i=!1){if(e.children.length>0&&e.children.forEach(s=>{const a=t&&e.id===t.id||i,r=!(s instanceof n);this._changeMaterialsOnSelect(s,t,(!a||!r)&&a)}),t)e instanceof n&&e.material instanceof s&&!e.userData.oldMaterial&&(e.userData.oldMaterial=e.material,e.material=e.material.clone(),i||l(e,{opacity:.2,transparent:!0}));else if(e.userData.oldMaterial&&e instanceof n&&e.material instanceof s){const{opacity:t,transparent:i}=e.userData.oldMaterial;l(e,{opacity:t,transparent:i}),e.userData.oldMaterial=void 0}}isComponentVisible(e){const t=[];e.traverse(e=>t.push(e.uuid));const i=(new a).setFromObject(e).getCenter(new r),n=(new r).subVectors(i,this._camera.position).normalize();this._raycaster.set(this._camera.position,n),this._raycaster.far=this._camera.position.distanceTo(i);const s=[];return this._raycaster.intersectObjects(this._scene.children,!0).forEach(e=>{e.object.material.visible&&(t.includes(e.object.uuid)||e.object.userData.ignoreComponentRaycast||s.push(e))}),0===s.length}checkComponentAndPreviewVisibility(e,t){e.hasSelection()?this.checkComponentVisibility(e,t):t.hasPreviews()?this.checkPreviewVisibility(t):this.changeMaterialsOnSelect(this._scene,null)}checkComponentVisibility(e,t){if(!e.hasSelection())return;const i=t.getComponentsForIds(e.getSelectedRuntimeComponentIds());if(i.length>1)return;const n=i[0];this.isComponentVisible(n)?this.changeMaterialsOnSelect(this._scene,null):this.changeMaterialsOnSelect(this._scene,n)}areAllPreviewsVisible(e){if(!e.hasPreviews())return!0;const t=e.getPreviews();return 0===t.length||t.map(e=>this.isComponentVisible(e)).reduce((e,t)=>e&&t)}areAllComponentsInFrustum(e){if(0===e.length)return!0;const t=new c,i=(new o).multiplyMatrices(this._camera.projectionMatrix,this._camera.matrixWorldInverse),n=new a;return t.setFromProjectionMatrix(i),e.map(e=>(e=>{const i=n.setFromObject(e).getCenter(new r);return t.containsPoint(i)})(e)).reduce((e,t)=>e&&t)}checkPreviewVisibility(e){e.hasPreviewLines()||(this.areAllPreviewsVisible(e)?this.changeMaterialsOnSelect(this._scene,null):this.changeMaterialsOnSelect(this._scene,{id:-1}))}})}}}));
|
|
2
|
-
//# sourceMappingURL=component-raycast-helper-7ff762fb.legacy.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"component-raycast-helper-7ff762fb.legacy.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
System.register(["./script-loader-e0ac631b.legacy.js","./roomle-dependency-injection-85d9c55c.legacy.js","./scene-manager-e3b3fce1.legacy.js","./component-raycast-helper-7ff762fb.legacy.js","./roomle-configurator-5e6fe9e5.legacy.js","./query-params-helper-8cebf03e.legacy.js","./main-thread-to-worker-fd41ac1a.legacy.js","./default-light-setting-05b1581d.legacy.js"],(function(e){var n,t,o,c,r,a,i,s,l,u,p,g,f,d;return{setters:[function(e){n=e.S,t=e.M},function(e){o=e.D,c=e.L,r=e.R,a=e.a,i=e.C,s=e.b,l=e.A},function(e){u=e.C,p=e.a},function(e){g=e.default},function(e){f=e.C,d=e.R},function(){},function(){},function(){}],execute:function(){const h=[new o("logger",c),new o("rapi-access",r),new o("script-loader",n),new o("camera-control-3d",u),new o("camera-control",p),new o("data-syncer",a),new o("configurator-scene-manager",f,1),new o("configurator-view-model",i,1),new o("component-raycast-helper",g,0)];e("Configurator",class extends t{setupDependencies(){s.setup(h),this.lookup("planner-kernel-access",this._context).init(1),this.lookup("rapi-access",this._context),this.lookup("script-loader",this._context),this.lookup("logger",this._context)}cleanUpGlobals(){delete window.RoomleConfigurator}cleanUpDependencies(){const e=this.lookup("script-loader"),n=this.lookup("rapi-access");this.lookup("dom-helper");const t=this.lookup("configurator-scene-manager");e&&e.cleanUp(),n&&n.cleanUp(),t&&t.cleanUp()}setupGlobals(e){const{kernelInstance:n,kernelContainer:t,planObjectId:o}=e||{};l.init({kernelInstance:n,kernelContainer:t,planObjectId:o})}getApi(){return this._configurator}bootFinished(){this._configurator=new d(this._context),this._configurator.getMain=()=>this,window.RoomleConfigurator||(window.RoomleConfigurator=this._configurator)}getContextName(){return"configurator"}})}}}));
|
|
2
|
-
//# sourceMappingURL=configurator-c0799fdf.legacy.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"configurator-c0799fdf.legacy.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"continuous-drawing-helper-65a73633.legacy.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
System.register(["./scene-manager-e3b3fce1.legacy.js","./roomle-dependency-injection-85d9c55c.legacy.js","./main-thread-to-worker-fd41ac1a.legacy.js"],(function(i){var t,a,e,n,o,s,h;return{setters:[function(i){t=i.L},function(i){a=i.Q},function(i){e=i.D,n=i.C,o=i.V,s=i.a,h=i.A}],execute:function(){i("D",class extends t{constructor(i,t){super(i,t),this._params={ambientLight:{color:"#ffffff"},mainDirLight:{position:{x:-3,y:4,z:4},color:"#ffffff"},secondDirLight:{position:{x:3,y:4,z:3},color:"#ffffff"}},this._mainDirectionalLight=new e(new n(this._params.mainDirLight.color),.8),this._mainDirectionalLight.position.set(this._params.mainDirLight.position.x,this._params.mainDirLight.position.y,this._params.mainDirLight.position.z),this._mainDirectionalLight.layers.set(1),this._mainDirectionalLight.castShadow=!0,this._mainDirectionalLight.shadow.camera.near=.1,this._mainDirectionalLight.shadow.camera.far=100,this._mainDirectionalLight.shadow.mapSize=new o(1024,1024),this._mainDirectionalLight.visible=!0,this._mainDirectionalLight.lookAt(new s(0,0,0)),this._secondDirectionalLight=new e(new n(this._params.secondDirLight.color),.2),this._secondDirectionalLight.position.set(this._params.secondDirLight.position.x,this._params.secondDirLight.position.y,this._params.secondDirLight.position.z),this._secondDirectionalLight.layers.set(1),this._secondDirectionalLight.castShadow=!1,this._secondDirectionalLight.shadow.camera.near=.1,this._secondDirectionalLight.shadow.camera.far=100,this._secondDirectionalLight.shadow.mapSize=new o(1024,1024),this._secondDirectionalLight.visible=!0,this._secondDirectionalLight.lookAt(new s(0,0,0)),this._ambientLight=new h(new n(this._params.ambientLight.color),.5),this._ambientLight.layers.set(1),this.addToScene()}needsBounds(){return!0}updateBounds(i){const t=i.getSize(new s),a=Math.max(Math.max(t.x,t.y),t.z)+1,e=a/2;this._mainDirectionalLight.shadow.camera.top=e,this._mainDirectionalLight.shadow.camera.bottom=-e,this._mainDirectionalLight.shadow.camera.left=-e,this._mainDirectionalLight.shadow.camera.right=e,this._mainDirectionalLight.shadow.camera.near=.01,this._mainDirectionalLight.shadow.camera.far=4*a,this._mainDirectionalLight.shadow.camera.updateProjectionMatrix(),this._secondDirectionalLight.shadow.camera.top=e,this._secondDirectionalLight.shadow.camera.bottom=-e,this._secondDirectionalLight.shadow.camera.left=-e,this._secondDirectionalLight.shadow.camera.right=e,this._secondDirectionalLight.shadow.camera.near=.01,this._secondDirectionalLight.shadow.camera.far=4*a,this._secondDirectionalLight.shadow.camera.updateProjectionMatrix()}addToScene(){this._scene.add(this._mainDirectionalLight),this._scene.add(this._secondDirectionalLight),this._scene.add(this._ambientLight)}removeFromScene(){this._scene.remove(this._mainDirectionalLight),this._scene.remove(this._secondDirectionalLight),this._scene.remove(this._ambientLight)}reload(){this.removeFromScene(),this.addToScene()}showGUI(){let i=a();if(i){if(this._ambientLight){let t=i.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(i=>this._ambientLight.color=new n(i))}if(this._mainDirectionalLight){let t=i.addFolder("Main Directional Light");t.add(this._mainDirectionalLight,"visible"),t.add(this._mainDirectionalLight,"intensity").min(0).max(10).step(.1),t.add(this._mainDirectionalLight,"castShadow"),t.addColor(this._params.mainDirLight,"color").onChange(i=>this._mainDirectionalLight.color=new n(i)),t.add(this._mainDirectionalLight.position,"x").min(-10).max(10).step(.1).onChange(()=>this._mainDirectionalLight.lookAt(new s(0,0,0))),t.add(this._mainDirectionalLight.position,"y").min(-10).max(50).step(.1).onChange(()=>this._mainDirectionalLight.lookAt(new s(0,0,0))),t.add(this._mainDirectionalLight.position,"z").min(-10).max(10).step(.1).onChange(()=>this._mainDirectionalLight.lookAt(new s(0,0,0)))}if(this._secondDirectionalLight){let t=i.addFolder("Second Directional Light");t.add(this._secondDirectionalLight,"visible"),t.add(this._secondDirectionalLight,"intensity").min(0).max(10).step(.1),t.add(this._secondDirectionalLight,"castShadow"),t.addColor(this._params.mainDirLight,"color").onChange(i=>this._mainDirectionalLight.color=new n(i)),t.add(this._secondDirectionalLight.position,"x").min(-10).max(10).step(.1).onChange(()=>this._mainDirectionalLight.lookAt(new s(0,0,0))),t.add(this._secondDirectionalLight.position,"y").min(-10).max(50).step(.1).onChange(()=>this._mainDirectionalLight.lookAt(new s(0,0,0))),t.add(this._secondDirectionalLight.position,"z").min(-10).max(10).step(.1).onChange(()=>this._mainDirectionalLight.lookAt(new s(0,0,0)))}}}})}}}));
|
|
2
|
-
//# sourceMappingURL=default-light-setting-05b1581d.legacy.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"default-light-setting-05b1581d.legacy.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
System.register(["./script-loader-e0ac631b.legacy.js","./roomle-dependency-injection-85d9c55c.legacy.js","./scene-manager-e3b3fce1.legacy.js","./main-thread-to-worker-fd41ac1a.legacy.js","./default-light-setting-05b1581d.legacy.js","./query-params-helper-8cebf03e.legacy.js"],(function(e){var t,r,i,n,s,a,o,h,c,l,d,_,m,u,p,g,w,f,b,S,v,C,L,y,M,B,I,x,G,j,E,F;return{setters:[function(e){t=e.S,r=e.M},function(e){i=e.as,n=e.D,s=e.L,a=e.R,o=e.Q,h=e._,c=e.i,l=e.e,d=e.j,_=e.k,m=e.n,u=e.b},function(e){p=e.C,g=e.L,w=e.S,f=e.T},function(e){b=e.a,S=e.ak,v=e.ap,C=e.Q,L=e.A,y=e.C,M=e.aN,B=e.aY,I=e.bG,x=e.l,G=e.bw,j=e.Y,E=e.bV},function(e){F=e.D},function(){}],execute:function(){const O=[new n("script-loader",t),new n("glb-input-manager",class extends i{},1),new n("logger",s),new n("rapi-access",a)];class D extends p{constructor(){super(...arguments),this.shouldIgnoreStandardBehavior=!1}adjust(e,t,r,i,n){let s=new b(-e.x/2,0,-e.z/2),a=new b(e.x/2,e.y,e.z/2);this._boundingBox=new S(s,a);let o=new v(-Math.PI/2+i,r,0,"ZYX"),h=(new C).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 P extends g{constructor(e,t){super(e,t),this._params={ambientLight:{color:"#ffffff"}},this._ambientLight=new L(new y(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=o();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 y(e)})}}}class z extends w{constructor(e,t){super(e,t,l.GLB,M.CAMERA_3D),this._itemsCount=0,this._standardSceneBackgroundColor=this._scene.background,this._initData.legacyLight&&(this._renderer.capabilities.maxTextures>8?this.loadDynamicLightSetting(d.createDynamicLightSettingSource(null,_.CAMERA)):(console.warn("this device has a maximum of 8 texture units thus we are using a simpler light setting"),this._lightSetting=new P(this._scene)))}createCameraControl(e,t){this._cameraControl=new D(this._creator_,this._getInputManager(),new b(-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=B(r);return i?this.loadGLB(i,!0,void 0,t):Promise.reject(new Error("GLB Url not detected"))}loadGLB(e,t=!0,r=new b(1,1,1),i){return this.clearScene(),new Promise((n,s)=>{this._loadGLB(e,new b(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 S).setFromObject(this._currentGLB);if(t){let e=r.getCenter(new b);this._cameraControl instanceof D&&(this._cameraControl.updateToBounds(r,!1,!0,e),this._cameraControl.reset(r,e,-15,0))}this._updateBounds(r,null,!0),n()},s)})}preparePerspectiveImage(e,t,r){return new Promise(i=>{t||(t=1e3),r||(r=1e3),e||((e=new I({antialias:!0})).setSize(t,r),e.outputColorSpace=x,e.autoClear=!1,e.shadowMap.enabled=!0,e.shadowMap.type=G);let n=this._cameraControl.getCamera().clone();n instanceof j&&(n.aspect=t/r,n.updateProjectionMatrix()),this._lightSetting.removeFromScene();let s=new F(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 D){let n=(new S).setFromObject(this._scene).getSize(new b);this._cameraControl.adjust(n,e,t,r,i),this._requestRender()}}onStart(e){this._itemsCount=e,this._scene.background=null,this._cameraControl instanceof D&&(this._cameraControl.shouldIgnoreStandardBehavior=!0)}onElementFinished(e){this._itemsCount,Math.round(100/this._itemsCount*e)}onFinished(e){this._scene.background=this._standardSceneBackgroundColor,this._cameraControl instanceof D&&(this._cameraControl.shouldIgnoreStandardBehavior=!1)}clearScene(){this._currentGLB&&(this._scene.remove(this._currentGLB),m(this._currentGLB),this._currentGLB=null),super.clearScene()}enableHD(){super.enableHD()}sceneChanged(){}getBounds(){return this._currentGLB?(new S).setFromObject(this._currentGLB):null}getGeometryBounds(){return null}}h([c],z.prototype,"_glbInputManager",void 0),h([c],z.prototype,"_rapiAccess",void 0);class k{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 I({antialias:!0,alpha:!0}),this._width=t,this._height=r,this._renderer.setSize(t,r),this._renderer.setClearColor(16777215,0),this._renderer.outputColorSpace=x}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 b(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 A{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){Promise.all([this._scriptLoader.fetch(f,{id:"tween-js"})]).then(()=>{this._sceneManager=new z(this._creator_,{left:0,top:1,right:1,bottom:0}),this._sceneManager.enableHD(),e()})}clearScene(){this._sceneManager.clearScene()}loadGLB(e,t=1,r){return this._currentIdOrUrl=e,this._rapiAccess.trackView(e),this._sceneManager.loadGLB(e,!0,new b(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)}preparePerspectiveImage(){return this._sceneManager.preparePerspectiveImage()}processRenderList(e,t=320,r=320){let i=JSON.parse(e);this._scriptLoader.fetch("static/jszip.min-c96375d50e72b199.js",{id:"jszip-js"}).then(()=>{let e=new k(this._sceneManager,t,r);e.addListener(this._sceneManager),e.start(i.items).then(t=>{t.generateAsync({type:"blob"}).then(t=>{E("content.zip",URL.createObjectURL(t)),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}getStorage(){return this._idbManager}setEnvironmentMap(e){const{url:t,intensity:r,rotation:i,maxLightSources:n}=e;this._sceneManager.setEnvironmentMap(t,r,i,n)}}h([c],A.prototype,"_rapiAccess",void 0),h([c],A.prototype,"_domHelper",void 0),h([c],A.prototype,"_scriptLoader",void 0),h([c],A.prototype,"_lifeCycleManager",void 0),h([c],A.prototype,"_initData",void 0),h([c],A.prototype,"_globalInitData",void 0),h([c],A.prototype,"_unitFormatter",void 0),h([c],A.prototype,"_idbManager",void 0),e("GlbViewer",class extends r{setupGlobals(){}setupDependencies(){u.setup(O),this.lookup("logger",this._context)}cleanUpGlobals(){throw new Error("Method not implemented.")}cleanUpDependencies(){throw new Error("Method not implemented.")}bootFinished(){this._viewer=new A(this._context),window.RoomleGLBViewer||(window.RoomleGLBViewer=this._viewer)}getApi(){return this._viewer}getContextName(){return"glb-viewer"}})}}}));
|
|
2
|
-
//# sourceMappingURL=glb-viewer-f053973c.legacy.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
System.register(["./script-loader-e0ac631b.legacy.js","./roomle-dependency-injection-85d9c55c.legacy.js","./scene-manager-e3b3fce1.legacy.js","./main-thread-to-worker-fd41ac1a.legacy.js","./query-params-helper-8cebf03e.legacy.js"],(function(e){var t,a,i,r,s,n,h,o,l,_,m,c,d,g,p,u,M,y,w,C,f,v,b,S,P,x,F,G,I,U,R,T,A,k,D,j,E;return{setters:[function(e){t=e.S,a=e.M},function(e){i=e._,r=e.i,s=e.e,n=e.j,h=e.k,o=e.M,l=e.au,_=e.av,m=e.Q,c=e.aw,d=e.O,g=e.ax,p=e.D,u=e.L,M=e.as,y=e.ay,w=e.R,C=e.b},function(e){f=e.S,v=e.B,b=e.C,S=e.F,P=e.T},function(e){x=e.aN,F=e.aX,G=e.b2,I=e.J,U=e.C,R=e.ak,T=e.a,A=e.E,k=e.ac,D=e.b9,j=e.bj,E=e.ag},function(){}],execute:function(){class O extends f{constructor(e,t){super(e,t,s.RMV,x.CAMERA_3D),this._sceneParams={type:"cube"},this._materialParams={color:"#ffffff",metallic:.5,alpha:0,alphaCutoff:0,doubleSided:!1},this._renderer.capabilities.maxTextures>8&&this.loadDynamicLightSetting(n.createDynamicLightSettingSource(null,h.CAMERA)),this._initScene()}_initScene(){const e=new F(1,1,1,100,100,100),t=o.createMeshPhysicalMaterial({color:G(this._initData.colors.PRIMARY)});this._setMaterial(t),this._mesh=new I(e,this._material),this._mesh.castShadow=!0,this._mesh.position.setY(.5),this._scene.add(this._mesh);const{initialFloorMaterial:a}=this._initData;if(a?this.changeFloorMaterialById(a):this._environment=new v(this._scene,null,new U(16777215)),this._cameraControl instanceof b){const e=new R;e.setFromObject(this._mesh),this._cameraControl.updateAndReset(e.getSize(new T),e.getCenter(new T))}this.showGUI()}loadMaterialId(e){return new Promise(t=>{this._configuratorMeshGenerator.loadMaterial(e,1e3,1e3).then(e=>{this._setMaterial(e),this._mesh.material=this._material,this._updateGUI(),this._requestRender(),t()})})}loadMaterial(e){return new Promise(t=>{e.__rapi_path__||(e.__rapi_path__="materials"),this._mesh.material=this._material,this._configuratorMeshGenerator.loadTextures(e,this._material,100,100).then(()=>{this._updateGUI(),this._requestRender()}),t()})}loadMaterialShading(e){return new Promise(t=>{let a={shading:e};this._setMaterial(l(this._material,a)),this._mesh.material=this._material,this._updateGUI(),this._requestRender(),t()})}_setMaterial(e){this._material=e,this._materialParams.alpha=e.opacity,this._materialParams.alphaCutoff=e.alphaTest,this._materialParams.color="#"+e.color.getHexString(),this._materialParams.doubleSided=e.side===A,this._materialParams.metallic=1===e.metalness?1:e.reflectivity}getMaterialShading(e=1){return _(this._material,e)}createCameraControl(e,t){this._cameraControl=new b(this._creator_,this._getInputManager(),new T(-1,1,1))}_getInputManager(){return this._inputManager}sceneChanged(){}getBounds(){return this._mesh?(new R).setFromObject(this._mesh):null}getGeometryBounds(){return null}_guiLoaded(){this._updateGUI()}_updateGUI(){let e=m();e&&(this._guiGeometryFolder||(this._guiGeometryFolder=e.addFolder("Geometry"),this._guiGeometryFolder.add(this._sceneParams,"type",{Cube:"cube",Sphere:"sphere",PlaneVertical:"plane_vertical",PlaneHorizontal:"plane_horizontal"}).onChange(e=>{this._setGeometry()})),this._material&&(this._guiMaterialFolder&&e.removeFolder(this._guiMaterialFolder),this._guiMaterialFolder=e.addFolder("Material"),this._guiMaterialFolder.addColor(this._materialParams,"color").onChange(e=>{this._material.color=new U(e),this._shadingChanged()}),this._guiMaterialFolder.add(this._materialParams,"metallic").min(0).max(1).step(.01).onChange(e=>{this._material.metalness=1===e?1:.5,this._material.reflectivity=e||.5,this._shadingChanged()}),this._guiMaterialFolder.add(this._material,"roughness").min(0).max(1).step(.01).onChange(e=>{this._shadingChanged()}),this._guiMaterialFolder.add(this._material,"transmission").min(0).max(1).step(.01).onChange(e=>{this._material.transmission=e,e>0&&(this._material.opacity=1,this._material.alphaTest=.5,this._material.depthWrite=!1,this._material.transparent=!0,this._material.metalness=0),this._mesh.castShadow=!this._material.transparent,this._shadingChanged()}),this._guiMaterialFolder.add(this._materialParams,"alpha").min(0).max(1).step(.01).onChange(e=>{this._material.transparent=e<1,this._material.opacity=e,this._material.depthWrite=e>=1,this._mesh.castShadow=!this._material.transparent,this._shadingChanged()}),this._guiMaterialFolder.add(this._materialParams,"alphaCutoff").min(0).max(1).step(.01).onChange(e=>{this._material.alphaTest=e||0,this._shadingChanged()}),this._guiMaterialFolder.add(this._materialParams,"doubleSided").onChange(e=>{this._material.side=e?A:k,this._shadingChanged()})),this._addGUIListener(e))}_shadingChanged(){this._roomleMaterialViewerUiCallback.onMaterialShadingChanged(_(this._material))}setGeometry(e){this._sceneParams.type=e,this._setGeometry()}_setGeometry(){let e;"cube"===this._sceneParams.type&&(e=new F(1,1,1,100,100,100)),"sphere"===this._sceneParams.type&&(e=new D(.5,100,100)),"plane_horizontal"===this._sceneParams.type&&(e=new j(1,1),e.rotateX(-Math.PI/2)),"plane_vertical"===this._sceneParams.type&&(e=new j(1,1)),this._mesh.geometry=e,this._renderEverything()}async changeFloorMaterialById(e){const t=await this._rapiAccess.getMaterial(e);return this._environment&&this._environment instanceof S||(this._environment=new S(this._scene,this._environment,!0)),new Promise((e,a)=>{this._environment.changeFloorMaterial(t,this._maxAnisotropy).then(()=>{this._requestRender(),e()},a)})}async addTexture(e,t){const a=100/(0===e.mmWidth?1:e.mmWidth),i=100/(0===e.mmHeight?1:e.mmHeight);if(t){const r=new Image;r.src=t;const s=new E;s.image=r,r.onload=function(){s.needsUpdate=!0},c(s,e,this._material,this._maxAnisotropy,a,i,this._renderer.capabilities.maxTextures)}else await d(e.image,e,this._material,this._maxAnisotropy,a,i,this._renderer.capabilities.maxTextures);this._requestRender()}removeTexture(e){"ORM"===e.mapping&&(this._material.aoMap=null,this._material.roughnessMap=null,this._material.metalnessMap=null),"RGB"!==e.mapping&&"RGBA"!==e.mapping||(this._material.map=null),"XYZ"===e.mapping&&(this._material.normalMap=null),this._material.needsUpdate=!0,this._requestRender()}clearCache(){this._configuratorMeshGenerator.clear()}}i([r],O.prototype,"_inputManager",void 0),i([r],O.prototype,"_configuratorMeshGenerator",void 0),i([r],O.prototype,"_roomleMaterialViewerUiCallback",void 0),i([r],O.prototype,"_rapiAccess",void 0);class V{constructor(e){this._creator_=e}setCameraOffset(e){this._sceneManager.setCameraOffset(e)}getCameraOffset(){return this._sceneManager.getCameraOffset()}init(e){return this._domHelper.setDomElement(e),this._sceneManager?(this._lifeCycleManager.resume(),Promise.resolve()):new Promise(this._initPromiseCallback.bind(this))}_initPromiseCallback(e,t){Promise.all([this._scriptLoader.fetch(P,{id:"tween-js"})]).then(()=>{this._sceneManager=new O(this._creator_,{left:0,top:1,right:1,bottom:0}),this._sceneManager.enableHD(),e()})}get callbacks(){return this._roomleMaterialViewerUiCallback}set callbacks(e){this._roomleMaterialViewerUiCallback=e}loadMaterialShading(e){return this._sceneManager.loadMaterialShading(e)}loadMaterial(e,t={}){return t.flushCache&&this._clearCaches(),this._sceneManager.loadMaterial(e)}loadMaterialId(e,t={}){return t.flushCache&&this._clearCaches(),this._sceneManager.loadMaterialId(e)}getMaterialShading(e=1){return this._sceneManager.getMaterialShading(e)}loadSceneSetting(e){return this._sceneManager.loadSceneSettings(e)}setOverrides(e){e&&this._initData.setOverrides(e)}updateSize(){this._sceneManager.updateCamera()}getMain(){}resumeTest(e){this._domHelper.setDomElement(e),this._lifeCycleManager.resume()}pauseTest(){this._lifeCycleManager.pause()}showGUI(){this._sceneManager.showGUI()}async changeFloorMaterialById(e){return this._sceneManager.changeFloorMaterialById(e)}setGeometry(e){this._sceneManager.setGeometry(e)}async addTexture(e,t){return this._sceneManager.addTexture(e,t)}removeTexture(e){return this._sceneManager.removeTexture(e)}_clearCaches(){this._rapiAccess.cleanUp(),this._sceneManager.clearCache()}getScene(){return this._sceneManager.getScene()}updateScene(){this._sceneManager.updateScene()}getUnitFormatter(){return this._unitFormatter}getStorage(){return this._idbManager}setEnvironmentMap(e){const{url:t,intensity:a,rotation:i,maxLightSources:r}=e;this._sceneManager.setEnvironmentMap(t,a,i,r)}}i([r],V.prototype,"_domHelper",void 0),i([r],V.prototype,"_scriptLoader",void 0),i([r],V.prototype,"_lifeCycleManager",void 0),i([r],V.prototype,"_roomleMaterialViewerUiCallback",void 0),i([r],V.prototype,"_initData",void 0),i([r],V.prototype,"_rapiAccess",void 0),i([r],V.prototype,"_unitFormatter",void 0),i([r],V.prototype,"_idbManager",void 0);const B=[new p("script-loader",t),new p("logger",u),new p("input-manager",M,1),new p("configurator-mesh-generator",y),new p("rapi-access",w),new p("roomle-material-viewer-ui-callback",class extends g{constructor(e){super(e),this.onMaterialShadingChanged=e=>{}}},1)];e("MaterialViewer",class extends a{setupGlobals(){}setupDependencies(){C.setup(B),this.lookup("logger",this._context)}cleanUpGlobals(){throw new Error("Method not implemented.")}cleanUpDependencies(){throw new Error("Method not implemented.")}bootFinished(){this._viewer=new V(this._context),window.RoomleMaterialViewer||(window.RoomleMaterialViewer=this._viewer)}getApi(){return this._viewer}getContextName(){return"material-viewer"}})}}}));
|
|
2
|
-
//# sourceMappingURL=material-viewer-7a1be594.legacy.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"material-viewer-7a1be594.legacy.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|