@roomle/web-sdk 2.28.0 → 2.29.0
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/{banana-for-scale-dd4c5739.js → banana-for-scale-656cea8a.js} +2 -2
- package/lib/{banana-for-scale-dd4c5739.js.map → banana-for-scale-656cea8a.js.map} +1 -1
- package/lib/{banana-for-scale-2239eff7.nomodule.js → banana-for-scale-89f70127.nomodule.js} +2 -2
- package/lib/{banana-for-scale-2239eff7.nomodule.js.map → banana-for-scale-89f70127.nomodule.js.map} +1 -1
- package/lib/{budgeteer-measure-05dc445d.js → budgeteer-measure-8cfea554.js} +2 -2
- package/lib/{budgeteer-measure-05dc445d.js.map → budgeteer-measure-8cfea554.js.map} +1 -1
- package/lib/budgeteer-measure.nomodule.js +1 -1
- package/lib/{component-dimensioning-07857a7e.js → component-dimensioning-1b5f64dd.js} +2 -2
- package/lib/component-dimensioning-1b5f64dd.js.map +1 -0
- package/lib/{component-dimensioning-e121b044.nomodule.js → component-dimensioning-7bdd1b3b.nomodule.js} +2 -2
- package/lib/component-dimensioning-7bdd1b3b.nomodule.js.map +1 -0
- package/lib/configurator-6e7f5ef0.js +2 -0
- package/lib/{configurator-366b9a69.js.map → configurator-6e7f5ef0.js.map} +1 -1
- package/lib/configurator-eddf59f1.nomodule.js +2 -0
- package/lib/{configurator-b498456a.nomodule.js.map → configurator-eddf59f1.nomodule.js.map} +1 -1
- package/lib/configurator-main-7acfa92f.js +2 -0
- package/lib/configurator-main-7acfa92f.js.map +1 -0
- package/lib/configurator-main.nomodule.js +1 -1
- package/lib/configurator-mesh-generator-05375458.nomodule.js +2 -0
- package/lib/configurator-mesh-generator-05375458.nomodule.js.map +1 -0
- package/lib/{configurator-mesh-generator-e827c528.js → configurator-mesh-generator-f210ee04.js} +2 -2
- package/lib/configurator-mesh-generator-f210ee04.js.map +1 -0
- package/lib/{default-light-setting-7eb7961c.js → default-light-setting-7de63c9a.js} +2 -2
- package/lib/default-light-setting-7de63c9a.js.map +1 -0
- package/lib/{default-light-setting-f21a820b.nomodule.js → default-light-setting-e4720308.nomodule.js} +2 -2
- package/lib/default-light-setting-e4720308.nomodule.js.map +1 -0
- package/lib/definitions/common-core/src/services/global-callback.d.ts +1 -0
- package/lib/definitions/configurator-core/src/roomle-configurator.d.ts +7 -1
- package/lib/definitions/configurator-core/src/webgl/scene-helper.d.ts +1 -1
- package/lib/{dimensioning-helper-73700224.nomodule.js → dimensioning-helper-844fc69d.nomodule.js} +2 -2
- package/lib/dimensioning-helper-844fc69d.nomodule.js.map +1 -0
- package/lib/{dimensioning-helper-2f129aab.js → dimensioning-helper-e77fbedb.js} +2 -2
- package/lib/dimensioning-helper-e77fbedb.js.map +1 -0
- package/lib/glb-viewer-0331f919.js +2 -0
- package/lib/{glb-viewer-10243e50.js.map → glb-viewer-0331f919.js.map} +1 -1
- package/lib/glb-viewer-6e5482c7.nomodule.js +2 -0
- package/lib/{glb-viewer-d6e080e4.nomodule.js.map → glb-viewer-6e5482c7.nomodule.js.map} +1 -1
- package/lib/glb-viewer-main-17601c40.js +2 -0
- package/lib/glb-viewer-main-17601c40.js.map +1 -0
- package/lib/glb-viewer-main.nomodule.js +1 -1
- package/lib/image-renderer-880c414d.nomodule.js +2 -0
- package/lib/{image-renderer-9478b17b.nomodule.js.map → image-renderer-880c414d.nomodule.js.map} +1 -1
- package/lib/image-renderer-ad267c8b.js +2 -0
- package/lib/{image-renderer-9e47bc3a.js.map → image-renderer-ad267c8b.js.map} +1 -1
- package/lib/legacy/{banana-for-scale-1dc75d47.legacy.js → banana-for-scale-bd7d6dfd.legacy.js} +2 -2
- package/lib/legacy/{banana-for-scale-1dc75d47.legacy.js.map → banana-for-scale-bd7d6dfd.legacy.js.map} +1 -1
- package/lib/legacy/budgeteer-measure.legacy.js +1 -1
- package/lib/legacy/{component-dimensioning-d657350b.legacy.js → component-dimensioning-59fd1367.legacy.js} +2 -2
- package/lib/legacy/component-dimensioning-59fd1367.legacy.js.map +1 -0
- package/lib/legacy/configurator-82b7967e.legacy.js +2 -0
- package/lib/legacy/{configurator-3250dfc2.legacy.js.map → configurator-82b7967e.legacy.js.map} +1 -1
- package/lib/legacy/configurator-main.legacy.js +1 -1
- package/lib/legacy/{configurator-mesh-generator-d604f05c.legacy.js → configurator-mesh-generator-6266fa75.legacy.js} +2 -2
- package/lib/legacy/configurator-mesh-generator-6266fa75.legacy.js.map +1 -0
- package/lib/legacy/{default-light-setting-14b03f67.legacy.js → default-light-setting-97f711dc.legacy.js} +2 -2
- package/lib/legacy/default-light-setting-97f711dc.legacy.js.map +1 -0
- package/lib/legacy/{dimensioning-helper-bed08d96.legacy.js → dimensioning-helper-99057da2.legacy.js} +2 -2
- package/lib/legacy/dimensioning-helper-99057da2.legacy.js.map +1 -0
- package/lib/legacy/glb-viewer-be2c067a.legacy.js +2 -0
- package/lib/legacy/{glb-viewer-5dcdda0a.legacy.js.map → glb-viewer-be2c067a.legacy.js.map} +1 -1
- package/lib/legacy/glb-viewer-main.legacy.js +1 -1
- package/lib/legacy/image-renderer-6df9eca6.legacy.js +2 -0
- package/lib/legacy/{image-renderer-0f532f9c.legacy.js.map → image-renderer-6df9eca6.legacy.js.map} +1 -1
- package/lib/legacy/{main-thread-to-worker-880d5b78.legacy.js → main-thread-to-worker-4c02f179.legacy.js} +2 -2
- package/lib/legacy/main-thread-to-worker-4c02f179.legacy.js.map +1 -0
- package/lib/legacy/{material-viewer-41e5c677.legacy.js → material-viewer-e83460de.legacy.js} +2 -2
- package/lib/legacy/material-viewer-e83460de.legacy.js.map +1 -0
- package/lib/legacy/material-viewer-main.legacy.js +1 -1
- package/lib/legacy/{mesh-generator-4f2f2ec7.legacy.js → mesh-generator-084a73cd.legacy.js} +2 -2
- package/lib/legacy/mesh-generator-084a73cd.legacy.js.map +1 -0
- package/lib/legacy/{pixotron-cd4cd438.legacy.js → pixotron-6195d494.legacy.js} +2 -2
- package/lib/legacy/{pixotron-cd4cd438.legacy.js.map → pixotron-6195d494.legacy.js.map} +1 -1
- package/lib/legacy/{planner-03b11101.legacy.js → planner-5b7cc8fa.legacy.js} +2 -2
- package/lib/legacy/{planner-03b11101.legacy.js.map → planner-5b7cc8fa.legacy.js.map} +1 -1
- package/lib/legacy/planner-main.legacy.js +1 -1
- package/lib/legacy/{rapi-access-ef758fca.legacy.js → rapi-access-7d0f02e7.legacy.js} +3 -3
- package/lib/legacy/{rapi-access-ef758fca.legacy.js.map → rapi-access-7d0f02e7.legacy.js.map} +1 -1
- package/lib/legacy/roomle-sdk.legacy.js +1 -1
- package/lib/legacy/{scene-manager-afd27798.legacy.js → scene-manager-65a4c302.legacy.js} +2 -2
- package/lib/legacy/scene-manager-65a4c302.legacy.js.map +1 -0
- package/lib/legacy/static/ConfiguratorKernel-4c09558b00e81ba8.wasm +0 -0
- package/lib/legacy/static/{ConfiguratorKernel-c416f21e546a33f4.js → ConfiguratorKernel-7379813e2cd03c0d.js} +74 -74
- package/lib/legacy/static/ConfiguratorKernelJs-3789a15227520de1.js +143 -0
- package/lib/legacy/static/ConfiguratorKernelJs-dd075c23d87b4733.mem +0 -0
- package/lib/legacy/static/RoomleCore-43a1c9de57277471.wasm +0 -0
- package/lib/legacy/static/{RoomleCore-30311f70b9e1675b.js → RoomleCore-4da5951bbc66db16.js} +83 -83
- package/lib/legacy/static/RoomleCoreJs-86806817a5b958c9.js +151 -0
- package/lib/legacy/static/RoomleCoreJs-cfff2977254b7f93.mem +0 -0
- package/lib/legacy/static/shaders-df453330fdd84fa7.json +1 -0
- package/lib/legacy/{stats-helper-0acbc658.legacy.js → stats-helper-e832d5a9.legacy.js} +2 -2
- package/lib/legacy/{stats-helper-0acbc658.legacy.js.map → stats-helper-e832d5a9.legacy.js.map} +1 -1
- package/lib/{main-thread-to-worker-bb844d54.nomodule.js → main-thread-to-worker-4fc95d50.nomodule.js} +2 -2
- package/lib/main-thread-to-worker-4fc95d50.nomodule.js.map +1 -0
- package/lib/{main-thread-to-worker-91bf9f5e.js → main-thread-to-worker-5447c1c5.js} +2 -2
- package/lib/main-thread-to-worker-5447c1c5.js.map +1 -0
- package/lib/{material-viewer-1b0d838c.nomodule.js → material-viewer-8183024b.nomodule.js} +2 -2
- package/lib/material-viewer-8183024b.nomodule.js.map +1 -0
- package/lib/{material-viewer-90b397b7.js → material-viewer-9ee1ebf0.js} +2 -2
- package/lib/material-viewer-9ee1ebf0.js.map +1 -0
- package/lib/material-viewer-main-6c084313.js +2 -0
- package/lib/material-viewer-main-6c084313.js.map +1 -0
- package/lib/material-viewer-main.nomodule.js +1 -1
- package/lib/{mesh-generator-948c7db4.nomodule.js → mesh-generator-7dea7a1b.nomodule.js} +2 -2
- package/lib/mesh-generator-7dea7a1b.nomodule.js.map +1 -0
- package/lib/{mesh-generator-ff0dbfc8.js → mesh-generator-a980f1b0.js} +2 -2
- package/lib/mesh-generator-a980f1b0.js.map +1 -0
- package/lib/{pixotron-ec9a72e0.nomodule.js → pixotron-4065f090.nomodule.js} +2 -2
- package/lib/{pixotron-ec9a72e0.nomodule.js.map → pixotron-4065f090.nomodule.js.map} +1 -1
- package/lib/{pixotron-5167229f.js → pixotron-9baf521b.js} +2 -2
- package/lib/{pixotron-5167229f.js.map → pixotron-9baf521b.js.map} +1 -1
- package/lib/{planner-f1b53f57.nomodule.js → planner-2040e9ab.nomodule.js} +2 -2
- package/lib/{planner-f1b53f57.nomodule.js.map → planner-2040e9ab.nomodule.js.map} +1 -1
- package/lib/{planner-c3c34e74.js → planner-79b62302.js} +2 -2
- package/lib/{planner-c3c34e74.js.map → planner-79b62302.js.map} +1 -1
- package/lib/planner-main-74807374.js +2 -0
- package/lib/planner-main-74807374.js.map +1 -0
- package/lib/planner-main.nomodule.js +1 -1
- package/lib/{rapi-access-cf61a750.nomodule.js → rapi-access-65dbda00.nomodule.js} +3 -3
- package/lib/{rapi-access-cf61a750.nomodule.js.map → rapi-access-65dbda00.nomodule.js.map} +1 -1
- package/lib/{rapi-access-cc4f78e4.js → rapi-access-d209c65c.js} +3 -3
- package/lib/{rapi-access-cc4f78e4.js.map → rapi-access-d209c65c.js.map} +1 -1
- package/lib/{roomle-sdk-da4e3ccc.js → roomle-sdk-85d54446.js} +2 -2
- package/lib/roomle-sdk-85d54446.js.map +1 -0
- package/lib/roomle-sdk.nomodule.js +1 -1
- package/lib/{scene-manager-aa8b9035.nomodule.js → scene-manager-0ac7eb06.nomodule.js} +2 -2
- package/lib/scene-manager-0ac7eb06.nomodule.js.map +1 -0
- package/lib/{scene-manager-8c308533.js → scene-manager-424afdbc.js} +2 -2
- package/lib/scene-manager-424afdbc.js.map +1 -0
- package/lib/static/ConfiguratorKernel-4c09558b00e81ba8.wasm +0 -0
- package/lib/static/ConfiguratorKernel-7379813e2cd03c0d.js +1 -0
- package/lib/static/ConfiguratorKernel-7379813e2cd03c0d.js.map +1 -0
- package/lib/static/ConfiguratorKernelJs-3789a15227520de1.js +143 -0
- package/lib/static/ConfiguratorKernelJs-dd075c23d87b4733.mem +0 -0
- package/lib/static/RoomleCore-43a1c9de57277471.wasm +0 -0
- package/lib/static/RoomleCore-4da5951bbc66db16.js +1 -0
- package/lib/static/RoomleCore-4da5951bbc66db16.js.map +1 -0
- package/lib/static/RoomleCoreJs-86806817a5b958c9.js +151 -0
- package/lib/static/RoomleCoreJs-cfff2977254b7f93.mem +0 -0
- package/lib/static/shaders-df453330fdd84fa7.json +1 -0
- package/lib/{stats-helper-f53f8b2f.js → stats-helper-3ffe1651.js} +2 -2
- package/lib/{stats-helper-f53f8b2f.js.map → stats-helper-3ffe1651.js.map} +1 -1
- package/lib/{stats-helper-7dc63459.nomodule.js → stats-helper-9b173f93.nomodule.js} +2 -2
- package/lib/{stats-helper-7dc63459.nomodule.js.map → stats-helper-9b173f93.nomodule.js.map} +1 -1
- package/package.json +2 -2
- package/lib/component-dimensioning-07857a7e.js.map +0 -1
- package/lib/component-dimensioning-e121b044.nomodule.js.map +0 -1
- package/lib/configurator-366b9a69.js +0 -2
- package/lib/configurator-b498456a.nomodule.js +0 -2
- package/lib/configurator-main-1ba50225.js +0 -2
- package/lib/configurator-main-1ba50225.js.map +0 -1
- package/lib/configurator-mesh-generator-bedfe9a1.nomodule.js +0 -2
- package/lib/configurator-mesh-generator-bedfe9a1.nomodule.js.map +0 -1
- package/lib/configurator-mesh-generator-e827c528.js.map +0 -1
- package/lib/default-light-setting-7eb7961c.js.map +0 -1
- package/lib/default-light-setting-f21a820b.nomodule.js.map +0 -1
- package/lib/dimensioning-helper-2f129aab.js.map +0 -1
- package/lib/dimensioning-helper-73700224.nomodule.js.map +0 -1
- package/lib/glb-viewer-10243e50.js +0 -2
- package/lib/glb-viewer-d6e080e4.nomodule.js +0 -2
- package/lib/glb-viewer-main-39535b70.js +0 -2
- package/lib/glb-viewer-main-39535b70.js.map +0 -1
- package/lib/image-renderer-9478b17b.nomodule.js +0 -2
- package/lib/image-renderer-9e47bc3a.js +0 -2
- package/lib/legacy/component-dimensioning-d657350b.legacy.js.map +0 -1
- package/lib/legacy/configurator-3250dfc2.legacy.js +0 -2
- package/lib/legacy/configurator-mesh-generator-d604f05c.legacy.js.map +0 -1
- package/lib/legacy/default-light-setting-14b03f67.legacy.js.map +0 -1
- package/lib/legacy/dimensioning-helper-bed08d96.legacy.js.map +0 -1
- package/lib/legacy/glb-viewer-5dcdda0a.legacy.js +0 -2
- package/lib/legacy/image-renderer-0f532f9c.legacy.js +0 -2
- package/lib/legacy/main-thread-to-worker-880d5b78.legacy.js.map +0 -1
- package/lib/legacy/material-viewer-41e5c677.legacy.js.map +0 -1
- package/lib/legacy/mesh-generator-4f2f2ec7.legacy.js.map +0 -1
- package/lib/legacy/scene-manager-afd27798.legacy.js.map +0 -1
- package/lib/legacy/static/ConfiguratorKernel-a1daecbcb66a7ea2.wasm +0 -0
- package/lib/legacy/static/ConfiguratorKernelJs-2a6eb4d239731162.mem +0 -0
- package/lib/legacy/static/ConfiguratorKernelJs-fdb5588c5f9ad271.js +0 -143
- package/lib/legacy/static/RoomleCore-423543e6e81ce65d.wasm +0 -0
- package/lib/legacy/static/RoomleCoreJs-3ca6b11e7db6ad5c.js +0 -151
- package/lib/legacy/static/RoomleCoreJs-88d140ccbd2a0401.mem +0 -0
- package/lib/legacy/static/shaders-300ca3b7af102119.json +0 -1
- package/lib/main-thread-to-worker-91bf9f5e.js.map +0 -1
- package/lib/main-thread-to-worker-bb844d54.nomodule.js.map +0 -1
- package/lib/material-viewer-1b0d838c.nomodule.js.map +0 -1
- package/lib/material-viewer-90b397b7.js.map +0 -1
- package/lib/material-viewer-main-39b78443.js +0 -2
- package/lib/material-viewer-main-39b78443.js.map +0 -1
- package/lib/mesh-generator-948c7db4.nomodule.js.map +0 -1
- package/lib/mesh-generator-ff0dbfc8.js.map +0 -1
- package/lib/planner-main-f87ff090.js +0 -2
- package/lib/planner-main-f87ff090.js.map +0 -1
- package/lib/roomle-sdk-da4e3ccc.js.map +0 -1
- package/lib/scene-manager-8c308533.js.map +0 -1
- package/lib/scene-manager-aa8b9035.nomodule.js.map +0 -1
- package/lib/static/ConfiguratorKernel-a1daecbcb66a7ea2.wasm +0 -0
- package/lib/static/ConfiguratorKernel-c416f21e546a33f4.js +0 -1
- package/lib/static/ConfiguratorKernel-c416f21e546a33f4.js.map +0 -1
- package/lib/static/ConfiguratorKernelJs-2a6eb4d239731162.mem +0 -0
- package/lib/static/ConfiguratorKernelJs-fdb5588c5f9ad271.js +0 -143
- package/lib/static/RoomleCore-30311f70b9e1675b.js +0 -1
- package/lib/static/RoomleCore-30311f70b9e1675b.js.map +0 -1
- package/lib/static/RoomleCore-423543e6e81ce65d.wasm +0 -0
- package/lib/static/RoomleCoreJs-3ca6b11e7db6ad5c.js +0 -151
- package/lib/static/RoomleCoreJs-88d140ccbd2a0401.mem +0 -0
- package/lib/static/shaders-300ca3b7af102119.json +0 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
System.register(["./rapi-access-
|
|
2
|
-
//# sourceMappingURL=default-light-setting-
|
|
1
|
+
System.register(["./rapi-access-7d0f02e7.legacy.js","./pixotron-6195d494.legacy.js"],(function(i){var t,a;return{setters:[function(i){t=i.h},function(i){a=i.L}],execute:function(){i("D",class extends a{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 THREE.DirectionalLight(new THREE.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 THREE.Vector2(1024,1024),this._mainDirectionalLight.visible=!0,this._mainDirectionalLight.lookAt(new THREE.Vector3(0,0,0)),this._secondDirectionalLight=new THREE.DirectionalLight(new THREE.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 THREE.Vector2(1024,1024),this._secondDirectionalLight.visible=!0,this._secondDirectionalLight.lookAt(new THREE.Vector3(0,0,0)),this._ambientLight=new THREE.AmbientLight(new THREE.Color(this._params.ambientLight.color),.5),this._ambientLight.layers.set(1),this.addToScene()}needsBounds(){return!0}updateBounds(i){const t=i.getSize(new THREE.Vector3),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=t();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 THREE.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 THREE.Color(i)),t.add(this._mainDirectionalLight.position,"x").min(-10).max(10).step(.1).onChange(()=>this._mainDirectionalLight.lookAt(new THREE.Vector3(0,0,0))),t.add(this._mainDirectionalLight.position,"y").min(-10).max(50).step(.1).onChange(()=>this._mainDirectionalLight.lookAt(new THREE.Vector3(0,0,0))),t.add(this._mainDirectionalLight.position,"z").min(-10).max(10).step(.1).onChange(()=>this._mainDirectionalLight.lookAt(new THREE.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 THREE.Color(i)),t.add(this._secondDirectionalLight.position,"x").min(-10).max(10).step(.1).onChange(()=>this._mainDirectionalLight.lookAt(new THREE.Vector3(0,0,0))),t.add(this._secondDirectionalLight.position,"y").min(-10).max(50).step(.1).onChange(()=>this._mainDirectionalLight.lookAt(new THREE.Vector3(0,0,0))),t.add(this._secondDirectionalLight.position,"z").min(-10).max(10).step(.1).onChange(()=>this._mainDirectionalLight.lookAt(new THREE.Vector3(0,0,0)))}}}})}}}));
|
|
2
|
+
//# sourceMappingURL=default-light-setting-97f711dc.legacy.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"default-light-setting-97f711dc.legacy.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
package/lib/legacy/{dimensioning-helper-bed08d96.legacy.js → dimensioning-helper-99057da2.legacy.js}
RENAMED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
System.register(["./query-params-helper-8c00a872.legacy.js","./rapi-access-ef758fca.legacy.js","./main-thread-to-worker-880d5b78.legacy.js","./image-renderer-0f532f9c.legacy.js","./pixotron-cd4cd438.legacy.js","./configurator-3250dfc2.legacy.js","./mesh-generator-4f2f2ec7.legacy.js","./configurator-mesh-generator-d604f05c.legacy.js","./default-light-setting-14b03f67.legacy.js"],(function(e){var t,i,s,n,h,o;return{setters:[function(){},function(e){t=e.e,i=e._,s=e.i,n=e.F},function(){},function(){},function(){},function(e){h=e.A,o=e.R},function(){},function(){},function(){}],execute:function(){const a="component_dimensioning_plane_material",_="component_dimensioning_text_material";let d=(()=>{class e extends THREE.Object3D{constructor(e){super(),this._label="",this._parameters={font:null,size:.1,height:.001,curveSegments:2,bevelEnabled:!0,bevelThickness:.001,bevelSize:.001},this.topDown=!1,this._parameters.font=e,this._position=new THREE.Vector3,this._initMaterials(),this._init(),this._update()}_initMaterials(){this._cacheHolder.materialCache.has(a)?this._planeMaterial=this._cacheHolder.materialCache.get(a):(this._planeMaterial=new THREE.MeshBasicMaterial({color:16777215,side:THREE.DoubleSide,opacity:.8,transparent:!0}),this._cacheHolder.materialCache.set(a,this._planeMaterial)),this._cacheHolder.materialCache.has(_)?this._textMaterial=this._cacheHolder.materialCache.get(_):(this._textMaterial=new THREE.MeshPhongMaterial({color:3618615}),this._cacheHolder.materialCache.set(_,this._textMaterial))}_init(){let e=new THREE.Geometry;this._text=new THREE.Mesh(e,this._textMaterial),this._text.name="text with background text "+this._label,this._plane=new THREE.Mesh(e,this._planeMaterial),this._plane.name="text with background plane "+this._label,this._textGeometry=new THREE.TextGeometry(this._label,this._parameters),this._textGeometry.computeBoundingBox(),this._text.geometry=this._textGeometry,this.add(this._text),this.add(this._plane)}update(e,t,i,s){this._position.copy(e),this._dimensioningType=t,this._cameraPosition=s,this._label=i;const n=this._cameraPosition.distanceTo(this._text.position),h=Math.max(.01,n/100),o=Math.max(5e-4,n/5e3);this._parameters.bevelThickness=o,this._parameters.bevelSize=o,this._parameters.size=h,this._textGeometry=new THREE.TextGeometry(this._label,this._parameters),this._textGeometry.computeBoundingBox(),this._text.geometry=this._textGeometry,this._update()}_update(){if(this.topDown){let e=new THREE.Quaternion;e.setFromAxisAngle(new THREE.Vector3(-1,0,0),Math.PI/2),this._updateText(this._textGeometry,e,new THREE.Vector3)}else if(this._updateText(this._textGeometry,new THREE.Quaternion,new THREE.Vector3),this._cameraPosition){const e=Math.atan2(this._cameraPosition.x-this._position.x,this._cameraPosition.z-this._position.z);this._text.rotation.y=e,this._plane.rotation.y=e}}_updateText(e,t,i){let s=new THREE.Vector3;s.copy(this._position),i.x*=this._getXSign(),s.add(i);let n=e.boundingBox.getSize(new THREE.Vector3);e.center(),this._text.position.copy(s),this._text.quaternion.copy(t);let h=new THREE.PlaneGeometry(n.x+.02,n.y+.02,32);h.center(),this._plane.geometry=h,this._plane.position.copy(s),this._plane.quaternion.copy(t)}_getXSign(){return!this._cameraPosition||this._cameraPosition.x>=0?1:-1}dispose(){t(this)}}return i([s],e.prototype,"_cacheHolder",void 0),e})();e("default",(()=>{class e{constructor(e){this._cameraPosition=new THREE.Vector3,this._textUpdated=!1,this._topDimensions=!1,this._initialized=new n,this._enabled=!1,this._dimensionsVisible=!1,this._creator_=e,this._lineMaterial=new THREE.LineBasicMaterial({color:3618615,linewidth:2});let t=new THREE.Geometry;this._widthLine=new THREE.Line(t,this._lineMaterial),this._widthLine.name="dimension width line",this._heightLine=new THREE.Line(t,this._lineMaterial),this._heightLine.name="dimension height line",this._depthLine=new THREE.Line(t,this._lineMaterial),this._depthLine.name="dimension depth line",this._planeMaterial=new THREE.MeshBasicMaterial({color:16777215,side:THREE.DoubleSide,opacity:.8,transparent:!0}),h.loadFont(o).then(e=>{this._font=e,this._loaded()})}_loaded(){this.update(!1),this.addToScene(this._scene,this._uiScene),this._initialized.resolve()}_performUpdate(e){this._enabled&&(this._lineBounds||e)&&this._font&&(this._updateHeight(),this._updateWidth(),this._updateDepth())}_updateWidth(){let e=new THREE.Geometry,t=this._getWidthEdge();e.vertices.push(t.start,t.end),this._widthLine.geometry.dispose(),this._widthLine.geometry=e;let i=t.getCenter(new THREE.Vector3);this._widthText||(this._widthText=new d(this._font)),this._widthText.topDown=this._topDimensions;const s=this._unitFormatter.formatMMValueToUnitString(1e3*this._dimensions.x);this._widthText.update(i,0,s,this._cameraPosition)}_updateHeight(){let e=new THREE.Geometry,t=this._getHeightEdge();e.vertices.push(t.start,t.end),this._heightLine.geometry.dispose(),this._heightLine.geometry=e;let i=t.getCenter(new THREE.Vector3);this._heightText||(this._heightText=new d(this._font)),this._heightText.topDown=this._topDimensions;const s=this._unitFormatter.formatMMValueToUnitString(1e3*this._dimensions.y);this._heightText.update(i,1,s,this._cameraPosition)}_updateDepth(){let e=new THREE.Geometry,t=this._getDepthEdge();e.vertices.push(t.start,t.end),this._depthLine.geometry.dispose(),this._depthLine.geometry=e;let i=t.getCenter(new THREE.Vector3);this._depthText||(this._depthText=new d(this._font)),this._depthText.topDown=this._topDimensions;const s=this._unitFormatter.formatMMValueToUnitString(1e3*this._dimensions.z);this._depthText.update(i,2,s,this._cameraPosition)}updateBounds(e){this._dimensions=e.getSize(new THREE.Vector3),this._lineBounds=e.clone();let t=this._lineBounds.min.y<0?this._lineBounds.min.y:0;t-=.01,this._lineBounds.expandByVector(new THREE.Vector3(.05,t,.05)),this._textUpdated=!1,this.update()}update(e=!1){this._enabled&&!this._dimensionsVisible&&(this._dimensionsVisible=!0,this._visibilityChangedCallback()),this._performUpdate(e)}addToScene(e,t){this._widthText&&this._widthLine&&this._heightText&&this._heightLine&&this._heightText&&this._heightLine&&(e.add(this._widthLine),t.add(this._widthText),e.add(this._heightLine),t.add(this._heightText),e.add(this._depthLine),t.add(this._depthText))}removeFromScene(e,t){e.remove(this._widthLine),t.remove(this._widthText),e.remove(this._heightLine),t.remove(this._heightText),e.remove(this._depthLine),t.remove(this._depthText)}_getWidthEdge(){return this._cameraPosition.z>=0?new THREE.Line3(new THREE.Vector3(this._lineBounds.min.x,this._lineBounds.min.y,this._lineBounds.max.z),new THREE.Vector3(this._lineBounds.max.x,this._lineBounds.min.y,this._lineBounds.max.z)):new THREE.Line3(new THREE.Vector3(this._lineBounds.min.x,this._lineBounds.min.y,this._lineBounds.min.z),new THREE.Vector3(this._lineBounds.max.x,this._lineBounds.min.y,this._lineBounds.min.z))}_getDepthEdge(){return this._cameraPosition.x>=0?new THREE.Line3(new THREE.Vector3(this._lineBounds.max.x,this._lineBounds.min.y,this._lineBounds.min.z),new THREE.Vector3(this._lineBounds.max.x,this._lineBounds.min.y,this._lineBounds.max.z)):new THREE.Line3(new THREE.Vector3(this._lineBounds.min.x,this._lineBounds.min.y,this._lineBounds.min.z),new THREE.Vector3(this._lineBounds.min.x,this._lineBounds.min.y,this._lineBounds.max.z))}_getHeightEdge(){return this._cameraPosition.x>=0&&this._cameraPosition.z>=0?new THREE.Line3(new THREE.Vector3(this._lineBounds.max.x,this._lineBounds.min.y,this._lineBounds.max.z),new THREE.Vector3(this._lineBounds.max.x,this._lineBounds.max.y,this._lineBounds.max.z)):this._cameraPosition.x<0&&this._cameraPosition.z>=0?new THREE.Line3(new THREE.Vector3(this._lineBounds.min.x,this._lineBounds.min.y,this._lineBounds.max.z),new THREE.Vector3(this._lineBounds.min.x,this._lineBounds.max.y,this._lineBounds.max.z)):this._cameraPosition.x>=0&&this._cameraPosition.z<0?new THREE.Line3(new THREE.Vector3(this._lineBounds.max.x,this._lineBounds.min.y,this._lineBounds.min.z),new THREE.Vector3(this._lineBounds.max.x,this._lineBounds.max.y,this._lineBounds.min.z)):new THREE.Line3(new THREE.Vector3(this._lineBounds.min.x,this._lineBounds.min.y,this._lineBounds.min.z),new THREE.Vector3(this._lineBounds.min.x,this._lineBounds.max.y,this._lineBounds.min.z))}onDimensionsVisibilityChanged(e){this._onChange=e}enableTopDimensions(){this.enableDimensions(),this._topDimensions=!0,this._heightLine.visible=!1,this._heightText.visible=!1,this.update(!0)}disableTopDimensions(){this._topDimensions=!1,this._heightLine.visible=!0,this._heightText.visible=!0,this.disableDimensions()}enableDimensions(){this._enabled=!0,this.update(!0),this.addToScene(this._scene,this._uiScene)}disableDimensions(){this._enabled=!1,this._dimensionsVisible&&(this._dimensionsVisible=!1,this._visibilityChangedCallback()),this.removeFromScene(this._scene,this._uiScene)}_visibilityChangedCallback(){this._onChange&&this._onChange(this._dimensionsVisible)}_clear(){this._lineMaterial.dispose(),this._planeMaterial.dispose(),this._widthLine.geometry.dispose(),this._heightLine.geometry.dispose(),this._depthLine.geometry.dispose(),this._heightText.dispose(),this._heightText.dispose(),this._depthText.dispose()}getBoundingBox(){const e=new THREE.Box3;return e.expandByObject(this._widthLine),e.expandByObject(this._widthText),e.expandByObject(this._heightLine),e.expandByObject(this._heightText),e.expandByObject(this._depthLine),e.expandByObject(this._depthText),e}setVisibility(e){this._heightLine&&this._widthLine&&this._depthLine&&this._heightText&&this._widthText&&this._depthText&&(this._heightLine.visible=e,this._heightText.visible=e,this._widthLine.visible=e,this._widthText.visible=e,this._depthLine.visible=e,this._depthText.visible=e)}moveCameraStart(e){this.setVisibility(!1),this._cameraPosition=e,this.update()}moveCameraEnd(e){this.setVisibility(!0),this._cameraPosition=e,this.update()}clearScene(e){this._clear()}setScene(e){this._scene=e}setUiScene(e){this._uiScene=e}needsUiScene(){return!0}isInitialized(){return this._initialized.wait()}areDimensionsEnabled(){return this._enabled}}return i([s],e.prototype,"_unitFormatter",void 0),e})())}}}));
|
|
2
|
-
//# sourceMappingURL=dimensioning-helper-
|
|
1
|
+
System.register(["./query-params-helper-8c00a872.legacy.js","./rapi-access-7d0f02e7.legacy.js","./main-thread-to-worker-4c02f179.legacy.js","./image-renderer-6df9eca6.legacy.js","./pixotron-6195d494.legacy.js","./configurator-82b7967e.legacy.js","./mesh-generator-084a73cd.legacy.js","./configurator-mesh-generator-6266fa75.legacy.js","./default-light-setting-97f711dc.legacy.js"],(function(e){var t,i,s,n,h,o;return{setters:[function(){},function(e){t=e.e,i=e._,s=e.i,n=e.F},function(){},function(){},function(){},function(e){h=e.A,o=e.R},function(){},function(){},function(){}],execute:function(){const a="component_dimensioning_plane_material",_="component_dimensioning_text_material";let d=(()=>{class e extends THREE.Object3D{constructor(e){super(),this._label="",this._parameters={font:null,size:.1,height:.001,curveSegments:2,bevelEnabled:!0,bevelThickness:.001,bevelSize:.001},this.topDown=!1,this._parameters.font=e,this._position=new THREE.Vector3,this._initMaterials(),this._init(),this._update()}_initMaterials(){this._cacheHolder.materialCache.has(a)?this._planeMaterial=this._cacheHolder.materialCache.get(a):(this._planeMaterial=new THREE.MeshBasicMaterial({color:16777215,side:THREE.DoubleSide,opacity:.8,transparent:!0}),this._cacheHolder.materialCache.set(a,this._planeMaterial)),this._cacheHolder.materialCache.has(_)?this._textMaterial=this._cacheHolder.materialCache.get(_):(this._textMaterial=new THREE.MeshPhongMaterial({color:3618615}),this._cacheHolder.materialCache.set(_,this._textMaterial))}_init(){let e=new THREE.Geometry;this._text=new THREE.Mesh(e,this._textMaterial),this._text.name="text with background text "+this._label,this._plane=new THREE.Mesh(e,this._planeMaterial),this._plane.name="text with background plane "+this._label,this._textGeometry=new THREE.TextGeometry(this._label,this._parameters),this._textGeometry.computeBoundingBox(),this._text.geometry=this._textGeometry,this.add(this._text),this.add(this._plane)}update(e,t,i,s){this._position.copy(e),this._dimensioningType=t,this._cameraPosition=s,this._label=i;const n=this._cameraPosition.distanceTo(this._text.position),h=Math.max(.01,n/100),o=Math.max(5e-4,n/5e3);this._parameters.bevelThickness=o,this._parameters.bevelSize=o,this._parameters.size=h,this._textGeometry=new THREE.TextGeometry(this._label,this._parameters),this._textGeometry.computeBoundingBox(),this._text.geometry=this._textGeometry,this._update()}_update(){if(this.topDown){let e=new THREE.Quaternion;e.setFromAxisAngle(new THREE.Vector3(-1,0,0),Math.PI/2),this._updateText(this._textGeometry,e,new THREE.Vector3)}else if(this._updateText(this._textGeometry,new THREE.Quaternion,new THREE.Vector3),this._cameraPosition){const e=Math.atan2(this._cameraPosition.x-this._position.x,this._cameraPosition.z-this._position.z);this._text.rotation.y=e,this._plane.rotation.y=e}}_updateText(e,t,i){let s=new THREE.Vector3;s.copy(this._position),i.x*=this._getXSign(),s.add(i);let n=e.boundingBox.getSize(new THREE.Vector3);e.center(),this._text.position.copy(s),this._text.quaternion.copy(t);let h=new THREE.PlaneGeometry(n.x+.02,n.y+.02,32);h.center(),this._plane.geometry=h,this._plane.position.copy(s),this._plane.quaternion.copy(t)}_getXSign(){return!this._cameraPosition||this._cameraPosition.x>=0?1:-1}dispose(){t(this)}}return i([s],e.prototype,"_cacheHolder",void 0),e})();e("default",(()=>{class e{constructor(e){this._cameraPosition=new THREE.Vector3,this._textUpdated=!1,this._topDimensions=!1,this._initialized=new n,this._enabled=!1,this._dimensionsVisible=!1,this._creator_=e,this._lineMaterial=new THREE.LineBasicMaterial({color:3618615,linewidth:2});let t=new THREE.Geometry;this._widthLine=new THREE.Line(t,this._lineMaterial),this._widthLine.name="dimension width line",this._heightLine=new THREE.Line(t,this._lineMaterial),this._heightLine.name="dimension height line",this._depthLine=new THREE.Line(t,this._lineMaterial),this._depthLine.name="dimension depth line",this._planeMaterial=new THREE.MeshBasicMaterial({color:16777215,side:THREE.DoubleSide,opacity:.8,transparent:!0}),h.loadFont(o).then(e=>{this._font=e,this._loaded()})}_loaded(){this.update(!1),this.addToScene(this._scene,this._uiScene),this._initialized.resolve()}_performUpdate(e){this._enabled&&(this._lineBounds||e)&&this._font&&(this._updateHeight(),this._updateWidth(),this._updateDepth())}_updateWidth(){let e=new THREE.Geometry,t=this._getWidthEdge();e.vertices.push(t.start,t.end),this._widthLine.geometry.dispose(),this._widthLine.geometry=e;let i=t.getCenter(new THREE.Vector3);this._widthText||(this._widthText=new d(this._font)),this._widthText.topDown=this._topDimensions;const s=this._unitFormatter.formatMMValueToUnitString(1e3*this._dimensions.x);this._widthText.update(i,0,s,this._cameraPosition)}_updateHeight(){let e=new THREE.Geometry,t=this._getHeightEdge();e.vertices.push(t.start,t.end),this._heightLine.geometry.dispose(),this._heightLine.geometry=e;let i=t.getCenter(new THREE.Vector3);this._heightText||(this._heightText=new d(this._font)),this._heightText.topDown=this._topDimensions;const s=this._unitFormatter.formatMMValueToUnitString(1e3*this._dimensions.y);this._heightText.update(i,1,s,this._cameraPosition)}_updateDepth(){let e=new THREE.Geometry,t=this._getDepthEdge();e.vertices.push(t.start,t.end),this._depthLine.geometry.dispose(),this._depthLine.geometry=e;let i=t.getCenter(new THREE.Vector3);this._depthText||(this._depthText=new d(this._font)),this._depthText.topDown=this._topDimensions;const s=this._unitFormatter.formatMMValueToUnitString(1e3*this._dimensions.z);this._depthText.update(i,2,s,this._cameraPosition)}updateBounds(e){this._dimensions=e.getSize(new THREE.Vector3),this._lineBounds=e.clone();let t=this._lineBounds.min.y<0?this._lineBounds.min.y:0;t-=.01,this._lineBounds.expandByVector(new THREE.Vector3(.05,t,.05)),this._textUpdated=!1,this.update()}update(e=!1){this._enabled&&!this._dimensionsVisible&&(this._dimensionsVisible=!0,this._visibilityChangedCallback()),this._performUpdate(e)}addToScene(e,t){this._widthText&&this._widthLine&&this._heightText&&this._heightLine&&this._heightText&&this._heightLine&&(e.add(this._widthLine),t.add(this._widthText),e.add(this._heightLine),t.add(this._heightText),e.add(this._depthLine),t.add(this._depthText))}removeFromScene(e,t){e.remove(this._widthLine),t.remove(this._widthText),e.remove(this._heightLine),t.remove(this._heightText),e.remove(this._depthLine),t.remove(this._depthText)}_getWidthEdge(){return this._cameraPosition.z>=0?new THREE.Line3(new THREE.Vector3(this._lineBounds.min.x,this._lineBounds.min.y,this._lineBounds.max.z),new THREE.Vector3(this._lineBounds.max.x,this._lineBounds.min.y,this._lineBounds.max.z)):new THREE.Line3(new THREE.Vector3(this._lineBounds.min.x,this._lineBounds.min.y,this._lineBounds.min.z),new THREE.Vector3(this._lineBounds.max.x,this._lineBounds.min.y,this._lineBounds.min.z))}_getDepthEdge(){return this._cameraPosition.x>=0?new THREE.Line3(new THREE.Vector3(this._lineBounds.max.x,this._lineBounds.min.y,this._lineBounds.min.z),new THREE.Vector3(this._lineBounds.max.x,this._lineBounds.min.y,this._lineBounds.max.z)):new THREE.Line3(new THREE.Vector3(this._lineBounds.min.x,this._lineBounds.min.y,this._lineBounds.min.z),new THREE.Vector3(this._lineBounds.min.x,this._lineBounds.min.y,this._lineBounds.max.z))}_getHeightEdge(){return this._cameraPosition.x>=0&&this._cameraPosition.z>=0?new THREE.Line3(new THREE.Vector3(this._lineBounds.max.x,this._lineBounds.min.y,this._lineBounds.max.z),new THREE.Vector3(this._lineBounds.max.x,this._lineBounds.max.y,this._lineBounds.max.z)):this._cameraPosition.x<0&&this._cameraPosition.z>=0?new THREE.Line3(new THREE.Vector3(this._lineBounds.min.x,this._lineBounds.min.y,this._lineBounds.max.z),new THREE.Vector3(this._lineBounds.min.x,this._lineBounds.max.y,this._lineBounds.max.z)):this._cameraPosition.x>=0&&this._cameraPosition.z<0?new THREE.Line3(new THREE.Vector3(this._lineBounds.max.x,this._lineBounds.min.y,this._lineBounds.min.z),new THREE.Vector3(this._lineBounds.max.x,this._lineBounds.max.y,this._lineBounds.min.z)):new THREE.Line3(new THREE.Vector3(this._lineBounds.min.x,this._lineBounds.min.y,this._lineBounds.min.z),new THREE.Vector3(this._lineBounds.min.x,this._lineBounds.max.y,this._lineBounds.min.z))}onDimensionsVisibilityChanged(e){this._onChange=e}enableTopDimensions(){this.enableDimensions(),this._topDimensions=!0,this._heightLine.visible=!1,this._heightText.visible=!1,this.update(!0)}disableTopDimensions(){this._topDimensions=!1,this._heightLine.visible=!0,this._heightText.visible=!0,this.disableDimensions()}enableDimensions(){this._enabled=!0,this.update(!0),this.addToScene(this._scene,this._uiScene)}disableDimensions(){this._enabled=!1,this._dimensionsVisible&&(this._dimensionsVisible=!1,this._visibilityChangedCallback()),this.removeFromScene(this._scene,this._uiScene)}_visibilityChangedCallback(){this._onChange&&this._onChange(this._dimensionsVisible)}_clear(){this._lineMaterial.dispose(),this._planeMaterial.dispose(),this._widthLine.geometry.dispose(),this._heightLine.geometry.dispose(),this._depthLine.geometry.dispose(),this._heightText.dispose(),this._heightText.dispose(),this._depthText.dispose()}getBoundingBox(){const e=new THREE.Box3;return e.expandByObject(this._widthLine),e.expandByObject(this._widthText),e.expandByObject(this._heightLine),e.expandByObject(this._heightText),e.expandByObject(this._depthLine),e.expandByObject(this._depthText),e}setVisibility(e){this._heightLine&&this._widthLine&&this._depthLine&&this._heightText&&this._widthText&&this._depthText&&(this._heightLine.visible=e,this._heightText.visible=e,this._widthLine.visible=e,this._widthText.visible=e,this._depthLine.visible=e,this._depthText.visible=e)}moveCameraStart(e){this.setVisibility(!1),this._cameraPosition=e,this.update()}moveCameraEnd(e){this.setVisibility(!0),this._cameraPosition=e,this.update()}clearScene(e){this._clear()}setScene(e){this._scene=e}setUiScene(e){this._uiScene=e}needsUiScene(){return!0}isInitialized(){return this._initialized.wait()}areDimensionsEnabled(){return this._enabled}}return i([s],e.prototype,"_unitFormatter",void 0),e})())}}}));
|
|
2
|
+
//# sourceMappingURL=dimensioning-helper-99057da2.legacy.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dimensioning-helper-99057da2.legacy.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
System.register(["./query-params-helper-8c00a872.legacy.js","./rapi-access-7d0f02e7.legacy.js","./main-thread-to-worker-4c02f179.legacy.js","./pixotron-6195d494.legacy.js","./default-light-setting-97f711dc.legacy.js","./scene-manager-65a4c302.legacy.js"],(function(e){var t,i,r,s,n,a,o,h,c,l,d,_,m,u,p,g,w,f,E,b,S,v,L,C,y;return{setters:[function(){},function(e){t=e.n,i=e.L,r=e.o,s=e.h,n=e._,a=e.i,o=e.d,h=e.f,c=e.P,l=e.e,d=e.G,_=e.a7,m=e.s},function(e){u=e.f},function(e){p=e.I,g=e.S,w=e.C,f=e.L,E=e.B,b=e.T,S=e.e,v=e.g,L=e.M},function(e){C=e.D},function(e){y=e.S}],execute:function(){const M=[new t("script-loader",g),new t("glb-input-manager",class extends p{},1),new t("logger",i),new t("rapi-access",r)];class R extends w{constructor(){super(...arguments),this.shouldIgnoreStandardBehavior=!1}adjust(e,t,i,r,s){let n=new THREE.Vector3(-e.x/2,0,-e.z/2),a=new THREE.Vector3(e.x/2,e.y,e.z/2);this._boundingBox=new THREE.Box3(n,a);let o=new THREE.Euler(-Math.PI/2+r,i,0,"ZYX"),h=(new THREE.Quaternion).setFromEuler(o);this._camera.updateProjectionMatrix(),this._camera.quaternion.copy(h),this._camera.position.copy(t)}_update(e){this.shouldIgnoreStandardBehavior?this._saveYawAndPitch():super._update(e)}animateCamera(e){return!!this.shouldIgnoreStandardBehavior||super.animateCamera(e)}}class B extends f{constructor(e,t){super(e,t),this._params={ambientLight:{color:"#ffffff"}},this._ambientLight=new THREE.AmbientLight(new THREE.Color(this._params.ambientLight.color),.5),this.addToScene()}addToScene(){this._scene.add(this._ambientLight)}removeFromScene(){this._scene.remove(this._ambientLight)}reload(){this.removeFromScene(),this.addToScene()}showGUI(){let e=s();if(e&&this._ambientLight){let t=e.addFolder("Ambient Light");t.add(this._ambientLight,"visible"),t.add(this._ambientLight,"intensity").min(0).max(5).step(.1),t.addColor(this._params.ambientLight,"color").onChange(e=>{this._ambientLight.color=new THREE.Color(e)})}}}let T=(()=>{class e extends y{constructor(e,t){super(e,t,o.GLB,"3D"),this._itemsCount=0,this._standardSceneBackgroundColor=this._scene.background,this._renderer.capabilities.maxTextures>8?this.loadDynamicLightSetting(h.createDynamicLightSettingSource(null,c.CAMERA)):(console.warn("this device has a maximum of 8 texture units thus we are using a simpler light setting"),this._lightSetting=new B(this._scene)),this._setEnvironment(new E(this._scene,this._environment))}createCameraControl(e){this._cameraControl=new R(this._creator_,this._getInputManager(),new THREE.Vector3(-1,1,1))}_getInputManager(){return this._glbInputManager}async loadStaticItem(e,t){const i=await this._rapiAccess.getItem(e);if(i.configuration)return Promise.reject();const r=u(i);return r?this.loadGLB(r,!0,void 0,t):Promise.reject(new Error("GLB Url not detected"))}loadGLB(e,t=!0,i=new THREE.Vector3(1,1,1),r){return this.clearScene(),new Promise((s,n)=>{this._loadGLB(e,new THREE.Vector3(0,0,0),0,void 0,i,void 0,void 0,r).then(e=>{this._currentGLB=e,this._scene.add(this._currentGLB);let i=(new THREE.Box3).setFromObject(this._currentGLB);if(t){let e=i.getCenter(new THREE.Vector3);this._cameraControl instanceof R&&(this._cameraControl.updateToBounds(i,!1,!0,e),this._cameraControl.reset(i,e,-15,0))}this._updateBounds(i),s()},n)})}preparePerspectiveImage(e,t,i){return new Promise(r=>{t||(t=1e3),i||(i=1e3),e||((e=new THREE.WebGLRenderer({antialias:!0})).setSize(t,i),e.outputEncoding=THREE.sRGBEncoding,e.autoClear=!1,e.shadowMap.enabled=!0,e.shadowMap.type=THREE.BasicShadowMap);let s=this._cameraControl.getCamera().clone();s instanceof THREE.PerspectiveCamera&&(s.aspect=t/i,s.updateProjectionMatrix()),this._lightSetting.removeFromScene();let n=new C(this._scene);e.render(this._scene,s);let a=e.domElement.toDataURL();e.domElement.toBlob(e=>{r({image:a,width:t,height:i,blob:e})},"image/png"),n.removeFromScene(),this._lightSetting.addToScene()})}adjustCamera(e,t,i,r){if(this._cameraControl instanceof R){let s=(new THREE.Box3).setFromObject(this._scene).getSize(new THREE.Vector3);this._cameraControl.adjust(s,e,t,i,r),this._requestRender()}}onStart(e){this._itemsCount=e,this._scene.background=null,this._cameraControl instanceof R&&(this._cameraControl.shouldIgnoreStandardBehavior=!0)}onElementFinished(e){this._itemsCount,Math.round(100/this._itemsCount*e)}onFinished(e){this._scene.background=this._standardSceneBackgroundColor,this._cameraControl instanceof R&&(this._cameraControl.shouldIgnoreStandardBehavior=!1)}clearScene(){this._currentGLB&&(this._scene.remove(this._currentGLB),l(this._currentGLB),this._currentGLB=null),super.clearScene()}enableHD(){super.enableHD(),this._pixotron.enableAA=!1,this._pixotron.getSAOPass().enabled=!0}sceneChanged(){}getPixotronParams(){return{saoparams:{intensity:.25,occlusionWorldRadius:.4,smoothTransition:!0,samplesPerFrame:4,bias:.016,numSamples:200,accumulative:!1,falloff:1.5},shadowparams:{shadowMapResolution:1024,shadowRadius:3,shadowQuality:1,smoothTransition:!0,enableAccumulation:!0,shadowBiasMultiplier:.6,nearPlane:.01,farPlane:50,fov:110,side:THREE.FrontSide,numSamples:100}}}getBakedShadowParams(){return{enable:!0,shadowMapResolution:512,smoothTransition:!0,numSamples:500,numSamplesPerFrame:4,bShadowMaterial:!0,falloff:1.5,darkness:.2,size:1.6,lightDirection:new THREE.Vector3(0,1,.5),lightSolidAngle:40}}getBounds(){return this._currentGLB?(new THREE.Box3).setFromObject(this._currentGLB):null}}return n([a],e.prototype,"_glbInputManager",void 0),n([a],e.prototype,"_rapiAccess",void 0),e})();class x{constructor(e,t,i){this._prefix="https://furniture.roomle.com/3d/glb/",this._listeners=new Set,this._finishedItems=0,this._sceneManager=e,this._renderer=new THREE.WebGLRenderer({antialias:!0,alpha:!0}),this._width=t,this._height=i,this._renderer.setSize(t,i),this._renderer.setClearColor(16777215,0),this._renderer.outputEncoding=THREE.sRGBEncoding}addListener(e){this._listeners.add(e)}removeListener(e){this._listeners.delete(e)}start(e){return this._entries=[],e.forEach(e=>{this._entries.push(this._transform(e))}),this._finishedItems=0,this._listeners.forEach(e=>e.onStart(this._entries.length)),this._zip=new window.JSZip,this._doNextEntry(),new Promise(e=>{this._resolve=e})}_transform(e){return{name:e.path.replace(".glb",".png"),url:this._prefix+e.path,position:new THREE.Vector3(e.camera.position.x,e.camera.position.z,-e.camera.position.y),fov:2*e.camera.fieldOfView,yaw:e.camera.rotation.z,pitch:e.camera.rotation.x}}_doNextEntry(){0===this._entries.length?(this._listeners.forEach(e=>e.onFinished(this._zip)),this._resolve(this._zip)):this._processEntry(this._entries[0])}_processEntry(e){this._sceneManager.loadGLB(e.url,!1,void 0).then(()=>{this._sceneManager.adjustCamera(e.position,e.yaw,e.pitch,e.fov),this._sceneManager.preparePerspectiveImage(this._renderer,this._width,this._height).then(t=>{this._entryFinished(e,t)})})}_entryFinished(e,t){let i=this._entries.indexOf(e);i>-1&&this._entries.splice(i,1),this._finishedItems++,this._listeners.forEach(e=>e.onElementFinished(this._finishedItems)),this._zip.file(e.name,t.blob),this._doNextEntry()}}let H=(()=>{class e{constructor(e){this._currentIdOrUrl=null,this._creator_=e}setCameraOffset(e){this._sceneManager.setCameraOffset(e)}getCameraOffset(){return this._sceneManager.getCameraOffset()}init(e,t){return this.setOverrides(t),this._domHelper.setDomElement(e),this._sceneManager?(this._lifeCycleManager.resume(),Promise.resolve()):new Promise(this._initPromiseCallback.bind(this))}_initPromiseCallback(e,t){this._threeLoader.fetch().then(()=>{let t=this._scriptLoader.fetch(d,{id:"gltf-loader"}),i=this._scriptLoader.fetch(_,{id:"draco-loader"}),r=this._scriptLoader.fetch(b,{id:"tween-js"});Promise.all([t,i,r]).then(()=>{this._sceneManager=new T(this._creator_,{left:0,top:1,right:1,bottom:0}),this.enableHD(),e()})})}enableHD(){return new Promise((e,t)=>{const i=()=>{this._sceneManager.enableHD(),e()};Promise.all(S.map(e=>this._scriptLoader.fetch(e,{id:e}))).then(()=>{this._scriptLoader.fetch(v,{id:"pi-js"}).then(i,t)},t)})}clearScene(){this._sceneManager.clearScene()}loadGLB(e,t=1,i){return this._currentIdOrUrl=e,this._rapiAccess.trackView(e),this._sceneManager.loadGLB(e,!0,new THREE.Vector3(t,t,t),i)}loadStaticItem(e,t){return this._currentIdOrUrl=e,this._rapiAccess.trackView(e),this._sceneManager.loadStaticItem(e,t)}getCurrentId(){return this._currentIdOrUrl}loadSceneSetting(e){return this._sceneManager.loadSceneSettings(e)}loadQualitySetting(e){this._sceneManager.loadQualitySetting(e)}preparePerspectiveImage(){return this._sceneManager.preparePerspectiveImage()}processRenderList(e,t=320,i=320){let r=JSON.parse(e);this._scriptLoader.fetch("static/jszip.min-dd6c9829408677a1.js",{id:"jszip-js"}).then(()=>{let e=new x(this._sceneManager,t,i);e.addListener(this._sceneManager),e.start(r.items).then(t=>{t.generateAsync({type:"blob"}).then(t=>{let i=document.createElement("a");i.href=URL.createObjectURL(t),i.download="content.zip",i.style.display="none",document.body.appendChild(i),i.click(),document.body.removeChild(i),e.removeListener(this._sceneManager)})})})}setOverrides(e){e&&(this._initData.setOverrides(e),this._globalInitData.setOverrides(e))}updateSize(){this._sceneManager.updateCamera()}getMain(){}resumeTest(e){this._domHelper.setDomElement(e),this._lifeCycleManager.resume()}pauseTest(){this._lifeCycleManager.pause()}showGUI(){this._sceneManager.showGUI()}get callbacks(){return{}}getScene(){return this._sceneManager.getScene()}updateScene(){this._sceneManager.updateScene()}}return n([a],e.prototype,"_rapiAccess",void 0),n([a],e.prototype,"_domHelper",void 0),n([a],e.prototype,"_scriptLoader",void 0),n([a],e.prototype,"_lifeCycleManager",void 0),n([a],e.prototype,"_threeLoader",void 0),n([a],e.prototype,"_initData",void 0),n([a],e.prototype,"_globalInitData",void 0),e})();e("GlbViewer",class extends L{setupGlobals(){}setupDependencies(){m.setup(M),this.lookup("logger",this._context)}cleanUpGlobals(){throw new Error("Method not implemented.")}cleanUpDependencies(){throw new Error("Method not implemented.")}bootFinished(){this._viewer=new H(this._context),window.RoomleGLBViewer||(window.RoomleGLBViewer=this._viewer)}getApi(){return this._viewer}getContextName(){return"glb-viewer"}})}}}));
|
|
2
|
+
//# sourceMappingURL=glb-viewer-be2c067a.legacy.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"glb-viewer-
|
|
1
|
+
{"version":3,"file":"glb-viewer-be2c067a.legacy.js","sources":["../../../node_modules/jszip/dist/jszip.min.js"],"sourcesContent":["export default \"static/jszip.min-dd6c9829408677a1.js\""],"names":[],"mappings":"s7QAAe"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
System.register(["./query-params-helper-8c00a872.legacy.js","./rapi-access-
|
|
1
|
+
System.register(["./query-params-helper-8c00a872.legacy.js","./rapi-access-7d0f02e7.legacy.js","./main-thread-to-worker-4c02f179.legacy.js","./pixotron-6195d494.legacy.js","./default-light-setting-97f711dc.legacy.js","./scene-manager-65a4c302.legacy.js","./glb-viewer-be2c067a.legacy.js"],(function(){var e;return{setters:[function(){},function(){},function(){},function(){},function(){},function(){},function(c){e=c.GlbViewer}],execute:function(){(new e).boot()}}}));
|
|
2
2
|
//# sourceMappingURL=glb-viewer-main.legacy.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
System.register(["./rapi-access-7d0f02e7.legacy.js","./main-thread-to-worker-4c02f179.legacy.js","./pixotron-6195d494.legacy.js","./default-light-setting-97f711dc.legacy.js"],(function(e){var t,n,r,i,o,a,s,l,c,d,h,u,_,p,g,b,m,E,f,C,y,P,R,j,w,O,H,M,v;return{setters:[function(e){t=e.U,n=e.T,r=e.J,i=e.V,o=e.e,a=e.W,s=e.O,l=e.X,c=e.Q,d=e.Y,h=e.Z,u=e._,_=e.i,p=e.$,g=e.C,b=e.B,m=e.E,E=e.M,f=e.a0,C=e.s,y=e.j,P=e.a1,R=e.a2,j=e.t,w=e.h},function(e){O=e.f},function(e){H=e.E,M=e.L},function(e){v=e.D}],execute:function(){e("G","static/GLTFExporter-86edae059df3a219.js"),e("C",class extends t{constructor(e){super(e),this.onKernelIsReady=null,this.onComponentPositionsUpdated=null,this.onUpdateParameters=e=>{},this.onUpdatePossibleChildren=(e,t)=>{},this.onUpdatePrice=(e,t)=>{},this.onSelectionChange=(e,t,n,r)=>{},this.onSelectionCancel=()=>{},this.onPartListUpdate=(e,t)=>{},this.onBoundsUpdate=e=>{},this.onLoadConfiguration=()=>{},this.onConfigurationReady=(e,t,n)=>{},this.onOpenTag=e=>{},this.onOpenAddOns=()=>{},this.onClickOutside=()=>{},this.onNoDockingsAvailable=()=>{},this.onUiIntersectionChange=e=>{},this.onZoomChange=(e,t)=>{},this.onDimensionsVisibilityChange=e=>{},this.onErrorDueToOffline=e=>{},this.onError=e=>{},this.onDockingsPreviewRemoved=()=>{},this.onConfigurationHasChildren=e=>{},this.onTrackTiming=(e,t,n,r)=>{},this.onUserInitiatedDockDone=(e,t,n,r,i)=>{},this.onAddonPlusHover=()=>{},this.onAddonPlusHoverOff=()=>{},this.onAddonPlusShown=()=>{},this.onAddonPlusHidden=()=>{},this.onContentProblem=e=>{},this.onSyncStarted=()=>{},this.onSyncDone=()=>{},this.onOpenFloorMaterials=()=>{},this.onOpenPartList=()=>{},this.onComponentLoadError=(e,t)=>{},this.onConfigurationLoadError=()=>{},this.onChangeTypeChangeTag=e=>{},this.onRemoveTypeChangeTag=e=>{},this.onConfigurationLabelChange=(e,t,n)=>{},this.onMemoryCorruption=()=>{},this.onConfiguratorKernelIsReady=(e,t)=>{},this.onConfigurationSaved=e=>{},this.onCameraPositionChanges=()=>{},this.onHistoryChange=(e,t)=>{}}});class x{constructor(){this._promiseExecutors=[]}create(){return new Promise((e,t)=>{this._promiseExecutors.push({resolve:e,reject:t})})}resolve(e){return new Promise(t=>{this._promiseExecutors.forEach(t=>t.resolve(e)),this._promiseExecutors=[],t(e)})}reject(e){return new Promise((t,n)=>{this._promiseExecutors.forEach(t=>t.reject(e)),this._promiseExecutors=[],n(e)})}}class I extends class{constructor(e){this._coreReference=e.clone()}clearReference(){this._coreReference.delete(),this._coreReference=null}getKernelObject(){return this._coreReference}}{constructor(e){super(e),this._objectWaiter=new x;const t=n(e.getCenter());this._container=new THREE.Object3D,this._container.position.copy(t),this._boundingBox=this._generateBoundingBox(this.getSize(),e.customColor),r(this._boundingBox),this._container.add(this._boundingBox),2!==this.getPlanElement().getType().value&&(this._object=new THREE.Object3D,this._container.add(this._object))}getSize(){return this._object?(new THREE.Box3).setFromObject(this._object).getSize(new THREE.Vector3):new THREE.Vector3}update(){this._container.position.copy(n(this.getPlanElement().getCenter()))}getPosition(){return this._container.position}getRotation(){return this._container.rotation.y}getBounds(){let e=new THREE.Box3;return e.setFromObject(this._container),e}getBoundingBox(){return this._boundingBox}getPlanElement(){return this._coreReference}setObject(e){this._object=e,this._objectWaiter.resolve(e)}getObject(){return this._object}async getObjectAsync(){return this._object?Promise.resolve(this._object):this._objectWaiter.create()}addMesh(e){this._object.add(e),this.hidePreviewBox()}getMesh(e){if(!this._object||0===this._object.children.length)return null;const t=i(e,this.getPlanElement().getType());return this._object.children.find(e=>e.userData.material===t)}getContainer(){return this._container}getId(){return this.getPlanElement().getId()}clear(){o(this._container),this._selectionMesh&&o(this._selectionMesh)}hidePreviewBox(){this._container&&this._boundingBox&&(this._boundingBox.material=a())}_generateBoundingBox(e,t){e.addScalar(.01);let n=new THREE.BoxGeometry(e.x,e.y,e.z),r=new THREE.Color(s);t>0&&(r=l(t));let i=new THREE.MeshStandardMaterial({color:r,opacity:c,transparent:!0}),o=new THREE.Mesh(n,i);return o.name="bounding box",o.position.y=e.y/2,o.castShadow=!1,o.receiveShadow=!1,o.layers.set(5),o}select(){if(!this._selectionMesh){let e=new THREE.MeshStandardMaterial({color:this._primaryColor,opacity:c,transparent:!0});const t=n(this.getPlanElement().getCenter());this._selectionMesh=new THREE.Mesh(d(t,this.getSize()),e)}this._container.add(this._selectionMesh)}deselect(){this._selectionMesh&&this._container.remove(this._selectionMesh)}setPrimaryColor(e){this._primaryColor=e}}class T extends I{constructor(e){super(e),this._container.rotation.y=e.rotation}getPlanObject(){return this.getPlanElement()}getSize(){return h(this.getPlanObject().size)}update(){super.update(),this._container.rotation.y=this.getPlanObject().rotation}}class k extends T{constructor(e){super(e),this._container.name="Configurable "+this._container.name}addRootComponent(e){this.setObject(e),this._container.add(this.getObject())}getConfigurationRuntimeId(){return this.getPlanObject().getConfigurationRuntimeId()}}e("d",k);let L=e("c",(()=>{class e extends T{constructor(e){super(e),this._container.name="Static "+this._container.name}setRapiItem(e){return this._rapiItem?Promise.resolve():this._addStaticItem(e)}_addStaticItem(e){this._rapiItem=e;let t=this.getPlanObject();this._glbUrl=O(e),this._glbUrl;let n=e.scaleable?h(t.size):void 0,i=new THREE.Vector3(1,1,1);return t.flipX&&(i.x*=-1),t.flipY&&(i.z*=-1),new Promise(o=>{this._staticItemLoader.loadGLB(this._glbUrl,void 0,void 0,n,i,t.customColor,e.colorable).then(t=>{t.name=e.label,this.setObject(t),p(t,this._glbUrl),r(t),this._container.add(this.getObject()),this.hidePreviewBox(),o()})})}getRapiItem(){return this._rapiItem}needsRapiItem(){return!this._glbUrl}getGLBUrl(){return this._glbUrl}}return u([_],e.prototype,"_staticItemLoader",void 0),e})());class D extends I{constructor(e){super(e),this._container.name="Wall Plan Element"}addMesh(e){super.addMesh(e);const t=(new THREE.Box3).setFromObject(this.getObject()).getSize(new THREE.Vector3);this._boundingBox.geometry=new THREE.BoxGeometry(t.x,t.y,t.z),this._boundingBox.position.y=t.y/2}}class S extends I{constructor(e){super(e),this._container.name="Floor Plan Element"}addMesh(e){super.addMesh(e),e.castShadow=!1;const t=(new THREE.Box3).setFromObject(this.getObject()).getSize(new THREE.Vector3);this._boundingBox.geometry=new THREE.BoxGeometry(t.x,.01,t.z)}}class B extends I{constructor(e){super(e),this._container.name="Ceiling Plan Element"}addMesh(e){super.addMesh(e),e.castShadow=!1;const t=(new THREE.Box3).setFromObject(this.getObject()).getSize(new THREE.Vector3);this._boundingBox.geometry=new THREE.BoxGeometry(t.x,.01,t.z)}}let V=e("P",(()=>{class e extends g{constructor(e){super(e,0),this._plannerKernelCallbackListener=new Set,b.addMeta("kernel_is_ready",{isWasm:this._useWASM}),this._scriptLoader.fetch(this._kernelPath,{id:"kernel"}).then(this._loadSuccess.bind(this),this._loadError.bind(this))}get kernelContainer(){return this._kernelContainer}_loadSuccess(){window.RoomleCore(this._kernelContainer)}_loadError(){console.error("kernel load error")}_createPlanInteractionHandler(){const e=this._kernelContainer;this._planInteractionHandler=new e.PlanInteractionHandler,this._planInteractionHandler.init(this._planInteractionHandler,1,100,!0,!0,e.DrawingType.CLICK_PER_CLICK),this._roomlePlannerUiCallback.onPlanInteractionHandlerCreated(this._planInteractionHandler)}addPlannerListener(e){this._plannerKernelCallbackListener.add(e)}removePlannerListener(e){this._plannerKernelCallbackListener.delete(e)}isReady(){super.isReady(),this.registerCallbacks(),this._roomlePlannerUiCallback.onPlannerKernelIsReady(this._kernelContainer),this._createPlanInteractionHandler();const e=this._planInteractionHandler.getConfiguratorKernel();this._kernelInstance=e,this._roomlePlannerUiCallback.onConfiguratorKernelIsReady(this._kernelContainer,e),m.isProduction||(window.__RML__DEBUG__.ConfiguratorKernel=this._kernelInstance,window.__RML__DEBUG__.PlannerKernelContainer=this._kernelContainer),this._kernelAccessCallback.isReady(),this._kernelInstance.useEnvironmentGeometry(!1)}get callbacks(){return this._roomlePlannerUiCallback}get planInteractionHandler(){return this._planInteractionHandler}get planModelViewHelper(){return this._kernelContainer.PlanModelViewHelper}catalogItemLoaded(e){const t=this._rapiItemToKernelItem(e);this._kernelContainer.catalogItemLoaded(t)}async insertItems(e){let t=new this._kernelContainer.CatalogItemPtrList;e.forEach(e=>{let n=e.count||1;for(let r=0;r<n;r++)e.count||(e.count=0),t.push_back(this._rapiItemToKernelItem(e))}),this._planInteractionHandler.addPlanObjects(t);const n=this._planInteractionHandler.getPlan().extRef.jsObject;await Promise.all(n.getStaticPlanObjectViewModels().map(async e=>{if(e.needsRapiItem()){const t=await this._rapiAccess.getItem(e.getPlanObject().getCatalogItemId());e.setRapiItem(t)}}))}_rapiItemToKernelItem(e){let t=new this._kernelContainer.CatalogItem(e.id),n=t.size;return n.x=e.width||0,n.y=e.depth||0,n.z=e.height||0,t.size=n,t.flipable=e.flipable,e.layer&&(t.layer=e.layer),t.orderable=e.orderable,t.scaleable=e.scaleable,t.type=e.type||"other",t.detailType=e.detailType||t.type||"other",t.configuration=e.configuration||"",t}onLoadComponentError(e,t){}configurationLoaded(e,t,n,r,i){}componentDefinitionLoaded(e,t){}componentDefinitionLoadingError(e,t){}configurationLoadingError(){}componentConfigurationUpdated(e){}componentParameters(){}requestComponentDimensions(){}planObjectCreated(e,t){}planObjectUpdated(e){}planObjectConfigurationUpdated(e,t,n){}planObjectDeleted(){}requestPlanObjectDimensions(){}cleanUpCallbacks(){super.cleanUpCallbacks(),this._kernelContainer.unregisterPlannerCallback(this)}registerCallbacks(){super.registerCallbacks(),this._kernelContainer.registerPlannerCallback(this)}async requestExternalMesh(e,t){let n;try{n=await this._rapiAccess.getMesh(e,E,t)}catch(e){throw console.error(e),e}try{const r=await fetch(new Request(this._dataSyncer.requestAsset(n.url,!0))),i=await r.arrayBuffer();await this._handleCortoMesh(i,e,t)}catch(e){throw console.error(e),e}}Editor3dRootComponentCreated(e,t,n,r){this._configuratorKernelCallbackListener.forEach(i=>i.Editor3dComponentCreated(e,t,n,r,!0))}Editor3dPlanObjectConstructionDone(e){}Editor3dBeginGroup(){}Editor3dEndGroup(){}Editor3dSetMaterial(){}Editor3dLoadMaterial(){}Editor3dAddDockPreview(e,t){}Editor3dSetPreviewPointAssociations(e,t){}Editor3dSetPreviewLineAssociations(e,t){}Editor3dPreviewConstructionDone(e,t){}Editor3dTranslateBy(){}Editor3dRotateBy(){}Editor3dRotateAround(){}Editor3dAddCube(){}Editor3dAddCubeUVMod(){}Editor3dAddSphere(){}Editor3dAddSphereUVMod(){}Editor3dAddRectangle(){}Editor3dAddRectangleUVMod(){}Editor3dAddMesh(){}Editor3dAddMeshUVMod(){}Editor3dAddMeshUVCoord(){}Editor3dAddCylinder(){}Editor3dAddCylinderUVMod(){}Editor3dAddPrism(){}Editor3dAddPrismUVMod(){}Editor3dAddFittingPoint(){}Editor3dAddFittingLine(){}Editor3dSelectObject(){}Editor3dCopy(){}Editor3dUpdatePlanObjectPosition(){}Editor3dUpdatePlanObjectRotation(){}Editor3dUpdatePlanObjectTransform(){}Editor3dUpdatePlanComponentPosition(){}Editor3dUpdatePlanComponentRotation(){}Editor3dUpdatePlanComponentTransform(){}planElementRemoved(e){this._plannerKernelCallbackListener.forEach(t=>t.planElementRemoved(e)),this._plannerKernelCallbackListener.forEach(t=>t.removePlanObjectFromScene(e.extRef.jsObject)),this._decoupleReferences(e)}handlerSwitchedPlans(e,t){if(this._decoupleReferences(e),t){let e=new U(this._creator_);e.setReference(t),this._coupleReferences(e,t),this._plannerKernelCallbackListener.forEach(t=>t.handlerSwitchedPlans(e))}}planBoundsChanged(){this._plannerKernelCallbackListener.forEach(e=>e.planBoundsChanged())}planCleared(){}planCompletelyLoaded(e){this._plannerKernelCallbackListener.forEach(t=>t.planCompletelyLoaded(e))}planElement3dMeshChanged(e,t){if(t.extRef){const e=t.extRef.jsObject;for(let t=e.getObject().children.length-1;t>=0;t--)e.getObject().remove(e.getObject().children[t])}this.planModelViewHelper.requestMesh3d(t)}planElementAdded(e,t){if(e&&e.extRef)if(t.getType()===this._kernelContainer.PlanElementType.OBJECT){let n,r=t;if(r.hasConfiguration())n=new k(r),this._coupleReferences(n,r),e.extRef.jsObject.addPlanElementViewModel(n);else{n=new L(r),this._coupleReferences(n,r),e.extRef.jsObject.addPlanElementViewModel(n);const i=t.getCatalogItemId();i&&this._rapiAccess.getItem(i).then(e=>{n.setRapiItem(e)})}this._plannerKernelCallbackListener.forEach(e=>e.addPlanObjectToScene(n))}else{let n,r=t;if(t.getType()===this._kernelContainer.PlanElementType.WALL?n=new D(r):t.getType()===this._kernelContainer.PlanElementType.FLOOR?n=new S(r):t.getType()===this._kernelContainer.PlanElementType.CEILING&&(n=new B(r)),!n)return;n.setPrimaryColor(this._initData.colors.PRIMARY),this._coupleReferences(n,r),e.extRef.jsObject.addPlanElementViewModel(n),this.planModelViewHelper.requestMesh3d(t)}}planElementChanged(e,t){if(t.extRef){let n=t.extRef.jsObject;n.update(),this._plannerKernelCallbackListener.forEach(t=>t.planElementChanged(e,n))}}planHistoryStateChanged(){this.planInteractionHandler&&this._roomlePlannerUiCallback.onHistoryChange(this.planInteractionHandler.isUndoPossible(),this.planInteractionHandler.isRedoPossible())}planObjectConfigurationCreated(e,t){}planObjectConfigurationLoaded(e,t,n){e&&e.extRef&&t&&t.extRef&&t.extRef.jsObject.getPlanObject().getConfigurationRuntimeId()>0&&this._plannerKernelCallbackListener.forEach(r=>r.planObjectConfigurationLoaded(e,t,n))}requestCatalogItem(e){}startedDrawing(){}stoppedDrawing(){}updateMesh2d(){}beginConstruction(){}addMesh(e,t,n,r,i,o){this._plannerKernelCallbackListener.forEach(a=>a.addMesh(e,t,n,r,i,o))}endConstruction(){}beginPlanConstruction(e){this._plannerKernelCallbackListener.forEach(t=>t.beginPlanConstruction(e))}addPlanMesh(e,t,n,r,i,o,a){this._plannerKernelCallbackListener.forEach(s=>s.addPlanMesh(e,t,n,r,i,o,a))}endPlanConstruction(e){this._plannerKernelCallbackListener.forEach(t=>t.endPlanConstruction(e))}addPlanObjectFromItem(e,t,n){if(!t&&!n)return this.insertItems([e]);n=n||0===n?n:0,t=t||{x:0,y:0,z:0};const r=this._rapiItemToKernelItem(e);return this._planInteractionHandler.addPlanObjectFromItem(r,t,n)}_coupleReferences(e,t){let n=new this._kernelContainer.EMSReference;n.jsObject=e,t.extRef=n}_decoupleReferences(e){e&&e.extRef&&(e.extRef.jsObject.clearReference(),e.extRef.jsObject=null,e.extRef.delete(),e.extRef=null)}}return u([_],e.prototype,"_kernelAccessCallback",void 0),u([_],e.prototype,"_roomlePlannerUiCallback",void 0),u([_],e.prototype,"_initData",void 0),e})()),U=(()=>{class e extends f{constructor(e){super(e),this._configurablePlanObjectViewModels=[],this._staticPlanObjectViewModels=[],this._constructionGroup=new THREE.Group,this._constructionGroup.name="Construction",this._ceilingGroup=new THREE.Group,this._getKernelAccess().addPlannerListener(this)}planBoundsChanged(){}_getKernelAccess(){return C.lookup("planner-kernel-access",this._creator_)}setReference(e){this._coreReference=e.clone()}clearReference(){this._coreReference.delete(),this._coreReference=null,super.clearReference()}getCorePlan(){return this._coreReference}addPlanElementViewModel(e){e instanceof k?this._configurablePlanObjectViewModels.push(e):e instanceof L?(this._staticPlanObjectViewModels.push(e),"door"!==e.getPlanObject().getObjectType()&&"window"!==e.getPlanObject().getObjectType()&&this._initData.edit&&this._plannerSceneEventHandler.addPlanObjectHandlers(e)):e instanceof D?(this._initData.edit&&this._plannerSceneEventHandler.addWallHandlers(e),this._constructionGroup.add(e.getContainer())):(e instanceof S||e instanceof B)&&this._constructionGroup.add(e.getContainer())}_addRootComponent(e){const t=this._getPlanObjectViewModelForRuntimeId(e.parentObjectId);t&&t instanceof k&&(t.addRootComponent(e),this._initData.edit&&this._plannerSceneEventHandler.addPlanObjectHandlers(t),t.hidePreviewBox())}_getPlanObjectViewModelForRuntimeId(e){let t=null;return this._configurablePlanObjectViewModels.forEach(n=>{e===n.getConfigurationRuntimeId()&&(t=n)}),t}getPlanObjectForId(e){let t=null;return this._configurablePlanObjectViewModels.forEach(n=>{e===n.getId()&&(t=n)}),this._staticPlanObjectViewModels.forEach(n=>{e===n.getId()&&(t=n)}),t}getConstructionGroup(){return this._constructionGroup}getCeilingGroup(){return this._ceilingGroup}getBoundingBox(){const e=this.getCorePlan();return e?y(e.getBounds()):(new THREE.Box3).setFromObject(this._constructionGroup)}setPlannerSceneEventHandler(e){this._plannerSceneEventHandler=e}sceneCleared(){this._configurablePlanObjectViewModels.forEach(e=>{e.clear()}),this._staticPlanObjectViewModels.forEach(e=>{e.clear()}),super.sceneCleared()}getStaticPlanObjectViewModels(){return this._staticPlanObjectViewModels}getComponent(e){return this._components.get(e)}_generateMesh(e=0,t=null,n,r,i,o,a,s,l){return this._plannerMeshGenerator.generateMesh(t,n,r,i,o,a,s,l)}_setMaterial(e,t,n){this._plannerMeshGenerator.setMaterial(e,t)}Editor3dComponentCreated(e,t,n,r,i){super.Editor3dComponentCreated(e,t,n,r,i),this._getKernelAccess()instanceof V&&this.dockComponent(e,r,t,n)}addPlanObjectToScene(e){}handlerSwitchedPlans(e){this._constructionGroup.clear(),this._ceilingGroup.clear()}planCompletelyLoaded(e){}beginPlanConstruction(e){}addPlanMesh(e,t,n,r,i,o,a){}endPlanConstruction(e){}planElementChanged(e,t){}planObjectConfigurationLoaded(e,t,n){}addMesh(e,t,n,r,i,o){const a=e.extRef.jsObject;let s=a.getMesh(t);s?s.geometry=this._plannerMeshGenerator.generateGeometry(null,n,r,i,o):(s=this._generateMesh(0,null,t,n,r,i,o,e.getType()),a.addMesh(s))}removePlanObjectFromScene(e){}planElementRemoved(e){if(e.getType()===this._getKernelAccess().kernelContainer.PlanElementType.OBJECT){let t=e;if(t.hasConfiguration()){const e=t.extRef.jsObject,n=this._configurablePlanObjectViewModels.indexOf(e);n>-1&&this._configurablePlanObjectViewModels.splice(n,1)}else{const e=t.extRef.jsObject,n=this._staticPlanObjectViewModels.indexOf(e);n>-1&&this._staticPlanObjectViewModels.splice(n,1)}}}getMeshGenerator(){return this._plannerMeshGenerator}}return u([_],e.prototype,"_plannerMeshGenerator",void 0),e})();const A=j(30);class G extends H{constructor(e,t,n,r){super(),this._offset=new THREE.Vector3(0,0,0),this._mode=void 0===r?1:r,this._scene=e,this._camera=t,this._raycaster=new THREE.Raycaster,this._raycaster.layers.enableAll(),this._inputManager=n,this._addInputListeners(n),this._planeBottom=new THREE.Plane(new THREE.Vector3(0,1,0)),this._planeFront=new THREE.Plane(new THREE.Vector3(0,0,1)),this._planeSide=new THREE.Plane(new THREE.Vector3(1,0,0))}setLayers(e){this._raycaster.layers=e}_addInputListeners(e){e.addEventListener(3,e=>{this._findCandidate(e.positionRelative)},this),e.addEventListener(5,e=>{this._findSelection(e.positionRelative)},this),e.addEventListener(6,e=>{this._findHover(e.positionRelative,e.type)},this),e.addEventListener(0,e=>{this._onDragStart(e.positionRelative)},this),e.addEventListener(1,e=>{this._onDrag(e.positionRelative)},this),e.addEventListener(2,e=>{this._onDragEnd(e.positionRelative)},this),e.addEventListener(9,e=>{this._onRotate(e.positionRelative,e.rotation)},this),e.addEventListener(10,()=>{this._currentRotate=null},this)}_findCandidate(e){this._intersection(e)&&this._inputManager.onElementHit()}_findSelection(e){let t=this._intersection(e);t?t&&t.object.dispatchEvent({type:"select"}):this.dispatchEvent(3)}_findHover(e,t){const n=this._intersection(e);!n&&this._currentHover?(this._currentHover.dispatchEvent({type:"hover_off",attachment:{type:t}}),this._currentHover=null):n&&(this._currentHover&&this._currentHover.id!==n.object.id&&(this._currentHover.dispatchEvent({type:"hover_off",attachment:{type:t}}),this._currentHover=null),this._currentHover?this._currentHover.dispatchEvent({type:"hover_move",attachment:{intersection:n,type:t}}):(this._currentHover=n.object,this._currentHover.dispatchEvent({type:"hover_on",attachment:{intersection:n,type:t}})))}_intersection(e){const t=this._intersect(e);if(t.length<=0)return null;let n=t[0];return t.length>1&&this._currentHover&&this._currentDrag&&this._currentDrag.id!==this._currentHover.id&&t.forEach(e=>{e.object.id===this._currentHover.id&&e.object.userData.priority===this._currentHover.userData.priority&&n.object.userData.priority<=e.object.userData.priority&&(n=e)}),n}_intersect(e){this._raycaster.setFromCamera(e,this._camera);const t=[];return this._raycaster.intersectObjects(this._scene.children,!0).forEach(e=>{const n=this._findObjectWithHandler(e.object);n&&(e.object=n,t.push(e))}),t.length>=0?t.sort((e,t)=>e.object.userData.priority!==t.object.userData.priority?t.object.userData.priority-e.object.userData.priority:e.distance-t.distance):[]}_findObjectWithHandler(e){return e.userData.hasListener?e:e.parent?this._findObjectWithHandler(e.parent):null}_onDragStart(e){let t=this._intersection(e);if(!t&&!this._currentDrag)return;if(t&&t.object.userData.roomleId===this._rootComponentId)return;!this._currentDrag&&t&&(this._currentDrag=t.object,this._currentDrag.dispatchEvent({type:"drag_start"}));let n=this._currentDrag.parent;n&&n.computeBoundingBox&&(n.computeBoundingBox(),this._calculateOffset(n)),this._positionPlanes(n)}_onDrag(e){if(!this._currentDrag)return;this._raycaster.setFromCamera(e,this._camera);let t,n=new THREE.Vector3(0,0,-5);if(this._raycaster.ray.intersectPlane(this._planeBottom,n),0===this._mode){const e=this._scene.children.find(({type:e,name:t})=>"Group"===e&&"Construction"===t);if(e){const t=this._raycaster.intersectObjects(e.children,!0);if(t.length){const e=t[0].point.clone();return void this._currentDrag.dispatchEvent({type:"drag",attachment:{position:e}})}}t=n.clone(),t.y=this._currentDrag.parent.position.y}else t=this._getIntersectionPosition(n),t.sub(this._offset);this._currentDrag.dispatchEvent({type:"drag",attachment:{position:t}})}_getIntersectionPosition(e){let t=this._getDistanceToCamera(e),n=this._camera.userData.yaw,r=new THREE.Vector3(0,0,0),i=new THREE.Vector3(0,0,0);this._raycaster.ray.intersectPlane(this._planeFront,r),this._raycaster.ray.intersectPlane(this._planeSide,i);let o,a=this._getDistanceToCamera(i),s=this._getDistanceToCamera(r);return n>=-A&&n<=A?o=t<s?e.clone():r.clone():t<s&&t<a?o=e.clone():s<t&&s<a?o=r.clone():a<t&&a<s&&(o=i.clone()),o}_getDistanceToCamera(e){let t=e.clone().sub(this._camera.position).length();return P(e)&&(t=Number.POSITIVE_INFINITY),t}_onDragEnd(e){this._currentDrag&&(this._currentDrag.dispatchEvent({type:"drag_end",attachment:{position:e}}),this._currentDrag=null)}_onRotate(e,t){if(!this._currentRotate){let t=this._intersection(e);if(!t)return;this._currentRotate=t.object}this._currentRotate.dispatchEvent({type:"rotate",attachment:{rotation:t}})}_positionPlanes(e){0===this._mode?(this._planeBottom.constant=0,this._camera.userData&&this._camera.userData.pitch&&this._camera.userData.pitch<0&&(this._planeBottom.constant=-3)):e&&e.boundingBox&&this._rootComponentPosition&&(this._planeBottom.constant=-e.boundingBox.getCenter(new THREE.Vector3).y-this._rootComponentPosition.y,this._planeSide.constant=2*-e.boundingBox.getSize(new THREE.Vector3).x+e.boundingBox.getCenter(new THREE.Vector3).x,this._camera.userData.yaw>0&&(this._planeSide.constant*=-1),this._bounds&&(this._planeFront.constant=this._bounds.z/2+e.boundingBox.getCenter(new THREE.Vector3).z))}_calculateOffset(e){e&&e.boundingBox&&(this._offset.copy(e.boundingBox.getCenter(new THREE.Vector3)),this._offset.applyQuaternion(e.getWorldQuaternion(new THREE.Quaternion)))}update(e,t,n){if(e&&(this._bounds=e),t&&(this._rootComponentPosition=t),n){this._backgroundScene=n;let e=this._backgroundScene.children[0];e instanceof THREE.Mesh&&e.geometry.computeBoundingBox()}}clear(){this._currentDrag&&R(this._currentDrag),this._currentHover&&R(this._currentHover)}enableDragIn(e){this._currentDrag=e}setRootComponentId(e){this._rootComponentId=e}setCamera(e){this._camera=e}setScene(e){this._scene=e}setMode(e){this._mode=e}}e("S",class extends H{constructor(e,t,n,r){super(),this._debug=!1,this._dragIn=!1,this._inputManager=r,this._raycastHelper=new G(t,n,this._inputManager),this._creator_=e}isDragIn(){return this._dragIn}setDragIn(e,t){this._dragIn=e,e?this._inputManager.enableDragIn(t):this._raycastHelper.clear(),this._interaction()}});class K extends M{constructor(e,t){super(e,t),this._params={ambientLight:{color:"#ffffff"}},this._ambientLight=new THREE.AmbientLight(new THREE.Color(this._params.ambientLight.color),1.2),this._ambientLight.layers.set(1),this.addToScene()}needsBounds(){return!1}addToScene(){this._scene.add(this._ambientLight)}removeFromScene(){this._scene.remove(this._ambientLight)}reload(){this.removeFromScene(),this.addToScene()}showGUI(){let e=w();if(e&&this._ambientLight){let t=e.addFolder("Ambient Light");t.add(this._ambientLight,"visible"),t.add(this._ambientLight,"intensity").min(0).max(5).step(.1),t.addColor(this._params.ambientLight,"color").onChange(e=>this._ambientLight.color=new THREE.Color(e))}}}let z=null;const F=()=>(z||(z=new THREE.WebGLRenderer({antialias:!0,alpha:!0}),z.outputEncoding=THREE.sRGBEncoding),z.autoClear=!0,z),W=(e("g",(e,t=0)=>{if(!e){const e=new THREE.Vector3;return{center:e,bounds:e,diagonal:0}}const n=e.getSize(new THREE.Vector3);return n.addScalar(t),{center:e.getCenter(new THREE.Vector3),bounds:n,diagonal:Math.sqrt(Math.pow(n.x,2)+Math.pow(n.y,2)+Math.pow(n.z,2))}}),e("a",(e,t,n,r,i={})=>new Promise(o=>{const{size:a=1024,showDimensions:s}=i,l=F();l.setSize(a,a);const c=e.fog?e.fog.clone():null,d=e.background?e.background.clone():null;e.background=null,e.fog=null;let h=new v(e);n.layers.disable(2),n.layers.disable(5),s?n.layers.enable(7):n.layers.disable(7),W(n,r,-20,-30),l.render(e,n),t&&(l.autoClear=!1,l.clearDepth(),l.render(t,n));const u=l.domElement.toDataURL();n.layers.enable(2),e.background=d,e.fog=c,h.removeFromScene(),o({image:u,width:a,height:a,blob:null})})),e("r",(e,t,n,r,i,o)=>new Promise(r=>{o||(o=1024);const i=F();i.setSize(o,o);const a=e.fog?e.fog.clone():null,s=e.background?e.background.clone():null;e.background=null,e.fog=null,t.layers.disable(2),t.layers.disable(5),n?W(t,n,-20,-30):(t.aspect=1,t.updateProjectionMatrix()),i.render(e,t);const l=i.domElement.toDataURL();t.layers.enable(2),e.background=s,e.fog=a,r({image:l,width:o,height:o,blob:null})})),e("p",(e,t,n,r)=>{e.far=1e3,e.fov=15,e.aspect=1,e.position.copy(t.center),e.rotation.set(0,0,0),e.rotateY(j(r)),e.rotateX(j(n)),e.translateZ(3.8*t.diagonal),e.updateProjectionMatrix()}));e("b",(e,t,n,r={})=>{const{showDimensions:i=!1}=r;return new Promise(r=>{const o=F();o.autoClear=!1;let a=new THREE.OrthographicCamera(-n.bounds.x/2,n.bounds.x/2,n.bounds.z/2,-n.bounds.z/2,.5);a.position.copy(n.center),a.rotateX(j(-90)),a.translateZ(n.bounds.y+1),a.far=a.position.y+.5,a.layers.mask=65535;let s=200*n.bounds.x,l=200*n.bounds.z;if(s>4096||l>4096){let e=0;s>4096?e=s/4096:l>4096&&(e=l/4096),s/=e,l/=e}o.setSize(s,l);let c=e.fog?e.fog.clone():null,d=e.background?e.background.clone():null;e.background=null,e.fog=null;let h=i?new K(e):new v(e);a.layers.disable(2),a.layers.disable(5),i?a.layers.enable(7):a.layers.disable(7),o.render(e,a),t&&(o.clearDepth(),o.render(t,a));let u=o.domElement.toDataURL();a.layers.enable(2),a.layers.enable(5),e.background=d,e.fog=c,h.removeFromScene(),r({image:u,width:s,height:l,blob:null})})})}}}));
|
|
2
|
+
//# sourceMappingURL=image-renderer-6df9eca6.legacy.js.map
|
package/lib/legacy/{image-renderer-0f532f9c.legacy.js.map → image-renderer-6df9eca6.legacy.js.map}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"image-renderer-
|
|
1
|
+
{"version":3,"file":"image-renderer-6df9eca6.legacy.js","sources":["../../../node_modules/three/examples/js/exporters/GLTFExporter.js"],"sourcesContent":["export default \"static/GLTFExporter-86edae059df3a219.js\""],"names":[],"mappings":"ygBAAe"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
System.register([],(function(e){return{execute:function(){e("R",{PRIMARY:"#db0000",ON_PRIMARY:"#ffffff",DEFAULT_BACKGROUND:"#f7f7f7",SELECTION:"#ffffff"}),e("s",e=>{document.body.style.cursor=e}),e("h",e=>{const t=e.headers.get("content-type");if(t&&t.includes("application/json"))return e.json();throw new TypeError("No JSON returned")}),e("g",()=>window.__RML__ENV__&&window.__RML__ENV__.assetPath?window.__RML__ENV__.assetPath:"");const t=e("u",(e=null)=>e?(parseInt(e,10)^16*Math.random()>>parseInt(e,10)/4).toString(16):(1e7.toString()+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g,t)),s=(e("e",(e,t,r)=>{s(e,t,{writable:r})}),e("c",(e,t,s)=>{const r=Object.getOwnPropertyDescriptor(e,t);for(let e in s)s.hasOwnProperty(e)&&(r[e]=s[e]);Object.defineProperty(e,t,r)})),r=(e("j",e=>({id:e,name:e,externalIdentifier:"test-identifier",group:"test-group",groupLabel:"test-group-label",color:"#"+new THREE.Color(.5,.5,.5).getHexString(),thumbnail:r(e,15),label:"test-label",textures:[1,2,3],shading:{alpha:1,metallic:.5,basecolor:{r:.5,g:.5,b:.5},roughness:.5,doubleSided:!1,alphaCutoff:.5},active:!0,tags:[]})),e("k",e=>{const t=e.split("_"),s=parseInt(t[1],10);return{mapping:"RGB",id:e,material:e,image:r(e),url:r(e),height:s,width:s,mmHeight:1,mmWidth:1,tileable:!0}}),(e,t)=>{const s=e.split("_");return t||(t=parseInt(s[1],10)),"https://loremflickr.com/"+t+"/"+t+"?lock="+Math.abs(parseFloat(s[2]))}),n=(e("m",e=>"string"==typeof e||e instanceof String),e("o",(e,t)=>e.reduce((e,s)=>{if("object"!=typeof s)return console.warn("objectArrayToMap only works for arrays of objects"),e;const r=s[t];return r?(e.has(r)||e.set(r,s),e):(console.warn('Object has no key "'+t+'" therefore we do not know where to put it'),e)},new Map)),e("t",(e,t=16)=>{let s,r=!1,n=0,o=null;return function(...a){s||(s=Date.now()),!r||s+t-Date.now()<0?(e.apply(this,[...arguments]),s=Date.now(),r=!0):n++,o||(o=setInterval(()=>{n&&e.apply(this,[...arguments]),n=0,clearInterval(o),o=null},t))}}),e("d",(e,t)=>{let s;return(...r)=>{clearTimeout(s),s=setTimeout(()=>{e(...r)},t)}}),e("w",async e=>new Promise(t=>setTimeout(t,e))),new RegExp(/\/3d\/[0-9]+\//)),o=(e("f",e=>{var t;if(null===(t=e.assets.glb)||void 0===t?void 0:t.url)return e.assets.glb.url;if(e.threeDimensionalAsset)return e.threeDimensionalAsset;const s=e.threeDimensionalAssetWeb;return s.match(n)?s.replace(n,"/3d/glb/").replace(".flash.u3d",".glb"):s}),e("b",(e,t)=>{for(const s in t)try{t[s].constructor===Object?e[s]=o(e[s],t[s]):e[s]=t[s]}catch(r){e[s]=t[s]}return e}));e("a",(e,t)=>void 0===e?t:e),e("r",(e,t)=>{const s=e.indexOf(t);s>-1&&e.splice(s,1)}),e("l",e=>e?JSON.parse(JSON.stringify(e)):e),e("i",()=>{const e=document.createElement("canvas");return!!e&&!!e.getContext("webgl2")});let a=0;e("M",class extends class{constructor(e,t){this._callbacks=e,this.eventListener=t,this.eventListener.addEventListener("message",this,!1)}get eventPoster(){return this._eventPoster&&this._eventPoster.postMessage?this._eventPoster:this.eventListener&&this.eventListener.postMessage?this.eventListener:{postMessage:()=>{}}}hasEventPoster(){return!!this._eventPoster}nextConversationId(){return a++}setEventPoster(e){this._eventPoster=e}handleEvent(e){if(!e||!e.data)return;const[t,s,r]=JSON.parse(e.data);if(!t||0!==t.indexOf("rml"))return;const[n,o]=t.split("."),a=parseInt(o,10);this._callbacks.onCommand(a,parseInt(s,10),r)}}{constructor(e,t){super(e,t),this._promiseCallbacks=new Map}sendToWorker(e,t=null,s,r){const n=this.nextConversationId(),o=()=>!1;!s&&r&&(s=o),s&&!r&&(r=o),s&&r&&this._promiseCallbacks.set(n,{resolve:s,reject:r}),this.eventPoster.postMessage(JSON.stringify(["rml."+e,n,t]))}resolvePromises(e,t){const s=this._promiseCallbacks.get(e);s&&(s.resolve.apply(s,[t]),this._promiseCallbacks.delete(e))}})}}}));
|
|
2
|
-
//# sourceMappingURL=main-thread-to-worker-
|
|
1
|
+
System.register([],(function(e){return{execute:function(){e("R",{PRIMARY:"#db0000",ON_PRIMARY:"#ffffff",DEFAULT_BACKGROUND:"#f7f7f7",SELECTION:"#ffffff"}),e("s",e=>{document.body.style.cursor=e}),e("h",e=>{const t=e.headers.get("content-type");if(t&&t.includes("application/json"))return e.json();throw new TypeError("No JSON returned")}),e("g",()=>window.__RML__ENV__&&window.__RML__ENV__.assetPath?window.__RML__ENV__.assetPath:"");const t=e("u",(e=null)=>e?(parseInt(e,10)^16*Math.random()>>parseInt(e,10)/4).toString(16):(1e7.toString()+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g,t)),s=(e("e",(e,t,r)=>{s(e,t,{writable:r})}),e("c",(e,t,s)=>{const r=Object.getOwnPropertyDescriptor(e,t);for(let e in s)s.hasOwnProperty(e)&&(r[e]=s[e]);Object.defineProperty(e,t,r)})),r=(e("j",e=>({id:e,name:e,externalIdentifier:"test-identifier",group:"test-group",groupLabel:"test-group-label",color:"#"+new THREE.Color(.5,.5,.5).getHexString(),thumbnail:r(e,15),label:"test-label",textures:[1,2,3],shading:{alpha:1,metallic:.5,basecolor:{r:.5,g:.5,b:.5},roughness:.5,doubleSided:!1,alphaCutoff:.5},active:!0,tags:[]})),e("k",e=>{const t=e.split("_"),s=parseInt(t[1],10);return{mapping:"RGB",id:e,material:e,image:r(e),url:r(e),height:s,width:s,mmHeight:1,mmWidth:1,tileable:!0}}),(e,t)=>{const s=e.split("_");return t||(t=parseInt(s[1],10)),"https://loremflickr.com/"+t+"/"+t+"?lock="+Math.abs(parseFloat(s[2]))}),n=(e("m",e=>"string"==typeof e||e instanceof String),e("o",(e,t)=>e.reduce((e,s)=>{if("object"!=typeof s)return console.warn("objectArrayToMap only works for arrays of objects"),e;const r=s[t];return r?(e.has(r)||e.set(r,s),e):(console.warn('Object has no key "'+t+'" therefore we do not know where to put it'),e)},new Map)),e("t",(e,t=16)=>{let s,r=!1,n=0,o=null;return function(...a){s||(s=Date.now()),!r||s+t-Date.now()<0?(e.apply(this,[...arguments]),s=Date.now(),r=!0):n++,o||(o=setInterval(()=>{n&&e.apply(this,[...arguments]),n=0,clearInterval(o),o=null},t))}}),e("d",(e,t)=>{let s;return(...r)=>{clearTimeout(s),s=setTimeout(()=>{e(...r)},t)}}),e("w",async e=>new Promise(t=>setTimeout(t,e))),new RegExp(/\/3d\/[0-9]+\//)),o=(e("f",e=>{var t;if(null===(t=e.assets.glb)||void 0===t?void 0:t.url)return e.assets.glb.url;if(e.threeDimensionalAsset)return e.threeDimensionalAsset;const s=e.threeDimensionalAssetWeb;return s&&"string"==typeof s?s.match(n)?s.replace(n,"/3d/glb/").replace(".flash.u3d",".glb"):s:null}),e("b",(e,t)=>{for(const s in t)try{t[s].constructor===Object?e[s]=o(e[s],t[s]):e[s]=t[s]}catch(r){e[s]=t[s]}return e}));e("a",(e,t)=>void 0===e?t:e),e("r",(e,t)=>{const s=e.indexOf(t);s>-1&&e.splice(s,1)}),e("l",e=>e?JSON.parse(JSON.stringify(e)):e),e("i",()=>{const e=document.createElement("canvas");return!!e&&!!e.getContext("webgl2")});let a=0;e("M",class extends class{constructor(e,t){this._callbacks=e,this.eventListener=t,this.eventListener.addEventListener("message",this,!1)}get eventPoster(){return this._eventPoster&&this._eventPoster.postMessage?this._eventPoster:this.eventListener&&this.eventListener.postMessage?this.eventListener:{postMessage:()=>{}}}hasEventPoster(){return!!this._eventPoster}nextConversationId(){return a++}setEventPoster(e){this._eventPoster=e}handleEvent(e){if(!e||!e.data)return;const[t,s,r]=JSON.parse(e.data);if(!t||0!==t.indexOf("rml"))return;const[n,o]=t.split("."),a=parseInt(o,10);this._callbacks.onCommand(a,parseInt(s,10),r)}}{constructor(e,t){super(e,t),this._promiseCallbacks=new Map}sendToWorker(e,t=null,s,r){const n=this.nextConversationId(),o=()=>!1;!s&&r&&(s=o),s&&!r&&(r=o),s&&r&&this._promiseCallbacks.set(n,{resolve:s,reject:r}),this.eventPoster.postMessage(JSON.stringify(["rml."+e,n,t]))}resolvePromises(e,t){const s=this._promiseCallbacks.get(e);s&&(s.resolve.apply(s,[t]),this._promiseCallbacks.delete(e))}})}}}));
|
|
2
|
+
//# sourceMappingURL=main-thread-to-worker-4c02f179.legacy.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"main-thread-to-worker-4c02f179.legacy.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
package/lib/legacy/{material-viewer-41e5c677.legacy.js → material-viewer-e83460de.legacy.js}
RENAMED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
System.register(["./query-params-helper-8c00a872.legacy.js","./rapi-access-ef758fca.legacy.js","./main-thread-to-worker-880d5b78.legacy.js","./pixotron-cd4cd438.legacy.js","./mesh-generator-4f2f2ec7.legacy.js","./configurator-mesh-generator-d604f05c.legacy.js","./scene-manager-afd27798.legacy.js"],(function(e){var t,a,i,r,s,n,o,h,l,m,_,d,c,g,p,u,M,w,y,f,C,S,E,P,v,x,T,R,b;return{setters:[function(){},function(e){t=e._,a=e.i,i=e.d,r=e.f,s=e.P,n=e.K,o=e.ab,h=e.ac,l=e.h,m=e.ad,_=e.N,d=e.G,c=e.U,g=e.n,p=e.L,u=e.ae,M=e.o,w=e.s},function(){},function(e){y=e.a,f=e.C,C=e.F,S=e.T,E=e.e,P=e.g,v=e.S,x=e.I,T=e.M},function(){},function(e){R=e.C},function(e){b=e.S}],execute:function(){let G=(()=>{class e extends b{constructor(e,t){super(e,t,i.RMV,"3D",!1),this._sceneParams={type:"cube"},this._materialParams={color:"#ffffff",metallic:.5,alpha:0,alphaCutoff:0,doubleSided:!1},this._renderer.capabilities.maxTextures>8&&this.loadDynamicLightSetting(r.createDynamicLightSettingSource(null,s.CAMERA)),this._initScene()}_initScene(){const e=new THREE.BoxGeometry(1,1,1,100,100,100),t=new THREE.MeshPhysicalMaterial({color:this._initData.colors.PRIMARY});this._environmentLoader.setEnvMap(t),this._setMaterial(t),this._mesh=new THREE.Mesh(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 y(this._scene,null,new THREE.Color(16777215)),this._cameraControl instanceof f){const e=new THREE.Box3;e.setFromObject(this._mesh),this._cameraControl.updateAndReset(e.getSize(new THREE.Vector3),e.getCenter(new THREE.Vector3))}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._setMaterial(n(e,this._environmentLoader)),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(o(this._material,a,this._environmentLoader)),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===THREE.DoubleSide,this._materialParams.metallic=1===e.metalness?1:e.reflectivity}getMaterialShading(){return h(this._material)}createCameraControl(e){this._cameraControl=new f(this._creator_,this._getInputManager(),new THREE.Vector3(-1,1,1))}_getInputManager(){return this._inputManager}sceneChanged(){}getPixotronParams(){return{saoparams:{intensity:.25,occlusionWorldRadius:.6,smoothTransition:!0,samplesPerFrame:4,bias:.02,numSamples:200,accumulative:!0},shadowparams:{shadowMapResolution:1024,shadowRadius:1,shadowQuality:1,smoothTransition:!0,enableAccumulation:!0,shadowBiasMultiplier:.05,nearPlane:.01,farPlane:50,fov:40,numSamples:50,side:THREE.FrontSide}}}getBakedShadowParams(){return{enable:!1,smoothTransition:!0,numSamples:500,numSamplesPerFrame:4}}getBounds(){return this._mesh?(new THREE.Box3).setFromObject(this._mesh):null}_guiLoaded(){this._updateGUI()}_updateGUI(){let e=l();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 THREE.Color(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?THREE.DoubleSide:THREE.FrontSide,this._shadingChanged()})),this._addGUIListener(e))}_shadingChanged(){this._roomleMaterialViewerUiCallback.onMaterialShadingChanged(h(this._material))}setGeometry(e){this._sceneParams.type=e,this._setGeometry()}_setGeometry(){let e;"cube"===this._sceneParams.type&&(e=new THREE.BoxGeometry(1,1,1,100,100,100)),"sphere"===this._sceneParams.type&&(e=new THREE.SphereGeometry(.5,100,100)),"plane_horizontal"===this._sceneParams.type&&(e=new THREE.PlaneGeometry(1,1),e.rotateX(-Math.PI/2)),"plane_vertical"===this._sceneParams.type&&(e=new THREE.PlaneGeometry(1,1)),this._mesh.geometry=e,this._renderEverything()}async changeFloorMaterialById(e){const t=await this._rapiAccess.getMaterial(e);return this._environment&&this._environment instanceof C||(this._environment=new C(this._scene,this._environment,!0)),this._pixotron&&this._environment.setPixotron(this._pixotron,this._renderer,this._cameraControl.getCamera()),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 THREE.Texture;s.image=r,r.onload=function(){s.needsUpdate=!0},m(s,e,this._material,this._maxAnisotropy,a,i,this._renderer.capabilities.maxTextures)}else await _(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()}}return t([a],e.prototype,"_inputManager",void 0),t([a],e.prototype,"_configuratorMeshGenerator",void 0),t([a],e.prototype,"_roomleMaterialViewerUiCallback",void 0),t([a],e.prototype,"_rapiAccess",void 0),e})(),F=(()=>{class e{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){this._threeLoader.fetch().then(()=>{let t=this._scriptLoader.fetch(d,{id:"gltf-loader"}),a=this._scriptLoader.fetch(S,{id:"tween-js"});Promise.all([t,a]).then(()=>{this._sceneManager=new G(this._creator_,{left:0,top:1,right:1,bottom:0}),this.enableHD(),e()})})}enableHD(){return new Promise((e,t)=>{const a=()=>{this._sceneManager.enableHD(),e()};Promise.all(E.map(e=>this._scriptLoader.fetch(e,{id:e}))).then(()=>{this._scriptLoader.fetch(P,{id:"pi-js"}).then(a,t)},t)})}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(){return this._sceneManager.getMaterialShading()}loadSceneSetting(e){return this._sceneManager.loadSceneSettings(e)}loadQualitySetting(e){this._sceneManager.loadQualitySetting(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()}}return t([a],e.prototype,"_domHelper",void 0),t([a],e.prototype,"_scriptLoader",void 0),t([a],e.prototype,"_lifeCycleManager",void 0),t([a],e.prototype,"_threeLoader",void 0),t([a],e.prototype,"_roomleMaterialViewerUiCallback",void 0),t([a],e.prototype,"_initData",void 0),t([a],e.prototype,"_rapiAccess",void 0),e})();const H=[new g("script-loader",v),new g("logger",p),new g("input-manager",x,1),new g("environment-loader",u),new g("configurator-mesh-generator",R),new g("rapi-access",M),new g("roomle-material-viewer-ui-callback",class extends c{constructor(e){super(e),this.onMaterialShadingChanged=e=>{}}},1)];e("MaterialViewer",class extends T{setupGlobals(){}setupDependencies(){w.setup(H),this.lookup("logger",this._context)}cleanUpGlobals(){throw new Error("Method not implemented.")}cleanUpDependencies(){throw new Error("Method not implemented.")}bootFinished(){this._viewer=new F(this._context),window.RoomleMaterialViewer||(window.RoomleMaterialViewer=this._viewer)}getApi(){return this._viewer}getContextName(){return"material-viewer"}})}}}));
|
|
2
|
-
//# sourceMappingURL=material-viewer-
|
|
1
|
+
System.register(["./query-params-helper-8c00a872.legacy.js","./rapi-access-7d0f02e7.legacy.js","./main-thread-to-worker-4c02f179.legacy.js","./pixotron-6195d494.legacy.js","./mesh-generator-084a73cd.legacy.js","./configurator-mesh-generator-6266fa75.legacy.js","./scene-manager-65a4c302.legacy.js"],(function(e){var t,a,i,r,s,n,o,h,l,m,_,d,c,g,p,u,M,w,y,f,C,S,E,P,v,x,T,R,b;return{setters:[function(){},function(e){t=e._,a=e.i,i=e.d,r=e.f,s=e.P,n=e.K,o=e.ab,h=e.ac,l=e.h,m=e.ad,_=e.N,d=e.G,c=e.U,g=e.n,p=e.L,u=e.ae,M=e.o,w=e.s},function(){},function(e){y=e.a,f=e.C,C=e.F,S=e.T,E=e.e,P=e.g,v=e.S,x=e.I,T=e.M},function(){},function(e){R=e.C},function(e){b=e.S}],execute:function(){let G=(()=>{class e extends b{constructor(e,t){super(e,t,i.RMV,"3D",!1),this._sceneParams={type:"cube"},this._materialParams={color:"#ffffff",metallic:.5,alpha:0,alphaCutoff:0,doubleSided:!1},this._renderer.capabilities.maxTextures>8&&this.loadDynamicLightSetting(r.createDynamicLightSettingSource(null,s.CAMERA)),this._initScene()}_initScene(){const e=new THREE.BoxGeometry(1,1,1,100,100,100),t=new THREE.MeshPhysicalMaterial({color:this._initData.colors.PRIMARY});this._environmentLoader.setEnvMap(t),this._setMaterial(t),this._mesh=new THREE.Mesh(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 y(this._scene,null,new THREE.Color(16777215)),this._cameraControl instanceof f){const e=new THREE.Box3;e.setFromObject(this._mesh),this._cameraControl.updateAndReset(e.getSize(new THREE.Vector3),e.getCenter(new THREE.Vector3))}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._setMaterial(n(e,this._environmentLoader)),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(o(this._material,a,this._environmentLoader)),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===THREE.DoubleSide,this._materialParams.metallic=1===e.metalness?1:e.reflectivity}getMaterialShading(){return h(this._material)}createCameraControl(e){this._cameraControl=new f(this._creator_,this._getInputManager(),new THREE.Vector3(-1,1,1))}_getInputManager(){return this._inputManager}sceneChanged(){}getPixotronParams(){return{saoparams:{intensity:.25,occlusionWorldRadius:.6,smoothTransition:!0,samplesPerFrame:4,bias:.02,numSamples:200,accumulative:!0},shadowparams:{shadowMapResolution:1024,shadowRadius:1,shadowQuality:1,smoothTransition:!0,enableAccumulation:!0,shadowBiasMultiplier:.05,nearPlane:.01,farPlane:50,fov:40,numSamples:50,side:THREE.FrontSide}}}getBakedShadowParams(){return{enable:!1,smoothTransition:!0,numSamples:500,numSamplesPerFrame:4}}getBounds(){return this._mesh?(new THREE.Box3).setFromObject(this._mesh):null}_guiLoaded(){this._updateGUI()}_updateGUI(){let e=l();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 THREE.Color(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?THREE.DoubleSide:THREE.FrontSide,this._shadingChanged()})),this._addGUIListener(e))}_shadingChanged(){this._roomleMaterialViewerUiCallback.onMaterialShadingChanged(h(this._material))}setGeometry(e){this._sceneParams.type=e,this._setGeometry()}_setGeometry(){let e;"cube"===this._sceneParams.type&&(e=new THREE.BoxGeometry(1,1,1,100,100,100)),"sphere"===this._sceneParams.type&&(e=new THREE.SphereGeometry(.5,100,100)),"plane_horizontal"===this._sceneParams.type&&(e=new THREE.PlaneGeometry(1,1),e.rotateX(-Math.PI/2)),"plane_vertical"===this._sceneParams.type&&(e=new THREE.PlaneGeometry(1,1)),this._mesh.geometry=e,this._renderEverything()}async changeFloorMaterialById(e){const t=await this._rapiAccess.getMaterial(e);return this._environment&&this._environment instanceof C||(this._environment=new C(this._scene,this._environment,!0)),this._pixotron&&this._environment.setPixotron(this._pixotron,this._renderer,this._cameraControl.getCamera()),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 THREE.Texture;s.image=r,r.onload=function(){s.needsUpdate=!0},m(s,e,this._material,this._maxAnisotropy,a,i,this._renderer.capabilities.maxTextures)}else await _(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()}}return t([a],e.prototype,"_inputManager",void 0),t([a],e.prototype,"_configuratorMeshGenerator",void 0),t([a],e.prototype,"_roomleMaterialViewerUiCallback",void 0),t([a],e.prototype,"_rapiAccess",void 0),e})(),F=(()=>{class e{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){this._threeLoader.fetch().then(()=>{let t=this._scriptLoader.fetch(d,{id:"gltf-loader"}),a=this._scriptLoader.fetch(S,{id:"tween-js"});Promise.all([t,a]).then(()=>{this._sceneManager=new G(this._creator_,{left:0,top:1,right:1,bottom:0}),this.enableHD(),e()})})}enableHD(){return new Promise((e,t)=>{const a=()=>{this._sceneManager.enableHD(),e()};Promise.all(E.map(e=>this._scriptLoader.fetch(e,{id:e}))).then(()=>{this._scriptLoader.fetch(P,{id:"pi-js"}).then(a,t)},t)})}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(){return this._sceneManager.getMaterialShading()}loadSceneSetting(e){return this._sceneManager.loadSceneSettings(e)}loadQualitySetting(e){this._sceneManager.loadQualitySetting(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()}}return t([a],e.prototype,"_domHelper",void 0),t([a],e.prototype,"_scriptLoader",void 0),t([a],e.prototype,"_lifeCycleManager",void 0),t([a],e.prototype,"_threeLoader",void 0),t([a],e.prototype,"_roomleMaterialViewerUiCallback",void 0),t([a],e.prototype,"_initData",void 0),t([a],e.prototype,"_rapiAccess",void 0),e})();const H=[new g("script-loader",v),new g("logger",p),new g("input-manager",x,1),new g("environment-loader",u),new g("configurator-mesh-generator",R),new g("rapi-access",M),new g("roomle-material-viewer-ui-callback",class extends c{constructor(e){super(e),this.onMaterialShadingChanged=e=>{}}},1)];e("MaterialViewer",class extends T{setupGlobals(){}setupDependencies(){w.setup(H),this.lookup("logger",this._context)}cleanUpGlobals(){throw new Error("Method not implemented.")}cleanUpDependencies(){throw new Error("Method not implemented.")}bootFinished(){this._viewer=new F(this._context),window.RoomleMaterialViewer||(window.RoomleMaterialViewer=this._viewer)}getApi(){return this._viewer}getContextName(){return"material-viewer"}})}}}));
|
|
2
|
+
//# sourceMappingURL=material-viewer-e83460de.legacy.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"material-viewer-e83460de.legacy.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
System.register(["./query-params-helper-8c00a872.legacy.js","./rapi-access-
|
|
1
|
+
System.register(["./query-params-helper-8c00a872.legacy.js","./rapi-access-7d0f02e7.legacy.js","./main-thread-to-worker-4c02f179.legacy.js","./pixotron-6195d494.legacy.js","./mesh-generator-084a73cd.legacy.js","./configurator-mesh-generator-6266fa75.legacy.js","./scene-manager-65a4c302.legacy.js","./material-viewer-e83460de.legacy.js"],(function(){var e;return{setters:[function(){},function(){},function(){},function(){},function(){},function(){},function(){},function(n){e=n.MaterialViewer}],execute:function(){(new e).boot()}}}));
|
|
2
2
|
//# sourceMappingURL=material-viewer-main.legacy.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
System.register(["./rapi-access-
|
|
2
|
-
//# sourceMappingURL=mesh-generator-
|
|
1
|
+
System.register(["./rapi-access-7d0f02e7.legacy.js","./main-thread-to-worker-4c02f179.legacy.js"],(function(e){var t,a,r,s,i,o,h,l,c;return{setters:[function(e){t=e._,a=e.i,r=e.O,s=e.S,i=e.a3,o=e.K,h=e.N},function(e){l=e.j,c=e.k}],execute:function(){class n{constructor(e,t){this._waitingPromises=[],this._finishPromiseExecutor=[],this._errorCallback=()=>{},Promise.allSettled=Promise.allSettled||(e=>Promise.all(e.map(e=>e.then(e=>({status:"fulfilled",value:e})).catch(e=>({status:"rejected",reason:e}))))),e&&this.registerCallback(e),t&&(this._errorCallback=t)}push(e){this._waitingPromises.push(e),Promise.all(this._waitingPromises).then(e=>{e.length===this._waitingPromises.length&&(this._callback&&this._callback(e),this._waitingPromises=[])},this._errorCallback)}finished(e=!1){return new Promise((t,a)=>{this._finishPromiseExecutor.push({resolve:t,reject:a});const r=e?"allSettled":"all";Promise[r](this._waitingPromises).then(e=>{if("allSettled"===r){const t=[];e.forEach(({value:e,status:a})=>{"fulfilled"===a&&t.push(e)}),this._resolveAllExecutors(t)}else this._resolveAllExecutors(e)},e=>{this._rejectAllExecutors(e)})})}registerCallback(e){this._callback=e}unregisterCallback(){this._callback=null}_resolveAllExecutors(e){this._finishPromiseExecutor.forEach(({resolve:t})=>t(e)),this._finishPromiseExecutor=[]}_rejectAllExecutors(e){this._finishPromiseExecutor.forEach(({reject:t})=>t(e)),this._finishPromiseExecutor=[]}clear(){const e=this._waitingPromises.length>0;this._waitingPromises=[],e?this._rejectAllExecutors(new Error("Promise queue has been cleared")):this._resolveAllExecutors([])}get length(){return this._waitingPromises.length}}e("P",n),e("M",(()=>{class e{constructor(e){this.materialQueue=new n,this._maxAnisotropy=1,this._maxTextures=16,this._textureLoader=new THREE.TextureLoader,this._creator_=e,this._previewMaterial=new THREE.MeshStandardMaterial({color:r,roughness:s,metalness:i}),this._environmentLoader.setEnvMap(this._previewMaterial)}_generateGeometry(e,t,a,r,s){let i;if(e&&this._cacheHolder.geometryCache.has(e))i=this._cacheHolder.geometryCache.get(e);else{i=new THREE.Geometry,i.faceVertexUvs=[],i.faceVertexUvs[0]=[];for(let e=0,a=t.length;e<a;e+=3)i.vertices.push(new THREE.Vector3(t[e]/1e3,t[e+2]/1e3,t[e+1]/-1e3));let o=0,h=0,l=0,c=0,n=0,m=0,_=0,d=0,u=0,g=0,p=[];for(let e=0,t=a.length;e<t;e+=3)h=e,l=e+1,c=e+2,n=3*a[h],m=3*a[l],_=3*a[c],p=[new THREE.Vector3(s[n],s[n+2],-1*s[n+1]),new THREE.Vector3(s[m],s[m+2],-1*s[m+1]),new THREE.Vector3(s[_],s[_+2],-1*s[_+1])],i.faces.push(new THREE.Face3(a[h],a[l],a[c],p)),d=2*a[h],u=2*a[l],g=2*a[c],i.faceVertexUvs[0][o]=[],i.faceVertexUvs[0][o][0]=new THREE.Vector2(r[d],r[d+1]),i.faceVertexUvs[0][o][1]=new THREE.Vector2(r[u],r[u+1]),i.faceVertexUvs[0][o][2]=new THREE.Vector2(r[g],r[g+1]),o++;e&&this._cacheHolder.geometryCache.set(e,i)}return i}changeMaterialOfMesh(e,t){e&&t?(e.material=t,e.material.transparent||0===e.material.opacity||e.material.transmission>0?(e.castShadow=!1,e.receiveShadow=!1):(e.castShadow=!0,e.receiveShadow=!0),e.material.needsUpdate=!0,this._materialLoaded&&this._materialLoaded(t)):console.warn("could not assign material to mesh",{mesh:e},{material:t})}_createMaterial(e,t,a,r,s){if(this._cacheHolder.materialCache.has(e))t();else if(e.startsWith("benchmarkMaterial")){let i=l(e),h=o(i,this._environmentLoader);this._loadBenchmarkTextures(i,h,r,s).then(t,a)}else this._rapiAccess.getMaterial(e).then(e=>{let i=o(e,this._environmentLoader);this._loadTextures(e,i,r,s).then(t,a)},a)}_loadBenchmarkTextures(e,t,a=1,r=1){return new Promise((s,i)=>{const o=c(e.id);h(this._dataSyncer.requestAsset(o.image,!0),o,t,this._maxAnisotropy,a/(0===o.mmWidth?1:o.mmWidth),r/(0===o.mmHeight?1:o.mmHeight),this._maxTextures).then(()=>{this._cacheHolder.materialCache.set(e.id,t),s()},i)})}_loadTextures(e,t,a=1,r=1){return new Promise((s,i)=>{if(!e.textures||e.textures&&0===e.textures.length)return this._cacheHolder.materialCache.set(e.id,t),s();this._rapiAccess.getTexturesOf(e).then(o=>{let l=[];o.forEach(e=>{l.push(h(this._dataSyncer.requestAsset(e.image,!0),e,t,this._maxAnisotropy,a/(0===e.mmWidth?1:e.mmWidth),r/(0===e.mmHeight?1:e.mmHeight),this._maxTextures))}),Promise.all(l).then(()=>{this._cacheHolder.materialCache.set(e.id,t),s()},i)})})}_loadMaterial(e,t,a){return new Promise((r,s)=>{this._singlePromiseFactory.create(6,e,(r,s)=>this._createMaterial(e,r,s,t,a)).then(()=>{setTimeout(()=>r(this._cacheHolder.materialCache.get(e)),0)},s)})}_assignMaterial(e,t){return this._cacheHolder.materialCache.has(t)?(this.changeMaterialOfMesh(e,this._cacheHolder.materialCache.get(t)),Promise.resolve()):new Promise((a,r)=>{this._loadMaterial(t).then(r=>{e.userData.materialId===t&&this.changeMaterialOfMesh(e,r),a()},r)})}get maxAnisotropy(){return this._maxAnisotropy}set maxAnisotropy(e){this._maxAnisotropy=e}get maxTextures(){return this._maxTextures}set maxTextures(e){this._maxTextures=e}clear(){this._cacheHolder.clear()}_assignRGB(e,t){return new Promise(a=>{let r,s="rbg"+JSON.stringify(t);this._cacheHolder.materialCache.has(s)?r=this._cacheHolder.materialCache.get(s):(r=new THREE.MeshStandardMaterial({color:t}),this._environmentLoader.setEnvMap(r),this._cacheHolder.materialCache.set(s,r)),this.changeMaterialOfMesh(e,r),setTimeout(()=>a(),0)})}_assignItem(e,t){return new Promise((a,r)=>{if(this._cacheHolder.materialCache.has(t))return this.changeMaterialOfMesh(e,this._cacheHolder.materialCache.get(t)),void a();this._rapiAccess.getItem(t).then(s=>{if(s.topImage)this._textureLoader.load(s.topImage,r=>{r.anisotropy=this._maxAnisotropy,r.wrapS=THREE.RepeatWrapping,r.wrapT=THREE.RepeatWrapping;let i=new THREE.Vector2(1,1);s.width>0&&(i.x=1/s.width),s.depth>0&&(i.y=1/s.depth),r.repeat.set(i.x,i.y);const o=new THREE.MeshPhysicalMaterial({map:r,roughness:.5,metalness:.1});this._environmentLoader.setEnvMap(o),this._cacheHolder.materialCache.set(t,o),this.changeMaterialOfMesh(e,o),setTimeout(()=>a(),0)});else{const e="can not set material, catalog item top image is not set";console.warn(e),r(e)}},r)})}setMaterialLoadedListener(e){this._materialLoaded=e}removeMaterialLoadedListener(){this._materialLoaded=void 0}}return t([a],e.prototype,"_rapiAccess",void 0),t([a],e.prototype,"_environmentLoader",void 0),t([a],e.prototype,"_dataSyncer",void 0),t([a],e.prototype,"_singlePromiseFactory",void 0),t([a],e.prototype,"_cacheHolder",void 0),t([a],e.prototype,"_plannerMeshGenerator",void 0),e})())}}}));
|
|
2
|
+
//# sourceMappingURL=mesh-generator-084a73cd.legacy.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mesh-generator-084a73cd.legacy.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|