@roomle/web-sdk 2.80.0-alpha.3 → 2.80.0-alpha.5

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.
Files changed (182) hide show
  1. package/lib/{banana-for-scale-24a6e087.nomodule.js → banana-for-scale-0fdca21d.nomodule.js} +2 -2
  2. package/lib/{banana-for-scale-24a6e087.nomodule.js.map → banana-for-scale-0fdca21d.nomodule.js.map} +1 -1
  3. package/lib/{banana-for-scale-65562f32.js → banana-for-scale-e437ad13.js} +2 -2
  4. package/lib/{banana-for-scale-65562f32.js.map → banana-for-scale-e437ad13.js.map} +1 -1
  5. package/lib/{camera-behaviour-f8fd624d.nomodule.js → camera-behaviour-c774306e.nomodule.js} +2 -2
  6. package/lib/{camera-behaviour-f8fd624d.nomodule.js.map → camera-behaviour-c774306e.nomodule.js.map} +1 -1
  7. package/lib/{camera-behaviour-7aba1045.js → camera-behaviour-ed5b7809.js} +2 -2
  8. package/lib/{camera-behaviour-7aba1045.js.map → camera-behaviour-ed5b7809.js.map} +1 -1
  9. package/lib/{component-dimensioning-3f78471b.js → component-dimensioning-352bf411.js} +2 -2
  10. package/lib/component-dimensioning-352bf411.js.map +1 -0
  11. package/lib/{component-dimensioning-01b50642.nomodule.js → component-dimensioning-7f18668f.nomodule.js} +2 -2
  12. package/lib/component-dimensioning-7f18668f.nomodule.js.map +1 -0
  13. package/lib/{component-raycast-helper-f56673b2.nomodule.js → component-raycast-helper-4e18a996.nomodule.js} +2 -2
  14. package/lib/component-raycast-helper-4e18a996.nomodule.js.map +1 -0
  15. package/lib/{component-raycast-helper-2688213e.js → component-raycast-helper-f3f6b3b5.js} +2 -2
  16. package/lib/component-raycast-helper-f3f6b3b5.js.map +1 -0
  17. package/lib/{configurator-865ca37c.js → configurator-1e9b8723.js} +2 -2
  18. package/lib/configurator-1e9b8723.js.map +1 -0
  19. package/lib/{configurator-45e4da79.nomodule.js → configurator-cd58dd34.nomodule.js} +2 -2
  20. package/lib/configurator-cd58dd34.nomodule.js.map +1 -0
  21. package/lib/configurator-main-db9f179e.js +2 -0
  22. package/lib/configurator-main-db9f179e.js.map +1 -0
  23. package/lib/configurator-main.nomodule.js +1 -1
  24. package/lib/{continuous-drawing-helper-f4b05a9e.js → continuous-drawing-helper-9b8e7c5b.js} +2 -2
  25. package/lib/continuous-drawing-helper-9b8e7c5b.js.map +1 -0
  26. package/lib/{continuous-drawing-helper-2a592de8.nomodule.js → continuous-drawing-helper-9f94fa5b.nomodule.js} +2 -2
  27. package/lib/continuous-drawing-helper-9f94fa5b.nomodule.js.map +1 -0
  28. package/lib/{default-light-setting-1a29c5d9.js → default-light-setting-68bd864c.js} +2 -2
  29. package/lib/default-light-setting-68bd864c.js.map +1 -0
  30. package/lib/{default-light-setting-4b20f995.nomodule.js → default-light-setting-e7e16d7f.nomodule.js} +2 -2
  31. package/lib/default-light-setting-e7e16d7f.nomodule.js.map +1 -0
  32. package/lib/definitions/planner-core/src/roomle-planner.d.ts +20 -0
  33. package/lib/definitions/planner-core/src/webgl/planner-scene-event-handler.d.ts +6 -1
  34. package/lib/definitions/planner-core/src/webgl/planner-scene-manager.d.ts +5 -0
  35. package/lib/definitions/typings/planner.d.ts +3 -1
  36. package/lib/{dimensioning-helper-b0c8123d.js → dimensioning-helper-266213f7.js} +2 -2
  37. package/lib/{dimensioning-helper-b0c8123d.js.map → dimensioning-helper-266213f7.js.map} +1 -1
  38. package/lib/{dimensioning-helper-d38228b8.nomodule.js → dimensioning-helper-6388032f.nomodule.js} +2 -2
  39. package/lib/{dimensioning-helper-d38228b8.nomodule.js.map → dimensioning-helper-6388032f.nomodule.js.map} +1 -1
  40. package/lib/{glb-viewer-2f2f6d1b.nomodule.js → glb-viewer-8529d9c6.nomodule.js} +2 -2
  41. package/lib/{glb-viewer-2f2f6d1b.nomodule.js.map → glb-viewer-8529d9c6.nomodule.js.map} +1 -1
  42. package/lib/glb-viewer-camera-behaviour-6a1ec78f.js +2 -0
  43. package/lib/glb-viewer-camera-behaviour-6a1ec78f.js.map +1 -0
  44. package/lib/{glb-viewer-camera-behaviour-9676fa07.nomodule.js → glb-viewer-camera-behaviour-fc47f13c.nomodule.js} +2 -2
  45. package/lib/glb-viewer-camera-behaviour-fc47f13c.nomodule.js.map +1 -0
  46. package/lib/{glb-viewer-81c29c2c.js → glb-viewer-dbbc0a6c.js} +2 -2
  47. package/lib/{glb-viewer-81c29c2c.js.map → glb-viewer-dbbc0a6c.js.map} +1 -1
  48. package/lib/glb-viewer-main-b13b87de.js +2 -0
  49. package/lib/glb-viewer-main-b13b87de.js.map +1 -0
  50. package/lib/glb-viewer-main.nomodule.js +1 -1
  51. package/lib/legacy/{banana-for-scale-6983319f.legacy.js → banana-for-scale-7138ed5e.legacy.js} +2 -2
  52. package/lib/legacy/{banana-for-scale-6983319f.legacy.js.map → banana-for-scale-7138ed5e.legacy.js.map} +1 -1
  53. package/lib/legacy/{camera-behaviour-ef426a46.legacy.js → camera-behaviour-5797c286.legacy.js} +2 -2
  54. package/lib/legacy/{camera-behaviour-ef426a46.legacy.js.map → camera-behaviour-5797c286.legacy.js.map} +1 -1
  55. package/lib/legacy/{component-dimensioning-9b27ee47.legacy.js → component-dimensioning-7c17c6ee.legacy.js} +2 -2
  56. package/lib/legacy/component-dimensioning-7c17c6ee.legacy.js.map +1 -0
  57. package/lib/legacy/{component-raycast-helper-f4084d11.legacy.js → component-raycast-helper-66529835.legacy.js} +2 -2
  58. package/lib/legacy/component-raycast-helper-66529835.legacy.js.map +1 -0
  59. package/lib/legacy/configurator-c9baeb75.legacy.js +2 -0
  60. package/lib/legacy/configurator-c9baeb75.legacy.js.map +1 -0
  61. package/lib/legacy/configurator-main.legacy.js +1 -1
  62. package/lib/legacy/{continuous-drawing-helper-e5520525.legacy.js → continuous-drawing-helper-f4aac281.legacy.js} +2 -2
  63. package/lib/legacy/continuous-drawing-helper-f4aac281.legacy.js.map +1 -0
  64. package/lib/legacy/{default-light-setting-c2e3a172.legacy.js → default-light-setting-6a177e01.legacy.js} +2 -2
  65. package/lib/legacy/default-light-setting-6a177e01.legacy.js.map +1 -0
  66. package/lib/legacy/{dimensioning-helper-d82ea1b2.legacy.js → dimensioning-helper-0fb567e1.legacy.js} +2 -2
  67. package/lib/legacy/{dimensioning-helper-d82ea1b2.legacy.js.map → dimensioning-helper-0fb567e1.legacy.js.map} +1 -1
  68. package/lib/legacy/{glb-viewer-camera-behaviour-cfc892bc.legacy.js → glb-viewer-camera-behaviour-bc09362a.legacy.js} +2 -2
  69. package/lib/legacy/glb-viewer-camera-behaviour-bc09362a.legacy.js.map +1 -0
  70. package/lib/legacy/{glb-viewer-2171e4db.legacy.js → glb-viewer-df3a666a.legacy.js} +2 -2
  71. package/lib/legacy/{glb-viewer-2171e4db.legacy.js.map → glb-viewer-df3a666a.legacy.js.map} +1 -1
  72. package/lib/legacy/glb-viewer-main.legacy.js +1 -1
  73. package/lib/legacy/{material-viewer-cbcd6421.legacy.js → material-viewer-5ff80fdc.legacy.js} +2 -2
  74. package/lib/legacy/material-viewer-5ff80fdc.legacy.js.map +1 -0
  75. package/lib/legacy/material-viewer-main.legacy.js +1 -1
  76. package/lib/legacy/planner-f5cba46b.legacy.js +2 -0
  77. package/lib/legacy/{planner-2fc85f51.legacy.js.map → planner-f5cba46b.legacy.js.map} +1 -1
  78. package/lib/legacy/planner-main.legacy.js +1 -1
  79. package/lib/legacy/{roomle-configurator-6ab50bfd.legacy.js → roomle-configurator-96ee710c.legacy.js} +2 -2
  80. package/lib/legacy/roomle-configurator-96ee710c.legacy.js.map +1 -0
  81. package/lib/legacy/{roomle-dependency-injection-7ff2d03f.legacy.js → roomle-dependency-injection-7c097ca8.legacy.js} +3 -3
  82. package/lib/legacy/{roomle-dependency-injection-7ff2d03f.legacy.js.map → roomle-dependency-injection-7c097ca8.legacy.js.map} +1 -1
  83. package/lib/legacy/roomle-sdk.legacy.js +1 -1
  84. package/lib/legacy/{script-loader-86b229ef.legacy.js → script-loader-f7b6b84e.legacy.js} +2 -2
  85. package/lib/legacy/script-loader-f7b6b84e.legacy.js.map +1 -0
  86. package/lib/legacy/static/{ConfiguratorKernel-0364d231fcecaafc.wasm → ConfiguratorKernel-84b1112b08d4db09.wasm} +0 -0
  87. package/lib/legacy/static/RoomleCore-67dc43824947a1e2.wasm +0 -0
  88. package/lib/{static/RoomleToolsCore-6c32dd9f8d017af8.wasm → legacy/static/RoomleToolsCore-f086a317a52c6a39.wasm} +0 -0
  89. package/lib/legacy/{stats-helper-28e73e75.legacy.js → stats-helper-81b77300.legacy.js} +2 -2
  90. package/lib/legacy/stats-helper-81b77300.legacy.js.map +1 -0
  91. package/lib/legacy/{tools-core-482a572b.legacy.js → tools-core-c0d4b595.legacy.js} +2 -2
  92. package/lib/legacy/tools-core-c0d4b595.legacy.js.map +1 -0
  93. package/lib/{material-viewer-56b68f41.js → material-viewer-10321a5b.js} +2 -2
  94. package/lib/material-viewer-10321a5b.js.map +1 -0
  95. package/lib/{material-viewer-c225f64e.nomodule.js → material-viewer-90f9f185.nomodule.js} +2 -2
  96. package/lib/material-viewer-90f9f185.nomodule.js.map +1 -0
  97. package/lib/material-viewer-main-f87704e4.js +2 -0
  98. package/lib/material-viewer-main-f87704e4.js.map +1 -0
  99. package/lib/material-viewer-main.nomodule.js +1 -1
  100. package/lib/planner-917e15da.js +2 -0
  101. package/lib/{planner-b4546a3c.js.map → planner-917e15da.js.map} +1 -1
  102. package/lib/planner-a9ba9e17.nomodule.js +2 -0
  103. package/lib/{planner-827f6366.nomodule.js.map → planner-a9ba9e17.nomodule.js.map} +1 -1
  104. package/lib/planner-main-88516caa.js +2 -0
  105. package/lib/planner-main-88516caa.js.map +1 -0
  106. package/lib/planner-main.nomodule.js +1 -1
  107. package/lib/{roomle-configurator-0858b546.nomodule.js → roomle-configurator-2143b898.nomodule.js} +2 -2
  108. package/lib/roomle-configurator-2143b898.nomodule.js.map +1 -0
  109. package/lib/{roomle-configurator-f1595c70.js → roomle-configurator-7932599a.js} +2 -2
  110. package/lib/roomle-configurator-7932599a.js.map +1 -0
  111. package/lib/{roomle-dependency-injection-ac8f942b.js → roomle-dependency-injection-3dc800bf.js} +3 -3
  112. package/lib/{roomle-dependency-injection-ac8f942b.js.map → roomle-dependency-injection-3dc800bf.js.map} +1 -1
  113. package/lib/{roomle-dependency-injection-dcc62c88.nomodule.js → roomle-dependency-injection-6b8fea42.nomodule.js} +3 -3
  114. package/lib/{roomle-dependency-injection-dcc62c88.nomodule.js.map → roomle-dependency-injection-6b8fea42.nomodule.js.map} +1 -1
  115. package/lib/{roomle-sdk-834c30bd.js → roomle-sdk-9feeb30f.js} +2 -2
  116. package/lib/roomle-sdk-9feeb30f.js.map +1 -0
  117. package/lib/roomle-sdk.nomodule.js +1 -1
  118. package/lib/{script-loader-bcf84a9b.nomodule.js → script-loader-2daa44b7.nomodule.js} +2 -2
  119. package/lib/script-loader-2daa44b7.nomodule.js.map +1 -0
  120. package/lib/{script-loader-fccf744e.js → script-loader-5e3c3441.js} +2 -2
  121. package/lib/script-loader-5e3c3441.js.map +1 -0
  122. package/lib/static/{ConfiguratorKernel-0364d231fcecaafc.wasm → ConfiguratorKernel-84b1112b08d4db09.wasm} +0 -0
  123. package/lib/static/RoomleCore-67dc43824947a1e2.wasm +0 -0
  124. package/lib/{legacy/static/RoomleToolsCore-6c32dd9f8d017af8.wasm → static/RoomleToolsCore-f086a317a52c6a39.wasm} +0 -0
  125. package/lib/{stats-helper-7bf2b8e6.js → stats-helper-42a71f0b.js} +2 -2
  126. package/lib/stats-helper-42a71f0b.js.map +1 -0
  127. package/lib/{stats-helper-9b31e52e.nomodule.js → stats-helper-a3644498.nomodule.js} +2 -2
  128. package/lib/stats-helper-a3644498.nomodule.js.map +1 -0
  129. package/lib/{tools-core-e8b51fb2.js → tools-core-33954dcd.js} +2 -2
  130. package/lib/tools-core-33954dcd.js.map +1 -0
  131. package/lib/{tools-core-5daf53b8.nomodule.js → tools-core-c7c46bb9.nomodule.js} +2 -2
  132. package/lib/tools-core-c7c46bb9.nomodule.js.map +1 -0
  133. package/package.json +2 -2
  134. package/lib/component-dimensioning-01b50642.nomodule.js.map +0 -1
  135. package/lib/component-dimensioning-3f78471b.js.map +0 -1
  136. package/lib/component-raycast-helper-2688213e.js.map +0 -1
  137. package/lib/component-raycast-helper-f56673b2.nomodule.js.map +0 -1
  138. package/lib/configurator-45e4da79.nomodule.js.map +0 -1
  139. package/lib/configurator-865ca37c.js.map +0 -1
  140. package/lib/configurator-main-2a5e98fa.js +0 -2
  141. package/lib/configurator-main-2a5e98fa.js.map +0 -1
  142. package/lib/continuous-drawing-helper-2a592de8.nomodule.js.map +0 -1
  143. package/lib/continuous-drawing-helper-f4b05a9e.js.map +0 -1
  144. package/lib/default-light-setting-1a29c5d9.js.map +0 -1
  145. package/lib/default-light-setting-4b20f995.nomodule.js.map +0 -1
  146. package/lib/glb-viewer-camera-behaviour-2b657a16.js +0 -2
  147. package/lib/glb-viewer-camera-behaviour-2b657a16.js.map +0 -1
  148. package/lib/glb-viewer-camera-behaviour-9676fa07.nomodule.js.map +0 -1
  149. package/lib/glb-viewer-main-16ce98b3.js +0 -2
  150. package/lib/glb-viewer-main-16ce98b3.js.map +0 -1
  151. package/lib/legacy/component-dimensioning-9b27ee47.legacy.js.map +0 -1
  152. package/lib/legacy/component-raycast-helper-f4084d11.legacy.js.map +0 -1
  153. package/lib/legacy/configurator-2c4150d4.legacy.js +0 -2
  154. package/lib/legacy/configurator-2c4150d4.legacy.js.map +0 -1
  155. package/lib/legacy/continuous-drawing-helper-e5520525.legacy.js.map +0 -1
  156. package/lib/legacy/default-light-setting-c2e3a172.legacy.js.map +0 -1
  157. package/lib/legacy/glb-viewer-camera-behaviour-cfc892bc.legacy.js.map +0 -1
  158. package/lib/legacy/material-viewer-cbcd6421.legacy.js.map +0 -1
  159. package/lib/legacy/planner-2fc85f51.legacy.js +0 -2
  160. package/lib/legacy/roomle-configurator-6ab50bfd.legacy.js.map +0 -1
  161. package/lib/legacy/script-loader-86b229ef.legacy.js.map +0 -1
  162. package/lib/legacy/static/RoomleCore-40aee224ba8fbae2.wasm +0 -0
  163. package/lib/legacy/stats-helper-28e73e75.legacy.js.map +0 -1
  164. package/lib/legacy/tools-core-482a572b.legacy.js.map +0 -1
  165. package/lib/material-viewer-56b68f41.js.map +0 -1
  166. package/lib/material-viewer-c225f64e.nomodule.js.map +0 -1
  167. package/lib/material-viewer-main-217bc953.js +0 -2
  168. package/lib/material-viewer-main-217bc953.js.map +0 -1
  169. package/lib/planner-827f6366.nomodule.js +0 -2
  170. package/lib/planner-b4546a3c.js +0 -2
  171. package/lib/planner-main-6d2478f2.js +0 -2
  172. package/lib/planner-main-6d2478f2.js.map +0 -1
  173. package/lib/roomle-configurator-0858b546.nomodule.js.map +0 -1
  174. package/lib/roomle-configurator-f1595c70.js.map +0 -1
  175. package/lib/roomle-sdk-834c30bd.js.map +0 -1
  176. package/lib/script-loader-bcf84a9b.nomodule.js.map +0 -1
  177. package/lib/script-loader-fccf744e.js.map +0 -1
  178. package/lib/static/RoomleCore-40aee224ba8fbae2.wasm +0 -0
  179. package/lib/stats-helper-7bf2b8e6.js.map +0 -1
  180. package/lib/stats-helper-9b31e52e.nomodule.js.map +0 -1
  181. package/lib/tools-core-5daf53b8.nomodule.js.map +0 -1
  182. package/lib/tools-core-e8b51fb2.js.map +0 -1
