@roomle/web-sdk 2.76.0 → 2.77.0-alpha.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/{banana-for-scale-00c51c97.nomodule.js → banana-for-scale-747faad0.nomodule.js} +2 -2
- package/lib/{banana-for-scale-00c51c97.nomodule.js.map → banana-for-scale-747faad0.nomodule.js.map} +1 -1
- package/lib/{banana-for-scale-6bb1ee7e.js → banana-for-scale-9b1f01e9.js} +2 -2
- package/lib/{banana-for-scale-6bb1ee7e.js.map → banana-for-scale-9b1f01e9.js.map} +1 -1
- package/lib/{camera-behaviour-c7eaa412.js → camera-behaviour-d6af6d09.js} +2 -2
- package/lib/{camera-behaviour-c7eaa412.js.map → camera-behaviour-d6af6d09.js.map} +1 -1
- package/lib/{camera-behaviour-35b9043c.nomodule.js → camera-behaviour-eee26e60.nomodule.js} +2 -2
- package/lib/{camera-behaviour-35b9043c.nomodule.js.map → camera-behaviour-eee26e60.nomodule.js.map} +1 -1
- package/lib/{component-dimensioning-be6f4978.nomodule.js → component-dimensioning-505e3be3.nomodule.js} +2 -2
- package/lib/component-dimensioning-505e3be3.nomodule.js.map +1 -0
- package/lib/{component-dimensioning-b340ff88.js → component-dimensioning-a87836c0.js} +2 -2
- package/lib/component-dimensioning-a87836c0.js.map +1 -0
- package/lib/{component-raycast-helper-fbc6ea71.js → component-raycast-helper-357d58fb.js} +2 -2
- package/lib/component-raycast-helper-357d58fb.js.map +1 -0
- package/lib/{component-raycast-helper-b5e775b6.nomodule.js → component-raycast-helper-4260f5f3.nomodule.js} +2 -2
- package/lib/component-raycast-helper-4260f5f3.nomodule.js.map +1 -0
- package/lib/{configurator-0545dd74.nomodule.js → configurator-28c8e5dc.nomodule.js} +2 -2
- package/lib/configurator-28c8e5dc.nomodule.js.map +1 -0
- package/lib/{configurator-e8e7249b.js → configurator-7be15b5d.js} +2 -2
- package/lib/configurator-7be15b5d.js.map +1 -0
- package/lib/configurator-main-9627b78d.js +2 -0
- package/lib/configurator-main-9627b78d.js.map +1 -0
- package/lib/configurator-main.nomodule.js +1 -1
- package/lib/{continuous-drawing-helper-3bf27c77.js → continuous-drawing-helper-51677944.js} +2 -2
- package/lib/continuous-drawing-helper-51677944.js.map +1 -0
- package/lib/{continuous-drawing-helper-c48a8810.nomodule.js → continuous-drawing-helper-ecb99fa7.nomodule.js} +2 -2
- package/lib/continuous-drawing-helper-ecb99fa7.nomodule.js.map +1 -0
- package/lib/{default-light-setting-50a8aae2.js → default-light-setting-432c00f7.js} +2 -2
- package/lib/default-light-setting-432c00f7.js.map +1 -0
- package/lib/{default-light-setting-4b8e7ee6.nomodule.js → default-light-setting-8492f1aa.nomodule.js} +2 -2
- package/lib/default-light-setting-8492f1aa.nomodule.js.map +1 -0
- package/lib/definitions/common-core/src/configurator-kernel-access.d.ts +1 -0
- package/lib/definitions/common-core/src/utils/shims.d.ts +2 -2
- package/lib/definitions/configurator-core/src/roomle-configurator.d.ts +4 -4
- package/lib/definitions/configurator-core/src/services/configurator-ui-callback.d.ts +2 -2
- package/lib/definitions/glb-viewer-core/src/roomle-glb-viewer.d.ts +1 -1
- package/lib/definitions/material-viewer/src/roomle-material-viewer.d.ts +1 -1
- package/lib/definitions/planner-core/src/roomle-planner-ui-callback.d.ts +5 -0
- package/lib/definitions/typings/kernel.d.ts +1 -0
- package/lib/{dimensioning-helper-ab6b7f69.js → dimensioning-helper-02499f1a.js} +2 -2
- package/lib/{dimensioning-helper-ab6b7f69.js.map → dimensioning-helper-02499f1a.js.map} +1 -1
- package/lib/{dimensioning-helper-c84c6aa3.nomodule.js → dimensioning-helper-be6a25b7.nomodule.js} +2 -2
- package/lib/{dimensioning-helper-c84c6aa3.nomodule.js.map → dimensioning-helper-be6a25b7.nomodule.js.map} +1 -1
- package/lib/{glb-viewer-622cb79a.nomodule.js → glb-viewer-7282caf7.nomodule.js} +2 -2
- package/lib/{glb-viewer-622cb79a.nomodule.js.map → glb-viewer-7282caf7.nomodule.js.map} +1 -1
- package/lib/{glb-viewer-camera-behaviour-6088e966.js → glb-viewer-camera-behaviour-94516099.js} +2 -2
- package/lib/glb-viewer-camera-behaviour-94516099.js.map +1 -0
- package/lib/{glb-viewer-camera-behaviour-8633618f.nomodule.js → glb-viewer-camera-behaviour-bee9e036.nomodule.js} +2 -2
- package/lib/glb-viewer-camera-behaviour-bee9e036.nomodule.js.map +1 -0
- package/lib/{glb-viewer-4a506f4e.js → glb-viewer-f88249d7.js} +2 -2
- package/lib/{glb-viewer-4a506f4e.js.map → glb-viewer-f88249d7.js.map} +1 -1
- package/lib/glb-viewer-main-42ec8932.js +2 -0
- package/lib/glb-viewer-main-42ec8932.js.map +1 -0
- package/lib/glb-viewer-main.nomodule.js +1 -1
- package/lib/legacy/{banana-for-scale-ebedc20c.legacy.js → banana-for-scale-adf89519.legacy.js} +2 -2
- package/lib/legacy/{banana-for-scale-ebedc20c.legacy.js.map → banana-for-scale-adf89519.legacy.js.map} +1 -1
- package/lib/legacy/{camera-behaviour-022aa24e.legacy.js → camera-behaviour-529c19c2.legacy.js} +2 -2
- package/lib/legacy/{camera-behaviour-022aa24e.legacy.js.map → camera-behaviour-529c19c2.legacy.js.map} +1 -1
- package/lib/legacy/{component-dimensioning-5e8990a3.legacy.js → component-dimensioning-480dad60.legacy.js} +2 -2
- package/lib/legacy/component-dimensioning-480dad60.legacy.js.map +1 -0
- package/lib/legacy/{component-raycast-helper-e04ecdef.legacy.js → component-raycast-helper-a732cc57.legacy.js} +2 -2
- package/lib/legacy/component-raycast-helper-a732cc57.legacy.js.map +1 -0
- package/lib/legacy/{configurator-a4557504.legacy.js → configurator-0ee3fb6e.legacy.js} +2 -2
- package/lib/legacy/configurator-0ee3fb6e.legacy.js.map +1 -0
- package/lib/legacy/configurator-main.legacy.js +1 -1
- package/lib/legacy/{continuous-drawing-helper-605724b0.legacy.js → continuous-drawing-helper-1c6ee6c9.legacy.js} +2 -2
- package/lib/legacy/continuous-drawing-helper-1c6ee6c9.legacy.js.map +1 -0
- package/lib/legacy/{default-light-setting-4bfdc4a5.legacy.js → default-light-setting-e546d92d.legacy.js} +2 -2
- package/lib/legacy/default-light-setting-e546d92d.legacy.js.map +1 -0
- package/lib/legacy/{dimensioning-helper-d2bd342f.legacy.js → dimensioning-helper-d367a9ae.legacy.js} +2 -2
- package/lib/legacy/{dimensioning-helper-d2bd342f.legacy.js.map → dimensioning-helper-d367a9ae.legacy.js.map} +1 -1
- package/lib/legacy/{glb-viewer-c3cdd113.legacy.js → glb-viewer-32520b42.legacy.js} +2 -2
- package/lib/legacy/{glb-viewer-c3cdd113.legacy.js.map → glb-viewer-32520b42.legacy.js.map} +1 -1
- package/lib/legacy/{glb-viewer-camera-behaviour-db58cf5d.legacy.js → glb-viewer-camera-behaviour-e7544c90.legacy.js} +2 -2
- package/lib/legacy/glb-viewer-camera-behaviour-e7544c90.legacy.js.map +1 -0
- package/lib/legacy/glb-viewer-main.legacy.js +1 -1
- package/lib/legacy/{material-viewer-8323195c.legacy.js → material-viewer-9f4642e2.legacy.js} +2 -2
- package/lib/legacy/material-viewer-9f4642e2.legacy.js.map +1 -0
- package/lib/legacy/material-viewer-main.legacy.js +1 -1
- package/lib/legacy/planner-ca9be806.legacy.js +2 -0
- package/lib/legacy/{planner-b5bb8ed7.legacy.js.map → planner-ca9be806.legacy.js.map} +1 -1
- package/lib/legacy/planner-main.legacy.js +1 -1
- package/lib/legacy/roomle-configurator-35ccd5e3.legacy.js +2 -0
- package/lib/legacy/roomle-configurator-35ccd5e3.legacy.js.map +1 -0
- package/lib/legacy/{roomle-dependency-injection-d61f4763.legacy.js → roomle-dependency-injection-32a7ed2e.legacy.js} +3 -3
- package/lib/legacy/{roomle-dependency-injection-d61f4763.legacy.js.map → roomle-dependency-injection-32a7ed2e.legacy.js.map} +1 -1
- package/lib/legacy/roomle-sdk.legacy.js +1 -1
- package/lib/legacy/{script-loader-0d8dab5c.legacy.js → script-loader-d14aa469.legacy.js} +2 -2
- package/lib/legacy/script-loader-d14aa469.legacy.js.map +1 -0
- package/lib/legacy/static/ConfiguratorKernel-c4372bbeb5743db2.wasm +0 -0
- package/lib/legacy/static/RoomleCore-0a87ce9a99621bd9.wasm +0 -0
- package/lib/{static/RoomleToolsCore-3ed4fcaccf294e37.wasm → legacy/static/RoomleToolsCore-61c01f70818028fb.wasm} +0 -0
- package/lib/legacy/{stats-helper-3a7e4556.legacy.js → stats-helper-048249dd.legacy.js} +2 -2
- package/lib/legacy/stats-helper-048249dd.legacy.js.map +1 -0
- package/lib/legacy/{tools-core-6800c7b7.legacy.js → tools-core-bef6b8f0.legacy.js} +2 -2
- package/lib/legacy/tools-core-bef6b8f0.legacy.js.map +1 -0
- package/lib/{material-viewer-ea6dba3f.js → material-viewer-561c5edf.js} +2 -2
- package/lib/material-viewer-561c5edf.js.map +1 -0
- package/lib/{material-viewer-ac971800.nomodule.js → material-viewer-da069f1a.nomodule.js} +2 -2
- package/lib/material-viewer-da069f1a.nomodule.js.map +1 -0
- package/lib/material-viewer-main-36f6466f.js +2 -0
- package/lib/material-viewer-main-36f6466f.js.map +1 -0
- package/lib/material-viewer-main.nomodule.js +1 -1
- package/lib/planner-2128f72c.js +2 -0
- package/lib/{planner-e8b990fe.js.map → planner-2128f72c.js.map} +1 -1
- package/lib/planner-948239c6.nomodule.js +2 -0
- package/lib/{planner-7f1380f3.nomodule.js.map → planner-948239c6.nomodule.js.map} +1 -1
- package/lib/planner-main-feee1b27.js +2 -0
- package/lib/planner-main-feee1b27.js.map +1 -0
- package/lib/planner-main.nomodule.js +1 -1
- package/lib/roomle-configurator-760afe57.nomodule.js +2 -0
- package/lib/roomle-configurator-760afe57.nomodule.js.map +1 -0
- package/lib/roomle-configurator-b8abfbd1.js +2 -0
- package/lib/roomle-configurator-b8abfbd1.js.map +1 -0
- package/lib/{roomle-dependency-injection-a1a06d1e.nomodule.js → roomle-dependency-injection-b567df3a.nomodule.js} +3 -3
- package/lib/{roomle-dependency-injection-a1a06d1e.nomodule.js.map → roomle-dependency-injection-b567df3a.nomodule.js.map} +1 -1
- package/lib/{roomle-dependency-injection-ae5fa28d.js → roomle-dependency-injection-d3a8c907.js} +3 -3
- package/lib/{roomle-dependency-injection-ae5fa28d.js.map → roomle-dependency-injection-d3a8c907.js.map} +1 -1
- package/lib/{roomle-sdk-2ab19e90.js → roomle-sdk-7a4f6fc0.js} +2 -2
- package/lib/roomle-sdk-7a4f6fc0.js.map +1 -0
- package/lib/roomle-sdk.nomodule.js +1 -1
- package/lib/{script-loader-234d078e.js → script-loader-3c5eb130.js} +2 -2
- package/lib/script-loader-3c5eb130.js.map +1 -0
- package/lib/{script-loader-687f7fbc.nomodule.js → script-loader-ed493cd8.nomodule.js} +2 -2
- package/lib/script-loader-ed493cd8.nomodule.js.map +1 -0
- package/lib/static/ConfiguratorKernel-c4372bbeb5743db2.wasm +0 -0
- package/lib/static/RoomleCore-0a87ce9a99621bd9.wasm +0 -0
- package/lib/{legacy/static/RoomleToolsCore-3ed4fcaccf294e37.wasm → static/RoomleToolsCore-61c01f70818028fb.wasm} +0 -0
- package/lib/{stats-helper-b09eb905.js → stats-helper-92c35a95.js} +2 -2
- package/lib/stats-helper-92c35a95.js.map +1 -0
- package/lib/{stats-helper-e97ec5e1.nomodule.js → stats-helper-9bdccb5b.nomodule.js} +2 -2
- package/lib/stats-helper-9bdccb5b.nomodule.js.map +1 -0
- package/lib/{tools-core-33ca2cb1.js → tools-core-86b0b79b.js} +2 -2
- package/lib/tools-core-86b0b79b.js.map +1 -0
- package/lib/{tools-core-fd03b0a0.nomodule.js → tools-core-9e4e23dc.nomodule.js} +2 -2
- package/lib/tools-core-9e4e23dc.nomodule.js.map +1 -0
- package/package.json +2 -2
- package/lib/component-dimensioning-b340ff88.js.map +0 -1
- package/lib/component-dimensioning-be6f4978.nomodule.js.map +0 -1
- package/lib/component-raycast-helper-b5e775b6.nomodule.js.map +0 -1
- package/lib/component-raycast-helper-fbc6ea71.js.map +0 -1
- package/lib/configurator-0545dd74.nomodule.js.map +0 -1
- package/lib/configurator-e8e7249b.js.map +0 -1
- package/lib/configurator-main-422f9df6.js +0 -2
- package/lib/configurator-main-422f9df6.js.map +0 -1
- package/lib/continuous-drawing-helper-3bf27c77.js.map +0 -1
- package/lib/continuous-drawing-helper-c48a8810.nomodule.js.map +0 -1
- package/lib/default-light-setting-4b8e7ee6.nomodule.js.map +0 -1
- package/lib/default-light-setting-50a8aae2.js.map +0 -1
- package/lib/glb-viewer-camera-behaviour-6088e966.js.map +0 -1
- package/lib/glb-viewer-camera-behaviour-8633618f.nomodule.js.map +0 -1
- package/lib/glb-viewer-main-06539243.js +0 -2
- package/lib/glb-viewer-main-06539243.js.map +0 -1
- package/lib/legacy/component-dimensioning-5e8990a3.legacy.js.map +0 -1
- package/lib/legacy/component-raycast-helper-e04ecdef.legacy.js.map +0 -1
- package/lib/legacy/configurator-a4557504.legacy.js.map +0 -1
- package/lib/legacy/continuous-drawing-helper-605724b0.legacy.js.map +0 -1
- package/lib/legacy/default-light-setting-4bfdc4a5.legacy.js.map +0 -1
- package/lib/legacy/glb-viewer-camera-behaviour-db58cf5d.legacy.js.map +0 -1
- package/lib/legacy/material-viewer-8323195c.legacy.js.map +0 -1
- package/lib/legacy/planner-b5bb8ed7.legacy.js +0 -2
- package/lib/legacy/roomle-configurator-876d1ced.legacy.js +0 -2
- package/lib/legacy/roomle-configurator-876d1ced.legacy.js.map +0 -1
- package/lib/legacy/script-loader-0d8dab5c.legacy.js.map +0 -1
- package/lib/legacy/static/ConfiguratorKernel-031e65eaee5cacde.wasm +0 -0
- package/lib/legacy/static/RoomleCore-55c9812f52948f19.wasm +0 -0
- package/lib/legacy/stats-helper-3a7e4556.legacy.js.map +0 -1
- package/lib/legacy/tools-core-6800c7b7.legacy.js.map +0 -1
- package/lib/material-viewer-ac971800.nomodule.js.map +0 -1
- package/lib/material-viewer-ea6dba3f.js.map +0 -1
- package/lib/material-viewer-main-2d9d0a22.js +0 -2
- package/lib/material-viewer-main-2d9d0a22.js.map +0 -1
- package/lib/planner-7f1380f3.nomodule.js +0 -2
- package/lib/planner-e8b990fe.js +0 -2
- package/lib/planner-main-39d3166e.js +0 -2
- package/lib/planner-main-39d3166e.js.map +0 -1
- package/lib/roomle-configurator-4136c482.js +0 -2
- package/lib/roomle-configurator-4136c482.js.map +0 -1
- package/lib/roomle-configurator-e97356ed.nomodule.js +0 -2
- package/lib/roomle-configurator-e97356ed.nomodule.js.map +0 -1
- package/lib/roomle-sdk-2ab19e90.js.map +0 -1
- package/lib/script-loader-234d078e.js.map +0 -1
- package/lib/script-loader-687f7fbc.nomodule.js.map +0 -1
- package/lib/static/ConfiguratorKernel-031e65eaee5cacde.wasm +0 -0
- package/lib/static/RoomleCore-55c9812f52948f19.wasm +0 -0
- package/lib/stats-helper-b09eb905.js.map +0 -1
- package/lib/stats-helper-e97ec5e1.nomodule.js.map +0 -1
- package/lib/tools-core-33ca2cb1.js.map +0 -1
- package/lib/tools-core-fd03b0a0.nomodule.js.map +0 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
System.register(["./camera-behaviour-
|
|
2
|
-
//# sourceMappingURL=default-light-setting-
|
|
1
|
+
System.register(["./camera-behaviour-eee26e60.nomodule.js","./roomle-dependency-injection-b567df3a.nomodule.js","./main-thread-to-worker-ff04af1e.nomodule.js"],(function(i){var t,a,e,n,o,s,h;return{setters:[function(i){t=i.L},function(i){a=i.a1},function(i){e=i.D,n=i.C,o=i.V,s=i.a,h=i.A}],execute:function(){i("D",class extends t{constructor(i,t){super(i,t),this._params={ambientLight:{color:"#ffffff"},mainDirLight:{position:{x:-3,y:4,z:4},color:"#ffffff"},secondDirLight:{position:{x:3,y:4,z:3},color:"#ffffff"}},this._mainDirectionalLight=new e(new n(this._params.mainDirLight.color),.8),this._mainDirectionalLight.position.set(this._params.mainDirLight.position.x,this._params.mainDirLight.position.y,this._params.mainDirLight.position.z),this._mainDirectionalLight.layers.set(1),this._mainDirectionalLight.castShadow=!0,this._mainDirectionalLight.shadow.camera.near=.1,this._mainDirectionalLight.shadow.camera.far=100,this._mainDirectionalLight.shadow.mapSize=new o(1024,1024),this._mainDirectionalLight.visible=!0,this._mainDirectionalLight.lookAt(new s(0,0,0)),this._secondDirectionalLight=new e(new n(this._params.secondDirLight.color),.2),this._secondDirectionalLight.position.set(this._params.secondDirLight.position.x,this._params.secondDirLight.position.y,this._params.secondDirLight.position.z),this._secondDirectionalLight.layers.set(1),this._secondDirectionalLight.castShadow=!1,this._secondDirectionalLight.shadow.camera.near=.1,this._secondDirectionalLight.shadow.camera.far=100,this._secondDirectionalLight.shadow.mapSize=new o(1024,1024),this._secondDirectionalLight.visible=!0,this._secondDirectionalLight.lookAt(new s(0,0,0)),this._ambientLight=new h(new n(this._params.ambientLight.color),.5),this._ambientLight.layers.set(1),this.addToScene()}needsBounds(){return!0}updateBounds(i){const t=i.getSize(new s),a=Math.max(Math.max(t.x,t.y),t.z)+1,e=a/2;this._mainDirectionalLight.shadow.camera.top=e,this._mainDirectionalLight.shadow.camera.bottom=-e,this._mainDirectionalLight.shadow.camera.left=-e,this._mainDirectionalLight.shadow.camera.right=e,this._mainDirectionalLight.shadow.camera.near=.01,this._mainDirectionalLight.shadow.camera.far=4*a,this._mainDirectionalLight.shadow.camera.updateProjectionMatrix(),this._secondDirectionalLight.shadow.camera.top=e,this._secondDirectionalLight.shadow.camera.bottom=-e,this._secondDirectionalLight.shadow.camera.left=-e,this._secondDirectionalLight.shadow.camera.right=e,this._secondDirectionalLight.shadow.camera.near=.01,this._secondDirectionalLight.shadow.camera.far=4*a,this._secondDirectionalLight.shadow.camera.updateProjectionMatrix()}addToScene(){this._scene.add(this._mainDirectionalLight),this._scene.add(this._secondDirectionalLight),this._scene.add(this._ambientLight)}removeFromScene(){this._scene.remove(this._mainDirectionalLight),this._scene.remove(this._secondDirectionalLight),this._scene.remove(this._ambientLight)}reload(){this.removeFromScene(),this.addToScene()}showGUI(){let i=a();if(i){if(this._ambientLight){let t=i.addFolder("Ambient Light");t.add(this._ambientLight,"visible"),t.add(this._ambientLight,"intensity").min(0).max(5).step(.1),t.addColor(this._params.ambientLight,"color").onChange(i=>this._ambientLight.color=new n(i))}if(this._mainDirectionalLight){let t=i.addFolder("Main Directional Light");t.add(this._mainDirectionalLight,"visible"),t.add(this._mainDirectionalLight,"intensity").min(0).max(10).step(.1),t.add(this._mainDirectionalLight,"castShadow"),t.addColor(this._params.mainDirLight,"color").onChange(i=>this._mainDirectionalLight.color=new n(i)),t.add(this._mainDirectionalLight.position,"x").min(-10).max(10).step(.1).onChange(()=>this._mainDirectionalLight.lookAt(new s(0,0,0))),t.add(this._mainDirectionalLight.position,"y").min(-10).max(50).step(.1).onChange(()=>this._mainDirectionalLight.lookAt(new s(0,0,0))),t.add(this._mainDirectionalLight.position,"z").min(-10).max(10).step(.1).onChange(()=>this._mainDirectionalLight.lookAt(new s(0,0,0)))}if(this._secondDirectionalLight){let t=i.addFolder("Second Directional Light");t.add(this._secondDirectionalLight,"visible"),t.add(this._secondDirectionalLight,"intensity").min(0).max(10).step(.1),t.add(this._secondDirectionalLight,"castShadow"),t.addColor(this._params.mainDirLight,"color").onChange(i=>this._mainDirectionalLight.color=new n(i)),t.add(this._secondDirectionalLight.position,"x").min(-10).max(10).step(.1).onChange(()=>this._mainDirectionalLight.lookAt(new s(0,0,0))),t.add(this._secondDirectionalLight.position,"y").min(-10).max(50).step(.1).onChange(()=>this._mainDirectionalLight.lookAt(new s(0,0,0))),t.add(this._secondDirectionalLight.position,"z").min(-10).max(10).step(.1).onChange(()=>this._mainDirectionalLight.lookAt(new s(0,0,0)))}}}})}}}));
|
|
2
|
+
//# sourceMappingURL=default-light-setting-8492f1aa.nomodule.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"default-light-setting-8492f1aa.nomodule.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -48,6 +48,7 @@ export default class ConfiguratorKernelAccess extends CommonKernelAccess {
|
|
|
48
48
|
changeUseOfHDGeometry(context: ConfiguratorContext, useHDGeometry: boolean): void;
|
|
49
49
|
webGlPreviewDockings(context: ConfiguratorContext, dragIn: boolean): void;
|
|
50
50
|
previewDockingsWithDrag(componentId: number, planObjectId: number): void;
|
|
51
|
+
cancelDocking(componentId: number): void;
|
|
51
52
|
loadConfiguration(configuration: ConfigurationString): void;
|
|
52
53
|
changeCommonComponentParameter(componentIds: number[], parameterKey: string, type: string, value: string, resolve: () => void, reject: () => void): void;
|
|
53
54
|
changeComponentParameter(componentId: number, parameterKey: string, type: string, value: string, resolve: () => void, reject: () => void): void;
|
|
@@ -294,13 +294,13 @@ export interface ConfiguratorInitData {
|
|
|
294
294
|
/**
|
|
295
295
|
* @deprecated
|
|
296
296
|
* @description Set the floor material which is used when loading the configurator
|
|
297
|
-
* For different options see {@link @roomle/web-sdk/
|
|
297
|
+
* For different options see {@link @roomle/web-sdk/configurator-core/src/environment/dynamic-environment-setting-loader#EnvironmentSetting}
|
|
298
298
|
*/
|
|
299
299
|
initialFloorMaterial?: string;
|
|
300
300
|
/**
|
|
301
301
|
* @internal
|
|
302
302
|
* @description Load a light setting using an URL.
|
|
303
|
-
* Check lights in {@link @roomle/web-sdk/
|
|
303
|
+
* Check lights in {@link @roomle/web-sdk/configurator-core/src/scene-settings-loader#SceneSettings} for an example.
|
|
304
304
|
* value is a dynamic light setting url
|
|
305
305
|
*/
|
|
306
306
|
dls?: string;
|
|
@@ -153,7 +153,7 @@ export default class RoomleConfigurator implements GlobalAPI, Context, KernelUti
|
|
|
153
153
|
* Generates an image of one part (slightly from the side) and returns it as base 64
|
|
154
154
|
* WARNING: It's only possible to render one sub part at a time
|
|
155
155
|
* * @param partId id of the sub part, received from part list
|
|
156
|
-
* * @param
|
|
156
|
+
* * @param options size of the rendered image in pixel (default is 256), will render faster when size is smaller
|
|
157
157
|
*/
|
|
158
158
|
preparePartImage(partId: number, options?: PrepareImageOptions | number): Promise<Base64Image>;
|
|
159
159
|
/**
|
|
@@ -169,7 +169,7 @@ export default class RoomleConfigurator implements GlobalAPI, Context, KernelUti
|
|
|
169
169
|
generateImagesOfCurrentConfiguration(): Promise<object>;
|
|
170
170
|
/**
|
|
171
171
|
* Generates a top image (birds perspective) and returns it as base 64
|
|
172
|
-
* @param
|
|
172
|
+
* @param options should object dimensions be visible
|
|
173
173
|
*/
|
|
174
174
|
prepareTopImage(options?: PrepareImageOptions | boolean): Promise<Base64Image>;
|
|
175
175
|
/**
|
|
@@ -398,7 +398,7 @@ export default class RoomleConfigurator implements GlobalAPI, Context, KernelUti
|
|
|
398
398
|
syncTypeChangeTag(tagId: RapiId): Promise<void>;
|
|
399
399
|
/**
|
|
400
400
|
* Loads a dynamic light settings into the scene. The dynamic light setting source can be an
|
|
401
|
-
* object (js), json, or an url (url to json). See {@link @roomle/web-sdk/
|
|
401
|
+
* object (js), json, or an url (url to json). See {@link @roomle/web-sdk/configurator-core/src/scene-settings-loader#SceneSettings} how to define it.
|
|
402
402
|
*
|
|
403
403
|
* Exampe:
|
|
404
404
|
* ```
|
|
@@ -473,7 +473,7 @@ export default class RoomleConfigurator implements GlobalAPI, Context, KernelUti
|
|
|
473
473
|
setBackgroundImage(url: string): void;
|
|
474
474
|
/**
|
|
475
475
|
* Loads a SceneSettings object, currently it can can contain a light setting definition
|
|
476
|
-
* (see {@link @roomle/web-sdk/configurator-core/src/roomle-configurator#RoomleConfigurator.loadDynamicLightSetting}) and an environment definition (see {@link @roomle/web-sdk/
|
|
476
|
+
* (see {@link @roomle/web-sdk/configurator-core/src/roomle-configurator#RoomleConfigurator.loadDynamicLightSetting}) and an environment definition (see {@link @roomle/web-sdk/configurator-core/src/environment/dynamic-environment-setting-loader#EnvironmentSetting}).
|
|
477
477
|
* @param sceneSettings
|
|
478
478
|
*/
|
|
479
479
|
loadSceneSetting(sceneSettings: SceneSettings): Promise<void>;
|
|
@@ -90,7 +90,7 @@ export default class ConfiguratorUiCallbacks extends UiCallback {
|
|
|
90
90
|
*/
|
|
91
91
|
onConfigurationReady: (partList: KernelPartList, hash: ConfigurationHash, rootComponentLabel: string) => void;
|
|
92
92
|
/**
|
|
93
|
-
* When UI should show the overlay based on the selected tag. Gets triggered when {@link @roomle/web-sdk/
|
|
93
|
+
* When UI should show the overlay based on the selected tag. Gets triggered when {@link @roomle/web-sdk/configurator-core/src/utils/shims#CommonInitData.startTag} is set
|
|
94
94
|
* @param tag
|
|
95
95
|
*/
|
|
96
96
|
onOpenTag: (tag: RapiTagForUi) => void;
|
|
@@ -107,7 +107,7 @@ export default class ConfiguratorUiCallbacks extends UiCallback {
|
|
|
107
107
|
*/
|
|
108
108
|
onNoDockingsAvailable: () => void;
|
|
109
109
|
/**
|
|
110
|
-
* When the configuration overlaps the UI (defined by {@link @roomle/web-sdk/
|
|
110
|
+
* When the configuration overlaps the UI (defined by {@link @roomle/web-sdk/configurator-core/src/configurator-interfaces#CanvasOffset})
|
|
111
111
|
* @param intersections
|
|
112
112
|
*/
|
|
113
113
|
onUiIntersectionChange: (intersections: UIIntersection[]) => void;
|
|
@@ -59,7 +59,7 @@ export default class RoomleGLBViewer implements GlobalAPI, Context, ExternalEmbe
|
|
|
59
59
|
getCurrentId(): string;
|
|
60
60
|
/**
|
|
61
61
|
* Loads a SceneSettings object, currently it can can contain a light setting definition
|
|
62
|
-
* (see {@link @roomle/web-sdk/configurator-core/src/roomle-configurator#RoomleConfigurator.loadDynamicLightSetting}) and an environment definition (see {@link @roomle/web-sdk/
|
|
62
|
+
* (see {@link @roomle/web-sdk/configurator-core/src/roomle-configurator#RoomleConfigurator.loadDynamicLightSetting}) and an environment definition (see {@link @roomle/web-sdk/configurator-core/src/environment/dynamic-environment-setting-loaderEnvironmentSetting}).
|
|
63
63
|
* @param sceneSettings
|
|
64
64
|
*/
|
|
65
65
|
loadSceneSetting(sceneSettings: SceneSettings): Promise<void>;
|
|
@@ -39,7 +39,7 @@ export default class RoomleMaterialViewer implements GlobalAPI, Context, Externa
|
|
|
39
39
|
getMaterialShading(version?: number): RapiMaterialShading;
|
|
40
40
|
/**
|
|
41
41
|
* Loads a SceneSettings object, currently it can can contain a light setting definition
|
|
42
|
-
* (see {@link @roomle/web-sdk/configurator-core/src/roomle-configurator#RoomleConfigurator.loadDynamicLightSetting}) and an environment definition (see {@link @roomle/web-sdk/
|
|
42
|
+
* (see {@link @roomle/web-sdk/configurator-core/src/roomle-configurator#RoomleConfigurator.loadDynamicLightSetting}) and an environment definition (see {@link @roomle/web-sdk/configurator-core/src/environment/dynamic-environment-setting-loader#EnvironmentSetting}).
|
|
43
43
|
* @param sceneSettings
|
|
44
44
|
*/
|
|
45
45
|
loadSceneSetting(sceneSettings: SceneSettings): Promise<void>;
|
|
@@ -120,6 +120,11 @@ export default class RoomlePlannerUiCallback extends UiCallback {
|
|
|
120
120
|
*/
|
|
121
121
|
onUpdatePlanObjectPositions: (planObjectPositions: PlanObjectPosition[]) => void;
|
|
122
122
|
onDrawCancel: () => void;
|
|
123
|
+
/**
|
|
124
|
+
* This updates if the user started/stopped drawing a wall
|
|
125
|
+
* @param currentlyDrawing
|
|
126
|
+
*/
|
|
127
|
+
onDrawingStateChanged: (currentlyDrawing: boolean) => void;
|
|
123
128
|
onHandlerSwitchedPlans: () => void;
|
|
124
129
|
/**
|
|
125
130
|
* This function gets called when a movable element begins to be dragged
|
|
@@ -377,6 +377,7 @@ export interface ConfiguratorKernelClass {
|
|
|
377
377
|
requestPlanComponentConstructionRecursive(componentId: number): void;
|
|
378
378
|
requestPreviewGeometry(componentId: number, planObjectId: number, allowInsertInBetween: boolean): void;
|
|
379
379
|
requestPreviewGeometryForExternalObject(componentId: string, planObjectId: number, allowInsertInBetween: boolean): void;
|
|
380
|
+
cancelDocking(componentId: number, undoDrag: boolean): void;
|
|
380
381
|
getComponentParameters(componentId: number): KernelParameter[];
|
|
381
382
|
setComponentParameter(componentId: number, parameterKey: string, value: string): void;
|
|
382
383
|
setPlanComponentParameters(componentIds: any, parameterKey: string, value: string): void;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{aG as normalizeRotation,w as dispose,_ as __decorate,i as inject,ah as AsyncGuard,aH as AsyncDependencyLoader,ad as convertToTHREE}from"./roomle-dependency-injection-ae5fa28d.js";import{O as Object3D,a as Vector3,h as MeshBasicMaterial,w as DoubleSide,br as MeshPhongMaterial,B as BufferGeometry,z as Mesh,Q as Quaternion,bc as PlaneGeometry,K as Group,u as LineBasicMaterial,G as Line,b as BufferAttribute,b0 as Line3,ad as Box3}from"./main-thread-to-worker-82b32425.js";import{T as TextGeometry}from"./TextGeometry-f0a85d6a.js";const PLANE_MATERIAL="component_dimensioning_plane_material",TEXT_MATERIAL="component_dimensioning_text_material";class TextWithBackground extends 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 Vector3,this._initMaterials(),this._init(),this._update()}_initMaterials(){this._cacheHolder.materialCache.has(PLANE_MATERIAL)?this._planeMaterial=this._cacheHolder.materialCache.get(PLANE_MATERIAL):(this._planeMaterial=new MeshBasicMaterial({color:16777215,side:DoubleSide,opacity:.8,transparent:!0}),this._cacheHolder.materialCache.set(PLANE_MATERIAL,this._planeMaterial)),this._cacheHolder.materialCache.has(TEXT_MATERIAL)?this._textMaterial=this._cacheHolder.materialCache.get(TEXT_MATERIAL):(this._textMaterial=new MeshPhongMaterial({color:3618615}),this._cacheHolder.materialCache.set(TEXT_MATERIAL,this._textMaterial))}_init(){let e=new BufferGeometry;this._text=new Mesh(e,this._textMaterial),this._text.userData.ignoreComponentRaycast=!0,this._text.name="text with background text "+this._label,this._plane=new Mesh(e,this._planeMaterial),this._plane.userData.ignoreComponentRaycast=!0,this._plane.name="text with background plane "+this._label,this._textGeometry=new 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){this._position.copy(e),this._cameraPosition=i,this._label=t;const s=this.getWorldPosition(new Vector3),n=this._cameraPosition.distanceTo(s),o=Math.max(.01,n/150),h=Math.max(5e-4,n/5e3);this._parameters.bevelThickness=h,this._parameters.bevelSize=h,this._parameters.size=o,this._textGeometry=new TextGeometry(this._label,this._parameters),this._textGeometry.computeBoundingBox(),this._text.geometry=this._textGeometry,this._update()}_update(){if(this.topDown){let e=new Quaternion;e.setFromAxisAngle(new Vector3(-1,0,0),Math.PI/2),this._updateText(this._textGeometry,e,new Vector3)}else if(this._updateText(this._textGeometry,new Quaternion,new Vector3),this._cameraPosition){const e=this.getWorldPosition(new Vector3),t=normalizeRotation(Math.atan2(this._cameraPosition.x-e.x,this._cameraPosition.z-e.z)-this.parent.rotation.y);this._text.rotation.y=t,this._plane.rotation.y=t}}_updateText(e,t,i){let s=new Vector3;s.copy(this._position),i.x*=this._getXSign(),s.add(i);let n=e.boundingBox.getSize(new Vector3);e.center(),this._text.position.copy(s),t&&this._text.quaternion.copy(t);let o=new PlaneGeometry(n.x+.02,n.y+.02,32);o.center(),this._plane.geometry=o,this._plane.position.copy(s),t&&this._plane.quaternion.copy(t)}_getXSign(){return!this._cameraPosition||this._cameraPosition.x>=0?1:-1}dispose(){dispose(this)}}__decorate([inject],TextWithBackground.prototype,"_cacheHolder",void 0);class DimensioningHelper{constructor(e){this._objectRotation=0,this._cameraPosition=new Vector3,this._topDimensions=!1,this._initialized=new AsyncGuard,this._enabled=!1,this._dimensionsVisible=!1,this._dimensionLineGroup=new Group,this._dimensionTextGroup=new Object3D,this._creator_=e,this._lineMaterial=new LineBasicMaterial({color:3618615,linewidth:2});let t=new BufferGeometry;this._widthLine=new Line(t,this._lineMaterial),this._widthLine.userData.ignoreComponentRaycast=!0,this._widthLine.name="dimension width line",this._dimensionLineGroup.add(this._widthLine),this._heightLine=new Line(t,this._lineMaterial),this._heightLine.userData.ignoreComponentRaycast=!0,this._heightLine.name="dimension height line",this._dimensionLineGroup.add(this._heightLine),this._depthLine=new Line(t,this._lineMaterial),this._depthLine.userData.ignoreComponentRaycast=!0,this._depthLine.name="dimension depth line",this._dimensionLineGroup.add(this._depthLine),this._planeMaterial=new MeshBasicMaterial({color:16777215,side:DoubleSide,opacity:.8,transparent:!0}),AsyncDependencyLoader.loadFont("static/rubik_regular_sub-2dd2d5cca49018c5.json").then(e=>{this._font=e,this._loaded()})}_loaded(){this.update(!1),this.addToObject(this._object),this.addToUiScene(this._uiScene),this._initialized.resolve()}_performUpdate(e){this._enabled&&(this._dimensions||e)&&this._font&&(this._updateHeight(),this._updateWidth(),this._updateDepth())}_updateWidth(){let e=new BufferGeometry,t=this._getWidthEdge(),i=[t.start.x,t.start.y,t.start.z,t.end.x,t.end.y,t.end.z];e.setAttribute("position",new BufferAttribute(new Float32Array(i),3)),this._widthLine.geometry.dispose(),this._widthLine.geometry=e;let s=t.getCenter(new Vector3);this._widthText||(this._widthText=new TextWithBackground(this._font),this._dimensionTextGroup.add(this._widthText)),this._widthText.topDown=this._topDimensions;const n=this._unitFormatter.formatMMValueToUnitString(1e3*this._dimensions.x);this._widthText.update(s,n,this._cameraPosition)}_updateHeight(){let e=new BufferGeometry,t=this._getHeightEdge(),i=[t.start.x,t.start.y,t.start.z,t.end.x,t.end.y,t.end.z];e.setAttribute("position",new BufferAttribute(new Float32Array(i),3)),this._heightLine.geometry.dispose(),this._heightLine.geometry=e;let s=t.getCenter(new Vector3);this._heightText||(this._heightText=new TextWithBackground(this._font),this._dimensionTextGroup.add(this._heightText)),this._heightText.topDown=this._topDimensions;const n=this._unitFormatter.formatMMValueToUnitString(1e3*this._dimensions.y);this._heightText.update(s,n,this._cameraPosition)}_updateDepth(){let e=new BufferGeometry,t=this._getDepthEdge(),i=[t.start.x,t.start.y,t.start.z,t.end.x,t.end.y,t.end.z];e.setAttribute("position",new BufferAttribute(new Float32Array(i),3)),this._depthLine.geometry.dispose(),this._depthLine.geometry=e;let s=t.getCenter(new Vector3);this._depthText||(this._depthText=new TextWithBackground(this._font),this._dimensionTextGroup.add(this._depthText)),this._depthText.topDown=this._topDimensions;const n=this._unitFormatter.formatMMValueToUnitString(1e3*this._dimensions.z);this._depthText.update(s,n,this._cameraPosition)}updateSize(e){this._origin=convertToTHREE(e.origin),this._dimensionLineGroup.position.x=this._origin.x-this._object.position.x,this._dimensionLineGroup.position.y=this._origin.y-this._object.position.y,this._dimensionLineGroup.position.z=this._origin.z-this._object.position.z,this._dimensions=convertToTHREE(e.size);const t=this._dimensionLineGroup.localToWorld(new Vector3);this._dimensionTextGroup.position.copy(t),this.update()}update(e=!1){this._enabled&&!this._dimensionsVisible&&(this._dimensionsVisible=!0,this._visibilityChangedCallback()),this._performUpdate(e)}addToObject(e){this._widthText&&this._widthLine&&this._heightText&&this._heightLine&&this._heightText&&this._heightLine&&e.add(this._dimensionLineGroup)}removeFromObject(e){e.remove(this._dimensionLineGroup),this.update()}addToUiScene(e){if(!(this._widthText&&this._heightText&&this._depthText&&this._object))return;const t=this._dimensionLineGroup.localToWorld(new Vector3);this._dimensionTextGroup.position.copy(t),this._dimensionTextGroup.rotation.y=this._objectRotation,e.add(this._dimensionTextGroup),this.update()}removeFromUiScene(e){e.remove(this._dimensionTextGroup),this.update()}_getWidthEdge(){const e=this._getRotation();return e>Math.PI/2||e<-Math.PI/2?new Line3(new Vector3(-.05,0,this._dimensions.z-.05),new Vector3(this._dimensions.x+.05,0,this._dimensions.z-.05)):new Line3(new Vector3(-.05,0,.05),new Vector3(this._dimensions.x+.05,0,.05))}_getDepthEdge(){return this._getRotation()>0?new Line3(new Vector3(.05+this._dimensions.x,0,.05),new Vector3(.05+this._dimensions.x,0,this._dimensions.z-.05)):new Line3(new Vector3(-.05,0,.05),new Vector3(-.05,0,this._dimensions.z-.05))}_getHeightEdge(){const e=this._getRotation();return e>0&&e<Math.PI/2?new Line3(new Vector3(-.05,0,.05),new Vector3(-.05,this._dimensions.y+.05,.05)):e>Math.PI/2?new Line3(new Vector3(-.05,0,this._dimensions.z-.05),new Vector3(-.05,this._dimensions.y+.05,this._dimensions.z-.05)):e<-Math.PI/2?new Line3(new Vector3(.05+this._dimensions.x,0,this._dimensions.z-.05),new Vector3(.05+this._dimensions.x,this._dimensions.y+.05,this._dimensions.z-.05)):new Line3(new Vector3(.05+this._dimensions.x,0,.05),new Vector3(.05+this._dimensions.x,this._dimensions.y+.05,.05))}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.addToUiScene(this._uiScene),this.addToObject(this._object)}disableDimensions(){this._enabled=!1,this._dimensionsVisible&&(this._dimensionsVisible=!1,this._visibilityChangedCallback()),this.removeFromUiScene(this._uiScene),this.removeFromObject(this._object)}_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 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._dimensionLineGroup&&this._dimensionTextGroup&&(this._dimensionLineGroup.visible=e,this._dimensionTextGroup.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()}setObject(e,t=0){this._object=e,this._objectRotation=t}setUiScene(e){this._uiScene=e}isInitialized(){return this._initialized.wait()}areDimensionsEnabled(){return this._enabled}_getRotation(){const e=this._object.getWorldPosition(new Vector3);return normalizeRotation(Math.atan2(this._cameraPosition.x-e.x,this._cameraPosition.z-e.z)-this._objectRotation)}}__decorate([inject],DimensioningHelper.prototype,"_unitFormatter",void 0);export{DimensioningHelper as default};
|
|
2
|
-
//# sourceMappingURL=dimensioning-helper-
|
|
1
|
+
import{aG as normalizeRotation,w as dispose,_ as __decorate,i as inject,ah as AsyncGuard,aH as AsyncDependencyLoader,ad as convertToTHREE}from"./roomle-dependency-injection-d3a8c907.js";import{O as Object3D,a as Vector3,h as MeshBasicMaterial,w as DoubleSide,br as MeshPhongMaterial,B as BufferGeometry,z as Mesh,Q as Quaternion,bc as PlaneGeometry,K as Group,u as LineBasicMaterial,G as Line,b as BufferAttribute,b0 as Line3,ad as Box3}from"./main-thread-to-worker-82b32425.js";import{T as TextGeometry}from"./TextGeometry-f0a85d6a.js";const PLANE_MATERIAL="component_dimensioning_plane_material",TEXT_MATERIAL="component_dimensioning_text_material";class TextWithBackground extends 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 Vector3,this._initMaterials(),this._init(),this._update()}_initMaterials(){this._cacheHolder.materialCache.has(PLANE_MATERIAL)?this._planeMaterial=this._cacheHolder.materialCache.get(PLANE_MATERIAL):(this._planeMaterial=new MeshBasicMaterial({color:16777215,side:DoubleSide,opacity:.8,transparent:!0}),this._cacheHolder.materialCache.set(PLANE_MATERIAL,this._planeMaterial)),this._cacheHolder.materialCache.has(TEXT_MATERIAL)?this._textMaterial=this._cacheHolder.materialCache.get(TEXT_MATERIAL):(this._textMaterial=new MeshPhongMaterial({color:3618615}),this._cacheHolder.materialCache.set(TEXT_MATERIAL,this._textMaterial))}_init(){let e=new BufferGeometry;this._text=new Mesh(e,this._textMaterial),this._text.userData.ignoreComponentRaycast=!0,this._text.name="text with background text "+this._label,this._plane=new Mesh(e,this._planeMaterial),this._plane.userData.ignoreComponentRaycast=!0,this._plane.name="text with background plane "+this._label,this._textGeometry=new 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){this._position.copy(e),this._cameraPosition=i,this._label=t;const s=this.getWorldPosition(new Vector3),n=this._cameraPosition.distanceTo(s),o=Math.max(.01,n/150),h=Math.max(5e-4,n/5e3);this._parameters.bevelThickness=h,this._parameters.bevelSize=h,this._parameters.size=o,this._textGeometry=new TextGeometry(this._label,this._parameters),this._textGeometry.computeBoundingBox(),this._text.geometry=this._textGeometry,this._update()}_update(){if(this.topDown){let e=new Quaternion;e.setFromAxisAngle(new Vector3(-1,0,0),Math.PI/2),this._updateText(this._textGeometry,e,new Vector3)}else if(this._updateText(this._textGeometry,new Quaternion,new Vector3),this._cameraPosition){const e=this.getWorldPosition(new Vector3),t=normalizeRotation(Math.atan2(this._cameraPosition.x-e.x,this._cameraPosition.z-e.z)-this.parent.rotation.y);this._text.rotation.y=t,this._plane.rotation.y=t}}_updateText(e,t,i){let s=new Vector3;s.copy(this._position),i.x*=this._getXSign(),s.add(i);let n=e.boundingBox.getSize(new Vector3);e.center(),this._text.position.copy(s),t&&this._text.quaternion.copy(t);let o=new PlaneGeometry(n.x+.02,n.y+.02,32);o.center(),this._plane.geometry=o,this._plane.position.copy(s),t&&this._plane.quaternion.copy(t)}_getXSign(){return!this._cameraPosition||this._cameraPosition.x>=0?1:-1}dispose(){dispose(this)}}__decorate([inject],TextWithBackground.prototype,"_cacheHolder",void 0);class DimensioningHelper{constructor(e){this._objectRotation=0,this._cameraPosition=new Vector3,this._topDimensions=!1,this._initialized=new AsyncGuard,this._enabled=!1,this._dimensionsVisible=!1,this._dimensionLineGroup=new Group,this._dimensionTextGroup=new Object3D,this._creator_=e,this._lineMaterial=new LineBasicMaterial({color:3618615,linewidth:2});let t=new BufferGeometry;this._widthLine=new Line(t,this._lineMaterial),this._widthLine.userData.ignoreComponentRaycast=!0,this._widthLine.name="dimension width line",this._dimensionLineGroup.add(this._widthLine),this._heightLine=new Line(t,this._lineMaterial),this._heightLine.userData.ignoreComponentRaycast=!0,this._heightLine.name="dimension height line",this._dimensionLineGroup.add(this._heightLine),this._depthLine=new Line(t,this._lineMaterial),this._depthLine.userData.ignoreComponentRaycast=!0,this._depthLine.name="dimension depth line",this._dimensionLineGroup.add(this._depthLine),this._planeMaterial=new MeshBasicMaterial({color:16777215,side:DoubleSide,opacity:.8,transparent:!0}),AsyncDependencyLoader.loadFont("static/rubik_regular_sub-2dd2d5cca49018c5.json").then(e=>{this._font=e,this._loaded()})}_loaded(){this.update(!1),this.addToObject(this._object),this.addToUiScene(this._uiScene),this._initialized.resolve()}_performUpdate(e){this._enabled&&(this._dimensions||e)&&this._font&&(this._updateHeight(),this._updateWidth(),this._updateDepth())}_updateWidth(){let e=new BufferGeometry,t=this._getWidthEdge(),i=[t.start.x,t.start.y,t.start.z,t.end.x,t.end.y,t.end.z];e.setAttribute("position",new BufferAttribute(new Float32Array(i),3)),this._widthLine.geometry.dispose(),this._widthLine.geometry=e;let s=t.getCenter(new Vector3);this._widthText||(this._widthText=new TextWithBackground(this._font),this._dimensionTextGroup.add(this._widthText)),this._widthText.topDown=this._topDimensions;const n=this._unitFormatter.formatMMValueToUnitString(1e3*this._dimensions.x);this._widthText.update(s,n,this._cameraPosition)}_updateHeight(){let e=new BufferGeometry,t=this._getHeightEdge(),i=[t.start.x,t.start.y,t.start.z,t.end.x,t.end.y,t.end.z];e.setAttribute("position",new BufferAttribute(new Float32Array(i),3)),this._heightLine.geometry.dispose(),this._heightLine.geometry=e;let s=t.getCenter(new Vector3);this._heightText||(this._heightText=new TextWithBackground(this._font),this._dimensionTextGroup.add(this._heightText)),this._heightText.topDown=this._topDimensions;const n=this._unitFormatter.formatMMValueToUnitString(1e3*this._dimensions.y);this._heightText.update(s,n,this._cameraPosition)}_updateDepth(){let e=new BufferGeometry,t=this._getDepthEdge(),i=[t.start.x,t.start.y,t.start.z,t.end.x,t.end.y,t.end.z];e.setAttribute("position",new BufferAttribute(new Float32Array(i),3)),this._depthLine.geometry.dispose(),this._depthLine.geometry=e;let s=t.getCenter(new Vector3);this._depthText||(this._depthText=new TextWithBackground(this._font),this._dimensionTextGroup.add(this._depthText)),this._depthText.topDown=this._topDimensions;const n=this._unitFormatter.formatMMValueToUnitString(-1e3*this._dimensions.z);this._depthText.update(s,n,this._cameraPosition)}updateSize(e){this._origin=convertToTHREE(e.origin),this._dimensionLineGroup.position.x=this._origin.x-this._object.position.x,this._dimensionLineGroup.position.y=this._origin.y-this._object.position.y,this._dimensionLineGroup.position.z=this._origin.z-this._object.position.z,this._dimensions=convertToTHREE(e.size);const t=this._dimensionLineGroup.localToWorld(new Vector3);this._dimensionTextGroup.position.copy(t),this.update()}update(e=!1){this._enabled&&!this._dimensionsVisible&&(this._dimensionsVisible=!0,this._visibilityChangedCallback()),this._performUpdate(e)}addToObject(e){this._widthText&&this._widthLine&&this._heightText&&this._heightLine&&this._heightText&&this._heightLine&&e.add(this._dimensionLineGroup)}removeFromObject(e){e.remove(this._dimensionLineGroup),this.update()}addToUiScene(e){if(!(this._widthText&&this._heightText&&this._depthText&&this._object))return;const t=this._dimensionLineGroup.localToWorld(new Vector3);this._dimensionTextGroup.position.copy(t),this._dimensionTextGroup.rotation.y=this._objectRotation,e.add(this._dimensionTextGroup),this.update()}removeFromUiScene(e){e.remove(this._dimensionTextGroup),this.update()}_getWidthEdge(){const e=this._getRotation();return e>Math.PI/2||e<-Math.PI/2?new Line3(new Vector3(-.05,0,this._dimensions.z-.05),new Vector3(this._dimensions.x+.05,0,this._dimensions.z-.05)):new Line3(new Vector3(-.05,0,.05),new Vector3(this._dimensions.x+.05,0,.05))}_getDepthEdge(){return this._getRotation()>0?new Line3(new Vector3(.05+this._dimensions.x,0,.05),new Vector3(.05+this._dimensions.x,0,this._dimensions.z-.05)):new Line3(new Vector3(-.05,0,.05),new Vector3(-.05,0,this._dimensions.z-.05))}_getHeightEdge(){const e=this._getRotation();return e>0&&e<Math.PI/2?new Line3(new Vector3(-.05,0,.05),new Vector3(-.05,this._dimensions.y+.05,.05)):e>Math.PI/2?new Line3(new Vector3(-.05,0,this._dimensions.z-.05),new Vector3(-.05,this._dimensions.y+.05,this._dimensions.z-.05)):e<-Math.PI/2?new Line3(new Vector3(.05+this._dimensions.x,0,this._dimensions.z-.05),new Vector3(.05+this._dimensions.x,this._dimensions.y+.05,this._dimensions.z-.05)):new Line3(new Vector3(.05+this._dimensions.x,0,.05),new Vector3(.05+this._dimensions.x,this._dimensions.y+.05,.05))}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.addToUiScene(this._uiScene),this.addToObject(this._object)}disableDimensions(){this._enabled=!1,this._dimensionsVisible&&(this._dimensionsVisible=!1,this._visibilityChangedCallback()),this.removeFromUiScene(this._uiScene),this.removeFromObject(this._object)}_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 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._dimensionLineGroup&&this._dimensionTextGroup&&(this._dimensionLineGroup.visible=e,this._dimensionTextGroup.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()}setObject(e,t=0){this._object=e,this._objectRotation=t}setUiScene(e){this._uiScene=e}isInitialized(){return this._initialized.wait()}areDimensionsEnabled(){return this._enabled}_getRotation(){const e=this._object.getWorldPosition(new Vector3);return normalizeRotation(Math.atan2(this._cameraPosition.x-e.x,this._cameraPosition.z-e.z)-this._objectRotation)}}__decorate([inject],DimensioningHelper.prototype,"_unitFormatter",void 0);export{DimensioningHelper as default};
|
|
2
|
+
//# sourceMappingURL=dimensioning-helper-02499f1a.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dimensioning-helper-
|
|
1
|
+
{"version":3,"file":"dimensioning-helper-02499f1a.js","sources":["../../packages/configurator-core/public/fonts/rubik_regular_sub.json"],"sourcesContent":["export default \"static/rubik_regular_sub-2dd2d5cca49018c5.json\""],"names":[],"mappings":"y7IAAe"}
|
package/lib/{dimensioning-helper-c84c6aa3.nomodule.js → dimensioning-helper-be6a25b7.nomodule.js}
RENAMED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
System.register(["./roomle-dependency-injection-
|
|
2
|
-
//# sourceMappingURL=dimensioning-helper-
|
|
1
|
+
System.register(["./roomle-dependency-injection-b567df3a.nomodule.js","./main-thread-to-worker-ff04af1e.nomodule.js","./TextGeometry-b57a793b.nomodule.js"],(function(t){var i,e,s,n,h,o,a,_,d,r,p,m,l,c,u,x,g,w,b,y,T,L,G;return{setters:[function(t){i=t.aG,e=t.w,s=t._,n=t.i,h=t.ah,o=t.aH,a=t.ad},function(t){_=t.O,d=t.a,r=t.h,p=t.w,m=t.br,l=t.B,c=t.z,u=t.Q,x=t.bc,g=t.K,w=t.u,b=t.G,y=t.b,T=t.b0,L=t.ad},function(t){G=t.T}],execute:function(){const z="component_dimensioning_plane_material",M="component_dimensioning_text_material";class j extends _{constructor(t){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=t,this._position=new d,this._initMaterials(),this._init(),this._update()}_initMaterials(){this._cacheHolder.materialCache.has(z)?this._planeMaterial=this._cacheHolder.materialCache.get(z):(this._planeMaterial=new r({color:16777215,side:p,opacity:.8,transparent:!0}),this._cacheHolder.materialCache.set(z,this._planeMaterial)),this._cacheHolder.materialCache.has(M)?this._textMaterial=this._cacheHolder.materialCache.get(M):(this._textMaterial=new m({color:3618615}),this._cacheHolder.materialCache.set(M,this._textMaterial))}_init(){let t=new l;this._text=new c(t,this._textMaterial),this._text.userData.ignoreComponentRaycast=!0,this._text.name="text with background text "+this._label,this._plane=new c(t,this._planeMaterial),this._plane.userData.ignoreComponentRaycast=!0,this._plane.name="text with background plane "+this._label,this._textGeometry=new G(this._label,this._parameters),this._textGeometry.computeBoundingBox(),this._text.geometry=this._textGeometry,this.add(this._text),this.add(this._plane)}update(t,i,e){this._position.copy(t),this._cameraPosition=e,this._label=i;const s=this.getWorldPosition(new d),n=this._cameraPosition.distanceTo(s),h=Math.max(.01,n/150),o=Math.max(5e-4,n/5e3);this._parameters.bevelThickness=o,this._parameters.bevelSize=o,this._parameters.size=h,this._textGeometry=new G(this._label,this._parameters),this._textGeometry.computeBoundingBox(),this._text.geometry=this._textGeometry,this._update()}_update(){if(this.topDown){let t=new u;t.setFromAxisAngle(new d(-1,0,0),Math.PI/2),this._updateText(this._textGeometry,t,new d)}else if(this._updateText(this._textGeometry,new u,new d),this._cameraPosition){const t=this.getWorldPosition(new d),e=i(Math.atan2(this._cameraPosition.x-t.x,this._cameraPosition.z-t.z)-this.parent.rotation.y);this._text.rotation.y=e,this._plane.rotation.y=e}}_updateText(t,i,e){let s=new d;s.copy(this._position),e.x*=this._getXSign(),s.add(e);let n=t.boundingBox.getSize(new d);t.center(),this._text.position.copy(s),i&&this._text.quaternion.copy(i);let h=new x(n.x+.02,n.y+.02,32);h.center(),this._plane.geometry=h,this._plane.position.copy(s),i&&this._plane.quaternion.copy(i)}_getXSign(){return!this._cameraPosition||this._cameraPosition.x>=0?1:-1}dispose(){e(this)}}s([n],j.prototype,"_cacheHolder",void 0);class D{constructor(t){this._objectRotation=0,this._cameraPosition=new d,this._topDimensions=!1,this._initialized=new h,this._enabled=!1,this._dimensionsVisible=!1,this._dimensionLineGroup=new g,this._dimensionTextGroup=new _,this._creator_=t,this._lineMaterial=new w({color:3618615,linewidth:2});let i=new l;this._widthLine=new b(i,this._lineMaterial),this._widthLine.userData.ignoreComponentRaycast=!0,this._widthLine.name="dimension width line",this._dimensionLineGroup.add(this._widthLine),this._heightLine=new b(i,this._lineMaterial),this._heightLine.userData.ignoreComponentRaycast=!0,this._heightLine.name="dimension height line",this._dimensionLineGroup.add(this._heightLine),this._depthLine=new b(i,this._lineMaterial),this._depthLine.userData.ignoreComponentRaycast=!0,this._depthLine.name="dimension depth line",this._dimensionLineGroup.add(this._depthLine),this._planeMaterial=new r({color:16777215,side:p,opacity:.8,transparent:!0}),o.loadFont("static/rubik_regular_sub-2dd2d5cca49018c5.json").then(t=>{this._font=t,this._loaded()})}_loaded(){this.update(!1),this.addToObject(this._object),this.addToUiScene(this._uiScene),this._initialized.resolve()}_performUpdate(t){this._enabled&&(this._dimensions||t)&&this._font&&(this._updateHeight(),this._updateWidth(),this._updateDepth())}_updateWidth(){let t=new l,i=this._getWidthEdge(),e=[i.start.x,i.start.y,i.start.z,i.end.x,i.end.y,i.end.z];t.setAttribute("position",new y(new Float32Array(e),3)),this._widthLine.geometry.dispose(),this._widthLine.geometry=t;let s=i.getCenter(new d);this._widthText||(this._widthText=new j(this._font),this._dimensionTextGroup.add(this._widthText)),this._widthText.topDown=this._topDimensions;const n=this._unitFormatter.formatMMValueToUnitString(1e3*this._dimensions.x);this._widthText.update(s,n,this._cameraPosition)}_updateHeight(){let t=new l,i=this._getHeightEdge(),e=[i.start.x,i.start.y,i.start.z,i.end.x,i.end.y,i.end.z];t.setAttribute("position",new y(new Float32Array(e),3)),this._heightLine.geometry.dispose(),this._heightLine.geometry=t;let s=i.getCenter(new d);this._heightText||(this._heightText=new j(this._font),this._dimensionTextGroup.add(this._heightText)),this._heightText.topDown=this._topDimensions;const n=this._unitFormatter.formatMMValueToUnitString(1e3*this._dimensions.y);this._heightText.update(s,n,this._cameraPosition)}_updateDepth(){let t=new l,i=this._getDepthEdge(),e=[i.start.x,i.start.y,i.start.z,i.end.x,i.end.y,i.end.z];t.setAttribute("position",new y(new Float32Array(e),3)),this._depthLine.geometry.dispose(),this._depthLine.geometry=t;let s=i.getCenter(new d);this._depthText||(this._depthText=new j(this._font),this._dimensionTextGroup.add(this._depthText)),this._depthText.topDown=this._topDimensions;const n=this._unitFormatter.formatMMValueToUnitString(-1e3*this._dimensions.z);this._depthText.update(s,n,this._cameraPosition)}updateSize(t){this._origin=a(t.origin),this._dimensionLineGroup.position.x=this._origin.x-this._object.position.x,this._dimensionLineGroup.position.y=this._origin.y-this._object.position.y,this._dimensionLineGroup.position.z=this._origin.z-this._object.position.z,this._dimensions=a(t.size);const i=this._dimensionLineGroup.localToWorld(new d);this._dimensionTextGroup.position.copy(i),this.update()}update(t=!1){this._enabled&&!this._dimensionsVisible&&(this._dimensionsVisible=!0,this._visibilityChangedCallback()),this._performUpdate(t)}addToObject(t){this._widthText&&this._widthLine&&this._heightText&&this._heightLine&&this._heightText&&this._heightLine&&t.add(this._dimensionLineGroup)}removeFromObject(t){t.remove(this._dimensionLineGroup),this.update()}addToUiScene(t){if(!(this._widthText&&this._heightText&&this._depthText&&this._object))return;const i=this._dimensionLineGroup.localToWorld(new d);this._dimensionTextGroup.position.copy(i),this._dimensionTextGroup.rotation.y=this._objectRotation,t.add(this._dimensionTextGroup),this.update()}removeFromUiScene(t){t.remove(this._dimensionTextGroup),this.update()}_getWidthEdge(){const t=this._getRotation();return t>Math.PI/2||t<-Math.PI/2?new T(new d(-.05,0,this._dimensions.z-.05),new d(this._dimensions.x+.05,0,this._dimensions.z-.05)):new T(new d(-.05,0,.05),new d(this._dimensions.x+.05,0,.05))}_getDepthEdge(){return this._getRotation()>0?new T(new d(.05+this._dimensions.x,0,.05),new d(.05+this._dimensions.x,0,this._dimensions.z-.05)):new T(new d(-.05,0,.05),new d(-.05,0,this._dimensions.z-.05))}_getHeightEdge(){const t=this._getRotation();return t>0&&t<Math.PI/2?new T(new d(-.05,0,.05),new d(-.05,this._dimensions.y+.05,.05)):t>Math.PI/2?new T(new d(-.05,0,this._dimensions.z-.05),new d(-.05,this._dimensions.y+.05,this._dimensions.z-.05)):t<-Math.PI/2?new T(new d(.05+this._dimensions.x,0,this._dimensions.z-.05),new d(.05+this._dimensions.x,this._dimensions.y+.05,this._dimensions.z-.05)):new T(new d(.05+this._dimensions.x,0,.05),new d(.05+this._dimensions.x,this._dimensions.y+.05,.05))}onDimensionsVisibilityChanged(t){this._onChange=t}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.addToUiScene(this._uiScene),this.addToObject(this._object)}disableDimensions(){this._enabled=!1,this._dimensionsVisible&&(this._dimensionsVisible=!1,this._visibilityChangedCallback()),this.removeFromUiScene(this._uiScene),this.removeFromObject(this._object)}_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 t=new L;return t.expandByObject(this._widthLine),t.expandByObject(this._widthText),t.expandByObject(this._heightLine),t.expandByObject(this._heightText),t.expandByObject(this._depthLine),t.expandByObject(this._depthText),t}setVisibility(t){this._dimensionLineGroup&&this._dimensionTextGroup&&(this._dimensionLineGroup.visible=t,this._dimensionTextGroup.visible=t)}moveCameraStart(t){this.setVisibility(!1),this._cameraPosition=t,this.update()}moveCameraEnd(t){this.setVisibility(!0),this._cameraPosition=t,this.update()}clearScene(t){this._clear()}setObject(t,i=0){this._object=t,this._objectRotation=i}setUiScene(t){this._uiScene=t}isInitialized(){return this._initialized.wait()}areDimensionsEnabled(){return this._enabled}_getRotation(){const t=this._object.getWorldPosition(new d);return i(Math.atan2(this._cameraPosition.x-t.x,this._cameraPosition.z-t.z)-this._objectRotation)}}t("default",D),s([n],D.prototype,"_unitFormatter",void 0)}}}));
|
|
2
|
+
//# sourceMappingURL=dimensioning-helper-be6a25b7.nomodule.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dimensioning-helper-
|
|
1
|
+
{"version":3,"file":"dimensioning-helper-be6a25b7.nomodule.js","sources":["../../packages/configurator-core/public/fonts/rubik_regular_sub.json"],"sourcesContent":["export default \"static/rubik_regular_sub-2dd2d5cca49018c5.json\""],"names":[],"mappings":"y4HAAe"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
System.register(["./script-loader-
|
|
2
|
-
//# sourceMappingURL=glb-viewer-
|
|
1
|
+
System.register(["./script-loader-ed493cd8.nomodule.js","./roomle-dependency-injection-b567df3a.nomodule.js","./camera-behaviour-eee26e60.nomodule.js","./main-thread-to-worker-ff04af1e.nomodule.js","./default-light-setting-8492f1aa.nomodule.js","./glb-viewer-camera-behaviour-bee9e036.nomodule.js","./query-params-helper-712890e0.nomodule.js"],(function(e){var t,r,i,n,a,s,o,h,c,d,l,u,m,_,p,g,w,v,f,b,C,S,L,B,M,y,I,x,G,E,j,O,F;return{setters:[function(e){t=e.S,r=e.M},function(e){i=e.aw,n=e.D,a=e.L,s=e.R,o=e.a1,h=e._,c=e.i,d=e.m,l=e.q,u=e.r,m=e.w,_=e.b},function(e){p=e.C,g=e.L,w=e.S,v=e.T},function(e){f=e.a,b=e.ad,C=e.ag,S=e.Q,L=e.A,B=e.C,M=e.aE,y=e.aR,I=e.bz,x=e.i,G=e.bn,E=e.N,j=e.bM},function(e){O=e.D},function(e){F=e.G},function(){}],execute:function(){const D=[new n("script-loader",t),new n("glb-input-manager",class extends i{},1),new n("logger",a),new n("rapi-access",s)];class P extends p{constructor(){super(...arguments),this.shouldIgnoreStandardBehavior=!1}adjust(e,t,r,i,n){let a=new f(-e.x/2,0,-e.z/2),s=new f(e.x/2,e.y,e.z/2);this._boundingBox=new b(a,s);let o=new C(-Math.PI/2+i,r,0,"ZYX"),h=(new S).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 z extends g{constructor(e,t){super(e,t),this._params={ambientLight:{color:"#ffffff"}},this._ambientLight=new L(new B(this._params.ambientLight.color),.5),this.addToScene()}addToScene(){this._scene.add(this._ambientLight)}removeFromScene(){this._scene.remove(this._ambientLight)}reload(){this.removeFromScene(),this.addToScene()}showGUI(){let e=o();if(e&&this._ambientLight){let t=e.addFolder("Ambient Light");t.add(this._ambientLight,"visible"),t.add(this._ambientLight,"intensity").min(0).max(5).step(.1),t.addColor(this._params.ambientLight,"color").onChange(e=>{this._ambientLight.color=new B(e)})}}}class A extends w{constructor(e,t){super(e,t,d.GLB,M.CAMERA_3D),this._itemsCount=0,this._standardSceneBackgroundColor=this._scene.background,this._initData.legacyLight&&(this._renderer.capabilities.maxTextures>8?this.loadDynamicLightSetting(l.createDynamicLightSettingSource(null,u.CAMERA)):(console.warn("this device has a maximum of 8 texture units thus we are using a simpler light setting"),this._lightSetting=new z(this._scene)))}createCameraControl(e,t){this._changeCameraBehaviour(new F(new P(this._creator_,this._getInputManager(),new f(-1,1,1)),this._cameraBehaviourState))}_getInputManager(){return this._glbInputManager}async loadStaticItem(e,t){const r=await this._rapiAccess.getItem(e);if(r.configuration)return Promise.reject();const i=y(r);return i?this.loadGLB(i,!0,void 0,t):Promise.reject(new Error("GLB Url not detected"))}loadGLB(e,t=!0,r=new f(1,1,1),i){return this.clearScene(),new Promise((n,a)=>{this._loadGLB(e,new f(0,0,0),0,void 0,r,void 0,void 0,i).then(e=>{this._currentGLB=e,this._scene.add(this._currentGLB);let r=(new b).setFromObject(this._currentGLB);t&&this.cameraBehaviour.cameraControl instanceof P&&this.glbViewerCameraBehaviour.updateCameraOnItemLoaded(r),this._updateBounds(r,null,!0),n()},a)})}preparePerspectiveImage(e,t,r){return new Promise(i=>{var n,a;t||(t=1e3),r||(r=1e3),e||((e=new I({antialias:!0})).setSize(t,r),e.outputColorSpace=x,e.autoClear=!1,e.shadowMap.enabled=!0,e.shadowMap.type=G);let s=this.cameraBehaviour.cameraControl.getCamera().clone();s instanceof E&&(s.aspect=t/r,s.updateProjectionMatrix()),null===(n=this._lightSetting)||void 0===n||n.removeFromScene();let o=new O(this._scene);e.render(this._scene,s);let h=e.domElement.toDataURL();e.domElement.toBlob(e=>{i({image:h,width:t,height:r,blob:e})},"image/png"),o.removeFromScene(),null===(a=this._lightSetting)||void 0===a||a.addToScene()})}adjustCamera(e,t,r,i){if(this.cameraBehaviour.cameraControl instanceof P){let n=(new b).setFromObject(this._scene).getSize(new f);this.cameraBehaviour.cameraControl.adjust(n,e,t,r,i),this._requestRender()}}onStart(e){this._itemsCount=e,this._scene.background=null,this.cameraBehaviour.cameraControl instanceof P&&(this.cameraBehaviour.cameraControl.shouldIgnoreStandardBehavior=!0)}onElementFinished(e){this._itemsCount,Math.round(100/this._itemsCount*e)}onFinished(e){this._scene.background=this._standardSceneBackgroundColor,this.cameraBehaviour.cameraControl instanceof P&&(this.cameraBehaviour.cameraControl.shouldIgnoreStandardBehavior=!1)}clearScene(){this._currentGLB&&(this._scene.remove(this._currentGLB),m(this._currentGLB),this._currentGLB=null),super.clearScene()}enableHD(){super.enableHD()}sceneChanged(){}getBounds(){return this._currentGLB?(new b).setFromObject(this._currentGLB):null}get glbViewerCameraBehaviour(){return this.cameraBehaviour}getGeometryBounds(){return null}cameraBehaviourChanged(){super.cameraBehaviourChanged(),this.cameraBehaviour.cameraControl.addEventListener(3,()=>{this._requestRender()},this),this.cameraBehaviour.cameraControl.addEventListener(4,()=>{this._requestRender()},this)}}h([c],A.prototype,"_glbInputManager",void 0),h([c],A.prototype,"_rapiAccess",void 0);class U{constructor(e,t,r){this._prefix="https://furniture.roomle.com/3d/glb/",this._listeners=new Set,this._finishedItems=0,this._sceneManager=e,this._renderer=new I({antialias:!0,alpha:!0}),this._width=t,this._height=r,this._renderer.setSize(t,r),this._renderer.setClearColor(16777215,0),this._renderer.outputColorSpace=x}addListener(e){this._listeners.add(e)}removeListener(e){this._listeners.delete(e)}start(e){return this._entries=[],e.forEach(e=>{this._entries.push(this._transform(e))}),this._finishedItems=0,this._listeners.forEach(e=>e.onStart(this._entries.length)),this._zip=new window.JSZip,this._doNextEntry(),new Promise(e=>{this._resolve=e})}_transform(e){return{name:e.path.replace(".glb",".png"),url:this._prefix+e.path,position:new f(e.camera.position.x,e.camera.position.z,-e.camera.position.y),fov:2*e.camera.fieldOfView,yaw:e.camera.rotation.z,pitch:e.camera.rotation.x}}_doNextEntry(){0===this._entries.length?(this._listeners.forEach(e=>e.onFinished(this._zip)),this._resolve(this._zip)):this._processEntry(this._entries[0])}_processEntry(e){this._sceneManager.loadGLB(e.url,!1,void 0).then(()=>{this._sceneManager.adjustCamera(e.position,e.yaw,e.pitch,e.fov),this._sceneManager.preparePerspectiveImage(this._renderer,this._width,this._height).then(t=>{this._entryFinished(e,t)})})}_entryFinished(e,t){let r=this._entries.indexOf(e);r>-1&&this._entries.splice(r,1),this._finishedItems++,this._listeners.forEach(e=>e.onElementFinished(this._finishedItems)),this._zip.file(e.name,t.blob),this._doNextEntry()}}class R{constructor(e){this._currentIdOrUrl=null,this._creator_=e}setCameraOffset(e){this._sceneManager.setCameraOffset(e)}getCameraOffset(){return this._sceneManager.getCameraOffset()}init(e,t){return this.setOverrides(t),this._domHelper.setDomElement(e),this._sceneManager?(this._lifeCycleManager.resume(),Promise.resolve()):new Promise(this._initPromiseCallback.bind(this))}_initPromiseCallback(e,t){Promise.all([this._scriptLoader.fetch(v,{id:"tween-js"})]).then(()=>{this._sceneManager=new A(this._creator_,{left:0,top:1,right:1,bottom:0}),this._sceneManager.enableHD(),e()})}clearScene(){this._sceneManager.clearScene()}loadGLB(e,t=1,r){return this._currentIdOrUrl=e,this._rapiAccess.trackView(e),this._sceneManager.loadGLB(e,!0,new f(t,t,t),r)}loadStaticItem(e,t){return this._currentIdOrUrl=e,this._rapiAccess.trackView(e),this._sceneManager.loadStaticItem(e,t)}getCurrentId(){return this._currentIdOrUrl}loadSceneSetting(e){return this._sceneManager.loadSceneSettings(e)}preparePerspectiveImage(){return this._sceneManager.preparePerspectiveImage()}processRenderList(e,t=320,r=320){let i=JSON.parse(e);this._scriptLoader.fetch("static/jszip.min-c96375d50e72b199.js",{id:"jszip-js"}).then(()=>{let e=new U(this._sceneManager,t,r);e.addListener(this._sceneManager),e.start(i.items).then(t=>{t.generateAsync({type:"blob"}).then(t=>{j("content.zip",URL.createObjectURL(t)),e.removeListener(this._sceneManager)})})})}setOverrides(e){e&&(this._initData.setOverrides(e),this._globalInitData.setOverrides(e))}updateSize(){this._sceneManager.updateCamera()}getMain(){}resumeTest(e){this._domHelper.setDomElement(e),this._lifeCycleManager.resume()}pauseTest(){this._lifeCycleManager.pause()}showGUI(){this._sceneManager.showGUI()}get callbacks(){return{}}getScene(){return this._sceneManager.getScene()}updateScene(){this._sceneManager.updateScene()}getUnitFormatter(){return this._unitFormatter}getStorage(){return this._idbManager}setEnvironmentMap(e){const{url:t,intensity:r,rotation:i,maxLightSources:n}=e;this._sceneManager.setEnvironmentMap(t,r,i,n)}}h([c],R.prototype,"_rapiAccess",void 0),h([c],R.prototype,"_domHelper",void 0),h([c],R.prototype,"_scriptLoader",void 0),h([c],R.prototype,"_lifeCycleManager",void 0),h([c],R.prototype,"_initData",void 0),h([c],R.prototype,"_globalInitData",void 0),h([c],R.prototype,"_unitFormatter",void 0),h([c],R.prototype,"_idbManager",void 0),e("GlbViewer",class extends r{setupGlobals(){}setupDependencies(){_.setup(D),this.lookup("logger",this._context)}cleanUpGlobals(){throw new Error("Method not implemented.")}cleanUpDependencies(){throw new Error("Method not implemented.")}bootFinished(){this._viewer=new R(this._context),window.RoomleGLBViewer||(window.RoomleGLBViewer=this._viewer)}getApi(){return this._viewer}getContextName(){return"glb-viewer"}})}}}));
|
|
2
|
+
//# sourceMappingURL=glb-viewer-7282caf7.nomodule.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"glb-viewer-
|
|
1
|
+
{"version":3,"file":"glb-viewer-7282caf7.nomodule.js","sources":["../../node_modules/jszip/dist/jszip.min.js"],"sourcesContent":["export default \"static/jszip.min-c96375d50e72b199.js\""],"names":[],"mappings":"yqPAAe"}
|
package/lib/{glb-viewer-camera-behaviour-6088e966.js → glb-viewer-camera-behaviour-94516099.js}
RENAMED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{b as CameraBehaviour}from"./camera-behaviour-
|
|
2
|
-
//# sourceMappingURL=glb-viewer-camera-behaviour-
|
|
1
|
+
import{b as CameraBehaviour}from"./camera-behaviour-d6af6d09.js";class GlbViewerCameraBehaviour extends CameraBehaviour{get cameraControl(){return this._cameraControl}updateCameraOnItemLoaded(a){this.cameraControl.updateAndReset(a,!1)}}export{GlbViewerCameraBehaviour as G};
|
|
2
|
+
//# sourceMappingURL=glb-viewer-camera-behaviour-94516099.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"glb-viewer-camera-behaviour-94516099.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
System.register(["./camera-behaviour-
|
|
2
|
-
//# sourceMappingURL=glb-viewer-camera-behaviour-
|
|
1
|
+
System.register(["./camera-behaviour-eee26e60.nomodule.js"],(function(e){var t;return{setters:[function(e){t=e.b}],execute:function(){e("G",class extends t{get cameraControl(){return this._cameraControl}updateCameraOnItemLoaded(e){this.cameraControl.updateAndReset(e,!1)}})}}}));
|
|
2
|
+
//# sourceMappingURL=glb-viewer-camera-behaviour-bee9e036.nomodule.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"glb-viewer-camera-behaviour-bee9e036.nomodule.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{S as ScriptLoader,M as Main}from"./script-loader-234d078e.js";import{aw as InputManager,D as DependencyInjectionAssignment,L as Logger,R as RapiAccess,a1 as getGUI,_ as __decorate,i as inject,m as CANVAS_ID,q as DynamicLightSettingLoader,r as PREDEFINED_LIGHTSETTING,w as dispose,b as RoomleDependencyInjection}from"./roomle-dependency-injection-ae5fa28d.js";import{C as CameraControl3D,L as LightSetting,S as SceneManager,T as TWEEN_FILE_NAME}from"./camera-behaviour-c7eaa412.js";import{a as Vector3,ad as Box3,ag as Euler,Q as Quaternion,A as AmbientLight,C as Color,aE as CAMERA_TYPE,aR as getGlbUrl,bz as WebGLRenderer,i as SRGBColorSpace,bn as BasicShadowMap,N as PerspectiveCamera,bM as download}from"./main-thread-to-worker-82b32425.js";import{D as DefaultLightSetting}from"./default-light-setting-50a8aae2.js";import{G as GlbViewerCameraBehaviour}from"./glb-viewer-camera-behaviour-6088e966.js";import"./query-params-helper-68ed40a6.js";const INJECTABLES=[new DependencyInjectionAssignment("script-loader",ScriptLoader),new DependencyInjectionAssignment("glb-input-manager",class extends InputManager{},1),new DependencyInjectionAssignment("logger",Logger),new DependencyInjectionAssignment("rapi-access",RapiAccess)];class AdjustableCameraControl3D extends CameraControl3D{constructor(){super(...arguments),this.shouldIgnoreStandardBehavior=!1}adjust(e,t,r,a,i){let n=new Vector3(-e.x/2,0,-e.z/2),s=new Vector3(e.x/2,e.y,e.z/2);this._boundingBox=new Box3(n,s);let o=new Euler(-Math.PI/2+a,r,0,"ZYX"),c=(new Quaternion).setFromEuler(o);this._camera.updateProjectionMatrix(),this._camera.quaternion.copy(c),this._camera.position.copy(t)}_update(e){this.shouldIgnoreStandardBehavior?this._saveYawAndPitch():super._update(e)}animateCamera(e){return!!this.shouldIgnoreStandardBehavior||super.animateCamera(e)}}class GLBViewerLightSetting extends LightSetting{constructor(e,t){super(e,t),this._params={ambientLight:{color:"#ffffff"}},this._ambientLight=new AmbientLight(new Color(this._params.ambientLight.color),.5),this.addToScene()}addToScene(){this._scene.add(this._ambientLight)}removeFromScene(){this._scene.remove(this._ambientLight)}reload(){this.removeFromScene(),this.addToScene()}showGUI(){let e=getGUI();if(e&&this._ambientLight){let t=e.addFolder("Ambient Light");t.add(this._ambientLight,"visible"),t.add(this._ambientLight,"intensity").min(0).max(5).step(.1),t.addColor(this._params.ambientLight,"color").onChange(e=>{this._ambientLight.color=new Color(e)})}}}class GLBViewerSceneManager extends SceneManager{constructor(e,t){super(e,t,CANVAS_ID.GLB,CAMERA_TYPE.CAMERA_3D),this._itemsCount=0,this._standardSceneBackgroundColor=this._scene.background,this._initData.legacyLight&&(this._renderer.capabilities.maxTextures>8?this.loadDynamicLightSetting(DynamicLightSettingLoader.createDynamicLightSettingSource(null,PREDEFINED_LIGHTSETTING.CAMERA)):(console.warn("this device has a maximum of 8 texture units thus we are using a simpler light setting"),this._lightSetting=new GLBViewerLightSetting(this._scene)))}createCameraControl(e,t){this._changeCameraBehaviour(new GlbViewerCameraBehaviour(new AdjustableCameraControl3D(this._creator_,this._getInputManager(),new Vector3(-1,1,1)),this._cameraBehaviourState))}_getInputManager(){return this._glbInputManager}async loadStaticItem(e,t){const r=await this._rapiAccess.getItem(e);if(r.configuration)return Promise.reject();const a=getGlbUrl(r);return a?this.loadGLB(a,!0,void 0,t):Promise.reject(new Error("GLB Url not detected"))}loadGLB(e,t=!0,r=new Vector3(1,1,1),a){return this.clearScene(),new Promise((i,n)=>{this._loadGLB(e,new Vector3(0,0,0),0,void 0,r,void 0,void 0,a).then(e=>{this._currentGLB=e,this._scene.add(this._currentGLB);let r=(new Box3).setFromObject(this._currentGLB);t&&this.cameraBehaviour.cameraControl instanceof AdjustableCameraControl3D&&this.glbViewerCameraBehaviour.updateCameraOnItemLoaded(r),this._updateBounds(r,null,!0),i()},n)})}preparePerspectiveImage(e,t,r){return new Promise(a=>{var i,n;t||(t=1e3),r||(r=1e3),e||((e=new WebGLRenderer({antialias:!0})).setSize(t,r),e.outputColorSpace=SRGBColorSpace,e.autoClear=!1,e.shadowMap.enabled=!0,e.shadowMap.type=BasicShadowMap);let s=this.cameraBehaviour.cameraControl.getCamera().clone();s instanceof PerspectiveCamera&&(s.aspect=t/r,s.updateProjectionMatrix()),null===(i=this._lightSetting)||void 0===i||i.removeFromScene();let o=new DefaultLightSetting(this._scene);e.render(this._scene,s);let c=e.domElement.toDataURL();e.domElement.toBlob(e=>{a({image:c,width:t,height:r,blob:e})},"image/png"),o.removeFromScene(),null===(n=this._lightSetting)||void 0===n||n.addToScene()})}adjustCamera(e,t,r,a){if(this.cameraBehaviour.cameraControl instanceof AdjustableCameraControl3D){let i=(new Box3).setFromObject(this._scene).getSize(new Vector3);this.cameraBehaviour.cameraControl.adjust(i,e,t,r,a),this._requestRender()}}onStart(e){this._itemsCount=e,this._scene.background=null,this.cameraBehaviour.cameraControl instanceof AdjustableCameraControl3D&&(this.cameraBehaviour.cameraControl.shouldIgnoreStandardBehavior=!0)}onElementFinished(e){this._itemsCount,Math.round(100/this._itemsCount*e)}onFinished(e){this._scene.background=this._standardSceneBackgroundColor,this.cameraBehaviour.cameraControl instanceof AdjustableCameraControl3D&&(this.cameraBehaviour.cameraControl.shouldIgnoreStandardBehavior=!1)}clearScene(){this._currentGLB&&(this._scene.remove(this._currentGLB),dispose(this._currentGLB),this._currentGLB=null),super.clearScene()}enableHD(){super.enableHD()}sceneChanged(){}getBounds(){return this._currentGLB?(new Box3).setFromObject(this._currentGLB):null}get glbViewerCameraBehaviour(){return this.cameraBehaviour}getGeometryBounds(){return null}cameraBehaviourChanged(){super.cameraBehaviourChanged(),this.cameraBehaviour.cameraControl.addEventListener(3,()=>{this._requestRender()},this),this.cameraBehaviour.cameraControl.addEventListener(4,()=>{this._requestRender()},this)}}__decorate([inject],GLBViewerSceneManager.prototype,"_glbInputManager",void 0),__decorate([inject],GLBViewerSceneManager.prototype,"_rapiAccess",void 0);class GLBRenderWorker{constructor(e,t,r){this._prefix="https://furniture.roomle.com/3d/glb/",this._listeners=new Set,this._finishedItems=0,this._sceneManager=e,this._renderer=new WebGLRenderer({antialias:!0,alpha:!0}),this._width=t,this._height=r,this._renderer.setSize(t,r),this._renderer.setClearColor(16777215,0),this._renderer.outputColorSpace=SRGBColorSpace}addListener(e){this._listeners.add(e)}removeListener(e){this._listeners.delete(e)}start(e){return this._entries=[],e.forEach(e=>{this._entries.push(this._transform(e))}),this._finishedItems=0,this._listeners.forEach(e=>e.onStart(this._entries.length)),this._zip=new window.JSZip,this._doNextEntry(),new Promise(e=>{this._resolve=e})}_transform(e){return{name:e.path.replace(".glb",".png"),url:this._prefix+e.path,position:new Vector3(e.camera.position.x,e.camera.position.z,-e.camera.position.y),fov:2*e.camera.fieldOfView,yaw:e.camera.rotation.z,pitch:e.camera.rotation.x}}_doNextEntry(){0===this._entries.length?(this._listeners.forEach(e=>e.onFinished(this._zip)),this._resolve(this._zip)):this._processEntry(this._entries[0])}_processEntry(e){this._sceneManager.loadGLB(e.url,!1,void 0).then(()=>{this._sceneManager.adjustCamera(e.position,e.yaw,e.pitch,e.fov),this._sceneManager.preparePerspectiveImage(this._renderer,this._width,this._height).then(t=>{this._entryFinished(e,t)})})}_entryFinished(e,t){let r=this._entries.indexOf(e);r>-1&&this._entries.splice(r,1),this._finishedItems++,this._listeners.forEach(e=>e.onElementFinished(this._finishedItems)),this._zip.file(e.name,t.blob),this._doNextEntry()}}class RoomleGLBViewer{constructor(e){this._currentIdOrUrl=null,this._creator_=e}setCameraOffset(e){this._sceneManager.setCameraOffset(e)}getCameraOffset(){return this._sceneManager.getCameraOffset()}init(e,t){return this.setOverrides(t),this._domHelper.setDomElement(e),this._sceneManager?(this._lifeCycleManager.resume(),Promise.resolve()):new Promise(this._initPromiseCallback.bind(this))}_initPromiseCallback(e,t){Promise.all([this._scriptLoader.fetch(TWEEN_FILE_NAME,{id:"tween-js"})]).then(()=>{this._sceneManager=new GLBViewerSceneManager(this._creator_,{left:0,top:1,right:1,bottom:0}),this._sceneManager.enableHD(),e()})}clearScene(){this._sceneManager.clearScene()}loadGLB(e,t=1,r){return this._currentIdOrUrl=e,this._rapiAccess.trackView(e),this._sceneManager.loadGLB(e,!0,new Vector3(t,t,t),r)}loadStaticItem(e,t){return this._currentIdOrUrl=e,this._rapiAccess.trackView(e),this._sceneManager.loadStaticItem(e,t)}getCurrentId(){return this._currentIdOrUrl}loadSceneSetting(e){return this._sceneManager.loadSceneSettings(e)}preparePerspectiveImage(){return this._sceneManager.preparePerspectiveImage()}processRenderList(e,t=320,r=320){let a=JSON.parse(e);this._scriptLoader.fetch("static/jszip.min-c96375d50e72b199.js",{id:"jszip-js"}).then(()=>{let e=new GLBRenderWorker(this._sceneManager,t,r);e.addListener(this._sceneManager),e.start(a.items).then(t=>{t.generateAsync({type:"blob"}).then(t=>{download("content.zip",URL.createObjectURL(t)),e.removeListener(this._sceneManager)})})})}setOverrides(e){e&&(this._initData.setOverrides(e),this._globalInitData.setOverrides(e))}updateSize(){this._sceneManager.updateCamera()}getMain(){}resumeTest(e){this._domHelper.setDomElement(e),this._lifeCycleManager.resume()}pauseTest(){this._lifeCycleManager.pause()}showGUI(){this._sceneManager.showGUI()}get callbacks(){return{}}getScene(){return this._sceneManager.getScene()}updateScene(){this._sceneManager.updateScene()}getUnitFormatter(){return this._unitFormatter}getStorage(){return this._idbManager}setEnvironmentMap(e){const{url:t,intensity:r,rotation:a,maxLightSources:i}=e;this._sceneManager.setEnvironmentMap(t,r,a,i)}}__decorate([inject],RoomleGLBViewer.prototype,"_rapiAccess",void 0),__decorate([inject],RoomleGLBViewer.prototype,"_domHelper",void 0),__decorate([inject],RoomleGLBViewer.prototype,"_scriptLoader",void 0),__decorate([inject],RoomleGLBViewer.prototype,"_lifeCycleManager",void 0),__decorate([inject],RoomleGLBViewer.prototype,"_initData",void 0),__decorate([inject],RoomleGLBViewer.prototype,"_globalInitData",void 0),__decorate([inject],RoomleGLBViewer.prototype,"_unitFormatter",void 0),__decorate([inject],RoomleGLBViewer.prototype,"_idbManager",void 0);class GlbViewer extends Main{setupGlobals(){}setupDependencies(){RoomleDependencyInjection.setup(INJECTABLES),this.lookup("logger",this._context)}cleanUpGlobals(){throw new Error("Method not implemented.")}cleanUpDependencies(){throw new Error("Method not implemented.")}bootFinished(){this._viewer=new RoomleGLBViewer(this._context),window.RoomleGLBViewer||(window.RoomleGLBViewer=this._viewer)}getApi(){return this._viewer}getContextName(){return"glb-viewer"}}export{GlbViewer};
|
|
2
|
-
//# sourceMappingURL=glb-viewer-
|
|
1
|
+
import{S as ScriptLoader,M as Main}from"./script-loader-3c5eb130.js";import{aw as InputManager,D as DependencyInjectionAssignment,L as Logger,R as RapiAccess,a1 as getGUI,_ as __decorate,i as inject,m as CANVAS_ID,q as DynamicLightSettingLoader,r as PREDEFINED_LIGHTSETTING,w as dispose,b as RoomleDependencyInjection}from"./roomle-dependency-injection-d3a8c907.js";import{C as CameraControl3D,L as LightSetting,S as SceneManager,T as TWEEN_FILE_NAME}from"./camera-behaviour-d6af6d09.js";import{a as Vector3,ad as Box3,ag as Euler,Q as Quaternion,A as AmbientLight,C as Color,aE as CAMERA_TYPE,aR as getGlbUrl,bz as WebGLRenderer,i as SRGBColorSpace,bn as BasicShadowMap,N as PerspectiveCamera,bM as download}from"./main-thread-to-worker-82b32425.js";import{D as DefaultLightSetting}from"./default-light-setting-432c00f7.js";import{G as GlbViewerCameraBehaviour}from"./glb-viewer-camera-behaviour-94516099.js";import"./query-params-helper-68ed40a6.js";const INJECTABLES=[new DependencyInjectionAssignment("script-loader",ScriptLoader),new DependencyInjectionAssignment("glb-input-manager",class extends InputManager{},1),new DependencyInjectionAssignment("logger",Logger),new DependencyInjectionAssignment("rapi-access",RapiAccess)];class AdjustableCameraControl3D extends CameraControl3D{constructor(){super(...arguments),this.shouldIgnoreStandardBehavior=!1}adjust(e,t,r,a,i){let n=new Vector3(-e.x/2,0,-e.z/2),s=new Vector3(e.x/2,e.y,e.z/2);this._boundingBox=new Box3(n,s);let o=new Euler(-Math.PI/2+a,r,0,"ZYX"),c=(new Quaternion).setFromEuler(o);this._camera.updateProjectionMatrix(),this._camera.quaternion.copy(c),this._camera.position.copy(t)}_update(e){this.shouldIgnoreStandardBehavior?this._saveYawAndPitch():super._update(e)}animateCamera(e){return!!this.shouldIgnoreStandardBehavior||super.animateCamera(e)}}class GLBViewerLightSetting extends LightSetting{constructor(e,t){super(e,t),this._params={ambientLight:{color:"#ffffff"}},this._ambientLight=new AmbientLight(new Color(this._params.ambientLight.color),.5),this.addToScene()}addToScene(){this._scene.add(this._ambientLight)}removeFromScene(){this._scene.remove(this._ambientLight)}reload(){this.removeFromScene(),this.addToScene()}showGUI(){let e=getGUI();if(e&&this._ambientLight){let t=e.addFolder("Ambient Light");t.add(this._ambientLight,"visible"),t.add(this._ambientLight,"intensity").min(0).max(5).step(.1),t.addColor(this._params.ambientLight,"color").onChange(e=>{this._ambientLight.color=new Color(e)})}}}class GLBViewerSceneManager extends SceneManager{constructor(e,t){super(e,t,CANVAS_ID.GLB,CAMERA_TYPE.CAMERA_3D),this._itemsCount=0,this._standardSceneBackgroundColor=this._scene.background,this._initData.legacyLight&&(this._renderer.capabilities.maxTextures>8?this.loadDynamicLightSetting(DynamicLightSettingLoader.createDynamicLightSettingSource(null,PREDEFINED_LIGHTSETTING.CAMERA)):(console.warn("this device has a maximum of 8 texture units thus we are using a simpler light setting"),this._lightSetting=new GLBViewerLightSetting(this._scene)))}createCameraControl(e,t){this._changeCameraBehaviour(new GlbViewerCameraBehaviour(new AdjustableCameraControl3D(this._creator_,this._getInputManager(),new Vector3(-1,1,1)),this._cameraBehaviourState))}_getInputManager(){return this._glbInputManager}async loadStaticItem(e,t){const r=await this._rapiAccess.getItem(e);if(r.configuration)return Promise.reject();const a=getGlbUrl(r);return a?this.loadGLB(a,!0,void 0,t):Promise.reject(new Error("GLB Url not detected"))}loadGLB(e,t=!0,r=new Vector3(1,1,1),a){return this.clearScene(),new Promise((i,n)=>{this._loadGLB(e,new Vector3(0,0,0),0,void 0,r,void 0,void 0,a).then(e=>{this._currentGLB=e,this._scene.add(this._currentGLB);let r=(new Box3).setFromObject(this._currentGLB);t&&this.cameraBehaviour.cameraControl instanceof AdjustableCameraControl3D&&this.glbViewerCameraBehaviour.updateCameraOnItemLoaded(r),this._updateBounds(r,null,!0),i()},n)})}preparePerspectiveImage(e,t,r){return new Promise(a=>{var i,n;t||(t=1e3),r||(r=1e3),e||((e=new WebGLRenderer({antialias:!0})).setSize(t,r),e.outputColorSpace=SRGBColorSpace,e.autoClear=!1,e.shadowMap.enabled=!0,e.shadowMap.type=BasicShadowMap);let s=this.cameraBehaviour.cameraControl.getCamera().clone();s instanceof PerspectiveCamera&&(s.aspect=t/r,s.updateProjectionMatrix()),null===(i=this._lightSetting)||void 0===i||i.removeFromScene();let o=new DefaultLightSetting(this._scene);e.render(this._scene,s);let c=e.domElement.toDataURL();e.domElement.toBlob(e=>{a({image:c,width:t,height:r,blob:e})},"image/png"),o.removeFromScene(),null===(n=this._lightSetting)||void 0===n||n.addToScene()})}adjustCamera(e,t,r,a){if(this.cameraBehaviour.cameraControl instanceof AdjustableCameraControl3D){let i=(new Box3).setFromObject(this._scene).getSize(new Vector3);this.cameraBehaviour.cameraControl.adjust(i,e,t,r,a),this._requestRender()}}onStart(e){this._itemsCount=e,this._scene.background=null,this.cameraBehaviour.cameraControl instanceof AdjustableCameraControl3D&&(this.cameraBehaviour.cameraControl.shouldIgnoreStandardBehavior=!0)}onElementFinished(e){this._itemsCount,Math.round(100/this._itemsCount*e)}onFinished(e){this._scene.background=this._standardSceneBackgroundColor,this.cameraBehaviour.cameraControl instanceof AdjustableCameraControl3D&&(this.cameraBehaviour.cameraControl.shouldIgnoreStandardBehavior=!1)}clearScene(){this._currentGLB&&(this._scene.remove(this._currentGLB),dispose(this._currentGLB),this._currentGLB=null),super.clearScene()}enableHD(){super.enableHD()}sceneChanged(){}getBounds(){return this._currentGLB?(new Box3).setFromObject(this._currentGLB):null}get glbViewerCameraBehaviour(){return this.cameraBehaviour}getGeometryBounds(){return null}cameraBehaviourChanged(){super.cameraBehaviourChanged(),this.cameraBehaviour.cameraControl.addEventListener(3,()=>{this._requestRender()},this),this.cameraBehaviour.cameraControl.addEventListener(4,()=>{this._requestRender()},this)}}__decorate([inject],GLBViewerSceneManager.prototype,"_glbInputManager",void 0),__decorate([inject],GLBViewerSceneManager.prototype,"_rapiAccess",void 0);class GLBRenderWorker{constructor(e,t,r){this._prefix="https://furniture.roomle.com/3d/glb/",this._listeners=new Set,this._finishedItems=0,this._sceneManager=e,this._renderer=new WebGLRenderer({antialias:!0,alpha:!0}),this._width=t,this._height=r,this._renderer.setSize(t,r),this._renderer.setClearColor(16777215,0),this._renderer.outputColorSpace=SRGBColorSpace}addListener(e){this._listeners.add(e)}removeListener(e){this._listeners.delete(e)}start(e){return this._entries=[],e.forEach(e=>{this._entries.push(this._transform(e))}),this._finishedItems=0,this._listeners.forEach(e=>e.onStart(this._entries.length)),this._zip=new window.JSZip,this._doNextEntry(),new Promise(e=>{this._resolve=e})}_transform(e){return{name:e.path.replace(".glb",".png"),url:this._prefix+e.path,position:new Vector3(e.camera.position.x,e.camera.position.z,-e.camera.position.y),fov:2*e.camera.fieldOfView,yaw:e.camera.rotation.z,pitch:e.camera.rotation.x}}_doNextEntry(){0===this._entries.length?(this._listeners.forEach(e=>e.onFinished(this._zip)),this._resolve(this._zip)):this._processEntry(this._entries[0])}_processEntry(e){this._sceneManager.loadGLB(e.url,!1,void 0).then(()=>{this._sceneManager.adjustCamera(e.position,e.yaw,e.pitch,e.fov),this._sceneManager.preparePerspectiveImage(this._renderer,this._width,this._height).then(t=>{this._entryFinished(e,t)})})}_entryFinished(e,t){let r=this._entries.indexOf(e);r>-1&&this._entries.splice(r,1),this._finishedItems++,this._listeners.forEach(e=>e.onElementFinished(this._finishedItems)),this._zip.file(e.name,t.blob),this._doNextEntry()}}class RoomleGLBViewer{constructor(e){this._currentIdOrUrl=null,this._creator_=e}setCameraOffset(e){this._sceneManager.setCameraOffset(e)}getCameraOffset(){return this._sceneManager.getCameraOffset()}init(e,t){return this.setOverrides(t),this._domHelper.setDomElement(e),this._sceneManager?(this._lifeCycleManager.resume(),Promise.resolve()):new Promise(this._initPromiseCallback.bind(this))}_initPromiseCallback(e,t){Promise.all([this._scriptLoader.fetch(TWEEN_FILE_NAME,{id:"tween-js"})]).then(()=>{this._sceneManager=new GLBViewerSceneManager(this._creator_,{left:0,top:1,right:1,bottom:0}),this._sceneManager.enableHD(),e()})}clearScene(){this._sceneManager.clearScene()}loadGLB(e,t=1,r){return this._currentIdOrUrl=e,this._rapiAccess.trackView(e),this._sceneManager.loadGLB(e,!0,new Vector3(t,t,t),r)}loadStaticItem(e,t){return this._currentIdOrUrl=e,this._rapiAccess.trackView(e),this._sceneManager.loadStaticItem(e,t)}getCurrentId(){return this._currentIdOrUrl}loadSceneSetting(e){return this._sceneManager.loadSceneSettings(e)}preparePerspectiveImage(){return this._sceneManager.preparePerspectiveImage()}processRenderList(e,t=320,r=320){let a=JSON.parse(e);this._scriptLoader.fetch("static/jszip.min-c96375d50e72b199.js",{id:"jszip-js"}).then(()=>{let e=new GLBRenderWorker(this._sceneManager,t,r);e.addListener(this._sceneManager),e.start(a.items).then(t=>{t.generateAsync({type:"blob"}).then(t=>{download("content.zip",URL.createObjectURL(t)),e.removeListener(this._sceneManager)})})})}setOverrides(e){e&&(this._initData.setOverrides(e),this._globalInitData.setOverrides(e))}updateSize(){this._sceneManager.updateCamera()}getMain(){}resumeTest(e){this._domHelper.setDomElement(e),this._lifeCycleManager.resume()}pauseTest(){this._lifeCycleManager.pause()}showGUI(){this._sceneManager.showGUI()}get callbacks(){return{}}getScene(){return this._sceneManager.getScene()}updateScene(){this._sceneManager.updateScene()}getUnitFormatter(){return this._unitFormatter}getStorage(){return this._idbManager}setEnvironmentMap(e){const{url:t,intensity:r,rotation:a,maxLightSources:i}=e;this._sceneManager.setEnvironmentMap(t,r,a,i)}}__decorate([inject],RoomleGLBViewer.prototype,"_rapiAccess",void 0),__decorate([inject],RoomleGLBViewer.prototype,"_domHelper",void 0),__decorate([inject],RoomleGLBViewer.prototype,"_scriptLoader",void 0),__decorate([inject],RoomleGLBViewer.prototype,"_lifeCycleManager",void 0),__decorate([inject],RoomleGLBViewer.prototype,"_initData",void 0),__decorate([inject],RoomleGLBViewer.prototype,"_globalInitData",void 0),__decorate([inject],RoomleGLBViewer.prototype,"_unitFormatter",void 0),__decorate([inject],RoomleGLBViewer.prototype,"_idbManager",void 0);class GlbViewer extends Main{setupGlobals(){}setupDependencies(){RoomleDependencyInjection.setup(INJECTABLES),this.lookup("logger",this._context)}cleanUpGlobals(){throw new Error("Method not implemented.")}cleanUpDependencies(){throw new Error("Method not implemented.")}bootFinished(){this._viewer=new RoomleGLBViewer(this._context),window.RoomleGLBViewer||(window.RoomleGLBViewer=this._viewer)}getApi(){return this._viewer}getContextName(){return"glb-viewer"}}export{GlbViewer};
|
|
2
|
+
//# sourceMappingURL=glb-viewer-f88249d7.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"glb-viewer-
|
|
1
|
+
{"version":3,"file":"glb-viewer-f88249d7.js","sources":["../../node_modules/jszip/dist/jszip.min.js"],"sourcesContent":["export default \"static/jszip.min-c96375d50e72b199.js\""],"names":[],"mappings":"+pRAAe"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{GlbViewer}from"./glb-viewer-f88249d7.js";import"./script-loader-3c5eb130.js";import"./query-params-helper-68ed40a6.js";import"./main-thread-to-worker-82b32425.js";import"./roomle-dependency-injection-d3a8c907.js";import"./camera-behaviour-d6af6d09.js";import"./default-light-setting-432c00f7.js";import"./glb-viewer-camera-behaviour-94516099.js";(new GlbViewer).boot();
|
|
2
|
+
//# sourceMappingURL=glb-viewer-main-42ec8932.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"glb-viewer-main-42ec8932.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
System.register(["./glb-viewer-
|
|
1
|
+
System.register(["./glb-viewer-7282caf7.nomodule.js","./script-loader-ed493cd8.nomodule.js","./query-params-helper-712890e0.nomodule.js","./main-thread-to-worker-ff04af1e.nomodule.js","./roomle-dependency-injection-b567df3a.nomodule.js","./camera-behaviour-eee26e60.nomodule.js","./default-light-setting-8492f1aa.nomodule.js","./glb-viewer-camera-behaviour-bee9e036.nomodule.js"],(function(){var e;return{setters:[function(n){e=n.GlbViewer},function(){},function(){},function(){},function(){},function(){},function(){},function(){}],execute:function(){(new e).boot()}}}));
|
|
2
2
|
//# sourceMappingURL=glb-viewer-main.nomodule.js.map
|
package/lib/legacy/{banana-for-scale-ebedc20c.legacy.js → banana-for-scale-adf89519.legacy.js}
RENAMED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
System.register(["./roomle-dependency-injection-
|
|
2
|
-
//# sourceMappingURL=banana-for-scale-
|
|
1
|
+
System.register(["./roomle-dependency-injection-32a7ed2e.legacy.js","./main-thread-to-worker-63c62382.legacy.js"],(function(e){var n,t,a,s,i;return{setters:[function(e){n=e.aI,t=e._,a=e.i},function(e){s=e.g,i=e.a}],execute:function(){class c extends n{setScene(e){this._scene=e,this._staticItemLoader.loadGLB(s()+"static/banana_div2-1351c98ec2986be1.glb").then(e=>{this._banana=e.scene,this.updateBounds(null)})}updateBounds(e){if(e&&(this._bounds=e),this._bounds){if(this._banana){const e=this._bounds.getSize(new i),n=this._bounds.getCenter(new i).clone();n.x-=e.x/2+.18,n.z+=e.z/2+.05,n.y=0;let t=.03;this._banana.scale.copy(new i(t,t,t)),this._banana.rotation.y=.6,this._banana.position.copy(n)}this._scene.children.includes(this._banana)||this.addToScene()}}clearScene(e,n){super.clearScene(e,n),this.removeFromScene()}addToScene(){this._scene&&this._banana&&this._scene.add(this._banana)}removeFromScene(){this._scene&&this._banana&&this._scene.remove(this._banana)}}e("default",c),t([a],c.prototype,"_staticItemLoader",void 0)}}}));
|
|
2
|
+
//# sourceMappingURL=banana-for-scale-adf89519.legacy.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"banana-for-scale-
|
|
1
|
+
{"version":3,"file":"banana-for-scale-adf89519.legacy.js","sources":["../../../packages/configurator-core/public/geometry/banana_div2.glb"],"sourcesContent":["export default \"static/banana_div2-1351c98ec2986be1.glb\""],"names":[],"mappings":"yTAAe"}
|