@roomle/web-sdk 3.6.0-alpha.2 → 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.
- package/lib/BufferGeometry-DLEagG41.mjs +1022 -0
- package/lib/BufferGeometry-DLEagG41.mjs.map +1 -0
- package/lib/ConfiguratorKernel.js +2 -2
- package/lib/ConfiguratorKernel.wasm +0 -0
- package/lib/GLTFExporter-D8qsdwDK.mjs +1092 -0
- package/lib/GLTFExporter-D8qsdwDK.mjs.map +1 -0
- package/lib/Object3D-DSjIOhON.mjs +1713 -0
- package/lib/Object3D-DSjIOhON.mjs.map +1 -0
- package/lib/PointLightHelper-BnjxGaOG.mjs +257 -0
- package/lib/PointLightHelper-BnjxGaOG.mjs.map +1 -0
- package/lib/RoomleCore.js +4 -4
- package/lib/RoomleCore.wasm +0 -0
- package/lib/RoomleToolsCore.wasm +0 -0
- package/lib/SpotLightHelper-DqsfqCrs.mjs +154 -0
- package/lib/SpotLightHelper-DqsfqCrs.mjs.map +1 -0
- package/lib/USDZExporter-DxIqi8St.mjs +296 -0
- package/lib/USDZExporter-DxIqi8St.mjs.map +1 -0
- package/lib/Vector4-DGmBYfpK.mjs +204 -0
- package/lib/Vector4-DGmBYfpK.mjs.map +1 -0
- package/lib/api-CNoIBuvr.mjs +55 -0
- package/lib/api-CNoIBuvr.mjs.map +1 -0
- package/lib/asset-loader.worker.js +1 -1
- package/lib/banana-for-scale-C_iNmlCT.mjs +36 -0
- package/lib/banana-for-scale-C_iNmlCT.mjs.map +1 -0
- package/lib/common-utils-DMSTohiS.mjs +187 -0
- package/lib/common-utils-DMSTohiS.mjs.map +1 -0
- package/lib/component-dimensioning-CvRmUja4.mjs +162 -0
- package/lib/component-dimensioning-CvRmUja4.mjs.map +1 -0
- package/lib/component-raycast-helper-CEp7wy9c.mjs +97 -0
- package/lib/component-raycast-helper-CEp7wy9c.mjs.map +1 -0
- package/lib/configurator-B_5XVG2O.mjs +45 -0
- package/lib/configurator-B_5XVG2O.mjs.map +1 -0
- package/lib/configurator-DCdvMM0o.mjs +2 -0
- package/lib/continuous-drawing-helper-v_5UAM9A.mjs +42 -0
- package/lib/continuous-drawing-helper-v_5UAM9A.mjs.map +1 -0
- package/lib/decorate-C1QnXPYw.mjs +35 -0
- package/lib/decorate-C1QnXPYw.mjs.map +1 -0
- package/lib/dimensioning-helper-DTcW85Oq.mjs +2 -0
- package/lib/dimensioning-helper-Fwpt1HTT.mjs +268 -0
- package/lib/dimensioning-helper-Fwpt1HTT.mjs.map +1 -0
- package/lib/fflate.module-dFNj5UPI.mjs +536 -0
- package/lib/fflate.module-dFNj5UPI.mjs.map +1 -0
- package/lib/glb-viewer-cP8g6bcm.mjs +315 -0
- package/lib/glb-viewer-cP8g6bcm.mjs.map +1 -0
- package/lib/glb-viewer-dZThmlwM.mjs +2 -0
- package/lib/homag-intelligence-LoOJ7roM.mjs +381 -0
- package/lib/homag-intelligence-LoOJ7roM.mjs.map +1 -0
- package/lib/imos-ix-poc-export-helper-CQh94HsO.mjs +161 -0
- package/lib/imos-ix-poc-export-helper-CQh94HsO.mjs.map +1 -0
- package/lib/kernel-BAQSG9r5.mjs +46 -0
- package/lib/kernel-BAQSG9r5.mjs.map +1 -0
- package/lib/kernel-utils-H74uNY1h.mjs +44 -0
- package/lib/kernel-utils-H74uNY1h.mjs.map +1 -0
- package/lib/layer-C_JtkhdO.mjs +8 -0
- package/lib/layer-C_JtkhdO.mjs.map +1 -0
- package/lib/main-BxEZ11ag.mjs +20461 -0
- package/lib/main-BxEZ11ag.mjs.map +1 -0
- package/lib/material-viewer-njBFF0Zg.mjs +292 -0
- package/lib/material-viewer-njBFF0Zg.mjs.map +1 -0
- package/lib/planner-Cr495Cyn.mjs +2 -0
- package/lib/planner-DY73rplC.mjs +44 -0
- package/lib/planner-DY73rplC.mjs.map +1 -0
- package/lib/plugin-system-D9K46xJk.mjs +55 -0
- package/lib/plugin-system-D9K46xJk.mjs.map +1 -0
- package/lib/roomle-sdk.d.ts +302 -134
- package/lib/roomle-sdk.js +7 -36
- package/lib/scene-renderer-D8HkTFeZ.mjs +3826 -0
- package/lib/scene-renderer-D8HkTFeZ.mjs.map +1 -0
- package/lib/script-loader-KBq8SjP6.mjs +45 -0
- package/lib/script-loader-KBq8SjP6.mjs.map +1 -0
- package/lib/static/draco/node_modules/three/examples/jsm/libs/draco/draco_decoder.js +34 -0
- package/lib/static/draco/node_modules/three/examples/jsm/libs/draco/draco_decoder.wasm +0 -0
- package/lib/static/draco/node_modules/three/examples/jsm/libs/draco/draco_encoder.js +33 -0
- package/lib/static/draco/node_modules/three/examples/jsm/libs/draco/draco_wasm_wrapper.js +117 -0
- package/lib/static/packages/workers/generated/asset-loader.worker.js +1 -0
- package/lib/static/roomle-core-hsc/node_modules/roomle-core-hsc/package.json +1 -0
- package/lib/static/roomle-core-hsc/{configuratorCore.d.ts → node_modules/roomle-core-hsc/src/embind/configuratorCore.d.ts} +1 -2
- package/lib/static/roomle-core-hsc/{configuratorCoreInterface.d.ts → node_modules/roomle-core-hsc/src/embind/configuratorCoreInterface.d.ts} +22 -29
- package/lib/static/roomle-core-hsc/{src → node_modules/roomle-core-hsc/src}/embind/plannerCore.d.ts +1 -2
- package/lib/static/roomle-core-hsc/{src → node_modules/roomle-core-hsc/src}/embind/plannerCoreCallback.d.ts +1 -1
- package/lib/static/roomle-core-hsc/{embind → node_modules/roomle-core-hsc/src/embind}/plannerCoreCallback.js +1 -1
- package/lib/static/roomle-core-hsc/node_modules/roomle-core-hsc/src/embind/plannerCoreCallback.js.map +1 -0
- package/lib/static/roomle-core-hsc/{plannerCoreInterface.d.ts → node_modules/roomle-core-hsc/src/embind/plannerCoreInterface.d.ts} +76 -81
- package/lib/static/roomle-core-hsc/{embind → node_modules/roomle-core-hsc/src/embind}/plannerCoreInterface.js +1 -6
- package/lib/static/roomle-core-hsc/node_modules/roomle-core-hsc/src/embind/plannerCoreInterface.js.map +1 -0
- package/lib/static/roomle-core-hsc/{loader → node_modules/roomle-core-hsc/src/loader}/configurableObject.d.ts +2 -2
- package/lib/static/roomle-core-hsc/{src → node_modules/roomle-core-hsc/src}/loader/configurableObject.js +6 -6
- package/lib/static/roomle-core-hsc/node_modules/roomle-core-hsc/src/loader/configurableObject.js.map +1 -0
- package/lib/static/roomle-core-hsc/{src → node_modules/roomle-core-hsc/src}/loader/configurationLoader.js +1 -5
- package/lib/static/roomle-core-hsc/node_modules/roomle-core-hsc/src/loader/configurationLoader.js.map +1 -0
- package/lib/static/roomle-core-hsc/{configurationManager.d.ts → node_modules/roomle-core-hsc/src/loader/configurationManager.d.ts} +1 -0
- package/lib/static/roomle-core-hsc/{loader → node_modules/roomle-core-hsc/src/loader}/configurationManager.js +6 -0
- package/lib/static/roomle-core-hsc/node_modules/roomle-core-hsc/src/loader/configurationManager.js.map +1 -0
- package/lib/static/roomle-core-hsc/{src → node_modules/roomle-core-hsc/src}/loader/planElementManager.d.ts +2 -2
- package/lib/static/roomle-core-hsc/{loader → node_modules/roomle-core-hsc/src/loader}/planElementManager.js.map +1 -1
- package/lib/static/roomle-core-hsc/{wasm_modern → node_modules/roomle-core-hsc/wasm_modern}/ConfiguratorKernel.js +2 -2
- package/lib/static/roomle-core-hsc/node_modules/roomle-core-hsc/wasm_modern/ConfiguratorKernel.wasm +0 -0
- package/lib/static/roomle-core-hsc/{wasm_modern → node_modules/roomle-core-hsc/wasm_modern}/RoomleCore.js +4 -4
- package/lib/static/roomle-core-hsc/node_modules/roomle-core-hsc/wasm_modern/RoomleCore.wasm +0 -0
- package/lib/static/roomle-core-hsc/node_modules/roomle-core-hsc/wasm_modern/RoomleToolsCore.wasm +0 -0
- package/lib/stats-helper-HM0TaIM5.mjs +95 -0
- package/lib/stats-helper-HM0TaIM5.mjs.map +1 -0
- package/lib/three.core-CLIofecG.mjs +7629 -0
- package/lib/three.core-CLIofecG.mjs.map +1 -0
- package/lib/three.module-C4Q1skJQ.mjs +5795 -0
- package/lib/three.module-C4Q1skJQ.mjs.map +1 -0
- package/lib/three.webgpu-dFspy2yF.mjs +16057 -0
- package/lib/three.webgpu-dFspy2yF.mjs.map +1 -0
- package/lib/threejs-utils-jEzvlJF1.mjs +2233 -0
- package/lib/threejs-utils-jEzvlJF1.mjs.map +1 -0
- package/lib/tools-core-CZbPygRC.mjs +30 -0
- package/lib/tools-core-CZbPygRC.mjs.map +1 -0
- package/package.json +3 -3
- package/lib/BufferGeometry-BZdSmtHt.mjs +0 -2064
- package/lib/BufferGeometry-BZdSmtHt.mjs.map +0 -1
- package/lib/GLTFExporter-DiE_HuI6.mjs +0 -1286
- package/lib/GLTFExporter-DiE_HuI6.mjs.map +0 -1
- package/lib/PointLightHelper-BvRpTX7D.mjs +0 -522
- package/lib/PointLightHelper-BvRpTX7D.mjs.map +0 -1
- package/lib/SpotLightHelper-Byg39thi.mjs +0 -222
- package/lib/SpotLightHelper-Byg39thi.mjs.map +0 -1
- package/lib/USDZExporter-VBx9xybH.mjs +0 -545
- package/lib/USDZExporter-VBx9xybH.mjs.map +0 -1
- package/lib/banana-for-scale-C9_AyZkI.mjs +0 -50
- package/lib/banana-for-scale-C9_AyZkI.mjs.map +0 -1
- package/lib/component-dimensioning-DHTSa-If.mjs +0 -229
- package/lib/component-dimensioning-DHTSa-If.mjs.map +0 -1
- package/lib/continuous-drawing-helper-BNHRsd4B.mjs +0 -48
- package/lib/continuous-drawing-helper-BNHRsd4B.mjs.map +0 -1
- package/lib/homag-intelligence-BraN723F.mjs +0 -545
- package/lib/homag-intelligence-BraN723F.mjs.map +0 -1
- package/lib/imos-ix-poc-export-helper-D7ubISCJ.mjs +0 -180
- package/lib/imos-ix-poc-export-helper-D7ubISCJ.mjs.map +0 -1
- package/lib/index-C-Prfui2.mjs +0 -73502
- package/lib/index-C-Prfui2.mjs.map +0 -1
- package/lib/material-viewer-DyVGp6Xm.mjs +0 -450
- package/lib/material-viewer-DyVGp6Xm.mjs.map +0 -1
- package/lib/roomle-sdk.js.map +0 -1
- package/lib/static/asset-loader.worker.js +0 -1
- package/lib/static/draco/gltf/draco_decoder.js +0 -33
- package/lib/static/draco/gltf/draco_decoder.wasm +0 -0
- package/lib/static/draco/gltf/draco_encoder.js +0 -33
- package/lib/static/draco/gltf/draco_wasm_wrapper.js +0 -116
- package/lib/static/roomle-core-hsc/ConfiguratorKernel.js +0 -74
- package/lib/static/roomle-core-hsc/ConfiguratorKernel.wasm +0 -0
- package/lib/static/roomle-core-hsc/RoomleCore.js +0 -79
- package/lib/static/roomle-core-hsc/RoomleCore.wasm +0 -0
- package/lib/static/roomle-core-hsc/RoomleToolsCore.wasm +0 -0
- package/lib/static/roomle-core-hsc/configurableObject.d.ts +0 -30
- package/lib/static/roomle-core-hsc/configurableObject.js +0 -111
- package/lib/static/roomle-core-hsc/configurableObject.js.map +0 -1
- package/lib/static/roomle-core-hsc/configurationLoader.js +0 -349
- package/lib/static/roomle-core-hsc/configurationLoader.js.map +0 -1
- package/lib/static/roomle-core-hsc/configurationManager.js +0 -141
- package/lib/static/roomle-core-hsc/configurationManager.js.map +0 -1
- package/lib/static/roomle-core-hsc/embind/configuratorCallback.d.ts +0 -82
- package/lib/static/roomle-core-hsc/embind/configuratorCallback.js +0 -355
- package/lib/static/roomle-core-hsc/embind/configuratorCallback.js.map +0 -1
- package/lib/static/roomle-core-hsc/embind/configuratorCore.d.ts +0 -20
- package/lib/static/roomle-core-hsc/embind/configuratorCore.js +0 -50
- package/lib/static/roomle-core-hsc/embind/configuratorCore.js.map +0 -1
- package/lib/static/roomle-core-hsc/embind/configuratorCoreInterface.d.ts +0 -753
- package/lib/static/roomle-core-hsc/embind/configuratorCoreInterface.js +0 -99
- package/lib/static/roomle-core-hsc/embind/configuratorCoreInterface.js.map +0 -1
- package/lib/static/roomle-core-hsc/embind/configuratorUtils.d.ts +0 -3
- package/lib/static/roomle-core-hsc/embind/configuratorUtils.js +0 -52
- package/lib/static/roomle-core-hsc/embind/configuratorUtils.js.map +0 -1
- package/lib/static/roomle-core-hsc/embind/coreModue.d.ts +0 -4
- package/lib/static/roomle-core-hsc/embind/coreModue.js +0 -3
- package/lib/static/roomle-core-hsc/embind/coreModue.js.map +0 -1
- package/lib/static/roomle-core-hsc/embind/coreModule.d.ts +0 -11
- package/lib/static/roomle-core-hsc/embind/coreModule.js +0 -19
- package/lib/static/roomle-core-hsc/embind/coreModule.js.map +0 -1
- package/lib/static/roomle-core-hsc/embind/plannerCore.d.ts +0 -32
- package/lib/static/roomle-core-hsc/embind/plannerCoreCallback.d.ts +0 -39
- package/lib/static/roomle-core-hsc/embind/plannerCoreCallback.js.map +0 -1
- package/lib/static/roomle-core-hsc/embind/plannerCoreInterface.d.ts +0 -858
- package/lib/static/roomle-core-hsc/embind/plannerCoreInterface.js.map +0 -1
- package/lib/static/roomle-core-hsc/loader/configurableObject.js +0 -111
- package/lib/static/roomle-core-hsc/loader/configurableObject.js.map +0 -1
- package/lib/static/roomle-core-hsc/loader/configurationGeometryConstructor.d.ts +0 -21
- package/lib/static/roomle-core-hsc/loader/configurationGeometryConstructor.js +0 -90
- package/lib/static/roomle-core-hsc/loader/configurationGeometryConstructor.js.map +0 -1
- package/lib/static/roomle-core-hsc/loader/configurationLoader.d.ts +0 -116
- package/lib/static/roomle-core-hsc/loader/configurationLoader.js +0 -349
- package/lib/static/roomle-core-hsc/loader/configurationLoader.js.map +0 -1
- package/lib/static/roomle-core-hsc/loader/configurationManager.d.ts +0 -40
- package/lib/static/roomle-core-hsc/loader/configurationManager.js.map +0 -1
- package/lib/static/roomle-core-hsc/loader/planElementManager.d.ts +0 -96
- package/lib/static/roomle-core-hsc/loaderUtility.d.ts +0 -81
- package/lib/static/roomle-core-hsc/loaderUtility.js +0 -141
- package/lib/static/roomle-core-hsc/loaderUtility.js.map +0 -1
- package/lib/static/roomle-core-hsc/logger.d.ts +0 -29
- package/lib/static/roomle-core-hsc/logger.js +0 -61
- package/lib/static/roomle-core-hsc/logger.js.map +0 -1
- package/lib/static/roomle-core-hsc/package.json +0 -1
- package/lib/static/roomle-core-hsc/planElementManager.d.ts +0 -96
- package/lib/static/roomle-core-hsc/planElementManager.js +0 -300
- package/lib/static/roomle-core-hsc/planElementManager.js.map +0 -1
- package/lib/static/roomle-core-hsc/plannerCore.d.ts +0 -32
- package/lib/static/roomle-core-hsc/plannerCore.js +0 -111
- package/lib/static/roomle-core-hsc/plannerCore.js.map +0 -1
- package/lib/static/roomle-core-hsc/plannerCoreCallback.d.ts +0 -39
- package/lib/static/roomle-core-hsc/plannerCoreCallback.js +0 -116
- package/lib/static/roomle-core-hsc/plannerCoreCallback.js.map +0 -1
- package/lib/static/roomle-core-hsc/plannerCoreInterface.js +0 -98
- package/lib/static/roomle-core-hsc/plannerCoreInterface.js.map +0 -1
- package/lib/static/roomle-core-hsc/rapiAccess.d.ts +0 -70
- package/lib/static/roomle-core-hsc/rapiAccess.js +0 -227
- package/lib/static/roomle-core-hsc/rapiAccess.js.map +0 -1
- package/lib/static/roomle-core-hsc/serviceCore.d.ts +0 -20
- package/lib/static/roomle-core-hsc/serviceCore.js +0 -54
- package/lib/static/roomle-core-hsc/serviceCore.js.map +0 -1
- package/lib/static/roomle-core-hsc/serviceCoreInterface.d.ts +0 -13
- package/lib/static/roomle-core-hsc/serviceCoreInterface.js +0 -3
- package/lib/static/roomle-core-hsc/serviceCoreInterface.js.map +0 -1
- package/lib/static/roomle-core-hsc/src/embind/configuratorCallback.d.ts +0 -82
- package/lib/static/roomle-core-hsc/src/embind/configuratorCallback.js +0 -355
- package/lib/static/roomle-core-hsc/src/embind/configuratorCallback.js.map +0 -1
- package/lib/static/roomle-core-hsc/src/embind/configuratorCore.d.ts +0 -20
- package/lib/static/roomle-core-hsc/src/embind/configuratorCore.js +0 -50
- package/lib/static/roomle-core-hsc/src/embind/configuratorCore.js.map +0 -1
- package/lib/static/roomle-core-hsc/src/embind/configuratorCoreInterface.d.ts +0 -753
- package/lib/static/roomle-core-hsc/src/embind/configuratorCoreInterface.js +0 -99
- package/lib/static/roomle-core-hsc/src/embind/configuratorCoreInterface.js.map +0 -1
- package/lib/static/roomle-core-hsc/src/embind/configuratorUtils.d.ts +0 -3
- package/lib/static/roomle-core-hsc/src/embind/configuratorUtils.js +0 -52
- package/lib/static/roomle-core-hsc/src/embind/configuratorUtils.js.map +0 -1
- package/lib/static/roomle-core-hsc/src/embind/coreModue.d.ts +0 -4
- package/lib/static/roomle-core-hsc/src/embind/coreModue.js +0 -3
- package/lib/static/roomle-core-hsc/src/embind/coreModue.js.map +0 -1
- package/lib/static/roomle-core-hsc/src/embind/coreModule.d.ts +0 -11
- package/lib/static/roomle-core-hsc/src/embind/coreModule.js +0 -19
- package/lib/static/roomle-core-hsc/src/embind/coreModule.js.map +0 -1
- package/lib/static/roomle-core-hsc/src/embind/plannerCore.js +0 -111
- package/lib/static/roomle-core-hsc/src/embind/plannerCore.js.map +0 -1
- package/lib/static/roomle-core-hsc/src/embind/plannerCoreCallback.js +0 -116
- package/lib/static/roomle-core-hsc/src/embind/plannerCoreCallback.js.map +0 -1
- package/lib/static/roomle-core-hsc/src/embind/plannerCoreInterface.d.ts +0 -858
- package/lib/static/roomle-core-hsc/src/embind/plannerCoreInterface.js +0 -98
- package/lib/static/roomle-core-hsc/src/embind/plannerCoreInterface.js.map +0 -1
- package/lib/static/roomle-core-hsc/src/embind/serviceCore.d.ts +0 -20
- package/lib/static/roomle-core-hsc/src/embind/serviceCore.js +0 -54
- package/lib/static/roomle-core-hsc/src/embind/serviceCore.js.map +0 -1
- package/lib/static/roomle-core-hsc/src/embind/serviceCoreInterface.d.ts +0 -13
- package/lib/static/roomle-core-hsc/src/embind/serviceCoreInterface.js +0 -3
- package/lib/static/roomle-core-hsc/src/embind/serviceCoreInterface.js.map +0 -1
- package/lib/static/roomle-core-hsc/src/embind/toolsCore.d.ts +0 -17
- package/lib/static/roomle-core-hsc/src/embind/toolsCore.js +0 -75
- package/lib/static/roomle-core-hsc/src/embind/toolsCore.js.map +0 -1
- package/lib/static/roomle-core-hsc/src/embind/toolsCoreInterface.d.ts +0 -40
- package/lib/static/roomle-core-hsc/src/embind/toolsCoreInterface.js +0 -8
- package/lib/static/roomle-core-hsc/src/embind/toolsCoreInterface.js.map +0 -1
- package/lib/static/roomle-core-hsc/src/loader/configurableObject.d.ts +0 -30
- package/lib/static/roomle-core-hsc/src/loader/configurableObject.js.map +0 -1
- package/lib/static/roomle-core-hsc/src/loader/configurationGeometryConstructor.d.ts +0 -21
- package/lib/static/roomle-core-hsc/src/loader/configurationGeometryConstructor.js +0 -90
- package/lib/static/roomle-core-hsc/src/loader/configurationGeometryConstructor.js.map +0 -1
- package/lib/static/roomle-core-hsc/src/loader/configurationLoader.d.ts +0 -116
- package/lib/static/roomle-core-hsc/src/loader/configurationLoader.js.map +0 -1
- package/lib/static/roomle-core-hsc/src/loader/configurationManager.d.ts +0 -40
- package/lib/static/roomle-core-hsc/src/loader/configurationManager.js +0 -141
- package/lib/static/roomle-core-hsc/src/loader/configurationManager.js.map +0 -1
- package/lib/static/roomle-core-hsc/src/loader/loaderUtility.d.ts +0 -81
- package/lib/static/roomle-core-hsc/src/loader/loaderUtility.js +0 -141
- package/lib/static/roomle-core-hsc/src/loader/loaderUtility.js.map +0 -1
- package/lib/static/roomle-core-hsc/src/loader/logger.d.ts +0 -29
- package/lib/static/roomle-core-hsc/src/loader/logger.js +0 -61
- package/lib/static/roomle-core-hsc/src/loader/logger.js.map +0 -1
- package/lib/static/roomle-core-hsc/src/loader/planElementManager.js +0 -300
- package/lib/static/roomle-core-hsc/src/loader/planElementManager.js.map +0 -1
- package/lib/static/roomle-core-hsc/src/loader/rapiAccess.d.ts +0 -70
- package/lib/static/roomle-core-hsc/src/loader/rapiAccess.js +0 -227
- package/lib/static/roomle-core-hsc/src/loader/rapiAccess.js.map +0 -1
- package/lib/static/roomle-core-hsc/toolsCore.d.ts +0 -17
- package/lib/static/roomle-core-hsc/toolsCore.js +0 -75
- package/lib/static/roomle-core-hsc/toolsCore.js.map +0 -1
- package/lib/static/roomle-core-hsc/toolsCoreInterface.d.ts +0 -40
- package/lib/static/roomle-core-hsc/toolsCoreInterface.js +0 -8
- package/lib/static/roomle-core-hsc/toolsCoreInterface.js.map +0 -1
- package/lib/static/roomle-core-hsc/wasm_modern/ConfiguratorKernel.wasm +0 -0
- package/lib/static/roomle-core-hsc/wasm_modern/RoomleCore.wasm +0 -0
- package/lib/static/roomle-core-hsc/wasm_modern/RoomleToolsCore.js +0 -74
- package/lib/static/roomle-core-hsc/wasm_modern/RoomleToolsCore.wasm +0 -0
- package/lib/stats-helper-UQlUyOTj.mjs +0 -108
- package/lib/stats-helper-UQlUyOTj.mjs.map +0 -1
- package/lib/three.webgpu-sHJcp001.mjs +0 -27625
- package/lib/three.webgpu-sHJcp001.mjs.map +0 -1
- package/lib/tools-core-wkPFRdnH.mjs +0 -36
- package/lib/tools-core-wkPFRdnH.mjs.map +0 -1
- /package/lib/static/draco/{README.md → node_modules/three/examples/jsm/libs/draco/README.md} +0 -0
- /package/lib/static/draco/{draco_decoder.js → node_modules/three/examples/jsm/libs/draco/gltf/draco_decoder.js} +0 -0
- /package/lib/static/draco/{draco_decoder.wasm → node_modules/three/examples/jsm/libs/draco/gltf/draco_decoder.wasm} +0 -0
- /package/lib/static/draco/{draco_encoder.js → node_modules/three/examples/jsm/libs/draco/gltf/draco_encoder.js} +0 -0
- /package/lib/static/draco/{draco_wasm_wrapper.js → node_modules/three/examples/jsm/libs/draco/gltf/draco_wasm_wrapper.js} +0 -0
- /package/lib/static/{budgeteer.sw.js → packages/workers/generated/budgeteer.sw.js} +0 -0
- /package/lib/static/roomle-core-hsc/{configuratorCallback.d.ts → node_modules/roomle-core-hsc/src/embind/configuratorCallback.d.ts} +0 -0
- /package/lib/static/roomle-core-hsc/{configuratorCallback.js → node_modules/roomle-core-hsc/src/embind/configuratorCallback.js} +0 -0
- /package/lib/static/roomle-core-hsc/{configuratorCallback.js.map → node_modules/roomle-core-hsc/src/embind/configuratorCallback.js.map} +0 -0
- /package/lib/static/roomle-core-hsc/{configuratorCore.js → node_modules/roomle-core-hsc/src/embind/configuratorCore.js} +0 -0
- /package/lib/static/roomle-core-hsc/{configuratorCore.js.map → node_modules/roomle-core-hsc/src/embind/configuratorCore.js.map} +0 -0
- /package/lib/static/roomle-core-hsc/{configuratorCoreInterface.js → node_modules/roomle-core-hsc/src/embind/configuratorCoreInterface.js} +0 -0
- /package/lib/static/roomle-core-hsc/{configuratorCoreInterface.js.map → node_modules/roomle-core-hsc/src/embind/configuratorCoreInterface.js.map} +0 -0
- /package/lib/static/roomle-core-hsc/{configuratorUtils.d.ts → node_modules/roomle-core-hsc/src/embind/configuratorUtils.d.ts} +0 -0
- /package/lib/static/roomle-core-hsc/{configuratorUtils.js → node_modules/roomle-core-hsc/src/embind/configuratorUtils.js} +0 -0
- /package/lib/static/roomle-core-hsc/{configuratorUtils.js.map → node_modules/roomle-core-hsc/src/embind/configuratorUtils.js.map} +0 -0
- /package/lib/static/roomle-core-hsc/{coreModue.d.ts → node_modules/roomle-core-hsc/src/embind/coreModue.d.ts} +0 -0
- /package/lib/static/roomle-core-hsc/{coreModue.js → node_modules/roomle-core-hsc/src/embind/coreModue.js} +0 -0
- /package/lib/static/roomle-core-hsc/{coreModue.js.map → node_modules/roomle-core-hsc/src/embind/coreModue.js.map} +0 -0
- /package/lib/static/roomle-core-hsc/{coreModule.d.ts → node_modules/roomle-core-hsc/src/embind/coreModule.d.ts} +0 -0
- /package/lib/static/roomle-core-hsc/{coreModule.js → node_modules/roomle-core-hsc/src/embind/coreModule.js} +0 -0
- /package/lib/static/roomle-core-hsc/{coreModule.js.map → node_modules/roomle-core-hsc/src/embind/coreModule.js.map} +0 -0
- /package/lib/static/roomle-core-hsc/{embind → node_modules/roomle-core-hsc/src/embind}/plannerCore.js +0 -0
- /package/lib/static/roomle-core-hsc/{embind → node_modules/roomle-core-hsc/src/embind}/plannerCore.js.map +0 -0
- /package/lib/static/roomle-core-hsc/{embind → node_modules/roomle-core-hsc/src/embind}/serviceCore.d.ts +0 -0
- /package/lib/static/roomle-core-hsc/{embind → node_modules/roomle-core-hsc/src/embind}/serviceCore.js +0 -0
- /package/lib/static/roomle-core-hsc/{embind → node_modules/roomle-core-hsc/src/embind}/serviceCore.js.map +0 -0
- /package/lib/static/roomle-core-hsc/{embind → node_modules/roomle-core-hsc/src/embind}/serviceCoreInterface.d.ts +0 -0
- /package/lib/static/roomle-core-hsc/{embind → node_modules/roomle-core-hsc/src/embind}/serviceCoreInterface.js +0 -0
- /package/lib/static/roomle-core-hsc/{embind → node_modules/roomle-core-hsc/src/embind}/serviceCoreInterface.js.map +0 -0
- /package/lib/static/roomle-core-hsc/{embind → node_modules/roomle-core-hsc/src/embind}/toolsCore.d.ts +0 -0
- /package/lib/static/roomle-core-hsc/{embind → node_modules/roomle-core-hsc/src/embind}/toolsCore.js +0 -0
- /package/lib/static/roomle-core-hsc/{embind → node_modules/roomle-core-hsc/src/embind}/toolsCore.js.map +0 -0
- /package/lib/static/roomle-core-hsc/{embind → node_modules/roomle-core-hsc/src/embind}/toolsCoreInterface.d.ts +0 -0
- /package/lib/static/roomle-core-hsc/{embind → node_modules/roomle-core-hsc/src/embind}/toolsCoreInterface.js +0 -0
- /package/lib/static/roomle-core-hsc/{embind → node_modules/roomle-core-hsc/src/embind}/toolsCoreInterface.js.map +0 -0
- /package/lib/static/roomle-core-hsc/{configurationGeometryConstructor.d.ts → node_modules/roomle-core-hsc/src/loader/configurationGeometryConstructor.d.ts} +0 -0
- /package/lib/static/roomle-core-hsc/{configurationGeometryConstructor.js → node_modules/roomle-core-hsc/src/loader/configurationGeometryConstructor.js} +0 -0
- /package/lib/static/roomle-core-hsc/{configurationGeometryConstructor.js.map → node_modules/roomle-core-hsc/src/loader/configurationGeometryConstructor.js.map} +0 -0
- /package/lib/static/roomle-core-hsc/{configurationLoader.d.ts → node_modules/roomle-core-hsc/src/loader/configurationLoader.d.ts} +0 -0
- /package/lib/static/roomle-core-hsc/{loader → node_modules/roomle-core-hsc/src/loader}/loaderUtility.d.ts +0 -0
- /package/lib/static/roomle-core-hsc/{loader → node_modules/roomle-core-hsc/src/loader}/loaderUtility.js +0 -0
- /package/lib/static/roomle-core-hsc/{loader → node_modules/roomle-core-hsc/src/loader}/loaderUtility.js.map +0 -0
- /package/lib/static/roomle-core-hsc/{loader → node_modules/roomle-core-hsc/src/loader}/logger.d.ts +0 -0
- /package/lib/static/roomle-core-hsc/{loader → node_modules/roomle-core-hsc/src/loader}/logger.js +0 -0
- /package/lib/static/roomle-core-hsc/{loader → node_modules/roomle-core-hsc/src/loader}/logger.js.map +0 -0
- /package/lib/static/roomle-core-hsc/{loader → node_modules/roomle-core-hsc/src/loader}/planElementManager.js +0 -0
- /package/lib/static/roomle-core-hsc/{loader → node_modules/roomle-core-hsc/src/loader}/rapiAccess.d.ts +0 -0
- /package/lib/static/roomle-core-hsc/{loader → node_modules/roomle-core-hsc/src/loader}/rapiAccess.js +0 -0
- /package/lib/static/roomle-core-hsc/{loader → node_modules/roomle-core-hsc/src/loader}/rapiAccess.js.map +0 -0
- /package/lib/static/roomle-core-hsc/{RoomleToolsCore.js → node_modules/roomle-core-hsc/wasm_modern/RoomleToolsCore.js} +0 -0
|
@@ -1,1286 +0,0 @@
|
|
|
1
|
-
import { f as $, aV as J, as as v, bs as ee, aA as S, bD as se, et as B, fv as te, bZ as ne, dv as k, aT as ie, eR as re, j as oe, fe as z, eU as ae, aM as K, aJ as ce, bP as ue, bO as le, bN as fe, aS as he, bM as pe, bL as de, bJ as xe, bK as ye, bI as ge, eV as Te } from "./index-C-Prfui2.mjs";
|
|
2
|
-
const Y = {
|
|
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 H {
|
|
31
|
-
/**
|
|
32
|
-
* Constructs a new glTF exporter.
|
|
33
|
-
*/
|
|
34
|
-
constructor() {
|
|
35
|
-
this.textureUtils = null, this.pluginCallbacks = [], this.register(function(e) {
|
|
36
|
-
return new Le(e);
|
|
37
|
-
}), this.register(function(e) {
|
|
38
|
-
return new _e(e);
|
|
39
|
-
}), this.register(function(e) {
|
|
40
|
-
return new Oe(e);
|
|
41
|
-
}), this.register(function(e) {
|
|
42
|
-
return new ve(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 Ue(e);
|
|
49
|
-
}), this.register(function(e) {
|
|
50
|
-
return new Ce(e);
|
|
51
|
-
}), this.register(function(e) {
|
|
52
|
-
return new Fe(e);
|
|
53
|
-
}), this.register(function(e) {
|
|
54
|
-
return new Be(e);
|
|
55
|
-
}), this.register(function(e) {
|
|
56
|
-
return new Ge(e);
|
|
57
|
-
}), this.register(function(e) {
|
|
58
|
-
return new Pe(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, n, t) {
|
|
106
|
-
const i = new Se(), r = [];
|
|
107
|
-
for (let o = 0, c = this.pluginCallbacks.length; o < c; o++)
|
|
108
|
-
r.push(this.pluginCallbacks[o](i));
|
|
109
|
-
i.setPlugins(r), i.setTextureUtils(this.textureUtils), i.writeAsync(e, s, t).catch(n);
|
|
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 n = this;
|
|
120
|
-
return new Promise(function(t, i) {
|
|
121
|
-
n.parse(e, t, i, s);
|
|
122
|
-
});
|
|
123
|
-
}
|
|
124
|
-
}
|
|
125
|
-
const g = {
|
|
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", R = {};
|
|
150
|
-
R[ue] = g.NEAREST;
|
|
151
|
-
R[le] = g.NEAREST_MIPMAP_NEAREST;
|
|
152
|
-
R[fe] = g.NEAREST_MIPMAP_LINEAR;
|
|
153
|
-
R[he] = g.LINEAR;
|
|
154
|
-
R[pe] = g.LINEAR_MIPMAP_NEAREST;
|
|
155
|
-
R[de] = g.LINEAR_MIPMAP_LINEAR;
|
|
156
|
-
R[xe] = g.CLAMP_TO_EDGE;
|
|
157
|
-
R[ye] = g.REPEAT;
|
|
158
|
-
R[ge] = g.MIRRORED_REPEAT;
|
|
159
|
-
const j = {
|
|
160
|
-
scale: "scale",
|
|
161
|
-
position: "translation",
|
|
162
|
-
quaternion: "rotation",
|
|
163
|
-
morphTargetInfluences: "weights"
|
|
164
|
-
}, we = new $(), q = 12, me = 1179937895, Me = 2, W = 8, Ae = 1313821514, Ee = 5130562;
|
|
165
|
-
function F(a, e) {
|
|
166
|
-
return a.length === e.length && a.every(function(s, n) {
|
|
167
|
-
return s === e[n];
|
|
168
|
-
});
|
|
169
|
-
}
|
|
170
|
-
function Ie(a) {
|
|
171
|
-
return new TextEncoder().encode(a).buffer;
|
|
172
|
-
}
|
|
173
|
-
function Re(a) {
|
|
174
|
-
return F(a.elements, [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1]);
|
|
175
|
-
}
|
|
176
|
-
function be(a, e, s) {
|
|
177
|
-
const n = {
|
|
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 i = 0; i < a.itemSize; i++) {
|
|
183
|
-
let r;
|
|
184
|
-
a.itemSize > 4 ? r = a.array[t * a.itemSize + i] : (i === 0 ? r = a.getX(t) : i === 1 ? r = a.getY(t) : i === 2 ? r = a.getZ(t) : i === 3 && (r = a.getW(t)), a.normalized === !0 && (r = k.normalize(r, a.array))), n.min[i] = Math.min(n.min[i], r), n.max[i] = Math.max(n.max[i], r);
|
|
185
|
-
}
|
|
186
|
-
return n;
|
|
187
|
-
}
|
|
188
|
-
function Z(a) {
|
|
189
|
-
return Math.ceil(a / 4) * 4;
|
|
190
|
-
}
|
|
191
|
-
function P(a, e = 0) {
|
|
192
|
-
const s = Z(a.byteLength);
|
|
193
|
-
if (s !== a.byteLength) {
|
|
194
|
-
const n = new Uint8Array(s);
|
|
195
|
-
if (n.set(new Uint8Array(a)), e !== 0)
|
|
196
|
-
for (let t = a.byteLength; t < s; t++)
|
|
197
|
-
n[t] = e;
|
|
198
|
-
return n.buffer;
|
|
199
|
-
}
|
|
200
|
-
return a;
|
|
201
|
-
}
|
|
202
|
-
function X() {
|
|
203
|
-
return typeof document > "u" && typeof OffscreenCanvas < "u" ? new OffscreenCanvas(1, 1) : document.createElement("canvas");
|
|
204
|
-
}
|
|
205
|
-
function Ne(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 Se {
|
|
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, n = {}) {
|
|
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
|
-
}, n), this.options.animations.length > 0 && (this.options.trs = !0), await this.processInputAsync(e), await Promise.all(this.pending);
|
|
254
|
-
const t = this, i = t.buffers, r = t.json;
|
|
255
|
-
n = t.options;
|
|
256
|
-
const o = t.extensionsUsed, c = t.extensionsRequired, l = new Blob(i, { type: "application/octet-stream" }), h = Object.keys(o), u = Object.keys(c);
|
|
257
|
-
if (h.length > 0 && (r.extensionsUsed = h), u.length > 0 && (r.extensionsRequired = u), r.buffers && r.buffers.length > 0 && (r.buffers[0].byteLength = l.size), n.binary === !0) {
|
|
258
|
-
const T = new FileReader();
|
|
259
|
-
T.readAsArrayBuffer(l), T.onloadend = function() {
|
|
260
|
-
const f = P(T.result), d = new DataView(new ArrayBuffer(W));
|
|
261
|
-
d.setUint32(0, f.byteLength, !0), d.setUint32(4, Ee, !0);
|
|
262
|
-
const x = P(Ie(JSON.stringify(r)), 32), y = new DataView(new ArrayBuffer(W));
|
|
263
|
-
y.setUint32(0, x.byteLength, !0), y.setUint32(4, Ae, !0);
|
|
264
|
-
const M = new ArrayBuffer(q), b = new DataView(M);
|
|
265
|
-
b.setUint32(0, me, !0), b.setUint32(4, Me, !0);
|
|
266
|
-
const O = q + y.byteLength + x.byteLength + d.byteLength + f.byteLength;
|
|
267
|
-
b.setUint32(8, O, !0);
|
|
268
|
-
const p = new Blob([
|
|
269
|
-
M,
|
|
270
|
-
y,
|
|
271
|
-
x,
|
|
272
|
-
d,
|
|
273
|
-
f
|
|
274
|
-
], { type: "application/octet-stream" }), w = new FileReader();
|
|
275
|
-
w.readAsArrayBuffer(p), w.onloadend = function() {
|
|
276
|
-
s(w.result);
|
|
277
|
-
};
|
|
278
|
-
};
|
|
279
|
-
} else if (r.buffers && r.buffers.length > 0) {
|
|
280
|
-
const T = new FileReader();
|
|
281
|
-
T.readAsDataURL(l), T.onloadend = function() {
|
|
282
|
-
const f = T.result;
|
|
283
|
-
r.buffers[0].uri = f, s(r);
|
|
284
|
-
};
|
|
285
|
-
} else
|
|
286
|
-
s(r);
|
|
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 n = this.options, t = this.extensionsUsed;
|
|
297
|
-
try {
|
|
298
|
-
const i = JSON.parse(JSON.stringify(e.userData));
|
|
299
|
-
if (n.includeCustomExtensions && i.gltfExtensions) {
|
|
300
|
-
s.extensions === void 0 && (s.extensions = {});
|
|
301
|
-
for (const r in i.gltfExtensions)
|
|
302
|
-
s.extensions[r] = i.gltfExtensions[r], t[r] = !0;
|
|
303
|
-
delete i.gltfExtensions;
|
|
304
|
-
}
|
|
305
|
-
Object.keys(i).length > 0 && (s.extras = i);
|
|
306
|
-
} catch (i) {
|
|
307
|
-
console.warn("THREE.GLTFExporter: userData of '" + e.name + "' won't be serialized because of JSON.stringify error - " + i.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 n = new v();
|
|
333
|
-
for (let t = 0, i = e.count; t < i; t++)
|
|
334
|
-
if (Math.abs(n.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 n = e.clone(), t = new v();
|
|
348
|
-
for (let i = 0, r = n.count; i < r; i++)
|
|
349
|
-
t.fromBufferAttribute(n, i), t.x === 0 && t.y === 0 && t.z === 0 ? t.setX(1) : t.normalize(), n.setXYZ(i, t.x, t.y, t.z);
|
|
350
|
-
return s.attributesNormalized.set(e, n), n;
|
|
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 n = !1;
|
|
361
|
-
const t = {};
|
|
362
|
-
(s.offset.x !== 0 || s.offset.y !== 0) && (t.offset = s.offset.toArray(), n = !0), s.rotation !== 0 && (t.rotation = s.rotation, n = !0), (s.repeat.x !== 1 || s.repeat.y !== 1) && (t.scale = s.repeat.toArray(), n = !0), n && (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 n(f) {
|
|
367
|
-
return f.colorSpace === ce ? function(x) {
|
|
368
|
-
return x < 0.04045 ? x * 0.0773993808 : Math.pow(x * 0.9478672986 + 0.0521327014, 2.4);
|
|
369
|
-
} : function(x) {
|
|
370
|
-
return x;
|
|
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, i = s ? s.image : null, r = Math.max(t ? t.width : 0, i ? i.width : 0), o = Math.max(t ? t.height : 0, i ? i.height : 0), c = X();
|
|
375
|
-
c.width = r, c.height = o;
|
|
376
|
-
const l = c.getContext("2d", {
|
|
377
|
-
willReadFrequently: !0
|
|
378
|
-
});
|
|
379
|
-
l.fillStyle = "#00ffff", l.fillRect(0, 0, r, o);
|
|
380
|
-
const h = l.getImageData(0, 0, r, o);
|
|
381
|
-
if (t) {
|
|
382
|
-
l.drawImage(t, 0, 0, r, o);
|
|
383
|
-
const f = n(e), d = l.getImageData(0, 0, r, o).data;
|
|
384
|
-
for (let x = 2; x < d.length; x += 4)
|
|
385
|
-
h.data[x] = f(d[x] / 256) * 256;
|
|
386
|
-
}
|
|
387
|
-
if (i) {
|
|
388
|
-
l.drawImage(i, 0, 0, r, o);
|
|
389
|
-
const f = n(s), d = l.getImageData(0, 0, r, o).data;
|
|
390
|
-
for (let x = 1; x < d.length; x += 4)
|
|
391
|
-
h.data[x] = f(d[x] / 256) * 256;
|
|
392
|
-
}
|
|
393
|
-
l.putImageData(h, 0, 0);
|
|
394
|
-
const T = (e || s).clone();
|
|
395
|
-
return T.source = new te(c), T.colorSpace = ne, T.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."), T;
|
|
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, n = this.buffers;
|
|
409
|
-
return s.buffers || (s.buffers = [{ byteLength: 0 }]), n.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, n, t, i) {
|
|
421
|
-
const r = this.json;
|
|
422
|
-
r.bufferViews || (r.bufferViews = []);
|
|
423
|
-
let o;
|
|
424
|
-
switch (s) {
|
|
425
|
-
case g.BYTE:
|
|
426
|
-
case g.UNSIGNED_BYTE:
|
|
427
|
-
o = 1;
|
|
428
|
-
break;
|
|
429
|
-
case g.SHORT:
|
|
430
|
-
case g.UNSIGNED_SHORT:
|
|
431
|
-
o = 2;
|
|
432
|
-
break;
|
|
433
|
-
default:
|
|
434
|
-
o = 4;
|
|
435
|
-
}
|
|
436
|
-
let c = e.itemSize * o;
|
|
437
|
-
i === g.ARRAY_BUFFER && (c = Math.ceil(c / 4) * 4);
|
|
438
|
-
const l = Z(t * c), h = new DataView(new ArrayBuffer(l));
|
|
439
|
-
let u = 0;
|
|
440
|
-
for (let d = n; d < n + t; d++) {
|
|
441
|
-
for (let x = 0; x < e.itemSize; x++) {
|
|
442
|
-
let y;
|
|
443
|
-
e.itemSize > 4 ? y = e.array[d * e.itemSize + x] : (x === 0 ? y = e.getX(d) : x === 1 ? y = e.getY(d) : x === 2 ? y = e.getZ(d) : x === 3 && (y = e.getW(d)), e.normalized === !0 && (y = k.normalize(y, e.array))), s === g.FLOAT ? h.setFloat32(u, y, !0) : s === g.INT ? h.setInt32(u, y, !0) : s === g.UNSIGNED_INT ? h.setUint32(u, y, !0) : s === g.SHORT ? h.setInt16(u, y, !0) : s === g.UNSIGNED_SHORT ? h.setUint16(u, y, !0) : s === g.BYTE ? h.setInt8(u, y) : s === g.UNSIGNED_BYTE && h.setUint8(u, y), u += o;
|
|
444
|
-
}
|
|
445
|
-
u % c !== 0 && (u += c - u % c);
|
|
446
|
-
}
|
|
447
|
-
const T = {
|
|
448
|
-
buffer: this.processBuffer(h.buffer),
|
|
449
|
-
byteOffset: this.byteOffset,
|
|
450
|
-
byteLength: l
|
|
451
|
-
};
|
|
452
|
-
return i !== void 0 && (T.target = i), i === g.ARRAY_BUFFER && (T.byteStride = c), this.byteOffset += l, r.bufferViews.push(T), {
|
|
453
|
-
id: r.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, n = s.json;
|
|
464
|
-
return n.bufferViews || (n.bufferViews = []), new Promise(function(t) {
|
|
465
|
-
const i = new FileReader();
|
|
466
|
-
i.readAsArrayBuffer(e), i.onloadend = function() {
|
|
467
|
-
const r = P(i.result), o = {
|
|
468
|
-
buffer: s.processBuffer(r),
|
|
469
|
-
byteOffset: s.byteOffset,
|
|
470
|
-
byteLength: r.byteLength
|
|
471
|
-
};
|
|
472
|
-
s.byteOffset += r.byteLength, t(n.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, n, t) {
|
|
485
|
-
const i = this.json, r = {
|
|
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 = g.FLOAT;
|
|
496
|
-
else if (e.array.constructor === Int32Array)
|
|
497
|
-
o = g.INT;
|
|
498
|
-
else if (e.array.constructor === Uint32Array)
|
|
499
|
-
o = g.UNSIGNED_INT;
|
|
500
|
-
else if (e.array.constructor === Int16Array)
|
|
501
|
-
o = g.SHORT;
|
|
502
|
-
else if (e.array.constructor === Uint16Array)
|
|
503
|
-
o = g.UNSIGNED_SHORT;
|
|
504
|
-
else if (e.array.constructor === Int8Array)
|
|
505
|
-
o = g.BYTE;
|
|
506
|
-
else if (e.array.constructor === Uint8Array)
|
|
507
|
-
o = g.UNSIGNED_BYTE;
|
|
508
|
-
else
|
|
509
|
-
throw new Error("THREE.GLTFExporter: Unsupported bufferAttribute component type: " + e.array.constructor.name);
|
|
510
|
-
if (n === void 0 && (n = 0), (t === void 0 || t === 1 / 0) && (t = e.count), t === 0) return null;
|
|
511
|
-
const c = be(e, n, t);
|
|
512
|
-
let l;
|
|
513
|
-
s !== void 0 && (l = e === s.index ? g.ELEMENT_ARRAY_BUFFER : g.ARRAY_BUFFER);
|
|
514
|
-
const h = this.processBufferView(e, o, n, t, l), u = {
|
|
515
|
-
bufferView: h.id,
|
|
516
|
-
byteOffset: h.byteOffset,
|
|
517
|
-
componentType: o,
|
|
518
|
-
count: t,
|
|
519
|
-
max: c.max,
|
|
520
|
-
min: c.min,
|
|
521
|
-
type: r[e.itemSize]
|
|
522
|
-
};
|
|
523
|
-
return e.normalized === !0 && (u.normalized = !0), i.accessors || (i.accessors = []), i.accessors.push(u) - 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, n, t = "image/png") {
|
|
534
|
-
if (e !== null) {
|
|
535
|
-
const i = this, r = i.cache, o = i.json, c = i.options, l = i.pending;
|
|
536
|
-
r.images.has(e) || r.images.set(e, {});
|
|
537
|
-
const h = r.images.get(e), u = t + ":flipY/" + n.toString();
|
|
538
|
-
if (h[u] !== void 0) return h[u];
|
|
539
|
-
o.images || (o.images = []);
|
|
540
|
-
const T = { mimeType: t }, f = X();
|
|
541
|
-
f.width = Math.min(e.width, c.maxTextureSize), f.height = Math.min(e.height, c.maxTextureSize);
|
|
542
|
-
const d = f.getContext("2d", {
|
|
543
|
-
willReadFrequently: !0
|
|
544
|
-
});
|
|
545
|
-
if (n === !0 && (d.translate(0, f.height), d.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 y = new Uint8ClampedArray(e.height * e.width * 4);
|
|
548
|
-
for (let M = 0; M < y.length; M += 4)
|
|
549
|
-
y[M + 0] = e.data[M + 0], y[M + 1] = e.data[M + 1], y[M + 2] = e.data[M + 2], y[M + 3] = e.data[M + 3];
|
|
550
|
-
d.putImageData(new ImageData(y, 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
|
-
d.drawImage(e, 0, 0, f.width, f.height);
|
|
553
|
-
else
|
|
554
|
-
throw new Error("THREE.GLTFExporter: Invalid image type. Use HTMLImageElement, HTMLCanvasElement, ImageBitmap or OffscreenCanvas.");
|
|
555
|
-
c.binary === !0 ? l.push(
|
|
556
|
-
Ne(f, t).then((y) => i.processBufferViewImage(y)).then((y) => {
|
|
557
|
-
T.bufferView = y;
|
|
558
|
-
})
|
|
559
|
-
) : T.uri = re.getDataURL(f, t);
|
|
560
|
-
const x = o.images.push(T) - 1;
|
|
561
|
-
return h[u] = x, x;
|
|
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 n = {
|
|
574
|
-
magFilter: R[e.magFilter],
|
|
575
|
-
minFilter: R[e.minFilter],
|
|
576
|
-
wrapS: R[e.wrapS],
|
|
577
|
-
wrapT: R[e.wrapT]
|
|
578
|
-
};
|
|
579
|
-
return s.samplers.push(n) - 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 n = this.options, t = this.cache, i = this.json;
|
|
588
|
-
if (t.textures.has(e)) return t.textures.get(e);
|
|
589
|
-
i.textures || (i.textures = []), e instanceof B && (e = await this.decompressTextureAsync(e, n.maxTextureSize));
|
|
590
|
-
let r = e.userData.mimeType;
|
|
591
|
-
r === "image/webp" && (r = "image/png");
|
|
592
|
-
const o = {
|
|
593
|
-
sampler: this.processSampler(e),
|
|
594
|
-
source: this.processImage(e.image, e.format, e.flipY, r)
|
|
595
|
-
};
|
|
596
|
-
e.name && (o.name = e.name), await this._invokeAllAsync(async function(l) {
|
|
597
|
-
l.writeTexture && await l.writeTexture(e, o);
|
|
598
|
-
});
|
|
599
|
-
const c = i.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, n = 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
|
-
n.materials || (n.materials = []);
|
|
613
|
-
const t = { pbrMetallicRoughness: {} };
|
|
614
|
-
e.isMeshStandardMaterial !== !0 && e.isMeshBasicMaterial !== !0 && console.warn("GLTFExporter: Use MeshStandardMaterial or MeshBasicMaterial for best results.");
|
|
615
|
-
const i = e.color.toArray().concat([e.opacity]);
|
|
616
|
-
if (F(i, [1, 1, 1, 1]) || (t.pbrMetallicRoughness.baseColorFactor = i), 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 l = {
|
|
634
|
-
index: await this.processTextureAsync(e.emissiveMap),
|
|
635
|
-
texCoord: e.emissiveMap.channel
|
|
636
|
-
};
|
|
637
|
-
this.applyTextureTransform(l, e.emissiveMap), t.emissiveTexture = l;
|
|
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 r = n.materials.push(t) - 1;
|
|
658
|
-
return s.materials.set(e, r), r;
|
|
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, n = this.json, t = [e.geometry.uuid];
|
|
667
|
-
if (Array.isArray(e.material))
|
|
668
|
-
for (let p = 0, w = e.material.length; p < w; p++)
|
|
669
|
-
t.push(e.material[p].uuid);
|
|
670
|
-
else
|
|
671
|
-
t.push(e.material.uuid);
|
|
672
|
-
const i = t.join(":");
|
|
673
|
-
if (s.meshes.has(i)) return s.meshes.get(i);
|
|
674
|
-
const r = e.geometry;
|
|
675
|
-
let o;
|
|
676
|
-
e.isLineSegments ? o = g.LINES : e.isLineLoop ? o = g.LINE_LOOP : e.isLine ? o = g.LINE_STRIP : e.isPoints ? o = g.POINTS : o = e.material.wireframe ? g.LINES : g.TRIANGLES;
|
|
677
|
-
const c = {}, l = {}, h = [], u = [], T = {
|
|
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
|
-
}, f = r.getAttribute("normal");
|
|
686
|
-
f !== void 0 && !this.isNormalizedNormalAttribute(f) && (console.warn("THREE.GLTFExporter: Creating normalized normal attribute from the non-normalized one."), r.setAttribute("normal", this.createNormalizedNormalAttribute(f)));
|
|
687
|
-
let d = null;
|
|
688
|
-
for (let p in r.attributes) {
|
|
689
|
-
if (p.slice(0, 5) === "morph") continue;
|
|
690
|
-
const w = r.attributes[p];
|
|
691
|
-
if (p = T[p] || p.toUpperCase(), /^(POSITION|NORMAL|TANGENT|TEXCOORD_\d+|COLOR_\d+|JOINTS_\d+|WEIGHTS_\d+)$/.test(p) || (p = "_" + p), s.attributes.has(this.getUID(w))) {
|
|
692
|
-
l[p] = s.attributes.get(this.getUID(w));
|
|
693
|
-
continue;
|
|
694
|
-
}
|
|
695
|
-
d = null;
|
|
696
|
-
const m = w.array;
|
|
697
|
-
p === "JOINTS_0" && !(m instanceof Uint16Array) && !(m instanceof Uint8Array) ? (console.warn('GLTFExporter: Attribute "skinIndex" converted to type UNSIGNED_SHORT.'), d = new S(new Uint16Array(m), w.itemSize, w.normalized)) : (m instanceof Uint32Array || m instanceof Int32Array) && !p.startsWith("_") && (console.warn(`GLTFExporter: Attribute "${p}" converted to type FLOAT.`), d = H.Utils.toFloat32BufferAttribute(w));
|
|
698
|
-
const I = this.processAccessor(d || w, r);
|
|
699
|
-
I !== null && (p.startsWith("_") || this.detectMeshQuantization(p, w), l[p] = I, s.attributes.set(this.getUID(w), I));
|
|
700
|
-
}
|
|
701
|
-
if (f !== void 0 && r.setAttribute("normal", f), Object.keys(l).length === 0) return null;
|
|
702
|
-
if (e.morphTargetInfluences !== void 0 && e.morphTargetInfluences.length > 0) {
|
|
703
|
-
const p = [], w = [], A = {};
|
|
704
|
-
if (e.morphTargetDictionary !== void 0)
|
|
705
|
-
for (const m in e.morphTargetDictionary)
|
|
706
|
-
A[e.morphTargetDictionary[m]] = m;
|
|
707
|
-
for (let m = 0; m < e.morphTargetInfluences.length; ++m) {
|
|
708
|
-
const I = {};
|
|
709
|
-
let V = !1;
|
|
710
|
-
for (const _ in r.morphAttributes) {
|
|
711
|
-
if (_ !== "position" && _ !== "normal") {
|
|
712
|
-
V || (console.warn("GLTFExporter: Only POSITION and NORMAL morph are supported."), V = !0);
|
|
713
|
-
continue;
|
|
714
|
-
}
|
|
715
|
-
const N = r.morphAttributes[_][m], D = _.toUpperCase(), U = r.attributes[_];
|
|
716
|
-
if (s.attributes.has(this.getUID(N, !0))) {
|
|
717
|
-
I[D] = s.attributes.get(this.getUID(N, !0));
|
|
718
|
-
continue;
|
|
719
|
-
}
|
|
720
|
-
const C = N.clone();
|
|
721
|
-
if (!r.morphTargetsRelative)
|
|
722
|
-
for (let E = 0, Q = N.count; E < Q; E++)
|
|
723
|
-
for (let L = 0; L < N.itemSize; L++)
|
|
724
|
-
L === 0 && C.setX(E, N.getX(E) - U.getX(E)), L === 1 && C.setY(E, N.getY(E) - U.getY(E)), L === 2 && C.setZ(E, N.getZ(E) - U.getZ(E)), L === 3 && C.setW(E, N.getW(E) - U.getW(E));
|
|
725
|
-
I[D] = this.processAccessor(C, r), s.attributes.set(this.getUID(U, !0), I[D]);
|
|
726
|
-
}
|
|
727
|
-
u.push(I), p.push(e.morphTargetInfluences[m]), e.morphTargetDictionary !== void 0 && w.push(A[m]);
|
|
728
|
-
}
|
|
729
|
-
c.weights = p, w.length > 0 && (c.extras = {}, c.extras.targetNames = w);
|
|
730
|
-
}
|
|
731
|
-
const x = Array.isArray(e.material);
|
|
732
|
-
if (x && r.groups.length === 0) return null;
|
|
733
|
-
let y = !1;
|
|
734
|
-
if (x && r.index === null) {
|
|
735
|
-
const p = [];
|
|
736
|
-
for (let w = 0, A = r.attributes.position.count; w < A; w++)
|
|
737
|
-
p[w] = w;
|
|
738
|
-
r.setIndex(p), y = !0;
|
|
739
|
-
}
|
|
740
|
-
const M = x ? e.material : [e.material], b = x ? r.groups : [{ materialIndex: 0, start: void 0, count: void 0 }];
|
|
741
|
-
for (let p = 0, w = b.length; p < w; p++) {
|
|
742
|
-
const A = {
|
|
743
|
-
mode: o,
|
|
744
|
-
attributes: l
|
|
745
|
-
};
|
|
746
|
-
if (this.serializeUserData(r, A), u.length > 0 && (A.targets = u), r.index !== null) {
|
|
747
|
-
let I = this.getUID(r.index);
|
|
748
|
-
(b[p].start !== void 0 || b[p].count !== void 0) && (I += ":" + b[p].start + ":" + b[p].count), s.attributes.has(I) ? A.indices = s.attributes.get(I) : (A.indices = this.processAccessor(r.index, r, b[p].start, b[p].count), s.attributes.set(I, A.indices)), A.indices === null && delete A.indices;
|
|
749
|
-
}
|
|
750
|
-
const m = await this.processMaterialAsync(M[b[p].materialIndex]);
|
|
751
|
-
m !== null && (A.material = m), h.push(A);
|
|
752
|
-
}
|
|
753
|
-
y === !0 && r.setIndex(null), c.primitives = h, n.meshes || (n.meshes = []), await this._invokeAllAsync(function(p) {
|
|
754
|
-
p.writeMesh && p.writeMesh(e, c);
|
|
755
|
-
});
|
|
756
|
-
const O = n.meshes.push(c) - 1;
|
|
757
|
-
return s.meshes.set(i, O), O;
|
|
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 n;
|
|
773
|
-
switch (s.array.constructor) {
|
|
774
|
-
case Int8Array:
|
|
775
|
-
n = "byte";
|
|
776
|
-
break;
|
|
777
|
-
case Uint8Array:
|
|
778
|
-
n = "unsigned byte";
|
|
779
|
-
break;
|
|
780
|
-
case Int16Array:
|
|
781
|
-
n = "short";
|
|
782
|
-
break;
|
|
783
|
-
case Uint16Array:
|
|
784
|
-
n = "unsigned short";
|
|
785
|
-
break;
|
|
786
|
-
default:
|
|
787
|
-
return;
|
|
788
|
-
}
|
|
789
|
-
s.normalized && (n += " normalized");
|
|
790
|
-
const t = e.split("_", 1)[0];
|
|
791
|
-
Y[t] && Y[t].includes(n) && (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 n = e.isOrthographicCamera, t = {
|
|
802
|
-
type: n ? "orthographic" : "perspective"
|
|
803
|
-
};
|
|
804
|
-
return n ? 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: k.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 n = this.json, t = this.nodeMap;
|
|
828
|
-
n.animations || (n.animations = []), e = H.Utils.mergeMorphTargetTracks(e.clone(), s);
|
|
829
|
-
const i = e.tracks, r = [], o = [];
|
|
830
|
-
for (let l = 0; l < i.length; ++l) {
|
|
831
|
-
const h = i[l], u = z.parseTrackName(h.name);
|
|
832
|
-
let T = z.findNode(s, u.nodeName);
|
|
833
|
-
const f = j[u.propertyName];
|
|
834
|
-
if (u.objectName === "bones" && (T.isSkinnedMesh === !0 ? T = T.skeleton.getBoneByName(u.objectIndex) : T = void 0), !T || !f) {
|
|
835
|
-
console.warn('THREE.GLTFExporter: Could not export animation track "%s".', h.name);
|
|
836
|
-
continue;
|
|
837
|
-
}
|
|
838
|
-
const d = 1;
|
|
839
|
-
let x = h.values.length / h.times.length;
|
|
840
|
-
f === j.morphTargetInfluences && (x /= T.morphTargetInfluences.length);
|
|
841
|
-
let y;
|
|
842
|
-
h.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline === !0 ? (y = "CUBICSPLINE", x /= 3) : h.getInterpolation() === ae ? y = "STEP" : y = "LINEAR", o.push({
|
|
843
|
-
input: this.processAccessor(new S(h.times, d)),
|
|
844
|
-
output: this.processAccessor(new S(h.values, x)),
|
|
845
|
-
interpolation: y
|
|
846
|
-
}), r.push({
|
|
847
|
-
sampler: o.length - 1,
|
|
848
|
-
target: {
|
|
849
|
-
node: t.get(T),
|
|
850
|
-
path: f
|
|
851
|
-
}
|
|
852
|
-
});
|
|
853
|
-
}
|
|
854
|
-
const c = {
|
|
855
|
-
name: e.name || "clip_" + n.animations.length,
|
|
856
|
-
samplers: o,
|
|
857
|
-
channels: r
|
|
858
|
-
};
|
|
859
|
-
return this.serializeUserData(e, c), n.animations.push(c), n.animations.length - 1;
|
|
860
|
-
}
|
|
861
|
-
/**
|
|
862
|
-
* @param {THREE.Object3D} object
|
|
863
|
-
* @return {?number}
|
|
864
|
-
*/
|
|
865
|
-
processSkin(e) {
|
|
866
|
-
const s = this.json, n = this.nodeMap, t = s.nodes[n.get(e)], i = e.skeleton;
|
|
867
|
-
if (i === void 0) return null;
|
|
868
|
-
const r = e.skeleton.bones[0];
|
|
869
|
-
if (r === void 0) return null;
|
|
870
|
-
const o = [], c = new Float32Array(i.bones.length * 16), l = new J();
|
|
871
|
-
for (let u = 0; u < i.bones.length; ++u)
|
|
872
|
-
o.push(n.get(i.bones[u])), l.copy(i.boneInverses[u]), l.multiply(e.bindMatrix).toArray(c, u * 16);
|
|
873
|
-
return s.skins === void 0 && (s.skins = []), s.skins.push({
|
|
874
|
-
inverseBindMatrices: this.processAccessor(new S(c, 16)),
|
|
875
|
-
joints: o,
|
|
876
|
-
skeleton: n.get(r)
|
|
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, n = this.options, t = this.nodeMap;
|
|
886
|
-
s.nodes || (s.nodes = []);
|
|
887
|
-
const i = {};
|
|
888
|
-
if (n.trs) {
|
|
889
|
-
const o = e.quaternion.toArray(), c = e.position.toArray(), l = e.scale.toArray();
|
|
890
|
-
F(o, [0, 0, 0, 1]) || (i.rotation = o), F(c, [0, 0, 0]) || (i.translation = c), F(l, [1, 1, 1]) || (i.scale = l);
|
|
891
|
-
} else
|
|
892
|
-
e.matrixAutoUpdate && e.updateMatrix(), Re(e.matrix) === !1 && (i.matrix = e.matrix.elements);
|
|
893
|
-
if (e.name !== "" && (i.name = String(e.name)), this.serializeUserData(e, i), e.isMesh || e.isLine || e.isPoints) {
|
|
894
|
-
const o = await this.processMeshAsync(e);
|
|
895
|
-
o !== null && (i.mesh = o);
|
|
896
|
-
} else e.isCamera && (i.camera = this.processCamera(e));
|
|
897
|
-
e.isSkinnedMesh && this.skins.push(e);
|
|
898
|
-
const r = s.nodes.push(i) - 1;
|
|
899
|
-
if (t.set(e, r), e.children.length > 0) {
|
|
900
|
-
const o = [];
|
|
901
|
-
for (let c = 0, l = e.children.length; c < l; c++) {
|
|
902
|
-
const h = e.children[c];
|
|
903
|
-
if (h.visible || n.onlyVisible === !1) {
|
|
904
|
-
const u = await this.processNodeAsync(h);
|
|
905
|
-
u !== null && o.push(u);
|
|
906
|
-
}
|
|
907
|
-
}
|
|
908
|
-
o.length > 0 && (i.children = o);
|
|
909
|
-
}
|
|
910
|
-
return await this._invokeAllAsync(function(o) {
|
|
911
|
-
o.writeNode && o.writeNode(e, i);
|
|
912
|
-
}), r;
|
|
913
|
-
}
|
|
914
|
-
/**
|
|
915
|
-
* Process Scene
|
|
916
|
-
* @param {Scene} scene Scene to process
|
|
917
|
-
*/
|
|
918
|
-
async processSceneAsync(e) {
|
|
919
|
-
const s = this.json, n = this.options;
|
|
920
|
-
s.scenes || (s.scenes = [], s.scene = 0);
|
|
921
|
-
const t = {};
|
|
922
|
-
e.name !== "" && (t.name = e.name), s.scenes.push(t);
|
|
923
|
-
const i = [];
|
|
924
|
-
for (let r = 0, o = e.children.length; r < o; r++) {
|
|
925
|
-
const c = e.children[r];
|
|
926
|
-
if (c.visible || n.onlyVisible === !1) {
|
|
927
|
-
const l = await this.processNodeAsync(c);
|
|
928
|
-
l !== null && i.push(l);
|
|
929
|
-
}
|
|
930
|
-
}
|
|
931
|
-
i.length > 0 && (t.nodes = i), this.serializeUserData(e, t);
|
|
932
|
-
}
|
|
933
|
-
/**
|
|
934
|
-
* Creates a Scene to hold a list of objects and parse it
|
|
935
|
-
* @param {Array<THREE.Object3D>} objects List of objects to process
|
|
936
|
-
*/
|
|
937
|
-
async processObjectsAsync(e) {
|
|
938
|
-
const s = new K();
|
|
939
|
-
s.name = "AuxScene";
|
|
940
|
-
for (let n = 0; n < e.length; n++)
|
|
941
|
-
s.children.push(e[n]);
|
|
942
|
-
await this.processSceneAsync(s);
|
|
943
|
-
}
|
|
944
|
-
/**
|
|
945
|
-
* @param {THREE.Object3D|Array<THREE.Object3D>} input
|
|
946
|
-
*/
|
|
947
|
-
async processInputAsync(e) {
|
|
948
|
-
const s = this.options;
|
|
949
|
-
e = e instanceof Array ? e : [e], await this._invokeAllAsync(function(t) {
|
|
950
|
-
t.beforeParse && t.beforeParse(e);
|
|
951
|
-
});
|
|
952
|
-
const n = [];
|
|
953
|
-
for (let t = 0; t < e.length; t++)
|
|
954
|
-
e[t] instanceof K ? await this.processSceneAsync(e[t]) : n.push(e[t]);
|
|
955
|
-
n.length > 0 && await this.processObjectsAsync(n);
|
|
956
|
-
for (let t = 0; t < this.skins.length; ++t)
|
|
957
|
-
this.processSkin(this.skins[t]);
|
|
958
|
-
for (let t = 0; t < s.animations.length; ++t)
|
|
959
|
-
this.processAnimation(s.animations[t], e[0]);
|
|
960
|
-
await this._invokeAllAsync(function(t) {
|
|
961
|
-
t.afterParse && t.afterParse(e);
|
|
962
|
-
});
|
|
963
|
-
}
|
|
964
|
-
async _invokeAllAsync(e) {
|
|
965
|
-
for (let s = 0, n = this.plugins.length; s < n; s++)
|
|
966
|
-
await e(this.plugins[s]);
|
|
967
|
-
}
|
|
968
|
-
}
|
|
969
|
-
class Le {
|
|
970
|
-
constructor(e) {
|
|
971
|
-
this.writer = e, this.name = "KHR_lights_punctual";
|
|
972
|
-
}
|
|
973
|
-
writeNode(e, s) {
|
|
974
|
-
if (!e.isLight) return;
|
|
975
|
-
if (!e.isDirectionalLight && !e.isPointLight && !e.isSpotLight) {
|
|
976
|
-
console.warn("THREE.GLTFExporter: Only directional, point, and spot lights are supported.", e);
|
|
977
|
-
return;
|
|
978
|
-
}
|
|
979
|
-
const n = this.writer, t = n.json, i = n.extensionsUsed, r = {};
|
|
980
|
-
e.name && (r.name = e.name), r.color = e.color.toArray(), r.intensity = e.intensity, e.isDirectionalLight ? r.type = "directional" : e.isPointLight ? (r.type = "point", e.distance > 0 && (r.range = e.distance)) : e.isSpotLight && (r.type = "spot", e.distance > 0 && (r.range = e.distance), r.spot = {}, r.spot.innerConeAngle = (1 - e.penumbra) * e.angle, r.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."), i[this.name] || (t.extensions = t.extensions || {}, t.extensions[this.name] = { lights: [] }, i[this.name] = !0);
|
|
981
|
-
const o = t.extensions[this.name].lights;
|
|
982
|
-
o.push(r), s.extensions = s.extensions || {}, s.extensions[this.name] = { light: o.length - 1 };
|
|
983
|
-
}
|
|
984
|
-
}
|
|
985
|
-
class _e {
|
|
986
|
-
constructor(e) {
|
|
987
|
-
this.writer = e, this.name = "KHR_materials_unlit";
|
|
988
|
-
}
|
|
989
|
-
async writeMaterialAsync(e, s) {
|
|
990
|
-
if (!e.isMeshBasicMaterial) return;
|
|
991
|
-
const t = this.writer.extensionsUsed;
|
|
992
|
-
s.extensions = s.extensions || {}, s.extensions[this.name] = {}, t[this.name] = !0, s.pbrMetallicRoughness.metallicFactor = 0, s.pbrMetallicRoughness.roughnessFactor = 0.9;
|
|
993
|
-
}
|
|
994
|
-
}
|
|
995
|
-
class Ue {
|
|
996
|
-
constructor(e) {
|
|
997
|
-
this.writer = e, this.name = "KHR_materials_clearcoat";
|
|
998
|
-
}
|
|
999
|
-
async writeMaterialAsync(e, s) {
|
|
1000
|
-
if (!e.isMeshPhysicalMaterial || e.clearcoat === 0) return;
|
|
1001
|
-
const n = this.writer, t = n.extensionsUsed, i = {};
|
|
1002
|
-
if (i.clearcoatFactor = e.clearcoat, e.clearcoatMap) {
|
|
1003
|
-
const r = {
|
|
1004
|
-
index: await n.processTextureAsync(e.clearcoatMap),
|
|
1005
|
-
texCoord: e.clearcoatMap.channel
|
|
1006
|
-
};
|
|
1007
|
-
n.applyTextureTransform(r, e.clearcoatMap), i.clearcoatTexture = r;
|
|
1008
|
-
}
|
|
1009
|
-
if (i.clearcoatRoughnessFactor = e.clearcoatRoughness, e.clearcoatRoughnessMap) {
|
|
1010
|
-
const r = {
|
|
1011
|
-
index: await n.processTextureAsync(e.clearcoatRoughnessMap),
|
|
1012
|
-
texCoord: e.clearcoatRoughnessMap.channel
|
|
1013
|
-
};
|
|
1014
|
-
n.applyTextureTransform(r, e.clearcoatRoughnessMap), i.clearcoatRoughnessTexture = r;
|
|
1015
|
-
}
|
|
1016
|
-
if (e.clearcoatNormalMap) {
|
|
1017
|
-
const r = {
|
|
1018
|
-
index: await n.processTextureAsync(e.clearcoatNormalMap),
|
|
1019
|
-
texCoord: e.clearcoatNormalMap.channel
|
|
1020
|
-
};
|
|
1021
|
-
e.clearcoatNormalScale.x !== 1 && (r.scale = e.clearcoatNormalScale.x), n.applyTextureTransform(r, e.clearcoatNormalMap), i.clearcoatNormalTexture = r;
|
|
1022
|
-
}
|
|
1023
|
-
s.extensions = s.extensions || {}, s.extensions[this.name] = i, t[this.name] = !0;
|
|
1024
|
-
}
|
|
1025
|
-
}
|
|
1026
|
-
class Ce {
|
|
1027
|
-
constructor(e) {
|
|
1028
|
-
this.writer = e, this.name = "KHR_materials_dispersion";
|
|
1029
|
-
}
|
|
1030
|
-
async writeMaterialAsync(e, s) {
|
|
1031
|
-
if (!e.isMeshPhysicalMaterial || e.dispersion === 0) return;
|
|
1032
|
-
const t = this.writer.extensionsUsed, i = {};
|
|
1033
|
-
i.dispersion = e.dispersion, s.extensions = s.extensions || {}, s.extensions[this.name] = i, t[this.name] = !0;
|
|
1034
|
-
}
|
|
1035
|
-
}
|
|
1036
|
-
class Fe {
|
|
1037
|
-
constructor(e) {
|
|
1038
|
-
this.writer = e, this.name = "KHR_materials_iridescence";
|
|
1039
|
-
}
|
|
1040
|
-
async writeMaterialAsync(e, s) {
|
|
1041
|
-
if (!e.isMeshPhysicalMaterial || e.iridescence === 0) return;
|
|
1042
|
-
const n = this.writer, t = n.extensionsUsed, i = {};
|
|
1043
|
-
if (i.iridescenceFactor = e.iridescence, e.iridescenceMap) {
|
|
1044
|
-
const r = {
|
|
1045
|
-
index: await n.processTextureAsync(e.iridescenceMap),
|
|
1046
|
-
texCoord: e.iridescenceMap.channel
|
|
1047
|
-
};
|
|
1048
|
-
n.applyTextureTransform(r, e.iridescenceMap), i.iridescenceTexture = r;
|
|
1049
|
-
}
|
|
1050
|
-
if (i.iridescenceIor = e.iridescenceIOR, i.iridescenceThicknessMinimum = e.iridescenceThicknessRange[0], i.iridescenceThicknessMaximum = e.iridescenceThicknessRange[1], e.iridescenceThicknessMap) {
|
|
1051
|
-
const r = {
|
|
1052
|
-
index: await n.processTextureAsync(e.iridescenceThicknessMap),
|
|
1053
|
-
texCoord: e.iridescenceThicknessMap.channel
|
|
1054
|
-
};
|
|
1055
|
-
n.applyTextureTransform(r, e.iridescenceThicknessMap), i.iridescenceThicknessTexture = r;
|
|
1056
|
-
}
|
|
1057
|
-
s.extensions = s.extensions || {}, s.extensions[this.name] = i, t[this.name] = !0;
|
|
1058
|
-
}
|
|
1059
|
-
}
|
|
1060
|
-
class Oe {
|
|
1061
|
-
constructor(e) {
|
|
1062
|
-
this.writer = e, this.name = "KHR_materials_transmission";
|
|
1063
|
-
}
|
|
1064
|
-
async writeMaterialAsync(e, s) {
|
|
1065
|
-
if (!e.isMeshPhysicalMaterial || e.transmission === 0) return;
|
|
1066
|
-
const n = this.writer, t = n.extensionsUsed, i = {};
|
|
1067
|
-
if (i.transmissionFactor = e.transmission, e.transmissionMap) {
|
|
1068
|
-
const r = {
|
|
1069
|
-
index: await n.processTextureAsync(e.transmissionMap),
|
|
1070
|
-
texCoord: e.transmissionMap.channel
|
|
1071
|
-
};
|
|
1072
|
-
n.applyTextureTransform(r, e.transmissionMap), i.transmissionTexture = r;
|
|
1073
|
-
}
|
|
1074
|
-
s.extensions = s.extensions || {}, s.extensions[this.name] = i, t[this.name] = !0;
|
|
1075
|
-
}
|
|
1076
|
-
}
|
|
1077
|
-
class ve {
|
|
1078
|
-
constructor(e) {
|
|
1079
|
-
this.writer = e, this.name = "KHR_materials_volume";
|
|
1080
|
-
}
|
|
1081
|
-
async writeMaterialAsync(e, s) {
|
|
1082
|
-
if (!e.isMeshPhysicalMaterial || e.transmission === 0) return;
|
|
1083
|
-
const n = this.writer, t = n.extensionsUsed, i = {};
|
|
1084
|
-
if (i.thicknessFactor = e.thickness, e.thicknessMap) {
|
|
1085
|
-
const r = {
|
|
1086
|
-
index: await n.processTextureAsync(e.thicknessMap),
|
|
1087
|
-
texCoord: e.thicknessMap.channel
|
|
1088
|
-
};
|
|
1089
|
-
n.applyTextureTransform(r, e.thicknessMap), i.thicknessTexture = r;
|
|
1090
|
-
}
|
|
1091
|
-
e.attenuationDistance !== 1 / 0 && (i.attenuationDistance = e.attenuationDistance), i.attenuationColor = e.attenuationColor.toArray(), s.extensions = s.extensions || {}, s.extensions[this.name] = i, t[this.name] = !0;
|
|
1092
|
-
}
|
|
1093
|
-
}
|
|
1094
|
-
class ze {
|
|
1095
|
-
constructor(e) {
|
|
1096
|
-
this.writer = e, this.name = "KHR_materials_ior";
|
|
1097
|
-
}
|
|
1098
|
-
async writeMaterialAsync(e, s) {
|
|
1099
|
-
if (!e.isMeshPhysicalMaterial || e.ior === 1.5) return;
|
|
1100
|
-
const t = this.writer.extensionsUsed, i = {};
|
|
1101
|
-
i.ior = e.ior, s.extensions = s.extensions || {}, s.extensions[this.name] = i, t[this.name] = !0;
|
|
1102
|
-
}
|
|
1103
|
-
}
|
|
1104
|
-
class De {
|
|
1105
|
-
constructor(e) {
|
|
1106
|
-
this.writer = e, this.name = "KHR_materials_specular";
|
|
1107
|
-
}
|
|
1108
|
-
async writeMaterialAsync(e, s) {
|
|
1109
|
-
if (!e.isMeshPhysicalMaterial || e.specularIntensity === 1 && e.specularColor.equals(we) && !e.specularIntensityMap && !e.specularColorMap) return;
|
|
1110
|
-
const n = this.writer, t = n.extensionsUsed, i = {};
|
|
1111
|
-
if (e.specularIntensityMap) {
|
|
1112
|
-
const r = {
|
|
1113
|
-
index: await n.processTextureAsync(e.specularIntensityMap),
|
|
1114
|
-
texCoord: e.specularIntensityMap.channel
|
|
1115
|
-
};
|
|
1116
|
-
n.applyTextureTransform(r, e.specularIntensityMap), i.specularTexture = r;
|
|
1117
|
-
}
|
|
1118
|
-
if (e.specularColorMap) {
|
|
1119
|
-
const r = {
|
|
1120
|
-
index: await n.processTextureAsync(e.specularColorMap),
|
|
1121
|
-
texCoord: e.specularColorMap.channel
|
|
1122
|
-
};
|
|
1123
|
-
n.applyTextureTransform(r, e.specularColorMap), i.specularColorTexture = r;
|
|
1124
|
-
}
|
|
1125
|
-
i.specularFactor = e.specularIntensity, i.specularColorFactor = e.specularColor.toArray(), s.extensions = s.extensions || {}, s.extensions[this.name] = i, t[this.name] = !0;
|
|
1126
|
-
}
|
|
1127
|
-
}
|
|
1128
|
-
class Be {
|
|
1129
|
-
constructor(e) {
|
|
1130
|
-
this.writer = e, this.name = "KHR_materials_sheen";
|
|
1131
|
-
}
|
|
1132
|
-
async writeMaterialAsync(e, s) {
|
|
1133
|
-
if (!e.isMeshPhysicalMaterial || e.sheen == 0) return;
|
|
1134
|
-
const n = this.writer, t = n.extensionsUsed, i = {};
|
|
1135
|
-
if (e.sheenRoughnessMap) {
|
|
1136
|
-
const r = {
|
|
1137
|
-
index: await n.processTextureAsync(e.sheenRoughnessMap),
|
|
1138
|
-
texCoord: e.sheenRoughnessMap.channel
|
|
1139
|
-
};
|
|
1140
|
-
n.applyTextureTransform(r, e.sheenRoughnessMap), i.sheenRoughnessTexture = r;
|
|
1141
|
-
}
|
|
1142
|
-
if (e.sheenColorMap) {
|
|
1143
|
-
const r = {
|
|
1144
|
-
index: await n.processTextureAsync(e.sheenColorMap),
|
|
1145
|
-
texCoord: e.sheenColorMap.channel
|
|
1146
|
-
};
|
|
1147
|
-
n.applyTextureTransform(r, e.sheenColorMap), i.sheenColorTexture = r;
|
|
1148
|
-
}
|
|
1149
|
-
i.sheenRoughnessFactor = e.sheenRoughness, i.sheenColorFactor = e.sheenColor.toArray(), s.extensions = s.extensions || {}, s.extensions[this.name] = i, t[this.name] = !0;
|
|
1150
|
-
}
|
|
1151
|
-
}
|
|
1152
|
-
class Ge {
|
|
1153
|
-
constructor(e) {
|
|
1154
|
-
this.writer = e, this.name = "KHR_materials_anisotropy";
|
|
1155
|
-
}
|
|
1156
|
-
async writeMaterialAsync(e, s) {
|
|
1157
|
-
if (!e.isMeshPhysicalMaterial || e.anisotropy == 0) return;
|
|
1158
|
-
const n = this.writer, t = n.extensionsUsed, i = {};
|
|
1159
|
-
if (e.anisotropyMap) {
|
|
1160
|
-
const r = { index: await n.processTextureAsync(e.anisotropyMap) };
|
|
1161
|
-
n.applyTextureTransform(r, e.anisotropyMap), i.anisotropyTexture = r;
|
|
1162
|
-
}
|
|
1163
|
-
i.anisotropyStrength = e.anisotropy, i.anisotropyRotation = e.anisotropyRotation, s.extensions = s.extensions || {}, s.extensions[this.name] = i, t[this.name] = !0;
|
|
1164
|
-
}
|
|
1165
|
-
}
|
|
1166
|
-
class Pe {
|
|
1167
|
-
constructor(e) {
|
|
1168
|
-
this.writer = e, this.name = "KHR_materials_emissive_strength";
|
|
1169
|
-
}
|
|
1170
|
-
async writeMaterialAsync(e, s) {
|
|
1171
|
-
if (!e.isMeshStandardMaterial || e.emissiveIntensity === 1) return;
|
|
1172
|
-
const t = this.writer.extensionsUsed, i = {};
|
|
1173
|
-
i.emissiveStrength = e.emissiveIntensity, s.extensions = s.extensions || {}, s.extensions[this.name] = i, t[this.name] = !0;
|
|
1174
|
-
}
|
|
1175
|
-
}
|
|
1176
|
-
class ke {
|
|
1177
|
-
constructor(e) {
|
|
1178
|
-
this.writer = e, this.name = "EXT_materials_bump";
|
|
1179
|
-
}
|
|
1180
|
-
async writeMaterialAsync(e, s) {
|
|
1181
|
-
if (!e.isMeshStandardMaterial || e.bumpScale === 1 && !e.bumpMap) return;
|
|
1182
|
-
const n = this.writer, t = n.extensionsUsed, i = {};
|
|
1183
|
-
if (e.bumpMap) {
|
|
1184
|
-
const r = {
|
|
1185
|
-
index: await n.processTextureAsync(e.bumpMap),
|
|
1186
|
-
texCoord: e.bumpMap.channel
|
|
1187
|
-
};
|
|
1188
|
-
n.applyTextureTransform(r, e.bumpMap), i.bumpTexture = r;
|
|
1189
|
-
}
|
|
1190
|
-
i.bumpFactor = e.bumpScale, s.extensions = s.extensions || {}, s.extensions[this.name] = i, t[this.name] = !0;
|
|
1191
|
-
}
|
|
1192
|
-
}
|
|
1193
|
-
class He {
|
|
1194
|
-
constructor(e) {
|
|
1195
|
-
this.writer = e, this.name = "EXT_mesh_gpu_instancing";
|
|
1196
|
-
}
|
|
1197
|
-
writeNode(e, s) {
|
|
1198
|
-
if (!e.isInstancedMesh) return;
|
|
1199
|
-
const n = this.writer, t = e, i = new Float32Array(t.count * 3), r = new Float32Array(t.count * 4), o = new Float32Array(t.count * 3), c = new J(), l = new v(), h = new ee(), u = new v();
|
|
1200
|
-
for (let f = 0; f < t.count; f++)
|
|
1201
|
-
t.getMatrixAt(f, c), c.decompose(l, h, u), l.toArray(i, f * 3), h.toArray(r, f * 4), u.toArray(o, f * 3);
|
|
1202
|
-
const T = {
|
|
1203
|
-
TRANSLATION: n.processAccessor(new S(i, 3)),
|
|
1204
|
-
ROTATION: n.processAccessor(new S(r, 4)),
|
|
1205
|
-
SCALE: n.processAccessor(new S(o, 3))
|
|
1206
|
-
};
|
|
1207
|
-
t.instanceColor && (T._COLOR_0 = n.processAccessor(t.instanceColor)), s.extensions = s.extensions || {}, s.extensions[this.name] = { attributes: T }, n.extensionsUsed[this.name] = !0, n.extensionsRequired[this.name] = !0;
|
|
1208
|
-
}
|
|
1209
|
-
}
|
|
1210
|
-
H.Utils = {
|
|
1211
|
-
insertKeyframe: function(a, e) {
|
|
1212
|
-
const n = a.getValueSize(), t = new a.TimeBufferType(a.times.length + 1), i = new a.ValueBufferType(a.values.length + n), r = a.createInterpolant(new a.ValueBufferType(n));
|
|
1213
|
-
let o;
|
|
1214
|
-
if (a.times.length === 0) {
|
|
1215
|
-
t[0] = e;
|
|
1216
|
-
for (let c = 0; c < n; c++)
|
|
1217
|
-
i[c] = 0;
|
|
1218
|
-
o = 0;
|
|
1219
|
-
} else if (e < a.times[0]) {
|
|
1220
|
-
if (Math.abs(a.times[0] - e) < 1e-3) return 0;
|
|
1221
|
-
t[0] = e, t.set(a.times, 1), i.set(r.evaluate(e), 0), i.set(a.values, n), o = 0;
|
|
1222
|
-
} else if (e > a.times[a.times.length - 1]) {
|
|
1223
|
-
if (Math.abs(a.times[a.times.length - 1] - e) < 1e-3)
|
|
1224
|
-
return a.times.length - 1;
|
|
1225
|
-
t[t.length - 1] = e, t.set(a.times, 0), i.set(a.values, 0), i.set(r.evaluate(e), a.values.length), o = t.length - 1;
|
|
1226
|
-
} else
|
|
1227
|
-
for (let c = 0; c < a.times.length; c++) {
|
|
1228
|
-
if (Math.abs(a.times[c] - e) < 1e-3) return c;
|
|
1229
|
-
if (a.times[c] < e && a.times[c + 1] > e) {
|
|
1230
|
-
t.set(a.times.slice(0, c + 1), 0), t[c + 1] = e, t.set(a.times.slice(c + 1), c + 2), i.set(a.values.slice(0, (c + 1) * n), 0), i.set(r.evaluate(e), (c + 1) * n), i.set(a.values.slice((c + 1) * n), (c + 2) * n), o = c + 1;
|
|
1231
|
-
break;
|
|
1232
|
-
}
|
|
1233
|
-
}
|
|
1234
|
-
return a.times = t, a.values = i, o;
|
|
1235
|
-
},
|
|
1236
|
-
mergeMorphTargetTracks: function(a, e) {
|
|
1237
|
-
const s = [], n = {}, t = a.tracks;
|
|
1238
|
-
for (let i = 0; i < t.length; ++i) {
|
|
1239
|
-
let r = t[i];
|
|
1240
|
-
const o = z.parseTrackName(r.name), c = z.findNode(e, o.nodeName);
|
|
1241
|
-
if (o.propertyName !== "morphTargetInfluences" || o.propertyIndex === void 0) {
|
|
1242
|
-
s.push(r);
|
|
1243
|
-
continue;
|
|
1244
|
-
}
|
|
1245
|
-
if (r.createInterpolant !== r.InterpolantFactoryMethodDiscrete && r.createInterpolant !== r.InterpolantFactoryMethodLinear) {
|
|
1246
|
-
if (r.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline)
|
|
1247
|
-
throw new Error("THREE.GLTFExporter: Cannot merge tracks with glTF CUBICSPLINE interpolation.");
|
|
1248
|
-
console.warn("THREE.GLTFExporter: Morph target interpolation mode not yet supported. Using LINEAR instead."), r = r.clone(), r.setInterpolation(Te);
|
|
1249
|
-
}
|
|
1250
|
-
const l = c.morphTargetInfluences.length, h = c.morphTargetDictionary[o.propertyIndex];
|
|
1251
|
-
if (h === void 0)
|
|
1252
|
-
throw new Error("THREE.GLTFExporter: Morph target name not found: " + o.propertyIndex);
|
|
1253
|
-
let u;
|
|
1254
|
-
if (n[c.uuid] === void 0) {
|
|
1255
|
-
u = r.clone();
|
|
1256
|
-
const f = new u.ValueBufferType(l * u.times.length);
|
|
1257
|
-
for (let d = 0; d < u.times.length; d++)
|
|
1258
|
-
f[d * l + h] = u.values[d];
|
|
1259
|
-
u.name = (o.nodeName || "") + ".morphTargetInfluences", u.values = f, n[c.uuid] = u, s.push(u);
|
|
1260
|
-
continue;
|
|
1261
|
-
}
|
|
1262
|
-
const T = r.createInterpolant(new r.ValueBufferType(1));
|
|
1263
|
-
u = n[c.uuid];
|
|
1264
|
-
for (let f = 0; f < u.times.length; f++)
|
|
1265
|
-
u.values[f * l + h] = T.evaluate(u.times[f]);
|
|
1266
|
-
for (let f = 0; f < r.times.length; f++) {
|
|
1267
|
-
const d = this.insertKeyframe(u, r.times[f]);
|
|
1268
|
-
u.values[d * l + h] = r.values[f];
|
|
1269
|
-
}
|
|
1270
|
-
}
|
|
1271
|
-
return a.tracks = s, a;
|
|
1272
|
-
},
|
|
1273
|
-
toFloat32BufferAttribute: function(a) {
|
|
1274
|
-
const e = new S(new Float32Array(a.count * a.itemSize), a.itemSize, !1);
|
|
1275
|
-
if (!a.normalized && !a.isInterleavedBufferAttribute)
|
|
1276
|
-
return e.array.set(a.array), e;
|
|
1277
|
-
for (let s = 0, n = a.count; s < n; s++)
|
|
1278
|
-
for (let t = 0; t < a.itemSize; t++)
|
|
1279
|
-
e.setComponent(s, t, a.getComponent(s, t));
|
|
1280
|
-
return e;
|
|
1281
|
-
}
|
|
1282
|
-
};
|
|
1283
|
-
export {
|
|
1284
|
-
H as GLTFExporter
|
|
1285
|
-
};
|
|
1286
|
-
//# sourceMappingURL=GLTFExporter-DiE_HuI6.mjs.map
|