@@ -1,2 +1,2 @@
1
- System.register(["./camera-behaviour-ef426a46.legacy.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-cfc892bc.legacy.js.map
1
+ System.register(["./camera-behaviour-5797c286.legacy.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-bc09362a.legacy.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"glb-viewer-camera-behaviour-bc09362a.legacy.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -1,2 +1,2 @@
1
- System.register(["./script-loader-86b229ef.legacy.js","./roomle-dependency-injection-7ff2d03f.legacy.js","./camera-behaviour-ef426a46.legacy.js","./main-thread-to-worker-6dc921e1.legacy.js","./default-light-setting-c2e3a172.legacy.js","./glb-viewer-camera-behaviour-cfc892bc.legacy.js","./query-params-helper-a47f6cfb.legacy.js"],(function(e){var t,r,i,a,n,s,o,h,c,l,d,u,_,m,g,p,v,w,f,b,C,S,L,y,B,M,I,x,G,j,E,F,O;return{setters:[function(e){t=e.S,r=e.M},function(e){i=e.aH,a=e.D,n=e.L,s=e.R,o=e.ae,h=e._,c=e.i,l=e.u,d=e.x,u=e.y,_=e.H,m=e.b},function(e){g=e.C,p=e.L,v=e.S,w=e.T},function(e){f=e.a,b=e.ak,C=e.ap,S=e.Q,L=e.A,y=e.C,B=e.aN,M=e.a$,I=e.bF,x=e.l,G=e.bv,j=e.Y,E=e.bW},function(e){F=e.D},function(e){O=e.G},function(){}],execute:function(){const D=[new a("script-loader",t),new a("glb-input-manager",class extends i{},1),new a("logger",n),new a("rapi-access",s)];class P extends g{constructor(){super(...arguments),this.shouldIgnoreStandardBehavior=!1}adjust(e,t,r,i,a){let n=new f(-e.x/2,0,-e.z/2),s=new f(e.x/2,e.y,e.z/2);this._boundingBox=new b(n,s);let o=new C(-Math.PI/2+i,r,0,"ZYX"),h=(new S).setFromEuler(o);this._camera.updateProjectionMatrix(),this._camera.quaternion.copy(h),this._camera.position.copy(t)}_update(e){this.shouldIgnoreStandardBehavior?this._saveYawAndPitch():super._update(e)}animateCamera(e){return!!this.shouldIgnoreStandardBehavior||super.animateCamera(e)}}class z extends p{constructor(e,t){super(e,t),this._params={ambientLight:{color:"#ffffff"}},this._ambientLight=new L(new y(this._params.ambientLight.color),.5),this.addToScene()}addToScene(){this._scene.add(this._ambientLight)}removeFromScene(){this._scene.remove(this._ambientLight)}reload(){this.removeFromScene(),this.addToScene()}showGUI(){let e=o();if(e&&this._ambientLight){let t=e.addFolder("Ambient Light");t.add(this._ambientLight,"visible"),t.add(this._ambientLight,"intensity").min(0).max(5).step(.1),t.addColor(this._params.ambientLight,"color").onChange(e=>{this._ambientLight.color=new y(e)})}}}class A extends v{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 O(new P(this._creator_,this._getInputManager(),new f(-1,1,1)),this._cameraBehaviourState))}_getInputManager(){return this._glbInputManager}async loadStaticItem(e,t){const r=await this._rapiAccess.getItem(e);if(r.configuration)return Promise.reject();const i=M(r);return i?this.loadGLB(i,!0,void 0,t):Promise.reject(new Error("GLB Url not detected"))}loadGLB(e,t=!0,r=new f(1,1,1),i){return this.clearScene(),new Promise((a,n)=>{this._loadGLB(e,new f(0,0,0),0,void 0,r,void 0,void 0,i).then(e=>{this._currentGLB=e,this._scene.add(this._currentGLB);let r=(new b).setFromObject(this._currentGLB);t&&this.cameraBehaviour.cameraControl instanceof P&&this.glbViewerCameraBehaviour.updateCameraOnItemLoaded(r),this._updateBounds(r,null,!0),a()},n)})}preparePerspectiveImage(e,t,r){return new Promise(i=>{var a,n;t||(t=1e3),r||(r=1e3),e||((e=new I({antialias:!0})).setSize(t,r),e.outputColorSpace=x,e.autoClear=!1,e.shadowMap.enabled=!0,e.shadowMap.type=G);let s=this.cameraBehaviour.cameraControl.getCamera().clone();s instanceof j&&(s.aspect=t/r,s.updateProjectionMatrix()),null===(a=this._lightSetting)||void 0===a||a.removeFromScene();let o=new F(this._scene);e.render(this._scene,s);let h=e.domElement.toDataURL();e.domElement.toBlob(e=>{i({image:h,width:t,height:r,blob:e})},"image/png"),o.removeFromScene(),null===(n=this._lightSetting)||void 0===n||n.addToScene()})}adjustCamera(e,t,r,i){if(this.cameraBehaviour.cameraControl instanceof P){let a=(new b).setFromObject(this._scene).getSize(new f);this.cameraBehaviour.cameraControl.adjust(a,e,t,r,i),this._requestRender()}}onStart(e){this._itemsCount=e,this._scene.background=null,this.cameraBehaviour.cameraControl instanceof P&&(this.cameraBehaviour.cameraControl.shouldIgnoreStandardBehavior=!0)}onElementFinished(e){this._itemsCount,Math.round(100/this._itemsCount*e)}onFinished(e){this._scene.background=this._standardSceneBackgroundColor,this.cameraBehaviour.cameraControl instanceof P&&(this.cameraBehaviour.cameraControl.shouldIgnoreStandardBehavior=!1)}clearScene(){this._currentGLB&&(this._scene.remove(this._currentGLB),_(this._currentGLB),this._currentGLB=null),super.clearScene()}enableHD(){super.enableHD()}sceneChanged(){}getBounds(){return this._currentGLB?(new b).setFromObject(this._currentGLB):null}get glbViewerCameraBehaviour(){return this.cameraBehaviour}getGeometryBounds(){return null}cameraBehaviourChanged(){super.cameraBehaviourChanged(),this.cameraBehaviour.cameraControl.addEventListener(3,()=>{this._requestRender()},this),this.cameraBehaviour.cameraControl.addEventListener(4,()=>{this._requestRender()},this)}}h([c],A.prototype,"_glbInputManager",void 0),h([c],A.prototype,"_rapiAccess",void 0);class U{constructor(e,t,r){this._prefix="https://furniture.roomle.com/3d/glb/",this._listeners=new Set,this._finishedItems=0,this._sceneManager=e,this._renderer=new I({antialias:!0,alpha:!0}),this._width=t,this._height=r,this._renderer.setSize(t,r),this._renderer.setClearColor(16777215,0),this._renderer.outputColorSpace=x}addListener(e){this._listeners.add(e)}removeListener(e){this._listeners.delete(e)}start(e){return this._entries=[],e.forEach(e=>{this._entries.push(this._transform(e))}),this._finishedItems=0,this._listeners.forEach(e=>e.onStart(this._entries.length)),this._zip=new window.JSZip,this._doNextEntry(),new Promise(e=>{this._resolve=e})}_transform(e){return{name:e.path.replace(".glb",".png"),url:this._prefix+e.path,position:new f(e.camera.position.x,e.camera.position.z,-e.camera.position.y),fov:2*e.camera.fieldOfView,yaw:e.camera.rotation.z,pitch:e.camera.rotation.x}}_doNextEntry(){0===this._entries.length?(this._listeners.forEach(e=>e.onFinished(this._zip)),this._resolve(this._zip)):this._processEntry(this._entries[0])}_processEntry(e){this._sceneManager.loadGLB(e.url,!1,void 0).then(()=>{this._sceneManager.adjustCamera(e.position,e.yaw,e.pitch,e.fov),this._sceneManager.preparePerspectiveImage(this._renderer,this._width,this._height).then(t=>{this._entryFinished(e,t)})})}_entryFinished(e,t){let r=this._entries.indexOf(e);r>-1&&this._entries.splice(r,1),this._finishedItems++,this._listeners.forEach(e=>e.onElementFinished(this._finishedItems)),this._zip.file(e.name,t.blob),this._doNextEntry()}}class 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(w,{id:"tween-js"})]).then(()=>{this._sceneManager=new A(this._creator_,{left:0,top:1,right:1,bottom:0}),this._sceneManager.enableHD(),e()})}clearScene(){this._sceneManager.clearScene()}loadGLB(e,t=1,r){return this._currentIdOrUrl=e,this._rapiAccess.trackView(e),this._sceneManager.loadGLB(e,!0,new f(t,t,t),r)}loadStaticItem(e,t){return this._currentIdOrUrl=e,this._rapiAccess.trackView(e),this._sceneManager.loadStaticItem(e,t)}getCurrentId(){return this._currentIdOrUrl}loadSceneSetting(e){return this._sceneManager.loadSceneSettings(e)}preparePerspectiveImage(){return this._sceneManager.preparePerspectiveImage()}processRenderList(e,t=320,r=320){let i=JSON.parse(e);this._scriptLoader.fetch("static/jszip.min-c96375d50e72b199.js",{id:"jszip-js"}).then(()=>{let e=new U(this._sceneManager,t,r);e.addListener(this._sceneManager),e.start(i.items).then(t=>{t.generateAsync({type:"blob"}).then(t=>{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:a}=e;this._sceneManager.setEnvironmentMap(t,r,i,a)}}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(){m.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-2171e4db.legacy.js.map
1
+ System.register(["./script-loader-f7b6b84e.legacy.js","./roomle-dependency-injection-7c097ca8.legacy.js","./camera-behaviour-5797c286.legacy.js","./main-thread-to-worker-6dc921e1.legacy.js","./default-light-setting-6a177e01.legacy.js","./glb-viewer-camera-behaviour-bc09362a.legacy.js","./query-params-helper-a47f6cfb.legacy.js"],(function(e){var t,r,i,a,n,s,o,h,c,l,d,u,_,m,g,p,v,w,b,f,C,S,L,y,B,M,I,x,G,j,E,F,O;return{setters:[function(e){t=e.S,r=e.M},function(e){i=e.aI,a=e.D,n=e.L,s=e.R,o=e.ae,h=e._,c=e.i,l=e.u,d=e.x,u=e.y,_=e.H,m=e.b},function(e){g=e.C,p=e.L,v=e.S,w=e.T},function(e){b=e.a,f=e.ak,C=e.ap,S=e.Q,L=e.A,y=e.C,B=e.aN,M=e.a$,I=e.bF,x=e.l,G=e.bv,j=e.Y,E=e.bW},function(e){F=e.D},function(e){O=e.G},function(){}],execute:function(){const D=[new a("script-loader",t),new a("glb-input-manager",class extends i{},1),new a("logger",n),new a("rapi-access",s)];class P extends g{constructor(){super(...arguments),this.shouldIgnoreStandardBehavior=!1}adjust(e,t,r,i,a){let n=new b(-e.x/2,0,-e.z/2),s=new b(e.x/2,e.y,e.z/2);this._boundingBox=new f(n,s);let o=new C(-Math.PI/2+i,r,0,"ZYX"),h=(new S).setFromEuler(o);this._camera.updateProjectionMatrix(),this._camera.quaternion.copy(h),this._camera.position.copy(t)}_update(e){this.shouldIgnoreStandardBehavior?this._saveYawAndPitch():super._update(e)}animateCamera(e){return!!this.shouldIgnoreStandardBehavior||super.animateCamera(e)}}class z extends p{constructor(e,t){super(e,t),this._params={ambientLight:{color:"#ffffff"}},this._ambientLight=new L(new y(this._params.ambientLight.color),.5),this.addToScene()}addToScene(){this._scene.add(this._ambientLight)}removeFromScene(){this._scene.remove(this._ambientLight)}reload(){this.removeFromScene(),this.addToScene()}showGUI(){let e=o();if(e&&this._ambientLight){let t=e.addFolder("Ambient Light");t.add(this._ambientLight,"visible"),t.add(this._ambientLight,"intensity").min(0).max(5).step(.1),t.addColor(this._params.ambientLight,"color").onChange(e=>{this._ambientLight.color=new y(e)})}}}class A extends v{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 O(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=M(r);return i?this.loadGLB(i,!0,void 0,t):Promise.reject(new Error("GLB Url not detected"))}loadGLB(e,t=!0,r=new b(1,1,1),i){return this.clearScene(),new Promise((a,n)=>{this._loadGLB(e,new b(0,0,0),0,void 0,r,void 0,void 0,i).then(e=>{this._currentGLB=e,this._scene.add(this._currentGLB);let r=(new f).setFromObject(this._currentGLB);t&&this.cameraBehaviour.cameraControl instanceof P&&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 I({antialias:!0})).setSize(t,r),e.outputColorSpace=x,e.autoClear=!1,e.shadowMap.enabled=!0,e.shadowMap.type=G);let s=this.cameraBehaviour.cameraControl.getCamera().clone();s instanceof j&&(s.aspect=t/r,s.updateProjectionMatrix()),null===(a=this._lightSetting)||void 0===a||a.removeFromScene();let o=new F(this._scene);e.render(this._scene,s);let h=e.domElement.toDataURL();e.domElement.toBlob(e=>{i({image:h,width:t,height:r,blob:e})},"image/png"),o.removeFromScene(),null===(n=this._lightSetting)||void 0===n||n.addToScene()})}adjustCamera(e,t,r,i){if(this.cameraBehaviour.cameraControl instanceof P){let a=(new f).setFromObject(this._scene).getSize(new b);this.cameraBehaviour.cameraControl.adjust(a,e,t,r,i),this._requestRender()}}onStart(e){this._itemsCount=e,this._scene.background=null,this.cameraBehaviour.cameraControl instanceof P&&(this.cameraBehaviour.cameraControl.shouldIgnoreStandardBehavior=!0)}onElementFinished(e){this._itemsCount,Math.round(100/this._itemsCount*e)}onFinished(e){this._scene.background=this._standardSceneBackgroundColor,this.cameraBehaviour.cameraControl instanceof P&&(this.cameraBehaviour.cameraControl.shouldIgnoreStandardBehavior=!1)}clearScene(){this._currentGLB&&(this._scene.remove(this._currentGLB),_(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}cameraBehaviourChanged(){super.cameraBehaviourChanged(),this.cameraBehaviour.cameraControl.addEventListener(3,()=>{this._requestRender()},this),this.cameraBehaviour.cameraControl.addEventListener(4,()=>{this._requestRender()},this)}}h([c],A.prototype,"_glbInputManager",void 0),h([c],A.prototype,"_rapiAccess",void 0);class U{constructor(e,t,r){this._prefix="https://furniture.roomle.com/3d/glb/",this._listeners=new Set,this._finishedItems=0,this._sceneManager=e,this._renderer=new I({antialias:!0,alpha:!0}),this._width=t,this._height=r,this._renderer.setSize(t,r),this._renderer.setClearColor(16777215,0),this._renderer.outputColorSpace=x}addListener(e){this._listeners.add(e)}removeListener(e){this._listeners.delete(e)}start(e){return this._entries=[],e.forEach(e=>{this._entries.push(this._transform(e))}),this._finishedItems=0,this._listeners.forEach(e=>e.onStart(this._entries.length)),this._zip=new window.JSZip,this._doNextEntry(),new Promise(e=>{this._resolve=e})}_transform(e){return{name:e.path.replace(".glb",".png"),url:this._prefix+e.path,position:new 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(w,{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:a}=e;this._sceneManager.setEnvironmentMap(t,r,i,a)}}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(){m.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-df3a666a.legacy.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"glb-viewer-2171e4db.legacy.js","sources":["../../../node_modules/jszip/dist/jszip.min.js"],"sourcesContent":["export default \"static/jszip.min-c96375d50e72b199.js\""],"names":[],"mappings":"2pPAAe"}
1
+ {"version":3,"file":"glb-viewer-df3a666a.legacy.js","sources":["../../../node_modules/jszip/dist/jszip.min.js"],"sourcesContent":["export default \"static/jszip.min-c96375d50e72b199.js\""],"names":[],"mappings":"2pPAAe"}
@@ -1,2 +1,2 @@
1
- System.register(["./glb-viewer-2171e4db.legacy.js","./script-loader-86b229ef.legacy.js","./query-params-helper-a47f6cfb.legacy.js","./main-thread-to-worker-6dc921e1.legacy.js","./roomle-dependency-injection-7ff2d03f.legacy.js","./camera-behaviour-ef426a46.legacy.js","./default-light-setting-c2e3a172.legacy.js","./glb-viewer-camera-behaviour-cfc892bc.legacy.js"],(function(){var e;return{setters:[function(c){e=c.GlbViewer},function(){},function(){},function(){},function(){},function(){},function(){},function(){}],execute:function(){(new e).boot()}}}));
1
+ System.register(["./glb-viewer-df3a666a.legacy.js","./script-loader-f7b6b84e.legacy.js","./query-params-helper-a47f6cfb.legacy.js","./main-thread-to-worker-6dc921e1.legacy.js","./roomle-dependency-injection-7c097ca8.legacy.js","./camera-behaviour-5797c286.legacy.js","./default-light-setting-6a177e01.legacy.js","./glb-viewer-camera-behaviour-bc09362a.legacy.js"],(function(){var e;return{setters:[function(c){e=c.GlbViewer},function(){},function(){},function(){},function(){},function(){},function(){},function(){}],execute:function(){(new e).boot()}}}));
2
2
  //# sourceMappingURL=glb-viewer-main.legacy.js.map
@@ -1,2 +1,2 @@
1
- System.register(["./script-loader-86b229ef.legacy.js","./roomle-dependency-injection-7ff2d03f.legacy.js","./camera-behaviour-ef426a46.legacy.js","./main-thread-to-worker-6dc921e1.legacy.js","./query-params-helper-a47f6cfb.legacy.js"],(function(e){var t,a,i,r,s,n,h,o,l,_,m,c,d,g,u,p,M,y,w,C,f,v,b,S,x,P,F,G,I,U,R,T,A,k,B,D,E;return{setters:[function(e){t=e.S,a=e.M},function(e){i=e._,r=e.i,s=e.u,n=e.x,h=e.y,o=e.a5,l=e.aJ,_=e.aK,m=e.ae,c=e.aL,d=e.ad,g=e.aM,u=e.D,p=e.L,M=e.aH,y=e.aN,w=e.R,C=e.b},function(e){f=e.b,v=e.S,b=e.B,S=e.C,x=e.F,P=e.T},function(e){F=e.aN,G=e.aZ,I=e.J,U=e.C,R=e.ak,T=e.E,A=e.a,k=e.ac,B=e.b0,D=e.bi,E=e.ag},function(){}],execute:function(){class V extends f{get cameraControl(){return this._cameraControl}}class j extends v{constructor(e,t){super(e,t,s.RMV,F.CAMERA_3D),this._sceneParams={type:"cube"},this._materialParams={color:"#ffffff",metallic:.5,alpha:0,alphaCutoff:0,doubleSided:!1},this._renderer.capabilities.maxTextures>8&&this.loadDynamicLightSetting(n.createDynamicLightSettingSource(null,h.CAMERA)),this._initScene()}_initScene(){const e=new G(1,1,1,100,100,100),t=o.createMeshPhysicalMaterial({color:this._initData.colors.PRIMARY});this._setMaterial(t),this._mesh=new I(e,this._material),this._mesh.castShadow=!0,this._mesh.position.setY(.5),this._scene.add(this._mesh);const{initialFloorMaterial:a}=this._initData;if(a?this.changeFloorMaterialById(a):this._environment=new b(this._scene,null,new U(16777215)),this.cameraBehaviour.cameraControl instanceof S){const e=new R;e.setFromObject(this._mesh),console.trace("reset camera"),this.cameraBehaviour.cameraControl.updateAndReset(e)}this.showGUI()}loadMaterialId(e){return new Promise(t=>{this._configuratorMeshGenerator.loadMaterial(e,1e3,1e3).then(e=>{this._setMaterial(e),this._mesh.material=this._material,this._updateGUI(),this._requestRender(),t()})})}loadMaterial(e){return new Promise(t=>{e.__rapi_path__||(e.__rapi_path__="materials"),this._mesh.material=this._material,this._configuratorMeshGenerator.loadTextures(e,this._material,100,100).then(()=>{this._updateGUI(),this._requestRender()}),t()})}loadMaterialShading(e){return new Promise(t=>{let a={shading:e};this._setMaterial(l(this._material,a)),this._mesh.material=this._material,this._updateGUI(),this._requestRender(),t()})}resetMaterial(){this._initScene()}_setMaterial(e){this._material=e,this._materialParams.alpha=e.opacity,this._materialParams.alphaCutoff=e.alphaTest,this._materialParams.color="#"+e.color.getHexString(),this._materialParams.doubleSided=e.side===T,this._materialParams.metallic=1===e.metalness?1:e.reflectivity}getMaterialShading(e=1){return _(this._material,e)}createCameraControl(e,t){this._changeCameraBehaviour(new V(new S(this._creator_,this._getInputManager(),new A(-1,1,1)),this._cameraBehaviourState))}_getInputManager(){return this._inputManager}sceneChanged(){}getBounds(){return this._mesh?(new R).setFromObject(this._mesh):null}getGeometryBounds(){return null}_guiLoaded(){this._updateGUI()}_updateGUI(){let e=m();e&&(this._guiGeometryFolder||(this._guiGeometryFolder=e.addFolder("Geometry"),this._guiGeometryFolder.add(this._sceneParams,"type",{Cube:"cube",Sphere:"sphere",PlaneVertical:"plane_vertical",PlaneHorizontal:"plane_horizontal"}).onChange(e=>{this._setGeometry()})),this._material&&(this._guiMaterialFolder&&e.removeFolder(this._guiMaterialFolder),this._guiMaterialFolder=e.addFolder("Material"),this._guiMaterialFolder.addColor(this._materialParams,"color").onChange(e=>{this._material.color=new U(e),this._shadingChanged()}),this._guiMaterialFolder.add(this._materialParams,"metallic").min(0).max(1).step(.01).onChange(e=>{this._material.metalness=1===e?1:.5,this._material.reflectivity=e||.5,this._shadingChanged()}),this._guiMaterialFolder.add(this._material,"roughness").min(0).max(1).step(.01).onChange(e=>{this._shadingChanged()}),this._guiMaterialFolder.add(this._material,"transmission").min(0).max(1).step(.01).onChange(e=>{this._material.transmission=e,e>0&&(this._material.opacity=1,this._material.alphaTest=.5,this._material.depthWrite=!1,this._material.transparent=!0,this._material.metalness=0),this._mesh.castShadow=!this._material.transparent,this._shadingChanged()}),this._guiMaterialFolder.add(this._materialParams,"alpha").min(0).max(1).step(.01).onChange(e=>{this._material.transparent=e<1,this._material.opacity=e,this._material.depthWrite=e>=1,this._mesh.castShadow=!this._material.transparent,this._shadingChanged()}),this._guiMaterialFolder.add(this._materialParams,"alphaCutoff").min(0).max(1).step(.01).onChange(e=>{this._material.alphaTest=e||0,this._shadingChanged()}),this._guiMaterialFolder.add(this._materialParams,"doubleSided").onChange(e=>{this._material.side=e?T:k,this._shadingChanged()})),this._addGUIListener(e))}_shadingChanged(){this._roomleMaterialViewerUiCallback.onMaterialShadingChanged(_(this._material))}setGeometry(e){this._sceneParams.type=e,this._setGeometry()}_setGeometry(){let e;"cube"===this._sceneParams.type&&(e=new G(1,1,1,100,100,100)),"sphere"===this._sceneParams.type&&(e=new B(.5,100,100)),"plane_horizontal"===this._sceneParams.type&&(e=new D(1,1),e.rotateX(-Math.PI/2)),"plane_vertical"===this._sceneParams.type&&(e=new D(1,1)),this._mesh.geometry=e,this._renderEverything()}async changeFloorMaterialById(e){const t=await this._rapiAccess.getMaterial(e);return this._environment&&this._environment instanceof x||(this._environment=new x(this._scene,this._environment,!0)),new Promise((e,a)=>{this._environment.changeFloorMaterial(t,this._maxAnisotropy).then(()=>{this._requestRender(),e()},a)})}async addTexture(e,t){const a=100/(0===e.mmWidth?1:e.mmWidth),i=100/(0===e.mmHeight?1:e.mmHeight);if(t){const r=new Image;r.src=t;const s=new E;s.image=r,r.onload=function(){s.needsUpdate=!0},c(s,e,this._material,this._maxAnisotropy,a,i,this._renderer.capabilities.maxTextures)}else await d(e.image,e,this._material,this._maxAnisotropy,a,i,this._renderer.capabilities.maxTextures);this._requestRender()}removeTexture(e){"ORM"===e.mapping&&(this._material.aoMap=null,this._material.roughnessMap=null,this._material.metalnessMap=null),"RGB"!==e.mapping&&"RGBA"!==e.mapping||(this._material.map=null),"XYZ"===e.mapping&&(this._material.normalMap=null),this._material.needsUpdate=!0,this._requestRender()}clearCache(){this._configuratorMeshGenerator.clear()}}i([r],j.prototype,"_inputManager",void 0),i([r],j.prototype,"_configuratorMeshGenerator",void 0),i([r],j.prototype,"_roomleMaterialViewerUiCallback",void 0),i([r],j.prototype,"_rapiAccess",void 0);class H{constructor(e){this._creator_=e}setCameraOffset(e){this._sceneManager.setCameraOffset(e)}getCameraOffset(){return this._sceneManager.getCameraOffset()}init(e){return this._domHelper.setDomElement(e),this._sceneManager?(this._lifeCycleManager.resume(),Promise.resolve()):new Promise(this._initPromiseCallback.bind(this))}_initPromiseCallback(e,t){Promise.all([this._scriptLoader.fetch(P,{id:"tween-js"})]).then(()=>{this._sceneManager=new j(this._creator_,{left:0,top:1,right:1,bottom:0}),this._sceneManager.enableHD(),e()})}get callbacks(){return this._roomleMaterialViewerUiCallback}set callbacks(e){this._roomleMaterialViewerUiCallback=e}loadMaterialShading(e){return this._sceneManager.loadMaterialShading(e)}resetMaterial(){this._sceneManager.resetMaterial()}loadMaterial(e,t={}){return t.flushCache&&this._clearCaches(),this._sceneManager.loadMaterial(e)}loadMaterialId(e,t={}){return t.flushCache&&this._clearCaches(),this._sceneManager.loadMaterialId(e)}getMaterialShading(e=1){return this._sceneManager.getMaterialShading(e)}loadSceneSetting(e){return this._sceneManager.loadSceneSettings(e)}setOverrides(e){e&&this._initData.setOverrides(e)}updateSize(){this._sceneManager.updateCamera()}getMain(){}resumeTest(e){this._domHelper.setDomElement(e),this._lifeCycleManager.resume()}pauseTest(){this._lifeCycleManager.pause()}showGUI(){this._sceneManager.showGUI()}async changeFloorMaterialById(e){return this._sceneManager.changeFloorMaterialById(e)}setGeometry(e){this._sceneManager.setGeometry(e)}async addTexture(e,t){return this._sceneManager.addTexture(e,t)}removeTexture(e){return this._sceneManager.removeTexture(e)}_clearCaches(){this._rapiAccess.cleanUp(),this._sceneManager.clearCache()}getScene(){return this._sceneManager.getScene()}updateScene(){this._sceneManager.updateScene()}getUnitFormatter(){return this._unitFormatter}getStorage(){return this._idbManager}setEnvironmentMap(e){const{url:t,intensity:a,rotation:i,maxLightSources:r}=e;this._sceneManager.setEnvironmentMap(t,a,i,r)}}i([r],H.prototype,"_domHelper",void 0),i([r],H.prototype,"_scriptLoader",void 0),i([r],H.prototype,"_lifeCycleManager",void 0),i([r],H.prototype,"_roomleMaterialViewerUiCallback",void 0),i([r],H.prototype,"_initData",void 0),i([r],H.prototype,"_rapiAccess",void 0),i([r],H.prototype,"_unitFormatter",void 0),i([r],H.prototype,"_idbManager",void 0);const L=[new u("script-loader",t),new u("logger",p),new u("input-manager",M,1),new u("configurator-mesh-generator",y),new u("rapi-access",w),new u("roomle-material-viewer-ui-callback",class extends g{constructor(e){super(e),this.onMaterialShadingChanged=e=>{}}},1)];e("MaterialViewer",class extends a{setupGlobals(){}setupDependencies(){C.setup(L),this.lookup("logger",this._context)}cleanUpGlobals(){throw new Error("Method not implemented.")}cleanUpDependencies(){throw new Error("Method not implemented.")}bootFinished(){this._viewer=new H(this._context),window.RoomleMaterialViewer||(window.RoomleMaterialViewer=this._viewer)}getApi(){return this._viewer}getContextName(){return"material-viewer"}})}}}));
2
- //# sourceMappingURL=material-viewer-cbcd6421.legacy.js.map
1
+ System.register(["./script-loader-f7b6b84e.legacy.js","./roomle-dependency-injection-7c097ca8.legacy.js","./camera-behaviour-5797c286.legacy.js","./main-thread-to-worker-6dc921e1.legacy.js","./query-params-helper-a47f6cfb.legacy.js"],(function(e){var t,a,i,r,s,n,h,o,l,_,m,c,d,g,u,p,M,y,w,C,f,v,b,S,x,P,F,G,I,U,R,T,A,k,B,D,E;return{setters:[function(e){t=e.S,a=e.M},function(e){i=e._,r=e.i,s=e.u,n=e.x,h=e.y,o=e.a5,l=e.aK,_=e.aL,m=e.ae,c=e.aM,d=e.ad,g=e.aN,u=e.D,p=e.L,M=e.aI,y=e.aO,w=e.R,C=e.b},function(e){f=e.b,v=e.S,b=e.B,S=e.C,x=e.F,P=e.T},function(e){F=e.aN,G=e.aZ,I=e.J,U=e.C,R=e.ak,T=e.E,A=e.a,k=e.ac,B=e.b0,D=e.bi,E=e.ag},function(){}],execute:function(){class O extends f{get cameraControl(){return this._cameraControl}}class V extends v{constructor(e,t){super(e,t,s.RMV,F.CAMERA_3D),this._sceneParams={type:"cube"},this._materialParams={color:"#ffffff",metallic:.5,alpha:0,alphaCutoff:0,doubleSided:!1},this._renderer.capabilities.maxTextures>8&&this.loadDynamicLightSetting(n.createDynamicLightSettingSource(null,h.CAMERA)),this._initScene()}_initScene(){const e=new G(1,1,1,100,100,100),t=o.createMeshPhysicalMaterial({color:this._initData.colors.PRIMARY});this._setMaterial(t),this._mesh=new I(e,this._material),this._mesh.castShadow=!0,this._mesh.position.setY(.5),this._scene.add(this._mesh);const{initialFloorMaterial:a}=this._initData;if(a?this.changeFloorMaterialById(a):this._environment=new b(this._scene,null,new U(16777215)),this.cameraBehaviour.cameraControl instanceof S){const e=new R;e.setFromObject(this._mesh),console.trace("reset camera"),this.cameraBehaviour.cameraControl.updateAndReset(e)}this.showGUI()}loadMaterialId(e){return new Promise(t=>{this._configuratorMeshGenerator.loadMaterial(e,1e3,1e3).then(e=>{this._setMaterial(e),this._mesh.material=this._material,this._updateGUI(),this._requestRender(),t()})})}loadMaterial(e){return new Promise(t=>{e.__rapi_path__||(e.__rapi_path__="materials"),this._mesh.material=this._material,this._configuratorMeshGenerator.loadTextures(e,this._material,100,100).then(()=>{this._updateGUI(),this._requestRender()}),t()})}loadMaterialShading(e){return new Promise(t=>{let a={shading:e};this._setMaterial(l(this._material,a)),this._mesh.material=this._material,this._updateGUI(),this._requestRender(),t()})}resetMaterial(){this._initScene()}_setMaterial(e){this._material=e,this._materialParams.alpha=e.opacity,this._materialParams.alphaCutoff=e.alphaTest,this._materialParams.color="#"+e.color.getHexString(),this._materialParams.doubleSided=e.side===T,this._materialParams.metallic=1===e.metalness?1:e.reflectivity}getMaterialShading(e=1){return _(this._material,e)}createCameraControl(e,t){this._changeCameraBehaviour(new O(new S(this._creator_,this._getInputManager(),new A(-1,1,1)),this._cameraBehaviourState))}_getInputManager(){return this._inputManager}sceneChanged(){}getBounds(){return this._mesh?(new R).setFromObject(this._mesh):null}getGeometryBounds(){return null}_guiLoaded(){this._updateGUI()}_updateGUI(){let e=m();e&&(this._guiGeometryFolder||(this._guiGeometryFolder=e.addFolder("Geometry"),this._guiGeometryFolder.add(this._sceneParams,"type",{Cube:"cube",Sphere:"sphere",PlaneVertical:"plane_vertical",PlaneHorizontal:"plane_horizontal"}).onChange(e=>{this._setGeometry()})),this._material&&(this._guiMaterialFolder&&e.removeFolder(this._guiMaterialFolder),this._guiMaterialFolder=e.addFolder("Material"),this._guiMaterialFolder.addColor(this._materialParams,"color").onChange(e=>{this._material.color=new U(e),this._shadingChanged()}),this._guiMaterialFolder.add(this._materialParams,"metallic").min(0).max(1).step(.01).onChange(e=>{this._material.metalness=1===e?1:.5,this._material.reflectivity=e||.5,this._shadingChanged()}),this._guiMaterialFolder.add(this._material,"roughness").min(0).max(1).step(.01).onChange(e=>{this._shadingChanged()}),this._guiMaterialFolder.add(this._material,"transmission").min(0).max(1).step(.01).onChange(e=>{this._material.transmission=e,e>0&&(this._material.opacity=1,this._material.alphaTest=.5,this._material.depthWrite=!1,this._material.transparent=!0,this._material.metalness=0),this._mesh.castShadow=!this._material.transparent,this._shadingChanged()}),this._guiMaterialFolder.add(this._materialParams,"alpha").min(0).max(1).step(.01).onChange(e=>{this._material.transparent=e<1,this._material.opacity=e,this._material.depthWrite=e>=1,this._mesh.castShadow=!this._material.transparent,this._shadingChanged()}),this._guiMaterialFolder.add(this._materialParams,"alphaCutoff").min(0).max(1).step(.01).onChange(e=>{this._material.alphaTest=e||0,this._shadingChanged()}),this._guiMaterialFolder.add(this._materialParams,"doubleSided").onChange(e=>{this._material.side=e?T:k,this._shadingChanged()})),this._addGUIListener(e))}_shadingChanged(){this._roomleMaterialViewerUiCallback.onMaterialShadingChanged(_(this._material))}setGeometry(e){this._sceneParams.type=e,this._setGeometry()}_setGeometry(){let e;"cube"===this._sceneParams.type&&(e=new G(1,1,1,100,100,100)),"sphere"===this._sceneParams.type&&(e=new B(.5,100,100)),"plane_horizontal"===this._sceneParams.type&&(e=new D(1,1),e.rotateX(-Math.PI/2)),"plane_vertical"===this._sceneParams.type&&(e=new D(1,1)),this._mesh.geometry=e,this._renderEverything()}async changeFloorMaterialById(e){const t=await this._rapiAccess.getMaterial(e);return this._environment&&this._environment instanceof x||(this._environment=new x(this._scene,this._environment,!0)),new Promise((e,a)=>{this._environment.changeFloorMaterial(t,this._maxAnisotropy).then(()=>{this._requestRender(),e()},a)})}async addTexture(e,t){const a=100/(0===e.mmWidth?1:e.mmWidth),i=100/(0===e.mmHeight?1:e.mmHeight);if(t){const r=new Image;r.src=t;const s=new E;s.image=r,r.onload=function(){s.needsUpdate=!0},c(s,e,this._material,this._maxAnisotropy,a,i,this._renderer.capabilities.maxTextures)}else await d(e.image,e,this._material,this._maxAnisotropy,a,i,this._renderer.capabilities.maxTextures);this._requestRender()}removeTexture(e){"ORM"===e.mapping&&(this._material.aoMap=null,this._material.roughnessMap=null,this._material.metalnessMap=null),"RGB"!==e.mapping&&"RGBA"!==e.mapping||(this._material.map=null),"XYZ"===e.mapping&&(this._material.normalMap=null),this._material.needsUpdate=!0,this._requestRender()}clearCache(){this._configuratorMeshGenerator.clear()}}i([r],V.prototype,"_inputManager",void 0),i([r],V.prototype,"_configuratorMeshGenerator",void 0),i([r],V.prototype,"_roomleMaterialViewerUiCallback",void 0),i([r],V.prototype,"_rapiAccess",void 0);class j{constructor(e){this._creator_=e}setCameraOffset(e){this._sceneManager.setCameraOffset(e)}getCameraOffset(){return this._sceneManager.getCameraOffset()}init(e){return this._domHelper.setDomElement(e),this._sceneManager?(this._lifeCycleManager.resume(),Promise.resolve()):new Promise(this._initPromiseCallback.bind(this))}_initPromiseCallback(e,t){Promise.all([this._scriptLoader.fetch(P,{id:"tween-js"})]).then(()=>{this._sceneManager=new V(this._creator_,{left:0,top:1,right:1,bottom:0}),this._sceneManager.enableHD(),e()})}get callbacks(){return this._roomleMaterialViewerUiCallback}set callbacks(e){this._roomleMaterialViewerUiCallback=e}loadMaterialShading(e){return this._sceneManager.loadMaterialShading(e)}resetMaterial(){this._sceneManager.resetMaterial()}loadMaterial(e,t={}){return t.flushCache&&this._clearCaches(),this._sceneManager.loadMaterial(e)}loadMaterialId(e,t={}){return t.flushCache&&this._clearCaches(),this._sceneManager.loadMaterialId(e)}getMaterialShading(e=1){return this._sceneManager.getMaterialShading(e)}loadSceneSetting(e){return this._sceneManager.loadSceneSettings(e)}setOverrides(e){e&&this._initData.setOverrides(e)}updateSize(){this._sceneManager.updateCamera()}getMain(){}resumeTest(e){this._domHelper.setDomElement(e),this._lifeCycleManager.resume()}pauseTest(){this._lifeCycleManager.pause()}showGUI(){this._sceneManager.showGUI()}async changeFloorMaterialById(e){return this._sceneManager.changeFloorMaterialById(e)}setGeometry(e){this._sceneManager.setGeometry(e)}async addTexture(e,t){return this._sceneManager.addTexture(e,t)}removeTexture(e){return this._sceneManager.removeTexture(e)}_clearCaches(){this._rapiAccess.cleanUp(),this._sceneManager.clearCache()}getScene(){return this._sceneManager.getScene()}updateScene(){this._sceneManager.updateScene()}getUnitFormatter(){return this._unitFormatter}getStorage(){return this._idbManager}setEnvironmentMap(e){const{url:t,intensity:a,rotation:i,maxLightSources:r}=e;this._sceneManager.setEnvironmentMap(t,a,i,r)}}i([r],j.prototype,"_domHelper",void 0),i([r],j.prototype,"_scriptLoader",void 0),i([r],j.prototype,"_lifeCycleManager",void 0),i([r],j.prototype,"_roomleMaterialViewerUiCallback",void 0),i([r],j.prototype,"_initData",void 0),i([r],j.prototype,"_rapiAccess",void 0),i([r],j.prototype,"_unitFormatter",void 0),i([r],j.prototype,"_idbManager",void 0);const L=[new u("script-loader",t),new u("logger",p),new u("input-manager",M,1),new u("configurator-mesh-generator",y),new u("rapi-access",w),new u("roomle-material-viewer-ui-callback",class extends g{constructor(e){super(e),this.onMaterialShadingChanged=e=>{}}},1)];e("MaterialViewer",class extends a{setupGlobals(){}setupDependencies(){C.setup(L),this.lookup("logger",this._context)}cleanUpGlobals(){throw new Error("Method not implemented.")}cleanUpDependencies(){throw new Error("Method not implemented.")}bootFinished(){this._viewer=new j(this._context),window.RoomleMaterialViewer||(window.RoomleMaterialViewer=this._viewer)}getApi(){return this._viewer}getContextName(){return"material-viewer"}})}}}));
2
+ //# sourceMappingURL=material-viewer-5ff80fdc.legacy.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"material-viewer-5ff80fdc.legacy.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -1,2 +1,2 @@
1
- System.register(["./material-viewer-cbcd6421.legacy.js","./script-loader-86b229ef.legacy.js","./query-params-helper-a47f6cfb.legacy.js","./main-thread-to-worker-6dc921e1.legacy.js","./roomle-dependency-injection-7ff2d03f.legacy.js","./camera-behaviour-ef426a46.legacy.js"],(function(){var e;return{setters:[function(c){e=c.MaterialViewer},function(){},function(){},function(){},function(){},function(){}],execute:function(){(new e).boot()}}}));
1
+ System.register(["./material-viewer-5ff80fdc.legacy.js","./script-loader-f7b6b84e.legacy.js","./query-params-helper-a47f6cfb.legacy.js","./main-thread-to-worker-6dc921e1.legacy.js","./roomle-dependency-injection-7c097ca8.legacy.js","./camera-behaviour-5797c286.legacy.js"],(function(){var e;return{setters:[function(c){e=c.MaterialViewer},function(){},function(){},function(){},function(){},function(){}],execute:function(){(new e).boot()}}}));
2
2
  //# sourceMappingURL=material-viewer-main.legacy.js.map