@roomle/web-sdk 3.6.0-alpha.3 → 3.6.0-alpha.4

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 (327) hide show
  1. package/lib/BufferGeometry-DLEagG41.mjs +1022 -0
  2. package/lib/BufferGeometry-DLEagG41.mjs.map +1 -0
  3. package/lib/ConfiguratorKernel.wasm +0 -0
  4. package/lib/GLTFExporter-D8qsdwDK.mjs +1092 -0
  5. package/lib/GLTFExporter-D8qsdwDK.mjs.map +1 -0
  6. package/lib/Object3D-DSjIOhON.mjs +1713 -0
  7. package/lib/Object3D-DSjIOhON.mjs.map +1 -0
  8. package/lib/PointLightHelper-BnjxGaOG.mjs +257 -0
  9. package/lib/PointLightHelper-BnjxGaOG.mjs.map +1 -0
  10. package/lib/RoomleCore.wasm +0 -0
  11. package/lib/RoomleToolsCore.wasm +0 -0
  12. package/lib/SpotLightHelper-DqsfqCrs.mjs +154 -0
  13. package/lib/SpotLightHelper-DqsfqCrs.mjs.map +1 -0
  14. package/lib/USDZExporter-DxIqi8St.mjs +296 -0
  15. package/lib/USDZExporter-DxIqi8St.mjs.map +1 -0
  16. package/lib/Vector4-DGmBYfpK.mjs +204 -0
  17. package/lib/Vector4-DGmBYfpK.mjs.map +1 -0
  18. package/lib/api-CNoIBuvr.mjs +55 -0
  19. package/lib/api-CNoIBuvr.mjs.map +1 -0
  20. package/lib/banana-for-scale-C_iNmlCT.mjs +36 -0
  21. package/lib/banana-for-scale-C_iNmlCT.mjs.map +1 -0
  22. package/lib/common-utils-DMSTohiS.mjs +187 -0
  23. package/lib/common-utils-DMSTohiS.mjs.map +1 -0
  24. package/lib/component-dimensioning-CvRmUja4.mjs +162 -0
  25. package/lib/component-dimensioning-CvRmUja4.mjs.map +1 -0
  26. package/lib/component-raycast-helper-CEp7wy9c.mjs +97 -0
  27. package/lib/component-raycast-helper-CEp7wy9c.mjs.map +1 -0
  28. package/lib/configurator-B_5XVG2O.mjs +45 -0
  29. package/lib/configurator-B_5XVG2O.mjs.map +1 -0
  30. package/lib/configurator-DCdvMM0o.mjs +2 -0
  31. package/lib/continuous-drawing-helper-v_5UAM9A.mjs +42 -0
  32. package/lib/continuous-drawing-helper-v_5UAM9A.mjs.map +1 -0
  33. package/lib/decorate-C1QnXPYw.mjs +35 -0
  34. package/lib/decorate-C1QnXPYw.mjs.map +1 -0
  35. package/lib/dimensioning-helper-DTcW85Oq.mjs +2 -0
  36. package/lib/dimensioning-helper-Fwpt1HTT.mjs +268 -0
  37. package/lib/dimensioning-helper-Fwpt1HTT.mjs.map +1 -0
  38. package/lib/fflate.module-dFNj5UPI.mjs +536 -0
  39. package/lib/fflate.module-dFNj5UPI.mjs.map +1 -0
  40. package/lib/glb-viewer-cP8g6bcm.mjs +315 -0
  41. package/lib/glb-viewer-cP8g6bcm.mjs.map +1 -0
  42. package/lib/glb-viewer-dZThmlwM.mjs +2 -0
  43. package/lib/homag-intelligence-LoOJ7roM.mjs +381 -0
  44. package/lib/homag-intelligence-LoOJ7roM.mjs.map +1 -0
  45. package/lib/imos-ix-poc-export-helper-CQh94HsO.mjs +161 -0
  46. package/lib/imos-ix-poc-export-helper-CQh94HsO.mjs.map +1 -0
  47. package/lib/kernel-BAQSG9r5.mjs +46 -0
  48. package/lib/kernel-BAQSG9r5.mjs.map +1 -0
  49. package/lib/kernel-utils-H74uNY1h.mjs +44 -0
  50. package/lib/kernel-utils-H74uNY1h.mjs.map +1 -0
  51. package/lib/layer-C_JtkhdO.mjs +8 -0
  52. package/lib/layer-C_JtkhdO.mjs.map +1 -0
  53. package/lib/main-BxEZ11ag.mjs +20461 -0
  54. package/lib/main-BxEZ11ag.mjs.map +1 -0
  55. package/lib/material-viewer-njBFF0Zg.mjs +292 -0
  56. package/lib/material-viewer-njBFF0Zg.mjs.map +1 -0
  57. package/lib/planner-Cr495Cyn.mjs +2 -0
  58. package/lib/planner-DY73rplC.mjs +44 -0
  59. package/lib/planner-DY73rplC.mjs.map +1 -0
  60. package/lib/plugin-system-D9K46xJk.mjs +55 -0
  61. package/lib/plugin-system-D9K46xJk.mjs.map +1 -0
  62. package/lib/roomle-sdk.d.ts +15 -2
  63. package/lib/roomle-sdk.js +7 -36
  64. package/lib/scene-renderer-D8HkTFeZ.mjs +3826 -0
  65. package/lib/scene-renderer-D8HkTFeZ.mjs.map +1 -0
  66. package/lib/script-loader-KBq8SjP6.mjs +45 -0
  67. package/lib/script-loader-KBq8SjP6.mjs.map +1 -0
  68. package/lib/static/draco/node_modules/three/examples/jsm/libs/draco/draco_decoder.js +34 -0
  69. package/lib/static/draco/node_modules/three/examples/jsm/libs/draco/draco_decoder.wasm +0 -0
  70. package/lib/static/draco/node_modules/three/examples/jsm/libs/draco/draco_encoder.js +33 -0
  71. package/lib/static/draco/node_modules/three/examples/jsm/libs/draco/draco_wasm_wrapper.js +117 -0
  72. package/lib/static/roomle-core-hsc/node_modules/roomle-core-hsc/package.json +1 -0
  73. package/lib/static/roomle-core-hsc/{src → node_modules/roomle-core-hsc/src}/embind/plannerCoreInterface.d.ts +2 -0
  74. package/lib/static/roomle-core-hsc/{wasm_modern → node_modules/roomle-core-hsc/wasm_modern}/ConfiguratorKernel.wasm +0 -0
  75. package/lib/static/roomle-core-hsc/{RoomleCore.wasm → node_modules/roomle-core-hsc/wasm_modern/RoomleCore.wasm} +0 -0
  76. package/lib/static/roomle-core-hsc/{wasm_modern → node_modules/roomle-core-hsc/wasm_modern}/RoomleToolsCore.wasm +0 -0
  77. package/lib/stats-helper-HM0TaIM5.mjs +95 -0
  78. package/lib/stats-helper-HM0TaIM5.mjs.map +1 -0
  79. package/lib/three.core-CLIofecG.mjs +7629 -0
  80. package/lib/three.core-CLIofecG.mjs.map +1 -0
  81. package/lib/three.module-C4Q1skJQ.mjs +5795 -0
  82. package/lib/three.module-C4Q1skJQ.mjs.map +1 -0
  83. package/lib/three.webgpu-dFspy2yF.mjs +16057 -0
  84. package/lib/three.webgpu-dFspy2yF.mjs.map +1 -0
  85. package/lib/threejs-utils-jEzvlJF1.mjs +2233 -0
  86. package/lib/threejs-utils-jEzvlJF1.mjs.map +1 -0
  87. package/lib/tools-core-CZbPygRC.mjs +30 -0
  88. package/lib/tools-core-CZbPygRC.mjs.map +1 -0
  89. package/package.json +1 -1
  90. package/lib/BufferGeometry-C1o0MiFL.mjs +0 -2064
  91. package/lib/BufferGeometry-C1o0MiFL.mjs.map +0 -1
  92. package/lib/GLTFExporter-CXMBueJw.mjs +0 -1323
  93. package/lib/GLTFExporter-CXMBueJw.mjs.map +0 -1
  94. package/lib/PointLightHelper-ICWLqwjK.mjs +0 -522
  95. package/lib/PointLightHelper-ICWLqwjK.mjs.map +0 -1
  96. package/lib/SpotLightHelper-CW5lDGFp.mjs +0 -222
  97. package/lib/SpotLightHelper-CW5lDGFp.mjs.map +0 -1
  98. package/lib/USDZExporter-CUp3dX08.mjs +0 -552
  99. package/lib/USDZExporter-CUp3dX08.mjs.map +0 -1
  100. package/lib/banana-for-scale-CfQ8dnY2.mjs +0 -50
  101. package/lib/banana-for-scale-CfQ8dnY2.mjs.map +0 -1
  102. package/lib/component-dimensioning-C9AWhxvj.mjs +0 -237
  103. package/lib/component-dimensioning-C9AWhxvj.mjs.map +0 -1
  104. package/lib/continuous-drawing-helper-B5BlbPPz.mjs +0 -48
  105. package/lib/continuous-drawing-helper-B5BlbPPz.mjs.map +0 -1
  106. package/lib/homag-intelligence-UFo9Z8FS.mjs +0 -549
  107. package/lib/homag-intelligence-UFo9Z8FS.mjs.map +0 -1
  108. package/lib/imos-ix-poc-export-helper-CGSk-8yx.mjs +0 -180
  109. package/lib/imos-ix-poc-export-helper-CGSk-8yx.mjs.map +0 -1
  110. package/lib/index-DIyMlQBA.mjs +0 -100947
  111. package/lib/index-DIyMlQBA.mjs.map +0 -1
  112. package/lib/material-viewer-QTlidNBs.mjs +0 -451
  113. package/lib/material-viewer-QTlidNBs.mjs.map +0 -1
  114. package/lib/roomle-sdk.js.map +0 -1
  115. package/lib/static/draco/gltf/draco_decoder.js +0 -33
  116. package/lib/static/draco/gltf/draco_decoder.wasm +0 -0
  117. package/lib/static/draco/gltf/draco_encoder.js +0 -33
  118. package/lib/static/draco/gltf/draco_wasm_wrapper.js +0 -116
  119. package/lib/static/roomle-core-hsc/ConfiguratorKernel.wasm +0 -0
  120. package/lib/static/roomle-core-hsc/RoomleToolsCore.wasm +0 -0
  121. package/lib/static/roomle-core-hsc/embind/configuratorCallback.d.ts +0 -82
  122. package/lib/static/roomle-core-hsc/embind/configuratorCallback.js +0 -355
  123. package/lib/static/roomle-core-hsc/embind/configuratorCallback.js.map +0 -1
  124. package/lib/static/roomle-core-hsc/embind/configuratorCore.d.ts +0 -19
  125. package/lib/static/roomle-core-hsc/embind/configuratorCore.js +0 -50
  126. package/lib/static/roomle-core-hsc/embind/configuratorCore.js.map +0 -1
  127. package/lib/static/roomle-core-hsc/embind/configuratorCoreInterface.d.ts +0 -746
  128. package/lib/static/roomle-core-hsc/embind/configuratorCoreInterface.js +0 -99
  129. package/lib/static/roomle-core-hsc/embind/configuratorCoreInterface.js.map +0 -1
  130. package/lib/static/roomle-core-hsc/embind/configuratorUtils.d.ts +0 -3
  131. package/lib/static/roomle-core-hsc/embind/configuratorUtils.js +0 -52
  132. package/lib/static/roomle-core-hsc/embind/configuratorUtils.js.map +0 -1
  133. package/lib/static/roomle-core-hsc/embind/coreModue.d.ts +0 -4
  134. package/lib/static/roomle-core-hsc/embind/coreModue.js +0 -3
  135. package/lib/static/roomle-core-hsc/embind/coreModue.js.map +0 -1
  136. package/lib/static/roomle-core-hsc/embind/coreModule.d.ts +0 -11
  137. package/lib/static/roomle-core-hsc/embind/coreModule.js +0 -19
  138. package/lib/static/roomle-core-hsc/embind/coreModule.js.map +0 -1
  139. package/lib/static/roomle-core-hsc/embind/plannerCoreInterface.d.ts +0 -851
  140. package/lib/static/roomle-core-hsc/loader/configurableObject.d.ts +0 -30
  141. package/lib/static/roomle-core-hsc/loader/configurableObject.js +0 -111
  142. package/lib/static/roomle-core-hsc/loader/configurableObject.js.map +0 -1
  143. package/lib/static/roomle-core-hsc/loader/configurationGeometryConstructor.d.ts +0 -21
  144. package/lib/static/roomle-core-hsc/loader/configurationGeometryConstructor.js +0 -90
  145. package/lib/static/roomle-core-hsc/loader/configurationGeometryConstructor.js.map +0 -1
  146. package/lib/static/roomle-core-hsc/loader/configurationLoader.d.ts +0 -116
  147. package/lib/static/roomle-core-hsc/loader/configurationLoader.js +0 -345
  148. package/lib/static/roomle-core-hsc/loader/configurationLoader.js.map +0 -1
  149. package/lib/static/roomle-core-hsc/loader/configurationManager.d.ts +0 -41
  150. package/lib/static/roomle-core-hsc/loader/configurationManager.js +0 -147
  151. package/lib/static/roomle-core-hsc/loader/configurationManager.js.map +0 -1
  152. package/lib/static/roomle-core-hsc/loaderUtility.d.ts +0 -81
  153. package/lib/static/roomle-core-hsc/loaderUtility.js +0 -141
  154. package/lib/static/roomle-core-hsc/loaderUtility.js.map +0 -1
  155. package/lib/static/roomle-core-hsc/logger.d.ts +0 -29
  156. package/lib/static/roomle-core-hsc/logger.js +0 -61
  157. package/lib/static/roomle-core-hsc/logger.js.map +0 -1
  158. package/lib/static/roomle-core-hsc/package.json +0 -1
  159. package/lib/static/roomle-core-hsc/planElementManager.d.ts +0 -96
  160. package/lib/static/roomle-core-hsc/planElementManager.js +0 -300
  161. package/lib/static/roomle-core-hsc/planElementManager.js.map +0 -1
  162. package/lib/static/roomle-core-hsc/plannerCore.d.ts +0 -31
  163. package/lib/static/roomle-core-hsc/plannerCore.js +0 -111
  164. package/lib/static/roomle-core-hsc/plannerCore.js.map +0 -1
  165. package/lib/static/roomle-core-hsc/plannerCoreCallback.d.ts +0 -39
  166. package/lib/static/roomle-core-hsc/plannerCoreCallback.js +0 -116
  167. package/lib/static/roomle-core-hsc/plannerCoreCallback.js.map +0 -1
  168. package/lib/static/roomle-core-hsc/plannerCoreInterface.d.ts +0 -851
  169. package/lib/static/roomle-core-hsc/plannerCoreInterface.js +0 -93
  170. package/lib/static/roomle-core-hsc/plannerCoreInterface.js.map +0 -1
  171. package/lib/static/roomle-core-hsc/rapiAccess.d.ts +0 -70
  172. package/lib/static/roomle-core-hsc/rapiAccess.js +0 -227
  173. package/lib/static/roomle-core-hsc/rapiAccess.js.map +0 -1
  174. package/lib/static/roomle-core-hsc/serviceCore.d.ts +0 -20
  175. package/lib/static/roomle-core-hsc/serviceCore.js +0 -54
  176. package/lib/static/roomle-core-hsc/serviceCore.js.map +0 -1
  177. package/lib/static/roomle-core-hsc/serviceCoreInterface.d.ts +0 -13
  178. package/lib/static/roomle-core-hsc/serviceCoreInterface.js +0 -3
  179. package/lib/static/roomle-core-hsc/serviceCoreInterface.js.map +0 -1
  180. package/lib/static/roomle-core-hsc/src/embind/configuratorCallback.d.ts +0 -82
  181. package/lib/static/roomle-core-hsc/src/embind/configuratorCallback.js +0 -355
  182. package/lib/static/roomle-core-hsc/src/embind/configuratorCallback.js.map +0 -1
  183. package/lib/static/roomle-core-hsc/src/embind/configuratorCore.d.ts +0 -19
  184. package/lib/static/roomle-core-hsc/src/embind/configuratorCore.js +0 -50
  185. package/lib/static/roomle-core-hsc/src/embind/configuratorCore.js.map +0 -1
  186. package/lib/static/roomle-core-hsc/src/embind/configuratorCoreInterface.d.ts +0 -746
  187. package/lib/static/roomle-core-hsc/src/embind/configuratorCoreInterface.js +0 -99
  188. package/lib/static/roomle-core-hsc/src/embind/configuratorCoreInterface.js.map +0 -1
  189. package/lib/static/roomle-core-hsc/src/embind/configuratorUtils.d.ts +0 -3
  190. package/lib/static/roomle-core-hsc/src/embind/configuratorUtils.js +0 -52
  191. package/lib/static/roomle-core-hsc/src/embind/configuratorUtils.js.map +0 -1
  192. package/lib/static/roomle-core-hsc/src/embind/coreModue.d.ts +0 -4
  193. package/lib/static/roomle-core-hsc/src/embind/coreModue.js +0 -3
  194. package/lib/static/roomle-core-hsc/src/embind/coreModue.js.map +0 -1
  195. package/lib/static/roomle-core-hsc/src/embind/coreModule.d.ts +0 -11
  196. package/lib/static/roomle-core-hsc/src/embind/coreModule.js +0 -19
  197. package/lib/static/roomle-core-hsc/src/embind/coreModule.js.map +0 -1
  198. package/lib/static/roomle-core-hsc/src/embind/plannerCore.d.ts +0 -31
  199. package/lib/static/roomle-core-hsc/src/embind/plannerCore.js +0 -111
  200. package/lib/static/roomle-core-hsc/src/embind/plannerCore.js.map +0 -1
  201. package/lib/static/roomle-core-hsc/src/embind/plannerCoreCallback.d.ts +0 -39
  202. package/lib/static/roomle-core-hsc/src/embind/plannerCoreCallback.js +0 -116
  203. package/lib/static/roomle-core-hsc/src/embind/plannerCoreCallback.js.map +0 -1
  204. package/lib/static/roomle-core-hsc/src/embind/plannerCoreInterface.js +0 -93
  205. package/lib/static/roomle-core-hsc/src/embind/plannerCoreInterface.js.map +0 -1
  206. package/lib/static/roomle-core-hsc/src/embind/serviceCore.d.ts +0 -20
  207. package/lib/static/roomle-core-hsc/src/embind/serviceCore.js +0 -54
  208. package/lib/static/roomle-core-hsc/src/embind/serviceCore.js.map +0 -1
  209. package/lib/static/roomle-core-hsc/src/embind/serviceCoreInterface.d.ts +0 -13
  210. package/lib/static/roomle-core-hsc/src/embind/serviceCoreInterface.js +0 -3
  211. package/lib/static/roomle-core-hsc/src/embind/serviceCoreInterface.js.map +0 -1
  212. package/lib/static/roomle-core-hsc/src/embind/toolsCore.d.ts +0 -17
  213. package/lib/static/roomle-core-hsc/src/embind/toolsCore.js +0 -75
  214. package/lib/static/roomle-core-hsc/src/embind/toolsCore.js.map +0 -1
  215. package/lib/static/roomle-core-hsc/src/embind/toolsCoreInterface.d.ts +0 -40
  216. package/lib/static/roomle-core-hsc/src/embind/toolsCoreInterface.js +0 -8
  217. package/lib/static/roomle-core-hsc/src/embind/toolsCoreInterface.js.map +0 -1
  218. package/lib/static/roomle-core-hsc/src/loader/configurableObject.d.ts +0 -30
  219. package/lib/static/roomle-core-hsc/src/loader/configurableObject.js +0 -111
  220. package/lib/static/roomle-core-hsc/src/loader/configurableObject.js.map +0 -1
  221. package/lib/static/roomle-core-hsc/src/loader/configurationGeometryConstructor.d.ts +0 -21
  222. package/lib/static/roomle-core-hsc/src/loader/configurationGeometryConstructor.js +0 -90
  223. package/lib/static/roomle-core-hsc/src/loader/configurationGeometryConstructor.js.map +0 -1
  224. package/lib/static/roomle-core-hsc/src/loader/configurationLoader.d.ts +0 -116
  225. package/lib/static/roomle-core-hsc/src/loader/configurationLoader.js +0 -345
  226. package/lib/static/roomle-core-hsc/src/loader/configurationLoader.js.map +0 -1
  227. package/lib/static/roomle-core-hsc/src/loader/configurationManager.d.ts +0 -41
  228. package/lib/static/roomle-core-hsc/src/loader/configurationManager.js +0 -147
  229. package/lib/static/roomle-core-hsc/src/loader/configurationManager.js.map +0 -1
  230. package/lib/static/roomle-core-hsc/src/loader/loaderUtility.d.ts +0 -81
  231. package/lib/static/roomle-core-hsc/src/loader/loaderUtility.js +0 -141
  232. package/lib/static/roomle-core-hsc/src/loader/loaderUtility.js.map +0 -1
  233. package/lib/static/roomle-core-hsc/src/loader/logger.d.ts +0 -29
  234. package/lib/static/roomle-core-hsc/src/loader/logger.js +0 -61
  235. package/lib/static/roomle-core-hsc/src/loader/logger.js.map +0 -1
  236. package/lib/static/roomle-core-hsc/src/loader/planElementManager.d.ts +0 -96
  237. package/lib/static/roomle-core-hsc/src/loader/planElementManager.js +0 -300
  238. package/lib/static/roomle-core-hsc/src/loader/planElementManager.js.map +0 -1
  239. package/lib/static/roomle-core-hsc/src/loader/rapiAccess.d.ts +0 -70
  240. package/lib/static/roomle-core-hsc/src/loader/rapiAccess.js +0 -227
  241. package/lib/static/roomle-core-hsc/src/loader/rapiAccess.js.map +0 -1
  242. package/lib/static/roomle-core-hsc/toolsCore.d.ts +0 -17
  243. package/lib/static/roomle-core-hsc/toolsCore.js +0 -75
  244. package/lib/static/roomle-core-hsc/toolsCore.js.map +0 -1
  245. package/lib/static/roomle-core-hsc/toolsCoreInterface.d.ts +0 -40
  246. package/lib/static/roomle-core-hsc/toolsCoreInterface.js +0 -8
  247. package/lib/static/roomle-core-hsc/toolsCoreInterface.js.map +0 -1
  248. package/lib/static/roomle-core-hsc/wasm_modern/ConfiguratorKernel.js +0 -74
  249. package/lib/static/roomle-core-hsc/wasm_modern/RoomleCore.js +0 -79
  250. package/lib/static/roomle-core-hsc/wasm_modern/RoomleCore.wasm +0 -0
  251. package/lib/static/roomle-core-hsc/wasm_modern/RoomleToolsCore.js +0 -74
  252. package/lib/stats-helper-cTITQsAT.mjs +0 -108
  253. package/lib/stats-helper-cTITQsAT.mjs.map +0 -1
  254. package/lib/tools-core-CCWbo8fD.mjs +0 -36
  255. package/lib/tools-core-CCWbo8fD.mjs.map +0 -1
  256. /package/lib/static/draco/{README.md → node_modules/three/examples/jsm/libs/draco/README.md} +0 -0
  257. /package/lib/static/draco/{draco_decoder.js → node_modules/three/examples/jsm/libs/draco/gltf/draco_decoder.js} +0 -0
  258. /package/lib/static/draco/{draco_decoder.wasm → node_modules/three/examples/jsm/libs/draco/gltf/draco_decoder.wasm} +0 -0
  259. /package/lib/static/draco/{draco_encoder.js → node_modules/three/examples/jsm/libs/draco/gltf/draco_encoder.js} +0 -0
  260. /package/lib/static/draco/{draco_wasm_wrapper.js → node_modules/three/examples/jsm/libs/draco/gltf/draco_wasm_wrapper.js} +0 -0
  261. /package/lib/static/{asset-loader.worker.js → packages/workers/generated/asset-loader.worker.js} +0 -0
  262. /package/lib/static/{budgeteer.sw.js → packages/workers/generated/budgeteer.sw.js} +0 -0
  263. /package/lib/static/roomle-core-hsc/{configuratorCallback.d.ts → node_modules/roomle-core-hsc/src/embind/configuratorCallback.d.ts} +0 -0
  264. /package/lib/static/roomle-core-hsc/{configuratorCallback.js → node_modules/roomle-core-hsc/src/embind/configuratorCallback.js} +0 -0
  265. /package/lib/static/roomle-core-hsc/{configuratorCallback.js.map → node_modules/roomle-core-hsc/src/embind/configuratorCallback.js.map} +0 -0
  266. /package/lib/static/roomle-core-hsc/{configuratorCore.d.ts → node_modules/roomle-core-hsc/src/embind/configuratorCore.d.ts} +0 -0
  267. /package/lib/static/roomle-core-hsc/{configuratorCore.js → node_modules/roomle-core-hsc/src/embind/configuratorCore.js} +0 -0
  268. /package/lib/static/roomle-core-hsc/{configuratorCore.js.map → node_modules/roomle-core-hsc/src/embind/configuratorCore.js.map} +0 -0
  269. /package/lib/static/roomle-core-hsc/{configuratorCoreInterface.d.ts → node_modules/roomle-core-hsc/src/embind/configuratorCoreInterface.d.ts} +0 -0
  270. /package/lib/static/roomle-core-hsc/{configuratorCoreInterface.js → node_modules/roomle-core-hsc/src/embind/configuratorCoreInterface.js} +0 -0
  271. /package/lib/static/roomle-core-hsc/{configuratorCoreInterface.js.map → node_modules/roomle-core-hsc/src/embind/configuratorCoreInterface.js.map} +0 -0
  272. /package/lib/static/roomle-core-hsc/{configuratorUtils.d.ts → node_modules/roomle-core-hsc/src/embind/configuratorUtils.d.ts} +0 -0
  273. /package/lib/static/roomle-core-hsc/{configuratorUtils.js → node_modules/roomle-core-hsc/src/embind/configuratorUtils.js} +0 -0
  274. /package/lib/static/roomle-core-hsc/{configuratorUtils.js.map → node_modules/roomle-core-hsc/src/embind/configuratorUtils.js.map} +0 -0
  275. /package/lib/static/roomle-core-hsc/{coreModue.d.ts → node_modules/roomle-core-hsc/src/embind/coreModue.d.ts} +0 -0
  276. /package/lib/static/roomle-core-hsc/{coreModue.js → node_modules/roomle-core-hsc/src/embind/coreModue.js} +0 -0
  277. /package/lib/static/roomle-core-hsc/{coreModue.js.map → node_modules/roomle-core-hsc/src/embind/coreModue.js.map} +0 -0
  278. /package/lib/static/roomle-core-hsc/{coreModule.d.ts → node_modules/roomle-core-hsc/src/embind/coreModule.d.ts} +0 -0
  279. /package/lib/static/roomle-core-hsc/{coreModule.js → node_modules/roomle-core-hsc/src/embind/coreModule.js} +0 -0
  280. /package/lib/static/roomle-core-hsc/{coreModule.js.map → node_modules/roomle-core-hsc/src/embind/coreModule.js.map} +0 -0
  281. /package/lib/static/roomle-core-hsc/{embind → node_modules/roomle-core-hsc/src/embind}/plannerCore.d.ts +0 -0
  282. /package/lib/static/roomle-core-hsc/{embind → node_modules/roomle-core-hsc/src/embind}/plannerCore.js +0 -0
  283. /package/lib/static/roomle-core-hsc/{embind → node_modules/roomle-core-hsc/src/embind}/plannerCore.js.map +0 -0
  284. /package/lib/static/roomle-core-hsc/{embind → node_modules/roomle-core-hsc/src/embind}/plannerCoreCallback.d.ts +0 -0
  285. /package/lib/static/roomle-core-hsc/{embind → node_modules/roomle-core-hsc/src/embind}/plannerCoreCallback.js +0 -0
  286. /package/lib/static/roomle-core-hsc/{embind → node_modules/roomle-core-hsc/src/embind}/plannerCoreCallback.js.map +0 -0
  287. /package/lib/static/roomle-core-hsc/{embind → node_modules/roomle-core-hsc/src/embind}/plannerCoreInterface.js +0 -0
  288. /package/lib/static/roomle-core-hsc/{embind → node_modules/roomle-core-hsc/src/embind}/plannerCoreInterface.js.map +0 -0
  289. /package/lib/static/roomle-core-hsc/{embind → node_modules/roomle-core-hsc/src/embind}/serviceCore.d.ts +0 -0
  290. /package/lib/static/roomle-core-hsc/{embind → node_modules/roomle-core-hsc/src/embind}/serviceCore.js +0 -0
  291. /package/lib/static/roomle-core-hsc/{embind → node_modules/roomle-core-hsc/src/embind}/serviceCore.js.map +0 -0
  292. /package/lib/static/roomle-core-hsc/{embind → node_modules/roomle-core-hsc/src/embind}/serviceCoreInterface.d.ts +0 -0
  293. /package/lib/static/roomle-core-hsc/{embind → node_modules/roomle-core-hsc/src/embind}/serviceCoreInterface.js +0 -0
  294. /package/lib/static/roomle-core-hsc/{embind → node_modules/roomle-core-hsc/src/embind}/serviceCoreInterface.js.map +0 -0
  295. /package/lib/static/roomle-core-hsc/{embind → node_modules/roomle-core-hsc/src/embind}/toolsCore.d.ts +0 -0
  296. /package/lib/static/roomle-core-hsc/{embind → node_modules/roomle-core-hsc/src/embind}/toolsCore.js +0 -0
  297. /package/lib/static/roomle-core-hsc/{embind → node_modules/roomle-core-hsc/src/embind}/toolsCore.js.map +0 -0
  298. /package/lib/static/roomle-core-hsc/{embind → node_modules/roomle-core-hsc/src/embind}/toolsCoreInterface.d.ts +0 -0
  299. /package/lib/static/roomle-core-hsc/{embind → node_modules/roomle-core-hsc/src/embind}/toolsCoreInterface.js +0 -0
  300. /package/lib/static/roomle-core-hsc/{embind → node_modules/roomle-core-hsc/src/embind}/toolsCoreInterface.js.map +0 -0
  301. /package/lib/static/roomle-core-hsc/{configurableObject.d.ts → node_modules/roomle-core-hsc/src/loader/configurableObject.d.ts} +0 -0
  302. /package/lib/static/roomle-core-hsc/{configurableObject.js → node_modules/roomle-core-hsc/src/loader/configurableObject.js} +0 -0
  303. /package/lib/static/roomle-core-hsc/{configurableObject.js.map → node_modules/roomle-core-hsc/src/loader/configurableObject.js.map} +0 -0
  304. /package/lib/static/roomle-core-hsc/{configurationGeometryConstructor.d.ts → node_modules/roomle-core-hsc/src/loader/configurationGeometryConstructor.d.ts} +0 -0
  305. /package/lib/static/roomle-core-hsc/{configurationGeometryConstructor.js → node_modules/roomle-core-hsc/src/loader/configurationGeometryConstructor.js} +0 -0
  306. /package/lib/static/roomle-core-hsc/{configurationGeometryConstructor.js.map → node_modules/roomle-core-hsc/src/loader/configurationGeometryConstructor.js.map} +0 -0
  307. /package/lib/static/roomle-core-hsc/{configurationLoader.d.ts → node_modules/roomle-core-hsc/src/loader/configurationLoader.d.ts} +0 -0
  308. /package/lib/static/roomle-core-hsc/{configurationLoader.js → node_modules/roomle-core-hsc/src/loader/configurationLoader.js} +0 -0
  309. /package/lib/static/roomle-core-hsc/{configurationLoader.js.map → node_modules/roomle-core-hsc/src/loader/configurationLoader.js.map} +0 -0
  310. /package/lib/static/roomle-core-hsc/{configurationManager.d.ts → node_modules/roomle-core-hsc/src/loader/configurationManager.d.ts} +0 -0
  311. /package/lib/static/roomle-core-hsc/{configurationManager.js → node_modules/roomle-core-hsc/src/loader/configurationManager.js} +0 -0
  312. /package/lib/static/roomle-core-hsc/{configurationManager.js.map → node_modules/roomle-core-hsc/src/loader/configurationManager.js.map} +0 -0
  313. /package/lib/static/roomle-core-hsc/{loader → node_modules/roomle-core-hsc/src/loader}/loaderUtility.d.ts +0 -0
  314. /package/lib/static/roomle-core-hsc/{loader → node_modules/roomle-core-hsc/src/loader}/loaderUtility.js +0 -0
  315. /package/lib/static/roomle-core-hsc/{loader → node_modules/roomle-core-hsc/src/loader}/loaderUtility.js.map +0 -0
  316. /package/lib/static/roomle-core-hsc/{loader → node_modules/roomle-core-hsc/src/loader}/logger.d.ts +0 -0
  317. /package/lib/static/roomle-core-hsc/{loader → node_modules/roomle-core-hsc/src/loader}/logger.js +0 -0
  318. /package/lib/static/roomle-core-hsc/{loader → node_modules/roomle-core-hsc/src/loader}/logger.js.map +0 -0
  319. /package/lib/static/roomle-core-hsc/{loader → node_modules/roomle-core-hsc/src/loader}/planElementManager.d.ts +0 -0
  320. /package/lib/static/roomle-core-hsc/{loader → node_modules/roomle-core-hsc/src/loader}/planElementManager.js +0 -0
  321. /package/lib/static/roomle-core-hsc/{loader → node_modules/roomle-core-hsc/src/loader}/planElementManager.js.map +0 -0
  322. /package/lib/static/roomle-core-hsc/{loader → node_modules/roomle-core-hsc/src/loader}/rapiAccess.d.ts +0 -0
  323. /package/lib/static/roomle-core-hsc/{loader → node_modules/roomle-core-hsc/src/loader}/rapiAccess.js +0 -0
  324. /package/lib/static/roomle-core-hsc/{loader → node_modules/roomle-core-hsc/src/loader}/rapiAccess.js.map +0 -0
  325. /package/lib/static/roomle-core-hsc/{ConfiguratorKernel.js → node_modules/roomle-core-hsc/wasm_modern/ConfiguratorKernel.js} +0 -0
  326. /package/lib/static/roomle-core-hsc/{RoomleCore.js → node_modules/roomle-core-hsc/wasm_modern/RoomleCore.js} +0 -0
  327. /package/lib/static/roomle-core-hsc/{RoomleToolsCore.js → node_modules/roomle-core-hsc/wasm_modern/RoomleToolsCore.js} +0 -0
