@roomle/web-sdk 2.104.0 → 2.105.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.
Files changed (194) hide show
  1. package/lib/{banana-for-scale-c4d894f6.nomodule.js → banana-for-scale-7b70708d.nomodule.js} +2 -2
  2. package/lib/{banana-for-scale-c4d894f6.nomodule.js.map → banana-for-scale-7b70708d.nomodule.js.map} +1 -1
  3. package/lib/{banana-for-scale-847fd0c8.js → banana-for-scale-cb30b97c.js} +2 -2
  4. package/lib/{banana-for-scale-847fd0c8.js.map → banana-for-scale-cb30b97c.js.map} +1 -1
  5. package/lib/{camera-behaviour-979f8cc1.nomodule.js → camera-behaviour-9f0c6fa8.nomodule.js} +2 -2
  6. package/lib/{camera-behaviour-979f8cc1.nomodule.js.map → camera-behaviour-9f0c6fa8.nomodule.js.map} +1 -1
  7. package/lib/{camera-behaviour-46d6bf44.js → camera-behaviour-e3cf184d.js} +2 -2
  8. package/lib/{camera-behaviour-46d6bf44.js.map → camera-behaviour-e3cf184d.js.map} +1 -1
  9. package/lib/{component-dimensioning-3536ba01.nomodule.js → component-dimensioning-3ab30af6.nomodule.js} +2 -2
  10. package/lib/component-dimensioning-3ab30af6.nomodule.js.map +1 -0
  11. package/lib/{component-dimensioning-d2589687.js → component-dimensioning-3c489dab.js} +2 -2
  12. package/lib/component-dimensioning-3c489dab.js.map +1 -0
  13. package/lib/{component-raycast-helper-67020a23.nomodule.js → component-raycast-helper-2ba5cf6c.nomodule.js} +2 -2
  14. package/lib/component-raycast-helper-2ba5cf6c.nomodule.js.map +1 -0
  15. package/lib/{component-raycast-helper-5b722fad.js → component-raycast-helper-a8827095.js} +2 -2
  16. package/lib/component-raycast-helper-a8827095.js.map +1 -0
  17. package/lib/{configurator-ca81be5c.nomodule.js → configurator-d424ee79.nomodule.js} +2 -2
  18. package/lib/configurator-d424ee79.nomodule.js.map +1 -0
  19. package/lib/{configurator-ef6a20a1.js → configurator-e518eab7.js} +2 -2
  20. package/lib/configurator-e518eab7.js.map +1 -0
  21. package/lib/configurator-main-34e0ff5d.js +2 -0
  22. package/lib/configurator-main-34e0ff5d.js.map +1 -0
  23. package/lib/configurator-main.nomodule.js +1 -1
  24. package/lib/{continuous-drawing-helper-dc86c969.nomodule.js → continuous-drawing-helper-bd3a0eae.nomodule.js} +2 -2
  25. package/lib/continuous-drawing-helper-bd3a0eae.nomodule.js.map +1 -0
  26. package/lib/{continuous-drawing-helper-fa12a769.js → continuous-drawing-helper-f3186088.js} +2 -2
  27. package/lib/continuous-drawing-helper-f3186088.js.map +1 -0
  28. package/lib/{default-light-setting-b6ec67e1.nomodule.js → default-light-setting-e26f49e8.nomodule.js} +2 -2
  29. package/lib/default-light-setting-e26f49e8.nomodule.js.map +1 -0
  30. package/lib/{default-light-setting-794e9686.js → default-light-setting-f92ce7db.js} +2 -2
  31. package/lib/default-light-setting-f92ce7db.js.map +1 -0
  32. package/lib/{dimensioning-helper-1f8d4717.nomodule.js → dimensioning-helper-635960d2.nomodule.js} +2 -2
  33. package/lib/{dimensioning-helper-1f8d4717.nomodule.js.map → dimensioning-helper-635960d2.nomodule.js.map} +1 -1
  34. package/lib/{dimensioning-helper-c5583055.js → dimensioning-helper-703997de.js} +2 -2
  35. package/lib/{dimensioning-helper-c5583055.js.map → dimensioning-helper-703997de.js.map} +1 -1
  36. package/lib/{glb-viewer-36432817.js → glb-viewer-33b50ca2.js} +2 -2
  37. package/lib/{glb-viewer-36432817.js.map → glb-viewer-33b50ca2.js.map} +1 -1
  38. package/lib/{glb-viewer-1d188950.nomodule.js → glb-viewer-40312c25.nomodule.js} +2 -2
  39. package/lib/{glb-viewer-1d188950.nomodule.js.map → glb-viewer-40312c25.nomodule.js.map} +1 -1
  40. package/lib/{glb-viewer-camera-behaviour-e8ca6baa.js → glb-viewer-camera-behaviour-268f29c9.js} +2 -2
  41. package/lib/glb-viewer-camera-behaviour-268f29c9.js.map +1 -0
  42. package/lib/{glb-viewer-camera-behaviour-922add80.nomodule.js → glb-viewer-camera-behaviour-29c02054.nomodule.js} +2 -2
  43. package/lib/glb-viewer-camera-behaviour-29c02054.nomodule.js.map +1 -0
  44. package/lib/glb-viewer-main-bd94b57d.js +2 -0
  45. package/lib/glb-viewer-main-bd94b57d.js.map +1 -0
  46. package/lib/glb-viewer-main.nomodule.js +1 -1
  47. package/lib/{imos-ix-poc-export-helper-0640d00b.nomodule.js → imos-ix-poc-export-helper-abb2f26e.nomodule.js} +2 -2
  48. package/lib/imos-ix-poc-export-helper-abb2f26e.nomodule.js.map +1 -0
  49. package/lib/{imos-ix-poc-export-helper-4ee31f86.js → imos-ix-poc-export-helper-b6b3ae79.js} +2 -2
  50. package/lib/imos-ix-poc-export-helper-b6b3ae79.js.map +1 -0
  51. package/lib/legacy/{banana-for-scale-fe61b6f9.legacy.js → banana-for-scale-7c131b75.legacy.js} +2 -2
  52. package/lib/legacy/{banana-for-scale-fe61b6f9.legacy.js.map → banana-for-scale-7c131b75.legacy.js.map} +1 -1
  53. package/lib/legacy/{camera-behaviour-0f6d1920.legacy.js → camera-behaviour-b93b326b.legacy.js} +2 -2
  54. package/lib/legacy/{camera-behaviour-0f6d1920.legacy.js.map → camera-behaviour-b93b326b.legacy.js.map} +1 -1
  55. package/lib/legacy/{component-dimensioning-e32fca53.legacy.js → component-dimensioning-2179761f.legacy.js} +2 -2
  56. package/lib/legacy/component-dimensioning-2179761f.legacy.js.map +1 -0
  57. package/lib/legacy/{component-raycast-helper-00e829ad.legacy.js → component-raycast-helper-a393367f.legacy.js} +2 -2
  58. package/lib/legacy/component-raycast-helper-a393367f.legacy.js.map +1 -0
  59. package/lib/legacy/{configurator-b99db454.legacy.js → configurator-3f6e4019.legacy.js} +2 -2
  60. package/lib/legacy/configurator-3f6e4019.legacy.js.map +1 -0
  61. package/lib/legacy/configurator-main.legacy.js +1 -1
  62. package/lib/legacy/{continuous-drawing-helper-9fda9f2d.legacy.js → continuous-drawing-helper-0cfaa199.legacy.js} +2 -2
  63. package/lib/legacy/continuous-drawing-helper-0cfaa199.legacy.js.map +1 -0
  64. package/lib/legacy/{default-light-setting-1d51edff.legacy.js → default-light-setting-07a94d9c.legacy.js} +2 -2
  65. package/lib/legacy/default-light-setting-07a94d9c.legacy.js.map +1 -0
  66. package/lib/legacy/{dimensioning-helper-0659f7db.legacy.js → dimensioning-helper-514082b7.legacy.js} +2 -2
  67. package/lib/legacy/{dimensioning-helper-0659f7db.legacy.js.map → dimensioning-helper-514082b7.legacy.js.map} +1 -1
  68. package/lib/legacy/{glb-viewer-camera-behaviour-0e58aa84.legacy.js → glb-viewer-camera-behaviour-0751efe4.legacy.js} +2 -2
  69. package/lib/legacy/glb-viewer-camera-behaviour-0751efe4.legacy.js.map +1 -0
  70. package/lib/legacy/{glb-viewer-f8e163a0.legacy.js → glb-viewer-ef6c58ca.legacy.js} +2 -2
  71. package/lib/legacy/{glb-viewer-f8e163a0.legacy.js.map → glb-viewer-ef6c58ca.legacy.js.map} +1 -1
  72. package/lib/legacy/glb-viewer-main.legacy.js +1 -1
  73. package/lib/legacy/{imos-ix-poc-export-helper-19935373.legacy.js → imos-ix-poc-export-helper-584e0991.legacy.js} +2 -2
  74. package/lib/legacy/imos-ix-poc-export-helper-584e0991.legacy.js.map +1 -0
  75. package/lib/legacy/{material-viewer-38ca9da3.legacy.js → material-viewer-8dd513d9.legacy.js} +2 -2
  76. package/lib/legacy/material-viewer-8dd513d9.legacy.js.map +1 -0
  77. package/lib/legacy/material-viewer-main.legacy.js +1 -1
  78. package/lib/legacy/{planner-2a5ca736.legacy.js → planner-be9c9ae3.legacy.js} +2 -2
  79. package/lib/legacy/{planner-2a5ca736.legacy.js.map → planner-be9c9ae3.legacy.js.map} +1 -1
  80. package/lib/legacy/planner-main.legacy.js +1 -1
  81. package/lib/legacy/{roomle-configurator-12d11e16.legacy.js → roomle-configurator-a8e4aba1.legacy.js} +2 -2
  82. package/lib/legacy/{roomle-configurator-12d11e16.legacy.js.map → roomle-configurator-a8e4aba1.legacy.js.map} +1 -1
  83. package/lib/legacy/{roomle-dependency-injection-ac2506f6.legacy.js → roomle-dependency-injection-24e6c110.legacy.js} +2 -2
  84. package/lib/legacy/{roomle-dependency-injection-ac2506f6.legacy.js.map → roomle-dependency-injection-24e6c110.legacy.js.map} +1 -1
  85. package/lib/legacy/roomle-sdk.legacy.js +1 -1
  86. package/lib/legacy/{script-loader-186bd36e.legacy.js → script-loader-c630be86.legacy.js} +2 -2
  87. package/lib/legacy/script-loader-c630be86.legacy.js.map +1 -0
  88. package/lib/legacy/static/ConfiguratorKernel-5a5434fd6c70a2bc.wasm +0 -0
  89. package/lib/legacy/static/ConfiguratorKernel-6ed2130d676f9fb1.js +82 -0
  90. package/lib/legacy/static/{RoomleCore-6c2e6c372475698e.js → RoomleCore-234080ee38751c57.js} +38 -38
  91. package/lib/legacy/static/RoomleCore-b96b50b633a2ccc7.wasm +0 -0
  92. package/lib/legacy/static/RoomleToolsCore-600f2c6914cde07b.wasm +0 -0
  93. package/lib/legacy/static/RoomleToolsCore-77dae5fda2bdeeda.js +80 -0
  94. package/lib/legacy/{stats-helper-c53366ae.legacy.js → stats-helper-a9665f06.legacy.js} +2 -2
  95. package/lib/legacy/{stats-helper-c53366ae.legacy.js.map → stats-helper-a9665f06.legacy.js.map} +1 -1
  96. package/lib/legacy/{tools-core-ecb23a87.legacy.js → tools-core-a1aee827.legacy.js} +2 -2
  97. package/lib/legacy/tools-core-a1aee827.legacy.js.map +1 -0
  98. package/lib/{material-viewer-2983a41a.nomodule.js → material-viewer-c2b3e766.nomodule.js} +2 -2
  99. package/lib/material-viewer-c2b3e766.nomodule.js.map +1 -0
  100. package/lib/{material-viewer-9cfec252.js → material-viewer-f4f44be1.js} +2 -2
  101. package/lib/material-viewer-f4f44be1.js.map +1 -0
  102. package/lib/material-viewer-main-1be7f69c.js +2 -0
  103. package/lib/material-viewer-main-1be7f69c.js.map +1 -0
  104. package/lib/material-viewer-main.nomodule.js +1 -1
  105. package/lib/{planner-e545f3af.nomodule.js → planner-204b3e60.nomodule.js} +2 -2
  106. package/lib/{planner-e545f3af.nomodule.js.map → planner-204b3e60.nomodule.js.map} +1 -1
  107. package/lib/{planner-62e7d5b5.js → planner-5ecbf56c.js} +2 -2
  108. package/lib/{planner-62e7d5b5.js.map → planner-5ecbf56c.js.map} +1 -1
  109. package/lib/planner-main-ffd2e1f6.js +2 -0
  110. package/lib/planner-main-ffd2e1f6.js.map +1 -0
  111. package/lib/planner-main.nomodule.js +1 -1
  112. package/lib/{roomle-configurator-1e0c7884.nomodule.js → roomle-configurator-89d4375b.nomodule.js} +2 -2
  113. package/lib/{roomle-configurator-1e0c7884.nomodule.js.map → roomle-configurator-89d4375b.nomodule.js.map} +1 -1
  114. package/lib/{roomle-configurator-dda3bce8.js → roomle-configurator-f8ae715d.js} +2 -2
  115. package/lib/{roomle-configurator-dda3bce8.js.map → roomle-configurator-f8ae715d.js.map} +1 -1
  116. package/lib/{roomle-dependency-injection-b583e325.nomodule.js → roomle-dependency-injection-77733c4a.nomodule.js} +2 -2
  117. package/lib/{roomle-dependency-injection-b583e325.nomodule.js.map → roomle-dependency-injection-77733c4a.nomodule.js.map} +1 -1
  118. package/lib/{roomle-dependency-injection-35c63f6d.js → roomle-dependency-injection-e7169044.js} +2 -2
  119. package/lib/{roomle-dependency-injection-35c63f6d.js.map → roomle-dependency-injection-e7169044.js.map} +1 -1
  120. package/lib/{roomle-sdk-421618b8.js → roomle-sdk-f32e77f2.js} +2 -2
  121. package/lib/roomle-sdk-f32e77f2.js.map +1 -0
  122. package/lib/roomle-sdk.nomodule.js +1 -1
  123. package/lib/{script-loader-47a44536.nomodule.js → script-loader-4853aa9d.nomodule.js} +2 -2
  124. package/lib/script-loader-4853aa9d.nomodule.js.map +1 -0
  125. package/lib/{script-loader-6c3568a9.js → script-loader-ce844543.js} +2 -2
  126. package/lib/script-loader-ce844543.js.map +1 -0
  127. package/lib/static/ConfiguratorKernel-5a5434fd6c70a2bc.wasm +0 -0
  128. package/lib/static/{ConfiguratorKernel-d0cd68e6cd8f877e.js → ConfiguratorKernel-6ed2130d676f9fb1.js} +1 -1
  129. package/lib/static/ConfiguratorKernel-6ed2130d676f9fb1.js.map +1 -0
  130. package/lib/static/{RoomleCore-6c2e6c372475698e.js → RoomleCore-234080ee38751c57.js} +1 -1
  131. package/lib/static/RoomleCore-234080ee38751c57.js.map +1 -0
  132. package/lib/static/RoomleCore-b96b50b633a2ccc7.wasm +0 -0
  133. package/lib/static/RoomleToolsCore-600f2c6914cde07b.wasm +0 -0
  134. package/lib/static/{RoomleToolsCore-83153e0246ba7ed0.js → RoomleToolsCore-77dae5fda2bdeeda.js} +1 -1
  135. package/lib/static/RoomleToolsCore-77dae5fda2bdeeda.js.map +1 -0
  136. package/lib/{stats-helper-31b4c772.nomodule.js → stats-helper-9e32bdb9.nomodule.js} +2 -2
  137. package/lib/{stats-helper-31b4c772.nomodule.js.map → stats-helper-9e32bdb9.nomodule.js.map} +1 -1
  138. package/lib/{stats-helper-543fc446.js → stats-helper-de650886.js} +2 -2
  139. package/lib/{stats-helper-543fc446.js.map → stats-helper-de650886.js.map} +1 -1
  140. package/lib/{tools-core-6688c01d.nomodule.js → tools-core-726f8acb.nomodule.js} +2 -2
  141. package/lib/tools-core-726f8acb.nomodule.js.map +1 -0
  142. package/lib/{tools-core-d7f47066.js → tools-core-ebc87b9e.js} +2 -2
  143. package/lib/tools-core-ebc87b9e.js.map +1 -0
  144. package/package.json +2 -2
  145. package/lib/component-dimensioning-3536ba01.nomodule.js.map +0 -1
  146. package/lib/component-dimensioning-d2589687.js.map +0 -1
  147. package/lib/component-raycast-helper-5b722fad.js.map +0 -1
  148. package/lib/component-raycast-helper-67020a23.nomodule.js.map +0 -1
  149. package/lib/configurator-ca81be5c.nomodule.js.map +0 -1
  150. package/lib/configurator-ef6a20a1.js.map +0 -1
  151. package/lib/configurator-main-4cfec5fe.js +0 -2
  152. package/lib/configurator-main-4cfec5fe.js.map +0 -1
  153. package/lib/continuous-drawing-helper-dc86c969.nomodule.js.map +0 -1
  154. package/lib/continuous-drawing-helper-fa12a769.js.map +0 -1
  155. package/lib/default-light-setting-794e9686.js.map +0 -1
  156. package/lib/default-light-setting-b6ec67e1.nomodule.js.map +0 -1
  157. package/lib/glb-viewer-camera-behaviour-922add80.nomodule.js.map +0 -1
  158. package/lib/glb-viewer-camera-behaviour-e8ca6baa.js.map +0 -1
  159. package/lib/glb-viewer-main-9cdf6cf9.js +0 -2
  160. package/lib/glb-viewer-main-9cdf6cf9.js.map +0 -1
  161. package/lib/imos-ix-poc-export-helper-0640d00b.nomodule.js.map +0 -1
  162. package/lib/imos-ix-poc-export-helper-4ee31f86.js.map +0 -1
  163. package/lib/legacy/component-dimensioning-e32fca53.legacy.js.map +0 -1
  164. package/lib/legacy/component-raycast-helper-00e829ad.legacy.js.map +0 -1
  165. package/lib/legacy/configurator-b99db454.legacy.js.map +0 -1
  166. package/lib/legacy/continuous-drawing-helper-9fda9f2d.legacy.js.map +0 -1
  167. package/lib/legacy/default-light-setting-1d51edff.legacy.js.map +0 -1
  168. package/lib/legacy/glb-viewer-camera-behaviour-0e58aa84.legacy.js.map +0 -1
  169. package/lib/legacy/imos-ix-poc-export-helper-19935373.legacy.js.map +0 -1
  170. package/lib/legacy/material-viewer-38ca9da3.legacy.js.map +0 -1
  171. package/lib/legacy/script-loader-186bd36e.legacy.js.map +0 -1
  172. package/lib/legacy/static/ConfiguratorKernel-c856fdc177e1add3.wasm +0 -0
  173. package/lib/legacy/static/ConfiguratorKernel-d0cd68e6cd8f877e.js +0 -82
  174. package/lib/legacy/static/RoomleCore-0d49acadb9d8916e.wasm +0 -0
  175. package/lib/legacy/static/RoomleToolsCore-75c06fcbb5dee38f.wasm +0 -0
  176. package/lib/legacy/static/RoomleToolsCore-83153e0246ba7ed0.js +0 -80
  177. package/lib/legacy/tools-core-ecb23a87.legacy.js.map +0 -1
  178. package/lib/material-viewer-2983a41a.nomodule.js.map +0 -1
  179. package/lib/material-viewer-9cfec252.js.map +0 -1
  180. package/lib/material-viewer-main-6f0c731a.js +0 -2
  181. package/lib/material-viewer-main-6f0c731a.js.map +0 -1
  182. package/lib/planner-main-60534bb1.js +0 -2
  183. package/lib/planner-main-60534bb1.js.map +0 -1
  184. package/lib/roomle-sdk-421618b8.js.map +0 -1
  185. package/lib/script-loader-47a44536.nomodule.js.map +0 -1
  186. package/lib/script-loader-6c3568a9.js.map +0 -1
  187. package/lib/static/ConfiguratorKernel-c856fdc177e1add3.wasm +0 -0
  188. package/lib/static/ConfiguratorKernel-d0cd68e6cd8f877e.js.map +0 -1
  189. package/lib/static/RoomleCore-0d49acadb9d8916e.wasm +0 -0
  190. package/lib/static/RoomleCore-6c2e6c372475698e.js.map +0 -1
  191. package/lib/static/RoomleToolsCore-75c06fcbb5dee38f.wasm +0 -0
  192. package/lib/static/RoomleToolsCore-83153e0246ba7ed0.js.map +0 -1
  193. package/lib/tools-core-6688c01d.nomodule.js.map +0 -1
  194. package/lib/tools-core-d7f47066.js.map +0 -1
