@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,2064 +0,0 @@
|
|
|
1
|
-
import { V as d, a1 as ft, a2 as v, a3 as lt, a4 as et, a5 as gt, a6 as mt, a7 as Rt, N, a8 as L, a9 as st, aa as zt, ab as Tt, ac as kt, ad as xt, a0 as bt, ae as yt, af as Ft, ag as St, ah as At, ai as Mt, aj as I, ak as Bt, al as Et, _ as Q, am as W, an as S, ao as Nt, W as Ot, O as It, ap as ut, aq as _, Q as Pt } from "./index-C-Prfui2.mjs";
|
|
2
|
-
const R = /* @__PURE__ */ new d(), nt = /* @__PURE__ */ new d(), H = /* @__PURE__ */ new d(), z = /* @__PURE__ */ new d(), rt = /* @__PURE__ */ new d(), U = /* @__PURE__ */ new d(), at = /* @__PURE__ */ new d();
|
|
3
|
-
class Vt {
|
|
4
|
-
/**
|
|
5
|
-
* Constructs a new ray.
|
|
6
|
-
*
|
|
7
|
-
* @param {Vector3} [origin=(0,0,0)] - The origin of the ray.
|
|
8
|
-
* @param {Vector3} [direction=(0,0,-1)] - The (normalized) direction of the ray.
|
|
9
|
-
*/
|
|
10
|
-
constructor(t = new d(), e = new d(0, 0, -1)) {
|
|
11
|
-
this.origin = t, this.direction = e;
|
|
12
|
-
}
|
|
13
|
-
/**
|
|
14
|
-
* Sets the ray's components by copying the given values.
|
|
15
|
-
*
|
|
16
|
-
* @param {Vector3} origin - The origin.
|
|
17
|
-
* @param {Vector3} direction - The direction.
|
|
18
|
-
* @return {Ray} A reference to this ray.
|
|
19
|
-
*/
|
|
20
|
-
set(t, e) {
|
|
21
|
-
return this.origin.copy(t), this.direction.copy(e), this;
|
|
22
|
-
}
|
|
23
|
-
/**
|
|
24
|
-
* Copies the values of the given ray to this instance.
|
|
25
|
-
*
|
|
26
|
-
* @param {Ray} ray - The ray to copy.
|
|
27
|
-
* @return {Ray} A reference to this ray.
|
|
28
|
-
*/
|
|
29
|
-
copy(t) {
|
|
30
|
-
return this.origin.copy(t.origin), this.direction.copy(t.direction), this;
|
|
31
|
-
}
|
|
32
|
-
/**
|
|
33
|
-
* Returns a vector that is located at a given distance along this ray.
|
|
34
|
-
*
|
|
35
|
-
* @param {number} t - The distance along the ray to retrieve a position for.
|
|
36
|
-
* @param {Vector3} target - The target vector that is used to store the method's result.
|
|
37
|
-
* @return {Vector3} A position on the ray.
|
|
38
|
-
*/
|
|
39
|
-
at(t, e) {
|
|
40
|
-
return e.copy(this.origin).addScaledVector(this.direction, t);
|
|
41
|
-
}
|
|
42
|
-
/**
|
|
43
|
-
* Adjusts the direction of the ray to point at the given vector in world space.
|
|
44
|
-
*
|
|
45
|
-
* @param {Vector3} v - The target position.
|
|
46
|
-
* @return {Ray} A reference to this ray.
|
|
47
|
-
*/
|
|
48
|
-
lookAt(t) {
|
|
49
|
-
return this.direction.copy(t).sub(this.origin).normalize(), this;
|
|
50
|
-
}
|
|
51
|
-
/**
|
|
52
|
-
* Shift the origin of this ray along its direction by the given distance.
|
|
53
|
-
*
|
|
54
|
-
* @param {number} t - The distance along the ray to interpolate.
|
|
55
|
-
* @return {Ray} A reference to this ray.
|
|
56
|
-
*/
|
|
57
|
-
recast(t) {
|
|
58
|
-
return this.origin.copy(this.at(t, R)), this;
|
|
59
|
-
}
|
|
60
|
-
/**
|
|
61
|
-
* Returns the point along this ray that is closest to the given point.
|
|
62
|
-
*
|
|
63
|
-
* @param {Vector3} point - A point in 3D space to get the closet location on the ray for.
|
|
64
|
-
* @param {Vector3} target - The target vector that is used to store the method's result.
|
|
65
|
-
* @return {Vector3} The closest point on this ray.
|
|
66
|
-
*/
|
|
67
|
-
closestPointToPoint(t, e) {
|
|
68
|
-
e.subVectors(t, this.origin);
|
|
69
|
-
const i = e.dot(this.direction);
|
|
70
|
-
return i < 0 ? e.copy(this.origin) : e.copy(this.origin).addScaledVector(this.direction, i);
|
|
71
|
-
}
|
|
72
|
-
/**
|
|
73
|
-
* Returns the distance of the closest approach between this ray and the given point.
|
|
74
|
-
*
|
|
75
|
-
* @param {Vector3} point - A point in 3D space to compute the distance to.
|
|
76
|
-
* @return {number} The distance.
|
|
77
|
-
*/
|
|
78
|
-
distanceToPoint(t) {
|
|
79
|
-
return Math.sqrt(this.distanceSqToPoint(t));
|
|
80
|
-
}
|
|
81
|
-
/**
|
|
82
|
-
* Returns the squared distance of the closest approach between this ray and the given point.
|
|
83
|
-
*
|
|
84
|
-
* @param {Vector3} point - A point in 3D space to compute the distance to.
|
|
85
|
-
* @return {number} The squared distance.
|
|
86
|
-
*/
|
|
87
|
-
distanceSqToPoint(t) {
|
|
88
|
-
const e = R.subVectors(t, this.origin).dot(this.direction);
|
|
89
|
-
return e < 0 ? this.origin.distanceToSquared(t) : (R.copy(this.origin).addScaledVector(this.direction, e), R.distanceToSquared(t));
|
|
90
|
-
}
|
|
91
|
-
/**
|
|
92
|
-
* Returns the squared distance between this ray and the given line segment.
|
|
93
|
-
*
|
|
94
|
-
* @param {Vector3} v0 - The start point of the line segment.
|
|
95
|
-
* @param {Vector3} v1 - The end point of the line segment.
|
|
96
|
-
* @param {Vector3} [optionalPointOnRay] - When provided, it receives the point on this ray that is closest to the segment.
|
|
97
|
-
* @param {Vector3} [optionalPointOnSegment] - When provided, it receives the point on the line segment that is closest to this ray.
|
|
98
|
-
* @return {number} The squared distance.
|
|
99
|
-
*/
|
|
100
|
-
distanceSqToSegment(t, e, i, s) {
|
|
101
|
-
nt.copy(t).add(e).multiplyScalar(0.5), H.copy(e).sub(t).normalize(), z.copy(this.origin).sub(nt);
|
|
102
|
-
const n = t.distanceTo(e) * 0.5, r = -this.direction.dot(H), o = z.dot(this.direction), h = -z.dot(H), l = z.lengthSq(), c = Math.abs(1 - r * r);
|
|
103
|
-
let u, a, p, x;
|
|
104
|
-
if (c > 0)
|
|
105
|
-
if (u = r * h - o, a = r * o - h, x = n * c, u >= 0)
|
|
106
|
-
if (a >= -x)
|
|
107
|
-
if (a <= x) {
|
|
108
|
-
const y = 1 / c;
|
|
109
|
-
u *= y, a *= y, p = u * (u + r * a + 2 * o) + a * (r * u + a + 2 * h) + l;
|
|
110
|
-
} else
|
|
111
|
-
a = n, u = Math.max(0, -(r * a + o)), p = -u * u + a * (a + 2 * h) + l;
|
|
112
|
-
else
|
|
113
|
-
a = -n, u = Math.max(0, -(r * a + o)), p = -u * u + a * (a + 2 * h) + l;
|
|
114
|
-
else
|
|
115
|
-
a <= -x ? (u = Math.max(0, -(-r * n + o)), a = u > 0 ? -n : Math.min(Math.max(-n, -h), n), p = -u * u + a * (a + 2 * h) + l) : a <= x ? (u = 0, a = Math.min(Math.max(-n, -h), n), p = a * (a + 2 * h) + l) : (u = Math.max(0, -(r * n + o)), a = u > 0 ? n : Math.min(Math.max(-n, -h), n), p = -u * u + a * (a + 2 * h) + l);
|
|
116
|
-
else
|
|
117
|
-
a = r > 0 ? -n : n, u = Math.max(0, -(r * a + o)), p = -u * u + a * (a + 2 * h) + l;
|
|
118
|
-
return i && i.copy(this.origin).addScaledVector(this.direction, u), s && s.copy(nt).addScaledVector(H, a), p;
|
|
119
|
-
}
|
|
120
|
-
/**
|
|
121
|
-
* Intersects this ray with the given sphere, returning the intersection
|
|
122
|
-
* point or `null` if there is no intersection.
|
|
123
|
-
*
|
|
124
|
-
* @param {Sphere} sphere - The sphere to intersect.
|
|
125
|
-
* @param {Vector3} target - The target vector that is used to store the method's result.
|
|
126
|
-
* @return {?Vector3} The intersection point.
|
|
127
|
-
*/
|
|
128
|
-
intersectSphere(t, e) {
|
|
129
|
-
R.subVectors(t.center, this.origin);
|
|
130
|
-
const i = R.dot(this.direction), s = R.dot(R) - i * i, n = t.radius * t.radius;
|
|
131
|
-
if (s > n) return null;
|
|
132
|
-
const r = Math.sqrt(n - s), o = i - r, h = i + r;
|
|
133
|
-
return h < 0 ? null : o < 0 ? this.at(h, e) : this.at(o, e);
|
|
134
|
-
}
|
|
135
|
-
/**
|
|
136
|
-
* Returns `true` if this ray intersects with the given sphere.
|
|
137
|
-
*
|
|
138
|
-
* @param {Sphere} sphere - The sphere to intersect.
|
|
139
|
-
* @return {boolean} Whether this ray intersects with the given sphere or not.
|
|
140
|
-
*/
|
|
141
|
-
intersectsSphere(t) {
|
|
142
|
-
return t.radius < 0 ? !1 : this.distanceSqToPoint(t.center) <= t.radius * t.radius;
|
|
143
|
-
}
|
|
144
|
-
/**
|
|
145
|
-
* Computes the distance from the ray's origin to the given plane. Returns `null` if the ray
|
|
146
|
-
* does not intersect with the plane.
|
|
147
|
-
*
|
|
148
|
-
* @param {Plane} plane - The plane to compute the distance to.
|
|
149
|
-
* @return {?number} Whether this ray intersects with the given sphere or not.
|
|
150
|
-
*/
|
|
151
|
-
distanceToPlane(t) {
|
|
152
|
-
const e = t.normal.dot(this.direction);
|
|
153
|
-
if (e === 0)
|
|
154
|
-
return t.distanceToPoint(this.origin) === 0 ? 0 : null;
|
|
155
|
-
const i = -(this.origin.dot(t.normal) + t.constant) / e;
|
|
156
|
-
return i >= 0 ? i : null;
|
|
157
|
-
}
|
|
158
|
-
/**
|
|
159
|
-
* Intersects this ray with the given plane, returning the intersection
|
|
160
|
-
* point or `null` if there is no intersection.
|
|
161
|
-
*
|
|
162
|
-
* @param {Plane} plane - The plane to intersect.
|
|
163
|
-
* @param {Vector3} target - The target vector that is used to store the method's result.
|
|
164
|
-
* @return {?Vector3} The intersection point.
|
|
165
|
-
*/
|
|
166
|
-
intersectPlane(t, e) {
|
|
167
|
-
const i = this.distanceToPlane(t);
|
|
168
|
-
return i === null ? null : this.at(i, e);
|
|
169
|
-
}
|
|
170
|
-
/**
|
|
171
|
-
* Returns `true` if this ray intersects with the given plane.
|
|
172
|
-
*
|
|
173
|
-
* @param {Plane} plane - The plane to intersect.
|
|
174
|
-
* @return {boolean} Whether this ray intersects with the given plane or not.
|
|
175
|
-
*/
|
|
176
|
-
intersectsPlane(t) {
|
|
177
|
-
const e = t.distanceToPoint(this.origin);
|
|
178
|
-
return e === 0 || t.normal.dot(this.direction) * e < 0;
|
|
179
|
-
}
|
|
180
|
-
/**
|
|
181
|
-
* Intersects this ray with the given bounding box, returning the intersection
|
|
182
|
-
* point or `null` if there is no intersection.
|
|
183
|
-
*
|
|
184
|
-
* @param {Box3} box - The box to intersect.
|
|
185
|
-
* @param {Vector3} target - The target vector that is used to store the method's result.
|
|
186
|
-
* @return {?Vector3} The intersection point.
|
|
187
|
-
*/
|
|
188
|
-
intersectBox(t, e) {
|
|
189
|
-
let i, s, n, r, o, h;
|
|
190
|
-
const l = 1 / this.direction.x, c = 1 / this.direction.y, u = 1 / this.direction.z, a = this.origin;
|
|
191
|
-
return l >= 0 ? (i = (t.min.x - a.x) * l, s = (t.max.x - a.x) * l) : (i = (t.max.x - a.x) * l, s = (t.min.x - a.x) * l), c >= 0 ? (n = (t.min.y - a.y) * c, r = (t.max.y - a.y) * c) : (n = (t.max.y - a.y) * c, r = (t.min.y - a.y) * c), i > r || n > s || ((n > i || isNaN(i)) && (i = n), (r < s || isNaN(s)) && (s = r), u >= 0 ? (o = (t.min.z - a.z) * u, h = (t.max.z - a.z) * u) : (o = (t.max.z - a.z) * u, h = (t.min.z - a.z) * u), i > h || o > s) || ((o > i || i !== i) && (i = o), (h < s || s !== s) && (s = h), s < 0) ? null : this.at(i >= 0 ? i : s, e);
|
|
192
|
-
}
|
|
193
|
-
/**
|
|
194
|
-
* Returns `true` if this ray intersects with the given box.
|
|
195
|
-
*
|
|
196
|
-
* @param {Box3} box - The box to intersect.
|
|
197
|
-
* @return {boolean} Whether this ray intersects with the given box or not.
|
|
198
|
-
*/
|
|
199
|
-
intersectsBox(t) {
|
|
200
|
-
return this.intersectBox(t, R) !== null;
|
|
201
|
-
}
|
|
202
|
-
/**
|
|
203
|
-
* Intersects this ray with the given triangle, returning the intersection
|
|
204
|
-
* point or `null` if there is no intersection.
|
|
205
|
-
*
|
|
206
|
-
* @param {Vector3} a - The first vertex of the triangle.
|
|
207
|
-
* @param {Vector3} b - The second vertex of the triangle.
|
|
208
|
-
* @param {Vector3} c - The third vertex of the triangle.
|
|
209
|
-
* @param {boolean} backfaceCulling - Whether to use backface culling or not.
|
|
210
|
-
* @param {Vector3} target - The target vector that is used to store the method's result.
|
|
211
|
-
* @return {?Vector3} The intersection point.
|
|
212
|
-
*/
|
|
213
|
-
intersectTriangle(t, e, i, s, n) {
|
|
214
|
-
rt.subVectors(e, t), U.subVectors(i, t), at.crossVectors(rt, U);
|
|
215
|
-
let r = this.direction.dot(at), o;
|
|
216
|
-
if (r > 0) {
|
|
217
|
-
if (s) return null;
|
|
218
|
-
o = 1;
|
|
219
|
-
} else if (r < 0)
|
|
220
|
-
o = -1, r = -r;
|
|
221
|
-
else
|
|
222
|
-
return null;
|
|
223
|
-
z.subVectors(this.origin, t);
|
|
224
|
-
const h = o * this.direction.dot(U.crossVectors(z, U));
|
|
225
|
-
if (h < 0)
|
|
226
|
-
return null;
|
|
227
|
-
const l = o * this.direction.dot(rt.cross(z));
|
|
228
|
-
if (l < 0 || h + l > r)
|
|
229
|
-
return null;
|
|
230
|
-
const c = -o * z.dot(at);
|
|
231
|
-
return c < 0 ? null : this.at(c / r, n);
|
|
232
|
-
}
|
|
233
|
-
/**
|
|
234
|
-
* Transforms this ray with the given 4x4 transformation matrix.
|
|
235
|
-
*
|
|
236
|
-
* @param {Matrix4} matrix4 - The transformation matrix.
|
|
237
|
-
* @return {Ray} A reference to this ray.
|
|
238
|
-
*/
|
|
239
|
-
applyMatrix4(t) {
|
|
240
|
-
return this.origin.applyMatrix4(t), this.direction.transformDirection(t), this;
|
|
241
|
-
}
|
|
242
|
-
/**
|
|
243
|
-
* Returns `true` if this ray is equal with the given one.
|
|
244
|
-
*
|
|
245
|
-
* @param {Ray} ray - The ray to test for equality.
|
|
246
|
-
* @return {boolean} Whether this ray is equal with the given one.
|
|
247
|
-
*/
|
|
248
|
-
equals(t) {
|
|
249
|
-
return t.origin.equals(this.origin) && t.direction.equals(this.direction);
|
|
250
|
-
}
|
|
251
|
-
/**
|
|
252
|
-
* Returns a new ray with copied values from this instance.
|
|
253
|
-
*
|
|
254
|
-
* @return {Ray} A clone of this instance.
|
|
255
|
-
*/
|
|
256
|
-
clone() {
|
|
257
|
-
return new this.constructor().copy(this);
|
|
258
|
-
}
|
|
259
|
-
}
|
|
260
|
-
const wt = /* @__PURE__ */ new lt().set(
|
|
261
|
-
0.4123908,
|
|
262
|
-
0.3575843,
|
|
263
|
-
0.1804808,
|
|
264
|
-
0.212639,
|
|
265
|
-
0.7151687,
|
|
266
|
-
0.0721923,
|
|
267
|
-
0.0193308,
|
|
268
|
-
0.1191948,
|
|
269
|
-
0.9505322
|
|
270
|
-
), Ct = /* @__PURE__ */ new lt().set(
|
|
271
|
-
3.2409699,
|
|
272
|
-
-1.5373832,
|
|
273
|
-
-0.4986108,
|
|
274
|
-
-0.9692436,
|
|
275
|
-
1.8759675,
|
|
276
|
-
0.0415551,
|
|
277
|
-
0.0556301,
|
|
278
|
-
-0.203977,
|
|
279
|
-
1.0569715
|
|
280
|
-
);
|
|
281
|
-
function qt() {
|
|
282
|
-
const f = {
|
|
283
|
-
enabled: !0,
|
|
284
|
-
workingColorSpace: ft,
|
|
285
|
-
/**
|
|
286
|
-
* Implementations of supported color spaces.
|
|
287
|
-
*
|
|
288
|
-
* Required:
|
|
289
|
-
* - primaries: chromaticity coordinates [ rx ry gx gy bx by ]
|
|
290
|
-
* - whitePoint: reference white [ x y ]
|
|
291
|
-
* - transfer: transfer function (pre-defined)
|
|
292
|
-
* - toXYZ: Matrix3 RGB to XYZ transform
|
|
293
|
-
* - fromXYZ: Matrix3 XYZ to RGB transform
|
|
294
|
-
* - luminanceCoefficients: RGB luminance coefficients
|
|
295
|
-
*
|
|
296
|
-
* Optional:
|
|
297
|
-
* - outputColorSpaceConfig: { drawingBufferColorSpace: ColorSpace, toneMappingMode: 'extended' | 'standard' }
|
|
298
|
-
* - workingColorSpaceConfig: { unpackColorSpace: ColorSpace }
|
|
299
|
-
*
|
|
300
|
-
* Reference:
|
|
301
|
-
* - https://www.russellcottrell.com/photo/matrixCalculator.htm
|
|
302
|
-
*/
|
|
303
|
-
spaces: {},
|
|
304
|
-
convert: function(s, n, r) {
|
|
305
|
-
return this.enabled === !1 || n === r || !n || !r || (this.spaces[n].transfer === et && (s.r = q(s.r), s.g = q(s.g), s.b = q(s.b)), this.spaces[n].primaries !== this.spaces[r].primaries && (s.applyMatrix3(this.spaces[n].toXYZ), s.applyMatrix3(this.spaces[r].fromXYZ)), this.spaces[r].transfer === et && (s.r = Z(s.r), s.g = Z(s.g), s.b = Z(s.b))), s;
|
|
306
|
-
},
|
|
307
|
-
workingToColorSpace: function(s, n) {
|
|
308
|
-
return this.convert(s, this.workingColorSpace, n);
|
|
309
|
-
},
|
|
310
|
-
colorSpaceToWorking: function(s, n) {
|
|
311
|
-
return this.convert(s, n, this.workingColorSpace);
|
|
312
|
-
},
|
|
313
|
-
getPrimaries: function(s) {
|
|
314
|
-
return this.spaces[s].primaries;
|
|
315
|
-
},
|
|
316
|
-
getTransfer: function(s) {
|
|
317
|
-
return s === Rt ? gt : this.spaces[s].transfer;
|
|
318
|
-
},
|
|
319
|
-
getToneMappingMode: function(s) {
|
|
320
|
-
return this.spaces[s].outputColorSpaceConfig.toneMappingMode || "standard";
|
|
321
|
-
},
|
|
322
|
-
getLuminanceCoefficients: function(s, n = this.workingColorSpace) {
|
|
323
|
-
return s.fromArray(this.spaces[n].luminanceCoefficients);
|
|
324
|
-
},
|
|
325
|
-
define: function(s) {
|
|
326
|
-
Object.assign(this.spaces, s);
|
|
327
|
-
},
|
|
328
|
-
// Internal APIs
|
|
329
|
-
_getMatrix: function(s, n, r) {
|
|
330
|
-
return s.copy(this.spaces[n].toXYZ).multiply(this.spaces[r].fromXYZ);
|
|
331
|
-
},
|
|
332
|
-
_getDrawingBufferColorSpace: function(s) {
|
|
333
|
-
return this.spaces[s].outputColorSpaceConfig.drawingBufferColorSpace;
|
|
334
|
-
},
|
|
335
|
-
_getUnpackColorSpace: function(s = this.workingColorSpace) {
|
|
336
|
-
return this.spaces[s].workingColorSpaceConfig.unpackColorSpace;
|
|
337
|
-
},
|
|
338
|
-
// Deprecated
|
|
339
|
-
fromWorkingColorSpace: function(s, n) {
|
|
340
|
-
return mt("ColorManagement: .fromWorkingColorSpace() has been renamed to .workingToColorSpace()."), f.workingToColorSpace(s, n);
|
|
341
|
-
},
|
|
342
|
-
toWorkingColorSpace: function(s, n) {
|
|
343
|
-
return mt("ColorManagement: .toWorkingColorSpace() has been renamed to .colorSpaceToWorking()."), f.colorSpaceToWorking(s, n);
|
|
344
|
-
}
|
|
345
|
-
}, t = [0.64, 0.33, 0.3, 0.6, 0.15, 0.06], e = [0.2126, 0.7152, 0.0722], i = [0.3127, 0.329];
|
|
346
|
-
return f.define({
|
|
347
|
-
[ft]: {
|
|
348
|
-
primaries: t,
|
|
349
|
-
whitePoint: i,
|
|
350
|
-
transfer: gt,
|
|
351
|
-
toXYZ: wt,
|
|
352
|
-
fromXYZ: Ct,
|
|
353
|
-
luminanceCoefficients: e,
|
|
354
|
-
workingColorSpaceConfig: { unpackColorSpace: v },
|
|
355
|
-
outputColorSpaceConfig: { drawingBufferColorSpace: v }
|
|
356
|
-
},
|
|
357
|
-
[v]: {
|
|
358
|
-
primaries: t,
|
|
359
|
-
whitePoint: i,
|
|
360
|
-
transfer: et,
|
|
361
|
-
toXYZ: wt,
|
|
362
|
-
fromXYZ: Ct,
|
|
363
|
-
luminanceCoefficients: e,
|
|
364
|
-
outputColorSpaceConfig: { drawingBufferColorSpace: v }
|
|
365
|
-
}
|
|
366
|
-
}), f;
|
|
367
|
-
}
|
|
368
|
-
const k = /* @__PURE__ */ qt();
|
|
369
|
-
function q(f) {
|
|
370
|
-
return f < 0.04045 ? f * 0.0773993808 : Math.pow(f * 0.9478672986 + 0.0521327014, 2.4);
|
|
371
|
-
}
|
|
372
|
-
function Z(f) {
|
|
373
|
-
return f < 31308e-7 ? f * 12.92 : 1.055 * Math.pow(f, 0.41666) - 0.055;
|
|
374
|
-
}
|
|
375
|
-
const vt = {
|
|
376
|
-
aliceblue: 15792383,
|
|
377
|
-
antiquewhite: 16444375,
|
|
378
|
-
aqua: 65535,
|
|
379
|
-
aquamarine: 8388564,
|
|
380
|
-
azure: 15794175,
|
|
381
|
-
beige: 16119260,
|
|
382
|
-
bisque: 16770244,
|
|
383
|
-
black: 0,
|
|
384
|
-
blanchedalmond: 16772045,
|
|
385
|
-
blue: 255,
|
|
386
|
-
blueviolet: 9055202,
|
|
387
|
-
brown: 10824234,
|
|
388
|
-
burlywood: 14596231,
|
|
389
|
-
cadetblue: 6266528,
|
|
390
|
-
chartreuse: 8388352,
|
|
391
|
-
chocolate: 13789470,
|
|
392
|
-
coral: 16744272,
|
|
393
|
-
cornflowerblue: 6591981,
|
|
394
|
-
cornsilk: 16775388,
|
|
395
|
-
crimson: 14423100,
|
|
396
|
-
cyan: 65535,
|
|
397
|
-
darkblue: 139,
|
|
398
|
-
darkcyan: 35723,
|
|
399
|
-
darkgoldenrod: 12092939,
|
|
400
|
-
darkgray: 11119017,
|
|
401
|
-
darkgreen: 25600,
|
|
402
|
-
darkgrey: 11119017,
|
|
403
|
-
darkkhaki: 12433259,
|
|
404
|
-
darkmagenta: 9109643,
|
|
405
|
-
darkolivegreen: 5597999,
|
|
406
|
-
darkorange: 16747520,
|
|
407
|
-
darkorchid: 10040012,
|
|
408
|
-
darkred: 9109504,
|
|
409
|
-
darksalmon: 15308410,
|
|
410
|
-
darkseagreen: 9419919,
|
|
411
|
-
darkslateblue: 4734347,
|
|
412
|
-
darkslategray: 3100495,
|
|
413
|
-
darkslategrey: 3100495,
|
|
414
|
-
darkturquoise: 52945,
|
|
415
|
-
darkviolet: 9699539,
|
|
416
|
-
deeppink: 16716947,
|
|
417
|
-
deepskyblue: 49151,
|
|
418
|
-
dimgray: 6908265,
|
|
419
|
-
dimgrey: 6908265,
|
|
420
|
-
dodgerblue: 2003199,
|
|
421
|
-
firebrick: 11674146,
|
|
422
|
-
floralwhite: 16775920,
|
|
423
|
-
forestgreen: 2263842,
|
|
424
|
-
fuchsia: 16711935,
|
|
425
|
-
gainsboro: 14474460,
|
|
426
|
-
ghostwhite: 16316671,
|
|
427
|
-
gold: 16766720,
|
|
428
|
-
goldenrod: 14329120,
|
|
429
|
-
gray: 8421504,
|
|
430
|
-
green: 32768,
|
|
431
|
-
greenyellow: 11403055,
|
|
432
|
-
grey: 8421504,
|
|
433
|
-
honeydew: 15794160,
|
|
434
|
-
hotpink: 16738740,
|
|
435
|
-
indianred: 13458524,
|
|
436
|
-
indigo: 4915330,
|
|
437
|
-
ivory: 16777200,
|
|
438
|
-
khaki: 15787660,
|
|
439
|
-
lavender: 15132410,
|
|
440
|
-
lavenderblush: 16773365,
|
|
441
|
-
lawngreen: 8190976,
|
|
442
|
-
lemonchiffon: 16775885,
|
|
443
|
-
lightblue: 11393254,
|
|
444
|
-
lightcoral: 15761536,
|
|
445
|
-
lightcyan: 14745599,
|
|
446
|
-
lightgoldenrodyellow: 16448210,
|
|
447
|
-
lightgray: 13882323,
|
|
448
|
-
lightgreen: 9498256,
|
|
449
|
-
lightgrey: 13882323,
|
|
450
|
-
lightpink: 16758465,
|
|
451
|
-
lightsalmon: 16752762,
|
|
452
|
-
lightseagreen: 2142890,
|
|
453
|
-
lightskyblue: 8900346,
|
|
454
|
-
lightslategray: 7833753,
|
|
455
|
-
lightslategrey: 7833753,
|
|
456
|
-
lightsteelblue: 11584734,
|
|
457
|
-
lightyellow: 16777184,
|
|
458
|
-
lime: 65280,
|
|
459
|
-
limegreen: 3329330,
|
|
460
|
-
linen: 16445670,
|
|
461
|
-
magenta: 16711935,
|
|
462
|
-
maroon: 8388608,
|
|
463
|
-
mediumaquamarine: 6737322,
|
|
464
|
-
mediumblue: 205,
|
|
465
|
-
mediumorchid: 12211667,
|
|
466
|
-
mediumpurple: 9662683,
|
|
467
|
-
mediumseagreen: 3978097,
|
|
468
|
-
mediumslateblue: 8087790,
|
|
469
|
-
mediumspringgreen: 64154,
|
|
470
|
-
mediumturquoise: 4772300,
|
|
471
|
-
mediumvioletred: 13047173,
|
|
472
|
-
midnightblue: 1644912,
|
|
473
|
-
mintcream: 16121850,
|
|
474
|
-
mistyrose: 16770273,
|
|
475
|
-
moccasin: 16770229,
|
|
476
|
-
navajowhite: 16768685,
|
|
477
|
-
navy: 128,
|
|
478
|
-
oldlace: 16643558,
|
|
479
|
-
olive: 8421376,
|
|
480
|
-
olivedrab: 7048739,
|
|
481
|
-
orange: 16753920,
|
|
482
|
-
orangered: 16729344,
|
|
483
|
-
orchid: 14315734,
|
|
484
|
-
palegoldenrod: 15657130,
|
|
485
|
-
palegreen: 10025880,
|
|
486
|
-
paleturquoise: 11529966,
|
|
487
|
-
palevioletred: 14381203,
|
|
488
|
-
papayawhip: 16773077,
|
|
489
|
-
peachpuff: 16767673,
|
|
490
|
-
peru: 13468991,
|
|
491
|
-
pink: 16761035,
|
|
492
|
-
plum: 14524637,
|
|
493
|
-
powderblue: 11591910,
|
|
494
|
-
purple: 8388736,
|
|
495
|
-
rebeccapurple: 6697881,
|
|
496
|
-
red: 16711680,
|
|
497
|
-
rosybrown: 12357519,
|
|
498
|
-
royalblue: 4286945,
|
|
499
|
-
saddlebrown: 9127187,
|
|
500
|
-
salmon: 16416882,
|
|
501
|
-
sandybrown: 16032864,
|
|
502
|
-
seagreen: 3050327,
|
|
503
|
-
seashell: 16774638,
|
|
504
|
-
sienna: 10506797,
|
|
505
|
-
silver: 12632256,
|
|
506
|
-
skyblue: 8900331,
|
|
507
|
-
slateblue: 6970061,
|
|
508
|
-
slategray: 7372944,
|
|
509
|
-
slategrey: 7372944,
|
|
510
|
-
snow: 16775930,
|
|
511
|
-
springgreen: 65407,
|
|
512
|
-
steelblue: 4620980,
|
|
513
|
-
tan: 13808780,
|
|
514
|
-
teal: 32896,
|
|
515
|
-
thistle: 14204888,
|
|
516
|
-
tomato: 16737095,
|
|
517
|
-
turquoise: 4251856,
|
|
518
|
-
violet: 15631086,
|
|
519
|
-
wheat: 16113331,
|
|
520
|
-
white: 16777215,
|
|
521
|
-
whitesmoke: 16119285,
|
|
522
|
-
yellow: 16776960,
|
|
523
|
-
yellowgreen: 10145074
|
|
524
|
-
}, E = { h: 0, s: 0, l: 0 }, j = { h: 0, s: 0, l: 0 };
|
|
525
|
-
function ot(f, t, e) {
|
|
526
|
-
return e < 0 && (e += 1), e > 1 && (e -= 1), e < 1 / 6 ? f + (t - f) * 6 * e : e < 1 / 2 ? t : e < 2 / 3 ? f + (t - f) * 6 * (2 / 3 - e) : f;
|
|
527
|
-
}
|
|
528
|
-
class ct {
|
|
529
|
-
/**
|
|
530
|
-
* Constructs a new color.
|
|
531
|
-
*
|
|
532
|
-
* Note that standard method of specifying color in three.js is with a hexadecimal triplet,
|
|
533
|
-
* and that method is used throughout the rest of the documentation.
|
|
534
|
-
*
|
|
535
|
-
* @param {(number|string|Color)} [r] - The red component of the color. If `g` and `b` are
|
|
536
|
-
* not provided, it can be hexadecimal triplet, a CSS-style string or another `Color` instance.
|
|
537
|
-
* @param {number} [g] - The green component.
|
|
538
|
-
* @param {number} [b] - The blue component.
|
|
539
|
-
*/
|
|
540
|
-
constructor(t, e, i) {
|
|
541
|
-
return this.isColor = !0, this.r = 1, this.g = 1, this.b = 1, this.set(t, e, i);
|
|
542
|
-
}
|
|
543
|
-
/**
|
|
544
|
-
* Sets the colors's components from the given values.
|
|
545
|
-
*
|
|
546
|
-
* @param {(number|string|Color)} [r] - The red component of the color. If `g` and `b` are
|
|
547
|
-
* not provided, it can be hexadecimal triplet, a CSS-style string or another `Color` instance.
|
|
548
|
-
* @param {number} [g] - The green component.
|
|
549
|
-
* @param {number} [b] - The blue component.
|
|
550
|
-
* @return {Color} A reference to this color.
|
|
551
|
-
*/
|
|
552
|
-
set(t, e, i) {
|
|
553
|
-
if (e === void 0 && i === void 0) {
|
|
554
|
-
const s = t;
|
|
555
|
-
s && s.isColor ? this.copy(s) : typeof s == "number" ? this.setHex(s) : typeof s == "string" && this.setStyle(s);
|
|
556
|
-
} else
|
|
557
|
-
this.setRGB(t, e, i);
|
|
558
|
-
return this;
|
|
559
|
-
}
|
|
560
|
-
/**
|
|
561
|
-
* Sets the colors's components to the given scalar value.
|
|
562
|
-
*
|
|
563
|
-
* @param {number} scalar - The scalar value.
|
|
564
|
-
* @return {Color} A reference to this color.
|
|
565
|
-
*/
|
|
566
|
-
setScalar(t) {
|
|
567
|
-
return this.r = t, this.g = t, this.b = t, this;
|
|
568
|
-
}
|
|
569
|
-
/**
|
|
570
|
-
* Sets this color from a hexadecimal value.
|
|
571
|
-
*
|
|
572
|
-
* @param {number} hex - The hexadecimal value.
|
|
573
|
-
* @param {string} [colorSpace=SRGBColorSpace] - The color space.
|
|
574
|
-
* @return {Color} A reference to this color.
|
|
575
|
-
*/
|
|
576
|
-
setHex(t, e = v) {
|
|
577
|
-
return t = Math.floor(t), this.r = (t >> 16 & 255) / 255, this.g = (t >> 8 & 255) / 255, this.b = (t & 255) / 255, k.colorSpaceToWorking(this, e), this;
|
|
578
|
-
}
|
|
579
|
-
/**
|
|
580
|
-
* Sets this color from RGB values.
|
|
581
|
-
*
|
|
582
|
-
* @param {number} r - Red channel value between `0.0` and `1.0`.
|
|
583
|
-
* @param {number} g - Green channel value between `0.0` and `1.0`.
|
|
584
|
-
* @param {number} b - Blue channel value between `0.0` and `1.0`.
|
|
585
|
-
* @param {string} [colorSpace=ColorManagement.workingColorSpace] - The color space.
|
|
586
|
-
* @return {Color} A reference to this color.
|
|
587
|
-
*/
|
|
588
|
-
setRGB(t, e, i, s = k.workingColorSpace) {
|
|
589
|
-
return this.r = t, this.g = e, this.b = i, k.colorSpaceToWorking(this, s), this;
|
|
590
|
-
}
|
|
591
|
-
/**
|
|
592
|
-
* Sets this color from RGB values.
|
|
593
|
-
*
|
|
594
|
-
* @param {number} h - Hue value between `0.0` and `1.0`.
|
|
595
|
-
* @param {number} s - Saturation value between `0.0` and `1.0`.
|
|
596
|
-
* @param {number} l - Lightness value between `0.0` and `1.0`.
|
|
597
|
-
* @param {string} [colorSpace=ColorManagement.workingColorSpace] - The color space.
|
|
598
|
-
* @return {Color} A reference to this color.
|
|
599
|
-
*/
|
|
600
|
-
setHSL(t, e, i, s = k.workingColorSpace) {
|
|
601
|
-
if (t = zt(t, 1), e = L(e, 0, 1), i = L(i, 0, 1), e === 0)
|
|
602
|
-
this.r = this.g = this.b = i;
|
|
603
|
-
else {
|
|
604
|
-
const n = i <= 0.5 ? i * (1 + e) : i + e - i * e, r = 2 * i - n;
|
|
605
|
-
this.r = ot(r, n, t + 1 / 3), this.g = ot(r, n, t), this.b = ot(r, n, t - 1 / 3);
|
|
606
|
-
}
|
|
607
|
-
return k.colorSpaceToWorking(this, s), this;
|
|
608
|
-
}
|
|
609
|
-
/**
|
|
610
|
-
* Sets this color from a CSS-style string. For example, `rgb(250, 0,0)`,
|
|
611
|
-
* `rgb(100%, 0%, 0%)`, `hsl(0, 100%, 50%)`, `#ff0000`, `#f00`, or `red` ( or
|
|
612
|
-
* any [X11 color name](https://en.wikipedia.org/wiki/X11_color_names#Color_name_chart) -
|
|
613
|
-
* all 140 color names are supported).
|
|
614
|
-
*
|
|
615
|
-
* @param {string} style - Color as a CSS-style string.
|
|
616
|
-
* @param {string} [colorSpace=SRGBColorSpace] - The color space.
|
|
617
|
-
* @return {Color} A reference to this color.
|
|
618
|
-
*/
|
|
619
|
-
setStyle(t, e = v) {
|
|
620
|
-
function i(n) {
|
|
621
|
-
n !== void 0 && parseFloat(n) < 1 && N("Color: Alpha component of " + t + " will be ignored.");
|
|
622
|
-
}
|
|
623
|
-
let s;
|
|
624
|
-
if (s = /^(\w+)\(([^\)]*)\)/.exec(t)) {
|
|
625
|
-
let n;
|
|
626
|
-
const r = s[1], o = s[2];
|
|
627
|
-
switch (r) {
|
|
628
|
-
case "rgb":
|
|
629
|
-
case "rgba":
|
|
630
|
-
if (n = /^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))
|
|
631
|
-
return i(n[4]), this.setRGB(
|
|
632
|
-
Math.min(255, parseInt(n[1], 10)) / 255,
|
|
633
|
-
Math.min(255, parseInt(n[2], 10)) / 255,
|
|
634
|
-
Math.min(255, parseInt(n[3], 10)) / 255,
|
|
635
|
-
e
|
|
636
|
-
);
|
|
637
|
-
if (n = /^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))
|
|
638
|
-
return i(n[4]), this.setRGB(
|
|
639
|
-
Math.min(100, parseInt(n[1], 10)) / 100,
|
|
640
|
-
Math.min(100, parseInt(n[2], 10)) / 100,
|
|
641
|
-
Math.min(100, parseInt(n[3], 10)) / 100,
|
|
642
|
-
e
|
|
643
|
-
);
|
|
644
|
-
break;
|
|
645
|
-
case "hsl":
|
|
646
|
-
case "hsla":
|
|
647
|
-
if (n = /^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\%\s*,\s*(\d*\.?\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))
|
|
648
|
-
return i(n[4]), this.setHSL(
|
|
649
|
-
parseFloat(n[1]) / 360,
|
|
650
|
-
parseFloat(n[2]) / 100,
|
|
651
|
-
parseFloat(n[3]) / 100,
|
|
652
|
-
e
|
|
653
|
-
);
|
|
654
|
-
break;
|
|
655
|
-
default:
|
|
656
|
-
N("Color: Unknown color model " + t);
|
|
657
|
-
}
|
|
658
|
-
} else if (s = /^\#([A-Fa-f\d]+)$/.exec(t)) {
|
|
659
|
-
const n = s[1], r = n.length;
|
|
660
|
-
if (r === 3)
|
|
661
|
-
return this.setRGB(
|
|
662
|
-
parseInt(n.charAt(0), 16) / 15,
|
|
663
|
-
parseInt(n.charAt(1), 16) / 15,
|
|
664
|
-
parseInt(n.charAt(2), 16) / 15,
|
|
665
|
-
e
|
|
666
|
-
);
|
|
667
|
-
if (r === 6)
|
|
668
|
-
return this.setHex(parseInt(n, 16), e);
|
|
669
|
-
N("Color: Invalid hex color " + t);
|
|
670
|
-
} else if (t && t.length > 0)
|
|
671
|
-
return this.setColorName(t, e);
|
|
672
|
-
return this;
|
|
673
|
-
}
|
|
674
|
-
/**
|
|
675
|
-
* Sets this color from a color name. Faster than {@link Color#setStyle} if
|
|
676
|
-
* you don't need the other CSS-style formats.
|
|
677
|
-
*
|
|
678
|
-
* For convenience, the list of names is exposed in `Color.NAMES` as a hash.
|
|
679
|
-
* ```js
|
|
680
|
-
* Color.NAMES.aliceblue // returns 0xF0F8FF
|
|
681
|
-
* ```
|
|
682
|
-
*
|
|
683
|
-
* @param {string} style - The color name.
|
|
684
|
-
* @param {string} [colorSpace=SRGBColorSpace] - The color space.
|
|
685
|
-
* @return {Color} A reference to this color.
|
|
686
|
-
*/
|
|
687
|
-
setColorName(t, e = v) {
|
|
688
|
-
const i = vt[t.toLowerCase()];
|
|
689
|
-
return i !== void 0 ? this.setHex(i, e) : N("Color: Unknown color " + t), this;
|
|
690
|
-
}
|
|
691
|
-
/**
|
|
692
|
-
* Returns a new color with copied values from this instance.
|
|
693
|
-
*
|
|
694
|
-
* @return {Color} A clone of this instance.
|
|
695
|
-
*/
|
|
696
|
-
clone() {
|
|
697
|
-
return new this.constructor(this.r, this.g, this.b);
|
|
698
|
-
}
|
|
699
|
-
/**
|
|
700
|
-
* Copies the values of the given color to this instance.
|
|
701
|
-
*
|
|
702
|
-
* @param {Color} color - The color to copy.
|
|
703
|
-
* @return {Color} A reference to this color.
|
|
704
|
-
*/
|
|
705
|
-
copy(t) {
|
|
706
|
-
return this.r = t.r, this.g = t.g, this.b = t.b, this;
|
|
707
|
-
}
|
|
708
|
-
/**
|
|
709
|
-
* Copies the given color into this color, and then converts this color from
|
|
710
|
-
* `SRGBColorSpace` to `LinearSRGBColorSpace`.
|
|
711
|
-
*
|
|
712
|
-
* @param {Color} color - The color to copy/convert.
|
|
713
|
-
* @return {Color} A reference to this color.
|
|
714
|
-
*/
|
|
715
|
-
copySRGBToLinear(t) {
|
|
716
|
-
return this.r = q(t.r), this.g = q(t.g), this.b = q(t.b), this;
|
|
717
|
-
}
|
|
718
|
-
/**
|
|
719
|
-
* Copies the given color into this color, and then converts this color from
|
|
720
|
-
* `LinearSRGBColorSpace` to `SRGBColorSpace`.
|
|
721
|
-
*
|
|
722
|
-
* @param {Color} color - The color to copy/convert.
|
|
723
|
-
* @return {Color} A reference to this color.
|
|
724
|
-
*/
|
|
725
|
-
copyLinearToSRGB(t) {
|
|
726
|
-
return this.r = Z(t.r), this.g = Z(t.g), this.b = Z(t.b), this;
|
|
727
|
-
}
|
|
728
|
-
/**
|
|
729
|
-
* Converts this color from `SRGBColorSpace` to `LinearSRGBColorSpace`.
|
|
730
|
-
*
|
|
731
|
-
* @return {Color} A reference to this color.
|
|
732
|
-
*/
|
|
733
|
-
convertSRGBToLinear() {
|
|
734
|
-
return this.copySRGBToLinear(this), this;
|
|
735
|
-
}
|
|
736
|
-
/**
|
|
737
|
-
* Converts this color from `LinearSRGBColorSpace` to `SRGBColorSpace`.
|
|
738
|
-
*
|
|
739
|
-
* @return {Color} A reference to this color.
|
|
740
|
-
*/
|
|
741
|
-
convertLinearToSRGB() {
|
|
742
|
-
return this.copyLinearToSRGB(this), this;
|
|
743
|
-
}
|
|
744
|
-
/**
|
|
745
|
-
* Returns the hexadecimal value of this color.
|
|
746
|
-
*
|
|
747
|
-
* @param {string} [colorSpace=SRGBColorSpace] - The color space.
|
|
748
|
-
* @return {number} The hexadecimal value.
|
|
749
|
-
*/
|
|
750
|
-
getHex(t = v) {
|
|
751
|
-
return k.workingToColorSpace(F.copy(this), t), Math.round(L(F.r * 255, 0, 255)) * 65536 + Math.round(L(F.g * 255, 0, 255)) * 256 + Math.round(L(F.b * 255, 0, 255));
|
|
752
|
-
}
|
|
753
|
-
/**
|
|
754
|
-
* Returns the hexadecimal value of this color as a string (for example, 'FFFFFF').
|
|
755
|
-
*
|
|
756
|
-
* @param {string} [colorSpace=SRGBColorSpace] - The color space.
|
|
757
|
-
* @return {string} The hexadecimal value as a string.
|
|
758
|
-
*/
|
|
759
|
-
getHexString(t = v) {
|
|
760
|
-
return ("000000" + this.getHex(t).toString(16)).slice(-6);
|
|
761
|
-
}
|
|
762
|
-
/**
|
|
763
|
-
* Converts the colors RGB values into the HSL format and stores them into the
|
|
764
|
-
* given target object.
|
|
765
|
-
*
|
|
766
|
-
* @param {{h:number,s:number,l:number}} target - The target object that is used to store the method's result.
|
|
767
|
-
* @param {string} [colorSpace=ColorManagement.workingColorSpace] - The color space.
|
|
768
|
-
* @return {{h:number,s:number,l:number}} The HSL representation of this color.
|
|
769
|
-
*/
|
|
770
|
-
getHSL(t, e = k.workingColorSpace) {
|
|
771
|
-
k.workingToColorSpace(F.copy(this), e);
|
|
772
|
-
const i = F.r, s = F.g, n = F.b, r = Math.max(i, s, n), o = Math.min(i, s, n);
|
|
773
|
-
let h, l;
|
|
774
|
-
const c = (o + r) / 2;
|
|
775
|
-
if (o === r)
|
|
776
|
-
h = 0, l = 0;
|
|
777
|
-
else {
|
|
778
|
-
const u = r - o;
|
|
779
|
-
switch (l = c <= 0.5 ? u / (r + o) : u / (2 - r - o), r) {
|
|
780
|
-
case i:
|
|
781
|
-
h = (s - n) / u + (s < n ? 6 : 0);
|
|
782
|
-
break;
|
|
783
|
-
case s:
|
|
784
|
-
h = (n - i) / u + 2;
|
|
785
|
-
break;
|
|
786
|
-
case n:
|
|
787
|
-
h = (i - s) / u + 4;
|
|
788
|
-
break;
|
|
789
|
-
}
|
|
790
|
-
h /= 6;
|
|
791
|
-
}
|
|
792
|
-
return t.h = h, t.s = l, t.l = c, t;
|
|
793
|
-
}
|
|
794
|
-
/**
|
|
795
|
-
* Returns the RGB values of this color and stores them into the given target object.
|
|
796
|
-
*
|
|
797
|
-
* @param {Color} target - The target color that is used to store the method's result.
|
|
798
|
-
* @param {string} [colorSpace=ColorManagement.workingColorSpace] - The color space.
|
|
799
|
-
* @return {Color} The RGB representation of this color.
|
|
800
|
-
*/
|
|
801
|
-
getRGB(t, e = k.workingColorSpace) {
|
|
802
|
-
return k.workingToColorSpace(F.copy(this), e), t.r = F.r, t.g = F.g, t.b = F.b, t;
|
|
803
|
-
}
|
|
804
|
-
/**
|
|
805
|
-
* Returns the value of this color as a CSS style string. Example: `rgb(255,0,0)`.
|
|
806
|
-
*
|
|
807
|
-
* @param {string} [colorSpace=SRGBColorSpace] - The color space.
|
|
808
|
-
* @return {string} The CSS representation of this color.
|
|
809
|
-
*/
|
|
810
|
-
getStyle(t = v) {
|
|
811
|
-
k.workingToColorSpace(F.copy(this), t);
|
|
812
|
-
const e = F.r, i = F.g, s = F.b;
|
|
813
|
-
return t !== v ? `color(${t} ${e.toFixed(3)} ${i.toFixed(3)} ${s.toFixed(3)})` : `rgb(${Math.round(e * 255)},${Math.round(i * 255)},${Math.round(s * 255)})`;
|
|
814
|
-
}
|
|
815
|
-
/**
|
|
816
|
-
* Adds the given HSL values to this color's values.
|
|
817
|
-
* Internally, this converts the color's RGB values to HSL, adds HSL
|
|
818
|
-
* and then converts the color back to RGB.
|
|
819
|
-
*
|
|
820
|
-
* @param {number} h - Hue value between `0.0` and `1.0`.
|
|
821
|
-
* @param {number} s - Saturation value between `0.0` and `1.0`.
|
|
822
|
-
* @param {number} l - Lightness value between `0.0` and `1.0`.
|
|
823
|
-
* @return {Color} A reference to this color.
|
|
824
|
-
*/
|
|
825
|
-
offsetHSL(t, e, i) {
|
|
826
|
-
return this.getHSL(E), this.setHSL(E.h + t, E.s + e, E.l + i);
|
|
827
|
-
}
|
|
828
|
-
/**
|
|
829
|
-
* Adds the RGB values of the given color to the RGB values of this color.
|
|
830
|
-
*
|
|
831
|
-
* @param {Color} color - The color to add.
|
|
832
|
-
* @return {Color} A reference to this color.
|
|
833
|
-
*/
|
|
834
|
-
add(t) {
|
|
835
|
-
return this.r += t.r, this.g += t.g, this.b += t.b, this;
|
|
836
|
-
}
|
|
837
|
-
/**
|
|
838
|
-
* Adds the RGB values of the given colors and stores the result in this instance.
|
|
839
|
-
*
|
|
840
|
-
* @param {Color} color1 - The first color.
|
|
841
|
-
* @param {Color} color2 - The second color.
|
|
842
|
-
* @return {Color} A reference to this color.
|
|
843
|
-
*/
|
|
844
|
-
addColors(t, e) {
|
|
845
|
-
return this.r = t.r + e.r, this.g = t.g + e.g, this.b = t.b + e.b, this;
|
|
846
|
-
}
|
|
847
|
-
/**
|
|
848
|
-
* Adds the given scalar value to the RGB values of this color.
|
|
849
|
-
*
|
|
850
|
-
* @param {number} s - The scalar to add.
|
|
851
|
-
* @return {Color} A reference to this color.
|
|
852
|
-
*/
|
|
853
|
-
addScalar(t) {
|
|
854
|
-
return this.r += t, this.g += t, this.b += t, this;
|
|
855
|
-
}
|
|
856
|
-
/**
|
|
857
|
-
* Subtracts the RGB values of the given color from the RGB values of this color.
|
|
858
|
-
*
|
|
859
|
-
* @param {Color} color - The color to subtract.
|
|
860
|
-
* @return {Color} A reference to this color.
|
|
861
|
-
*/
|
|
862
|
-
sub(t) {
|
|
863
|
-
return this.r = Math.max(0, this.r - t.r), this.g = Math.max(0, this.g - t.g), this.b = Math.max(0, this.b - t.b), this;
|
|
864
|
-
}
|
|
865
|
-
/**
|
|
866
|
-
* Multiplies the RGB values of the given color with the RGB values of this color.
|
|
867
|
-
*
|
|
868
|
-
* @param {Color} color - The color to multiply.
|
|
869
|
-
* @return {Color} A reference to this color.
|
|
870
|
-
*/
|
|
871
|
-
multiply(t) {
|
|
872
|
-
return this.r *= t.r, this.g *= t.g, this.b *= t.b, this;
|
|
873
|
-
}
|
|
874
|
-
/**
|
|
875
|
-
* Multiplies the given scalar value with the RGB values of this color.
|
|
876
|
-
*
|
|
877
|
-
* @param {number} s - The scalar to multiply.
|
|
878
|
-
* @return {Color} A reference to this color.
|
|
879
|
-
*/
|
|
880
|
-
multiplyScalar(t) {
|
|
881
|
-
return this.r *= t, this.g *= t, this.b *= t, this;
|
|
882
|
-
}
|
|
883
|
-
/**
|
|
884
|
-
* Linearly interpolates this color's RGB values toward the RGB values of the
|
|
885
|
-
* given color. The alpha argument can be thought of as the ratio between
|
|
886
|
-
* the two colors, where `0.0` is this color and `1.0` is the first argument.
|
|
887
|
-
*
|
|
888
|
-
* @param {Color} color - The color to converge on.
|
|
889
|
-
* @param {number} alpha - The interpolation factor in the closed interval `[0,1]`.
|
|
890
|
-
* @return {Color} A reference to this color.
|
|
891
|
-
*/
|
|
892
|
-
lerp(t, e) {
|
|
893
|
-
return this.r += (t.r - this.r) * e, this.g += (t.g - this.g) * e, this.b += (t.b - this.b) * e, this;
|
|
894
|
-
}
|
|
895
|
-
/**
|
|
896
|
-
* Linearly interpolates between the given colors and stores the result in this instance.
|
|
897
|
-
* The alpha argument can be thought of as the ratio between the two colors, where `0.0`
|
|
898
|
-
* is the first and `1.0` is the second color.
|
|
899
|
-
*
|
|
900
|
-
* @param {Color} color1 - The first color.
|
|
901
|
-
* @param {Color} color2 - The second color.
|
|
902
|
-
* @param {number} alpha - The interpolation factor in the closed interval `[0,1]`.
|
|
903
|
-
* @return {Color} A reference to this color.
|
|
904
|
-
*/
|
|
905
|
-
lerpColors(t, e, i) {
|
|
906
|
-
return this.r = t.r + (e.r - t.r) * i, this.g = t.g + (e.g - t.g) * i, this.b = t.b + (e.b - t.b) * i, this;
|
|
907
|
-
}
|
|
908
|
-
/**
|
|
909
|
-
* Linearly interpolates this color's HSL values toward the HSL values of the
|
|
910
|
-
* given color. It differs from {@link Color#lerp} by not interpolating straight
|
|
911
|
-
* from one color to the other, but instead going through all the hues in between
|
|
912
|
-
* those two colors. The alpha argument can be thought of as the ratio between
|
|
913
|
-
* the two colors, where 0.0 is this color and 1.0 is the first argument.
|
|
914
|
-
*
|
|
915
|
-
* @param {Color} color - The color to converge on.
|
|
916
|
-
* @param {number} alpha - The interpolation factor in the closed interval `[0,1]`.
|
|
917
|
-
* @return {Color} A reference to this color.
|
|
918
|
-
*/
|
|
919
|
-
lerpHSL(t, e) {
|
|
920
|
-
this.getHSL(E), t.getHSL(j);
|
|
921
|
-
const i = st(E.h, j.h, e), s = st(E.s, j.s, e), n = st(E.l, j.l, e);
|
|
922
|
-
return this.setHSL(i, s, n), this;
|
|
923
|
-
}
|
|
924
|
-
/**
|
|
925
|
-
* Sets the color's RGB components from the given 3D vector.
|
|
926
|
-
*
|
|
927
|
-
* @param {Vector3} v - The vector to set.
|
|
928
|
-
* @return {Color} A reference to this color.
|
|
929
|
-
*/
|
|
930
|
-
setFromVector3(t) {
|
|
931
|
-
return this.r = t.x, this.g = t.y, this.b = t.z, this;
|
|
932
|
-
}
|
|
933
|
-
/**
|
|
934
|
-
* Transforms this color with the given 3x3 matrix.
|
|
935
|
-
*
|
|
936
|
-
* @param {Matrix3} m - The matrix.
|
|
937
|
-
* @return {Color} A reference to this color.
|
|
938
|
-
*/
|
|
939
|
-
applyMatrix3(t) {
|
|
940
|
-
const e = this.r, i = this.g, s = this.b, n = t.elements;
|
|
941
|
-
return this.r = n[0] * e + n[3] * i + n[6] * s, this.g = n[1] * e + n[4] * i + n[7] * s, this.b = n[2] * e + n[5] * i + n[8] * s, this;
|
|
942
|
-
}
|
|
943
|
-
/**
|
|
944
|
-
* Returns `true` if this color is equal with the given one.
|
|
945
|
-
*
|
|
946
|
-
* @param {Color} c - The color to test for equality.
|
|
947
|
-
* @return {boolean} Whether this bounding color is equal with the given one.
|
|
948
|
-
*/
|
|
949
|
-
equals(t) {
|
|
950
|
-
return t.r === this.r && t.g === this.g && t.b === this.b;
|
|
951
|
-
}
|
|
952
|
-
/**
|
|
953
|
-
* Sets this color's RGB components from the given array.
|
|
954
|
-
*
|
|
955
|
-
* @param {Array<number>} array - An array holding the RGB values.
|
|
956
|
-
* @param {number} [offset=0] - The offset into the array.
|
|
957
|
-
* @return {Color} A reference to this color.
|
|
958
|
-
*/
|
|
959
|
-
fromArray(t, e = 0) {
|
|
960
|
-
return this.r = t[e], this.g = t[e + 1], this.b = t[e + 2], this;
|
|
961
|
-
}
|
|
962
|
-
/**
|
|
963
|
-
* Writes the RGB components of this color to the given array. If no array is provided,
|
|
964
|
-
* the method returns a new instance.
|
|
965
|
-
*
|
|
966
|
-
* @param {Array<number>} [array=[]] - The target array holding the color components.
|
|
967
|
-
* @param {number} [offset=0] - Index of the first element in the array.
|
|
968
|
-
* @return {Array<number>} The color components.
|
|
969
|
-
*/
|
|
970
|
-
toArray(t = [], e = 0) {
|
|
971
|
-
return t[e] = this.r, t[e + 1] = this.g, t[e + 2] = this.b, t;
|
|
972
|
-
}
|
|
973
|
-
/**
|
|
974
|
-
* Sets the components of this color from the given buffer attribute.
|
|
975
|
-
*
|
|
976
|
-
* @param {BufferAttribute} attribute - The buffer attribute holding color data.
|
|
977
|
-
* @param {number} index - The index into the attribute.
|
|
978
|
-
* @return {Color} A reference to this color.
|
|
979
|
-
*/
|
|
980
|
-
fromBufferAttribute(t, e) {
|
|
981
|
-
return this.r = t.getX(e), this.g = t.getY(e), this.b = t.getZ(e), this;
|
|
982
|
-
}
|
|
983
|
-
/**
|
|
984
|
-
* This methods defines the serialization result of this class. Returns the color
|
|
985
|
-
* as a hexadecimal value.
|
|
986
|
-
*
|
|
987
|
-
* @return {number} The hexadecimal value.
|
|
988
|
-
*/
|
|
989
|
-
toJSON() {
|
|
990
|
-
return this.getHex();
|
|
991
|
-
}
|
|
992
|
-
*[Symbol.iterator]() {
|
|
993
|
-
yield this.r, yield this.g, yield this.b;
|
|
994
|
-
}
|
|
995
|
-
}
|
|
996
|
-
const F = /* @__PURE__ */ new ct();
|
|
997
|
-
ct.NAMES = vt;
|
|
998
|
-
let Zt = 0;
|
|
999
|
-
class Yt extends Tt {
|
|
1000
|
-
/**
|
|
1001
|
-
* Constructs a new material.
|
|
1002
|
-
*/
|
|
1003
|
-
constructor() {
|
|
1004
|
-
super(), this.isMaterial = !0, Object.defineProperty(this, "id", { value: Zt++ }), this.uuid = kt(), this.name = "", this.type = "Material", this.blending = xt, this.side = bt, this.vertexColors = !1, this.opacity = 1, this.transparent = !1, this.alphaHash = !1, this.blendSrc = yt, this.blendDst = Ft, this.blendEquation = St, this.blendSrcAlpha = null, this.blendDstAlpha = null, this.blendEquationAlpha = null, this.blendColor = new ct(0, 0, 0), this.blendAlpha = 0, this.depthFunc = At, this.depthTest = !0, this.depthWrite = !0, this.stencilWriteMask = 255, this.stencilFunc = Mt, this.stencilRef = 0, this.stencilFuncMask = 255, this.stencilFail = I, this.stencilZFail = I, this.stencilZPass = I, this.stencilWrite = !1, this.clippingPlanes = null, this.clipIntersection = !1, this.clipShadows = !1, this.shadowSide = null, this.colorWrite = !0, this.precision = null, this.polygonOffset = !1, this.polygonOffsetFactor = 0, this.polygonOffsetUnits = 0, this.dithering = !1, this.alphaToCoverage = !1, this.premultipliedAlpha = !1, this.forceSinglePass = !1, this.allowOverride = !0, this.visible = !0, this.toneMapped = !0, this.userData = {}, this.version = 0, this._alphaTest = 0;
|
|
1005
|
-
}
|
|
1006
|
-
/**
|
|
1007
|
-
* Sets the alpha value to be used when running an alpha test. The material
|
|
1008
|
-
* will not be rendered if the opacity is lower than this value.
|
|
1009
|
-
*
|
|
1010
|
-
* @type {number}
|
|
1011
|
-
* @readonly
|
|
1012
|
-
* @default 0
|
|
1013
|
-
*/
|
|
1014
|
-
get alphaTest() {
|
|
1015
|
-
return this._alphaTest;
|
|
1016
|
-
}
|
|
1017
|
-
set alphaTest(t) {
|
|
1018
|
-
this._alphaTest > 0 != t > 0 && this.version++, this._alphaTest = t;
|
|
1019
|
-
}
|
|
1020
|
-
/**
|
|
1021
|
-
* An optional callback that is executed immediately before the material is used to render a 3D object.
|
|
1022
|
-
*
|
|
1023
|
-
* This method can only be used when rendering with {@link WebGLRenderer}.
|
|
1024
|
-
*
|
|
1025
|
-
* @param {WebGLRenderer} renderer - The renderer.
|
|
1026
|
-
* @param {Scene} scene - The scene.
|
|
1027
|
-
* @param {Camera} camera - The camera that is used to render the scene.
|
|
1028
|
-
* @param {BufferGeometry} geometry - The 3D object's geometry.
|
|
1029
|
-
* @param {Object3D} object - The 3D object.
|
|
1030
|
-
* @param {Object} group - The geometry group data.
|
|
1031
|
-
*/
|
|
1032
|
-
onBeforeRender() {
|
|
1033
|
-
}
|
|
1034
|
-
/**
|
|
1035
|
-
* An optional callback that is executed immediately before the shader
|
|
1036
|
-
* program is compiled. This function is called with the shader source code
|
|
1037
|
-
* as a parameter. Useful for the modification of built-in materials.
|
|
1038
|
-
*
|
|
1039
|
-
* This method can only be used when rendering with {@link WebGLRenderer}. The
|
|
1040
|
-
* recommended approach when customizing materials is to use `WebGPURenderer` with the new
|
|
1041
|
-
* Node Material system and [TSL](https://github.com/mrdoob/three.js/wiki/Three.js-Shading-Language).
|
|
1042
|
-
*
|
|
1043
|
-
* @param {{vertexShader:string,fragmentShader:string,uniforms:Object}} shaderobject - The object holds the uniforms and the vertex and fragment shader source.
|
|
1044
|
-
* @param {WebGLRenderer} renderer - A reference to the renderer.
|
|
1045
|
-
*/
|
|
1046
|
-
onBeforeCompile() {
|
|
1047
|
-
}
|
|
1048
|
-
/**
|
|
1049
|
-
* In case {@link Material#onBeforeCompile} is used, this callback can be used to identify
|
|
1050
|
-
* values of settings used in `onBeforeCompile()`, so three.js can reuse a cached
|
|
1051
|
-
* shader or recompile the shader for this material as needed.
|
|
1052
|
-
*
|
|
1053
|
-
* This method can only be used when rendering with {@link WebGLRenderer}.
|
|
1054
|
-
*
|
|
1055
|
-
* @return {string} The custom program cache key.
|
|
1056
|
-
*/
|
|
1057
|
-
customProgramCacheKey() {
|
|
1058
|
-
return this.onBeforeCompile.toString();
|
|
1059
|
-
}
|
|
1060
|
-
/**
|
|
1061
|
-
* This method can be used to set default values from parameter objects.
|
|
1062
|
-
* It is a generic implementation so it can be used with different types
|
|
1063
|
-
* of materials.
|
|
1064
|
-
*
|
|
1065
|
-
* @param {Object} [values] - The material values to set.
|
|
1066
|
-
*/
|
|
1067
|
-
setValues(t) {
|
|
1068
|
-
if (t !== void 0)
|
|
1069
|
-
for (const e in t) {
|
|
1070
|
-
const i = t[e];
|
|
1071
|
-
if (i === void 0) {
|
|
1072
|
-
N(`Material: parameter '${e}' has value of undefined.`);
|
|
1073
|
-
continue;
|
|
1074
|
-
}
|
|
1075
|
-
const s = this[e];
|
|
1076
|
-
if (s === void 0) {
|
|
1077
|
-
N(`Material: '${e}' is not a property of THREE.${this.type}.`);
|
|
1078
|
-
continue;
|
|
1079
|
-
}
|
|
1080
|
-
s && s.isColor ? s.set(i) : s && s.isVector3 && i && i.isVector3 ? s.copy(i) : this[e] = i;
|
|
1081
|
-
}
|
|
1082
|
-
}
|
|
1083
|
-
/**
|
|
1084
|
-
* Serializes the material into JSON.
|
|
1085
|
-
*
|
|
1086
|
-
* @param {?(Object|string)} meta - An optional value holding meta information about the serialization.
|
|
1087
|
-
* @return {Object} A JSON object representing the serialized material.
|
|
1088
|
-
* @see {@link ObjectLoader#parse}
|
|
1089
|
-
*/
|
|
1090
|
-
toJSON(t) {
|
|
1091
|
-
const e = t === void 0 || typeof t == "string";
|
|
1092
|
-
e && (t = {
|
|
1093
|
-
textures: {},
|
|
1094
|
-
images: {}
|
|
1095
|
-
});
|
|
1096
|
-
const i = {
|
|
1097
|
-
metadata: {
|
|
1098
|
-
version: 4.7,
|
|
1099
|
-
type: "Material",
|
|
1100
|
-
generator: "Material.toJSON"
|
|
1101
|
-
}
|
|
1102
|
-
};
|
|
1103
|
-
i.uuid = this.uuid, i.type = this.type, this.name !== "" && (i.name = this.name), this.color && this.color.isColor && (i.color = this.color.getHex()), this.roughness !== void 0 && (i.roughness = this.roughness), this.metalness !== void 0 && (i.metalness = this.metalness), this.sheen !== void 0 && (i.sheen = this.sheen), this.sheenColor && this.sheenColor.isColor && (i.sheenColor = this.sheenColor.getHex()), this.sheenRoughness !== void 0 && (i.sheenRoughness = this.sheenRoughness), this.emissive && this.emissive.isColor && (i.emissive = this.emissive.getHex()), this.emissiveIntensity !== void 0 && this.emissiveIntensity !== 1 && (i.emissiveIntensity = this.emissiveIntensity), this.specular && this.specular.isColor && (i.specular = this.specular.getHex()), this.specularIntensity !== void 0 && (i.specularIntensity = this.specularIntensity), this.specularColor && this.specularColor.isColor && (i.specularColor = this.specularColor.getHex()), this.shininess !== void 0 && (i.shininess = this.shininess), this.clearcoat !== void 0 && (i.clearcoat = this.clearcoat), this.clearcoatRoughness !== void 0 && (i.clearcoatRoughness = this.clearcoatRoughness), this.clearcoatMap && this.clearcoatMap.isTexture && (i.clearcoatMap = this.clearcoatMap.toJSON(t).uuid), this.clearcoatRoughnessMap && this.clearcoatRoughnessMap.isTexture && (i.clearcoatRoughnessMap = this.clearcoatRoughnessMap.toJSON(t).uuid), this.clearcoatNormalMap && this.clearcoatNormalMap.isTexture && (i.clearcoatNormalMap = this.clearcoatNormalMap.toJSON(t).uuid, i.clearcoatNormalScale = this.clearcoatNormalScale.toArray()), this.sheenColorMap && this.sheenColorMap.isTexture && (i.sheenColorMap = this.sheenColorMap.toJSON(t).uuid), this.sheenRoughnessMap && this.sheenRoughnessMap.isTexture && (i.sheenRoughnessMap = this.sheenRoughnessMap.toJSON(t).uuid), this.dispersion !== void 0 && (i.dispersion = this.dispersion), this.iridescence !== void 0 && (i.iridescence = this.iridescence), this.iridescenceIOR !== void 0 && (i.iridescenceIOR = this.iridescenceIOR), this.iridescenceThicknessRange !== void 0 && (i.iridescenceThicknessRange = this.iridescenceThicknessRange), this.iridescenceMap && this.iridescenceMap.isTexture && (i.iridescenceMap = this.iridescenceMap.toJSON(t).uuid), this.iridescenceThicknessMap && this.iridescenceThicknessMap.isTexture && (i.iridescenceThicknessMap = this.iridescenceThicknessMap.toJSON(t).uuid), this.anisotropy !== void 0 && (i.anisotropy = this.anisotropy), this.anisotropyRotation !== void 0 && (i.anisotropyRotation = this.anisotropyRotation), this.anisotropyMap && this.anisotropyMap.isTexture && (i.anisotropyMap = this.anisotropyMap.toJSON(t).uuid), this.map && this.map.isTexture && (i.map = this.map.toJSON(t).uuid), this.matcap && this.matcap.isTexture && (i.matcap = this.matcap.toJSON(t).uuid), this.alphaMap && this.alphaMap.isTexture && (i.alphaMap = this.alphaMap.toJSON(t).uuid), this.lightMap && this.lightMap.isTexture && (i.lightMap = this.lightMap.toJSON(t).uuid, i.lightMapIntensity = this.lightMapIntensity), this.aoMap && this.aoMap.isTexture && (i.aoMap = this.aoMap.toJSON(t).uuid, i.aoMapIntensity = this.aoMapIntensity), this.bumpMap && this.bumpMap.isTexture && (i.bumpMap = this.bumpMap.toJSON(t).uuid, i.bumpScale = this.bumpScale), this.normalMap && this.normalMap.isTexture && (i.normalMap = this.normalMap.toJSON(t).uuid, i.normalMapType = this.normalMapType, i.normalScale = this.normalScale.toArray()), this.displacementMap && this.displacementMap.isTexture && (i.displacementMap = this.displacementMap.toJSON(t).uuid, i.displacementScale = this.displacementScale, i.displacementBias = this.displacementBias), this.roughnessMap && this.roughnessMap.isTexture && (i.roughnessMap = this.roughnessMap.toJSON(t).uuid), this.metalnessMap && this.metalnessMap.isTexture && (i.metalnessMap = this.metalnessMap.toJSON(t).uuid), this.emissiveMap && this.emissiveMap.isTexture && (i.emissiveMap = this.emissiveMap.toJSON(t).uuid), this.specularMap && this.specularMap.isTexture && (i.specularMap = this.specularMap.toJSON(t).uuid), this.specularIntensityMap && this.specularIntensityMap.isTexture && (i.specularIntensityMap = this.specularIntensityMap.toJSON(t).uuid), this.specularColorMap && this.specularColorMap.isTexture && (i.specularColorMap = this.specularColorMap.toJSON(t).uuid), this.envMap && this.envMap.isTexture && (i.envMap = this.envMap.toJSON(t).uuid, this.combine !== void 0 && (i.combine = this.combine)), this.envMapRotation !== void 0 && (i.envMapRotation = this.envMapRotation.toArray()), this.envMapIntensity !== void 0 && (i.envMapIntensity = this.envMapIntensity), this.reflectivity !== void 0 && (i.reflectivity = this.reflectivity), this.refractionRatio !== void 0 && (i.refractionRatio = this.refractionRatio), this.gradientMap && this.gradientMap.isTexture && (i.gradientMap = this.gradientMap.toJSON(t).uuid), this.transmission !== void 0 && (i.transmission = this.transmission), this.transmissionMap && this.transmissionMap.isTexture && (i.transmissionMap = this.transmissionMap.toJSON(t).uuid), this.thickness !== void 0 && (i.thickness = this.thickness), this.thicknessMap && this.thicknessMap.isTexture && (i.thicknessMap = this.thicknessMap.toJSON(t).uuid), this.attenuationDistance !== void 0 && this.attenuationDistance !== 1 / 0 && (i.attenuationDistance = this.attenuationDistance), this.attenuationColor !== void 0 && (i.attenuationColor = this.attenuationColor.getHex()), this.size !== void 0 && (i.size = this.size), this.shadowSide !== null && (i.shadowSide = this.shadowSide), this.sizeAttenuation !== void 0 && (i.sizeAttenuation = this.sizeAttenuation), this.blending !== xt && (i.blending = this.blending), this.side !== bt && (i.side = this.side), this.vertexColors === !0 && (i.vertexColors = !0), this.opacity < 1 && (i.opacity = this.opacity), this.transparent === !0 && (i.transparent = !0), this.blendSrc !== yt && (i.blendSrc = this.blendSrc), this.blendDst !== Ft && (i.blendDst = this.blendDst), this.blendEquation !== St && (i.blendEquation = this.blendEquation), this.blendSrcAlpha !== null && (i.blendSrcAlpha = this.blendSrcAlpha), this.blendDstAlpha !== null && (i.blendDstAlpha = this.blendDstAlpha), this.blendEquationAlpha !== null && (i.blendEquationAlpha = this.blendEquationAlpha), this.blendColor && this.blendColor.isColor && (i.blendColor = this.blendColor.getHex()), this.blendAlpha !== 0 && (i.blendAlpha = this.blendAlpha), this.depthFunc !== At && (i.depthFunc = this.depthFunc), this.depthTest === !1 && (i.depthTest = this.depthTest), this.depthWrite === !1 && (i.depthWrite = this.depthWrite), this.colorWrite === !1 && (i.colorWrite = this.colorWrite), this.stencilWriteMask !== 255 && (i.stencilWriteMask = this.stencilWriteMask), this.stencilFunc !== Mt && (i.stencilFunc = this.stencilFunc), this.stencilRef !== 0 && (i.stencilRef = this.stencilRef), this.stencilFuncMask !== 255 && (i.stencilFuncMask = this.stencilFuncMask), this.stencilFail !== I && (i.stencilFail = this.stencilFail), this.stencilZFail !== I && (i.stencilZFail = this.stencilZFail), this.stencilZPass !== I && (i.stencilZPass = this.stencilZPass), this.stencilWrite === !0 && (i.stencilWrite = this.stencilWrite), this.rotation !== void 0 && this.rotation !== 0 && (i.rotation = this.rotation), this.polygonOffset === !0 && (i.polygonOffset = !0), this.polygonOffsetFactor !== 0 && (i.polygonOffsetFactor = this.polygonOffsetFactor), this.polygonOffsetUnits !== 0 && (i.polygonOffsetUnits = this.polygonOffsetUnits), this.linewidth !== void 0 && this.linewidth !== 1 && (i.linewidth = this.linewidth), this.dashSize !== void 0 && (i.dashSize = this.dashSize), this.gapSize !== void 0 && (i.gapSize = this.gapSize), this.scale !== void 0 && (i.scale = this.scale), this.dithering === !0 && (i.dithering = !0), this.alphaTest > 0 && (i.alphaTest = this.alphaTest), this.alphaHash === !0 && (i.alphaHash = !0), this.alphaToCoverage === !0 && (i.alphaToCoverage = !0), this.premultipliedAlpha === !0 && (i.premultipliedAlpha = !0), this.forceSinglePass === !0 && (i.forceSinglePass = !0), this.allowOverride === !1 && (i.allowOverride = !1), this.wireframe === !0 && (i.wireframe = !0), this.wireframeLinewidth > 1 && (i.wireframeLinewidth = this.wireframeLinewidth), this.wireframeLinecap !== "round" && (i.wireframeLinecap = this.wireframeLinecap), this.wireframeLinejoin !== "round" && (i.wireframeLinejoin = this.wireframeLinejoin), this.flatShading === !0 && (i.flatShading = !0), this.visible === !1 && (i.visible = !1), this.toneMapped === !1 && (i.toneMapped = !1), this.fog === !1 && (i.fog = !1), Object.keys(this.userData).length > 0 && (i.userData = this.userData);
|
|
1104
|
-
function s(n) {
|
|
1105
|
-
const r = [];
|
|
1106
|
-
for (const o in n) {
|
|
1107
|
-
const h = n[o];
|
|
1108
|
-
delete h.metadata, r.push(h);
|
|
1109
|
-
}
|
|
1110
|
-
return r;
|
|
1111
|
-
}
|
|
1112
|
-
if (e) {
|
|
1113
|
-
const n = s(t.textures), r = s(t.images);
|
|
1114
|
-
n.length > 0 && (i.textures = n), r.length > 0 && (i.images = r);
|
|
1115
|
-
}
|
|
1116
|
-
return i;
|
|
1117
|
-
}
|
|
1118
|
-
/**
|
|
1119
|
-
* Returns a new material with copied values from this instance.
|
|
1120
|
-
*
|
|
1121
|
-
* @return {Material} A clone of this instance.
|
|
1122
|
-
*/
|
|
1123
|
-
clone() {
|
|
1124
|
-
return new this.constructor().copy(this);
|
|
1125
|
-
}
|
|
1126
|
-
/**
|
|
1127
|
-
* Copies the values of the given material to this instance.
|
|
1128
|
-
*
|
|
1129
|
-
* @param {Material} source - The material to copy.
|
|
1130
|
-
* @return {Material} A reference to this instance.
|
|
1131
|
-
*/
|
|
1132
|
-
copy(t) {
|
|
1133
|
-
this.name = t.name, this.blending = t.blending, this.side = t.side, this.vertexColors = t.vertexColors, this.opacity = t.opacity, this.transparent = t.transparent, this.blendSrc = t.blendSrc, this.blendDst = t.blendDst, this.blendEquation = t.blendEquation, this.blendSrcAlpha = t.blendSrcAlpha, this.blendDstAlpha = t.blendDstAlpha, this.blendEquationAlpha = t.blendEquationAlpha, this.blendColor.copy(t.blendColor), this.blendAlpha = t.blendAlpha, this.depthFunc = t.depthFunc, this.depthTest = t.depthTest, this.depthWrite = t.depthWrite, this.stencilWriteMask = t.stencilWriteMask, this.stencilFunc = t.stencilFunc, this.stencilRef = t.stencilRef, this.stencilFuncMask = t.stencilFuncMask, this.stencilFail = t.stencilFail, this.stencilZFail = t.stencilZFail, this.stencilZPass = t.stencilZPass, this.stencilWrite = t.stencilWrite;
|
|
1134
|
-
const e = t.clippingPlanes;
|
|
1135
|
-
let i = null;
|
|
1136
|
-
if (e !== null) {
|
|
1137
|
-
const s = e.length;
|
|
1138
|
-
i = new Array(s);
|
|
1139
|
-
for (let n = 0; n !== s; ++n)
|
|
1140
|
-
i[n] = e[n].clone();
|
|
1141
|
-
}
|
|
1142
|
-
return this.clippingPlanes = i, this.clipIntersection = t.clipIntersection, this.clipShadows = t.clipShadows, this.shadowSide = t.shadowSide, this.colorWrite = t.colorWrite, this.precision = t.precision, this.polygonOffset = t.polygonOffset, this.polygonOffsetFactor = t.polygonOffsetFactor, this.polygonOffsetUnits = t.polygonOffsetUnits, this.dithering = t.dithering, this.alphaTest = t.alphaTest, this.alphaHash = t.alphaHash, this.alphaToCoverage = t.alphaToCoverage, this.premultipliedAlpha = t.premultipliedAlpha, this.forceSinglePass = t.forceSinglePass, this.allowOverride = t.allowOverride, this.visible = t.visible, this.toneMapped = t.toneMapped, this.userData = JSON.parse(JSON.stringify(t.userData)), this;
|
|
1143
|
-
}
|
|
1144
|
-
/**
|
|
1145
|
-
* Frees the GPU-related resources allocated by this instance. Call this
|
|
1146
|
-
* method whenever this instance is no longer used in your app.
|
|
1147
|
-
*
|
|
1148
|
-
* @fires Material#dispose
|
|
1149
|
-
*/
|
|
1150
|
-
dispose() {
|
|
1151
|
-
this.dispatchEvent({ type: "dispose" });
|
|
1152
|
-
}
|
|
1153
|
-
/**
|
|
1154
|
-
* Setting this property to `true` indicates the engine the material
|
|
1155
|
-
* needs to be recompiled.
|
|
1156
|
-
*
|
|
1157
|
-
* @type {boolean}
|
|
1158
|
-
* @default false
|
|
1159
|
-
* @param {boolean} value
|
|
1160
|
-
*/
|
|
1161
|
-
set needsUpdate(t) {
|
|
1162
|
-
t === !0 && this.version++;
|
|
1163
|
-
}
|
|
1164
|
-
}
|
|
1165
|
-
const m = /* @__PURE__ */ new d(), $ = /* @__PURE__ */ new Q();
|
|
1166
|
-
let Xt = 0;
|
|
1167
|
-
class X {
|
|
1168
|
-
/**
|
|
1169
|
-
* Constructs a new buffer attribute.
|
|
1170
|
-
*
|
|
1171
|
-
* @param {TypedArray} array - The array holding the attribute data.
|
|
1172
|
-
* @param {number} itemSize - The item size.
|
|
1173
|
-
* @param {boolean} [normalized=false] - Whether the data are normalized or not.
|
|
1174
|
-
*/
|
|
1175
|
-
constructor(t, e, i = !1) {
|
|
1176
|
-
if (Array.isArray(t))
|
|
1177
|
-
throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");
|
|
1178
|
-
this.isBufferAttribute = !0, Object.defineProperty(this, "id", { value: Xt++ }), this.name = "", this.array = t, this.itemSize = e, this.count = t !== void 0 ? t.length / e : 0, this.normalized = i, this.usage = Bt, this.updateRanges = [], this.gpuType = Et, this.version = 0;
|
|
1179
|
-
}
|
|
1180
|
-
/**
|
|
1181
|
-
* A callback function that is executed after the renderer has transferred the attribute
|
|
1182
|
-
* array data to the GPU.
|
|
1183
|
-
*/
|
|
1184
|
-
onUploadCallback() {
|
|
1185
|
-
}
|
|
1186
|
-
/**
|
|
1187
|
-
* Flag to indicate that this attribute has changed and should be re-sent to
|
|
1188
|
-
* the GPU. Set this to `true` when you modify the value of the array.
|
|
1189
|
-
*
|
|
1190
|
-
* @type {number}
|
|
1191
|
-
* @default false
|
|
1192
|
-
* @param {boolean} value
|
|
1193
|
-
*/
|
|
1194
|
-
set needsUpdate(t) {
|
|
1195
|
-
t === !0 && this.version++;
|
|
1196
|
-
}
|
|
1197
|
-
/**
|
|
1198
|
-
* Sets the usage of this buffer attribute.
|
|
1199
|
-
*
|
|
1200
|
-
* @param {(StaticDrawUsage|DynamicDrawUsage|StreamDrawUsage|StaticReadUsage|DynamicReadUsage|StreamReadUsage|StaticCopyUsage|DynamicCopyUsage|StreamCopyUsage)} value - The usage to set.
|
|
1201
|
-
* @return {BufferAttribute} A reference to this buffer attribute.
|
|
1202
|
-
*/
|
|
1203
|
-
setUsage(t) {
|
|
1204
|
-
return this.usage = t, this;
|
|
1205
|
-
}
|
|
1206
|
-
/**
|
|
1207
|
-
* Adds a range of data in the data array to be updated on the GPU.
|
|
1208
|
-
*
|
|
1209
|
-
* @param {number} start - Position at which to start update.
|
|
1210
|
-
* @param {number} count - The number of components to update.
|
|
1211
|
-
*/
|
|
1212
|
-
addUpdateRange(t, e) {
|
|
1213
|
-
this.updateRanges.push({ start: t, count: e });
|
|
1214
|
-
}
|
|
1215
|
-
/**
|
|
1216
|
-
* Clears the update ranges.
|
|
1217
|
-
*/
|
|
1218
|
-
clearUpdateRanges() {
|
|
1219
|
-
this.updateRanges.length = 0;
|
|
1220
|
-
}
|
|
1221
|
-
/**
|
|
1222
|
-
* Copies the values of the given buffer attribute to this instance.
|
|
1223
|
-
*
|
|
1224
|
-
* @param {BufferAttribute} source - The buffer attribute to copy.
|
|
1225
|
-
* @return {BufferAttribute} A reference to this instance.
|
|
1226
|
-
*/
|
|
1227
|
-
copy(t) {
|
|
1228
|
-
return this.name = t.name, this.array = new t.array.constructor(t.array), this.itemSize = t.itemSize, this.count = t.count, this.normalized = t.normalized, this.usage = t.usage, this.gpuType = t.gpuType, this;
|
|
1229
|
-
}
|
|
1230
|
-
/**
|
|
1231
|
-
* Copies a vector from the given buffer attribute to this one. The start
|
|
1232
|
-
* and destination position in the attribute buffers are represented by the
|
|
1233
|
-
* given indices.
|
|
1234
|
-
*
|
|
1235
|
-
* @param {number} index1 - The destination index into this buffer attribute.
|
|
1236
|
-
* @param {BufferAttribute} attribute - The buffer attribute to copy from.
|
|
1237
|
-
* @param {number} index2 - The source index into the given buffer attribute.
|
|
1238
|
-
* @return {BufferAttribute} A reference to this instance.
|
|
1239
|
-
*/
|
|
1240
|
-
copyAt(t, e, i) {
|
|
1241
|
-
t *= this.itemSize, i *= e.itemSize;
|
|
1242
|
-
for (let s = 0, n = this.itemSize; s < n; s++)
|
|
1243
|
-
this.array[t + s] = e.array[i + s];
|
|
1244
|
-
return this;
|
|
1245
|
-
}
|
|
1246
|
-
/**
|
|
1247
|
-
* Copies the given array data into this buffer attribute.
|
|
1248
|
-
*
|
|
1249
|
-
* @param {(TypedArray|Array)} array - The array to copy.
|
|
1250
|
-
* @return {BufferAttribute} A reference to this instance.
|
|
1251
|
-
*/
|
|
1252
|
-
copyArray(t) {
|
|
1253
|
-
return this.array.set(t), this;
|
|
1254
|
-
}
|
|
1255
|
-
/**
|
|
1256
|
-
* Applies the given 3x3 matrix to the given attribute. Works with
|
|
1257
|
-
* item size `2` and `3`.
|
|
1258
|
-
*
|
|
1259
|
-
* @param {Matrix3} m - The matrix to apply.
|
|
1260
|
-
* @return {BufferAttribute} A reference to this instance.
|
|
1261
|
-
*/
|
|
1262
|
-
applyMatrix3(t) {
|
|
1263
|
-
if (this.itemSize === 2)
|
|
1264
|
-
for (let e = 0, i = this.count; e < i; e++)
|
|
1265
|
-
$.fromBufferAttribute(this, e), $.applyMatrix3(t), this.setXY(e, $.x, $.y);
|
|
1266
|
-
else if (this.itemSize === 3)
|
|
1267
|
-
for (let e = 0, i = this.count; e < i; e++)
|
|
1268
|
-
m.fromBufferAttribute(this, e), m.applyMatrix3(t), this.setXYZ(e, m.x, m.y, m.z);
|
|
1269
|
-
return this;
|
|
1270
|
-
}
|
|
1271
|
-
/**
|
|
1272
|
-
* Applies the given 4x4 matrix to the given attribute. Only works with
|
|
1273
|
-
* item size `3`.
|
|
1274
|
-
*
|
|
1275
|
-
* @param {Matrix4} m - The matrix to apply.
|
|
1276
|
-
* @return {BufferAttribute} A reference to this instance.
|
|
1277
|
-
*/
|
|
1278
|
-
applyMatrix4(t) {
|
|
1279
|
-
for (let e = 0, i = this.count; e < i; e++)
|
|
1280
|
-
m.fromBufferAttribute(this, e), m.applyMatrix4(t), this.setXYZ(e, m.x, m.y, m.z);
|
|
1281
|
-
return this;
|
|
1282
|
-
}
|
|
1283
|
-
/**
|
|
1284
|
-
* Applies the given 3x3 normal matrix to the given attribute. Only works with
|
|
1285
|
-
* item size `3`.
|
|
1286
|
-
*
|
|
1287
|
-
* @param {Matrix3} m - The normal matrix to apply.
|
|
1288
|
-
* @return {BufferAttribute} A reference to this instance.
|
|
1289
|
-
*/
|
|
1290
|
-
applyNormalMatrix(t) {
|
|
1291
|
-
for (let e = 0, i = this.count; e < i; e++)
|
|
1292
|
-
m.fromBufferAttribute(this, e), m.applyNormalMatrix(t), this.setXYZ(e, m.x, m.y, m.z);
|
|
1293
|
-
return this;
|
|
1294
|
-
}
|
|
1295
|
-
/**
|
|
1296
|
-
* Applies the given 4x4 matrix to the given attribute. Only works with
|
|
1297
|
-
* item size `3` and with direction vectors.
|
|
1298
|
-
*
|
|
1299
|
-
* @param {Matrix4} m - The matrix to apply.
|
|
1300
|
-
* @return {BufferAttribute} A reference to this instance.
|
|
1301
|
-
*/
|
|
1302
|
-
transformDirection(t) {
|
|
1303
|
-
for (let e = 0, i = this.count; e < i; e++)
|
|
1304
|
-
m.fromBufferAttribute(this, e), m.transformDirection(t), this.setXYZ(e, m.x, m.y, m.z);
|
|
1305
|
-
return this;
|
|
1306
|
-
}
|
|
1307
|
-
/**
|
|
1308
|
-
* Sets the given array data in the buffer attribute.
|
|
1309
|
-
*
|
|
1310
|
-
* @param {(TypedArray|Array)} value - The array data to set.
|
|
1311
|
-
* @param {number} [offset=0] - The offset in this buffer attribute's array.
|
|
1312
|
-
* @return {BufferAttribute} A reference to this instance.
|
|
1313
|
-
*/
|
|
1314
|
-
set(t, e = 0) {
|
|
1315
|
-
return this.array.set(t, e), this;
|
|
1316
|
-
}
|
|
1317
|
-
/**
|
|
1318
|
-
* Returns the given component of the vector at the given index.
|
|
1319
|
-
*
|
|
1320
|
-
* @param {number} index - The index into the buffer attribute.
|
|
1321
|
-
* @param {number} component - The component index.
|
|
1322
|
-
* @return {number} The returned value.
|
|
1323
|
-
*/
|
|
1324
|
-
getComponent(t, e) {
|
|
1325
|
-
let i = this.array[t * this.itemSize + e];
|
|
1326
|
-
return this.normalized && (i = W(i, this.array)), i;
|
|
1327
|
-
}
|
|
1328
|
-
/**
|
|
1329
|
-
* Sets the given value to the given component of the vector at the given index.
|
|
1330
|
-
*
|
|
1331
|
-
* @param {number} index - The index into the buffer attribute.
|
|
1332
|
-
* @param {number} component - The component index.
|
|
1333
|
-
* @param {number} value - The value to set.
|
|
1334
|
-
* @return {BufferAttribute} A reference to this instance.
|
|
1335
|
-
*/
|
|
1336
|
-
setComponent(t, e, i) {
|
|
1337
|
-
return this.normalized && (i = S(i, this.array)), this.array[t * this.itemSize + e] = i, this;
|
|
1338
|
-
}
|
|
1339
|
-
/**
|
|
1340
|
-
* Returns the x component of the vector at the given index.
|
|
1341
|
-
*
|
|
1342
|
-
* @param {number} index - The index into the buffer attribute.
|
|
1343
|
-
* @return {number} The x component.
|
|
1344
|
-
*/
|
|
1345
|
-
getX(t) {
|
|
1346
|
-
let e = this.array[t * this.itemSize];
|
|
1347
|
-
return this.normalized && (e = W(e, this.array)), e;
|
|
1348
|
-
}
|
|
1349
|
-
/**
|
|
1350
|
-
* Sets the x component of the vector at the given index.
|
|
1351
|
-
*
|
|
1352
|
-
* @param {number} index - The index into the buffer attribute.
|
|
1353
|
-
* @param {number} x - The value to set.
|
|
1354
|
-
* @return {BufferAttribute} A reference to this instance.
|
|
1355
|
-
*/
|
|
1356
|
-
setX(t, e) {
|
|
1357
|
-
return this.normalized && (e = S(e, this.array)), this.array[t * this.itemSize] = e, this;
|
|
1358
|
-
}
|
|
1359
|
-
/**
|
|
1360
|
-
* Returns the y component of the vector at the given index.
|
|
1361
|
-
*
|
|
1362
|
-
* @param {number} index - The index into the buffer attribute.
|
|
1363
|
-
* @return {number} The y component.
|
|
1364
|
-
*/
|
|
1365
|
-
getY(t) {
|
|
1366
|
-
let e = this.array[t * this.itemSize + 1];
|
|
1367
|
-
return this.normalized && (e = W(e, this.array)), e;
|
|
1368
|
-
}
|
|
1369
|
-
/**
|
|
1370
|
-
* Sets the y component of the vector at the given index.
|
|
1371
|
-
*
|
|
1372
|
-
* @param {number} index - The index into the buffer attribute.
|
|
1373
|
-
* @param {number} y - The value to set.
|
|
1374
|
-
* @return {BufferAttribute} A reference to this instance.
|
|
1375
|
-
*/
|
|
1376
|
-
setY(t, e) {
|
|
1377
|
-
return this.normalized && (e = S(e, this.array)), this.array[t * this.itemSize + 1] = e, this;
|
|
1378
|
-
}
|
|
1379
|
-
/**
|
|
1380
|
-
* Returns the z component of the vector at the given index.
|
|
1381
|
-
*
|
|
1382
|
-
* @param {number} index - The index into the buffer attribute.
|
|
1383
|
-
* @return {number} The z component.
|
|
1384
|
-
*/
|
|
1385
|
-
getZ(t) {
|
|
1386
|
-
let e = this.array[t * this.itemSize + 2];
|
|
1387
|
-
return this.normalized && (e = W(e, this.array)), e;
|
|
1388
|
-
}
|
|
1389
|
-
/**
|
|
1390
|
-
* Sets the z component of the vector at the given index.
|
|
1391
|
-
*
|
|
1392
|
-
* @param {number} index - The index into the buffer attribute.
|
|
1393
|
-
* @param {number} z - The value to set.
|
|
1394
|
-
* @return {BufferAttribute} A reference to this instance.
|
|
1395
|
-
*/
|
|
1396
|
-
setZ(t, e) {
|
|
1397
|
-
return this.normalized && (e = S(e, this.array)), this.array[t * this.itemSize + 2] = e, this;
|
|
1398
|
-
}
|
|
1399
|
-
/**
|
|
1400
|
-
* Returns the w component of the vector at the given index.
|
|
1401
|
-
*
|
|
1402
|
-
* @param {number} index - The index into the buffer attribute.
|
|
1403
|
-
* @return {number} The w component.
|
|
1404
|
-
*/
|
|
1405
|
-
getW(t) {
|
|
1406
|
-
let e = this.array[t * this.itemSize + 3];
|
|
1407
|
-
return this.normalized && (e = W(e, this.array)), e;
|
|
1408
|
-
}
|
|
1409
|
-
/**
|
|
1410
|
-
* Sets the w component of the vector at the given index.
|
|
1411
|
-
*
|
|
1412
|
-
* @param {number} index - The index into the buffer attribute.
|
|
1413
|
-
* @param {number} w - The value to set.
|
|
1414
|
-
* @return {BufferAttribute} A reference to this instance.
|
|
1415
|
-
*/
|
|
1416
|
-
setW(t, e) {
|
|
1417
|
-
return this.normalized && (e = S(e, this.array)), this.array[t * this.itemSize + 3] = e, this;
|
|
1418
|
-
}
|
|
1419
|
-
/**
|
|
1420
|
-
* Sets the x and y component of the vector at the given index.
|
|
1421
|
-
*
|
|
1422
|
-
* @param {number} index - The index into the buffer attribute.
|
|
1423
|
-
* @param {number} x - The value for the x component to set.
|
|
1424
|
-
* @param {number} y - The value for the y component to set.
|
|
1425
|
-
* @return {BufferAttribute} A reference to this instance.
|
|
1426
|
-
*/
|
|
1427
|
-
setXY(t, e, i) {
|
|
1428
|
-
return t *= this.itemSize, this.normalized && (e = S(e, this.array), i = S(i, this.array)), this.array[t + 0] = e, this.array[t + 1] = i, this;
|
|
1429
|
-
}
|
|
1430
|
-
/**
|
|
1431
|
-
* Sets the x, y and z component of the vector at the given index.
|
|
1432
|
-
*
|
|
1433
|
-
* @param {number} index - The index into the buffer attribute.
|
|
1434
|
-
* @param {number} x - The value for the x component to set.
|
|
1435
|
-
* @param {number} y - The value for the y component to set.
|
|
1436
|
-
* @param {number} z - The value for the z component to set.
|
|
1437
|
-
* @return {BufferAttribute} A reference to this instance.
|
|
1438
|
-
*/
|
|
1439
|
-
setXYZ(t, e, i, s) {
|
|
1440
|
-
return t *= this.itemSize, this.normalized && (e = S(e, this.array), i = S(i, this.array), s = S(s, this.array)), this.array[t + 0] = e, this.array[t + 1] = i, this.array[t + 2] = s, this;
|
|
1441
|
-
}
|
|
1442
|
-
/**
|
|
1443
|
-
* Sets the x, y, z and w component of the vector at the given index.
|
|
1444
|
-
*
|
|
1445
|
-
* @param {number} index - The index into the buffer attribute.
|
|
1446
|
-
* @param {number} x - The value for the x component to set.
|
|
1447
|
-
* @param {number} y - The value for the y component to set.
|
|
1448
|
-
* @param {number} z - The value for the z component to set.
|
|
1449
|
-
* @param {number} w - The value for the w component to set.
|
|
1450
|
-
* @return {BufferAttribute} A reference to this instance.
|
|
1451
|
-
*/
|
|
1452
|
-
setXYZW(t, e, i, s, n) {
|
|
1453
|
-
return t *= this.itemSize, this.normalized && (e = S(e, this.array), i = S(i, this.array), s = S(s, this.array), n = S(n, this.array)), this.array[t + 0] = e, this.array[t + 1] = i, this.array[t + 2] = s, this.array[t + 3] = n, this;
|
|
1454
|
-
}
|
|
1455
|
-
/**
|
|
1456
|
-
* Sets the given callback function that is executed after the Renderer has transferred
|
|
1457
|
-
* the attribute array data to the GPU. Can be used to perform clean-up operations after
|
|
1458
|
-
* the upload when attribute data are not needed anymore on the CPU side.
|
|
1459
|
-
*
|
|
1460
|
-
* @param {Function} callback - The `onUpload()` callback.
|
|
1461
|
-
* @return {BufferAttribute} A reference to this instance.
|
|
1462
|
-
*/
|
|
1463
|
-
onUpload(t) {
|
|
1464
|
-
return this.onUploadCallback = t, this;
|
|
1465
|
-
}
|
|
1466
|
-
/**
|
|
1467
|
-
* Returns a new buffer attribute with copied values from this instance.
|
|
1468
|
-
*
|
|
1469
|
-
* @return {BufferAttribute} A clone of this instance.
|
|
1470
|
-
*/
|
|
1471
|
-
clone() {
|
|
1472
|
-
return new this.constructor(this.array, this.itemSize).copy(this);
|
|
1473
|
-
}
|
|
1474
|
-
/**
|
|
1475
|
-
* Serializes the buffer attribute into JSON.
|
|
1476
|
-
*
|
|
1477
|
-
* @return {Object} A JSON object representing the serialized buffer attribute.
|
|
1478
|
-
*/
|
|
1479
|
-
toJSON() {
|
|
1480
|
-
const t = {
|
|
1481
|
-
itemSize: this.itemSize,
|
|
1482
|
-
type: this.array.constructor.name,
|
|
1483
|
-
array: Array.from(this.array),
|
|
1484
|
-
normalized: this.normalized
|
|
1485
|
-
};
|
|
1486
|
-
return this.name !== "" && (t.name = this.name), this.usage !== Bt && (t.usage = this.usage), t;
|
|
1487
|
-
}
|
|
1488
|
-
}
|
|
1489
|
-
class Jt extends X {
|
|
1490
|
-
/**
|
|
1491
|
-
* Constructs a new buffer attribute.
|
|
1492
|
-
*
|
|
1493
|
-
* @param {(Array<number>|Uint16Array)} array - The array holding the attribute data.
|
|
1494
|
-
* @param {number} itemSize - The item size.
|
|
1495
|
-
* @param {boolean} [normalized=false] - Whether the data are normalized or not.
|
|
1496
|
-
*/
|
|
1497
|
-
constructor(t, e, i) {
|
|
1498
|
-
super(new Uint16Array(t), e, i);
|
|
1499
|
-
}
|
|
1500
|
-
}
|
|
1501
|
-
class Lt extends X {
|
|
1502
|
-
/**
|
|
1503
|
-
* Constructs a new buffer attribute.
|
|
1504
|
-
*
|
|
1505
|
-
* @param {(Array<number>|Uint32Array)} array - The array holding the attribute data.
|
|
1506
|
-
* @param {number} itemSize - The item size.
|
|
1507
|
-
* @param {boolean} [normalized=false] - Whether the data are normalized or not.
|
|
1508
|
-
*/
|
|
1509
|
-
constructor(t, e, i) {
|
|
1510
|
-
super(new Uint32Array(t), e, i);
|
|
1511
|
-
}
|
|
1512
|
-
}
|
|
1513
|
-
class Wt extends X {
|
|
1514
|
-
/**
|
|
1515
|
-
* Constructs a new buffer attribute.
|
|
1516
|
-
*
|
|
1517
|
-
* @param {(Array<number>|Float32Array)} array - The array holding the attribute data.
|
|
1518
|
-
* @param {number} itemSize - The item size.
|
|
1519
|
-
* @param {boolean} [normalized=false] - Whether the data are normalized or not.
|
|
1520
|
-
*/
|
|
1521
|
-
constructor(t, e, i) {
|
|
1522
|
-
super(new Float32Array(t), e, i);
|
|
1523
|
-
}
|
|
1524
|
-
}
|
|
1525
|
-
let _t = 0;
|
|
1526
|
-
const B = /* @__PURE__ */ new Ot(), ht = /* @__PURE__ */ new It(), P = /* @__PURE__ */ new d(), A = /* @__PURE__ */ new ut(), G = /* @__PURE__ */ new ut(), b = /* @__PURE__ */ new d();
|
|
1527
|
-
class Dt extends Tt {
|
|
1528
|
-
/**
|
|
1529
|
-
* Constructs a new geometry.
|
|
1530
|
-
*/
|
|
1531
|
-
constructor() {
|
|
1532
|
-
super(), this.isBufferGeometry = !0, Object.defineProperty(this, "id", { value: _t++ }), this.uuid = kt(), this.name = "", this.type = "BufferGeometry", this.index = null, this.indirect = null, this.indirectOffset = 0, this.attributes = {}, this.morphAttributes = {}, this.morphTargetsRelative = !1, this.groups = [], this.boundingBox = null, this.boundingSphere = null, this.drawRange = { start: 0, count: 1 / 0 }, this.userData = {};
|
|
1533
|
-
}
|
|
1534
|
-
/**
|
|
1535
|
-
* Returns the index of this geometry.
|
|
1536
|
-
*
|
|
1537
|
-
* @return {?BufferAttribute} The index. Returns `null` if no index is defined.
|
|
1538
|
-
*/
|
|
1539
|
-
getIndex() {
|
|
1540
|
-
return this.index;
|
|
1541
|
-
}
|
|
1542
|
-
/**
|
|
1543
|
-
* Sets the given index to this geometry.
|
|
1544
|
-
*
|
|
1545
|
-
* @param {Array<number>|BufferAttribute} index - The index to set.
|
|
1546
|
-
* @return {BufferGeometry} A reference to this instance.
|
|
1547
|
-
*/
|
|
1548
|
-
setIndex(t) {
|
|
1549
|
-
return Array.isArray(t) ? this.index = new (Nt(t) ? Lt : Jt)(t, 1) : this.index = t, this;
|
|
1550
|
-
}
|
|
1551
|
-
/**
|
|
1552
|
-
* Sets the given indirect attribute to this geometry.
|
|
1553
|
-
*
|
|
1554
|
-
* @param {BufferAttribute} indirect - The attribute holding indirect draw calls.
|
|
1555
|
-
* @param {number|Array<number>} [indirectOffset=0] - The offset, in bytes, into the indirect drawing buffer where the value data begins. If an array is provided, multiple indirect draw calls will be made for each offset.
|
|
1556
|
-
* @return {BufferGeometry} A reference to this instance.
|
|
1557
|
-
*/
|
|
1558
|
-
setIndirect(t, e = 0) {
|
|
1559
|
-
return this.indirect = t, this.indirectOffset = e, this;
|
|
1560
|
-
}
|
|
1561
|
-
/**
|
|
1562
|
-
* Returns the indirect attribute of this geometry.
|
|
1563
|
-
*
|
|
1564
|
-
* @return {?BufferAttribute} The indirect attribute. Returns `null` if no indirect attribute is defined.
|
|
1565
|
-
*/
|
|
1566
|
-
getIndirect() {
|
|
1567
|
-
return this.indirect;
|
|
1568
|
-
}
|
|
1569
|
-
/**
|
|
1570
|
-
* Returns the buffer attribute for the given name.
|
|
1571
|
-
*
|
|
1572
|
-
* @param {string} name - The attribute name.
|
|
1573
|
-
* @return {BufferAttribute|InterleavedBufferAttribute|undefined} The buffer attribute.
|
|
1574
|
-
* Returns `undefined` if not attribute has been found.
|
|
1575
|
-
*/
|
|
1576
|
-
getAttribute(t) {
|
|
1577
|
-
return this.attributes[t];
|
|
1578
|
-
}
|
|
1579
|
-
/**
|
|
1580
|
-
* Sets the given attribute for the given name.
|
|
1581
|
-
*
|
|
1582
|
-
* @param {string} name - The attribute name.
|
|
1583
|
-
* @param {BufferAttribute|InterleavedBufferAttribute} attribute - The attribute to set.
|
|
1584
|
-
* @return {BufferGeometry} A reference to this instance.
|
|
1585
|
-
*/
|
|
1586
|
-
setAttribute(t, e) {
|
|
1587
|
-
return this.attributes[t] = e, this;
|
|
1588
|
-
}
|
|
1589
|
-
/**
|
|
1590
|
-
* Deletes the attribute for the given name.
|
|
1591
|
-
*
|
|
1592
|
-
* @param {string} name - The attribute name to delete.
|
|
1593
|
-
* @return {BufferGeometry} A reference to this instance.
|
|
1594
|
-
*/
|
|
1595
|
-
deleteAttribute(t) {
|
|
1596
|
-
return delete this.attributes[t], this;
|
|
1597
|
-
}
|
|
1598
|
-
/**
|
|
1599
|
-
* Returns `true` if this geometry has an attribute for the given name.
|
|
1600
|
-
*
|
|
1601
|
-
* @param {string} name - The attribute name.
|
|
1602
|
-
* @return {boolean} Whether this geometry has an attribute for the given name or not.
|
|
1603
|
-
*/
|
|
1604
|
-
hasAttribute(t) {
|
|
1605
|
-
return this.attributes[t] !== void 0;
|
|
1606
|
-
}
|
|
1607
|
-
/**
|
|
1608
|
-
* Adds a group to this geometry.
|
|
1609
|
-
*
|
|
1610
|
-
* @param {number} start - The first element in this draw call. That is the first
|
|
1611
|
-
* vertex for non-indexed geometry, otherwise the first triangle index.
|
|
1612
|
-
* @param {number} count - Specifies how many vertices (or indices) are part of this group.
|
|
1613
|
-
* @param {number} [materialIndex=0] - The material array index to use.
|
|
1614
|
-
*/
|
|
1615
|
-
addGroup(t, e, i = 0) {
|
|
1616
|
-
this.groups.push({
|
|
1617
|
-
start: t,
|
|
1618
|
-
count: e,
|
|
1619
|
-
materialIndex: i
|
|
1620
|
-
});
|
|
1621
|
-
}
|
|
1622
|
-
/**
|
|
1623
|
-
* Clears all groups.
|
|
1624
|
-
*/
|
|
1625
|
-
clearGroups() {
|
|
1626
|
-
this.groups = [];
|
|
1627
|
-
}
|
|
1628
|
-
/**
|
|
1629
|
-
* Sets the draw range for this geometry.
|
|
1630
|
-
*
|
|
1631
|
-
* @param {number} start - The first vertex for non-indexed geometry, otherwise the first triangle index.
|
|
1632
|
-
* @param {number} count - For non-indexed BufferGeometry, `count` is the number of vertices to render.
|
|
1633
|
-
* For indexed BufferGeometry, `count` is the number of indices to render.
|
|
1634
|
-
*/
|
|
1635
|
-
setDrawRange(t, e) {
|
|
1636
|
-
this.drawRange.start = t, this.drawRange.count = e;
|
|
1637
|
-
}
|
|
1638
|
-
/**
|
|
1639
|
-
* Applies the given 4x4 transformation matrix to the geometry.
|
|
1640
|
-
*
|
|
1641
|
-
* @param {Matrix4} matrix - The matrix to apply.
|
|
1642
|
-
* @return {BufferGeometry} A reference to this instance.
|
|
1643
|
-
*/
|
|
1644
|
-
applyMatrix4(t) {
|
|
1645
|
-
const e = this.attributes.position;
|
|
1646
|
-
e !== void 0 && (e.applyMatrix4(t), e.needsUpdate = !0);
|
|
1647
|
-
const i = this.attributes.normal;
|
|
1648
|
-
if (i !== void 0) {
|
|
1649
|
-
const n = new lt().getNormalMatrix(t);
|
|
1650
|
-
i.applyNormalMatrix(n), i.needsUpdate = !0;
|
|
1651
|
-
}
|
|
1652
|
-
const s = this.attributes.tangent;
|
|
1653
|
-
return s !== void 0 && (s.transformDirection(t), s.needsUpdate = !0), this.boundingBox !== null && this.computeBoundingBox(), this.boundingSphere !== null && this.computeBoundingSphere(), this;
|
|
1654
|
-
}
|
|
1655
|
-
/**
|
|
1656
|
-
* Applies the rotation represented by the Quaternion to the geometry.
|
|
1657
|
-
*
|
|
1658
|
-
* @param {Quaternion} q - The Quaternion to apply.
|
|
1659
|
-
* @return {BufferGeometry} A reference to this instance.
|
|
1660
|
-
*/
|
|
1661
|
-
applyQuaternion(t) {
|
|
1662
|
-
return B.makeRotationFromQuaternion(t), this.applyMatrix4(B), this;
|
|
1663
|
-
}
|
|
1664
|
-
/**
|
|
1665
|
-
* Rotates the geometry about the X axis. This is typically done as a one time
|
|
1666
|
-
* operation, and not during a loop. Use {@link Object3D#rotation} for typical
|
|
1667
|
-
* real-time mesh rotation.
|
|
1668
|
-
*
|
|
1669
|
-
* @param {number} angle - The angle in radians.
|
|
1670
|
-
* @return {BufferGeometry} A reference to this instance.
|
|
1671
|
-
*/
|
|
1672
|
-
rotateX(t) {
|
|
1673
|
-
return B.makeRotationX(t), this.applyMatrix4(B), this;
|
|
1674
|
-
}
|
|
1675
|
-
/**
|
|
1676
|
-
* Rotates the geometry about the Y axis. This is typically done as a one time
|
|
1677
|
-
* operation, and not during a loop. Use {@link Object3D#rotation} for typical
|
|
1678
|
-
* real-time mesh rotation.
|
|
1679
|
-
*
|
|
1680
|
-
* @param {number} angle - The angle in radians.
|
|
1681
|
-
* @return {BufferGeometry} A reference to this instance.
|
|
1682
|
-
*/
|
|
1683
|
-
rotateY(t) {
|
|
1684
|
-
return B.makeRotationY(t), this.applyMatrix4(B), this;
|
|
1685
|
-
}
|
|
1686
|
-
/**
|
|
1687
|
-
* Rotates the geometry about the Z axis. This is typically done as a one time
|
|
1688
|
-
* operation, and not during a loop. Use {@link Object3D#rotation} for typical
|
|
1689
|
-
* real-time mesh rotation.
|
|
1690
|
-
*
|
|
1691
|
-
* @param {number} angle - The angle in radians.
|
|
1692
|
-
* @return {BufferGeometry} A reference to this instance.
|
|
1693
|
-
*/
|
|
1694
|
-
rotateZ(t) {
|
|
1695
|
-
return B.makeRotationZ(t), this.applyMatrix4(B), this;
|
|
1696
|
-
}
|
|
1697
|
-
/**
|
|
1698
|
-
* Translates the geometry. This is typically done as a one time
|
|
1699
|
-
* operation, and not during a loop. Use {@link Object3D#position} for typical
|
|
1700
|
-
* real-time mesh rotation.
|
|
1701
|
-
*
|
|
1702
|
-
* @param {number} x - The x offset.
|
|
1703
|
-
* @param {number} y - The y offset.
|
|
1704
|
-
* @param {number} z - The z offset.
|
|
1705
|
-
* @return {BufferGeometry} A reference to this instance.
|
|
1706
|
-
*/
|
|
1707
|
-
translate(t, e, i) {
|
|
1708
|
-
return B.makeTranslation(t, e, i), this.applyMatrix4(B), this;
|
|
1709
|
-
}
|
|
1710
|
-
/**
|
|
1711
|
-
* Scales the geometry. This is typically done as a one time
|
|
1712
|
-
* operation, and not during a loop. Use {@link Object3D#scale} for typical
|
|
1713
|
-
* real-time mesh rotation.
|
|
1714
|
-
*
|
|
1715
|
-
* @param {number} x - The x scale.
|
|
1716
|
-
* @param {number} y - The y scale.
|
|
1717
|
-
* @param {number} z - The z scale.
|
|
1718
|
-
* @return {BufferGeometry} A reference to this instance.
|
|
1719
|
-
*/
|
|
1720
|
-
scale(t, e, i) {
|
|
1721
|
-
return B.makeScale(t, e, i), this.applyMatrix4(B), this;
|
|
1722
|
-
}
|
|
1723
|
-
/**
|
|
1724
|
-
* Rotates the geometry to face a point in 3D space. This is typically done as a one time
|
|
1725
|
-
* operation, and not during a loop. Use {@link Object3D#lookAt} for typical
|
|
1726
|
-
* real-time mesh rotation.
|
|
1727
|
-
*
|
|
1728
|
-
* @param {Vector3} vector - The target point.
|
|
1729
|
-
* @return {BufferGeometry} A reference to this instance.
|
|
1730
|
-
*/
|
|
1731
|
-
lookAt(t) {
|
|
1732
|
-
return ht.lookAt(t), ht.updateMatrix(), this.applyMatrix4(ht.matrix), this;
|
|
1733
|
-
}
|
|
1734
|
-
/**
|
|
1735
|
-
* Center the geometry based on its bounding box.
|
|
1736
|
-
*
|
|
1737
|
-
* @return {BufferGeometry} A reference to this instance.
|
|
1738
|
-
*/
|
|
1739
|
-
center() {
|
|
1740
|
-
return this.computeBoundingBox(), this.boundingBox.getCenter(P).negate(), this.translate(P.x, P.y, P.z), this;
|
|
1741
|
-
}
|
|
1742
|
-
/**
|
|
1743
|
-
* Defines a geometry by creating a `position` attribute based on the given array of points. The array
|
|
1744
|
-
* can hold 2D or 3D vectors. When using two-dimensional data, the `z` coordinate for all vertices is
|
|
1745
|
-
* set to `0`.
|
|
1746
|
-
*
|
|
1747
|
-
* If the method is used with an existing `position` attribute, the vertex data are overwritten with the
|
|
1748
|
-
* data from the array. The length of the array must match the vertex count.
|
|
1749
|
-
*
|
|
1750
|
-
* @param {Array<Vector2>|Array<Vector3>} points - The points.
|
|
1751
|
-
* @return {BufferGeometry} A reference to this instance.
|
|
1752
|
-
*/
|
|
1753
|
-
setFromPoints(t) {
|
|
1754
|
-
const e = this.getAttribute("position");
|
|
1755
|
-
if (e === void 0) {
|
|
1756
|
-
const i = [];
|
|
1757
|
-
for (let s = 0, n = t.length; s < n; s++) {
|
|
1758
|
-
const r = t[s];
|
|
1759
|
-
i.push(r.x, r.y, r.z || 0);
|
|
1760
|
-
}
|
|
1761
|
-
this.setAttribute("position", new Wt(i, 3));
|
|
1762
|
-
} else {
|
|
1763
|
-
const i = Math.min(t.length, e.count);
|
|
1764
|
-
for (let s = 0; s < i; s++) {
|
|
1765
|
-
const n = t[s];
|
|
1766
|
-
e.setXYZ(s, n.x, n.y, n.z || 0);
|
|
1767
|
-
}
|
|
1768
|
-
t.length > e.count && N("BufferGeometry: Buffer size too small for points data. Use .dispose() and create a new geometry."), e.needsUpdate = !0;
|
|
1769
|
-
}
|
|
1770
|
-
return this;
|
|
1771
|
-
}
|
|
1772
|
-
/**
|
|
1773
|
-
* Computes the bounding box of the geometry, and updates the `boundingBox` member.
|
|
1774
|
-
* The bounding box is not computed by the engine; it must be computed by your app.
|
|
1775
|
-
* You may need to recompute the bounding box if the geometry vertices are modified.
|
|
1776
|
-
*/
|
|
1777
|
-
computeBoundingBox() {
|
|
1778
|
-
this.boundingBox === null && (this.boundingBox = new ut());
|
|
1779
|
-
const t = this.attributes.position, e = this.morphAttributes.position;
|
|
1780
|
-
if (t && t.isGLBufferAttribute) {
|
|
1781
|
-
_("BufferGeometry.computeBoundingBox(): GLBufferAttribute requires a manual bounding box.", this), this.boundingBox.set(
|
|
1782
|
-
new d(-1 / 0, -1 / 0, -1 / 0),
|
|
1783
|
-
new d(1 / 0, 1 / 0, 1 / 0)
|
|
1784
|
-
);
|
|
1785
|
-
return;
|
|
1786
|
-
}
|
|
1787
|
-
if (t !== void 0) {
|
|
1788
|
-
if (this.boundingBox.setFromBufferAttribute(t), e)
|
|
1789
|
-
for (let i = 0, s = e.length; i < s; i++) {
|
|
1790
|
-
const n = e[i];
|
|
1791
|
-
A.setFromBufferAttribute(n), this.morphTargetsRelative ? (b.addVectors(this.boundingBox.min, A.min), this.boundingBox.expandByPoint(b), b.addVectors(this.boundingBox.max, A.max), this.boundingBox.expandByPoint(b)) : (this.boundingBox.expandByPoint(A.min), this.boundingBox.expandByPoint(A.max));
|
|
1792
|
-
}
|
|
1793
|
-
} else
|
|
1794
|
-
this.boundingBox.makeEmpty();
|
|
1795
|
-
(isNaN(this.boundingBox.min.x) || isNaN(this.boundingBox.min.y) || isNaN(this.boundingBox.min.z)) && _('BufferGeometry.computeBoundingBox(): Computed min/max have NaN values. The "position" attribute is likely to have NaN values.', this);
|
|
1796
|
-
}
|
|
1797
|
-
/**
|
|
1798
|
-
* Computes the bounding sphere of the geometry, and updates the `boundingSphere` member.
|
|
1799
|
-
* The engine automatically computes the bounding sphere when it is needed, e.g., for ray casting or view frustum culling.
|
|
1800
|
-
* You may need to recompute the bounding sphere if the geometry vertices are modified.
|
|
1801
|
-
*/
|
|
1802
|
-
computeBoundingSphere() {
|
|
1803
|
-
this.boundingSphere === null && (this.boundingSphere = new Pt());
|
|
1804
|
-
const t = this.attributes.position, e = this.morphAttributes.position;
|
|
1805
|
-
if (t && t.isGLBufferAttribute) {
|
|
1806
|
-
_("BufferGeometry.computeBoundingSphere(): GLBufferAttribute requires a manual bounding sphere.", this), this.boundingSphere.set(new d(), 1 / 0);
|
|
1807
|
-
return;
|
|
1808
|
-
}
|
|
1809
|
-
if (t) {
|
|
1810
|
-
const i = this.boundingSphere.center;
|
|
1811
|
-
if (A.setFromBufferAttribute(t), e)
|
|
1812
|
-
for (let n = 0, r = e.length; n < r; n++) {
|
|
1813
|
-
const o = e[n];
|
|
1814
|
-
G.setFromBufferAttribute(o), this.morphTargetsRelative ? (b.addVectors(A.min, G.min), A.expandByPoint(b), b.addVectors(A.max, G.max), A.expandByPoint(b)) : (A.expandByPoint(G.min), A.expandByPoint(G.max));
|
|
1815
|
-
}
|
|
1816
|
-
A.getCenter(i);
|
|
1817
|
-
let s = 0;
|
|
1818
|
-
for (let n = 0, r = t.count; n < r; n++)
|
|
1819
|
-
b.fromBufferAttribute(t, n), s = Math.max(s, i.distanceToSquared(b));
|
|
1820
|
-
if (e)
|
|
1821
|
-
for (let n = 0, r = e.length; n < r; n++) {
|
|
1822
|
-
const o = e[n], h = this.morphTargetsRelative;
|
|
1823
|
-
for (let l = 0, c = o.count; l < c; l++)
|
|
1824
|
-
b.fromBufferAttribute(o, l), h && (P.fromBufferAttribute(t, l), b.add(P)), s = Math.max(s, i.distanceToSquared(b));
|
|
1825
|
-
}
|
|
1826
|
-
this.boundingSphere.radius = Math.sqrt(s), isNaN(this.boundingSphere.radius) && _('BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.', this);
|
|
1827
|
-
}
|
|
1828
|
-
}
|
|
1829
|
-
/**
|
|
1830
|
-
* Calculates and adds a tangent attribute to this geometry.
|
|
1831
|
-
*
|
|
1832
|
-
* The computation is only supported for indexed geometries and if position, normal, and uv attributes
|
|
1833
|
-
* are defined. When using a tangent space normal map, prefer the MikkTSpace algorithm provided by
|
|
1834
|
-
* {@link BufferGeometryUtils#computeMikkTSpaceTangents} instead.
|
|
1835
|
-
*/
|
|
1836
|
-
computeTangents() {
|
|
1837
|
-
const t = this.index, e = this.attributes;
|
|
1838
|
-
if (t === null || e.position === void 0 || e.normal === void 0 || e.uv === void 0) {
|
|
1839
|
-
_("BufferGeometry: .computeTangents() failed. Missing required attributes (index, position, normal or uv)");
|
|
1840
|
-
return;
|
|
1841
|
-
}
|
|
1842
|
-
const i = e.position, s = e.normal, n = e.uv;
|
|
1843
|
-
this.hasAttribute("tangent") === !1 && this.setAttribute("tangent", new X(new Float32Array(4 * i.count), 4));
|
|
1844
|
-
const r = this.getAttribute("tangent"), o = [], h = [];
|
|
1845
|
-
for (let g = 0; g < i.count; g++)
|
|
1846
|
-
o[g] = new d(), h[g] = new d();
|
|
1847
|
-
const l = new d(), c = new d(), u = new d(), a = new Q(), p = new Q(), x = new Q(), y = new d(), D = new d();
|
|
1848
|
-
function V(g, M, w) {
|
|
1849
|
-
l.fromBufferAttribute(i, g), c.fromBufferAttribute(i, M), u.fromBufferAttribute(i, w), a.fromBufferAttribute(n, g), p.fromBufferAttribute(n, M), x.fromBufferAttribute(n, w), c.sub(l), u.sub(l), p.sub(a), x.sub(a);
|
|
1850
|
-
const C = 1 / (p.x * x.y - x.x * p.y);
|
|
1851
|
-
isFinite(C) && (y.copy(c).multiplyScalar(x.y).addScaledVector(u, -p.y).multiplyScalar(C), D.copy(u).multiplyScalar(p.x).addScaledVector(c, -x.x).multiplyScalar(C), o[g].add(y), o[M].add(y), o[w].add(y), h[g].add(D), h[M].add(D), h[w].add(D));
|
|
1852
|
-
}
|
|
1853
|
-
let O = this.groups;
|
|
1854
|
-
O.length === 0 && (O = [{
|
|
1855
|
-
start: 0,
|
|
1856
|
-
count: t.count
|
|
1857
|
-
}]);
|
|
1858
|
-
for (let g = 0, M = O.length; g < M; ++g) {
|
|
1859
|
-
const w = O[g], C = w.start, tt = w.count;
|
|
1860
|
-
for (let T = C, it = C + tt; T < it; T += 3)
|
|
1861
|
-
V(
|
|
1862
|
-
t.getX(T + 0),
|
|
1863
|
-
t.getX(T + 1),
|
|
1864
|
-
t.getX(T + 2)
|
|
1865
|
-
);
|
|
1866
|
-
}
|
|
1867
|
-
const J = new d(), dt = new d(), Y = new d(), pt = new d();
|
|
1868
|
-
function K(g) {
|
|
1869
|
-
Y.fromBufferAttribute(s, g), pt.copy(Y);
|
|
1870
|
-
const M = o[g];
|
|
1871
|
-
J.copy(M), J.sub(Y.multiplyScalar(Y.dot(M))).normalize(), dt.crossVectors(pt, M);
|
|
1872
|
-
const C = dt.dot(h[g]) < 0 ? -1 : 1;
|
|
1873
|
-
r.setXYZW(g, J.x, J.y, J.z, C);
|
|
1874
|
-
}
|
|
1875
|
-
for (let g = 0, M = O.length; g < M; ++g) {
|
|
1876
|
-
const w = O[g], C = w.start, tt = w.count;
|
|
1877
|
-
for (let T = C, it = C + tt; T < it; T += 3)
|
|
1878
|
-
K(t.getX(T + 0)), K(t.getX(T + 1)), K(t.getX(T + 2));
|
|
1879
|
-
}
|
|
1880
|
-
}
|
|
1881
|
-
/**
|
|
1882
|
-
* Computes vertex normals for the given vertex data. For indexed geometries, the method sets
|
|
1883
|
-
* each vertex normal to be the average of the face normals of the faces that share that vertex.
|
|
1884
|
-
* For non-indexed geometries, vertices are not shared, and the method sets each vertex normal
|
|
1885
|
-
* to be the same as the face normal.
|
|
1886
|
-
*/
|
|
1887
|
-
computeVertexNormals() {
|
|
1888
|
-
const t = this.index, e = this.getAttribute("position");
|
|
1889
|
-
if (e !== void 0) {
|
|
1890
|
-
let i = this.getAttribute("normal");
|
|
1891
|
-
if (i === void 0)
|
|
1892
|
-
i = new X(new Float32Array(e.count * 3), 3), this.setAttribute("normal", i);
|
|
1893
|
-
else
|
|
1894
|
-
for (let a = 0, p = i.count; a < p; a++)
|
|
1895
|
-
i.setXYZ(a, 0, 0, 0);
|
|
1896
|
-
const s = new d(), n = new d(), r = new d(), o = new d(), h = new d(), l = new d(), c = new d(), u = new d();
|
|
1897
|
-
if (t)
|
|
1898
|
-
for (let a = 0, p = t.count; a < p; a += 3) {
|
|
1899
|
-
const x = t.getX(a + 0), y = t.getX(a + 1), D = t.getX(a + 2);
|
|
1900
|
-
s.fromBufferAttribute(e, x), n.fromBufferAttribute(e, y), r.fromBufferAttribute(e, D), c.subVectors(r, n), u.subVectors(s, n), c.cross(u), o.fromBufferAttribute(i, x), h.fromBufferAttribute(i, y), l.fromBufferAttribute(i, D), o.add(c), h.add(c), l.add(c), i.setXYZ(x, o.x, o.y, o.z), i.setXYZ(y, h.x, h.y, h.z), i.setXYZ(D, l.x, l.y, l.z);
|
|
1901
|
-
}
|
|
1902
|
-
else
|
|
1903
|
-
for (let a = 0, p = e.count; a < p; a += 3)
|
|
1904
|
-
s.fromBufferAttribute(e, a + 0), n.fromBufferAttribute(e, a + 1), r.fromBufferAttribute(e, a + 2), c.subVectors(r, n), u.subVectors(s, n), c.cross(u), i.setXYZ(a + 0, c.x, c.y, c.z), i.setXYZ(a + 1, c.x, c.y, c.z), i.setXYZ(a + 2, c.x, c.y, c.z);
|
|
1905
|
-
this.normalizeNormals(), i.needsUpdate = !0;
|
|
1906
|
-
}
|
|
1907
|
-
}
|
|
1908
|
-
/**
|
|
1909
|
-
* Ensures every normal vector in a geometry will have a magnitude of `1`. This will
|
|
1910
|
-
* correct lighting on the geometry surfaces.
|
|
1911
|
-
*/
|
|
1912
|
-
normalizeNormals() {
|
|
1913
|
-
const t = this.attributes.normal;
|
|
1914
|
-
for (let e = 0, i = t.count; e < i; e++)
|
|
1915
|
-
b.fromBufferAttribute(t, e), b.normalize(), t.setXYZ(e, b.x, b.y, b.z);
|
|
1916
|
-
}
|
|
1917
|
-
/**
|
|
1918
|
-
* Return a new non-index version of this indexed geometry. If the geometry
|
|
1919
|
-
* is already non-indexed, the method is a NOOP.
|
|
1920
|
-
*
|
|
1921
|
-
* @return {BufferGeometry} The non-indexed version of this indexed geometry.
|
|
1922
|
-
*/
|
|
1923
|
-
toNonIndexed() {
|
|
1924
|
-
function t(o, h) {
|
|
1925
|
-
const l = o.array, c = o.itemSize, u = o.normalized, a = new l.constructor(h.length * c);
|
|
1926
|
-
let p = 0, x = 0;
|
|
1927
|
-
for (let y = 0, D = h.length; y < D; y++) {
|
|
1928
|
-
o.isInterleavedBufferAttribute ? p = h[y] * o.data.stride + o.offset : p = h[y] * c;
|
|
1929
|
-
for (let V = 0; V < c; V++)
|
|
1930
|
-
a[x++] = l[p++];
|
|
1931
|
-
}
|
|
1932
|
-
return new X(a, c, u);
|
|
1933
|
-
}
|
|
1934
|
-
if (this.index === null)
|
|
1935
|
-
return N("BufferGeometry.toNonIndexed(): BufferGeometry is already non-indexed."), this;
|
|
1936
|
-
const e = new Dt(), i = this.index.array, s = this.attributes;
|
|
1937
|
-
for (const o in s) {
|
|
1938
|
-
const h = s[o], l = t(h, i);
|
|
1939
|
-
e.setAttribute(o, l);
|
|
1940
|
-
}
|
|
1941
|
-
const n = this.morphAttributes;
|
|
1942
|
-
for (const o in n) {
|
|
1943
|
-
const h = [], l = n[o];
|
|
1944
|
-
for (let c = 0, u = l.length; c < u; c++) {
|
|
1945
|
-
const a = l[c], p = t(a, i);
|
|
1946
|
-
h.push(p);
|
|
1947
|
-
}
|
|
1948
|
-
e.morphAttributes[o] = h;
|
|
1949
|
-
}
|
|
1950
|
-
e.morphTargetsRelative = this.morphTargetsRelative;
|
|
1951
|
-
const r = this.groups;
|
|
1952
|
-
for (let o = 0, h = r.length; o < h; o++) {
|
|
1953
|
-
const l = r[o];
|
|
1954
|
-
e.addGroup(l.start, l.count, l.materialIndex);
|
|
1955
|
-
}
|
|
1956
|
-
return e;
|
|
1957
|
-
}
|
|
1958
|
-
/**
|
|
1959
|
-
* Serializes the geometry into JSON.
|
|
1960
|
-
*
|
|
1961
|
-
* @return {Object} A JSON object representing the serialized geometry.
|
|
1962
|
-
*/
|
|
1963
|
-
toJSON() {
|
|
1964
|
-
const t = {
|
|
1965
|
-
metadata: {
|
|
1966
|
-
version: 4.7,
|
|
1967
|
-
type: "BufferGeometry",
|
|
1968
|
-
generator: "BufferGeometry.toJSON"
|
|
1969
|
-
}
|
|
1970
|
-
};
|
|
1971
|
-
if (t.uuid = this.uuid, t.type = this.type, this.name !== "" && (t.name = this.name), Object.keys(this.userData).length > 0 && (t.userData = this.userData), this.parameters !== void 0) {
|
|
1972
|
-
const h = this.parameters;
|
|
1973
|
-
for (const l in h)
|
|
1974
|
-
h[l] !== void 0 && (t[l] = h[l]);
|
|
1975
|
-
return t;
|
|
1976
|
-
}
|
|
1977
|
-
t.data = { attributes: {} };
|
|
1978
|
-
const e = this.index;
|
|
1979
|
-
e !== null && (t.data.index = {
|
|
1980
|
-
type: e.array.constructor.name,
|
|
1981
|
-
array: Array.prototype.slice.call(e.array)
|
|
1982
|
-
});
|
|
1983
|
-
const i = this.attributes;
|
|
1984
|
-
for (const h in i) {
|
|
1985
|
-
const l = i[h];
|
|
1986
|
-
t.data.attributes[h] = l.toJSON(t.data);
|
|
1987
|
-
}
|
|
1988
|
-
const s = {};
|
|
1989
|
-
let n = !1;
|
|
1990
|
-
for (const h in this.morphAttributes) {
|
|
1991
|
-
const l = this.morphAttributes[h], c = [];
|
|
1992
|
-
for (let u = 0, a = l.length; u < a; u++) {
|
|
1993
|
-
const p = l[u];
|
|
1994
|
-
c.push(p.toJSON(t.data));
|
|
1995
|
-
}
|
|
1996
|
-
c.length > 0 && (s[h] = c, n = !0);
|
|
1997
|
-
}
|
|
1998
|
-
n && (t.data.morphAttributes = s, t.data.morphTargetsRelative = this.morphTargetsRelative);
|
|
1999
|
-
const r = this.groups;
|
|
2000
|
-
r.length > 0 && (t.data.groups = JSON.parse(JSON.stringify(r)));
|
|
2001
|
-
const o = this.boundingSphere;
|
|
2002
|
-
return o !== null && (t.data.boundingSphere = o.toJSON()), t;
|
|
2003
|
-
}
|
|
2004
|
-
/**
|
|
2005
|
-
* Returns a new geometry with copied values from this instance.
|
|
2006
|
-
*
|
|
2007
|
-
* @return {BufferGeometry} A clone of this instance.
|
|
2008
|
-
*/
|
|
2009
|
-
clone() {
|
|
2010
|
-
return new this.constructor().copy(this);
|
|
2011
|
-
}
|
|
2012
|
-
/**
|
|
2013
|
-
* Copies the values of the given geometry to this instance.
|
|
2014
|
-
*
|
|
2015
|
-
* @param {BufferGeometry} source - The geometry to copy.
|
|
2016
|
-
* @return {BufferGeometry} A reference to this instance.
|
|
2017
|
-
*/
|
|
2018
|
-
copy(t) {
|
|
2019
|
-
this.index = null, this.attributes = {}, this.morphAttributes = {}, this.groups = [], this.boundingBox = null, this.boundingSphere = null;
|
|
2020
|
-
const e = {};
|
|
2021
|
-
this.name = t.name;
|
|
2022
|
-
const i = t.index;
|
|
2023
|
-
i !== null && this.setIndex(i.clone());
|
|
2024
|
-
const s = t.attributes;
|
|
2025
|
-
for (const l in s) {
|
|
2026
|
-
const c = s[l];
|
|
2027
|
-
this.setAttribute(l, c.clone(e));
|
|
2028
|
-
}
|
|
2029
|
-
const n = t.morphAttributes;
|
|
2030
|
-
for (const l in n) {
|
|
2031
|
-
const c = [], u = n[l];
|
|
2032
|
-
for (let a = 0, p = u.length; a < p; a++)
|
|
2033
|
-
c.push(u[a].clone(e));
|
|
2034
|
-
this.morphAttributes[l] = c;
|
|
2035
|
-
}
|
|
2036
|
-
this.morphTargetsRelative = t.morphTargetsRelative;
|
|
2037
|
-
const r = t.groups;
|
|
2038
|
-
for (let l = 0, c = r.length; l < c; l++) {
|
|
2039
|
-
const u = r[l];
|
|
2040
|
-
this.addGroup(u.start, u.count, u.materialIndex);
|
|
2041
|
-
}
|
|
2042
|
-
const o = t.boundingBox;
|
|
2043
|
-
o !== null && (this.boundingBox = o.clone());
|
|
2044
|
-
const h = t.boundingSphere;
|
|
2045
|
-
return h !== null && (this.boundingSphere = h.clone()), this.drawRange.start = t.drawRange.start, this.drawRange.count = t.drawRange.count, this.userData = t.userData, this;
|
|
2046
|
-
}
|
|
2047
|
-
/**
|
|
2048
|
-
* Frees the GPU-related resources allocated by this instance. Call this
|
|
2049
|
-
* method whenever this instance is no longer used in your app.
|
|
2050
|
-
*
|
|
2051
|
-
* @fires BufferGeometry#dispose
|
|
2052
|
-
*/
|
|
2053
|
-
dispose() {
|
|
2054
|
-
this.dispatchEvent({ type: "dispose" });
|
|
2055
|
-
}
|
|
2056
|
-
}
|
|
2057
|
-
export {
|
|
2058
|
-
Dt as B,
|
|
2059
|
-
ct as C,
|
|
2060
|
-
Wt as F,
|
|
2061
|
-
Yt as M,
|
|
2062
|
-
Vt as R
|
|
2063
|
-
};
|
|
2064
|
-
//# sourceMappingURL=BufferGeometry-BZdSmtHt.mjs.map
|