@@ -1,1323 +0,0 @@
1
- import { f as $, aK as Z, as as z, aL as ee, ay as b, aM as se, aN as B, aO as te, aJ as ne, aP as H, aQ as ie, aR as re, j as oe, aS as D, aT as ae, aU as Y, aV as ce, aW as le, aX as ue, aY as he, aZ as fe, a_ as pe, a$ as de, b0 as xe, b1 as ye, b2 as ge, b3 as Te } from "./index-DIyMlQBA.mjs";
2
- const K = {
3
- POSITION: [
4
- "byte",
5
- "byte normalized",
6
- "unsigned byte",
7
- "unsigned byte normalized",
8
- "short",
9
- "short normalized",
10
- "unsigned short",
11
- "unsigned short normalized"
12
- ],
13
- NORMAL: [
14
- "byte normalized",
15
- "short normalized"
16
- ],
17
- TANGENT: [
18
- "byte normalized",
19
- "short normalized"
20
- ],
21
- TEXCOORD: [
22
- "byte",
23
- "byte normalized",
24
- "unsigned byte",
25
- "short",
26
- "short normalized",
27
- "unsigned short"
28
- ]
29
- };
30
- class O {
31
- /**
32
- * Constructs a new glTF exporter.
33
- */
34
- constructor() {
35
- this.textureUtils = null, this.pluginCallbacks = [], this.register(function(e) {
36
- return new _e(e);
37
- }), this.register(function(e) {
38
- return new be(e);
39
- }), this.register(function(e) {
40
- return new ve(e);
41
- }), this.register(function(e) {
42
- return new Oe(e);
43
- }), this.register(function(e) {
44
- return new ze(e);
45
- }), this.register(function(e) {
46
- return new De(e);
47
- }), this.register(function(e) {
48
- return new Ce(e);
49
- }), this.register(function(e) {
50
- return new Ue(e);
51
- }), this.register(function(e) {
52
- return new Fe(e);
53
- }), this.register(function(e) {
54
- return new Pe(e);
55
- }), this.register(function(e) {
56
- return new Be(e);
57
- }), this.register(function(e) {
58
- return new Ge(e);
59
- }), this.register(function(e) {
60
- return new ke(e);
61
- }), this.register(function(e) {
62
- return new He(e);
63
- });
64
- }
65
- /**
66
- * Registers a plugin callback. This API is internally used to implement the various
67
- * glTF extensions but can also used by third-party code to add additional logic
68
- * to the exporter.
69
- *
70
- * @param {function(writer:GLTFWriter)} callback - The callback function to register.
71
- * @return {GLTFExporter} A reference to this exporter.
72
- */
73
- register(e) {
74
- return this.pluginCallbacks.indexOf(e) === -1 && this.pluginCallbacks.push(e), this;
75
- }
76
- /**
77
- * Unregisters a plugin callback.
78
- *
79
- * @param {Function} callback - The callback function to unregister.
80
- * @return {GLTFExporter} A reference to this exporter.
81
- */
82
- unregister(e) {
83
- return this.pluginCallbacks.indexOf(e) !== -1 && this.pluginCallbacks.splice(this.pluginCallbacks.indexOf(e), 1), this;
84
- }
85
- /**
86
- * Sets the texture utils for this exporter. Only relevant when compressed textures have to be exported.
87
- *
88
- * Depending on whether you use {@link WebGLRenderer} or {@link WebGPURenderer}, you must inject the
89
- * corresponding texture utils {@link WebGLTextureUtils} or {@link WebGPUTextureUtils}.
90
- *
91
- * @param {WebGLTextureUtils|WebGPUTextureUtils} utils - The texture utils.
92
- * @return {GLTFExporter} A reference to this exporter.
93
- */
94
- setTextureUtils(e) {
95
- return this.textureUtils = e, this;
96
- }
97
- /**
98
- * Parses the given scenes and generates the glTF output.
99
- *
100
- * @param {Scene|Array<Scene>} input - A scene or an array of scenes.
101
- * @param {GLTFExporter~OnDone} onDone - A callback function that is executed when the export has finished.
102
- * @param {GLTFExporter~OnError} onError - A callback function that is executed when an error happens.
103
- * @param {GLTFExporter~Options} options - options
104
- */
105
- parse(e, s, r, t) {
106
- const n = new Le(), i = [];
107
- for (let o = 0, c = this.pluginCallbacks.length; o < c; o++)
108
- i.push(this.pluginCallbacks[o](n));
109
- n.setPlugins(i), n.setTextureUtils(this.textureUtils), n.writeAsync(e, s, t).catch(r);
110
- }
111
- /**
112
- * Async version of {@link GLTFExporter#parse}.
113
- *
114
- * @param {Scene|Array<Scene>} input - A scene or an array of scenes.
115
- * @param {GLTFExporter~Options} options - options.
116
- * @return {Promise<ArrayBuffer|string>} A Promise that resolved with the exported glTF data.
117
- */
118
- parseAsync(e, s) {
119
- const r = this;
120
- return new Promise(function(t, n) {
121
- r.parse(e, t, n, s);
122
- });
123
- }
124
- }
125
- const T = {
126
- POINTS: 0,
127
- LINES: 1,
128
- LINE_LOOP: 2,
129
- LINE_STRIP: 3,
130
- TRIANGLES: 4,
131
- BYTE: 5120,
132
- UNSIGNED_BYTE: 5121,
133
- SHORT: 5122,
134
- UNSIGNED_SHORT: 5123,
135
- INT: 5124,
136
- UNSIGNED_INT: 5125,
137
- FLOAT: 5126,
138
- ARRAY_BUFFER: 34962,
139
- ELEMENT_ARRAY_BUFFER: 34963,
140
- NEAREST: 9728,
141
- LINEAR: 9729,
142
- NEAREST_MIPMAP_NEAREST: 9984,
143
- LINEAR_MIPMAP_NEAREST: 9985,
144
- NEAREST_MIPMAP_LINEAR: 9986,
145
- LINEAR_MIPMAP_LINEAR: 9987,
146
- CLAMP_TO_EDGE: 33071,
147
- MIRRORED_REPEAT: 33648,
148
- REPEAT: 10497
149
- }, G = "KHR_mesh_quantization", N = {};
150
- N[le] = T.NEAREST;
151
- N[ue] = T.NEAREST_MIPMAP_NEAREST;
152
- N[he] = T.NEAREST_MIPMAP_LINEAR;
153
- N[fe] = T.LINEAR;
154
- N[pe] = T.LINEAR_MIPMAP_NEAREST;
155
- N[de] = T.LINEAR_MIPMAP_LINEAR;
156
- N[xe] = T.CLAMP_TO_EDGE;
157
- N[ye] = T.REPEAT;
158
- N[ge] = T.MIRRORED_REPEAT;
159
- const W = {
160
- scale: "scale",
161
- position: "translation",
162
- quaternion: "rotation",
163
- morphTargetInfluences: "weights"
164
- }, we = new $(), q = 12, me = 1179937895, Me = 2, X = 8, Ae = 1313821514, Ee = 5130562;
165
- function L(a, e) {
166
- return a.length === e.length && a.every(function(s, r) {
167
- return s === e[r];
168
- });
169
- }
170
- function Ie(a) {
171
- return new TextEncoder().encode(a).buffer;
172
- }
173
- function Re(a) {
174
- return L(a.elements, [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1]);
175
- }
176
- function Ne(a, e, s) {
177
- const r = {
178
- min: new Array(a.itemSize).fill(Number.POSITIVE_INFINITY),
179
- max: new Array(a.itemSize).fill(Number.NEGATIVE_INFINITY)
180
- };
181
- for (let t = e; t < e + s; t++)
182
- for (let n = 0; n < a.itemSize; n++) {
183
- let i;
184
- a.itemSize > 4 ? i = a.array[t * a.itemSize + n] : (n === 0 ? i = a.getX(t) : n === 1 ? i = a.getY(t) : n === 2 ? i = a.getZ(t) : n === 3 && (i = a.getW(t)), a.normalized === !0 && (i = H.normalize(i, a.array))), r.min[n] = Math.min(r.min[n], i), r.max[n] = Math.max(r.max[n], i);
185
- }
186
- return r;
187
- }
188
- function j(a) {
189
- return Math.ceil(a / 4) * 4;
190
- }
191
- function k(a, e = 0) {
192
- const s = j(a.byteLength);
193
- if (s !== a.byteLength) {
194
- const r = new Uint8Array(s);
195
- if (r.set(new Uint8Array(a)), e !== 0)
196
- for (let t = a.byteLength; t < s; t++)
197
- r[t] = e;
198
- return r.buffer;
199
- }
200
- return a;
201
- }
202
- function J() {
203
- return typeof document > "u" && typeof OffscreenCanvas < "u" ? new OffscreenCanvas(1, 1) : document.createElement("canvas");
204
- }
205
- function Se(a, e) {
206
- if (typeof OffscreenCanvas < "u" && a instanceof OffscreenCanvas) {
207
- let s;
208
- return e === "image/jpeg" ? s = 0.92 : e === "image/webp" && (s = 0.8), a.convertToBlob({
209
- type: e,
210
- quality: s
211
- });
212
- } else
213
- return new Promise((s) => a.toBlob(s, e));
214
- }
215
- class Le {
216
- constructor() {
217
- this.plugins = [], this.options = {}, this.pending = [], this.buffers = [], this.byteOffset = 0, this.buffers = [], this.nodeMap = /* @__PURE__ */ new Map(), this.skins = [], this.extensionsUsed = {}, this.extensionsRequired = {}, this.uids = /* @__PURE__ */ new Map(), this.uid = 0, this.json = {
218
- asset: {
219
- version: "2.0",
220
- generator: "THREE.GLTFExporter r" + se
221
- }
222
- }, this.cache = {
223
- meshes: /* @__PURE__ */ new Map(),
224
- attributes: /* @__PURE__ */ new Map(),
225
- attributesNormalized: /* @__PURE__ */ new Map(),
226
- materials: /* @__PURE__ */ new Map(),
227
- textures: /* @__PURE__ */ new Map(),
228
- images: /* @__PURE__ */ new Map()
229
- }, this.textureUtils = null;
230
- }
231
- setPlugins(e) {
232
- this.plugins = e;
233
- }
234
- setTextureUtils(e) {
235
- this.textureUtils = e;
236
- }
237
- /**
238
- * Parse scenes and generate GLTF output
239
- *
240
- * @param {Scene|Array<Scene>} input Scene or Array of THREE.Scenes
241
- * @param {Function} onDone Callback on completed
242
- * @param {Object} options options
243
- */
244
- async writeAsync(e, s, r = {}) {
245
- this.options = Object.assign({
246
- // default options
247
- binary: !1,
248
- trs: !1,
249
- onlyVisible: !0,
250
- maxTextureSize: 1 / 0,
251
- animations: [],
252
- includeCustomExtensions: !1
253
- }, r), this.options.animations.length > 0 && (this.options.trs = !0), await this.processInputAsync(e), await Promise.all(this.pending);
254
- const t = this, n = t.buffers, i = t.json;
255
- r = t.options;
256
- const o = t.extensionsUsed, c = t.extensionsRequired, u = new Blob(n, { type: "application/octet-stream" }), f = Object.keys(o), l = Object.keys(c);
257
- if (f.length > 0 && (i.extensionsUsed = f), l.length > 0 && (i.extensionsRequired = l), i.buffers && i.buffers.length > 0 && (i.buffers[0].byteLength = u.size), r.binary === !0) {
258
- const g = new FileReader();
259
- g.readAsArrayBuffer(u), g.onloadend = function() {
260
- const h = k(g.result), x = new DataView(new ArrayBuffer(X));
261
- x.setUint32(0, h.byteLength, !0), x.setUint32(4, Ee, !0);
262
- const p = k(Ie(JSON.stringify(i)), 32), d = new DataView(new ArrayBuffer(X));
263
- d.setUint32(0, p.byteLength, !0), d.setUint32(4, Ae, !0);
264
- const m = new ArrayBuffer(q), A = new DataView(m);
265
- A.setUint32(0, me, !0), A.setUint32(4, Me, !0);
266
- const _ = q + d.byteLength + p.byteLength + x.byteLength + h.byteLength;
267
- A.setUint32(8, _, !0);
268
- const y = new Blob([
269
- m,
270
- d,
271
- p,
272
- x,
273
- h
274
- ], { type: "application/octet-stream" }), w = new FileReader();
275
- w.readAsArrayBuffer(y), w.onloadend = function() {
276
- s(w.result);
277
- };
278
- };
279
- } else if (i.buffers && i.buffers.length > 0) {
280
- const g = new FileReader();
281
- g.readAsDataURL(u), g.onloadend = function() {
282
- const h = g.result;
283
- i.buffers[0].uri = h, s(i);
284
- };
285
- } else
286
- s(i);
287
- }
288
- /**
289
- * Serializes a userData.
290
- *
291
- * @param {THREE.Object3D|THREE.Material|THREE.BufferGeometry|THREE.AnimationClip} object
292
- * @param {Object} objectDef
293
- */
294
- serializeUserData(e, s) {
295
- if (Object.keys(e.userData).length === 0) return;
296
- const r = this.options, t = this.extensionsUsed;
297
- try {
298
- const n = JSON.parse(JSON.stringify(e.userData));
299
- if (r.includeCustomExtensions && n.gltfExtensions) {
300
- s.extensions === void 0 && (s.extensions = {});
301
- for (const i in n.gltfExtensions)
302
- s.extensions[i] = n.gltfExtensions[i], t[i] = !0;
303
- delete n.gltfExtensions;
304
- }
305
- Object.keys(n).length > 0 && (s.extras = n);
306
- } catch (n) {
307
- console.warn("THREE.GLTFExporter: userData of '" + e.name + "' won't be serialized because of JSON.stringify error - " + n.message);
308
- }
309
- }
310
- /**
311
- * Returns ids for buffer attributes.
312
- *
313
- * @param {Object} attribute
314
- * @param {boolean} [isRelativeCopy=false]
315
- * @return {number} An integer
316
- */
317
- getUID(e, s = !1) {
318
- if (this.uids.has(e) === !1) {
319
- const t = /* @__PURE__ */ new Map();
320
- t.set(!0, this.uid++), t.set(!1, this.uid++), this.uids.set(e, t);
321
- }
322
- return this.uids.get(e).get(s);
323
- }
324
- /**
325
- * Checks if normal attribute values are normalized.
326
- *
327
- * @param {BufferAttribute} normal
328
- * @returns {boolean}
329
- */
330
- isNormalizedNormalAttribute(e) {
331
- if (this.cache.attributesNormalized.has(e)) return !1;
332
- const r = new z();
333
- for (let t = 0, n = e.count; t < n; t++)
334
- if (Math.abs(r.fromBufferAttribute(e, t).length() - 1) > 5e-4) return !1;
335
- return !0;
336
- }
337
- /**
338
- * Creates normalized normal buffer attribute.
339
- *
340
- * @param {BufferAttribute} normal
341
- * @returns {BufferAttribute}
342
- *
343
- */
344
- createNormalizedNormalAttribute(e) {
345
- const s = this.cache;
346
- if (s.attributesNormalized.has(e)) return s.attributesNormalized.get(e);
347
- const r = e.clone(), t = new z();
348
- for (let n = 0, i = r.count; n < i; n++)
349
- t.fromBufferAttribute(r, n), t.x === 0 && t.y === 0 && t.z === 0 ? t.setX(1) : t.normalize(), r.setXYZ(n, t.x, t.y, t.z);
350
- return s.attributesNormalized.set(e, r), r;
351
- }
352
- /**
353
- * Applies a texture transform, if present, to the map definition. Requires
354
- * the KHR_texture_transform extension.
355
- *
356
- * @param {Object} mapDef
357
- * @param {THREE.Texture} texture
358
- */
359
- applyTextureTransform(e, s) {
360
- let r = !1;
361
- const t = {};
362
- (s.offset.x !== 0 || s.offset.y !== 0) && (t.offset = s.offset.toArray(), r = !0), s.rotation !== 0 && (t.rotation = s.rotation, r = !0), (s.repeat.x !== 1 || s.repeat.y !== 1) && (t.scale = s.repeat.toArray(), r = !0), r && (e.extensions = e.extensions || {}, e.extensions.KHR_texture_transform = t, this.extensionsUsed.KHR_texture_transform = !0);
363
- }
364
- async buildMetalRoughTextureAsync(e, s) {
365
- if (e === s) return e;
366
- function r(h) {
367
- return h.colorSpace === ce ? function(p) {
368
- return p < 0.04045 ? p * 0.0773993808 : Math.pow(p * 0.9478672986 + 0.0521327014, 2.4);
369
- } : function(p) {
370
- return p;
371
- };
372
- }
373
- e instanceof B && (e = await this.decompressTextureAsync(e)), s instanceof B && (s = await this.decompressTextureAsync(s));
374
- const t = e ? e.image : null, n = s ? s.image : null, i = Math.max(t ? t.width : 0, n ? n.width : 0), o = Math.max(t ? t.height : 0, n ? n.height : 0), c = J();
375
- c.width = i, c.height = o;
376
- const u = c.getContext("2d", {
377
- willReadFrequently: !0
378
- });
379
- u.fillStyle = "#00ffff", u.fillRect(0, 0, i, o);
380
- const f = u.getImageData(0, 0, i, o);
381
- if (t) {
382
- u.drawImage(t, 0, 0, i, o);
383
- const h = r(e), x = u.getImageData(0, 0, i, o).data;
384
- for (let p = 2; p < x.length; p += 4)
385
- f.data[p] = h(x[p] / 256) * 256;
386
- }
387
- if (n) {
388
- u.drawImage(n, 0, 0, i, o);
389
- const h = r(s), x = u.getImageData(0, 0, i, o).data;
390
- for (let p = 1; p < x.length; p += 4)
391
- f.data[p] = h(x[p] / 256) * 256;
392
- }
393
- u.putImageData(f, 0, 0);
394
- const g = (e || s).clone();
395
- return g.source = new te(c), g.colorSpace = ne, g.channel = (e || s).channel, e && s && e.channel !== s.channel && console.warn("THREE.GLTFExporter: UV channels for metalnessMap and roughnessMap textures must match."), console.warn("THREE.GLTFExporter: Merged metalnessMap and roughnessMap textures."), g;
396
- }
397
- async decompressTextureAsync(e, s = 1 / 0) {
398
- if (this.textureUtils === null)
399
- throw new Error("THREE.GLTFExporter: setTextureUtils() must be called to process compressed textures.");
400
- return await this.textureUtils.decompress(e, s);
401
- }
402
- /**
403
- * Process a buffer to append to the default one.
404
- * @param {ArrayBuffer} buffer
405
- * @return {0}
406
- */
407
- processBuffer(e) {
408
- const s = this.json, r = this.buffers;
409
- return s.buffers || (s.buffers = [{ byteLength: 0 }]), r.push(e), 0;
410
- }
411
- /**
412
- * Process and generate a BufferView
413
- * @param {BufferAttribute} attribute
414
- * @param {number} componentType
415
- * @param {number} start
416
- * @param {number} count
417
- * @param {number} [target] Target usage of the BufferView
418
- * @return {Object}
419
- */
420
- processBufferView(e, s, r, t, n) {
421
- const i = this.json;
422
- i.bufferViews || (i.bufferViews = []);
423
- let o;
424
- switch (s) {
425
- case T.BYTE:
426
- case T.UNSIGNED_BYTE:
427
- o = 1;
428
- break;
429
- case T.SHORT:
430
- case T.UNSIGNED_SHORT:
431
- o = 2;
432
- break;
433
- default:
434
- o = 4;
435
- }
436
- let c = e.itemSize * o;
437
- n === T.ARRAY_BUFFER && (c = Math.ceil(c / 4) * 4);
438
- const u = j(t * c), f = new DataView(new ArrayBuffer(u));
439
- let l = 0;
440
- for (let x = r; x < r + t; x++) {
441
- for (let p = 0; p < e.itemSize; p++) {
442
- let d;
443
- e.itemSize > 4 ? d = e.array[x * e.itemSize + p] : (p === 0 ? d = e.getX(x) : p === 1 ? d = e.getY(x) : p === 2 ? d = e.getZ(x) : p === 3 && (d = e.getW(x)), e.normalized === !0 && (d = H.normalize(d, e.array))), s === T.FLOAT ? f.setFloat32(l, d, !0) : s === T.INT ? f.setInt32(l, d, !0) : s === T.UNSIGNED_INT ? f.setUint32(l, d, !0) : s === T.SHORT ? f.setInt16(l, d, !0) : s === T.UNSIGNED_SHORT ? f.setUint16(l, d, !0) : s === T.BYTE ? f.setInt8(l, d) : s === T.UNSIGNED_BYTE && f.setUint8(l, d), l += o;
444
- }
445
- l % c !== 0 && (l += c - l % c);
446
- }
447
- const g = {
448
- buffer: this.processBuffer(f.buffer),
449
- byteOffset: this.byteOffset,
450
- byteLength: u
451
- };
452
- return n !== void 0 && (g.target = n), n === T.ARRAY_BUFFER && (g.byteStride = c), this.byteOffset += u, i.bufferViews.push(g), {
453
- id: i.bufferViews.length - 1,
454
- byteLength: 0
455
- };
456
- }
457
- /**
458
- * Process and generate a BufferView from an image Blob.
459
- * @param {Blob} blob
460
- * @return {Promise<number>} An integer
461
- */
462
- processBufferViewImage(e) {
463
- const s = this, r = s.json;
464
- return r.bufferViews || (r.bufferViews = []), new Promise(function(t) {
465
- const n = new FileReader();
466
- n.readAsArrayBuffer(e), n.onloadend = function() {
467
- const i = k(n.result), o = {
468
- buffer: s.processBuffer(i),
469
- byteOffset: s.byteOffset,
470
- byteLength: i.byteLength
471
- };
472
- s.byteOffset += i.byteLength, t(r.bufferViews.push(o) - 1);
473
- };
474
- });
475
- }
476
- /**
477
- * Process attribute to generate an accessor
478
- * @param {BufferAttribute} attribute Attribute to process
479
- * @param {?BufferGeometry} [geometry] Geometry used for truncated draw range
480
- * @param {number} [start=0]
481
- * @param {number} [count=Infinity]
482
- * @return {?number} Index of the processed accessor on the "accessors" array
483
- */
484
- processAccessor(e, s, r, t) {
485
- const n = this.json, i = {
486
- 1: "SCALAR",
487
- 2: "VEC2",
488
- 3: "VEC3",
489
- 4: "VEC4",
490
- 9: "MAT3",
491
- 16: "MAT4"
492
- };
493
- let o;
494
- if (e.array.constructor === Float32Array)
495
- o = T.FLOAT;
496
- else if (e.array.constructor === Int32Array)
497
- o = T.INT;
498
- else if (e.array.constructor === Uint32Array)
499
- o = T.UNSIGNED_INT;
500
- else if (e.array.constructor === Int16Array)
501
- o = T.SHORT;
502
- else if (e.array.constructor === Uint16Array)
503
- o = T.UNSIGNED_SHORT;
504
- else if (e.array.constructor === Int8Array)
505
- o = T.BYTE;
506
- else if (e.array.constructor === Uint8Array)
507
- o = T.UNSIGNED_BYTE;
508
- else
509
- throw new Error("THREE.GLTFExporter: Unsupported bufferAttribute component type: " + e.array.constructor.name);
510
- if (r === void 0 && (r = 0), (t === void 0 || t === 1 / 0) && (t = e.count), t === 0) return null;
511
- const c = Ne(e, r, t);
512
- let u;
513
- s !== void 0 && (u = e === s.index ? T.ELEMENT_ARRAY_BUFFER : T.ARRAY_BUFFER);
514
- const f = this.processBufferView(e, o, r, t, u), l = {
515
- bufferView: f.id,
516
- byteOffset: f.byteOffset,
517
- componentType: o,
518
- count: t,
519
- max: c.max,
520
- min: c.min,
521
- type: i[e.itemSize]
522
- };
523
- return e.normalized === !0 && (l.normalized = !0), n.accessors || (n.accessors = []), n.accessors.push(l) - 1;
524
- }
525
- /**
526
- * Process image
527
- * @param {Image} image to process
528
- * @param {number} format Identifier of the format (RGBAFormat)
529
- * @param {boolean} flipY before writing out the image
530
- * @param {string} mimeType export format
531
- * @return {number} Index of the processed texture in the "images" array
532
- */
533
- processImage(e, s, r, t = "image/png") {
534
- if (e !== null) {
535
- const n = this, i = n.cache, o = n.json, c = n.options, u = n.pending;
536
- i.images.has(e) || i.images.set(e, {});
537
- const f = i.images.get(e), l = t + ":flipY/" + r.toString();
538
- if (f[l] !== void 0) return f[l];
539
- o.images || (o.images = []);
540
- const g = { mimeType: t }, h = J();
541
- h.width = Math.min(e.width, c.maxTextureSize), h.height = Math.min(e.height, c.maxTextureSize);
542
- const x = h.getContext("2d", {
543
- willReadFrequently: !0
544
- });
545
- if (r === !0 && (x.translate(0, h.height), x.scale(1, -1)), e.data !== void 0) {
546
- s !== ie && console.error("GLTFExporter: Only RGBAFormat is supported.", s), (e.width > c.maxTextureSize || e.height > c.maxTextureSize) && console.warn("GLTFExporter: Image size is bigger than maxTextureSize", e);
547
- const d = new Uint8ClampedArray(e.height * e.width * 4);
548
- for (let m = 0; m < d.length; m += 4)
549
- d[m + 0] = e.data[m + 0], d[m + 1] = e.data[m + 1], d[m + 2] = e.data[m + 2], d[m + 3] = e.data[m + 3];
550
- x.putImageData(new ImageData(d, e.width, e.height), 0, 0);
551
- } else if (typeof HTMLImageElement < "u" && e instanceof HTMLImageElement || typeof HTMLCanvasElement < "u" && e instanceof HTMLCanvasElement || typeof ImageBitmap < "u" && e instanceof ImageBitmap || typeof OffscreenCanvas < "u" && e instanceof OffscreenCanvas)
552
- x.drawImage(e, 0, 0, h.width, h.height);
553
- else
554
- throw new Error("THREE.GLTFExporter: Invalid image type. Use HTMLImageElement, HTMLCanvasElement, ImageBitmap or OffscreenCanvas.");
555
- c.binary === !0 ? u.push(
556
- Se(h, t).then((d) => n.processBufferViewImage(d)).then((d) => {
557
- g.bufferView = d;
558
- })
559
- ) : g.uri = re.getDataURL(h, t);
560
- const p = o.images.push(g) - 1;
561
- return f[l] = p, p;
562
- } else
563
- throw new Error("THREE.GLTFExporter: No valid image data found. Unable to process texture.");
564
- }
565
- /**
566
- * Process sampler
567
- * @param {Texture} map Texture to process
568
- * @return {number} Index of the processed texture in the "samplers" array
569
- */
570
- processSampler(e) {
571
- const s = this.json;
572
- s.samplers || (s.samplers = []);
573
- const r = {
574
- magFilter: N[e.magFilter],
575
- minFilter: N[e.minFilter],
576
- wrapS: N[e.wrapS],
577
- wrapT: N[e.wrapT]
578
- };
579
- return s.samplers.push(r) - 1;
580
- }
581
- /**
582
- * Process texture
583
- * @param {Texture} map Map to process
584
- * @return {Promise<number>} Index of the processed texture in the "textures" array
585
- */
586
- async processTextureAsync(e) {
587
- const r = this.options, t = this.cache, n = this.json;
588
- if (t.textures.has(e)) return t.textures.get(e);
589
- n.textures || (n.textures = []), e instanceof B && (e = await this.decompressTextureAsync(e, r.maxTextureSize));
590
- let i = e.userData.mimeType;
591
- i === "image/webp" && (i = "image/png");
592
- const o = {
593
- sampler: this.processSampler(e),
594
- source: this.processImage(e.image, e.format, e.flipY, i)
595
- };
596
- e.name && (o.name = e.name), await this._invokeAllAsync(async function(u) {
597
- u.writeTexture && await u.writeTexture(e, o);
598
- });
599
- const c = n.textures.push(o) - 1;
600
- return t.textures.set(e, c), c;
601
- }
602
- /**
603
- * Process material
604
- * @param {THREE.Material} material Material to process
605
- * @return {Promise<?number>} Index of the processed material in the "materials" array
606
- */
607
- async processMaterialAsync(e) {
608
- const s = this.cache, r = this.json;
609
- if (s.materials.has(e)) return s.materials.get(e);
610
- if (e.isShaderMaterial)
611
- return console.warn("GLTFExporter: THREE.ShaderMaterial not supported."), null;
612
- r.materials || (r.materials = []);
613
- const t = { pbrMetallicRoughness: {} };
614
- e.isMeshStandardMaterial !== !0 && e.isMeshBasicMaterial !== !0 && console.warn("GLTFExporter: Use MeshStandardMaterial or MeshBasicMaterial for best results.");
615
- const n = e.color.toArray().concat([e.opacity]);
616
- if (L(n, [1, 1, 1, 1]) || (t.pbrMetallicRoughness.baseColorFactor = n), e.isMeshStandardMaterial ? (t.pbrMetallicRoughness.metallicFactor = e.metalness, t.pbrMetallicRoughness.roughnessFactor = e.roughness) : (t.pbrMetallicRoughness.metallicFactor = 0, t.pbrMetallicRoughness.roughnessFactor = 1), e.metalnessMap || e.roughnessMap) {
617
- const o = await this.buildMetalRoughTextureAsync(e.metalnessMap, e.roughnessMap), c = {
618
- index: await this.processTextureAsync(o),
619
- texCoord: o.channel
620
- };
621
- this.applyTextureTransform(c, o), t.pbrMetallicRoughness.metallicRoughnessTexture = c;
622
- }
623
- if (e.map) {
624
- const o = {
625
- index: await this.processTextureAsync(e.map),
626
- texCoord: e.map.channel
627
- };
628
- this.applyTextureTransform(o, e.map), t.pbrMetallicRoughness.baseColorTexture = o;
629
- }
630
- if (e.emissive) {
631
- const o = e.emissive;
632
- if (Math.max(o.r, o.g, o.b) > 0 && (t.emissiveFactor = e.emissive.toArray()), e.emissiveMap) {
633
- const u = {
634
- index: await this.processTextureAsync(e.emissiveMap),
635
- texCoord: e.emissiveMap.channel
636
- };
637
- this.applyTextureTransform(u, e.emissiveMap), t.emissiveTexture = u;
638
- }
639
- }
640
- if (e.normalMap) {
641
- const o = {
642
- index: await this.processTextureAsync(e.normalMap),
643
- texCoord: e.normalMap.channel
644
- };
645
- e.normalScale && e.normalScale.x !== 1 && (o.scale = e.normalScale.x), this.applyTextureTransform(o, e.normalMap), t.normalTexture = o;
646
- }
647
- if (e.aoMap) {
648
- const o = {
649
- index: await this.processTextureAsync(e.aoMap),
650
- texCoord: e.aoMap.channel
651
- };
652
- e.aoMapIntensity !== 1 && (o.strength = e.aoMapIntensity), this.applyTextureTransform(o, e.aoMap), t.occlusionTexture = o;
653
- }
654
- e.transparent ? t.alphaMode = "BLEND" : e.alphaTest > 0 && (t.alphaMode = "MASK", t.alphaCutoff = e.alphaTest), e.side === oe && (t.doubleSided = !0), e.name !== "" && (t.name = e.name), this.serializeUserData(e, t), await this._invokeAllAsync(async function(o) {
655
- o.writeMaterialAsync && await o.writeMaterialAsync(e, t);
656
- });
657
- const i = r.materials.push(t) - 1;
658
- return s.materials.set(e, i), i;
659
- }
660
- /**
661
- * Process mesh
662
- * @param {THREE.Mesh} mesh Mesh to process
663
- * @return {Promise<?number>} Index of the processed mesh in the "meshes" array
664
- */
665
- async processMeshAsync(e) {
666
- const s = this.cache, r = this.json, t = [e.geometry.uuid];
667
- if (Array.isArray(e.material))
668
- for (let y = 0, w = e.material.length; y < w; y++)
669
- t.push(e.material[y].uuid);
670
- else
671
- t.push(e.material.uuid);
672
- const n = t.join(":");
673
- if (s.meshes.has(n)) return s.meshes.get(n);
674
- const i = e.geometry;
675
- let o;
676
- e.isLineSegments ? o = T.LINES : e.isLineLoop ? o = T.LINE_LOOP : e.isLine ? o = T.LINE_STRIP : e.isPoints ? o = T.POINTS : o = e.material.wireframe ? T.LINES : T.TRIANGLES;
677
- const c = {}, u = {}, f = [], l = [], g = {
678
- uv: "TEXCOORD_0",
679
- uv1: "TEXCOORD_1",
680
- uv2: "TEXCOORD_2",
681
- uv3: "TEXCOORD_3",
682
- color: "COLOR_0",
683
- skinWeight: "WEIGHTS_0",
684
- skinIndex: "JOINTS_0"
685
- }, h = i.getAttribute("normal");
686
- h !== void 0 && !this.isNormalizedNormalAttribute(h) && (console.warn("THREE.GLTFExporter: Creating normalized normal attribute from the non-normalized one."), i.setAttribute("normal", this.createNormalizedNormalAttribute(h)));
687
- let x = null;
688
- for (let y in i.attributes) {
689
- if (y.slice(0, 5) === "morph") continue;
690
- const w = i.attributes[y];
691
- if (y = g[y] || y.toUpperCase(), /^(POSITION|NORMAL|TANGENT|TEXCOORD_\d+|COLOR_\d+|JOINTS_\d+|WEIGHTS_\d+)$/.test(y) || (y = "_" + y), s.attributes.has(this.getUID(w))) {
692
- u[y] = s.attributes.get(this.getUID(w));
693
- continue;
694
- }
695
- x = null;
696
- const M = w.array;
697
- y === "JOINTS_0" && !(M instanceof Uint16Array) && !(M instanceof Uint8Array) ? (console.warn('GLTFExporter: Attribute "skinIndex" converted to type UNSIGNED_SHORT.'), x = O.Utils.toTypedBufferAttribute(w, Uint16Array)) : (M instanceof Uint32Array || M instanceof Int32Array) && !y.startsWith("_") && (console.warn(`GLTFExporter: Attribute "${y}" converted to type FLOAT.`), x = O.Utils.toTypedBufferAttribute(w, Float32Array));
698
- const R = this.processAccessor(x || w, i);
699
- R !== null && (y.startsWith("_") || this.detectMeshQuantization(y, w), u[y] = R, s.attributes.set(this.getUID(w), R));
700
- }
701
- if (h !== void 0 && i.setAttribute("normal", h), Object.keys(u).length === 0) return null;
702
- if (e.morphTargetInfluences !== void 0 && e.morphTargetInfluences.length > 0) {
703
- const y = [], w = [], E = {};
704
- if (e.morphTargetDictionary !== void 0)
705
- for (const M in e.morphTargetDictionary)
706
- E[e.morphTargetDictionary[M]] = M;
707
- for (let M = 0; M < e.morphTargetInfluences.length; ++M) {
708
- const R = {};
709
- let V = !1;
710
- for (const U in i.morphAttributes) {
711
- if (U !== "position" && U !== "normal") {
712
- V || (console.warn("GLTFExporter: Only POSITION and NORMAL morph are supported."), V = !0);
713
- continue;
714
- }
715
- const S = i.morphAttributes[U][M], P = U.toUpperCase(), F = i.attributes[U];
716
- if (s.attributes.has(this.getUID(S, !0))) {
717
- R[P] = s.attributes.get(this.getUID(S, !0));
718
- continue;
719
- }
720
- const v = S.clone();
721
- if (!i.morphTargetsRelative)
722
- for (let I = 0, Q = S.count; I < Q; I++)
723
- for (let C = 0; C < S.itemSize; C++)
724
- C === 0 && v.setX(I, S.getX(I) - F.getX(I)), C === 1 && v.setY(I, S.getY(I) - F.getY(I)), C === 2 && v.setZ(I, S.getZ(I) - F.getZ(I)), C === 3 && v.setW(I, S.getW(I) - F.getW(I));
725
- R[P] = this.processAccessor(v, i), s.attributes.set(this.getUID(F, !0), R[P]);
726
- }
727
- l.push(R), y.push(e.morphTargetInfluences[M]), e.morphTargetDictionary !== void 0 && w.push(E[M]);
728
- }
729
- c.weights = y, w.length > 0 && (c.extras = {}, c.extras.targetNames = w);
730
- }
731
- const p = Array.isArray(e.material);
732
- if (p && i.groups.length === 0) return null;
733
- let d = !1;
734
- if (p && i.index === null) {
735
- const y = [];
736
- for (let w = 0, E = i.attributes.position.count; w < E; w++)
737
- y[w] = w;
738
- i.setIndex(y), d = !0;
739
- }
740
- const m = p ? e.material : [e.material], A = p ? i.groups : [{ materialIndex: 0, start: void 0, count: void 0 }];
741
- for (let y = 0, w = A.length; y < w; y++) {
742
- const E = {
743
- mode: o,
744
- attributes: u
745
- };
746
- if (this.serializeUserData(i, E), l.length > 0 && (E.targets = l), i.index !== null) {
747
- let R = this.getUID(i.index);
748
- (A[y].start !== void 0 || A[y].count !== void 0) && (R += ":" + A[y].start + ":" + A[y].count), s.attributes.has(R) ? E.indices = s.attributes.get(R) : (E.indices = this.processAccessor(i.index, i, A[y].start, A[y].count), s.attributes.set(R, E.indices)), E.indices === null && delete E.indices;
749
- }
750
- const M = await this.processMaterialAsync(m[A[y].materialIndex]);
751
- M !== null && (E.material = M), f.push(E);
752
- }
753
- d === !0 && i.setIndex(null), c.primitives = f, r.meshes || (r.meshes = []), await this._invokeAllAsync(function(y) {
754
- y.writeMesh && y.writeMesh(e, c);
755
- });
756
- const _ = r.meshes.push(c) - 1;
757
- return s.meshes.set(n, _), _;
758
- }
759
- /**
760
- * If a vertex attribute with a
761
- * [non-standard data type](https://registry.khronos.org/glTF/specs/2.0/glTF-2.0.html#meshes-overview)
762
- * is used, it is checked whether it is a valid data type according to the
763
- * [KHR_mesh_quantization](https://github.com/KhronosGroup/glTF/blob/main/extensions/2.0/Khronos/KHR_mesh_quantization/README.md)
764
- * extension.
765
- * In this case the extension is automatically added to the list of used extensions.
766
- *
767
- * @param {string} attributeName
768
- * @param {THREE.BufferAttribute} attribute
769
- */
770
- detectMeshQuantization(e, s) {
771
- if (this.extensionsUsed[G]) return;
772
- let r;
773
- switch (s.array.constructor) {
774
- case Int8Array:
775
- r = "byte";
776
- break;
777
- case Uint8Array:
778
- r = "unsigned byte";
779
- break;
780
- case Int16Array:
781
- r = "short";
782
- break;
783
- case Uint16Array:
784
- r = "unsigned short";
785
- break;
786
- default:
787
- return;
788
- }
789
- s.normalized && (r += " normalized");
790
- const t = e.split("_", 1)[0];
791
- K[t] && K[t].includes(r) && (this.extensionsUsed[G] = !0, this.extensionsRequired[G] = !0);
792
- }
793
- /**
794
- * Process camera
795
- * @param {THREE.Camera} camera Camera to process
796
- * @return {number} Index of the processed mesh in the "camera" array
797
- */
798
- processCamera(e) {
799
- const s = this.json;
800
- s.cameras || (s.cameras = []);
801
- const r = e.isOrthographicCamera, t = {
802
- type: r ? "orthographic" : "perspective"
803
- };
804
- return r ? t.orthographic = {
805
- xmag: e.right * 2,
806
- ymag: e.top * 2,
807
- zfar: e.far <= 0 ? 1e-3 : e.far,
808
- znear: e.near < 0 ? 0 : e.near
809
- } : t.perspective = {
810
- aspectRatio: e.aspect,
811
- yfov: H.degToRad(e.fov),
812
- zfar: e.far <= 0 ? 1e-3 : e.far,
813
- znear: e.near < 0 ? 0 : e.near
814
- }, e.name !== "" && (t.name = e.type), s.cameras.push(t) - 1;
815
- }
816
- /**
817
- * Creates glTF animation entry from AnimationClip object.
818
- *
819
- * Status:
820
- * - Only properties listed in PATH_PROPERTIES may be animated.
821
- *
822
- * @param {THREE.AnimationClip} clip
823
- * @param {THREE.Object3D} root
824
- * @return {?number}
825
- */
826
- processAnimation(e, s) {
827
- const r = this.json, t = this.nodeMap;
828
- r.animations || (r.animations = []), e = O.Utils.mergeMorphTargetTracks(e.clone(), s);
829
- const n = e.tracks, i = [], o = [];
830
- for (let u = 0; u < n.length; ++u) {
831
- const f = n[u], l = D.parseTrackName(f.name);
832
- let g = D.findNode(s, l.nodeName);
833
- const h = W[l.propertyName];
834
- if (l.objectName === "bones" && (g.isSkinnedMesh === !0 ? g = g.skeleton.getBoneByName(l.objectIndex) : g = void 0), !g || !h) {
835
- console.warn('THREE.GLTFExporter: Could not export animation track "%s".', f.name);
836
- continue;
837
- }
838
- const x = 1;
839
- let p = f.values.length / f.times.length;
840
- h === W.morphTargetInfluences && (p /= g.morphTargetInfluences.length);
841
- let d;
842
- f.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline === !0 ? (d = "CUBICSPLINE", p /= 3) : f.getInterpolation() === ae ? d = "STEP" : d = "LINEAR", o.push({
843
- input: this.processAccessor(new b(f.times, x)),
844
- output: this.processAccessor(new b(f.values, p)),
845
- interpolation: d
846
- }), i.push({
847
- sampler: o.length - 1,
848
- target: {
849
- node: t.get(g),
850
- path: h
851
- }
852
- });
853
- }
854
- const c = {
855
- name: e.name || "clip_" + r.animations.length,
856
- samplers: o,
857
- channels: i
858
- };
859
- return this.serializeUserData(e, c), r.animations.push(c), r.animations.length - 1;
860
- }
861
- /**
862
- * @param {THREE.Object3D} object
863
- * @return {?number}
864
- */
865
- processSkin(e) {
866
- const s = this.json, r = this.nodeMap, t = s.nodes[r.get(e)], n = e.skeleton;
867
- if (n === void 0) return null;
868
- const i = e.skeleton.bones[0];
869
- if (i === void 0) return null;
870
- const o = [], c = new Float32Array(n.bones.length * 16), u = new Z();
871
- for (let l = 0; l < n.bones.length; ++l)
872
- o.push(r.get(n.bones[l])), u.copy(n.boneInverses[l]), u.multiply(e.bindMatrix).toArray(c, l * 16);
873
- return s.skins === void 0 && (s.skins = []), s.skins.push({
874
- inverseBindMatrices: this.processAccessor(new b(c, 16)),
875
- joints: o,
876
- skeleton: r.get(i)
877
- }), t.skin = s.skins.length - 1;
878
- }
879
- /**
880
- * Process Object3D node
881
- * @param {THREE.Object3D} object Object3D to processNodeAsync
882
- * @return {Promise<number>} Index of the node in the nodes list
883
- */
884
- async processNodeAsync(e) {
885
- const s = this.json, r = this.options, t = this.nodeMap;
886
- if (s.nodes || (s.nodes = []), e.pivot !== null)
887
- return await this._processNodeWithPivotAsync(e);
888
- const n = {};
889
- if (r.trs) {
890
- const o = e.quaternion.toArray(), c = e.position.toArray(), u = e.scale.toArray();
891
- L(o, [0, 0, 0, 1]) || (n.rotation = o), L(c, [0, 0, 0]) || (n.translation = c), L(u, [1, 1, 1]) || (n.scale = u);
892
- } else
893
- e.matrixAutoUpdate && e.updateMatrix(), Re(e.matrix) === !1 && (n.matrix = e.matrix.elements);
894
- if (e.name !== "" && (n.name = String(e.name)), this.serializeUserData(e, n), e.isMesh || e.isLine || e.isPoints) {
895
- const o = await this.processMeshAsync(e);
896
- o !== null && (n.mesh = o);
897
- } else e.isCamera && (n.camera = this.processCamera(e));
898
- e.isSkinnedMesh && this.skins.push(e);
899
- const i = s.nodes.push(n) - 1;
900
- if (t.set(e, i), e.children.length > 0) {
901
- const o = [];
902
- for (let c = 0, u = e.children.length; c < u; c++) {
903
- const f = e.children[c];
904
- if (f.visible || r.onlyVisible === !1) {
905
- const l = await this.processNodeAsync(f);
906
- l !== null && o.push(l);
907
- }
908
- }
909
- o.length > 0 && (n.children = o);
910
- }
911
- return await this._invokeAllAsync(function(o) {
912
- o.writeNode && o.writeNode(e, n);
913
- }), i;
914
- }
915
- /**
916
- * Process Object3D node with pivot using container approach
917
- * @param {THREE.Object3D} object Object3D with pivot
918
- * @return {Promise<number>} Index of the container node
919
- */
920
- async _processNodeWithPivotAsync(e) {
921
- const s = this.json, r = this.options, t = this.nodeMap, n = e.pivot, i = {}, o = e.quaternion.toArray(), c = [
922
- e.position.x + n.x,
923
- e.position.y + n.y,
924
- e.position.z + n.z
925
- ], u = e.scale.toArray();
926
- L(o, [0, 0, 0, 1]) || (i.rotation = o), L(c, [0, 0, 0]) || (i.translation = c), L(u, [1, 1, 1]) || (i.scale = u), i.extras = { pivot: n.toArray() }, e.name !== "" && (i.name = String(e.name)), this.serializeUserData(e, i);
927
- const f = s.nodes.push(i) - 1;
928
- t.set(e, f);
929
- const l = {}, g = [-n.x, -n.y, -n.z];
930
- if (L(g, [0, 0, 0]) || (l.translation = g), e.isMesh || e.isLine || e.isPoints) {
931
- const p = await this.processMeshAsync(e);
932
- p !== null && (l.mesh = p);
933
- } else e.isCamera && (l.camera = this.processCamera(e));
934
- e.isSkinnedMesh && this.skins.push(e);
935
- const x = [s.nodes.push(l) - 1];
936
- if (e.children.length > 0) {
937
- const p = [];
938
- for (let d = 0, m = e.children.length; d < m; d++) {
939
- const A = e.children[d];
940
- if (A.visible || r.onlyVisible === !1) {
941
- const _ = await this.processNodeAsync(A);
942
- _ !== null && p.push(_);
943
- }
944
- }
945
- p.length > 0 && (l.children = p);
946
- }
947
- return i.children = x, await this._invokeAllAsync(function(p) {
948
- p.writeNode && p.writeNode(e, i);
949
- }), f;
950
- }
951
- /**
952
- * Process Scene
953
- * @param {Scene} scene Scene to process
954
- */
955
- async processSceneAsync(e) {
956
- const s = this.json, r = this.options;
957
- s.scenes || (s.scenes = [], s.scene = 0);
958
- const t = {};
959
- e.name !== "" && (t.name = e.name), s.scenes.push(t);
960
- const n = [];
961
- for (let i = 0, o = e.children.length; i < o; i++) {
962
- const c = e.children[i];
963
- if (c.visible || r.onlyVisible === !1) {
964
- const u = await this.processNodeAsync(c);
965
- u !== null && n.push(u);
966
- }
967
- }
968
- n.length > 0 && (t.nodes = n), this.serializeUserData(e, t);
969
- }
970
- /**
971
- * Creates a Scene to hold a list of objects and parse it
972
- * @param {Array<THREE.Object3D>} objects List of objects to process
973
- */
974
- async processObjectsAsync(e) {
975
- const s = new Y();
976
- s.name = "AuxScene";
977
- for (let r = 0; r < e.length; r++)
978
- s.children.push(e[r]);
979
- await this.processSceneAsync(s);
980
- }
981
- /**
982
- * @param {THREE.Object3D|Array<THREE.Object3D>} input
983
- */
984
- async processInputAsync(e) {
985
- const s = this.options;
986
- e = e instanceof Array ? e : [e], await this._invokeAllAsync(function(t) {
987
- t.beforeParse && t.beforeParse(e);
988
- });
989
- const r = [];
990
- for (let t = 0; t < e.length; t++)
991
- e[t] instanceof Y ? await this.processSceneAsync(e[t]) : r.push(e[t]);
992
- r.length > 0 && await this.processObjectsAsync(r);
993
- for (let t = 0; t < this.skins.length; ++t)
994
- this.processSkin(this.skins[t]);
995
- for (let t = 0; t < s.animations.length; ++t)
996
- this.processAnimation(s.animations[t], e[0]);
997
- await this._invokeAllAsync(function(t) {
998
- t.afterParse && t.afterParse(e);
999
- });
1000
- }
1001
- async _invokeAllAsync(e) {
1002
- for (let s = 0, r = this.plugins.length; s < r; s++)
1003
- await e(this.plugins[s]);
1004
- }
1005
- }
1006
- class _e {
1007
- constructor(e) {
1008
- this.writer = e, this.name = "KHR_lights_punctual";
1009
- }
1010
- writeNode(e, s) {
1011
- if (!e.isLight) return;
1012
- if (!e.isDirectionalLight && !e.isPointLight && !e.isSpotLight) {
1013
- console.warn("THREE.GLTFExporter: Only directional, point, and spot lights are supported.", e);
1014
- return;
1015
- }
1016
- const r = this.writer, t = r.json, n = r.extensionsUsed, i = {};
1017
- e.name && (i.name = e.name), i.color = e.color.toArray(), i.intensity = e.intensity, e.isDirectionalLight ? i.type = "directional" : e.isPointLight ? (i.type = "point", e.distance > 0 && (i.range = e.distance)) : e.isSpotLight && (i.type = "spot", e.distance > 0 && (i.range = e.distance), i.spot = {}, i.spot.innerConeAngle = (1 - e.penumbra) * e.angle, i.spot.outerConeAngle = e.angle), e.decay !== void 0 && e.decay !== 2 && console.warn("THREE.GLTFExporter: Light decay may be lost. glTF is physically-based, and expects light.decay=2."), e.target && (e.target.parent !== e || e.target.position.x !== 0 || e.target.position.y !== 0 || e.target.position.z !== -1) && console.warn("THREE.GLTFExporter: Light direction may be lost. For best results, make light.target a child of the light with position 0,0,-1."), n[this.name] || (t.extensions = t.extensions || {}, t.extensions[this.name] = { lights: [] }, n[this.name] = !0);
1018
- const o = t.extensions[this.name].lights;
1019
- o.push(i), s.extensions = s.extensions || {}, s.extensions[this.name] = { light: o.length - 1 };
1020
- }
1021
- }
1022
- class be {
1023
- constructor(e) {
1024
- this.writer = e, this.name = "KHR_materials_unlit";
1025
- }
1026
- async writeMaterialAsync(e, s) {
1027
- if (!e.isMeshBasicMaterial) return;
1028
- const t = this.writer.extensionsUsed;
1029
- s.extensions = s.extensions || {}, s.extensions[this.name] = {}, t[this.name] = !0, s.pbrMetallicRoughness.metallicFactor = 0, s.pbrMetallicRoughness.roughnessFactor = 0.9;
1030
- }
1031
- }
1032
- class Ce {
1033
- constructor(e) {
1034
- this.writer = e, this.name = "KHR_materials_clearcoat";
1035
- }
1036
- async writeMaterialAsync(e, s) {
1037
- if (!e.isMeshPhysicalMaterial || e.clearcoat === 0) return;
1038
- const r = this.writer, t = r.extensionsUsed, n = {};
1039
- if (n.clearcoatFactor = e.clearcoat, e.clearcoatMap) {
1040
- const i = {
1041
- index: await r.processTextureAsync(e.clearcoatMap),
1042
- texCoord: e.clearcoatMap.channel
1043
- };
1044
- r.applyTextureTransform(i, e.clearcoatMap), n.clearcoatTexture = i;
1045
- }
1046
- if (n.clearcoatRoughnessFactor = e.clearcoatRoughness, e.clearcoatRoughnessMap) {
1047
- const i = {
1048
- index: await r.processTextureAsync(e.clearcoatRoughnessMap),
1049
- texCoord: e.clearcoatRoughnessMap.channel
1050
- };
1051
- r.applyTextureTransform(i, e.clearcoatRoughnessMap), n.clearcoatRoughnessTexture = i;
1052
- }
1053
- if (e.clearcoatNormalMap) {
1054
- const i = {
1055
- index: await r.processTextureAsync(e.clearcoatNormalMap),
1056
- texCoord: e.clearcoatNormalMap.channel
1057
- };
1058
- e.clearcoatNormalScale.x !== 1 && (i.scale = e.clearcoatNormalScale.x), r.applyTextureTransform(i, e.clearcoatNormalMap), n.clearcoatNormalTexture = i;
1059
- }
1060
- s.extensions = s.extensions || {}, s.extensions[this.name] = n, t[this.name] = !0;
1061
- }
1062
- }
1063
- class Ue {
1064
- constructor(e) {
1065
- this.writer = e, this.name = "KHR_materials_dispersion";
1066
- }
1067
- async writeMaterialAsync(e, s) {
1068
- if (!e.isMeshPhysicalMaterial || e.dispersion === 0) return;
1069
- const t = this.writer.extensionsUsed, n = {};
1070
- n.dispersion = e.dispersion, s.extensions = s.extensions || {}, s.extensions[this.name] = n, t[this.name] = !0;
1071
- }
1072
- }
1073
- class Fe {
1074
- constructor(e) {
1075
- this.writer = e, this.name = "KHR_materials_iridescence";
1076
- }
1077
- async writeMaterialAsync(e, s) {
1078
- if (!e.isMeshPhysicalMaterial || e.iridescence === 0) return;
1079
- const r = this.writer, t = r.extensionsUsed, n = {};
1080
- if (n.iridescenceFactor = e.iridescence, e.iridescenceMap) {
1081
- const i = {
1082
- index: await r.processTextureAsync(e.iridescenceMap),
1083
- texCoord: e.iridescenceMap.channel
1084
- };
1085
- r.applyTextureTransform(i, e.iridescenceMap), n.iridescenceTexture = i;
1086
- }
1087
- if (n.iridescenceIor = e.iridescenceIOR, n.iridescenceThicknessMinimum = e.iridescenceThicknessRange[0], n.iridescenceThicknessMaximum = e.iridescenceThicknessRange[1], e.iridescenceThicknessMap) {
1088
- const i = {
1089
- index: await r.processTextureAsync(e.iridescenceThicknessMap),
1090
- texCoord: e.iridescenceThicknessMap.channel
1091
- };
1092
- r.applyTextureTransform(i, e.iridescenceThicknessMap), n.iridescenceThicknessTexture = i;
1093
- }
1094
- s.extensions = s.extensions || {}, s.extensions[this.name] = n, t[this.name] = !0;
1095
- }
1096
- }
1097
- class ve {
1098
- constructor(e) {
1099
- this.writer = e, this.name = "KHR_materials_transmission";
1100
- }
1101
- async writeMaterialAsync(e, s) {
1102
- if (!e.isMeshPhysicalMaterial || e.transmission === 0) return;
1103
- const r = this.writer, t = r.extensionsUsed, n = {};
1104
- if (n.transmissionFactor = e.transmission, e.transmissionMap) {
1105
- const i = {
1106
- index: await r.processTextureAsync(e.transmissionMap),
1107
- texCoord: e.transmissionMap.channel
1108
- };
1109
- r.applyTextureTransform(i, e.transmissionMap), n.transmissionTexture = i;
1110
- }
1111
- s.extensions = s.extensions || {}, s.extensions[this.name] = n, t[this.name] = !0;
1112
- }
1113
- }
1114
- class Oe {
1115
- constructor(e) {
1116
- this.writer = e, this.name = "KHR_materials_volume";
1117
- }
1118
- async writeMaterialAsync(e, s) {
1119
- if (!e.isMeshPhysicalMaterial || e.transmission === 0) return;
1120
- const r = this.writer, t = r.extensionsUsed, n = {};
1121
- if (n.thicknessFactor = e.thickness, e.thicknessMap) {
1122
- const i = {
1123
- index: await r.processTextureAsync(e.thicknessMap),
1124
- texCoord: e.thicknessMap.channel
1125
- };
1126
- r.applyTextureTransform(i, e.thicknessMap), n.thicknessTexture = i;
1127
- }
1128
- e.attenuationDistance !== 1 / 0 && (n.attenuationDistance = e.attenuationDistance), n.attenuationColor = e.attenuationColor.toArray(), s.extensions = s.extensions || {}, s.extensions[this.name] = n, t[this.name] = !0;
1129
- }
1130
- }
1131
- class ze {
1132
- constructor(e) {
1133
- this.writer = e, this.name = "KHR_materials_ior";
1134
- }
1135
- async writeMaterialAsync(e, s) {
1136
- if (!e.isMeshPhysicalMaterial || e.ior === 1.5) return;
1137
- const t = this.writer.extensionsUsed, n = {};
1138
- n.ior = e.ior, s.extensions = s.extensions || {}, s.extensions[this.name] = n, t[this.name] = !0;
1139
- }
1140
- }
1141
- class De {
1142
- constructor(e) {
1143
- this.writer = e, this.name = "KHR_materials_specular";
1144
- }
1145
- async writeMaterialAsync(e, s) {
1146
- if (!e.isMeshPhysicalMaterial || e.specularIntensity === 1 && e.specularColor.equals(we) && !e.specularIntensityMap && !e.specularColorMap) return;
1147
- const r = this.writer, t = r.extensionsUsed, n = {};
1148
- if (e.specularIntensityMap) {
1149
- const i = {
1150
- index: await r.processTextureAsync(e.specularIntensityMap),
1151
- texCoord: e.specularIntensityMap.channel
1152
- };
1153
- r.applyTextureTransform(i, e.specularIntensityMap), n.specularTexture = i;
1154
- }
1155
- if (e.specularColorMap) {
1156
- const i = {
1157
- index: await r.processTextureAsync(e.specularColorMap),
1158
- texCoord: e.specularColorMap.channel
1159
- };
1160
- r.applyTextureTransform(i, e.specularColorMap), n.specularColorTexture = i;
1161
- }
1162
- n.specularFactor = e.specularIntensity, n.specularColorFactor = e.specularColor.toArray(), s.extensions = s.extensions || {}, s.extensions[this.name] = n, t[this.name] = !0;
1163
- }
1164
- }
1165
- class Pe {
1166
- constructor(e) {
1167
- this.writer = e, this.name = "KHR_materials_sheen";
1168
- }
1169
- async writeMaterialAsync(e, s) {
1170
- if (!e.isMeshPhysicalMaterial || e.sheen == 0) return;
1171
- const r = this.writer, t = r.extensionsUsed, n = {};
1172
- if (e.sheenRoughnessMap) {
1173
- const i = {
1174
- index: await r.processTextureAsync(e.sheenRoughnessMap),
1175
- texCoord: e.sheenRoughnessMap.channel
1176
- };
1177
- r.applyTextureTransform(i, e.sheenRoughnessMap), n.sheenRoughnessTexture = i;
1178
- }
1179
- if (e.sheenColorMap) {
1180
- const i = {
1181
- index: await r.processTextureAsync(e.sheenColorMap),
1182
- texCoord: e.sheenColorMap.channel
1183
- };
1184
- r.applyTextureTransform(i, e.sheenColorMap), n.sheenColorTexture = i;
1185
- }
1186
- n.sheenRoughnessFactor = e.sheenRoughness, n.sheenColorFactor = e.sheenColor.toArray(), s.extensions = s.extensions || {}, s.extensions[this.name] = n, t[this.name] = !0;
1187
- }
1188
- }
1189
- class Be {
1190
- constructor(e) {
1191
- this.writer = e, this.name = "KHR_materials_anisotropy";
1192
- }
1193
- async writeMaterialAsync(e, s) {
1194
- if (!e.isMeshPhysicalMaterial || e.anisotropy == 0) return;
1195
- const r = this.writer, t = r.extensionsUsed, n = {};
1196
- if (e.anisotropyMap) {
1197
- const i = { index: await r.processTextureAsync(e.anisotropyMap) };
1198
- r.applyTextureTransform(i, e.anisotropyMap), n.anisotropyTexture = i;
1199
- }
1200
- n.anisotropyStrength = e.anisotropy, n.anisotropyRotation = e.anisotropyRotation, s.extensions = s.extensions || {}, s.extensions[this.name] = n, t[this.name] = !0;
1201
- }
1202
- }
1203
- class Ge {
1204
- constructor(e) {
1205
- this.writer = e, this.name = "KHR_materials_emissive_strength";
1206
- }
1207
- async writeMaterialAsync(e, s) {
1208
- if (!e.isMeshStandardMaterial || e.emissiveIntensity === 1) return;
1209
- const t = this.writer.extensionsUsed, n = {};
1210
- n.emissiveStrength = e.emissiveIntensity, s.extensions = s.extensions || {}, s.extensions[this.name] = n, t[this.name] = !0;
1211
- }
1212
- }
1213
- class ke {
1214
- constructor(e) {
1215
- this.writer = e, this.name = "EXT_materials_bump";
1216
- }
1217
- async writeMaterialAsync(e, s) {
1218
- if (!e.isMeshStandardMaterial || e.bumpScale === 1 && !e.bumpMap) return;
1219
- const r = this.writer, t = r.extensionsUsed, n = {};
1220
- if (e.bumpMap) {
1221
- const i = {
1222
- index: await r.processTextureAsync(e.bumpMap),
1223
- texCoord: e.bumpMap.channel
1224
- };
1225
- r.applyTextureTransform(i, e.bumpMap), n.bumpTexture = i;
1226
- }
1227
- n.bumpFactor = e.bumpScale, s.extensions = s.extensions || {}, s.extensions[this.name] = n, t[this.name] = !0;
1228
- }
1229
- }
1230
- class He {
1231
- constructor(e) {
1232
- this.writer = e, this.name = "EXT_mesh_gpu_instancing";
1233
- }
1234
- writeNode(e, s) {
1235
- if (!e.isInstancedMesh) return;
1236
- const r = this.writer, t = e, n = new Float32Array(t.count * 3), i = new Float32Array(t.count * 4), o = new Float32Array(t.count * 3), c = new Z(), u = new z(), f = new ee(), l = new z();
1237
- for (let h = 0; h < t.count; h++)
1238
- t.getMatrixAt(h, c), c.decompose(u, f, l), u.toArray(n, h * 3), f.toArray(i, h * 4), l.toArray(o, h * 3);
1239
- const g = {
1240
- TRANSLATION: r.processAccessor(new b(n, 3)),
1241
- ROTATION: r.processAccessor(new b(i, 4)),
1242
- SCALE: r.processAccessor(new b(o, 3))
1243
- };
1244
- t.instanceColor && (g._COLOR_0 = r.processAccessor(t.instanceColor)), s.extensions = s.extensions || {}, s.extensions[this.name] = { attributes: g }, r.extensionsUsed[this.name] = !0, r.extensionsRequired[this.name] = !0;
1245
- }
1246
- }
1247
- O.Utils = {
1248
- insertKeyframe: function(a, e) {
1249
- const r = a.getValueSize(), t = new a.TimeBufferType(a.times.length + 1), n = new a.ValueBufferType(a.values.length + r), i = a.createInterpolant(new a.ValueBufferType(r));
1250
- let o;
1251
- if (a.times.length === 0) {
1252
- t[0] = e;
1253
- for (let c = 0; c < r; c++)
1254
- n[c] = 0;
1255
- o = 0;
1256
- } else if (e < a.times[0]) {
1257
- if (Math.abs(a.times[0] - e) < 1e-3) return 0;
1258
- t[0] = e, t.set(a.times, 1), n.set(i.evaluate(e), 0), n.set(a.values, r), o = 0;
1259
- } else if (e > a.times[a.times.length - 1]) {
1260
- if (Math.abs(a.times[a.times.length - 1] - e) < 1e-3)
1261
- return a.times.length - 1;
1262
- t[t.length - 1] = e, t.set(a.times, 0), n.set(a.values, 0), n.set(i.evaluate(e), a.values.length), o = t.length - 1;
1263
- } else
1264
- for (let c = 0; c < a.times.length; c++) {
1265
- if (Math.abs(a.times[c] - e) < 1e-3) return c;
1266
- if (a.times[c] < e && a.times[c + 1] > e) {
1267
- t.set(a.times.slice(0, c + 1), 0), t[c + 1] = e, t.set(a.times.slice(c + 1), c + 2), n.set(a.values.slice(0, (c + 1) * r), 0), n.set(i.evaluate(e), (c + 1) * r), n.set(a.values.slice((c + 1) * r), (c + 2) * r), o = c + 1;
1268
- break;
1269
- }
1270
- }
1271
- return a.times = t, a.values = n, o;
1272
- },
1273
- mergeMorphTargetTracks: function(a, e) {
1274
- const s = [], r = {}, t = a.tracks;
1275
- for (let n = 0; n < t.length; ++n) {
1276
- let i = t[n];
1277
- const o = D.parseTrackName(i.name), c = D.findNode(e, o.nodeName);
1278
- if (o.propertyName !== "morphTargetInfluences" || o.propertyIndex === void 0) {
1279
- s.push(i);
1280
- continue;
1281
- }
1282
- if (i.createInterpolant !== i.InterpolantFactoryMethodDiscrete && i.createInterpolant !== i.InterpolantFactoryMethodLinear) {
1283
- if (i.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline)
1284
- throw new Error("THREE.GLTFExporter: Cannot merge tracks with glTF CUBICSPLINE interpolation.");
1285
- console.warn("THREE.GLTFExporter: Morph target interpolation mode not yet supported. Using LINEAR instead."), i = i.clone(), i.setInterpolation(Te);
1286
- }
1287
- const u = c.morphTargetInfluences.length, f = c.morphTargetDictionary[o.propertyIndex];
1288
- if (f === void 0)
1289
- throw new Error("THREE.GLTFExporter: Morph target name not found: " + o.propertyIndex);
1290
- let l;
1291
- if (r[c.uuid] === void 0) {
1292
- l = i.clone();
1293
- const h = new l.ValueBufferType(u * l.times.length);
1294
- for (let x = 0; x < l.times.length; x++)
1295
- h[x * u + f] = l.values[x];
1296
- l.name = (o.nodeName || "") + ".morphTargetInfluences", l.values = h, r[c.uuid] = l, s.push(l);
1297
- continue;
1298
- }
1299
- const g = i.createInterpolant(new i.ValueBufferType(1));
1300
- l = r[c.uuid];
1301
- for (let h = 0; h < l.times.length; h++)
1302
- l.values[h * u + f] = g.evaluate(l.times[h]);
1303
- for (let h = 0; h < i.times.length; h++) {
1304
- const x = this.insertKeyframe(l, i.times[h]);
1305
- l.values[x * u + f] = i.values[h];
1306
- }
1307
- }
1308
- return a.tracks = s, a;
1309
- },
1310
- toTypedBufferAttribute: function(a, e) {
1311
- const s = new b(new e(a.count * a.itemSize), a.itemSize, !1);
1312
- if (!a.normalized && !a.isInterleavedBufferAttribute)
1313
- return s.array.set(a.array), s;
1314
- for (let r = 0, t = a.count; r < t; r++)
1315
- for (let n = 0; n < a.itemSize; n++)
1316
- s.setComponent(r, n, a.getComponent(r, n));
1317
- return s;
1318
- }
1319
- };
1320
- export {
1321
- O as GLTFExporter
1322
- };
1323
- //# sourceMappingURL=GLTFExporter-CXMBueJw.mjs.map