@roomle/web-sdk 2.74.0-alpha.1 → 2.74.0-alpha.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/{banana-for-scale-005da370.nomodule.js → banana-for-scale-493ba3a4.nomodule.js} +2 -2
- package/lib/{banana-for-scale-005da370.nomodule.js.map → banana-for-scale-493ba3a4.nomodule.js.map} +1 -1
- package/lib/{banana-for-scale-76d5124d.js → banana-for-scale-4ee6b861.js} +2 -2
- package/lib/{banana-for-scale-76d5124d.js.map → banana-for-scale-4ee6b861.js.map} +1 -1
- package/lib/{camera-behaviour-1b7c8b3f.js → camera-behaviour-0227a3b5.js} +2 -2
- package/lib/{camera-behaviour-1b7c8b3f.js.map → camera-behaviour-0227a3b5.js.map} +1 -1
- package/lib/{camera-behaviour-5da87548.nomodule.js → camera-behaviour-f1b7daa6.nomodule.js} +2 -2
- package/lib/{camera-behaviour-5da87548.nomodule.js.map → camera-behaviour-f1b7daa6.nomodule.js.map} +1 -1
- package/lib/{component-dimensioning-02f915ca.js → component-dimensioning-c209675b.js} +2 -2
- package/lib/component-dimensioning-c209675b.js.map +1 -0
- package/lib/{component-dimensioning-55f84ca3.nomodule.js → component-dimensioning-cfe19f77.nomodule.js} +2 -2
- package/lib/component-dimensioning-cfe19f77.nomodule.js.map +1 -0
- package/lib/{component-raycast-helper-fcb3787a.nomodule.js → component-raycast-helper-b9304ecc.nomodule.js} +2 -2
- package/lib/component-raycast-helper-b9304ecc.nomodule.js.map +1 -0
- package/lib/{component-raycast-helper-60912498.js → component-raycast-helper-e142e0a3.js} +2 -2
- package/lib/component-raycast-helper-e142e0a3.js.map +1 -0
- package/lib/{configurator-20de86f2.js → configurator-242189bf.js} +2 -2
- package/lib/configurator-242189bf.js.map +1 -0
- package/lib/{configurator-700585e4.nomodule.js → configurator-fd124243.nomodule.js} +2 -2
- package/lib/configurator-fd124243.nomodule.js.map +1 -0
- package/lib/configurator-main-b22b9601.js +2 -0
- package/lib/configurator-main-b22b9601.js.map +1 -0
- package/lib/configurator-main.nomodule.js +1 -1
- package/lib/{continuous-drawing-helper-d5996253.js → continuous-drawing-helper-6594dc80.js} +2 -2
- package/lib/continuous-drawing-helper-6594dc80.js.map +1 -0
- package/lib/{continuous-drawing-helper-1e56b48b.nomodule.js → continuous-drawing-helper-9fe6998c.nomodule.js} +2 -2
- package/lib/continuous-drawing-helper-9fe6998c.nomodule.js.map +1 -0
- package/lib/{default-light-setting-339e68f0.nomodule.js → default-light-setting-97b2c33a.nomodule.js} +2 -2
- package/lib/default-light-setting-97b2c33a.nomodule.js.map +1 -0
- package/lib/{default-light-setting-06ef5388.js → default-light-setting-a8f6c936.js} +2 -2
- package/lib/default-light-setting-a8f6c936.js.map +1 -0
- package/lib/definitions/common-core/src/utils/init-data.d.ts +1 -0
- package/lib/definitions/common-core/src/utils/shims.d.ts +5 -0
- package/lib/definitions/common-core/src/webgl/renderer/materials/postprocessing-material-plugin.d.ts +17 -9
- package/lib/definitions/common-core/src/webgl/renderer/pass/debug-pass.d.ts +2 -0
- package/lib/definitions/common-core/src/webgl/renderer/render-pass-manager.d.ts +4 -1
- package/lib/definitions/common-core/src/webgl/renderer/scene-renderer.d.ts +1 -0
- package/lib/definitions/common-core/src/webgl/renderer/shader-utility.d.ts +1 -1
- package/lib/definitions/common-core/src/webgl/roomle-webgl-renderer.d.ts +3 -1
- package/lib/{dimensioning-helper-9f58e8a5.nomodule.js → dimensioning-helper-0f07d870.nomodule.js} +2 -2
- package/lib/{dimensioning-helper-9f58e8a5.nomodule.js.map → dimensioning-helper-0f07d870.nomodule.js.map} +1 -1
- package/lib/{dimensioning-helper-61eb1353.js → dimensioning-helper-6e284a8f.js} +2 -2
- package/lib/{dimensioning-helper-61eb1353.js.map → dimensioning-helper-6e284a8f.js.map} +1 -1
- package/lib/{glb-viewer-3de5d53f.nomodule.js → glb-viewer-c2cba24c.nomodule.js} +2 -2
- package/lib/{glb-viewer-3de5d53f.nomodule.js.map → glb-viewer-c2cba24c.nomodule.js.map} +1 -1
- package/lib/{glb-viewer-camera-behaviour-4994c55c.js → glb-viewer-camera-behaviour-13fe6037.js} +2 -2
- package/lib/glb-viewer-camera-behaviour-13fe6037.js.map +1 -0
- package/lib/{glb-viewer-camera-behaviour-99f57525.nomodule.js → glb-viewer-camera-behaviour-bfa12aef.nomodule.js} +2 -2
- package/lib/glb-viewer-camera-behaviour-bfa12aef.nomodule.js.map +1 -0
- package/lib/{glb-viewer-12df2a4c.js → glb-viewer-df34fe01.js} +2 -2
- package/lib/{glb-viewer-12df2a4c.js.map → glb-viewer-df34fe01.js.map} +1 -1
- package/lib/glb-viewer-main-13b5eddb.js +2 -0
- package/lib/glb-viewer-main-13b5eddb.js.map +1 -0
- package/lib/glb-viewer-main.nomodule.js +1 -1
- package/lib/legacy/{banana-for-scale-bd28690c.legacy.js → banana-for-scale-f3a635a8.legacy.js} +2 -2
- package/lib/legacy/{banana-for-scale-bd28690c.legacy.js.map → banana-for-scale-f3a635a8.legacy.js.map} +1 -1
- package/lib/legacy/{camera-behaviour-b54b6f5c.legacy.js → camera-behaviour-c5a9e41e.legacy.js} +2 -2
- package/lib/legacy/{camera-behaviour-b54b6f5c.legacy.js.map → camera-behaviour-c5a9e41e.legacy.js.map} +1 -1
- package/lib/legacy/{component-dimensioning-92caaeea.legacy.js → component-dimensioning-05283029.legacy.js} +2 -2
- package/lib/legacy/component-dimensioning-05283029.legacy.js.map +1 -0
- package/lib/legacy/{component-raycast-helper-6fefbad4.legacy.js → component-raycast-helper-4e4dd362.legacy.js} +2 -2
- package/lib/legacy/component-raycast-helper-4e4dd362.legacy.js.map +1 -0
- package/lib/legacy/{configurator-e0cfcd41.legacy.js → configurator-c07d5702.legacy.js} +2 -2
- package/lib/legacy/configurator-c07d5702.legacy.js.map +1 -0
- package/lib/legacy/configurator-main.legacy.js +1 -1
- package/lib/legacy/{continuous-drawing-helper-ec97e26f.legacy.js → continuous-drawing-helper-c242018e.legacy.js} +2 -2
- package/lib/legacy/continuous-drawing-helper-c242018e.legacy.js.map +1 -0
- package/lib/legacy/{default-light-setting-8d3f5813.legacy.js → default-light-setting-4a44a19b.legacy.js} +2 -2
- package/lib/legacy/default-light-setting-4a44a19b.legacy.js.map +1 -0
- package/lib/legacy/{dimensioning-helper-a8215ccd.legacy.js → dimensioning-helper-c1863a88.legacy.js} +2 -2
- package/lib/legacy/{dimensioning-helper-a8215ccd.legacy.js.map → dimensioning-helper-c1863a88.legacy.js.map} +1 -1
- package/lib/legacy/{glb-viewer-59280199.legacy.js → glb-viewer-55b9fa63.legacy.js} +2 -2
- package/lib/legacy/{glb-viewer-59280199.legacy.js.map → glb-viewer-55b9fa63.legacy.js.map} +1 -1
- package/lib/legacy/{glb-viewer-camera-behaviour-fcd166c0.legacy.js → glb-viewer-camera-behaviour-c2d9cf34.legacy.js} +2 -2
- package/lib/legacy/glb-viewer-camera-behaviour-c2d9cf34.legacy.js.map +1 -0
- package/lib/legacy/glb-viewer-main.legacy.js +1 -1
- package/lib/legacy/{material-viewer-e95f5092.legacy.js → material-viewer-9ed755f2.legacy.js} +2 -2
- package/lib/legacy/material-viewer-9ed755f2.legacy.js.map +1 -0
- package/lib/legacy/material-viewer-main.legacy.js +1 -1
- package/lib/legacy/{planner-c864db21.legacy.js → planner-c5b1df8e.legacy.js} +2 -2
- package/lib/legacy/{planner-c864db21.legacy.js.map → planner-c5b1df8e.legacy.js.map} +1 -1
- package/lib/legacy/planner-main.legacy.js +1 -1
- package/lib/legacy/{roomle-configurator-34bf685e.legacy.js → roomle-configurator-abb1d6a9.legacy.js} +2 -2
- package/lib/legacy/roomle-configurator-abb1d6a9.legacy.js.map +1 -0
- package/lib/legacy/roomle-dependency-injection-85007579.legacy.js +9 -0
- package/lib/legacy/{roomle-dependency-injection-d21579b8.legacy.js.map → roomle-dependency-injection-85007579.legacy.js.map} +1 -1
- package/lib/legacy/roomle-sdk.legacy.js +1 -1
- package/lib/legacy/{script-loader-1676f192.legacy.js → script-loader-604472ed.legacy.js} +2 -2
- package/lib/legacy/script-loader-604472ed.legacy.js.map +1 -0
- package/lib/legacy/{stats-helper-6766197e.legacy.js → stats-helper-9b7ed416.legacy.js} +2 -2
- package/lib/legacy/stats-helper-9b7ed416.legacy.js.map +1 -0
- package/lib/legacy/{tools-core-cc51e283.legacy.js → tools-core-2f381e07.legacy.js} +2 -2
- package/lib/legacy/tools-core-2f381e07.legacy.js.map +1 -0
- package/lib/{material-viewer-8735a912.nomodule.js → material-viewer-ad62cf00.nomodule.js} +2 -2
- package/lib/material-viewer-ad62cf00.nomodule.js.map +1 -0
- package/lib/{material-viewer-669cd5a6.js → material-viewer-dfa1a777.js} +2 -2
- package/lib/material-viewer-dfa1a777.js.map +1 -0
- package/lib/material-viewer-main-678f9156.js +2 -0
- package/lib/material-viewer-main-678f9156.js.map +1 -0
- package/lib/material-viewer-main.nomodule.js +1 -1
- package/lib/{planner-8cc117f0.nomodule.js → planner-722f9a54.nomodule.js} +2 -2
- package/lib/{planner-8cc117f0.nomodule.js.map → planner-722f9a54.nomodule.js.map} +1 -1
- package/lib/{planner-c05ab3c1.js → planner-8e2b540b.js} +2 -2
- package/lib/{planner-c05ab3c1.js.map → planner-8e2b540b.js.map} +1 -1
- package/lib/planner-main-70139caa.js +2 -0
- package/lib/planner-main-70139caa.js.map +1 -0
- package/lib/planner-main.nomodule.js +1 -1
- package/lib/{roomle-configurator-68b0bc7e.js → roomle-configurator-6919df4e.js} +2 -2
- package/lib/roomle-configurator-6919df4e.js.map +1 -0
- package/lib/{roomle-configurator-c6e25f0f.nomodule.js → roomle-configurator-799d5bff.nomodule.js} +2 -2
- package/lib/roomle-configurator-799d5bff.nomodule.js.map +1 -0
- package/lib/roomle-dependency-injection-390bf393.nomodule.js +9 -0
- package/lib/{roomle-dependency-injection-3c279485.nomodule.js.map → roomle-dependency-injection-390bf393.nomodule.js.map} +1 -1
- package/lib/roomle-dependency-injection-d1a1dd5d.js +9 -0
- package/lib/{roomle-dependency-injection-6ccd8f80.js.map → roomle-dependency-injection-d1a1dd5d.js.map} +1 -1
- package/lib/{roomle-sdk-dc6da9f3.js → roomle-sdk-8424ff5f.js} +2 -2
- package/lib/roomle-sdk-8424ff5f.js.map +1 -0
- package/lib/roomle-sdk.nomodule.js +1 -1
- package/lib/{script-loader-855b8af6.js → script-loader-2b31ae62.js} +2 -2
- package/lib/script-loader-2b31ae62.js.map +1 -0
- package/lib/{script-loader-56b3cca6.nomodule.js → script-loader-975a3b82.nomodule.js} +2 -2
- package/lib/script-loader-975a3b82.nomodule.js.map +1 -0
- package/lib/{stats-helper-e6e26b2f.nomodule.js → stats-helper-6ad68a5a.nomodule.js} +2 -2
- package/lib/stats-helper-6ad68a5a.nomodule.js.map +1 -0
- package/lib/{stats-helper-07376fcf.js → stats-helper-a3631622.js} +2 -2
- package/lib/stats-helper-a3631622.js.map +1 -0
- package/lib/{tools-core-c695b8a8.nomodule.js → tools-core-27d136ac.nomodule.js} +2 -2
- package/lib/tools-core-27d136ac.nomodule.js.map +1 -0
- package/lib/{tools-core-152805f0.js → tools-core-74c3f54e.js} +2 -2
- package/lib/tools-core-74c3f54e.js.map +1 -0
- package/package.json +2 -2
- package/lib/component-dimensioning-02f915ca.js.map +0 -1
- package/lib/component-dimensioning-55f84ca3.nomodule.js.map +0 -1
- package/lib/component-raycast-helper-60912498.js.map +0 -1
- package/lib/component-raycast-helper-fcb3787a.nomodule.js.map +0 -1
- package/lib/configurator-20de86f2.js.map +0 -1
- package/lib/configurator-700585e4.nomodule.js.map +0 -1
- package/lib/configurator-main-fb62bfe0.js +0 -2
- package/lib/configurator-main-fb62bfe0.js.map +0 -1
- package/lib/continuous-drawing-helper-1e56b48b.nomodule.js.map +0 -1
- package/lib/continuous-drawing-helper-d5996253.js.map +0 -1
- package/lib/default-light-setting-06ef5388.js.map +0 -1
- package/lib/default-light-setting-339e68f0.nomodule.js.map +0 -1
- package/lib/glb-viewer-camera-behaviour-4994c55c.js.map +0 -1
- package/lib/glb-viewer-camera-behaviour-99f57525.nomodule.js.map +0 -1
- package/lib/glb-viewer-main-e7afb302.js +0 -2
- package/lib/glb-viewer-main-e7afb302.js.map +0 -1
- package/lib/legacy/component-dimensioning-92caaeea.legacy.js.map +0 -1
- package/lib/legacy/component-raycast-helper-6fefbad4.legacy.js.map +0 -1
- package/lib/legacy/configurator-e0cfcd41.legacy.js.map +0 -1
- package/lib/legacy/continuous-drawing-helper-ec97e26f.legacy.js.map +0 -1
- package/lib/legacy/default-light-setting-8d3f5813.legacy.js.map +0 -1
- package/lib/legacy/glb-viewer-camera-behaviour-fcd166c0.legacy.js.map +0 -1
- package/lib/legacy/material-viewer-e95f5092.legacy.js.map +0 -1
- package/lib/legacy/roomle-configurator-34bf685e.legacy.js.map +0 -1
- package/lib/legacy/roomle-dependency-injection-d21579b8.legacy.js +0 -9
- package/lib/legacy/script-loader-1676f192.legacy.js.map +0 -1
- package/lib/legacy/stats-helper-6766197e.legacy.js.map +0 -1
- package/lib/legacy/tools-core-cc51e283.legacy.js.map +0 -1
- package/lib/material-viewer-669cd5a6.js.map +0 -1
- package/lib/material-viewer-8735a912.nomodule.js.map +0 -1
- package/lib/material-viewer-main-a50f29e6.js +0 -2
- package/lib/material-viewer-main-a50f29e6.js.map +0 -1
- package/lib/planner-main-e7d689ad.js +0 -2
- package/lib/planner-main-e7d689ad.js.map +0 -1
- package/lib/roomle-configurator-68b0bc7e.js.map +0 -1
- package/lib/roomle-configurator-c6e25f0f.nomodule.js.map +0 -1
- package/lib/roomle-dependency-injection-3c279485.nomodule.js +0 -9
- package/lib/roomle-dependency-injection-6ccd8f80.js +0 -9
- package/lib/roomle-sdk-dc6da9f3.js.map +0 -1
- package/lib/script-loader-56b3cca6.nomodule.js.map +0 -1
- package/lib/script-loader-855b8af6.js.map +0 -1
- package/lib/stats-helper-07376fcf.js.map +0 -1
- package/lib/stats-helper-e6e26b2f.nomodule.js.map +0 -1
- package/lib/tools-core-152805f0.js.map +0 -1
- package/lib/tools-core-c695b8a8.nomodule.js.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"default-light-setting-97b2c33a.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-0227a3b5.js";import{a1 as getGUI}from"./roomle-dependency-injection-d1a1dd5d.js";import{D as DirectionalLight,C as Color,V as Vector2,a as Vector3,A as AmbientLight}from"./main-thread-to-worker-7a8e1f0e.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-a8f6c936.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"default-light-setting-a8f6c936.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -41,6 +41,7 @@ export default class InitData implements Context, Omit<InitDataDefinition, 'colo
|
|
|
41
41
|
sceneLight?: DefaultEnvironmentSceneType;
|
|
42
42
|
shading?: SceneShadingType;
|
|
43
43
|
customShading?: CustomShadingParameters;
|
|
44
|
+
customShadingMoc?: CustomShadingParameters;
|
|
44
45
|
restrictionLevel?: number;
|
|
45
46
|
e2e?: boolean;
|
|
46
47
|
offlineSync?: string;
|
|
@@ -247,6 +247,11 @@ export interface CommonInitData {
|
|
|
247
247
|
* @groups scene-settings
|
|
248
248
|
*/
|
|
249
249
|
customShading?: CustomShadingParameters;
|
|
250
|
+
/**
|
|
251
|
+
* @description Customized shading properties for the overall appearance in MOC
|
|
252
|
+
* @groups scene-settings
|
|
253
|
+
*/
|
|
254
|
+
customShadingMoc?: CustomShadingParameters;
|
|
250
255
|
/**
|
|
251
256
|
* @description restrictionLevel defines visibility of parameters and possible children
|
|
252
257
|
*/
|
package/lib/definitions/common-core/src/webgl/renderer/materials/postprocessing-material-plugin.d.ts
CHANGED
|
@@ -1,16 +1,24 @@
|
|
|
1
1
|
import type { MeshPhysicalMaterial, Texture } from 'three';
|
|
2
2
|
export declare class PostProcessingMaterialPlugin {
|
|
3
|
-
private _aoPassMap;
|
|
4
|
-
aoPassMapScale: number;
|
|
5
|
-
aoIntensity: number;
|
|
6
|
-
aoPassMapIntensity: number;
|
|
7
|
-
shPassMapIntensity: number;
|
|
8
3
|
applyAoAndShadowToAlpha: boolean;
|
|
9
|
-
private
|
|
10
|
-
|
|
11
|
-
|
|
4
|
+
private _aoPassMapUniform;
|
|
5
|
+
private _aoPassMapScaleUniform;
|
|
6
|
+
private _aoPassMapIntensityUniform;
|
|
7
|
+
private _shPassMapIntensityUniform;
|
|
8
|
+
private _reflectionPassMapUniform;
|
|
9
|
+
private _reflectionPassMapScaleUniform;
|
|
10
|
+
private _reflectionPassMapIntensityUniform;
|
|
11
|
+
applyReflectionPassMap: boolean;
|
|
12
|
+
set aoPassMap(value: Texture | null);
|
|
13
|
+
set aoPassMapScale(value: number);
|
|
14
|
+
set aoPassMapIntensity(value: number);
|
|
15
|
+
set shPassMapIntensity(value: number);
|
|
16
|
+
set reflectionPassMap(value: Texture | null);
|
|
17
|
+
set reflectionPassMapScale(value: number);
|
|
18
|
+
set reflectionPassMapIntensity(value: number);
|
|
12
19
|
static addPlugin(material: MeshPhysicalMaterial): PostProcessingMaterialPlugin | null;
|
|
20
|
+
private _isEnabled;
|
|
13
21
|
private _customProgramCacheKey;
|
|
14
22
|
private _onBeforeCompile;
|
|
15
|
-
private
|
|
23
|
+
private _initUniforms;
|
|
16
24
|
}
|
|
@@ -5,11 +5,13 @@ import type { ShaderMaterial, WebGLRenderer } from 'three';
|
|
|
5
5
|
export declare class DebugPass extends RenderPass {
|
|
6
6
|
private _environmentMapDecodeMaterial;
|
|
7
7
|
private _copyMaterial?;
|
|
8
|
+
private _srgbToLinearCopyMaterial?;
|
|
8
9
|
private _depthRenderMaterial?;
|
|
9
10
|
debugOutput: string;
|
|
10
11
|
constructor(renderPassManager: RenderPassManager);
|
|
11
12
|
dispose(): void;
|
|
12
13
|
protected getCopyMaterial(parameters?: CopyTransformMaterialParameters): ShaderMaterial;
|
|
14
|
+
protected getSrgbToLinearCopyMaterial(parameters?: CopyTransformMaterialParameters): ShaderMaterial;
|
|
13
15
|
private _getDepthRenderMaterial;
|
|
14
16
|
renderPass(renderer: WebGLRenderer): void;
|
|
15
17
|
}
|
|
@@ -9,7 +9,7 @@ import type { OutlineRenderer } from './outline-renderer';
|
|
|
9
9
|
import { DebugPass } from './pass/debug-pass';
|
|
10
10
|
import { SceneRenderPass } from './pass/scene-render-pass';
|
|
11
11
|
import type { SceneRenderer } from './scene-renderer';
|
|
12
|
-
import type { Camera, Scene, WebGLRenderer } from 'three';
|
|
12
|
+
import type { Camera, Scene, Texture, WebGLRenderer } from 'three';
|
|
13
13
|
export declare class RenderPassManager {
|
|
14
14
|
materialsNeedUpdate: boolean;
|
|
15
15
|
private _sceneRenderer;
|
|
@@ -30,6 +30,7 @@ export declare class RenderPassManager {
|
|
|
30
30
|
private _noOStaticFrames;
|
|
31
31
|
private _maxSamples;
|
|
32
32
|
private _passUpdateStates;
|
|
33
|
+
aoPassMapTexture: Texture | null;
|
|
33
34
|
get passRenderer(): PassRenderer;
|
|
34
35
|
get scene(): Scene;
|
|
35
36
|
get camera(): Camera;
|
|
@@ -66,5 +67,7 @@ export declare class RenderPassManager {
|
|
|
66
67
|
private _updateDebugPass;
|
|
67
68
|
private _updateMaterials;
|
|
68
69
|
private _updateMaterial;
|
|
70
|
+
private _updatePlugInAo;
|
|
71
|
+
private _updatePlugInReflection;
|
|
69
72
|
renderPasses(renderer: WebGLRenderer, scene: Scene): void;
|
|
70
73
|
}
|
|
@@ -99,6 +99,7 @@ export declare class SceneRenderer {
|
|
|
99
99
|
setQualityLevel(qualityLevel: QualityLevel): void;
|
|
100
100
|
setQualityMap(qualityMap: QualityMap): void;
|
|
101
101
|
setCustomShadingParameters(customShadingParameters: CustomShadingParameters): void;
|
|
102
|
+
setQualityMapAndShadingParameters(qualityMap: QualityMap, customShadingParameters: CustomShadingParameters): void;
|
|
102
103
|
applyCurrentParameters(): void;
|
|
103
104
|
requestUpdateOfPasses(): void;
|
|
104
105
|
clearCache(): void;
|
|
@@ -33,7 +33,7 @@ export interface CopyTransformMaterialParameters {
|
|
|
33
33
|
blendEquationAlpha?: number;
|
|
34
34
|
}
|
|
35
35
|
export declare class CopyTransformMaterial extends ShaderMaterial {
|
|
36
|
-
constructor(parameters?: CopyTransformMaterialParameters, copyBlendMode?: CopyMaterialBlendMode);
|
|
36
|
+
constructor(parameters?: CopyTransformMaterialParameters, copyBlendMode?: CopyMaterialBlendMode, linearToSrgb?: boolean, premultipliedALpha?: boolean);
|
|
37
37
|
update(parameters?: CopyTransformMaterialParameters): CopyTransformMaterial;
|
|
38
38
|
}
|
|
39
39
|
export declare const BlurShader: {
|
|
@@ -26,6 +26,8 @@ export declare class RoomleWebGLRenderer {
|
|
|
26
26
|
private _cacheNeedsUpdate;
|
|
27
27
|
private _shadowNeedsUpdate;
|
|
28
28
|
private _bakedGroundShadowNeedsUpdate;
|
|
29
|
+
private _customShadingParameters;
|
|
30
|
+
private _customShadingParametersMoc;
|
|
29
31
|
private _fpsCounter;
|
|
30
32
|
get renderer(): WebGLRenderer;
|
|
31
33
|
get sceneRenderer(): SceneRenderer;
|
|
@@ -42,7 +44,7 @@ export declare class RoomleWebGLRenderer {
|
|
|
42
44
|
setAutoQuality(autoQuality: boolean): void;
|
|
43
45
|
setQualityLevel(qualityLevel: QualityLevel): void;
|
|
44
46
|
setQualityMap(qualityMap: QualityMap): void;
|
|
45
|
-
setCustomShadingParameters(customShadingParameters?: CustomShadingParameters): void;
|
|
47
|
+
setCustomShadingParameters(customShadingParameters?: CustomShadingParameters, customShadingParametersMoc?: CustomShadingParameters): void;
|
|
46
48
|
enableUiInteractionMode(): void;
|
|
47
49
|
disableUiInteractionMode(): void;
|
|
48
50
|
private loadRectAreLight;
|
package/lib/{dimensioning-helper-9f58e8a5.nomodule.js → dimensioning-helper-0f07d870.nomodule.js}
RENAMED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
System.register(["./roomle-dependency-injection-
|
|
2
|
-
//# sourceMappingURL=dimensioning-helper-
|
|
1
|
+
System.register(["./roomle-dependency-injection-390bf393.nomodule.js","./main-thread-to-worker-097aa61a.nomodule.js","./TextGeometry-00c172fe.nomodule.js"],(function(i){var e,t,s,n,h,o,a,_,d,r,l,m,p,u,x,c,w,g,y,B,b;return{setters:[function(i){e=i.u,t=i._,s=i.i,n=i.ah,h=i.aG},function(i){o=i.O,a=i.a,_=i.h,d=i.w,r=i.br,l=i.B,m=i.z,p=i.Q,u=i.bc,x=i.K,c=i.u,w=i.G,g=i.b,y=i.b0,B=i.ad},function(i){b=i.T}],execute:function(){const T="component_dimensioning_plane_material",z="component_dimensioning_text_material";class L extends o{constructor(i){super(),this._label="",this._parameters={font:null,size:.1,height:.001,curveSegments:2,bevelEnabled:!0,bevelThickness:.001,bevelSize:.001},this.topDown=!1,this._parameters.font=i,this._position=new a,this._initMaterials(),this._init(),this._update()}_initMaterials(){this._cacheHolder.materialCache.has(T)?this._planeMaterial=this._cacheHolder.materialCache.get(T):(this._planeMaterial=new _({color:16777215,side:d,opacity:.8,transparent:!0}),this._cacheHolder.materialCache.set(T,this._planeMaterial)),this._cacheHolder.materialCache.has(z)?this._textMaterial=this._cacheHolder.materialCache.get(z):(this._textMaterial=new r({color:3618615}),this._cacheHolder.materialCache.set(z,this._textMaterial))}_init(){let i=new l;this._text=new m(i,this._textMaterial),this._text.userData.ignoreComponentRaycast=!0,this._text.name="text with background text "+this._label,this._plane=new m(i,this._planeMaterial),this._plane.userData.ignoreComponentRaycast=!0,this._plane.name="text with background plane "+this._label,this._textGeometry=new b(this._label,this._parameters),this._textGeometry.computeBoundingBox(),this._text.geometry=this._textGeometry,this.add(this._text),this.add(this._plane)}update(i,e,t,s){this._position.copy(i),this._dimensioningType=e,this._cameraPosition=s,this._label=t;const n=this._cameraPosition.distanceTo(this._text.position),h=Math.max(.01,n/100),o=Math.max(5e-4,n/5e3);this._parameters.bevelThickness=o,this._parameters.bevelSize=o,this._parameters.size=h,this._textGeometry=new b(this._label,this._parameters),this._textGeometry.computeBoundingBox(),this._text.geometry=this._textGeometry,this._update()}_update(){if(this.topDown){let i=new p;i.setFromAxisAngle(new a(-1,0,0),Math.PI/2),this._updateText(this._textGeometry,i,new a)}else if(this._updateText(this._textGeometry,new p,new a),this._cameraPosition){const i=Math.atan2(this._cameraPosition.x-this._position.x,this._cameraPosition.z-this._position.z);this._text.rotation.y=i,this._plane.rotation.y=i}}_updateText(i,e,t){let s=new a;s.copy(this._position),t.x*=this._getXSign(),s.add(t);let n=i.boundingBox.getSize(new a);i.center(),this._text.position.copy(s),this._text.quaternion.copy(e);let h=new u(n.x+.02,n.y+.02,32);h.center(),this._plane.geometry=h,this._plane.position.copy(s),this._plane.quaternion.copy(e)}_getXSign(){return!this._cameraPosition||this._cameraPosition.x>=0?1:-1}dispose(){e(this)}}t([s],L.prototype,"_cacheHolder",void 0);class D{constructor(i){this._cameraPosition=new a,this._textUpdated=!1,this._topDimensions=!1,this._initialized=new n,this._enabled=!1,this._dimensionsVisible=!1,this._dimensionLineGroup=new x,this._dimensionTextGroup=new x,this._creator_=i,this._lineMaterial=new c({color:3618615,linewidth:2});let e=new l;this._widthLine=new w(e,this._lineMaterial),this._widthLine.userData.ignoreComponentRaycast=!0,this._widthLine.name="dimension width line",this._dimensionLineGroup.add(this._widthLine),this._heightLine=new w(e,this._lineMaterial),this._heightLine.userData.ignoreComponentRaycast=!0,this._heightLine.name="dimension height line",this._dimensionLineGroup.add(this._heightLine),this._depthLine=new w(e,this._lineMaterial),this._depthLine.userData.ignoreComponentRaycast=!0,this._depthLine.name="dimension depth line",this._dimensionLineGroup.add(this._depthLine),this._planeMaterial=new _({color:16777215,side:d,opacity:.8,transparent:!0}),h.loadFont("static/rubik_regular_sub-2dd2d5cca49018c5.json").then(i=>{this._font=i,this._loaded()})}_loaded(){this.update(!1),this.addToScene(this._scene,this._uiScene),this._initialized.resolve()}_performUpdate(i){this._enabled&&(this._lineBounds||i)&&this._font&&(this._updateHeight(),this._updateWidth(),this._updateDepth())}_updateWidth(){let i=new l,e=this._getWidthEdge(),t=[e.start.x,e.start.y,e.start.z,e.end.x,e.end.y,e.end.z];i.setAttribute("position",new g(new Float32Array(t),3)),this._widthLine.geometry.dispose(),this._widthLine.geometry=i;let s=e.getCenter(new a);this._widthText||(this._widthText=new L(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,0,n,this._cameraPosition)}_updateHeight(){let i=new l,e=this._getHeightEdge(),t=[e.start.x,e.start.y,e.start.z,e.end.x,e.end.y,e.end.z];i.setAttribute("position",new g(new Float32Array(t),3)),this._heightLine.geometry.dispose(),this._heightLine.geometry=i;let s=e.getCenter(new a);this._heightText||(this._heightText=new L(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,1,n,this._cameraPosition)}_updateDepth(){let i=new l,e=this._getDepthEdge(),t=[e.start.x,e.start.y,e.start.z,e.end.x,e.end.y,e.end.z];i.setAttribute("position",new g(new Float32Array(t),3)),this._depthLine.geometry.dispose(),this._depthLine.geometry=i;let s=e.getCenter(new a);this._depthText||(this._depthText=new L(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,2,n,this._cameraPosition)}updateBounds(i){if(!i)return;this._dimensions=i.getSize(new a),this._lineBounds=i.clone();let e=this._lineBounds.min.y<0?this._lineBounds.min.y:0;e-=.01,this._lineBounds.expandByVector(new a(.05,e,.05)),this._textUpdated=!1,this.update()}update(i=!1){this._enabled&&!this._dimensionsVisible&&(this._dimensionsVisible=!0,this._visibilityChangedCallback()),this._performUpdate(i)}addToScene(i,e){this._widthText&&this._widthLine&&this._heightText&&this._heightLine&&this._heightText&&this._heightLine&&(i.add(this._dimensionLineGroup),e.add(this._dimensionTextGroup))}removeFromScene(i,e){i.remove(this._dimensionLineGroup),e.remove(this._dimensionTextGroup)}_getWidthEdge(){return this._cameraPosition.z>=0?new y(new a(this._lineBounds.min.x,this._lineBounds.min.y,this._lineBounds.max.z),new a(this._lineBounds.max.x,this._lineBounds.min.y,this._lineBounds.max.z)):new y(new a(this._lineBounds.min.x,this._lineBounds.min.y,this._lineBounds.min.z),new a(this._lineBounds.max.x,this._lineBounds.min.y,this._lineBounds.min.z))}_getDepthEdge(){return this._cameraPosition.x>=0?new y(new a(this._lineBounds.max.x,this._lineBounds.min.y,this._lineBounds.min.z),new a(this._lineBounds.max.x,this._lineBounds.min.y,this._lineBounds.max.z)):new y(new a(this._lineBounds.min.x,this._lineBounds.min.y,this._lineBounds.min.z),new a(this._lineBounds.min.x,this._lineBounds.min.y,this._lineBounds.max.z))}_getHeightEdge(){return this._cameraPosition.x>=0&&this._cameraPosition.z>=0?new y(new a(this._lineBounds.max.x,this._lineBounds.min.y,this._lineBounds.max.z),new a(this._lineBounds.max.x,this._lineBounds.max.y,this._lineBounds.max.z)):this._cameraPosition.x<0&&this._cameraPosition.z>=0?new y(new a(this._lineBounds.min.x,this._lineBounds.min.y,this._lineBounds.max.z),new a(this._lineBounds.min.x,this._lineBounds.max.y,this._lineBounds.max.z)):this._cameraPosition.x>=0&&this._cameraPosition.z<0?new y(new a(this._lineBounds.max.x,this._lineBounds.min.y,this._lineBounds.min.z),new a(this._lineBounds.max.x,this._lineBounds.max.y,this._lineBounds.min.z)):new y(new a(this._lineBounds.min.x,this._lineBounds.min.y,this._lineBounds.min.z),new a(this._lineBounds.min.x,this._lineBounds.max.y,this._lineBounds.min.z))}onDimensionsVisibilityChanged(i){this._onChange=i}enableTopDimensions(){this.enableDimensions(),this._topDimensions=!0,this._heightLine.visible=!1,this._heightText.visible=!1,this.update(!0)}disableTopDimensions(){this._topDimensions=!1,this._heightLine.visible=!0,this._heightText.visible=!0,this.disableDimensions()}enableDimensions(){this._enabled=!0,this.update(!0),this.addToScene(this._scene,this._uiScene)}disableDimensions(){this._enabled=!1,this._dimensionsVisible&&(this._dimensionsVisible=!1,this._visibilityChangedCallback()),this.removeFromScene(this._scene,this._uiScene)}_visibilityChangedCallback(){this._onChange&&this._onChange(this._dimensionsVisible)}_clear(){this._lineMaterial.dispose(),this._planeMaterial.dispose(),this._widthLine.geometry.dispose(),this._heightLine.geometry.dispose(),this._depthLine.geometry.dispose(),this._heightText.dispose(),this._heightText.dispose(),this._depthText.dispose()}getBoundingBox(){const i=new B;return i.expandByObject(this._widthLine),i.expandByObject(this._widthText),i.expandByObject(this._heightLine),i.expandByObject(this._heightText),i.expandByObject(this._depthLine),i.expandByObject(this._depthText),i}setVisibility(i){this._dimensionLineGroup&&this._dimensionTextGroup&&(this._dimensionLineGroup.visible=i,this._dimensionTextGroup.visible=i)}moveCameraStart(i){this.setVisibility(!1),this._cameraPosition=i,this.update()}moveCameraEnd(i){this.setVisibility(!0),this._cameraPosition=i,this.update()}clearScene(i){this._clear()}setScene(i){this._scene=i}setUiScene(i){this._uiScene=i}needsUiScene(){return!0}isInitialized(){return this._initialized.wait()}areDimensionsEnabled(){return this._enabled}}i("default",D),t([s],D.prototype,"_unitFormatter",void 0)}}}));
|
|
2
|
+
//# sourceMappingURL=dimensioning-helper-0f07d870.nomodule.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dimensioning-helper-
|
|
1
|
+
{"version":3,"file":"dimensioning-helper-0f07d870.nomodule.js","sources":["../../packages/configurator-core/public/fonts/rubik_regular_sub.json"],"sourcesContent":["export default \"static/rubik_regular_sub-2dd2d5cca49018c5.json\""],"names":[],"mappings":"81HAAe"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{u as dispose,_ as __decorate,i as inject,ah as AsyncGuard,aG as AsyncDependencyLoader}from"./roomle-dependency-injection-6ccd8f80.js";import{O as Object3D,a as Vector3,h as MeshBasicMaterial,w as DoubleSide,br as MeshPhongMaterial,B as BufferGeometry,z as Mesh,Q as Quaternion,bc as PlaneGeometry,K as Group,u as LineBasicMaterial,G as Line,b as BufferAttribute,b0 as Line3,ad as Box3}from"./main-thread-to-worker-7a8e1f0e.js";import{T as TextGeometry}from"./TextGeometry-ed5deff2.js";const PLANE_MATERIAL="component_dimensioning_plane_material",TEXT_MATERIAL="component_dimensioning_text_material";class TextWithBackground extends Object3D{constructor(e){super(),this._label="",this._parameters={font:null,size:.1,height:.001,curveSegments:2,bevelEnabled:!0,bevelThickness:.001,bevelSize:.001},this.topDown=!1,this._parameters.font=e,this._position=new Vector3,this._initMaterials(),this._init(),this._update()}_initMaterials(){this._cacheHolder.materialCache.has(PLANE_MATERIAL)?this._planeMaterial=this._cacheHolder.materialCache.get(PLANE_MATERIAL):(this._planeMaterial=new MeshBasicMaterial({color:16777215,side:DoubleSide,opacity:.8,transparent:!0}),this._cacheHolder.materialCache.set(PLANE_MATERIAL,this._planeMaterial)),this._cacheHolder.materialCache.has(TEXT_MATERIAL)?this._textMaterial=this._cacheHolder.materialCache.get(TEXT_MATERIAL):(this._textMaterial=new MeshPhongMaterial({color:3618615}),this._cacheHolder.materialCache.set(TEXT_MATERIAL,this._textMaterial))}_init(){let e=new BufferGeometry;this._text=new Mesh(e,this._textMaterial),this._text.userData.ignoreComponentRaycast=!0,this._text.name="text with background text "+this._label,this._plane=new Mesh(e,this._planeMaterial),this._plane.userData.ignoreComponentRaycast=!0,this._plane.name="text with background plane "+this._label,this._textGeometry=new TextGeometry(this._label,this._parameters),this._textGeometry.computeBoundingBox(),this._text.geometry=this._textGeometry,this.add(this._text),this.add(this._plane)}update(e,t,i,s){this._position.copy(e),this._dimensioningType=t,this._cameraPosition=s,this._label=i;const n=this._cameraPosition.distanceTo(this._text.position),h=Math.max(.01,n/100),o=Math.max(5e-4,n/5e3);this._parameters.bevelThickness=o,this._parameters.bevelSize=o,this._parameters.size=h,this._textGeometry=new 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=Math.atan2(this._cameraPosition.x-this._position.x,this._cameraPosition.z-this._position.z);this._text.rotation.y=e,this._plane.rotation.y=e}}_updateText(e,t,i){let s=new 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),this._text.quaternion.copy(t);let h=new PlaneGeometry(n.x+.02,n.y+.02,32);h.center(),this._plane.geometry=h,this._plane.position.copy(s),this._plane.quaternion.copy(t)}_getXSign(){return!this._cameraPosition||this._cameraPosition.x>=0?1:-1}dispose(){dispose(this)}}__decorate([inject],TextWithBackground.prototype,"_cacheHolder",void 0);class DimensioningHelper{constructor(e){this._cameraPosition=new Vector3,this._textUpdated=!1,this._topDimensions=!1,this._initialized=new AsyncGuard,this._enabled=!1,this._dimensionsVisible=!1,this._dimensionLineGroup=new Group,this._dimensionTextGroup=new Group,this._creator_=e,this._lineMaterial=new LineBasicMaterial({color:3618615,linewidth:2});let t=new BufferGeometry;this._widthLine=new Line(t,this._lineMaterial),this._widthLine.userData.ignoreComponentRaycast=!0,this._widthLine.name="dimension width line",this._dimensionLineGroup.add(this._widthLine),this._heightLine=new Line(t,this._lineMaterial),this._heightLine.userData.ignoreComponentRaycast=!0,this._heightLine.name="dimension height line",this._dimensionLineGroup.add(this._heightLine),this._depthLine=new Line(t,this._lineMaterial),this._depthLine.userData.ignoreComponentRaycast=!0,this._depthLine.name="dimension depth line",this._dimensionLineGroup.add(this._depthLine),this._planeMaterial=new MeshBasicMaterial({color:16777215,side:DoubleSide,opacity:.8,transparent:!0}),AsyncDependencyLoader.loadFont("static/rubik_regular_sub-2dd2d5cca49018c5.json").then(e=>{this._font=e,this._loaded()})}_loaded(){this.update(!1),this.addToScene(this._scene,this._uiScene),this._initialized.resolve()}_performUpdate(e){this._enabled&&(this._lineBounds||e)&&this._font&&(this._updateHeight(),this._updateWidth(),this._updateDepth())}_updateWidth(){let e=new 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,0,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,1,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,2,n,this._cameraPosition)}updateBounds(e){if(!e)return;this._dimensions=e.getSize(new Vector3),this._lineBounds=e.clone();let t=this._lineBounds.min.y<0?this._lineBounds.min.y:0;t-=.01,this._lineBounds.expandByVector(new Vector3(.05,t,.05)),this._textUpdated=!1,this.update()}update(e=!1){this._enabled&&!this._dimensionsVisible&&(this._dimensionsVisible=!0,this._visibilityChangedCallback()),this._performUpdate(e)}addToScene(e,t){this._widthText&&this._widthLine&&this._heightText&&this._heightLine&&this._heightText&&this._heightLine&&(e.add(this._dimensionLineGroup),t.add(this._dimensionTextGroup))}removeFromScene(e,t){e.remove(this._dimensionLineGroup),t.remove(this._dimensionTextGroup)}_getWidthEdge(){return this._cameraPosition.z>=0?new Line3(new Vector3(this._lineBounds.min.x,this._lineBounds.min.y,this._lineBounds.max.z),new Vector3(this._lineBounds.max.x,this._lineBounds.min.y,this._lineBounds.max.z)):new Line3(new Vector3(this._lineBounds.min.x,this._lineBounds.min.y,this._lineBounds.min.z),new Vector3(this._lineBounds.max.x,this._lineBounds.min.y,this._lineBounds.min.z))}_getDepthEdge(){return this._cameraPosition.x>=0?new Line3(new Vector3(this._lineBounds.max.x,this._lineBounds.min.y,this._lineBounds.min.z),new Vector3(this._lineBounds.max.x,this._lineBounds.min.y,this._lineBounds.max.z)):new Line3(new Vector3(this._lineBounds.min.x,this._lineBounds.min.y,this._lineBounds.min.z),new Vector3(this._lineBounds.min.x,this._lineBounds.min.y,this._lineBounds.max.z))}_getHeightEdge(){return this._cameraPosition.x>=0&&this._cameraPosition.z>=0?new Line3(new Vector3(this._lineBounds.max.x,this._lineBounds.min.y,this._lineBounds.max.z),new Vector3(this._lineBounds.max.x,this._lineBounds.max.y,this._lineBounds.max.z)):this._cameraPosition.x<0&&this._cameraPosition.z>=0?new Line3(new Vector3(this._lineBounds.min.x,this._lineBounds.min.y,this._lineBounds.max.z),new Vector3(this._lineBounds.min.x,this._lineBounds.max.y,this._lineBounds.max.z)):this._cameraPosition.x>=0&&this._cameraPosition.z<0?new Line3(new Vector3(this._lineBounds.max.x,this._lineBounds.min.y,this._lineBounds.min.z),new Vector3(this._lineBounds.max.x,this._lineBounds.max.y,this._lineBounds.min.z)):new Line3(new Vector3(this._lineBounds.min.x,this._lineBounds.min.y,this._lineBounds.min.z),new Vector3(this._lineBounds.min.x,this._lineBounds.max.y,this._lineBounds.min.z))}onDimensionsVisibilityChanged(e){this._onChange=e}enableTopDimensions(){this.enableDimensions(),this._topDimensions=!0,this._heightLine.visible=!1,this._heightText.visible=!1,this.update(!0)}disableTopDimensions(){this._topDimensions=!1,this._heightLine.visible=!0,this._heightText.visible=!0,this.disableDimensions()}enableDimensions(){this._enabled=!0,this.update(!0),this.addToScene(this._scene,this._uiScene)}disableDimensions(){this._enabled=!1,this._dimensionsVisible&&(this._dimensionsVisible=!1,this._visibilityChangedCallback()),this.removeFromScene(this._scene,this._uiScene)}_visibilityChangedCallback(){this._onChange&&this._onChange(this._dimensionsVisible)}_clear(){this._lineMaterial.dispose(),this._planeMaterial.dispose(),this._widthLine.geometry.dispose(),this._heightLine.geometry.dispose(),this._depthLine.geometry.dispose(),this._heightText.dispose(),this._heightText.dispose(),this._depthText.dispose()}getBoundingBox(){const e=new 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()}setScene(e){this._scene=e}setUiScene(e){this._uiScene=e}needsUiScene(){return!0}isInitialized(){return this._initialized.wait()}areDimensionsEnabled(){return this._enabled}}__decorate([inject],DimensioningHelper.prototype,"_unitFormatter",void 0);export{DimensioningHelper as default};
|
|
2
|
-
//# sourceMappingURL=dimensioning-helper-
|
|
1
|
+
import{u as dispose,_ as __decorate,i as inject,ah as AsyncGuard,aG as AsyncDependencyLoader}from"./roomle-dependency-injection-d1a1dd5d.js";import{O as Object3D,a as Vector3,h as MeshBasicMaterial,w as DoubleSide,br as MeshPhongMaterial,B as BufferGeometry,z as Mesh,Q as Quaternion,bc as PlaneGeometry,K as Group,u as LineBasicMaterial,G as Line,b as BufferAttribute,b0 as Line3,ad as Box3}from"./main-thread-to-worker-7a8e1f0e.js";import{T as TextGeometry}from"./TextGeometry-ed5deff2.js";const PLANE_MATERIAL="component_dimensioning_plane_material",TEXT_MATERIAL="component_dimensioning_text_material";class TextWithBackground extends Object3D{constructor(e){super(),this._label="",this._parameters={font:null,size:.1,height:.001,curveSegments:2,bevelEnabled:!0,bevelThickness:.001,bevelSize:.001},this.topDown=!1,this._parameters.font=e,this._position=new Vector3,this._initMaterials(),this._init(),this._update()}_initMaterials(){this._cacheHolder.materialCache.has(PLANE_MATERIAL)?this._planeMaterial=this._cacheHolder.materialCache.get(PLANE_MATERIAL):(this._planeMaterial=new MeshBasicMaterial({color:16777215,side:DoubleSide,opacity:.8,transparent:!0}),this._cacheHolder.materialCache.set(PLANE_MATERIAL,this._planeMaterial)),this._cacheHolder.materialCache.has(TEXT_MATERIAL)?this._textMaterial=this._cacheHolder.materialCache.get(TEXT_MATERIAL):(this._textMaterial=new MeshPhongMaterial({color:3618615}),this._cacheHolder.materialCache.set(TEXT_MATERIAL,this._textMaterial))}_init(){let e=new BufferGeometry;this._text=new Mesh(e,this._textMaterial),this._text.userData.ignoreComponentRaycast=!0,this._text.name="text with background text "+this._label,this._plane=new Mesh(e,this._planeMaterial),this._plane.userData.ignoreComponentRaycast=!0,this._plane.name="text with background plane "+this._label,this._textGeometry=new TextGeometry(this._label,this._parameters),this._textGeometry.computeBoundingBox(),this._text.geometry=this._textGeometry,this.add(this._text),this.add(this._plane)}update(e,t,i,s){this._position.copy(e),this._dimensioningType=t,this._cameraPosition=s,this._label=i;const n=this._cameraPosition.distanceTo(this._text.position),h=Math.max(.01,n/100),o=Math.max(5e-4,n/5e3);this._parameters.bevelThickness=o,this._parameters.bevelSize=o,this._parameters.size=h,this._textGeometry=new 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=Math.atan2(this._cameraPosition.x-this._position.x,this._cameraPosition.z-this._position.z);this._text.rotation.y=e,this._plane.rotation.y=e}}_updateText(e,t,i){let s=new 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),this._text.quaternion.copy(t);let h=new PlaneGeometry(n.x+.02,n.y+.02,32);h.center(),this._plane.geometry=h,this._plane.position.copy(s),this._plane.quaternion.copy(t)}_getXSign(){return!this._cameraPosition||this._cameraPosition.x>=0?1:-1}dispose(){dispose(this)}}__decorate([inject],TextWithBackground.prototype,"_cacheHolder",void 0);class DimensioningHelper{constructor(e){this._cameraPosition=new Vector3,this._textUpdated=!1,this._topDimensions=!1,this._initialized=new AsyncGuard,this._enabled=!1,this._dimensionsVisible=!1,this._dimensionLineGroup=new Group,this._dimensionTextGroup=new Group,this._creator_=e,this._lineMaterial=new LineBasicMaterial({color:3618615,linewidth:2});let t=new BufferGeometry;this._widthLine=new Line(t,this._lineMaterial),this._widthLine.userData.ignoreComponentRaycast=!0,this._widthLine.name="dimension width line",this._dimensionLineGroup.add(this._widthLine),this._heightLine=new Line(t,this._lineMaterial),this._heightLine.userData.ignoreComponentRaycast=!0,this._heightLine.name="dimension height line",this._dimensionLineGroup.add(this._heightLine),this._depthLine=new Line(t,this._lineMaterial),this._depthLine.userData.ignoreComponentRaycast=!0,this._depthLine.name="dimension depth line",this._dimensionLineGroup.add(this._depthLine),this._planeMaterial=new MeshBasicMaterial({color:16777215,side:DoubleSide,opacity:.8,transparent:!0}),AsyncDependencyLoader.loadFont("static/rubik_regular_sub-2dd2d5cca49018c5.json").then(e=>{this._font=e,this._loaded()})}_loaded(){this.update(!1),this.addToScene(this._scene,this._uiScene),this._initialized.resolve()}_performUpdate(e){this._enabled&&(this._lineBounds||e)&&this._font&&(this._updateHeight(),this._updateWidth(),this._updateDepth())}_updateWidth(){let e=new 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,0,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,1,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,2,n,this._cameraPosition)}updateBounds(e){if(!e)return;this._dimensions=e.getSize(new Vector3),this._lineBounds=e.clone();let t=this._lineBounds.min.y<0?this._lineBounds.min.y:0;t-=.01,this._lineBounds.expandByVector(new Vector3(.05,t,.05)),this._textUpdated=!1,this.update()}update(e=!1){this._enabled&&!this._dimensionsVisible&&(this._dimensionsVisible=!0,this._visibilityChangedCallback()),this._performUpdate(e)}addToScene(e,t){this._widthText&&this._widthLine&&this._heightText&&this._heightLine&&this._heightText&&this._heightLine&&(e.add(this._dimensionLineGroup),t.add(this._dimensionTextGroup))}removeFromScene(e,t){e.remove(this._dimensionLineGroup),t.remove(this._dimensionTextGroup)}_getWidthEdge(){return this._cameraPosition.z>=0?new Line3(new Vector3(this._lineBounds.min.x,this._lineBounds.min.y,this._lineBounds.max.z),new Vector3(this._lineBounds.max.x,this._lineBounds.min.y,this._lineBounds.max.z)):new Line3(new Vector3(this._lineBounds.min.x,this._lineBounds.min.y,this._lineBounds.min.z),new Vector3(this._lineBounds.max.x,this._lineBounds.min.y,this._lineBounds.min.z))}_getDepthEdge(){return this._cameraPosition.x>=0?new Line3(new Vector3(this._lineBounds.max.x,this._lineBounds.min.y,this._lineBounds.min.z),new Vector3(this._lineBounds.max.x,this._lineBounds.min.y,this._lineBounds.max.z)):new Line3(new Vector3(this._lineBounds.min.x,this._lineBounds.min.y,this._lineBounds.min.z),new Vector3(this._lineBounds.min.x,this._lineBounds.min.y,this._lineBounds.max.z))}_getHeightEdge(){return this._cameraPosition.x>=0&&this._cameraPosition.z>=0?new Line3(new Vector3(this._lineBounds.max.x,this._lineBounds.min.y,this._lineBounds.max.z),new Vector3(this._lineBounds.max.x,this._lineBounds.max.y,this._lineBounds.max.z)):this._cameraPosition.x<0&&this._cameraPosition.z>=0?new Line3(new Vector3(this._lineBounds.min.x,this._lineBounds.min.y,this._lineBounds.max.z),new Vector3(this._lineBounds.min.x,this._lineBounds.max.y,this._lineBounds.max.z)):this._cameraPosition.x>=0&&this._cameraPosition.z<0?new Line3(new Vector3(this._lineBounds.max.x,this._lineBounds.min.y,this._lineBounds.min.z),new Vector3(this._lineBounds.max.x,this._lineBounds.max.y,this._lineBounds.min.z)):new Line3(new Vector3(this._lineBounds.min.x,this._lineBounds.min.y,this._lineBounds.min.z),new Vector3(this._lineBounds.min.x,this._lineBounds.max.y,this._lineBounds.min.z))}onDimensionsVisibilityChanged(e){this._onChange=e}enableTopDimensions(){this.enableDimensions(),this._topDimensions=!0,this._heightLine.visible=!1,this._heightText.visible=!1,this.update(!0)}disableTopDimensions(){this._topDimensions=!1,this._heightLine.visible=!0,this._heightText.visible=!0,this.disableDimensions()}enableDimensions(){this._enabled=!0,this.update(!0),this.addToScene(this._scene,this._uiScene)}disableDimensions(){this._enabled=!1,this._dimensionsVisible&&(this._dimensionsVisible=!1,this._visibilityChangedCallback()),this.removeFromScene(this._scene,this._uiScene)}_visibilityChangedCallback(){this._onChange&&this._onChange(this._dimensionsVisible)}_clear(){this._lineMaterial.dispose(),this._planeMaterial.dispose(),this._widthLine.geometry.dispose(),this._heightLine.geometry.dispose(),this._depthLine.geometry.dispose(),this._heightText.dispose(),this._heightText.dispose(),this._depthText.dispose()}getBoundingBox(){const e=new 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()}setScene(e){this._scene=e}setUiScene(e){this._uiScene=e}needsUiScene(){return!0}isInitialized(){return this._initialized.wait()}areDimensionsEnabled(){return this._enabled}}__decorate([inject],DimensioningHelper.prototype,"_unitFormatter",void 0);export{DimensioningHelper as default};
|
|
2
|
+
//# sourceMappingURL=dimensioning-helper-6e284a8f.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dimensioning-helper-
|
|
1
|
+
{"version":3,"file":"dimensioning-helper-6e284a8f.js","sources":["../../packages/configurator-core/public/fonts/rubik_regular_sub.json"],"sourcesContent":["export default \"static/rubik_regular_sub-2dd2d5cca49018c5.json\""],"names":[],"mappings":"o1IAAe"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
System.register(["./script-loader-
|
|
2
|
-
//# sourceMappingURL=glb-viewer-
|
|
1
|
+
System.register(["./script-loader-975a3b82.nomodule.js","./roomle-dependency-injection-390bf393.nomodule.js","./camera-behaviour-f1b7daa6.nomodule.js","./main-thread-to-worker-097aa61a.nomodule.js","./default-light-setting-97b2c33a.nomodule.js","./glb-viewer-camera-behaviour-bfa12aef.nomodule.js","./query-params-helper-558a4849.nomodule.js"],(function(e){var t,r,i,n,s,a,o,h,c,l,d,u,m,_,p,g,w,v,b,f,S,C,L,M,B,y,I,x,G,j,E,O,F;return{setters:[function(e){t=e.S,r=e.M},function(e){i=e.aw,n=e.D,s=e.L,a=e.R,o=e.a1,h=e._,c=e.i,l=e.l,d=e.p,u=e.q,m=e.u,_=e.b},function(e){p=e.C,g=e.L,w=e.S,v=e.T},function(e){b=e.a,f=e.ad,S=e.ag,C=e.Q,L=e.A,M=e.C,B=e.aE,y=e.aS,I=e.bz,x=e.i,G=e.bn,j=e.N,E=e.bN},function(e){O=e.D},function(e){F=e.G},function(){}],execute:function(){const D=[new n("script-loader",t),new n("glb-input-manager",class extends i{},1),new n("logger",s),new n("rapi-access",a)];class P extends p{constructor(){super(...arguments),this.shouldIgnoreStandardBehavior=!1}adjust(e,t,r,i,n){let s=new b(-e.x/2,0,-e.z/2),a=new b(e.x/2,e.y,e.z/2);this._boundingBox=new f(s,a);let o=new S(-Math.PI/2+i,r,0,"ZYX"),h=(new C).setFromEuler(o);this._camera.updateProjectionMatrix(),this._camera.quaternion.copy(h),this._camera.position.copy(t)}_update(e){this.shouldIgnoreStandardBehavior?this._saveYawAndPitch():super._update(e)}animateCamera(e){return!!this.shouldIgnoreStandardBehavior||super.animateCamera(e)}}class z extends g{constructor(e,t){super(e,t),this._params={ambientLight:{color:"#ffffff"}},this._ambientLight=new L(new M(this._params.ambientLight.color),.5),this.addToScene()}addToScene(){this._scene.add(this._ambientLight)}removeFromScene(){this._scene.remove(this._ambientLight)}reload(){this.removeFromScene(),this.addToScene()}showGUI(){let e=o();if(e&&this._ambientLight){let t=e.addFolder("Ambient Light");t.add(this._ambientLight,"visible"),t.add(this._ambientLight,"intensity").min(0).max(5).step(.1),t.addColor(this._params.ambientLight,"color").onChange(e=>{this._ambientLight.color=new M(e)})}}}class A extends w{constructor(e,t){super(e,t,l.GLB,B.CAMERA_3D),this._itemsCount=0,this._standardSceneBackgroundColor=this._scene.background,this._initData.legacyLight&&(this._renderer.capabilities.maxTextures>8?this.loadDynamicLightSetting(d.createDynamicLightSettingSource(null,u.CAMERA)):(console.warn("this device has a maximum of 8 texture units thus we are using a simpler light setting"),this._lightSetting=new z(this._scene)))}createCameraControl(e,t){this._changeCameraBehaviour(new F(new P(this._creator_,this._getInputManager(),new b(-1,1,1)),this._cameraBehaviourState))}_getInputManager(){return this._glbInputManager}async loadStaticItem(e,t){const r=await this._rapiAccess.getItem(e);if(r.configuration)return Promise.reject();const i=y(r);return i?this.loadGLB(i,!0,void 0,t):Promise.reject(new Error("GLB Url not detected"))}loadGLB(e,t=!0,r=new b(1,1,1),i){return this.clearScene(),new Promise((n,s)=>{this._loadGLB(e,new b(0,0,0),0,void 0,r,void 0,void 0,i).then(e=>{this._currentGLB=e,this._scene.add(this._currentGLB);let r=(new f).setFromObject(this._currentGLB);t&&this.cameraBehaviour.cameraControl instanceof P&&this.glbViewerCameraBehaviour.updateCameraOnItemLoaded(r),this._updateBounds(r,null,!0),n()},s)})}preparePerspectiveImage(e,t,r){return new Promise(i=>{var n,s;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 a=this.cameraBehaviour.cameraControl.getCamera().clone();a instanceof j&&(a.aspect=t/r,a.updateProjectionMatrix()),null===(n=this._lightSetting)||void 0===n||n.removeFromScene();let o=new O(this._scene);e.render(this._scene,a);let h=e.domElement.toDataURL();e.domElement.toBlob(e=>{i({image:h,width:t,height:r,blob:e})},"image/png"),o.removeFromScene(),null===(s=this._lightSetting)||void 0===s||s.addToScene()})}adjustCamera(e,t,r,i){if(this.cameraBehaviour.cameraControl instanceof P){let n=(new f).setFromObject(this._scene).getSize(new b);this.cameraBehaviour.cameraControl.adjust(n,e,t,r,i),this._requestRender()}}onStart(e){this._itemsCount=e,this._scene.background=null,this.cameraBehaviour.cameraControl instanceof P&&(this.cameraBehaviour.cameraControl.shouldIgnoreStandardBehavior=!0)}onElementFinished(e){this._itemsCount,Math.round(100/this._itemsCount*e)}onFinished(e){this._scene.background=this._standardSceneBackgroundColor,this.cameraBehaviour.cameraControl instanceof P&&(this.cameraBehaviour.cameraControl.shouldIgnoreStandardBehavior=!1)}clearScene(){this._currentGLB&&(this._scene.remove(this._currentGLB),m(this._currentGLB),this._currentGLB=null),super.clearScene()}enableHD(){super.enableHD()}sceneChanged(){}getBounds(){return this._currentGLB?(new f).setFromObject(this._currentGLB):null}get glbViewerCameraBehaviour(){return this.cameraBehaviour}getGeometryBounds(){return null}}h([c],A.prototype,"_glbInputManager",void 0),h([c],A.prototype,"_rapiAccess",void 0);class U{constructor(e,t,r){this._prefix="https://furniture.roomle.com/3d/glb/",this._listeners=new Set,this._finishedItems=0,this._sceneManager=e,this._renderer=new I({antialias:!0,alpha:!0}),this._width=t,this._height=r,this._renderer.setSize(t,r),this._renderer.setClearColor(16777215,0),this._renderer.outputColorSpace=x}addListener(e){this._listeners.add(e)}removeListener(e){this._listeners.delete(e)}start(e){return this._entries=[],e.forEach(e=>{this._entries.push(this._transform(e))}),this._finishedItems=0,this._listeners.forEach(e=>e.onStart(this._entries.length)),this._zip=new window.JSZip,this._doNextEntry(),new Promise(e=>{this._resolve=e})}_transform(e){return{name:e.path.replace(".glb",".png"),url:this._prefix+e.path,position:new 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 k{constructor(e){this._currentIdOrUrl=null,this._creator_=e}setCameraOffset(e){this._sceneManager.setCameraOffset(e)}getCameraOffset(){return this._sceneManager.getCameraOffset()}init(e,t){return this.setOverrides(t),this._domHelper.setDomElement(e),this._sceneManager?(this._lifeCycleManager.resume(),Promise.resolve()):new Promise(this._initPromiseCallback.bind(this))}_initPromiseCallback(e,t){Promise.all([this._scriptLoader.fetch(v,{id:"tween-js"})]).then(()=>{this._sceneManager=new A(this._creator_,{left:0,top:1,right:1,bottom:0}),this._sceneManager.enableHD(),e()})}clearScene(){this._sceneManager.clearScene()}loadGLB(e,t=1,r){return this._currentIdOrUrl=e,this._rapiAccess.trackView(e),this._sceneManager.loadGLB(e,!0,new 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=>{E("content.zip",URL.createObjectURL(t)),e.removeListener(this._sceneManager)})})})}setOverrides(e){e&&(this._initData.setOverrides(e),this._globalInitData.setOverrides(e))}updateSize(){this._sceneManager.updateCamera()}getMain(){}resumeTest(e){this._domHelper.setDomElement(e),this._lifeCycleManager.resume()}pauseTest(){this._lifeCycleManager.pause()}showGUI(){this._sceneManager.showGUI()}get callbacks(){return{}}getScene(){return this._sceneManager.getScene()}updateScene(){this._sceneManager.updateScene()}getUnitFormatter(){return this._unitFormatter}getStorage(){return this._idbManager}setEnvironmentMap(e){const{url:t,intensity:r,rotation:i,maxLightSources:n}=e;this._sceneManager.setEnvironmentMap(t,r,i,n)}}h([c],k.prototype,"_rapiAccess",void 0),h([c],k.prototype,"_domHelper",void 0),h([c],k.prototype,"_scriptLoader",void 0),h([c],k.prototype,"_lifeCycleManager",void 0),h([c],k.prototype,"_initData",void 0),h([c],k.prototype,"_globalInitData",void 0),h([c],k.prototype,"_unitFormatter",void 0),h([c],k.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 k(this._context),window.RoomleGLBViewer||(window.RoomleGLBViewer=this._viewer)}getApi(){return this._viewer}getContextName(){return"glb-viewer"}})}}}));
|
|
2
|
+
//# sourceMappingURL=glb-viewer-c2cba24c.nomodule.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"glb-viewer-
|
|
1
|
+
{"version":3,"file":"glb-viewer-c2cba24c.nomodule.js","sources":["../../node_modules/jszip/dist/jszip.min.js"],"sourcesContent":["export default \"static/jszip.min-c96375d50e72b199.js\""],"names":[],"mappings":"i8OAAe"}
|
package/lib/{glb-viewer-camera-behaviour-4994c55c.js → glb-viewer-camera-behaviour-13fe6037.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-0227a3b5.js";class GlbViewerCameraBehaviour extends CameraBehaviour{get cameraControl(){return this._cameraControl}updateCameraOnItemLoaded(a){this.cameraControl.updateAndReset(a,!1)}}export{GlbViewerCameraBehaviour as G};
|
|
2
|
+
//# sourceMappingURL=glb-viewer-camera-behaviour-13fe6037.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"glb-viewer-camera-behaviour-13fe6037.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
System.register(["./camera-behaviour-
|
|
2
|
-
//# sourceMappingURL=glb-viewer-camera-behaviour-
|
|
1
|
+
System.register(["./camera-behaviour-f1b7daa6.nomodule.js"],(function(e){var t;return{setters:[function(e){t=e.b}],execute:function(){e("G",class extends t{get cameraControl(){return this._cameraControl}updateCameraOnItemLoaded(e){this.cameraControl.updateAndReset(e,!1)}})}}}));
|
|
2
|
+
//# sourceMappingURL=glb-viewer-camera-behaviour-bfa12aef.nomodule.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"glb-viewer-camera-behaviour-bfa12aef.nomodule.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{S as ScriptLoader,M as Main}from"./script-loader-855b8af6.js";import{aw as InputManager,D as DependencyInjectionAssignment,L as Logger,R as RapiAccess,a1 as getGUI,_ as __decorate,i as inject,l as CANVAS_ID,p as DynamicLightSettingLoader,q as PREDEFINED_LIGHTSETTING,u as dispose,b as RoomleDependencyInjection}from"./roomle-dependency-injection-6ccd8f80.js";import{C as CameraControl3D,L as LightSetting,S as SceneManager,T as TWEEN_FILE_NAME}from"./camera-behaviour-1b7c8b3f.js";import{a as Vector3,ad as Box3,ag as Euler,Q as Quaternion,A as AmbientLight,C as Color,aE as CAMERA_TYPE,aS as getGlbUrl,bz as WebGLRenderer,i as SRGBColorSpace,bn as BasicShadowMap,N as PerspectiveCamera,bN as download}from"./main-thread-to-worker-7a8e1f0e.js";import{D as DefaultLightSetting}from"./default-light-setting-06ef5388.js";import{G as GlbViewerCameraBehaviour}from"./glb-viewer-camera-behaviour-4994c55c.js";import"./query-params-helper-12ad9c03.js";const INJECTABLES=[new DependencyInjectionAssignment("script-loader",ScriptLoader),new DependencyInjectionAssignment("glb-input-manager",class extends InputManager{},1),new DependencyInjectionAssignment("logger",Logger),new DependencyInjectionAssignment("rapi-access",RapiAccess)];class AdjustableCameraControl3D extends CameraControl3D{constructor(){super(...arguments),this.shouldIgnoreStandardBehavior=!1}adjust(e,t,r,i,a){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+i,r,0,"ZYX"),c=(new Quaternion).setFromEuler(o);this._camera.updateProjectionMatrix(),this._camera.quaternion.copy(c),this._camera.position.copy(t)}_update(e){this.shouldIgnoreStandardBehavior?this._saveYawAndPitch():super._update(e)}animateCamera(e){return!!this.shouldIgnoreStandardBehavior||super.animateCamera(e)}}class GLBViewerLightSetting extends LightSetting{constructor(e,t){super(e,t),this._params={ambientLight:{color:"#ffffff"}},this._ambientLight=new AmbientLight(new Color(this._params.ambientLight.color),.5),this.addToScene()}addToScene(){this._scene.add(this._ambientLight)}removeFromScene(){this._scene.remove(this._ambientLight)}reload(){this.removeFromScene(),this.addToScene()}showGUI(){let e=getGUI();if(e&&this._ambientLight){let t=e.addFolder("Ambient Light");t.add(this._ambientLight,"visible"),t.add(this._ambientLight,"intensity").min(0).max(5).step(.1),t.addColor(this._params.ambientLight,"color").onChange(e=>{this._ambientLight.color=new Color(e)})}}}class GLBViewerSceneManager extends SceneManager{constructor(e,t){super(e,t,CANVAS_ID.GLB,CAMERA_TYPE.CAMERA_3D),this._itemsCount=0,this._standardSceneBackgroundColor=this._scene.background,this._initData.legacyLight&&(this._renderer.capabilities.maxTextures>8?this.loadDynamicLightSetting(DynamicLightSettingLoader.createDynamicLightSettingSource(null,PREDEFINED_LIGHTSETTING.CAMERA)):(console.warn("this device has a maximum of 8 texture units thus we are using a simpler light setting"),this._lightSetting=new GLBViewerLightSetting(this._scene)))}createCameraControl(e,t){this._changeCameraBehaviour(new GlbViewerCameraBehaviour(new AdjustableCameraControl3D(this._creator_,this._getInputManager(),new Vector3(-1,1,1)),this._cameraBehaviourState))}_getInputManager(){return this._glbInputManager}async loadStaticItem(e,t){const r=await this._rapiAccess.getItem(e);if(r.configuration)return Promise.reject();const i=getGlbUrl(r);return i?this.loadGLB(i,!0,void 0,t):Promise.reject(new Error("GLB Url not detected"))}loadGLB(e,t=!0,r=new Vector3(1,1,1),i){return this.clearScene(),new Promise((a,n)=>{this._loadGLB(e,new Vector3(0,0,0),0,void 0,r,void 0,void 0,i).then(e=>{this._currentGLB=e,this._scene.add(this._currentGLB);let r=(new Box3).setFromObject(this._currentGLB);t&&this.cameraBehaviour.cameraControl instanceof AdjustableCameraControl3D&&this.glbViewerCameraBehaviour.updateCameraOnItemLoaded(r),this._updateBounds(r,null,!0),a()},n)})}preparePerspectiveImage(e,t,r){return new Promise(i=>{var a,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===(a=this._lightSetting)||void 0===a||a.removeFromScene();let o=new DefaultLightSetting(this._scene);e.render(this._scene,s);let c=e.domElement.toDataURL();e.domElement.toBlob(e=>{i({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,i){if(this.cameraBehaviour.cameraControl instanceof AdjustableCameraControl3D){let a=(new Box3).setFromObject(this._scene).getSize(new Vector3);this.cameraBehaviour.cameraControl.adjust(a,e,t,r,i),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}}__decorate([inject],GLBViewerSceneManager.prototype,"_glbInputManager",void 0),__decorate([inject],GLBViewerSceneManager.prototype,"_rapiAccess",void 0);class GLBRenderWorker{constructor(e,t,r){this._prefix="https://furniture.roomle.com/3d/glb/",this._listeners=new Set,this._finishedItems=0,this._sceneManager=e,this._renderer=new WebGLRenderer({antialias:!0,alpha:!0}),this._width=t,this._height=r,this._renderer.setSize(t,r),this._renderer.setClearColor(16777215,0),this._renderer.outputColorSpace=SRGBColorSpace}addListener(e){this._listeners.add(e)}removeListener(e){this._listeners.delete(e)}start(e){return this._entries=[],e.forEach(e=>{this._entries.push(this._transform(e))}),this._finishedItems=0,this._listeners.forEach(e=>e.onStart(this._entries.length)),this._zip=new window.JSZip,this._doNextEntry(),new Promise(e=>{this._resolve=e})}_transform(e){return{name:e.path.replace(".glb",".png"),url:this._prefix+e.path,position:new Vector3(e.camera.position.x,e.camera.position.z,-e.camera.position.y),fov:2*e.camera.fieldOfView,yaw:e.camera.rotation.z,pitch:e.camera.rotation.x}}_doNextEntry(){0===this._entries.length?(this._listeners.forEach(e=>e.onFinished(this._zip)),this._resolve(this._zip)):this._processEntry(this._entries[0])}_processEntry(e){this._sceneManager.loadGLB(e.url,!1,void 0).then(()=>{this._sceneManager.adjustCamera(e.position,e.yaw,e.pitch,e.fov),this._sceneManager.preparePerspectiveImage(this._renderer,this._width,this._height).then(t=>{this._entryFinished(e,t)})})}_entryFinished(e,t){let r=this._entries.indexOf(e);r>-1&&this._entries.splice(r,1),this._finishedItems++,this._listeners.forEach(e=>e.onElementFinished(this._finishedItems)),this._zip.file(e.name,t.blob),this._doNextEntry()}}class RoomleGLBViewer{constructor(e){this._currentIdOrUrl=null,this._creator_=e}setCameraOffset(e){this._sceneManager.setCameraOffset(e)}getCameraOffset(){return this._sceneManager.getCameraOffset()}init(e,t){return this.setOverrides(t),this._domHelper.setDomElement(e),this._sceneManager?(this._lifeCycleManager.resume(),Promise.resolve()):new Promise(this._initPromiseCallback.bind(this))}_initPromiseCallback(e,t){Promise.all([this._scriptLoader.fetch(TWEEN_FILE_NAME,{id:"tween-js"})]).then(()=>{this._sceneManager=new GLBViewerSceneManager(this._creator_,{left:0,top:1,right:1,bottom:0}),this._sceneManager.enableHD(),e()})}clearScene(){this._sceneManager.clearScene()}loadGLB(e,t=1,r){return this._currentIdOrUrl=e,this._rapiAccess.trackView(e),this._sceneManager.loadGLB(e,!0,new Vector3(t,t,t),r)}loadStaticItem(e,t){return this._currentIdOrUrl=e,this._rapiAccess.trackView(e),this._sceneManager.loadStaticItem(e,t)}getCurrentId(){return this._currentIdOrUrl}loadSceneSetting(e){return this._sceneManager.loadSceneSettings(e)}preparePerspectiveImage(){return this._sceneManager.preparePerspectiveImage()}processRenderList(e,t=320,r=320){let i=JSON.parse(e);this._scriptLoader.fetch("static/jszip.min-c96375d50e72b199.js",{id:"jszip-js"}).then(()=>{let e=new GLBRenderWorker(this._sceneManager,t,r);e.addListener(this._sceneManager),e.start(i.items).then(t=>{t.generateAsync({type:"blob"}).then(t=>{download("content.zip",URL.createObjectURL(t)),e.removeListener(this._sceneManager)})})})}setOverrides(e){e&&(this._initData.setOverrides(e),this._globalInitData.setOverrides(e))}updateSize(){this._sceneManager.updateCamera()}getMain(){}resumeTest(e){this._domHelper.setDomElement(e),this._lifeCycleManager.resume()}pauseTest(){this._lifeCycleManager.pause()}showGUI(){this._sceneManager.showGUI()}get callbacks(){return{}}getScene(){return this._sceneManager.getScene()}updateScene(){this._sceneManager.updateScene()}getUnitFormatter(){return this._unitFormatter}getStorage(){return this._idbManager}setEnvironmentMap(e){const{url:t,intensity:r,rotation:i,maxLightSources:a}=e;this._sceneManager.setEnvironmentMap(t,r,i,a)}}__decorate([inject],RoomleGLBViewer.prototype,"_rapiAccess",void 0),__decorate([inject],RoomleGLBViewer.prototype,"_domHelper",void 0),__decorate([inject],RoomleGLBViewer.prototype,"_scriptLoader",void 0),__decorate([inject],RoomleGLBViewer.prototype,"_lifeCycleManager",void 0),__decorate([inject],RoomleGLBViewer.prototype,"_initData",void 0),__decorate([inject],RoomleGLBViewer.prototype,"_globalInitData",void 0),__decorate([inject],RoomleGLBViewer.prototype,"_unitFormatter",void 0),__decorate([inject],RoomleGLBViewer.prototype,"_idbManager",void 0);class GlbViewer extends Main{setupGlobals(){}setupDependencies(){RoomleDependencyInjection.setup(INJECTABLES),this.lookup("logger",this._context)}cleanUpGlobals(){throw new Error("Method not implemented.")}cleanUpDependencies(){throw new Error("Method not implemented.")}bootFinished(){this._viewer=new RoomleGLBViewer(this._context),window.RoomleGLBViewer||(window.RoomleGLBViewer=this._viewer)}getApi(){return this._viewer}getContextName(){return"glb-viewer"}}export{GlbViewer};
|
|
2
|
-
//# sourceMappingURL=glb-viewer-
|
|
1
|
+
import{S as ScriptLoader,M as Main}from"./script-loader-2b31ae62.js";import{aw as InputManager,D as DependencyInjectionAssignment,L as Logger,R as RapiAccess,a1 as getGUI,_ as __decorate,i as inject,l as CANVAS_ID,p as DynamicLightSettingLoader,q as PREDEFINED_LIGHTSETTING,u as dispose,b as RoomleDependencyInjection}from"./roomle-dependency-injection-d1a1dd5d.js";import{C as CameraControl3D,L as LightSetting,S as SceneManager,T as TWEEN_FILE_NAME}from"./camera-behaviour-0227a3b5.js";import{a as Vector3,ad as Box3,ag as Euler,Q as Quaternion,A as AmbientLight,C as Color,aE as CAMERA_TYPE,aS as getGlbUrl,bz as WebGLRenderer,i as SRGBColorSpace,bn as BasicShadowMap,N as PerspectiveCamera,bN as download}from"./main-thread-to-worker-7a8e1f0e.js";import{D as DefaultLightSetting}from"./default-light-setting-a8f6c936.js";import{G as GlbViewerCameraBehaviour}from"./glb-viewer-camera-behaviour-13fe6037.js";import"./query-params-helper-12ad9c03.js";const INJECTABLES=[new DependencyInjectionAssignment("script-loader",ScriptLoader),new DependencyInjectionAssignment("glb-input-manager",class extends InputManager{},1),new DependencyInjectionAssignment("logger",Logger),new DependencyInjectionAssignment("rapi-access",RapiAccess)];class AdjustableCameraControl3D extends CameraControl3D{constructor(){super(...arguments),this.shouldIgnoreStandardBehavior=!1}adjust(e,t,r,a,i){let n=new Vector3(-e.x/2,0,-e.z/2),s=new Vector3(e.x/2,e.y,e.z/2);this._boundingBox=new Box3(n,s);let o=new Euler(-Math.PI/2+a,r,0,"ZYX"),c=(new Quaternion).setFromEuler(o);this._camera.updateProjectionMatrix(),this._camera.quaternion.copy(c),this._camera.position.copy(t)}_update(e){this.shouldIgnoreStandardBehavior?this._saveYawAndPitch():super._update(e)}animateCamera(e){return!!this.shouldIgnoreStandardBehavior||super.animateCamera(e)}}class GLBViewerLightSetting extends LightSetting{constructor(e,t){super(e,t),this._params={ambientLight:{color:"#ffffff"}},this._ambientLight=new AmbientLight(new Color(this._params.ambientLight.color),.5),this.addToScene()}addToScene(){this._scene.add(this._ambientLight)}removeFromScene(){this._scene.remove(this._ambientLight)}reload(){this.removeFromScene(),this.addToScene()}showGUI(){let e=getGUI();if(e&&this._ambientLight){let t=e.addFolder("Ambient Light");t.add(this._ambientLight,"visible"),t.add(this._ambientLight,"intensity").min(0).max(5).step(.1),t.addColor(this._params.ambientLight,"color").onChange(e=>{this._ambientLight.color=new Color(e)})}}}class GLBViewerSceneManager extends SceneManager{constructor(e,t){super(e,t,CANVAS_ID.GLB,CAMERA_TYPE.CAMERA_3D),this._itemsCount=0,this._standardSceneBackgroundColor=this._scene.background,this._initData.legacyLight&&(this._renderer.capabilities.maxTextures>8?this.loadDynamicLightSetting(DynamicLightSettingLoader.createDynamicLightSettingSource(null,PREDEFINED_LIGHTSETTING.CAMERA)):(console.warn("this device has a maximum of 8 texture units thus we are using a simpler light setting"),this._lightSetting=new GLBViewerLightSetting(this._scene)))}createCameraControl(e,t){this._changeCameraBehaviour(new GlbViewerCameraBehaviour(new AdjustableCameraControl3D(this._creator_,this._getInputManager(),new Vector3(-1,1,1)),this._cameraBehaviourState))}_getInputManager(){return this._glbInputManager}async loadStaticItem(e,t){const r=await this._rapiAccess.getItem(e);if(r.configuration)return Promise.reject();const a=getGlbUrl(r);return a?this.loadGLB(a,!0,void 0,t):Promise.reject(new Error("GLB Url not detected"))}loadGLB(e,t=!0,r=new Vector3(1,1,1),a){return this.clearScene(),new Promise((i,n)=>{this._loadGLB(e,new Vector3(0,0,0),0,void 0,r,void 0,void 0,a).then(e=>{this._currentGLB=e,this._scene.add(this._currentGLB);let r=(new Box3).setFromObject(this._currentGLB);t&&this.cameraBehaviour.cameraControl instanceof AdjustableCameraControl3D&&this.glbViewerCameraBehaviour.updateCameraOnItemLoaded(r),this._updateBounds(r,null,!0),i()},n)})}preparePerspectiveImage(e,t,r){return new Promise(a=>{var i,n;t||(t=1e3),r||(r=1e3),e||((e=new WebGLRenderer({antialias:!0})).setSize(t,r),e.outputColorSpace=SRGBColorSpace,e.autoClear=!1,e.shadowMap.enabled=!0,e.shadowMap.type=BasicShadowMap);let s=this.cameraBehaviour.cameraControl.getCamera().clone();s instanceof PerspectiveCamera&&(s.aspect=t/r,s.updateProjectionMatrix()),null===(i=this._lightSetting)||void 0===i||i.removeFromScene();let o=new DefaultLightSetting(this._scene);e.render(this._scene,s);let c=e.domElement.toDataURL();e.domElement.toBlob(e=>{a({image:c,width:t,height:r,blob:e})},"image/png"),o.removeFromScene(),null===(n=this._lightSetting)||void 0===n||n.addToScene()})}adjustCamera(e,t,r,a){if(this.cameraBehaviour.cameraControl instanceof AdjustableCameraControl3D){let i=(new Box3).setFromObject(this._scene).getSize(new Vector3);this.cameraBehaviour.cameraControl.adjust(i,e,t,r,a),this._requestRender()}}onStart(e){this._itemsCount=e,this._scene.background=null,this.cameraBehaviour.cameraControl instanceof AdjustableCameraControl3D&&(this.cameraBehaviour.cameraControl.shouldIgnoreStandardBehavior=!0)}onElementFinished(e){this._itemsCount,Math.round(100/this._itemsCount*e)}onFinished(e){this._scene.background=this._standardSceneBackgroundColor,this.cameraBehaviour.cameraControl instanceof AdjustableCameraControl3D&&(this.cameraBehaviour.cameraControl.shouldIgnoreStandardBehavior=!1)}clearScene(){this._currentGLB&&(this._scene.remove(this._currentGLB),dispose(this._currentGLB),this._currentGLB=null),super.clearScene()}enableHD(){super.enableHD()}sceneChanged(){}getBounds(){return this._currentGLB?(new Box3).setFromObject(this._currentGLB):null}get glbViewerCameraBehaviour(){return this.cameraBehaviour}getGeometryBounds(){return null}}__decorate([inject],GLBViewerSceneManager.prototype,"_glbInputManager",void 0),__decorate([inject],GLBViewerSceneManager.prototype,"_rapiAccess",void 0);class GLBRenderWorker{constructor(e,t,r){this._prefix="https://furniture.roomle.com/3d/glb/",this._listeners=new Set,this._finishedItems=0,this._sceneManager=e,this._renderer=new WebGLRenderer({antialias:!0,alpha:!0}),this._width=t,this._height=r,this._renderer.setSize(t,r),this._renderer.setClearColor(16777215,0),this._renderer.outputColorSpace=SRGBColorSpace}addListener(e){this._listeners.add(e)}removeListener(e){this._listeners.delete(e)}start(e){return this._entries=[],e.forEach(e=>{this._entries.push(this._transform(e))}),this._finishedItems=0,this._listeners.forEach(e=>e.onStart(this._entries.length)),this._zip=new window.JSZip,this._doNextEntry(),new Promise(e=>{this._resolve=e})}_transform(e){return{name:e.path.replace(".glb",".png"),url:this._prefix+e.path,position:new Vector3(e.camera.position.x,e.camera.position.z,-e.camera.position.y),fov:2*e.camera.fieldOfView,yaw:e.camera.rotation.z,pitch:e.camera.rotation.x}}_doNextEntry(){0===this._entries.length?(this._listeners.forEach(e=>e.onFinished(this._zip)),this._resolve(this._zip)):this._processEntry(this._entries[0])}_processEntry(e){this._sceneManager.loadGLB(e.url,!1,void 0).then(()=>{this._sceneManager.adjustCamera(e.position,e.yaw,e.pitch,e.fov),this._sceneManager.preparePerspectiveImage(this._renderer,this._width,this._height).then(t=>{this._entryFinished(e,t)})})}_entryFinished(e,t){let r=this._entries.indexOf(e);r>-1&&this._entries.splice(r,1),this._finishedItems++,this._listeners.forEach(e=>e.onElementFinished(this._finishedItems)),this._zip.file(e.name,t.blob),this._doNextEntry()}}class RoomleGLBViewer{constructor(e){this._currentIdOrUrl=null,this._creator_=e}setCameraOffset(e){this._sceneManager.setCameraOffset(e)}getCameraOffset(){return this._sceneManager.getCameraOffset()}init(e,t){return this.setOverrides(t),this._domHelper.setDomElement(e),this._sceneManager?(this._lifeCycleManager.resume(),Promise.resolve()):new Promise(this._initPromiseCallback.bind(this))}_initPromiseCallback(e,t){Promise.all([this._scriptLoader.fetch(TWEEN_FILE_NAME,{id:"tween-js"})]).then(()=>{this._sceneManager=new GLBViewerSceneManager(this._creator_,{left:0,top:1,right:1,bottom:0}),this._sceneManager.enableHD(),e()})}clearScene(){this._sceneManager.clearScene()}loadGLB(e,t=1,r){return this._currentIdOrUrl=e,this._rapiAccess.trackView(e),this._sceneManager.loadGLB(e,!0,new Vector3(t,t,t),r)}loadStaticItem(e,t){return this._currentIdOrUrl=e,this._rapiAccess.trackView(e),this._sceneManager.loadStaticItem(e,t)}getCurrentId(){return this._currentIdOrUrl}loadSceneSetting(e){return this._sceneManager.loadSceneSettings(e)}preparePerspectiveImage(){return this._sceneManager.preparePerspectiveImage()}processRenderList(e,t=320,r=320){let a=JSON.parse(e);this._scriptLoader.fetch("static/jszip.min-c96375d50e72b199.js",{id:"jszip-js"}).then(()=>{let e=new GLBRenderWorker(this._sceneManager,t,r);e.addListener(this._sceneManager),e.start(a.items).then(t=>{t.generateAsync({type:"blob"}).then(t=>{download("content.zip",URL.createObjectURL(t)),e.removeListener(this._sceneManager)})})})}setOverrides(e){e&&(this._initData.setOverrides(e),this._globalInitData.setOverrides(e))}updateSize(){this._sceneManager.updateCamera()}getMain(){}resumeTest(e){this._domHelper.setDomElement(e),this._lifeCycleManager.resume()}pauseTest(){this._lifeCycleManager.pause()}showGUI(){this._sceneManager.showGUI()}get callbacks(){return{}}getScene(){return this._sceneManager.getScene()}updateScene(){this._sceneManager.updateScene()}getUnitFormatter(){return this._unitFormatter}getStorage(){return this._idbManager}setEnvironmentMap(e){const{url:t,intensity:r,rotation:a,maxLightSources:i}=e;this._sceneManager.setEnvironmentMap(t,r,a,i)}}__decorate([inject],RoomleGLBViewer.prototype,"_rapiAccess",void 0),__decorate([inject],RoomleGLBViewer.prototype,"_domHelper",void 0),__decorate([inject],RoomleGLBViewer.prototype,"_scriptLoader",void 0),__decorate([inject],RoomleGLBViewer.prototype,"_lifeCycleManager",void 0),__decorate([inject],RoomleGLBViewer.prototype,"_initData",void 0),__decorate([inject],RoomleGLBViewer.prototype,"_globalInitData",void 0),__decorate([inject],RoomleGLBViewer.prototype,"_unitFormatter",void 0),__decorate([inject],RoomleGLBViewer.prototype,"_idbManager",void 0);class GlbViewer extends Main{setupGlobals(){}setupDependencies(){RoomleDependencyInjection.setup(INJECTABLES),this.lookup("logger",this._context)}cleanUpGlobals(){throw new Error("Method not implemented.")}cleanUpDependencies(){throw new Error("Method not implemented.")}bootFinished(){this._viewer=new RoomleGLBViewer(this._context),window.RoomleGLBViewer||(window.RoomleGLBViewer=this._viewer)}getApi(){return this._viewer}getContextName(){return"glb-viewer"}}export{GlbViewer};
|
|
2
|
+
//# sourceMappingURL=glb-viewer-df34fe01.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"glb-viewer-
|
|
1
|
+
{"version":3,"file":"glb-viewer-df34fe01.js","sources":["../../node_modules/jszip/dist/jszip.min.js"],"sourcesContent":["export default \"static/jszip.min-c96375d50e72b199.js\""],"names":[],"mappings":"u7QAAe"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{GlbViewer}from"./glb-viewer-df34fe01.js";import"./script-loader-2b31ae62.js";import"./query-params-helper-12ad9c03.js";import"./main-thread-to-worker-7a8e1f0e.js";import"./roomle-dependency-injection-d1a1dd5d.js";import"./camera-behaviour-0227a3b5.js";import"./default-light-setting-a8f6c936.js";import"./glb-viewer-camera-behaviour-13fe6037.js";(new GlbViewer).boot();
|
|
2
|
+
//# sourceMappingURL=glb-viewer-main-13b5eddb.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"glb-viewer-main-13b5eddb.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
System.register(["./glb-viewer-
|
|
1
|
+
System.register(["./glb-viewer-c2cba24c.nomodule.js","./script-loader-975a3b82.nomodule.js","./query-params-helper-558a4849.nomodule.js","./main-thread-to-worker-097aa61a.nomodule.js","./roomle-dependency-injection-390bf393.nomodule.js","./camera-behaviour-f1b7daa6.nomodule.js","./default-light-setting-97b2c33a.nomodule.js","./glb-viewer-camera-behaviour-bfa12aef.nomodule.js"],(function(){var e;return{setters:[function(n){e=n.GlbViewer},function(){},function(){},function(){},function(){},function(){},function(){},function(){}],execute:function(){(new e).boot()}}}));
|
|
2
2
|
//# sourceMappingURL=glb-viewer-main.nomodule.js.map
|
package/lib/legacy/{banana-for-scale-bd28690c.legacy.js → banana-for-scale-f3a635a8.legacy.js}
RENAMED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
System.register(["./roomle-dependency-injection-
|
|
2
|
-
//# sourceMappingURL=banana-for-scale-
|
|
1
|
+
System.register(["./roomle-dependency-injection-85007579.legacy.js","./main-thread-to-worker-f066567e.legacy.js"],(function(e){var n,t,a,s,i;return{setters:[function(e){n=e.aH,t=e._,a=e.i},function(e){s=e.g,i=e.a}],execute:function(){class c extends n{setScene(e){this._scene=e,this._staticItemLoader.loadGLB(s()+"static/banana_div2-1351c98ec2986be1.glb").then(e=>{this._banana=e.scene,this.updateBounds(null)})}updateBounds(e){if(e&&(this._bounds=e),this._bounds){if(this._banana){const e=this._bounds.getSize(new i),n=this._bounds.getCenter(new i).clone();n.x-=e.x/2+.18,n.z+=e.z/2+.05,n.y=0;let t=.03;this._banana.scale.copy(new i(t,t,t)),this._banana.rotation.y=.6,this._banana.position.copy(n)}this._scene.children.includes(this._banana)||this.addToScene()}}clearScene(e,n){super.clearScene(e,n),this.removeFromScene()}addToScene(){this._scene&&this._banana&&this._scene.add(this._banana)}removeFromScene(){this._scene&&this._banana&&this._scene.remove(this._banana)}}e("default",c),t([a],c.prototype,"_staticItemLoader",void 0)}}}));
|
|
2
|
+
//# sourceMappingURL=banana-for-scale-f3a635a8.legacy.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"banana-for-scale-
|
|
1
|
+
{"version":3,"file":"banana-for-scale-f3a635a8.legacy.js","sources":["../../../packages/configurator-core/public/geometry/banana_div2.glb"],"sourcesContent":["export default \"static/banana_div2-1351c98ec2986be1.glb\""],"names":[],"mappings":"yTAAe"}
|