@@ -1,2 +1,2 @@
1
- System.register(["./script-loader-47a44536.nomodule.js","./roomle-dependency-injection-b583e325.nomodule.js","./camera-behaviour-979f8cc1.nomodule.js","./main-thread-to-worker-707405ab.nomodule.js","./query-params-helper-0afbebc7.nomodule.js"],(function(e){var t,a,i,r,s,n,o,l,h,_,m,c,d,g,u,p,M,C,w,y,f,b,v,S,P,x,F,G,I,U,R,k,T,A,B,D;return{setters:[function(e){t=e.S,a=e.M},function(e){i=e._,r=e.i,s=e.H,n=e.K,o=e.O,l=e.af,h=e.aX,_=e.aY,m=e.n,c=e.aZ,d=e.ak,g=e.a_,u=e.D,p=e.L,M=e.aV,C=e.a$,w=e.R,y=e.b},function(e){f=e.b,b=e.S,v=e.B,S=e.C,P=e.F,x=e.T},function(e){F=e.aE,G=e.aP,I=e.z,U=e.C,R=e.ad,k=e.w,T=e.a7,A=e.aS,B=e.b9,D=e.a9},function(){}],execute:function(){class V extends f{get cameraControl(){return this._cameraControl}}class E extends b{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,o.CAMERA)),this._initScene()}_initScene(){const e=new G(1,1,1,100,100,100),t=l.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 v(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(h(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===k,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(),null),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?k:T,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 A(.5,100,100)),"plane_horizontal"===this._sceneParams.type&&(e=new B(1,1),e.rotateX(-Math.PI/2)),"plane_vertical"===this._sceneParams.type&&(e=new B(1,1)),this._mesh.geometry=e,this._renderEverything()}async changeFloorMaterialById(e){const t=await this._rapiAccess.getMaterial(e);return this._environment&&this._environment instanceof P||(this._environment=new P(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 D;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],E.prototype,"_inputManager",void 0),i([r],E.prototype,"_configuratorMeshGenerator",void 0),i([r],E.prototype,"_roomleMaterialViewerUiCallback",void 0),i([r],E.prototype,"_rapiAccess",void 0);class O{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(x,{id:"tween-js"})]).then(()=>{this._sceneManager=new E(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)}get globalCallbacks(){return this._globalCallback}}i([r],O.prototype,"_domHelper",void 0),i([r],O.prototype,"_scriptLoader",void 0),i([r],O.prototype,"_lifeCycleManager",void 0),i([r],O.prototype,"_roomleMaterialViewerUiCallback",void 0),i([r],O.prototype,"_initData",void 0),i([r],O.prototype,"_globalCallback",void 0),i([r],O.prototype,"_rapiAccess",void 0),i([r],O.prototype,"_unitFormatter",void 0),i([r],O.prototype,"_idbManager",void 0);const j=[new u("script-loader",t),new u("logger",p),new u("input-manager",M,1),new u("configurator-mesh-generator",C),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(){y.setup(j),this.lookup("logger",this._context)}cleanUpGlobals(){throw new Error("Method not implemented.")}cleanUpDependencies(){throw new Error("Method not implemented.")}bootFinished(){this._viewer=new O(this._context),window.RoomleMaterialViewer||(window.RoomleMaterialViewer=this._viewer)}getApi(){return this._viewer}getContextName(){return"material-viewer"}})}}}));
2
- //# sourceMappingURL=material-viewer-2983a41a.nomodule.js.map
1
+ System.register(["./script-loader-4853aa9d.nomodule.js","./roomle-dependency-injection-77733c4a.nomodule.js","./camera-behaviour-9f0c6fa8.nomodule.js","./main-thread-to-worker-707405ab.nomodule.js","./query-params-helper-0afbebc7.nomodule.js"],(function(e){var t,a,i,r,s,n,o,l,h,_,m,c,d,g,u,p,M,C,w,y,f,v,b,S,P,x,F,G,I,U,R,k,T,A,B,D;return{setters:[function(e){t=e.S,a=e.M},function(e){i=e._,r=e.i,s=e.H,n=e.K,o=e.O,l=e.af,h=e.aX,_=e.aY,m=e.n,c=e.aZ,d=e.ak,g=e.a_,u=e.D,p=e.L,M=e.aV,C=e.a$,w=e.R,y=e.b},function(e){f=e.b,v=e.S,b=e.B,S=e.C,P=e.F,x=e.T},function(e){F=e.aE,G=e.aP,I=e.z,U=e.C,R=e.ad,k=e.w,T=e.a7,A=e.aS,B=e.b9,D=e.a9},function(){}],execute:function(){class V extends f{get cameraControl(){return this._cameraControl}}class E 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,o.CAMERA)),this._initScene()}_initScene(){const e=new G(1,1,1,100,100,100),t=l.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(h(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===k,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(),null),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?k:T,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 A(.5,100,100)),"plane_horizontal"===this._sceneParams.type&&(e=new B(1,1),e.rotateX(-Math.PI/2)),"plane_vertical"===this._sceneParams.type&&(e=new B(1,1)),this._mesh.geometry=e,this._renderEverything()}async changeFloorMaterialById(e){const t=await this._rapiAccess.getMaterial(e);return this._environment&&this._environment instanceof P||(this._environment=new P(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 D;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],E.prototype,"_inputManager",void 0),i([r],E.prototype,"_configuratorMeshGenerator",void 0),i([r],E.prototype,"_roomleMaterialViewerUiCallback",void 0),i([r],E.prototype,"_rapiAccess",void 0);class O{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(x,{id:"tween-js"})]).then(()=>{this._sceneManager=new E(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)}get globalCallbacks(){return this._globalCallback}}i([r],O.prototype,"_domHelper",void 0),i([r],O.prototype,"_scriptLoader",void 0),i([r],O.prototype,"_lifeCycleManager",void 0),i([r],O.prototype,"_roomleMaterialViewerUiCallback",void 0),i([r],O.prototype,"_initData",void 0),i([r],O.prototype,"_globalCallback",void 0),i([r],O.prototype,"_rapiAccess",void 0),i([r],O.prototype,"_unitFormatter",void 0),i([r],O.prototype,"_idbManager",void 0);const j=[new u("script-loader",t),new u("logger",p),new u("input-manager",M,1),new u("configurator-mesh-generator",C),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(){y.setup(j),this.lookup("logger",this._context)}cleanUpGlobals(){throw new Error("Method not implemented.")}cleanUpDependencies(){throw new Error("Method not implemented.")}bootFinished(){this._viewer=new O(this._context),window.RoomleMaterialViewer||(window.RoomleMaterialViewer=this._viewer)}getApi(){return this._viewer}getContextName(){return"material-viewer"}})}}}));
2
+ //# sourceMappingURL=material-viewer-c2b3e766.nomodule.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"material-viewer-c2b3e766.nomodule.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -1,2 +1,2 @@
1
- import{S as ScriptLoader,M as Main}from"./script-loader-6c3568a9.js";import{_ as __decorate,i as inject,H as CANVAS_ID,K as DynamicLightSettingLoader,O as PREDEFINED_LIGHTSETTING,af as MaterialCreator,aX as setMaterial,aY as getMaterialShading,n as getGUI,aZ as addExistingTexture,ak as addTexture,a_ as UiCallback,D as DependencyInjectionAssignment,L as Logger,aV as InputManager,a$ as ConfiguratorMeshGenerator,R as RapiAccess,b as RoomleDependencyInjection}from"./roomle-dependency-injection-35c63f6d.js";import{b as CameraBehaviour,S as SceneManager,B as BackgroundEnvironment,C as CameraControl3D,F as FloorEnvironment,T as TWEEN_FILE_NAME}from"./camera-behaviour-46d6bf44.js";import{aE as CAMERA_TYPE,aP as BoxGeometry,z as Mesh,C as Color,ad as Box3,w as DoubleSide,a7 as FrontSide,aS as SphereGeometry,b9 as PlaneGeometry,a9 as Texture}from"./main-thread-to-worker-7f1066e7.js";import"./query-params-helper-37c38de6.js";class MaterialViewerCameraBehaviour extends CameraBehaviour{get cameraControl(){return this._cameraControl}}class MaterialViewerSceneManager extends SceneManager{constructor(e,a){super(e,a,CANVAS_ID.RMV,CAMERA_TYPE.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(DynamicLightSettingLoader.createDynamicLightSettingSource(null,PREDEFINED_LIGHTSETTING.CAMERA)),this._initScene()}_initScene(){const e=new BoxGeometry(1,1,1,100,100,100),a=MaterialCreator.createMeshPhysicalMaterial({color:this._initData.colors.PRIMARY});this._setMaterial(a),this._mesh=new Mesh(e,this._material),this._mesh.castShadow=!0,this._mesh.position.setY(.5),this._scene.add(this._mesh);const{initialFloorMaterial:t}=this._initData;if(t?this.changeFloorMaterialById(t):this._environment=new BackgroundEnvironment(this._scene,null,new Color(16777215)),this.cameraBehaviour.cameraControl instanceof CameraControl3D){const e=new Box3;e.setFromObject(this._mesh),console.trace("reset camera"),this.cameraBehaviour.cameraControl.updateAndReset(e)}this.showGUI()}loadMaterialId(e){return new Promise(a=>{this._configuratorMeshGenerator.loadMaterial(e,1e3,1e3).then(e=>{this._setMaterial(e),this._mesh.material=this._material,this._updateGUI(),this._requestRender(),a()})})}loadMaterial(e){return new Promise(a=>{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()}),a()})}loadMaterialShading(e){return new Promise(a=>{let t={shading:e};this._setMaterial(setMaterial(this._material,t)),this._mesh.material=this._material,this._updateGUI(),this._requestRender(),a()})}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===DoubleSide,this._materialParams.metallic=1===e.metalness?1:e.reflectivity}getMaterialShading(e=1){return getMaterialShading(this._material,e)}createCameraControl(e,a){this._changeCameraBehaviour(new MaterialViewerCameraBehaviour(new CameraControl3D(this._creator_,this._getInputManager(),null),this._cameraBehaviourState))}_getInputManager(){return this._inputManager}sceneChanged(){}getBounds(){return this._mesh?(new Box3).setFromObject(this._mesh):null}getGeometryBounds(){return null}_guiLoaded(){this._updateGUI()}_updateGUI(){let e=getGUI();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 Color(e),this._shadingChanged()}),this._guiMaterialFolder.add(this._materialParams,"metallic").min(0).max(1).step(.01).onChange(e=>{this._material.metalness=1===e?1:.5,this._material.reflectivity=e||.5,this._shadingChanged()}),this._guiMaterialFolder.add(this._material,"roughness").min(0).max(1).step(.01).onChange(e=>{this._shadingChanged()}),this._guiMaterialFolder.add(this._material,"transmission").min(0).max(1).step(.01).onChange(e=>{this._material.transmission=e,e>0&&(this._material.opacity=1,this._material.alphaTest=.5,this._material.depthWrite=!1,this._material.transparent=!0,this._material.metalness=0),this._mesh.castShadow=!this._material.transparent,this._shadingChanged()}),this._guiMaterialFolder.add(this._materialParams,"alpha").min(0).max(1).step(.01).onChange(e=>{this._material.transparent=e<1,this._material.opacity=e,this._material.depthWrite=e>=1,this._mesh.castShadow=!this._material.transparent,this._shadingChanged()}),this._guiMaterialFolder.add(this._materialParams,"alphaCutoff").min(0).max(1).step(.01).onChange(e=>{this._material.alphaTest=e||0,this._shadingChanged()}),this._guiMaterialFolder.add(this._materialParams,"doubleSided").onChange(e=>{this._material.side=e?DoubleSide:FrontSide,this._shadingChanged()})),this._addGUIListener(e))}_shadingChanged(){this._roomleMaterialViewerUiCallback.onMaterialShadingChanged(getMaterialShading(this._material))}setGeometry(e){this._sceneParams.type=e,this._setGeometry()}_setGeometry(){let e;"cube"===this._sceneParams.type&&(e=new BoxGeometry(1,1,1,100,100,100)),"sphere"===this._sceneParams.type&&(e=new SphereGeometry(.5,100,100)),"plane_horizontal"===this._sceneParams.type&&(e=new PlaneGeometry(1,1),e.rotateX(-Math.PI/2)),"plane_vertical"===this._sceneParams.type&&(e=new PlaneGeometry(1,1)),this._mesh.geometry=e,this._renderEverything()}async changeFloorMaterialById(e){const a=await this._rapiAccess.getMaterial(e);return this._environment&&this._environment instanceof FloorEnvironment||(this._environment=new FloorEnvironment(this._scene,this._environment,!0)),new Promise((e,t)=>{this._environment.changeFloorMaterial(a,this._maxAnisotropy).then(()=>{this._requestRender(),e()},t)})}async addTexture(e,a){const t=100/(0===e.mmWidth?1:e.mmWidth),r=100/(0===e.mmHeight?1:e.mmHeight);if(a){const i=new Image;i.src=a;const s=new Texture;s.image=i,i.onload=function(){s.needsUpdate=!0},addExistingTexture(s,e,this._material,this._maxAnisotropy,t,r,this._renderer.capabilities.maxTextures)}else await addTexture(e.image,e,this._material,this._maxAnisotropy,t,r,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()}}__decorate([inject],MaterialViewerSceneManager.prototype,"_inputManager",void 0),__decorate([inject],MaterialViewerSceneManager.prototype,"_configuratorMeshGenerator",void 0),__decorate([inject],MaterialViewerSceneManager.prototype,"_roomleMaterialViewerUiCallback",void 0),__decorate([inject],MaterialViewerSceneManager.prototype,"_rapiAccess",void 0);class RoomleMaterialViewer{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,a){Promise.all([this._scriptLoader.fetch(TWEEN_FILE_NAME,{id:"tween-js"})]).then(()=>{this._sceneManager=new MaterialViewerSceneManager(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,a={}){return a.flushCache&&this._clearCaches(),this._sceneManager.loadMaterial(e)}loadMaterialId(e,a={}){return a.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,a){return this._sceneManager.addTexture(e,a)}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:a,intensity:t,rotation:r,maxLightSources:i}=e;this._sceneManager.setEnvironmentMap(a,t,r,i)}get globalCallbacks(){return this._globalCallback}}__decorate([inject],RoomleMaterialViewer.prototype,"_domHelper",void 0),__decorate([inject],RoomleMaterialViewer.prototype,"_scriptLoader",void 0),__decorate([inject],RoomleMaterialViewer.prototype,"_lifeCycleManager",void 0),__decorate([inject],RoomleMaterialViewer.prototype,"_roomleMaterialViewerUiCallback",void 0),__decorate([inject],RoomleMaterialViewer.prototype,"_initData",void 0),__decorate([inject],RoomleMaterialViewer.prototype,"_globalCallback",void 0),__decorate([inject],RoomleMaterialViewer.prototype,"_rapiAccess",void 0),__decorate([inject],RoomleMaterialViewer.prototype,"_unitFormatter",void 0),__decorate([inject],RoomleMaterialViewer.prototype,"_idbManager",void 0);const INJECTABLES=[new DependencyInjectionAssignment("script-loader",ScriptLoader),new DependencyInjectionAssignment("logger",Logger),new DependencyInjectionAssignment("input-manager",InputManager,1),new DependencyInjectionAssignment("configurator-mesh-generator",ConfiguratorMeshGenerator),new DependencyInjectionAssignment("rapi-access",RapiAccess),new DependencyInjectionAssignment("roomle-material-viewer-ui-callback",class extends UiCallback{constructor(e){super(e),this.onMaterialShadingChanged=e=>{}}},1)];class MaterialViewer 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 RoomleMaterialViewer(this._context),window.RoomleMaterialViewer||(window.RoomleMaterialViewer=this._viewer)}getApi(){return this._viewer}getContextName(){return"material-viewer"}}export{MaterialViewer};
2
- //# sourceMappingURL=material-viewer-9cfec252.js.map
1
+ import{S as ScriptLoader,M as Main}from"./script-loader-ce844543.js";import{_ as __decorate,i as inject,H as CANVAS_ID,K as DynamicLightSettingLoader,O as PREDEFINED_LIGHTSETTING,af as MaterialCreator,aX as setMaterial,aY as getMaterialShading,n as getGUI,aZ as addExistingTexture,ak as addTexture,a_ as UiCallback,D as DependencyInjectionAssignment,L as Logger,aV as InputManager,a$ as ConfiguratorMeshGenerator,R as RapiAccess,b as RoomleDependencyInjection}from"./roomle-dependency-injection-e7169044.js";import{b as CameraBehaviour,S as SceneManager,B as BackgroundEnvironment,C as CameraControl3D,F as FloorEnvironment,T as TWEEN_FILE_NAME}from"./camera-behaviour-e3cf184d.js";import{aE as CAMERA_TYPE,aP as BoxGeometry,z as Mesh,C as Color,ad as Box3,w as DoubleSide,a7 as FrontSide,aS as SphereGeometry,b9 as PlaneGeometry,a9 as Texture}from"./main-thread-to-worker-7f1066e7.js";import"./query-params-helper-37c38de6.js";class MaterialViewerCameraBehaviour extends CameraBehaviour{get cameraControl(){return this._cameraControl}}class MaterialViewerSceneManager extends SceneManager{constructor(e,a){super(e,a,CANVAS_ID.RMV,CAMERA_TYPE.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(DynamicLightSettingLoader.createDynamicLightSettingSource(null,PREDEFINED_LIGHTSETTING.CAMERA)),this._initScene()}_initScene(){const e=new BoxGeometry(1,1,1,100,100,100),a=MaterialCreator.createMeshPhysicalMaterial({color:this._initData.colors.PRIMARY});this._setMaterial(a),this._mesh=new Mesh(e,this._material),this._mesh.castShadow=!0,this._mesh.position.setY(.5),this._scene.add(this._mesh);const{initialFloorMaterial:t}=this._initData;if(t?this.changeFloorMaterialById(t):this._environment=new BackgroundEnvironment(this._scene,null,new Color(16777215)),this.cameraBehaviour.cameraControl instanceof CameraControl3D){const e=new Box3;e.setFromObject(this._mesh),console.trace("reset camera"),this.cameraBehaviour.cameraControl.updateAndReset(e)}this.showGUI()}loadMaterialId(e){return new Promise(a=>{this._configuratorMeshGenerator.loadMaterial(e,1e3,1e3).then(e=>{this._setMaterial(e),this._mesh.material=this._material,this._updateGUI(),this._requestRender(),a()})})}loadMaterial(e){return new Promise(a=>{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()}),a()})}loadMaterialShading(e){return new Promise(a=>{let t={shading:e};this._setMaterial(setMaterial(this._material,t)),this._mesh.material=this._material,this._updateGUI(),this._requestRender(),a()})}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===DoubleSide,this._materialParams.metallic=1===e.metalness?1:e.reflectivity}getMaterialShading(e=1){return getMaterialShading(this._material,e)}createCameraControl(e,a){this._changeCameraBehaviour(new MaterialViewerCameraBehaviour(new CameraControl3D(this._creator_,this._getInputManager(),null),this._cameraBehaviourState))}_getInputManager(){return this._inputManager}sceneChanged(){}getBounds(){return this._mesh?(new Box3).setFromObject(this._mesh):null}getGeometryBounds(){return null}_guiLoaded(){this._updateGUI()}_updateGUI(){let e=getGUI();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 Color(e),this._shadingChanged()}),this._guiMaterialFolder.add(this._materialParams,"metallic").min(0).max(1).step(.01).onChange(e=>{this._material.metalness=1===e?1:.5,this._material.reflectivity=e||.5,this._shadingChanged()}),this._guiMaterialFolder.add(this._material,"roughness").min(0).max(1).step(.01).onChange(e=>{this._shadingChanged()}),this._guiMaterialFolder.add(this._material,"transmission").min(0).max(1).step(.01).onChange(e=>{this._material.transmission=e,e>0&&(this._material.opacity=1,this._material.alphaTest=.5,this._material.depthWrite=!1,this._material.transparent=!0,this._material.metalness=0),this._mesh.castShadow=!this._material.transparent,this._shadingChanged()}),this._guiMaterialFolder.add(this._materialParams,"alpha").min(0).max(1).step(.01).onChange(e=>{this._material.transparent=e<1,this._material.opacity=e,this._material.depthWrite=e>=1,this._mesh.castShadow=!this._material.transparent,this._shadingChanged()}),this._guiMaterialFolder.add(this._materialParams,"alphaCutoff").min(0).max(1).step(.01).onChange(e=>{this._material.alphaTest=e||0,this._shadingChanged()}),this._guiMaterialFolder.add(this._materialParams,"doubleSided").onChange(e=>{this._material.side=e?DoubleSide:FrontSide,this._shadingChanged()})),this._addGUIListener(e))}_shadingChanged(){this._roomleMaterialViewerUiCallback.onMaterialShadingChanged(getMaterialShading(this._material))}setGeometry(e){this._sceneParams.type=e,this._setGeometry()}_setGeometry(){let e;"cube"===this._sceneParams.type&&(e=new BoxGeometry(1,1,1,100,100,100)),"sphere"===this._sceneParams.type&&(e=new SphereGeometry(.5,100,100)),"plane_horizontal"===this._sceneParams.type&&(e=new PlaneGeometry(1,1),e.rotateX(-Math.PI/2)),"plane_vertical"===this._sceneParams.type&&(e=new PlaneGeometry(1,1)),this._mesh.geometry=e,this._renderEverything()}async changeFloorMaterialById(e){const a=await this._rapiAccess.getMaterial(e);return this._environment&&this._environment instanceof FloorEnvironment||(this._environment=new FloorEnvironment(this._scene,this._environment,!0)),new Promise((e,t)=>{this._environment.changeFloorMaterial(a,this._maxAnisotropy).then(()=>{this._requestRender(),e()},t)})}async addTexture(e,a){const t=100/(0===e.mmWidth?1:e.mmWidth),r=100/(0===e.mmHeight?1:e.mmHeight);if(a){const i=new Image;i.src=a;const s=new Texture;s.image=i,i.onload=function(){s.needsUpdate=!0},addExistingTexture(s,e,this._material,this._maxAnisotropy,t,r,this._renderer.capabilities.maxTextures)}else await addTexture(e.image,e,this._material,this._maxAnisotropy,t,r,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()}}__decorate([inject],MaterialViewerSceneManager.prototype,"_inputManager",void 0),__decorate([inject],MaterialViewerSceneManager.prototype,"_configuratorMeshGenerator",void 0),__decorate([inject],MaterialViewerSceneManager.prototype,"_roomleMaterialViewerUiCallback",void 0),__decorate([inject],MaterialViewerSceneManager.prototype,"_rapiAccess",void 0);class RoomleMaterialViewer{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,a){Promise.all([this._scriptLoader.fetch(TWEEN_FILE_NAME,{id:"tween-js"})]).then(()=>{this._sceneManager=new MaterialViewerSceneManager(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,a={}){return a.flushCache&&this._clearCaches(),this._sceneManager.loadMaterial(e)}loadMaterialId(e,a={}){return a.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,a){return this._sceneManager.addTexture(e,a)}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:a,intensity:t,rotation:r,maxLightSources:i}=e;this._sceneManager.setEnvironmentMap(a,t,r,i)}get globalCallbacks(){return this._globalCallback}}__decorate([inject],RoomleMaterialViewer.prototype,"_domHelper",void 0),__decorate([inject],RoomleMaterialViewer.prototype,"_scriptLoader",void 0),__decorate([inject],RoomleMaterialViewer.prototype,"_lifeCycleManager",void 0),__decorate([inject],RoomleMaterialViewer.prototype,"_roomleMaterialViewerUiCallback",void 0),__decorate([inject],RoomleMaterialViewer.prototype,"_initData",void 0),__decorate([inject],RoomleMaterialViewer.prototype,"_globalCallback",void 0),__decorate([inject],RoomleMaterialViewer.prototype,"_rapiAccess",void 0),__decorate([inject],RoomleMaterialViewer.prototype,"_unitFormatter",void 0),__decorate([inject],RoomleMaterialViewer.prototype,"_idbManager",void 0);const INJECTABLES=[new DependencyInjectionAssignment("script-loader",ScriptLoader),new DependencyInjectionAssignment("logger",Logger),new DependencyInjectionAssignment("input-manager",InputManager,1),new DependencyInjectionAssignment("configurator-mesh-generator",ConfiguratorMeshGenerator),new DependencyInjectionAssignment("rapi-access",RapiAccess),new DependencyInjectionAssignment("roomle-material-viewer-ui-callback",class extends UiCallback{constructor(e){super(e),this.onMaterialShadingChanged=e=>{}}},1)];class MaterialViewer 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 RoomleMaterialViewer(this._context),window.RoomleMaterialViewer||(window.RoomleMaterialViewer=this._viewer)}getApi(){return this._viewer}getContextName(){return"material-viewer"}}export{MaterialViewer};
2
+ //# sourceMappingURL=material-viewer-f4f44be1.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"material-viewer-f4f44be1.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ import{MaterialViewer}from"./material-viewer-f4f44be1.js";import"./script-loader-ce844543.js";import"./query-params-helper-37c38de6.js";import"./main-thread-to-worker-7f1066e7.js";import"./roomle-dependency-injection-e7169044.js";import"./camera-behaviour-e3cf184d.js";(new MaterialViewer).boot();
2
+ //# sourceMappingURL=material-viewer-main-1be7f69c.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"material-viewer-main-1be7f69c.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -1,2 +1,2 @@
1
- System.register(["./material-viewer-2983a41a.nomodule.js","./script-loader-47a44536.nomodule.js","./query-params-helper-0afbebc7.nomodule.js","./main-thread-to-worker-707405ab.nomodule.js","./roomle-dependency-injection-b583e325.nomodule.js","./camera-behaviour-979f8cc1.nomodule.js"],(function(){var e;return{setters:[function(n){e=n.MaterialViewer},function(){},function(){},function(){},function(){},function(){}],execute:function(){(new e).boot()}}}));
1
+ System.register(["./material-viewer-c2b3e766.nomodule.js","./script-loader-4853aa9d.nomodule.js","./query-params-helper-0afbebc7.nomodule.js","./main-thread-to-worker-707405ab.nomodule.js","./roomle-dependency-injection-77733c4a.nomodule.js","./camera-behaviour-9f0c6fa8.nomodule.js"],(function(){var e;return{setters:[function(n){e=n.MaterialViewer},function(){},function(){},function(){},function(){},function(){}],execute:function(){(new e).boot()}}}));
2
2
  //# sourceMappingURL=material-viewer-main.nomodule.js.map