@roomle/web-sdk 2.105.0-alpha.6 → 2.105.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/{banana-for-scale-2633168c.js → banana-for-scale-33778dbb.js} +2 -2
- package/lib/{banana-for-scale-2633168c.js.map → banana-for-scale-33778dbb.js.map} +1 -1
- package/lib/{banana-for-scale-7d3eda64.nomodule.js → banana-for-scale-5e2781a3.nomodule.js} +2 -2
- package/lib/{banana-for-scale-7d3eda64.nomodule.js.map → banana-for-scale-5e2781a3.nomodule.js.map} +1 -1
- package/lib/camera-behaviour-16588b1c.js +2 -0
- package/lib/{camera-behaviour-b38936e8.js.map → camera-behaviour-16588b1c.js.map} +1 -1
- package/lib/camera-behaviour-dd7a063e.nomodule.js +2 -0
- package/lib/{camera-behaviour-d54a163f.nomodule.js.map → camera-behaviour-dd7a063e.nomodule.js.map} +1 -1
- package/lib/{component-dimensioning-bfc2cae3.js → component-dimensioning-4ee8f27d.js} +2 -2
- package/lib/component-dimensioning-4ee8f27d.js.map +1 -0
- package/lib/{component-dimensioning-40501ab3.nomodule.js → component-dimensioning-763769c4.nomodule.js} +2 -2
- package/lib/component-dimensioning-763769c4.nomodule.js.map +1 -0
- package/lib/{component-raycast-helper-9c21304e.js → component-raycast-helper-7c75e5f0.js} +2 -2
- package/lib/component-raycast-helper-7c75e5f0.js.map +1 -0
- package/lib/{component-raycast-helper-40bfa0dc.nomodule.js → component-raycast-helper-9e685f1a.nomodule.js} +2 -2
- package/lib/component-raycast-helper-9e685f1a.nomodule.js.map +1 -0
- package/lib/{configurator-1835defb.js → configurator-cca1c6b9.js} +2 -2
- package/lib/configurator-cca1c6b9.js.map +1 -0
- package/lib/{configurator-0d266f2d.nomodule.js → configurator-d5e3e975.nomodule.js} +2 -2
- package/lib/configurator-d5e3e975.nomodule.js.map +1 -0
- package/lib/configurator-main-314fd7d7.js +2 -0
- package/lib/configurator-main-314fd7d7.js.map +1 -0
- package/lib/configurator-main.nomodule.js +1 -1
- package/lib/{continuous-drawing-helper-966ca38e.js → continuous-drawing-helper-18cc6038.js} +2 -2
- package/lib/continuous-drawing-helper-18cc6038.js.map +1 -0
- package/lib/{continuous-drawing-helper-6f0ede86.nomodule.js → continuous-drawing-helper-7c54ed2c.nomodule.js} +2 -2
- package/lib/continuous-drawing-helper-7c54ed2c.nomodule.js.map +1 -0
- package/lib/{default-light-setting-dbac7805.js → default-light-setting-427cc173.js} +2 -2
- package/lib/default-light-setting-427cc173.js.map +1 -0
- package/lib/{default-light-setting-9a50093b.nomodule.js → default-light-setting-b7032eac.nomodule.js} +2 -2
- package/lib/default-light-setting-b7032eac.nomodule.js.map +1 -0
- package/lib/definitions/common-core/src/utils/threejs-utils.d.ts +1 -1
- package/lib/definitions/packages/common-core/src/utils/threejs-utils.d.ts +1 -1
- package/lib/{dimensioning-helper-29e6a6ef.nomodule.js → dimensioning-helper-d4726ede.nomodule.js} +2 -2
- package/lib/{dimensioning-helper-29e6a6ef.nomodule.js.map → dimensioning-helper-d4726ede.nomodule.js.map} +1 -1
- package/lib/{dimensioning-helper-6a37e332.js → dimensioning-helper-d7060dbf.js} +2 -2
- package/lib/{dimensioning-helper-6a37e332.js.map → dimensioning-helper-d7060dbf.js.map} +1 -1
- package/lib/{glb-viewer-289273d5.js → glb-viewer-56580b03.js} +2 -2
- package/lib/{glb-viewer-289273d5.js.map → glb-viewer-56580b03.js.map} +1 -1
- package/lib/{glb-viewer-camera-behaviour-7e1b1e90.nomodule.js → glb-viewer-camera-behaviour-67fa46c3.nomodule.js} +2 -2
- package/lib/glb-viewer-camera-behaviour-67fa46c3.nomodule.js.map +1 -0
- package/lib/{glb-viewer-camera-behaviour-be7c8747.js → glb-viewer-camera-behaviour-bcd098e8.js} +2 -2
- package/lib/glb-viewer-camera-behaviour-bcd098e8.js.map +1 -0
- package/lib/{glb-viewer-6772ad20.nomodule.js → glb-viewer-fe45c467.nomodule.js} +2 -2
- package/lib/{glb-viewer-6772ad20.nomodule.js.map → glb-viewer-fe45c467.nomodule.js.map} +1 -1
- package/lib/glb-viewer-main-e1a17a38.js +2 -0
- package/lib/glb-viewer-main-e1a17a38.js.map +1 -0
- package/lib/glb-viewer-main.nomodule.js +1 -1
- package/lib/{imos-ix-poc-export-helper-588a53ab.nomodule.js → imos-ix-poc-export-helper-56fd272c.nomodule.js} +2 -2
- package/lib/imos-ix-poc-export-helper-56fd272c.nomodule.js.map +1 -0
- package/lib/{imos-ix-poc-export-helper-37572034.js → imos-ix-poc-export-helper-68f83fb7.js} +2 -2
- package/lib/imos-ix-poc-export-helper-68f83fb7.js.map +1 -0
- package/lib/legacy/{banana-for-scale-5b011d9f.legacy.js → banana-for-scale-2fc610a6.legacy.js} +2 -2
- package/lib/legacy/{banana-for-scale-5b011d9f.legacy.js.map → banana-for-scale-2fc610a6.legacy.js.map} +1 -1
- package/lib/legacy/camera-behaviour-f5d2fa60.legacy.js +2 -0
- package/lib/legacy/{camera-behaviour-2088546c.legacy.js.map → camera-behaviour-f5d2fa60.legacy.js.map} +1 -1
- package/lib/legacy/{component-dimensioning-f04cf8d0.legacy.js → component-dimensioning-0224eda5.legacy.js} +2 -2
- package/lib/legacy/component-dimensioning-0224eda5.legacy.js.map +1 -0
- package/lib/legacy/{component-raycast-helper-967cd80e.legacy.js → component-raycast-helper-6e8975b4.legacy.js} +2 -2
- package/lib/legacy/component-raycast-helper-6e8975b4.legacy.js.map +1 -0
- package/lib/legacy/{configurator-6d32b749.legacy.js → configurator-0dafcb92.legacy.js} +2 -2
- package/lib/legacy/configurator-0dafcb92.legacy.js.map +1 -0
- package/lib/legacy/configurator-main.legacy.js +1 -1
- package/lib/legacy/{continuous-drawing-helper-6985bc30.legacy.js → continuous-drawing-helper-b2afe8d1.legacy.js} +2 -2
- package/lib/legacy/continuous-drawing-helper-b2afe8d1.legacy.js.map +1 -0
- package/lib/legacy/{default-light-setting-e6e3c9ef.legacy.js → default-light-setting-05238ba4.legacy.js} +2 -2
- package/lib/legacy/default-light-setting-05238ba4.legacy.js.map +1 -0
- package/lib/legacy/{dimensioning-helper-1859491f.legacy.js → dimensioning-helper-78fdeba9.legacy.js} +2 -2
- package/lib/legacy/{dimensioning-helper-1859491f.legacy.js.map → dimensioning-helper-78fdeba9.legacy.js.map} +1 -1
- package/lib/legacy/{glb-viewer-dc032024.legacy.js → glb-viewer-039e52be.legacy.js} +2 -2
- package/lib/legacy/{glb-viewer-dc032024.legacy.js.map → glb-viewer-039e52be.legacy.js.map} +1 -1
- package/lib/legacy/{glb-viewer-camera-behaviour-9a618475.legacy.js → glb-viewer-camera-behaviour-8a2d4de1.legacy.js} +2 -2
- package/lib/legacy/glb-viewer-camera-behaviour-8a2d4de1.legacy.js.map +1 -0
- package/lib/legacy/glb-viewer-main.legacy.js +1 -1
- package/lib/legacy/{imos-ix-poc-export-helper-e6175ea6.legacy.js → imos-ix-poc-export-helper-eff99220.legacy.js} +2 -2
- package/lib/legacy/imos-ix-poc-export-helper-eff99220.legacy.js.map +1 -0
- package/lib/legacy/{material-viewer-29935906.legacy.js → material-viewer-75848657.legacy.js} +2 -2
- package/lib/legacy/material-viewer-75848657.legacy.js.map +1 -0
- package/lib/legacy/material-viewer-main.legacy.js +1 -1
- package/lib/legacy/{planner-db6af31d.legacy.js → planner-96b5c06a.legacy.js} +2 -2
- package/lib/legacy/{planner-db6af31d.legacy.js.map → planner-96b5c06a.legacy.js.map} +1 -1
- package/lib/legacy/planner-main.legacy.js +1 -1
- package/lib/legacy/{roomle-configurator-4891f01a.legacy.js → roomle-configurator-88689bbd.legacy.js} +2 -2
- package/lib/legacy/{roomle-configurator-4891f01a.legacy.js.map → roomle-configurator-88689bbd.legacy.js.map} +1 -1
- package/lib/legacy/{roomle-dependency-injection-5672400b.legacy.js → roomle-dependency-injection-f9e80d9c.legacy.js} +2 -2
- package/lib/legacy/{roomle-dependency-injection-5672400b.legacy.js.map → roomle-dependency-injection-f9e80d9c.legacy.js.map} +1 -1
- package/lib/legacy/roomle-sdk.legacy.js +1 -1
- package/lib/legacy/{script-loader-1e570149.legacy.js → script-loader-c7c8f3b8.legacy.js} +2 -2
- package/lib/legacy/script-loader-c7c8f3b8.legacy.js.map +1 -0
- package/lib/legacy/{stats-helper-c5311cdc.legacy.js → stats-helper-e205d215.legacy.js} +2 -2
- package/lib/legacy/{stats-helper-c5311cdc.legacy.js.map → stats-helper-e205d215.legacy.js.map} +1 -1
- package/lib/legacy/{tools-core-26d48a74.legacy.js → tools-core-245e7016.legacy.js} +2 -2
- package/lib/legacy/tools-core-245e7016.legacy.js.map +1 -0
- package/lib/{material-viewer-28079735.nomodule.js → material-viewer-75a6946b.nomodule.js} +2 -2
- package/lib/material-viewer-75a6946b.nomodule.js.map +1 -0
- package/lib/{material-viewer-e3e02a19.js → material-viewer-b7225b36.js} +2 -2
- package/lib/material-viewer-b7225b36.js.map +1 -0
- package/lib/material-viewer-main-5d9fad42.js +2 -0
- package/lib/material-viewer-main-5d9fad42.js.map +1 -0
- package/lib/material-viewer-main.nomodule.js +1 -1
- package/lib/{planner-04496cd9.js → planner-0d5b3552.js} +2 -2
- package/lib/{planner-04496cd9.js.map → planner-0d5b3552.js.map} +1 -1
- package/lib/{planner-6bde1857.nomodule.js → planner-47be9e18.nomodule.js} +2 -2
- package/lib/{planner-6bde1857.nomodule.js.map → planner-47be9e18.nomodule.js.map} +1 -1
- package/lib/planner-main-6a885050.js +2 -0
- package/lib/planner-main-6a885050.js.map +1 -0
- package/lib/planner-main.nomodule.js +1 -1
- package/lib/{roomle-configurator-6b12a452.nomodule.js → roomle-configurator-20693b9d.nomodule.js} +2 -2
- package/lib/{roomle-configurator-6b12a452.nomodule.js.map → roomle-configurator-20693b9d.nomodule.js.map} +1 -1
- package/lib/{roomle-configurator-fee84062.js → roomle-configurator-b014274e.js} +2 -2
- package/lib/{roomle-configurator-fee84062.js.map → roomle-configurator-b014274e.js.map} +1 -1
- package/lib/{roomle-dependency-injection-04bee035.js → roomle-dependency-injection-40c9e584.js} +2 -2
- package/lib/{roomle-dependency-injection-04bee035.js.map → roomle-dependency-injection-40c9e584.js.map} +1 -1
- package/lib/{roomle-dependency-injection-f5a3c39f.nomodule.js → roomle-dependency-injection-e3763cd6.nomodule.js} +2 -2
- package/lib/{roomle-dependency-injection-f5a3c39f.nomodule.js.map → roomle-dependency-injection-e3763cd6.nomodule.js.map} +1 -1
- package/lib/{roomle-sdk-4657770f.js → roomle-sdk-b7447e02.js} +2 -2
- package/lib/roomle-sdk-b7447e02.js.map +1 -0
- package/lib/roomle-sdk.nomodule.js +1 -1
- package/lib/{script-loader-df273d31.js → script-loader-01e992f9.js} +2 -2
- package/lib/script-loader-01e992f9.js.map +1 -0
- package/lib/{script-loader-ac74eccd.nomodule.js → script-loader-fa13d1f5.nomodule.js} +2 -2
- package/lib/script-loader-fa13d1f5.nomodule.js.map +1 -0
- package/lib/{stats-helper-94a8807b.nomodule.js → stats-helper-d2c22957.nomodule.js} +2 -2
- package/lib/{stats-helper-94a8807b.nomodule.js.map → stats-helper-d2c22957.nomodule.js.map} +1 -1
- package/lib/{stats-helper-f1462964.js → stats-helper-dccf2916.js} +2 -2
- package/lib/{stats-helper-f1462964.js.map → stats-helper-dccf2916.js.map} +1 -1
- package/lib/{tools-core-e655b76b.nomodule.js → tools-core-262d0573.nomodule.js} +2 -2
- package/lib/tools-core-262d0573.nomodule.js.map +1 -0
- package/lib/{tools-core-bd3d5c0b.js → tools-core-290dd27f.js} +2 -2
- package/lib/tools-core-290dd27f.js.map +1 -0
- package/package.json +2 -2
- package/lib/camera-behaviour-b38936e8.js +0 -2
- package/lib/camera-behaviour-d54a163f.nomodule.js +0 -2
- package/lib/component-dimensioning-40501ab3.nomodule.js.map +0 -1
- package/lib/component-dimensioning-bfc2cae3.js.map +0 -1
- package/lib/component-raycast-helper-40bfa0dc.nomodule.js.map +0 -1
- package/lib/component-raycast-helper-9c21304e.js.map +0 -1
- package/lib/configurator-0d266f2d.nomodule.js.map +0 -1
- package/lib/configurator-1835defb.js.map +0 -1
- package/lib/configurator-main-08e2552a.js +0 -2
- package/lib/configurator-main-08e2552a.js.map +0 -1
- package/lib/continuous-drawing-helper-6f0ede86.nomodule.js.map +0 -1
- package/lib/continuous-drawing-helper-966ca38e.js.map +0 -1
- package/lib/default-light-setting-9a50093b.nomodule.js.map +0 -1
- package/lib/default-light-setting-dbac7805.js.map +0 -1
- package/lib/glb-viewer-camera-behaviour-7e1b1e90.nomodule.js.map +0 -1
- package/lib/glb-viewer-camera-behaviour-be7c8747.js.map +0 -1
- package/lib/glb-viewer-main-5f614eaa.js +0 -2
- package/lib/glb-viewer-main-5f614eaa.js.map +0 -1
- package/lib/imos-ix-poc-export-helper-37572034.js.map +0 -1
- package/lib/imos-ix-poc-export-helper-588a53ab.nomodule.js.map +0 -1
- package/lib/legacy/camera-behaviour-2088546c.legacy.js +0 -2
- package/lib/legacy/component-dimensioning-f04cf8d0.legacy.js.map +0 -1
- package/lib/legacy/component-raycast-helper-967cd80e.legacy.js.map +0 -1
- package/lib/legacy/configurator-6d32b749.legacy.js.map +0 -1
- package/lib/legacy/continuous-drawing-helper-6985bc30.legacy.js.map +0 -1
- package/lib/legacy/default-light-setting-e6e3c9ef.legacy.js.map +0 -1
- package/lib/legacy/glb-viewer-camera-behaviour-9a618475.legacy.js.map +0 -1
- package/lib/legacy/imos-ix-poc-export-helper-e6175ea6.legacy.js.map +0 -1
- package/lib/legacy/material-viewer-29935906.legacy.js.map +0 -1
- package/lib/legacy/script-loader-1e570149.legacy.js.map +0 -1
- package/lib/legacy/tools-core-26d48a74.legacy.js.map +0 -1
- package/lib/material-viewer-28079735.nomodule.js.map +0 -1
- package/lib/material-viewer-e3e02a19.js.map +0 -1
- package/lib/material-viewer-main-7df74726.js +0 -2
- package/lib/material-viewer-main-7df74726.js.map +0 -1
- package/lib/planner-main-624e6e13.js +0 -2
- package/lib/planner-main-624e6e13.js.map +0 -1
- package/lib/roomle-sdk-4657770f.js.map +0 -1
- package/lib/script-loader-ac74eccd.nomodule.js.map +0 -1
- package/lib/script-loader-df273d31.js.map +0 -1
- package/lib/tools-core-bd3d5c0b.js.map +0 -1
- package/lib/tools-core-e655b76b.nomodule.js.map +0 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{bD as Raycaster,bZ as throttle,z as Mesh,v as MeshStandardMaterial,ad as Box3,a as Vector3,am as Frustum,k as Matrix4}from"./main-thread-to-worker-b1fa75c7.js";import{aw as transitionTransparencyOfMaterial}from"./roomle-dependency-injection-
|
|
2
|
-
//# sourceMappingURL=component-raycast-helper-
|
|
1
|
+
import{bD as Raycaster,bZ as throttle,z as Mesh,v as MeshStandardMaterial,ad as Box3,a as Vector3,am as Frustum,k as Matrix4}from"./main-thread-to-worker-b1fa75c7.js";import{aw as transitionTransparencyOfMaterial}from"./roomle-dependency-injection-40c9e584.js";class ComponentRaycastHelper{constructor(){this._nonTransparentComponent=null,this._raycaster=new Raycaster,this._raycaster.near=.1,this._raycaster.layers.enable(3),this._raycaster.layers.enable(4),this._raycaster.layers.enable(5),this._raycaster.layers.enable(6)}init(e,t){this._object=e,this._camera=t,this.checkComponentVisibility=throttle(this.checkComponentVisibility,100).bind(this),this.checkPreviewVisibility=throttle(this.checkPreviewVisibility,100).bind(this)}setCamera(e){this._camera=e}setObject(e){this._object=e}changeMaterialsOnSelect(e,t,a=!1,i){t!==this._nonTransparentComponent&&(this._nonTransparentComponent=t,this._changeMaterialsOnSelect(e,t,a,i))}_changeMaterialsOnSelect(e,t,a=!1,i){if(e.children.length>0&&e.children.forEach(s=>{const n=t&&e.id===t.id||a,r=!(s instanceof Mesh);s.userData.ignoreComponentRaycast||this._changeMaterialsOnSelect(s,t,(!n||!r)&&n,i)}),t)e instanceof Mesh&&e.material instanceof MeshStandardMaterial&&!e.userData.oldMaterial&&(e.userData.oldMaterial=e.material,e.material=e.material.clone(),a||transitionTransparencyOfMaterial(e,{opacity:.2,transparent:!0}).then(()=>{null==i||i()}));else if(e.userData.oldMaterial&&e instanceof Mesh&&e.material instanceof MeshStandardMaterial){const{opacity:t,transparent:a}=e.userData.oldMaterial;transitionTransparencyOfMaterial(e,{opacity:t,transparent:a}).then(()=>null==i?void 0:i()),e.userData.oldMaterial=void 0}}isComponentVisible(e){const t=[];e.traverse(e=>t.push(e.uuid));const a=(new Box3).setFromObject(e).getCenter(new Vector3),i=(new Vector3).subVectors(a,this._camera.position).normalize();this._raycaster.set(this._camera.position,i),this._raycaster.far=this._camera.position.distanceTo(a);const s=[];return this._raycaster.intersectObjects(this._object.children,!0).forEach(e=>{e.object.material.visible&&(t.includes(e.object.uuid)||e.object.userData.ignoreComponentRaycast||s.push(e))}),0===s.length}checkComponentAndPreviewVisibility(e,t){e.hasSelection()?this.checkComponentVisibility(e,t):t.hasPreviews()?this.checkPreviewVisibility(t):this.changeMaterialsOnSelect(this._object,null)}checkComponentVisibility(e,t){if(!e.hasSelection())return;const a=t.getComponentsForIds(e.getSelectedRuntimeComponentIds());if(a.length>1)return;const i=a[0];this.isComponentVisible(i)?this.changeMaterialsOnSelect(this._object,null):this.changeMaterialsOnSelect(this._object,i)}areAllPreviewsVisible(e){if(!e.hasPreviews())return!0;const t=e.getPreviews();return 0===t.length||t.map(e=>this.isComponentVisible(e)).reduce((e,t)=>e&&t)}areAllComponentsInFrustum(e){if(0===e.length)return!0;const t=new Frustum,a=(new Matrix4).multiplyMatrices(this._camera.projectionMatrix,this._camera.matrixWorldInverse),i=new Box3;return t.setFromProjectionMatrix(a),e.map(e=>(e=>{const a=i.setFromObject(e).getCenter(new Vector3);return t.containsPoint(a)})(e)).reduce((e,t)=>e&&t)}checkPreviewVisibility(e){e.hasPreviewLines()||(this.areAllPreviewsVisible(e)?this.changeMaterialsOnSelect(this._object,null):this.changeMaterialsOnSelect(this._object,{id:-1}))}}export{ComponentRaycastHelper as default};
|
|
2
|
+
//# sourceMappingURL=component-raycast-helper-7c75e5f0.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"component-raycast-helper-7c75e5f0.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
System.register(["./main-thread-to-worker-6a2da53d.nomodule.js","./roomle-dependency-injection-
|
|
2
|
-
//# sourceMappingURL=component-raycast-helper-
|
|
1
|
+
System.register(["./main-thread-to-worker-6a2da53d.nomodule.js","./roomle-dependency-injection-e3763cd6.nomodule.js"],(function(e){var t,i,n,a,s,r,c,o,l;return{setters:[function(e){t=e.bD,i=e.bZ,n=e.z,a=e.v,s=e.ad,r=e.a,c=e.am,o=e.k},function(e){l=e.aw}],execute:function(){e("default",class{constructor(){this._nonTransparentComponent=null,this._raycaster=new t,this._raycaster.near=.1,this._raycaster.layers.enable(3),this._raycaster.layers.enable(4),this._raycaster.layers.enable(5),this._raycaster.layers.enable(6)}init(e,t){this._object=e,this._camera=t,this.checkComponentVisibility=i(this.checkComponentVisibility,100).bind(this),this.checkPreviewVisibility=i(this.checkPreviewVisibility,100).bind(this)}setCamera(e){this._camera=e}setObject(e){this._object=e}changeMaterialsOnSelect(e,t,i=!1,n){t!==this._nonTransparentComponent&&(this._nonTransparentComponent=t,this._changeMaterialsOnSelect(e,t,i,n))}_changeMaterialsOnSelect(e,t,i=!1,s){if(e.children.length>0&&e.children.forEach(a=>{const r=t&&e.id===t.id||i,c=!(a instanceof n);a.userData.ignoreComponentRaycast||this._changeMaterialsOnSelect(a,t,(!r||!c)&&r,s)}),t)e instanceof n&&e.material instanceof a&&!e.userData.oldMaterial&&(e.userData.oldMaterial=e.material,e.material=e.material.clone(),i||l(e,{opacity:.2,transparent:!0}).then(()=>{null==s||s()}));else if(e.userData.oldMaterial&&e instanceof n&&e.material instanceof a){const{opacity:t,transparent:i}=e.userData.oldMaterial;l(e,{opacity:t,transparent:i}).then(()=>null==s?void 0:s()),e.userData.oldMaterial=void 0}}isComponentVisible(e){const t=[];e.traverse(e=>t.push(e.uuid));const i=(new s).setFromObject(e).getCenter(new r),n=(new r).subVectors(i,this._camera.position).normalize();this._raycaster.set(this._camera.position,n),this._raycaster.far=this._camera.position.distanceTo(i);const a=[];return this._raycaster.intersectObjects(this._object.children,!0).forEach(e=>{e.object.material.visible&&(t.includes(e.object.uuid)||e.object.userData.ignoreComponentRaycast||a.push(e))}),0===a.length}checkComponentAndPreviewVisibility(e,t){e.hasSelection()?this.checkComponentVisibility(e,t):t.hasPreviews()?this.checkPreviewVisibility(t):this.changeMaterialsOnSelect(this._object,null)}checkComponentVisibility(e,t){if(!e.hasSelection())return;const i=t.getComponentsForIds(e.getSelectedRuntimeComponentIds());if(i.length>1)return;const n=i[0];this.isComponentVisible(n)?this.changeMaterialsOnSelect(this._object,null):this.changeMaterialsOnSelect(this._object,n)}areAllPreviewsVisible(e){if(!e.hasPreviews())return!0;const t=e.getPreviews();return 0===t.length||t.map(e=>this.isComponentVisible(e)).reduce((e,t)=>e&&t)}areAllComponentsInFrustum(e){if(0===e.length)return!0;const t=new c,i=(new o).multiplyMatrices(this._camera.projectionMatrix,this._camera.matrixWorldInverse),n=new s;return t.setFromProjectionMatrix(i),e.map(e=>(e=>{const i=n.setFromObject(e).getCenter(new r);return t.containsPoint(i)})(e)).reduce((e,t)=>e&&t)}checkPreviewVisibility(e){e.hasPreviewLines()||(this.areAllPreviewsVisible(e)?this.changeMaterialsOnSelect(this._object,null):this.changeMaterialsOnSelect(this._object,{id:-1}))}})}}}));
|
|
2
|
+
//# sourceMappingURL=component-raycast-helper-9e685f1a.nomodule.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"component-raycast-helper-9e685f1a.nomodule.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{S as ScriptLoader,M as Main}from"./script-loader-
|
|
2
|
-
//# sourceMappingURL=configurator-
|
|
1
|
+
import{S as ScriptLoader,M as Main}from"./script-loader-01e992f9.js";import{D as DependencyInjectionAssignment,L as Logger,R as RapiAccess,a as DataSyncer,b as RoomleDependencyInjection,A as AppContext}from"./roomle-dependency-injection-40c9e584.js";import{C as CameraControl3D,a as CameraControl}from"./camera-behaviour-16588b1c.js";import ComponentRaycastHelper from"./component-raycast-helper-7c75e5f0.js";import{C as ConfiguratorSceneManager,a as ConfiguratorViewModel,R as RoomleConfigurator}from"./roomle-configurator-b014274e.js";import"./query-params-helper-2f7f2adb.js";import"./main-thread-to-worker-b1fa75c7.js";import"./Object3D-80e9d0f8.js";import"./default-light-setting-427cc173.js";import"./external-objects-969e35e2.js";const INJECTABLES=[new DependencyInjectionAssignment("logger",Logger),new DependencyInjectionAssignment("rapi-access",RapiAccess),new DependencyInjectionAssignment("script-loader",ScriptLoader),new DependencyInjectionAssignment("camera-control-3d",CameraControl3D),new DependencyInjectionAssignment("camera-control",CameraControl),new DependencyInjectionAssignment("data-syncer",DataSyncer),new DependencyInjectionAssignment("configurator-scene-manager",ConfiguratorSceneManager,1),new DependencyInjectionAssignment("configurator-view-model",ConfiguratorViewModel,1),new DependencyInjectionAssignment("component-raycast-helper",ComponentRaycastHelper,0)];class Configurator extends Main{setupDependencies(){RoomleDependencyInjection.setup(INJECTABLES),this.lookup("planner-kernel-access",this._context).init(1),this.lookup("rapi-access",this._context),this.lookup("script-loader",this._context),this.lookup("logger",this._context)}cleanUpGlobals(){delete window.RoomleConfigurator}cleanUpDependencies(){const e=this.lookup("script-loader"),n=this.lookup("rapi-access");this.lookup("dom-helper");const o=this.lookup("configurator-scene-manager");e&&e.cleanUp(),n&&n.cleanUp(),o&&o.cleanUp()}setupGlobals(e){const{kernelInstance:n,kernelContainer:o,planObjectId:t}=e||{};AppContext.init({kernelInstance:n,kernelContainer:o,planObjectId:t})}getApi(){return this._configurator}bootFinished(){this._configurator=new RoomleConfigurator(this._context),this._configurator.getMain=()=>this,window.RoomleConfigurator||(window.RoomleConfigurator=this._configurator)}getContextName(){return"configurator"}}export{Configurator};
|
|
2
|
+
//# sourceMappingURL=configurator-cca1c6b9.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"configurator-cca1c6b9.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
System.register(["./script-loader-
|
|
2
|
-
//# sourceMappingURL=configurator-
|
|
1
|
+
System.register(["./script-loader-fa13d1f5.nomodule.js","./roomle-dependency-injection-e3763cd6.nomodule.js","./camera-behaviour-dd7a063e.nomodule.js","./component-raycast-helper-9e685f1a.nomodule.js","./roomle-configurator-20693b9d.nomodule.js","./query-params-helper-3a0e7148.nomodule.js","./main-thread-to-worker-6a2da53d.nomodule.js","./Object3D-2abce9d8.nomodule.js","./default-light-setting-b7032eac.nomodule.js","./external-objects-7de43fc9.nomodule.js"],(function(e){var o,n,t,r,a,c,i,s,l,u,d,p,f,m;return{setters:[function(e){o=e.S,n=e.M},function(e){t=e.D,r=e.L,a=e.R,c=e.a,i=e.b,s=e.A},function(e){l=e.C,u=e.a},function(e){d=e.default},function(e){p=e.C,f=e.a,m=e.R},function(){},function(){},function(){},function(){},function(){}],execute:function(){const h=[new t("logger",r),new t("rapi-access",a),new t("script-loader",o),new t("camera-control-3d",l),new t("camera-control",u),new t("data-syncer",c),new t("configurator-scene-manager",p,1),new t("configurator-view-model",f,1),new t("component-raycast-helper",d,0)];e("Configurator",class extends n{setupDependencies(){i.setup(h),this.lookup("planner-kernel-access",this._context).init(1),this.lookup("rapi-access",this._context),this.lookup("script-loader",this._context),this.lookup("logger",this._context)}cleanUpGlobals(){delete window.RoomleConfigurator}cleanUpDependencies(){const e=this.lookup("script-loader"),o=this.lookup("rapi-access");this.lookup("dom-helper");const n=this.lookup("configurator-scene-manager");e&&e.cleanUp(),o&&o.cleanUp(),n&&n.cleanUp()}setupGlobals(e){const{kernelInstance:o,kernelContainer:n,planObjectId:t}=e||{};s.init({kernelInstance:o,kernelContainer:n,planObjectId:t})}getApi(){return this._configurator}bootFinished(){this._configurator=new m(this._context),this._configurator.getMain=()=>this,window.RoomleConfigurator||(window.RoomleConfigurator=this._configurator)}getContextName(){return"configurator"}})}}}));
|
|
2
|
+
//# sourceMappingURL=configurator-d5e3e975.nomodule.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"configurator-d5e3e975.nomodule.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{Configurator}from"./configurator-cca1c6b9.js";import"./script-loader-01e992f9.js";import"./query-params-helper-2f7f2adb.js";import"./main-thread-to-worker-b1fa75c7.js";import"./roomle-dependency-injection-40c9e584.js";import"./camera-behaviour-16588b1c.js";import"./component-raycast-helper-7c75e5f0.js";import"./roomle-configurator-b014274e.js";import"./Object3D-80e9d0f8.js";import"./default-light-setting-427cc173.js";import"./external-objects-969e35e2.js";(new Configurator).boot(),window.requestIdleCallback||(window.requestIdleCallback=e=>setTimeout(()=>{let o=Date.now();e({didTimeout:!1,timeRemaining:()=>Math.max(0,50-(Date.now()-o))})},1)),window.cancelIdleCallback||(window.cancelIdleCallback=window.cancelIdleCallback||function(e){clearTimeout(e)});
|
|
2
|
+
//# sourceMappingURL=configurator-main-314fd7d7.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"configurator-main-314fd7d7.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
System.register(["./configurator-
|
|
1
|
+
System.register(["./configurator-d5e3e975.nomodule.js","./script-loader-fa13d1f5.nomodule.js","./query-params-helper-3a0e7148.nomodule.js","./main-thread-to-worker-6a2da53d.nomodule.js","./roomle-dependency-injection-e3763cd6.nomodule.js","./camera-behaviour-dd7a063e.nomodule.js","./component-raycast-helper-9e685f1a.nomodule.js","./roomle-configurator-20693b9d.nomodule.js","./Object3D-2abce9d8.nomodule.js","./default-light-setting-b7032eac.nomodule.js","./external-objects-7de43fc9.nomodule.js"],(function(){var e;return{setters:[function(o){e=o.Configurator},function(){},function(){},function(){},function(){},function(){},function(){},function(){},function(){},function(){},function(){}],execute:function(){(new e).boot(),window.requestIdleCallback||(window.requestIdleCallback=e=>setTimeout(()=>{let o=Date.now();e({didTimeout:!1,timeRemaining:()=>Math.max(0,50-(Date.now()-o))})},1)),window.cancelIdleCallback||(window.cancelIdleCallback=window.cancelIdleCallback||function(e){clearTimeout(e)})}}}));
|
|
2
2
|
//# sourceMappingURL=configurator-main.nomodule.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{s as convertToTHREE}from"./roomle-dependency-injection-
|
|
2
|
-
//# sourceMappingURL=continuous-drawing-helper-
|
|
1
|
+
import{s as convertToTHREE}from"./roomle-dependency-injection-40c9e584.js";import{aT as RingGeometry,h as MeshBasicMaterial,w as DoubleSide,z as Mesh}from"./main-thread-to-worker-b1fa75c7.js";class ContinuousDrawingHelper{constructor(){this._currentInnerRadius=0}init(e,i,r){this._drawingGroup=e,this._continuousDrawingManager=i,this._kernelZoomFactor=r,this.update()}update(){this._initCircle(),this._updateCircle()}_initCircle(){if(this._circleMesh)return;const e=70/this._kernelZoomFactor/1e3,i=new RingGeometry(e,e+e/50,32),r=new MeshBasicMaterial({color:10066329,side:DoubleSide});this._circleMesh=new Mesh(i,r),this._circleMesh.name="Circle",this._circleMesh.rotation.set(Math.PI/2,0,0),this._circleMesh.visible=this._continuousDrawingManager.shouldShowCircle(),this._drawingGroup.add(this._circleMesh)}_updateCircle(){if(!this._circleMesh)return;const e=70/this._kernelZoomFactor/1e3;if(e!==this._currentInnerRadius){const i=e+e/50;this._circleMesh.geometry=new RingGeometry(e,i,32)}const i=convertToTHREE(this._continuousDrawingManager.getStartPoint());i.y=5,this._circleMesh.position.copy(i),this._circleMesh.visible=this._continuousDrawingManager.shouldShowCircle(),this._currentInnerRadius=e}setKernelZoomFactor(e){this._kernelZoomFactor=e}endDrawing(){this._drawingGroup.remove(this._circleMesh),this._circleMesh=null}}export{ContinuousDrawingHelper as default};
|
|
2
|
+
//# sourceMappingURL=continuous-drawing-helper-18cc6038.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"continuous-drawing-helper-18cc6038.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
System.register(["./roomle-dependency-injection-
|
|
2
|
-
//# sourceMappingURL=continuous-drawing-helper-
|
|
1
|
+
System.register(["./roomle-dependency-injection-e3763cd6.nomodule.js","./main-thread-to-worker-6a2da53d.nomodule.js"],(function(e){var i,t,r,n,s;return{setters:[function(e){i=e.s},function(e){t=e.aT,r=e.h,n=e.w,s=e.z}],execute:function(){e("default",class{constructor(){this._currentInnerRadius=0}init(e,i,t){this._drawingGroup=e,this._continuousDrawingManager=i,this._kernelZoomFactor=t,this.update()}update(){this._initCircle(),this._updateCircle()}_initCircle(){if(this._circleMesh)return;const e=70/this._kernelZoomFactor/1e3,i=new t(e,e+e/50,32),c=new r({color:10066329,side:n});this._circleMesh=new s(i,c),this._circleMesh.name="Circle",this._circleMesh.rotation.set(Math.PI/2,0,0),this._circleMesh.visible=this._continuousDrawingManager.shouldShowCircle(),this._drawingGroup.add(this._circleMesh)}_updateCircle(){if(!this._circleMesh)return;const e=70/this._kernelZoomFactor/1e3;if(e!==this._currentInnerRadius){const i=e+e/50;this._circleMesh.geometry=new t(e,i,32)}const r=i(this._continuousDrawingManager.getStartPoint());r.y=5,this._circleMesh.position.copy(r),this._circleMesh.visible=this._continuousDrawingManager.shouldShowCircle(),this._currentInnerRadius=e}setKernelZoomFactor(e){this._kernelZoomFactor=e}endDrawing(){this._drawingGroup.remove(this._circleMesh),this._circleMesh=null}})}}}));
|
|
2
|
+
//# sourceMappingURL=continuous-drawing-helper-7c54ed2c.nomodule.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"continuous-drawing-helper-7c54ed2c.nomodule.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{L as LightSetting}from"./camera-behaviour-
|
|
2
|
-
//# sourceMappingURL=default-light-setting-
|
|
1
|
+
import{L as LightSetting}from"./camera-behaviour-16588b1c.js";import{n as getGUI}from"./roomle-dependency-injection-40c9e584.js";import{D as DirectionalLight,C as Color,V as Vector2,a as Vector3,A as AmbientLight}from"./main-thread-to-worker-b1fa75c7.js";class DefaultLightSetting extends LightSetting{constructor(i,t){super(i,t),this._params={ambientLight:{color:"#ffffff"},mainDirLight:{position:{x:-3,y:4,z:4},color:"#ffffff"},secondDirLight:{position:{x:3,y:4,z:3},color:"#ffffff"}},this._mainDirectionalLight=new DirectionalLight(new Color(this._params.mainDirLight.color),.8),this._mainDirectionalLight.position.set(this._params.mainDirLight.position.x,this._params.mainDirLight.position.y,this._params.mainDirLight.position.z),this._mainDirectionalLight.layers.set(1),this._mainDirectionalLight.castShadow=!0,this._mainDirectionalLight.shadow.camera.near=.1,this._mainDirectionalLight.shadow.camera.far=100,this._mainDirectionalLight.shadow.mapSize=new Vector2(1024,1024),this._mainDirectionalLight.visible=!0,this._mainDirectionalLight.lookAt(new Vector3(0,0,0)),this._secondDirectionalLight=new DirectionalLight(new Color(this._params.secondDirLight.color),.2),this._secondDirectionalLight.position.set(this._params.secondDirLight.position.x,this._params.secondDirLight.position.y,this._params.secondDirLight.position.z),this._secondDirectionalLight.layers.set(1),this._secondDirectionalLight.castShadow=!1,this._secondDirectionalLight.shadow.camera.near=.1,this._secondDirectionalLight.shadow.camera.far=100,this._secondDirectionalLight.shadow.mapSize=new Vector2(1024,1024),this._secondDirectionalLight.visible=!0,this._secondDirectionalLight.lookAt(new Vector3(0,0,0)),this._ambientLight=new AmbientLight(new Color(this._params.ambientLight.color),.5),this._ambientLight.layers.set(1),this.addToScene()}needsBounds(){return!0}updateBounds(i){const t=i.getSize(new Vector3),a=Math.max(Math.max(t.x,t.y),t.z)+1,o=a/2;this._mainDirectionalLight.shadow.camera.top=o,this._mainDirectionalLight.shadow.camera.bottom=-o,this._mainDirectionalLight.shadow.camera.left=-o,this._mainDirectionalLight.shadow.camera.right=o,this._mainDirectionalLight.shadow.camera.near=.01,this._mainDirectionalLight.shadow.camera.far=4*a,this._mainDirectionalLight.shadow.camera.updateProjectionMatrix(),this._secondDirectionalLight.shadow.camera.top=o,this._secondDirectionalLight.shadow.camera.bottom=-o,this._secondDirectionalLight.shadow.camera.left=-o,this._secondDirectionalLight.shadow.camera.right=o,this._secondDirectionalLight.shadow.camera.near=.01,this._secondDirectionalLight.shadow.camera.far=4*a,this._secondDirectionalLight.shadow.camera.updateProjectionMatrix()}addToScene(){this._scene.add(this._mainDirectionalLight),this._scene.add(this._secondDirectionalLight),this._scene.add(this._ambientLight)}removeFromScene(){this._scene.remove(this._mainDirectionalLight),this._scene.remove(this._secondDirectionalLight),this._scene.remove(this._ambientLight)}reload(){this.removeFromScene(),this.addToScene()}showGUI(){let i=getGUI();if(i){if(this._ambientLight){let t=i.addFolder("Ambient Light");t.add(this._ambientLight,"visible"),t.add(this._ambientLight,"intensity").min(0).max(5).step(.1),t.addColor(this._params.ambientLight,"color").onChange(i=>this._ambientLight.color=new Color(i))}if(this._mainDirectionalLight){let t=i.addFolder("Main Directional Light");t.add(this._mainDirectionalLight,"visible"),t.add(this._mainDirectionalLight,"intensity").min(0).max(10).step(.1),t.add(this._mainDirectionalLight,"castShadow"),t.addColor(this._params.mainDirLight,"color").onChange(i=>this._mainDirectionalLight.color=new Color(i)),t.add(this._mainDirectionalLight.position,"x").min(-10).max(10).step(.1).onChange(()=>this._mainDirectionalLight.lookAt(new Vector3(0,0,0))),t.add(this._mainDirectionalLight.position,"y").min(-10).max(50).step(.1).onChange(()=>this._mainDirectionalLight.lookAt(new Vector3(0,0,0))),t.add(this._mainDirectionalLight.position,"z").min(-10).max(10).step(.1).onChange(()=>this._mainDirectionalLight.lookAt(new Vector3(0,0,0)))}if(this._secondDirectionalLight){let t=i.addFolder("Second Directional Light");t.add(this._secondDirectionalLight,"visible"),t.add(this._secondDirectionalLight,"intensity").min(0).max(10).step(.1),t.add(this._secondDirectionalLight,"castShadow"),t.addColor(this._params.mainDirLight,"color").onChange(i=>this._mainDirectionalLight.color=new Color(i)),t.add(this._secondDirectionalLight.position,"x").min(-10).max(10).step(.1).onChange(()=>this._mainDirectionalLight.lookAt(new Vector3(0,0,0))),t.add(this._secondDirectionalLight.position,"y").min(-10).max(50).step(.1).onChange(()=>this._mainDirectionalLight.lookAt(new Vector3(0,0,0))),t.add(this._secondDirectionalLight.position,"z").min(-10).max(10).step(.1).onChange(()=>this._mainDirectionalLight.lookAt(new Vector3(0,0,0)))}}}}export{DefaultLightSetting as D};
|
|
2
|
+
//# sourceMappingURL=default-light-setting-427cc173.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"default-light-setting-427cc173.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
System.register(["./camera-behaviour-
|
|
2
|
-
//# sourceMappingURL=default-light-setting-
|
|
1
|
+
System.register(["./camera-behaviour-dd7a063e.nomodule.js","./roomle-dependency-injection-e3763cd6.nomodule.js","./main-thread-to-worker-6a2da53d.nomodule.js"],(function(i){var t,a,e,n,o,s,h;return{setters:[function(i){t=i.L},function(i){a=i.n},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-b7032eac.nomodule.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"default-light-setting-b7032eac.nomodule.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -41,7 +41,7 @@ export declare const getGUI: (autoplace?: boolean) => GUI;
|
|
|
41
41
|
export declare const setWallTransparencyBasedOnCamera: (camera: Camera, material: Material, animate?: boolean) => void;
|
|
42
42
|
export declare const hideWallsBasedOnCamera: (camera: Camera, wallPlanElementViewModels: WallPlanElementViewModel[]) => boolean;
|
|
43
43
|
export declare const setWallTransparency: (material: Material, transparent: boolean, animate?: boolean) => void;
|
|
44
|
-
export declare const animateObjectMatrix: (object3d: Object3D, priorMatrix: Matrix4, fromMatrix: Matrix4, toMatrix: Matrix4, onProgressUpdate?: () => void) => void;
|
|
44
|
+
export declare const animateObjectMatrix: (object3d: Object3D, priorMatrix: Matrix4, fromMatrix: Matrix4, toMatrix: Matrix4, subsequentTransform: Matrix4, onProgressUpdate?: () => void) => void;
|
|
45
45
|
export declare const calculateBaseMatrix: (matrixFrom: Matrix4, matrixTo: Matrix4) => Matrix4;
|
|
46
46
|
export declare const getAxisAndAngleFromQuaternion: (quaternion: Quaternion) => {
|
|
47
47
|
axis: Vector3;
|
|
@@ -41,7 +41,7 @@ export declare const getGUI: (autoplace?: boolean) => GUI;
|
|
|
41
41
|
export declare const setWallTransparencyBasedOnCamera: (camera: Camera, material: Material, animate?: boolean) => void;
|
|
42
42
|
export declare const hideWallsBasedOnCamera: (camera: Camera, wallPlanElementViewModels: WallPlanElementViewModel[]) => boolean;
|
|
43
43
|
export declare const setWallTransparency: (material: Material, transparent: boolean, animate?: boolean) => void;
|
|
44
|
-
export declare const animateObjectMatrix: (object3d: Object3D, priorMatrix: Matrix4, fromMatrix: Matrix4, toMatrix: Matrix4, onProgressUpdate?: () => void) => void;
|
|
44
|
+
export declare const animateObjectMatrix: (object3d: Object3D, priorMatrix: Matrix4, fromMatrix: Matrix4, toMatrix: Matrix4, subsequentTransform: Matrix4, onProgressUpdate?: () => void) => void;
|
|
45
45
|
export declare const calculateBaseMatrix: (matrixFrom: Matrix4, matrixTo: Matrix4) => Matrix4;
|
|
46
46
|
export declare const getAxisAndAngleFromQuaternion: (quaternion: Quaternion) => {
|
|
47
47
|
axis: Vector3;
|
package/lib/{dimensioning-helper-29e6a6ef.nomodule.js → dimensioning-helper-d4726ede.nomodule.js}
RENAMED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
System.register(["./roomle-dependency-injection-
|
|
2
|
-
//# sourceMappingURL=dimensioning-helper-
|
|
1
|
+
System.register(["./roomle-dependency-injection-e3763cd6.nomodule.js","./main-thread-to-worker-6a2da53d.nomodule.js","./TextGeometry-e50ce5fb.nomodule.js"],(function(t){var i,e,s,n,h,o,a,_,d,r,p,m,l,c,x,u,g,w,b,y,T,L,z;return{setters:[function(t){i=t.b3,e=t.U,s=t._,n=t.i,h=t.j,o=t.b4,a=t.s},function(t){_=t.O,d=t.a,r=t.h,p=t.w,m=t.bo,l=t.B,c=t.z,x=t.Q,u=t.b9,g=t.K,w=t.u,b=t.G,y=t.b,T=t.bR,L=t.ad},function(t){z=t.T}],execute:function(){const G="component_dimensioning_plane_material",M="component_dimensioning_text_material";class j extends _{constructor(t){super(),this._label="",this._parameters={font:null,size:.1,depth:.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(G)?this._planeMaterial=this._cacheHolder.materialCache.get(G):(this._planeMaterial=new r({color:16777215,side:p,opacity:.8,transparent:!0}),this._cacheHolder.materialCache.set(G,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 z(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 z(this._label,this._parameters),this._textGeometry.computeBoundingBox(),this._text.geometry=this._textGeometry,this._update()}_update(){if(this.topDown){let t=new x;t.setFromAxisAngle(new d(-1,0,0),Math.PI/2),this._updateText(this._textGeometry,t,new d)}else if(this._updateText(this._textGeometry,new x,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 u(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/lato_regular_sub-9dd2262895ccc1a9.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._topDimensions=!0,this.enableDimensions(),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.addToObject(this._object),this.addToUiScene(this._uiScene)}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-d4726ede.nomodule.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dimensioning-helper-
|
|
1
|
+
{"version":3,"file":"dimensioning-helper-d4726ede.nomodule.js","sources":["../../packages/configurator-core/public/fonts/lato_regular_sub.json"],"sourcesContent":["export default \"static/lato_regular_sub-9dd2262895ccc1a9.json\""],"names":[],"mappings":"s4HAAe"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{b3 as normalizeRotation,U as dispose,_ as __decorate,i as inject,j as AsyncGuard,b4 as AsyncDependencyLoader,s as convertToTHREE}from"./roomle-dependency-injection-04bee035.js";import{O as Object3D,a as Vector3,h as MeshBasicMaterial,w as DoubleSide,bo as MeshPhongMaterial,B as BufferGeometry,z as Mesh,Q as Quaternion,b9 as PlaneGeometry,K as Group,u as LineBasicMaterial,G as Line,b as BufferAttribute,bR as Line3,ad as Box3}from"./main-thread-to-worker-b1fa75c7.js";import{T as TextGeometry}from"./TextGeometry-a42434bb.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,depth:.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/lato_regular_sub-9dd2262895ccc1a9.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._topDimensions=!0,this.enableDimensions(),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.addToObject(this._object),this.addToUiScene(this._uiScene)}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{b3 as normalizeRotation,U as dispose,_ as __decorate,i as inject,j as AsyncGuard,b4 as AsyncDependencyLoader,s as convertToTHREE}from"./roomle-dependency-injection-40c9e584.js";import{O as Object3D,a as Vector3,h as MeshBasicMaterial,w as DoubleSide,bo as MeshPhongMaterial,B as BufferGeometry,z as Mesh,Q as Quaternion,b9 as PlaneGeometry,K as Group,u as LineBasicMaterial,G as Line,b as BufferAttribute,bR as Line3,ad as Box3}from"./main-thread-to-worker-b1fa75c7.js";import{T as TextGeometry}from"./TextGeometry-a42434bb.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,depth:.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/lato_regular_sub-9dd2262895ccc1a9.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._topDimensions=!0,this.enableDimensions(),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.addToObject(this._object),this.addToUiScene(this._uiScene)}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-d7060dbf.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dimensioning-helper-
|
|
1
|
+
{"version":3,"file":"dimensioning-helper-d7060dbf.js","sources":["../../packages/configurator-core/public/fonts/lato_regular_sub.json"],"sourcesContent":["export default \"static/lato_regular_sub-9dd2262895ccc1a9.json\""],"names":[],"mappings":"s7IAAe"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{S as ScriptLoader,M as Main}from"./script-loader-df273d31.js";import{aV as InputManager,D as DependencyInjectionAssignment,L as Logger,R as RapiAccess,n as getGUI,_ as __decorate,i as inject,H as CANVAS_ID,K as DynamicLightSettingLoader,O as PREDEFINED_LIGHTSETTING,U as dispose,b as RoomleDependencyInjection}from"./roomle-dependency-injection-04bee035.js";import{C as CameraControl3D,L as LightSetting,S as SceneManager,T as TWEEN_FILE_NAME}from"./camera-behaviour-b38936e8.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,bC as WebGLRenderer,i as SRGBColorSpace,bk as BasicShadowMap,U as PerspectiveCamera,bK as download}from"./main-thread-to-worker-b1fa75c7.js";import{D as DefaultLightSetting}from"./default-light-setting-dbac7805.js";import{G as GlbViewerCameraBehaviour}from"./glb-viewer-camera-behaviour-be7c8747.js";import"./query-params-helper-2f7f2adb.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(),null),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),this._readyForRender(),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)}async moveCamera(e){return this.glbViewerCameraBehaviour.externalApiMoveCamera(e)}_readyForRender(){this._globalCallback.onReadyForRender()}}__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)}exportCanvasScreenshot(e){return this._sceneManager.exportCanvasScreenshot(e)}async moveCamera(e){return this._sceneManager.moveCamera(e)}get globalCallbacks(){return this._globalCallback}}__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,"_globalCallback",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-01e992f9.js";import{aV as InputManager,D as DependencyInjectionAssignment,L as Logger,R as RapiAccess,n as getGUI,_ as __decorate,i as inject,H as CANVAS_ID,K as DynamicLightSettingLoader,O as PREDEFINED_LIGHTSETTING,U as dispose,b as RoomleDependencyInjection}from"./roomle-dependency-injection-40c9e584.js";import{C as CameraControl3D,L as LightSetting,S as SceneManager,T as TWEEN_FILE_NAME}from"./camera-behaviour-16588b1c.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,bC as WebGLRenderer,i as SRGBColorSpace,bk as BasicShadowMap,U as PerspectiveCamera,bK as download}from"./main-thread-to-worker-b1fa75c7.js";import{D as DefaultLightSetting}from"./default-light-setting-427cc173.js";import{G as GlbViewerCameraBehaviour}from"./glb-viewer-camera-behaviour-bcd098e8.js";import"./query-params-helper-2f7f2adb.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(),null),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),this._readyForRender(),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)}async moveCamera(e){return this.glbViewerCameraBehaviour.externalApiMoveCamera(e)}_readyForRender(){this._globalCallback.onReadyForRender()}}__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)}exportCanvasScreenshot(e){return this._sceneManager.exportCanvasScreenshot(e)}async moveCamera(e){return this._sceneManager.moveCamera(e)}get globalCallbacks(){return this._globalCallback}}__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,"_globalCallback",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-56580b03.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"glb-viewer-
|
|
1
|
+
{"version":3,"file":"glb-viewer-56580b03.js","sources":["../../node_modules/jszip/dist/jszip.min.js"],"sourcesContent":["export default \"static/jszip.min-c96375d50e72b199.js\""],"names":[],"mappings":"kzRAAe"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
System.register(["./camera-behaviour-
|
|
2
|
-
//# sourceMappingURL=glb-viewer-camera-behaviour-
|
|
1
|
+
System.register(["./camera-behaviour-dd7a063e.nomodule.js"],(function(e){var a;return{setters:[function(e){a=e.b}],execute:function(){e("G",class extends a{get cameraControl(){return this._cameraControl}async updateCameraOnItemLoaded(e){await this.cameraControl.updateAndReset(e,!0)}async externalApiMoveCamera(e){await this.cameraControl.moveCamera(e),this._onCameraChanged()}})}}}));
|
|
2
|
+
//# sourceMappingURL=glb-viewer-camera-behaviour-67fa46c3.nomodule.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"glb-viewer-camera-behaviour-67fa46c3.nomodule.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
package/lib/{glb-viewer-camera-behaviour-be7c8747.js → glb-viewer-camera-behaviour-bcd098e8.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-16588b1c.js";class GlbViewerCameraBehaviour extends CameraBehaviour{get cameraControl(){return this._cameraControl}async updateCameraOnItemLoaded(a){await this.cameraControl.updateAndReset(a,!0)}async externalApiMoveCamera(a){await this.cameraControl.moveCamera(a),this._onCameraChanged()}}export{GlbViewerCameraBehaviour as G};
|
|
2
|
+
//# sourceMappingURL=glb-viewer-camera-behaviour-bcd098e8.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"glb-viewer-camera-behaviour-bcd098e8.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
System.register(["./script-loader-
|
|
2
|
-
//# sourceMappingURL=glb-viewer-
|
|
1
|
+
System.register(["./script-loader-fa13d1f5.nomodule.js","./roomle-dependency-injection-e3763cd6.nomodule.js","./camera-behaviour-dd7a063e.nomodule.js","./main-thread-to-worker-6a2da53d.nomodule.js","./default-light-setting-b7032eac.nomodule.js","./glb-viewer-camera-behaviour-67fa46c3.nomodule.js","./query-params-helper-3a0e7148.nomodule.js"],(function(e){var t,r,i,a,n,s,o,h,c,l,d,m,u,_,g,p,v,w,b,C,f,S,L,B,M,y,I,x,G,E,j,F,O;return{setters:[function(e){t=e.S,r=e.M},function(e){i=e.aV,a=e.D,n=e.L,s=e.R,o=e.n,h=e._,c=e.i,l=e.H,d=e.K,m=e.O,u=e.U,_=e.b},function(e){g=e.C,p=e.L,v=e.S,w=e.T},function(e){b=e.a,C=e.ad,f=e.ag,S=e.Q,L=e.A,B=e.C,M=e.aE,y=e.aR,I=e.bC,x=e.i,G=e.bk,E=e.U,j=e.bK},function(e){F=e.D},function(e){O=e.G},function(){}],execute:function(){const D=[new a("script-loader",t),new a("glb-input-manager",class extends i{},1),new a("logger",n),new a("rapi-access",s)];class P extends g{constructor(){super(...arguments),this.shouldIgnoreStandardBehavior=!1}adjust(e,t,r,i,a){let n=new b(-e.x/2,0,-e.z/2),s=new b(e.x/2,e.y,e.z/2);this._boundingBox=new C(n,s);let o=new f(-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 k extends p{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 R extends v{constructor(e,t){super(e,t,l.GLB,M.CAMERA_3D),this._itemsCount=0,this._standardSceneBackgroundColor=this._scene.background,this._initData.legacyLight&&(this._renderer.capabilities.maxTextures>8?this.loadDynamicLightSetting(d.createDynamicLightSettingSource(null,m.CAMERA)):(console.warn("this device has a maximum of 8 texture units thus we are using a simpler light setting"),this._lightSetting=new k(this._scene)))}createCameraControl(e,t){this._changeCameraBehaviour(new O(new P(this._creator_,this._getInputManager(),null),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 b(1,1,1),i){return this.clearScene(),new Promise((a,n)=>{this._loadGLB(e,new b(0,0,0),0,void 0,r,void 0,void 0,i).then(e=>{this._currentGLB=e,this._scene.add(this._currentGLB);let r=(new C).setFromObject(this._currentGLB);t&&this.cameraBehaviour.cameraControl instanceof P&&this.glbViewerCameraBehaviour.updateCameraOnItemLoaded(r),this._updateBounds(r,null,!0),this._readyForRender(),a()},n)})}preparePerspectiveImage(e,t,r){return new Promise(i=>{var a,n;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===(a=this._lightSetting)||void 0===a||a.removeFromScene();let o=new F(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===(n=this._lightSetting)||void 0===n||n.addToScene()})}adjustCamera(e,t,r,i){if(this.cameraBehaviour.cameraControl instanceof P){let a=(new C).setFromObject(this._scene).getSize(new b);this.cameraBehaviour.cameraControl.adjust(a,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),u(this._currentGLB),this._currentGLB=null),super.clearScene()}enableHD(){super.enableHD()}sceneChanged(){}getBounds(){return this._currentGLB?(new C).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)}async moveCamera(e){return this.glbViewerCameraBehaviour.externalApiMoveCamera(e)}_readyForRender(){this._globalCallback.onReadyForRender()}}h([c],R.prototype,"_glbInputManager",void 0),h([c],R.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 b(e.camera.position.x,e.camera.position.z,-e.camera.position.y),fov:2*e.camera.fieldOfView,yaw:e.camera.rotation.z,pitch:e.camera.rotation.x}}_doNextEntry(){0===this._entries.length?(this._listeners.forEach(e=>e.onFinished(this._zip)),this._resolve(this._zip)):this._processEntry(this._entries[0])}_processEntry(e){this._sceneManager.loadGLB(e.url,!1,void 0).then(()=>{this._sceneManager.adjustCamera(e.position,e.yaw,e.pitch,e.fov),this._sceneManager.preparePerspectiveImage(this._renderer,this._width,this._height).then(t=>{this._entryFinished(e,t)})})}_entryFinished(e,t){let r=this._entries.indexOf(e);r>-1&&this._entries.splice(r,1),this._finishedItems++,this._listeners.forEach(e=>e.onElementFinished(this._finishedItems)),this._zip.file(e.name,t.blob),this._doNextEntry()}}class z{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(w,{id:"tween-js"})]).then(()=>{this._sceneManager=new R(this._creator_,{left:0,top:1,right:1,bottom:0}),this._sceneManager.enableHD(),e()})}clearScene(){this._sceneManager.clearScene()}loadGLB(e,t=1,r){return this._currentIdOrUrl=e,this._rapiAccess.trackView(e),this._sceneManager.loadGLB(e,!0,new b(t,t,t),r)}loadStaticItem(e,t){return this._currentIdOrUrl=e,this._rapiAccess.trackView(e),this._sceneManager.loadStaticItem(e,t)}getCurrentId(){return this._currentIdOrUrl}loadSceneSetting(e){return this._sceneManager.loadSceneSettings(e)}preparePerspectiveImage(){return this._sceneManager.preparePerspectiveImage()}processRenderList(e,t=320,r=320){let i=JSON.parse(e);this._scriptLoader.fetch("static/jszip.min-c96375d50e72b199.js",{id:"jszip-js"}).then(()=>{let e=new 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:a}=e;this._sceneManager.setEnvironmentMap(t,r,i,a)}exportCanvasScreenshot(e){return this._sceneManager.exportCanvasScreenshot(e)}async moveCamera(e){return this._sceneManager.moveCamera(e)}get globalCallbacks(){return this._globalCallback}}h([c],z.prototype,"_rapiAccess",void 0),h([c],z.prototype,"_domHelper",void 0),h([c],z.prototype,"_scriptLoader",void 0),h([c],z.prototype,"_lifeCycleManager",void 0),h([c],z.prototype,"_initData",void 0),h([c],z.prototype,"_globalInitData",void 0),h([c],z.prototype,"_globalCallback",void 0),h([c],z.prototype,"_unitFormatter",void 0),h([c],z.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 z(this._context),window.RoomleGLBViewer||(window.RoomleGLBViewer=this._viewer)}getApi(){return this._viewer}getContextName(){return"glb-viewer"}})}}}));
|
|
2
|
+
//# sourceMappingURL=glb-viewer-fe45c467.nomodule.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"glb-viewer-
|
|
1
|
+
{"version":3,"file":"glb-viewer-fe45c467.nomodule.js","sources":["../../node_modules/jszip/dist/jszip.min.js"],"sourcesContent":["export default \"static/jszip.min-c96375d50e72b199.js\""],"names":[],"mappings":"k0PAAe"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{GlbViewer}from"./glb-viewer-56580b03.js";import"./script-loader-01e992f9.js";import"./query-params-helper-2f7f2adb.js";import"./main-thread-to-worker-b1fa75c7.js";import"./roomle-dependency-injection-40c9e584.js";import"./camera-behaviour-16588b1c.js";import"./default-light-setting-427cc173.js";import"./glb-viewer-camera-behaviour-bcd098e8.js";(new GlbViewer).boot();
|
|
2
|
+
//# sourceMappingURL=glb-viewer-main-e1a17a38.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"glb-viewer-main-e1a17a38.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
System.register(["./glb-viewer-
|
|
1
|
+
System.register(["./glb-viewer-fe45c467.nomodule.js","./script-loader-fa13d1f5.nomodule.js","./query-params-helper-3a0e7148.nomodule.js","./main-thread-to-worker-6a2da53d.nomodule.js","./roomle-dependency-injection-e3763cd6.nomodule.js","./camera-behaviour-dd7a063e.nomodule.js","./default-light-setting-b7032eac.nomodule.js","./glb-viewer-camera-behaviour-67fa46c3.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
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
System.register(["./main-thread-to-worker-6a2da53d.nomodule.js","./roomle-dependency-injection-
|
|
2
|
-
//# sourceMappingURL=imos-ix-poc-export-helper-
|
|
1
|
+
System.register(["./main-thread-to-worker-6a2da53d.nomodule.js","./roomle-dependency-injection-e3763cd6.nomodule.js"],(function(e){var t,n;return{setters:[function(e){t=e.bK},function(e){n=e.a5}],execute:function(){const r=(e,t)=>`${e.x.toFixed(t)},${e.y.toFixed(t)},${e.z.toFixed(t)}`,o=(e,t)=>{let n="";for(let r=0;r<t.length;r++)n+=`<${e}${r+1}>${t[r]}</${e}${r+1}>\n `;return n},a=e("createHomagIxXml",(e={},t={},n={},a)=>{return`<?xml version="1.0" encoding="UTF-8"?>\n <XML type="ListBuilder">\n <Order No="${e.orderNumber}" DispDate="${e.dispatchDate}" Basket="${e.basketNumber}">\n ${i=t,`<Head>\n <COMM>${i.comm}</COMM>\n <ARTICLENO>${i.articleno}</ARTICLENO>\n <CUSTOMER>${i.customer}</CUSTOMER>\n <RETAILER>${i.retailer}</RETAILER>\n <CLIENT>${i.client}</CLIENT>\n <PROGRAM>${i.program}</PROGRAM>\n <EMPLOYEE>${i.employee}</EMPLOYEE>\n <TEXT_LONG>${i.textLong}</TEXT_LONG>\n <TEXT_SHORT>${i.textShort}</TEXT_SHORT>\n\n ${o("COLOUR",i.colour)}\n ${o("INFO",i.info)}\n ${o("ADDRESS",i.address)}\n ${o("BILLING_ADDRESS",i.billingAddress)}\n ${o("SHIPPING_ADDRESS",i.shippingAddress)}\n ${o("ORDER_PRICE_INFO",i.orderPriceInfo)}\n ${o("CUSTOM_INFO",i.customInfo)}\n </Head>`}\n <BuilderList>\n ${((e={},t)=>{let n="";for(let i=0;i<t.length;i++)n+=`<Set LineNo="${i+1}">${o=e,a=t[i],`\n <Pname>${a.name}</Pname>\n <Count>${a.count}</Count>\n <PVarString>${a.attributes}</PVarString>\n <ARTICLE_TEXT_INFO1>${o.articleTextInfo1||""}</ARTICLE_TEXT_INFO1>\n <ARTICLE_TEXT_INFO2>${o.articleTextInfo2||""}</ARTICLE_TEXT_INFO2>\n <ARTICLE_PRICE_INFO1>${o.articlePriceInfo1||""}</ARTICLE_PRICE_INFO1>\n <ARTICLE_PRICE_INFO2>${o.articlePriceInfo2||""}</ARTICLE_PRICE_INFO2>\n <ARTICLE_PRICE_INFO3>${o.articlePriceInfo3||""}</ARTICLE_PRICE_INFO3>\n <Pinsertion>${r(a.position,2)}</Pinsertion>\n <POrntation>${r(a.rotation,2)}</POrntation>\n <DeliveryPeriod>${o.deliveryPeriod||""}</DeliveryPeriod>\n <LIEFERANT>${o.supplier||""}</LIEFERANT>\n <Mengenrabatt>${o.discount||0}</Mengenrabatt>\n <MengenrabattAbs>${o.discountAbs||""}</MengenrabattAbs>\n `}</Set>\n `;var o,a;return n})(n,a.articles)}\n </BuilderList>\n </Order>\n </XML>\n `;var i}),i=e("getFakeOrderParams",()=>{const e=Math.floor(1e6*Math.random()).toString();return{orderNumber:"Order "+e,dispatchDate:"9/11/1911",basketNumber:e}}),s=e("getFakeHeaderParams",()=>({comm:"Rubens2Rembrand",articleno:"ExampleSIM",customer:"Roomle",retailer:"Retail",client:"Ex ClientName",program:"program",employee:"Homag",textLong:"long long long txt",textShort:"short txt",colour:["colour1","colour2","colour3","colour4","colour5"],info:["1Admin","2Firma_ABC","3Adresse_ABC","4PLZ_ABC","5Stadt_ABC","6","7","8","9","10","11","12"],address:["Admin","Firma_ABC","Adresse_ABC","PLZ_ABC","Stadt_ABC","Kundennummer_ABC","Land_ABC"],billingAddress:["Optional1","Optional2","Optional3","Optional4","Optional5","Optional6"],shippingAddress:["opt","opt","opt","opt","opt","opt"],orderPriceInfo:["000","Price002","Price003","Price004","Price005"],customInfo:["CustInf1","CustInf2","CustInf3","CustInf4","CustInf5","CustInf6","CustInf7","CustInf8","CustInf9","CustInf10"]})),c=e("getFakeArticleParams",()=>({}));e("downloadHomagIxExportPoC",async(e,r,o)=>{const l=n(e.objects);let I=[];for(const e of l){const t=e.configurationRuntimeId;try{const e=JSON.parse(r.generateExport(2,t,o));I=I.concat(e.articles)}catch(e){return console.error(e),Promise.reject("Could not create export JSON 2")}}const d=i(),u=s(),E=c(),C=a(d,u,E,{articles:I});return t("IMOSiX.xml",C),Promise.resolve()}),e("generateExportHomagIxConfiguration",async(e,t,n,r,o="")=>{try{return n.setDefaultExportDataDefinition(o),Promise.resolve(JSON.parse(n.generateExport(t,e,r)))}catch(e){return console.error(e),Promise.reject("Could not create export JSON "+t)}}),e("homagIxMockUpData",(e,t={},n={},r={})=>(t=i(),n=s(),r=c(),a(t,n,r,e)))}}}));
|
|
2
|
+
//# sourceMappingURL=imos-ix-poc-export-helper-56fd272c.nomodule.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"imos-ix-poc-export-helper-56fd272c.nomodule.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|