@splinetool/runtime 2.0.74 → 2.0.76
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/AGENTS.md +4 -0
- package/build/{runtime-aiAssistant-G2QMJZ6I.js → runtime-aiAssistant-DBCVWUEB.js} +1 -1
- package/build/runtime-aiAssistant-DBCVWUEB.js.br +0 -0
- package/build/runtime-aiAssistant-DBCVWUEB.js.gz +0 -0
- package/build/{runtime-apiServices-BNG5NNGJ.js → runtime-apiServices-JU3DOVOS.js} +1 -1
- package/build/runtime-apiServices-JU3DOVOS.js.br +0 -0
- package/build/runtime-apiServices-JU3DOVOS.js.gz +0 -0
- package/build/{runtime-audio-6LIEZJ5Y.js → runtime-audio-LJOR4W23.js} +1 -1
- package/build/runtime-audio-LJOR4W23.js.br +0 -0
- package/build/runtime-audio-LJOR4W23.js.gz +0 -0
- package/build/{runtime-bloom-XL2LGMRS.js → runtime-bloom-QWEX7MRM.js} +1 -1
- package/build/runtime-bloom-QWEX7MRM.js.br +0 -0
- package/build/runtime-bloom-QWEX7MRM.js.gz +0 -0
- package/build/{runtime-brightnessContrast-NVUYXHJN.js → runtime-brightnessContrast-WEITGRB7.js} +1 -1
- package/build/runtime-brightnessContrast-WEITGRB7.js.br +0 -0
- package/build/runtime-brightnessContrast-WEITGRB7.js.gz +0 -0
- package/build/{runtime-chromaticAberration-G6RI2BZ6.js → runtime-chromaticAberration-MWGH6M3J.js} +1 -1
- package/build/runtime-chromaticAberration-MWGH6M3J.js.br +0 -0
- package/build/runtime-chromaticAberration-MWGH6M3J.js.gz +0 -0
- package/build/{runtime-chunk-XSOC3ZAU.js → runtime-chunk-2DXI65BA.js} +1 -1
- package/build/runtime-chunk-2DXI65BA.js.br +0 -0
- package/build/runtime-chunk-2DXI65BA.js.gz +0 -0
- package/build/runtime-chunk-4XNHGXFP.js +1 -0
- package/build/runtime-chunk-4XNHGXFP.js.br +0 -0
- package/build/runtime-chunk-4XNHGXFP.js.gz +0 -0
- package/build/{runtime-chunk-U3FFE3XY.js → runtime-chunk-6MXQXGJV.js} +1 -1
- package/build/runtime-chunk-6MXQXGJV.js.br +0 -0
- package/build/runtime-chunk-6MXQXGJV.js.gz +0 -0
- package/build/{runtime-chunk-VFPHGGAW.js → runtime-chunk-CKC66SDD.js} +1 -1
- package/build/runtime-chunk-CKC66SDD.js.br +1 -0
- package/build/runtime-chunk-CKC66SDD.js.gz +0 -0
- package/build/{runtime-chunk-IDLPSZ23.js → runtime-chunk-D6UL7QVP.js} +1 -1
- package/build/runtime-chunk-D6UL7QVP.js.br +0 -0
- package/build/runtime-chunk-D6UL7QVP.js.gz +0 -0
- package/build/{runtime-chunk-3IZ67XSS.js → runtime-chunk-EKCMGGVU.js} +1 -1
- package/build/runtime-chunk-EKCMGGVU.js.br +0 -0
- package/build/runtime-chunk-EKCMGGVU.js.gz +0 -0
- package/build/{runtime-chunk-TSG4YZAG.js → runtime-chunk-EXHKTSKP.js} +1 -1
- package/build/runtime-chunk-EXHKTSKP.js.br +0 -0
- package/build/runtime-chunk-EXHKTSKP.js.gz +0 -0
- package/build/runtime-chunk-GDQWREZV.js +1 -0
- package/build/runtime-chunk-GDQWREZV.js.br +0 -0
- package/build/runtime-chunk-GDQWREZV.js.gz +0 -0
- package/build/{runtime-chunk-2BGTDNPM.js → runtime-chunk-GIO4XHW2.js} +1 -1
- package/build/runtime-chunk-GIO4XHW2.js.br +0 -0
- package/build/runtime-chunk-GIO4XHW2.js.gz +0 -0
- package/build/{runtime-chunk-M2T4RO2D.js → runtime-chunk-HUXCP2PU.js} +1 -1
- package/build/runtime-chunk-HUXCP2PU.js.br +0 -0
- package/build/runtime-chunk-HUXCP2PU.js.gz +0 -0
- package/build/{runtime-chunk-YF6YZ4JP.js → runtime-chunk-J6P5ZWHL.js} +1 -1
- package/build/runtime-chunk-J6P5ZWHL.js.br +0 -0
- package/build/runtime-chunk-J6P5ZWHL.js.gz +0 -0
- package/build/runtime-chunk-JBTA64YE.js +1 -0
- package/build/runtime-chunk-JBTA64YE.js.br +0 -0
- package/build/runtime-chunk-JBTA64YE.js.gz +0 -0
- package/build/{runtime-chunk-RF5RJ7WV.js → runtime-chunk-JEEQYSJN.js} +1 -1
- package/build/runtime-chunk-JEEQYSJN.js.br +0 -0
- package/build/runtime-chunk-JEEQYSJN.js.gz +0 -0
- package/build/{runtime-chunk-3IDUZQCX.js → runtime-chunk-KSHWLQFH.js} +1 -1
- package/build/runtime-chunk-KSHWLQFH.js.br +0 -0
- package/build/runtime-chunk-KSHWLQFH.js.gz +0 -0
- package/build/{runtime-chunk-MB4PQARC.js → runtime-chunk-LQYHP43C.js} +1 -1
- package/build/runtime-chunk-LQYHP43C.js.br +0 -0
- package/build/runtime-chunk-LQYHP43C.js.gz +0 -0
- package/build/{runtime-chunk-LGDFMPZV.js → runtime-chunk-LTIZNPR7.js} +1 -1
- package/build/runtime-chunk-LTIZNPR7.js.br +0 -0
- package/build/runtime-chunk-LTIZNPR7.js.gz +0 -0
- package/build/{runtime-chunk-NSBTKBP4.js → runtime-chunk-NEOF7SBZ.js} +1 -1
- package/build/runtime-chunk-NEOF7SBZ.js.br +0 -0
- package/build/runtime-chunk-NEOF7SBZ.js.gz +0 -0
- package/build/{runtime-chunk-GAIDJXNU.js → runtime-chunk-OBY4GH2G.js} +1 -1
- package/build/runtime-chunk-OBY4GH2G.js.br +0 -0
- package/build/runtime-chunk-OBY4GH2G.js.gz +0 -0
- package/build/{runtime-chunk-OGOYYKTI.js → runtime-chunk-PPYPL2FA.js} +1 -1
- package/build/runtime-chunk-PPYPL2FA.js.br +0 -0
- package/build/runtime-chunk-PPYPL2FA.js.gz +0 -0
- package/build/{runtime-chunk-ZPGBO3RF.js → runtime-chunk-QMZHJVIY.js} +1 -1
- package/build/runtime-chunk-QMZHJVIY.js.br +0 -0
- package/build/runtime-chunk-QMZHJVIY.js.gz +0 -0
- package/build/runtime-chunk-QRAO74EQ.js +1 -0
- package/build/runtime-chunk-QRAO74EQ.js.br +0 -0
- package/build/runtime-chunk-QRAO74EQ.js.gz +0 -0
- package/build/{runtime-chunk-SPQPAGPZ.js → runtime-chunk-RNPU23IE.js} +1 -1
- package/build/runtime-chunk-RNPU23IE.js.br +0 -0
- package/build/runtime-chunk-RNPU23IE.js.gz +0 -0
- package/build/runtime-chunk-TVA4CVPL.js +1 -0
- package/build/runtime-chunk-TVA4CVPL.js.br +0 -0
- package/build/runtime-chunk-TVA4CVPL.js.gz +0 -0
- package/build/{runtime-chunk-I4ELBYXH.js → runtime-chunk-UEMEFP7N.js} +1 -1
- package/build/runtime-chunk-UEMEFP7N.js.br +0 -0
- package/build/runtime-chunk-UEMEFP7N.js.gz +0 -0
- package/build/{runtime-chunk-7EZLEGAR.js → runtime-chunk-UQQ35LPE.js} +1 -1
- package/build/runtime-chunk-UQQ35LPE.js.br +0 -0
- package/build/runtime-chunk-UQQ35LPE.js.gz +0 -0
- package/build/{runtime-chunk-HT3IDSSP.js → runtime-chunk-VIY2ZYET.js} +1 -1
- package/build/runtime-chunk-VIY2ZYET.js.br +0 -0
- package/build/runtime-chunk-VIY2ZYET.js.gz +0 -0
- package/build/{runtime-chunk-RAC7ZRCY.js → runtime-chunk-XJHIXU7R.js} +1 -1
- package/build/runtime-chunk-XJHIXU7R.js.br +0 -0
- package/build/runtime-chunk-XJHIXU7R.js.gz +0 -0
- package/build/{runtime-chunk-LHETPF7C.js → runtime-chunk-XLNQVH4X.js} +1 -1
- package/build/{runtime-chunk-LHETPF7C.js.br → runtime-chunk-XLNQVH4X.js.br} +0 -0
- package/build/runtime-chunk-XLNQVH4X.js.gz +0 -0
- package/build/{runtime-chunk-PLFQ6EYP.js → runtime-chunk-YGTCEPBW.js} +1 -1
- package/build/runtime-chunk-YGTCEPBW.js.br +0 -0
- package/build/runtime-chunk-YGTCEPBW.js.gz +0 -0
- package/build/{runtime-chunk-ITY6YQG7.js → runtime-chunk-YQNSWRUG.js} +1 -1
- package/build/runtime-chunk-YQNSWRUG.js.br +0 -0
- package/build/runtime-chunk-YQNSWRUG.js.gz +0 -0
- package/build/{runtime-chunk-3BVK77PB.js → runtime-chunk-ZTPGBHSM.js} +1 -1
- package/build/runtime-chunk-ZTPGBHSM.js.br +0 -0
- package/build/runtime-chunk-ZTPGBHSM.js.gz +0 -0
- package/build/{runtime-classicRuntime-FXFVFMJH.js → runtime-classicRuntime-Z7ETK77X.js} +1 -1
- package/build/runtime-classicRuntime-Z7ETK77X.js.br +0 -0
- package/build/runtime-classicRuntime-Z7ETK77X.js.gz +0 -0
- package/build/runtime-cloners-XESRQZAQ.js +1 -0
- package/build/runtime-cloners-XESRQZAQ.js.br +0 -0
- package/build/runtime-cloners-XESRQZAQ.js.gz +0 -0
- package/build/{runtime-components-X4VSF3YN.js → runtime-components-HKA7YQLV.js} +1 -1
- package/build/runtime-components-HKA7YQLV.js.br +0 -0
- package/build/runtime-components-HKA7YQLV.js.gz +0 -0
- package/build/{runtime-conditional-HF6IVW4F.js → runtime-conditional-NND2FHP6.js} +1 -1
- package/build/runtime-conditional-NND2FHP6.js.br +0 -0
- package/build/runtime-conditional-NND2FHP6.js.gz +0 -0
- package/build/{runtime-createDestroy-VA7S3QOX.js → runtime-createDestroy-S3MAGWSU.js} +1 -1
- package/build/runtime-createDestroy-S3MAGWSU.js.br +0 -0
- package/build/runtime-createDestroy-S3MAGWSU.js.gz +0 -0
- package/build/{runtime-depthOfField-UOGP3RXR.js → runtime-depthOfField-3O3BP5UF.js} +1 -1
- package/build/runtime-depthOfField-3O3BP5UF.js.br +0 -0
- package/build/runtime-depthOfField-3O3BP5UF.js.gz +0 -0
- package/build/{runtime-dragDrop-MMW4JJK5.js → runtime-dragDrop-PE5Y4MWB.js} +1 -1
- package/build/runtime-dragDrop-PE5Y4MWB.js.br +0 -0
- package/build/runtime-dragDrop-PE5Y4MWB.js.gz +0 -0
- package/build/{runtime-gameControls-RTLF3SFV.js → runtime-gameControls-5RLJDMUI.js} +1 -1
- package/build/runtime-gameControls-5RLJDMUI.js.br +0 -0
- package/build/runtime-gameControls-5RLJDMUI.js.gz +0 -0
- package/build/runtime-hair-ZXUGRWYE.js +1 -0
- package/build/runtime-hair-ZXUGRWYE.js.br +3 -0
- package/build/runtime-hair-ZXUGRWYE.js.gz +0 -0
- package/build/{runtime-hueSaturation-LYCL2TIK.js → runtime-hueSaturation-CGKVQ5AX.js} +1 -1
- package/build/runtime-hueSaturation-CGKVQ5AX.js.br +0 -0
- package/build/runtime-hueSaturation-CGKVQ5AX.js.gz +0 -0
- package/build/{runtime-mergeStaticGeometries-O3ASOOEF.js → runtime-mergeStaticGeometries-OYK7BHIT.js} +1 -1
- package/build/runtime-mergeStaticGeometries-OYK7BHIT.js.br +0 -0
- package/build/runtime-mergeStaticGeometries-OYK7BHIT.js.gz +0 -0
- package/build/{runtime-miscActions-GUOUHOIP.js → runtime-miscActions-JBIPB377.js} +1 -1
- package/build/runtime-miscActions-JBIPB377.js.br +0 -0
- package/build/runtime-miscActions-JBIPB377.js.gz +0 -0
- package/build/{runtime-mouseHover-VESYEYPP.js → runtime-mouseHover-DX3N3X7P.js} +1 -1
- package/build/runtime-mouseHover-DX3N3X7P.js.br +0 -0
- package/build/runtime-mouseHover-DX3N3X7P.js.gz +0 -0
- package/build/{runtime-noise-PNVGOS7A.js → runtime-noise-IAXCCKRI.js} +1 -1
- package/build/runtime-noise-IAXCCKRI.js.br +0 -0
- package/build/runtime-noise-IAXCCKRI.js.gz +0 -0
- package/build/{runtime-particles-3FGB32NG.js → runtime-particles-RT6PZSWK.js} +1 -1
- package/build/runtime-particles-RT6PZSWK.js.br +0 -0
- package/build/runtime-particles-RT6PZSWK.js.gz +0 -0
- package/build/{runtime-paths-5TBOKC73.js → runtime-paths-W4TBZW5Y.js} +1 -1
- package/build/runtime-paths-W4TBZW5Y.js.br +0 -0
- package/build/runtime-paths-W4TBZW5Y.js.gz +0 -0
- package/build/{runtime-pixelation-ZVCDH6UI.js → runtime-pixelation-ETQKXULE.js} +1 -1
- package/build/runtime-pixelation-ETQKXULE.js.br +0 -0
- package/build/runtime-pixelation-ETQKXULE.js.gz +0 -0
- package/build/{runtime-resize-WYDL5VDC.js → runtime-resize-DPVCEPTN.js} +1 -1
- package/build/runtime-resize-DPVCEPTN.js.br +0 -0
- package/build/runtime-resize-DPVCEPTN.js.gz +0 -0
- package/build/{runtime-sceneTransition-JC5CBZ7Y.js → runtime-sceneTransition-56IV7SWV.js} +1 -1
- package/build/runtime-sceneTransition-56IV7SWV.js.br +0 -0
- package/build/runtime-sceneTransition-56IV7SWV.js.gz +0 -0
- package/build/{runtime-scroll-LUQTGR3L.js → runtime-scroll-6V3HUZMD.js} +1 -1
- package/build/runtime-scroll-6V3HUZMD.js.br +0 -0
- package/build/runtime-scroll-6V3HUZMD.js.gz +0 -0
- package/build/runtime-shapeBlends-QVPRUMEV.js +1 -0
- package/build/runtime-shapeBlends-QVPRUMEV.js.br +4 -0
- package/build/runtime-shapeBlends-QVPRUMEV.js.gz +0 -0
- package/build/{runtime-text-NDE2MG7P.js → runtime-text-6HDGLXDK.js} +1 -1
- package/build/runtime-text-6HDGLXDK.js.br +0 -0
- package/build/runtime-text-6HDGLXDK.js.gz +0 -0
- package/build/{runtime-textInputs-TQVKLR6P.js → runtime-textInputs-YJHUTIQQ.js} +1 -1
- package/build/runtime-textInputs-YJHUTIQQ.js.br +0 -0
- package/build/runtime-textInputs-YJHUTIQQ.js.gz +0 -0
- package/build/runtime-timeline-MLGEUIGX.js +1 -0
- package/build/runtime-timeline-MLGEUIGX.js.br +0 -0
- package/build/runtime-timeline-MLGEUIGX.js.gz +0 -0
- package/build/{runtime-tracking-KGG3DGKH.js → runtime-tracking-E3ZVHDBK.js} +1 -1
- package/build/runtime-tracking-E3ZVHDBK.js.br +0 -0
- package/build/runtime-tracking-E3ZVHDBK.js.gz +0 -0
- package/build/{runtime-transitions-2GXBFFKI.js → runtime-transitions-ZOOFJNQG.js} +1 -1
- package/build/runtime-transitions-ZOOFJNQG.js.br +0 -0
- package/build/runtime-transitions-ZOOFJNQG.js.gz +0 -0
- package/build/{runtime-ui2d-LDNYTXUV.js → runtime-ui2d-PEQJMQI6.js} +1 -1
- package/build/runtime-ui2d-PEQJMQI6.js.br +0 -0
- package/build/runtime-ui2d-PEQJMQI6.js.gz +0 -0
- package/build/{runtime-updater-GDPFK5FP.js → runtime-updater-KWRKWDYN.js} +1 -1
- package/build/runtime-updater-KWRKWDYN.js.br +1 -0
- package/build/runtime-updater-KWRKWDYN.js.gz +0 -0
- package/build/{runtime-variables-SGC5CI6X.js → runtime-variables-S6VNWBXR.js} +1 -1
- package/build/runtime-variables-S6VNWBXR.js.br +0 -0
- package/build/runtime-variables-S6VNWBXR.js.gz +0 -0
- package/build/{runtime-vectorShapes-CYMTSR6Z.js → runtime-vectorShapes-JJZBFBYT.js} +1 -1
- package/build/runtime-vectorShapes-JJZBFBYT.js.br +0 -0
- package/build/runtime-vectorShapes-JJZBFBYT.js.gz +0 -0
- package/build/{runtime-video-ESE3MHIR.js → runtime-video-BMREJ4XX.js} +1 -1
- package/build/runtime-video-BMREJ4XX.js.br +0 -0
- package/build/runtime-video-BMREJ4XX.js.gz +0 -0
- package/build/{runtime-vignette-TECYHVQU.js → runtime-vignette-IZCX6M3H.js} +1 -1
- package/build/runtime-vignette-IZCX6M3H.js.br +0 -0
- package/build/runtime-vignette-IZCX6M3H.js.gz +0 -0
- package/build/{runtime-webgpu-K4S7CCDF.js → runtime-webgpu-N3IPXH3K.js} +1 -1
- package/build/runtime-webgpu-N3IPXH3K.js.br +0 -0
- package/build/runtime-webgpu-N3IPXH3K.js.gz +0 -0
- package/build/runtime.cjs +325 -325
- package/build/runtime.js +1 -1
- package/build/runtime.js.br +0 -0
- package/build/runtime.js.gz +0 -0
- package/build/runtime.standalone.js +1 -1
- package/build/runtime.standalone.js.br +0 -0
- package/build/runtime.standalone.js.gz +0 -0
- package/build/runtime.standalone.webgl.js +1 -1
- package/build/runtime.standalone.webgl.js.br +0 -0
- package/build/runtime.standalone.webgl.js.gz +0 -0
- package/build/runtime.standalone.webgpu.js +1 -1
- package/build/runtime.standalone.webgpu.js.br +0 -0
- package/build/runtime.standalone.webgpu.js.gz +0 -0
- package/build/runtime.standalone.webgpu.micro.js +1 -1
- package/build/runtime.standalone.webgpu.micro.js.br +0 -0
- package/build/runtime.standalone.webgpu.micro.js.gz +0 -0
- package/build/runtime.standalone.webgpu.min.js +1 -1
- package/build/runtime.standalone.webgpu.min.js.br +0 -0
- package/build/runtime.standalone.webgpu.min.js.gz +0 -0
- package/package.json +1 -1
- package/runtime.d.ts +4 -1
- package/build/runtime-aiAssistant-G2QMJZ6I.js.br +0 -0
- package/build/runtime-aiAssistant-G2QMJZ6I.js.gz +0 -0
- package/build/runtime-apiServices-BNG5NNGJ.js.br +0 -0
- package/build/runtime-apiServices-BNG5NNGJ.js.gz +0 -0
- package/build/runtime-audio-6LIEZJ5Y.js.br +0 -0
- package/build/runtime-audio-6LIEZJ5Y.js.gz +0 -0
- package/build/runtime-bloom-XL2LGMRS.js.br +0 -0
- package/build/runtime-bloom-XL2LGMRS.js.gz +0 -0
- package/build/runtime-brightnessContrast-NVUYXHJN.js.br +0 -0
- package/build/runtime-brightnessContrast-NVUYXHJN.js.gz +0 -0
- package/build/runtime-chromaticAberration-G6RI2BZ6.js.br +0 -0
- package/build/runtime-chromaticAberration-G6RI2BZ6.js.gz +0 -0
- package/build/runtime-chunk-2BGTDNPM.js.br +0 -0
- package/build/runtime-chunk-2BGTDNPM.js.gz +0 -0
- package/build/runtime-chunk-3BVK77PB.js.br +0 -0
- package/build/runtime-chunk-3BVK77PB.js.gz +0 -0
- package/build/runtime-chunk-3IDUZQCX.js.br +0 -0
- package/build/runtime-chunk-3IDUZQCX.js.gz +0 -0
- package/build/runtime-chunk-3IZ67XSS.js.br +0 -0
- package/build/runtime-chunk-3IZ67XSS.js.gz +0 -0
- package/build/runtime-chunk-7EZLEGAR.js.br +0 -0
- package/build/runtime-chunk-7EZLEGAR.js.gz +0 -0
- package/build/runtime-chunk-AHV7KLQP.js +0 -1
- package/build/runtime-chunk-AHV7KLQP.js.br +0 -0
- package/build/runtime-chunk-AHV7KLQP.js.gz +0 -0
- package/build/runtime-chunk-GAIDJXNU.js.br +0 -0
- package/build/runtime-chunk-GAIDJXNU.js.gz +0 -0
- package/build/runtime-chunk-HT3IDSSP.js.br +0 -0
- package/build/runtime-chunk-HT3IDSSP.js.gz +0 -0
- package/build/runtime-chunk-I4ELBYXH.js.br +0 -0
- package/build/runtime-chunk-I4ELBYXH.js.gz +0 -0
- package/build/runtime-chunk-IDLPSZ23.js.br +0 -0
- package/build/runtime-chunk-IDLPSZ23.js.gz +0 -0
- package/build/runtime-chunk-ITY6YQG7.js.br +0 -0
- package/build/runtime-chunk-ITY6YQG7.js.gz +0 -0
- package/build/runtime-chunk-JTZ2BWZ5.js +0 -1
- package/build/runtime-chunk-JTZ2BWZ5.js.br +0 -0
- package/build/runtime-chunk-JTZ2BWZ5.js.gz +0 -0
- package/build/runtime-chunk-LGDFMPZV.js.br +0 -0
- package/build/runtime-chunk-LGDFMPZV.js.gz +0 -0
- package/build/runtime-chunk-LHETPF7C.js.gz +0 -0
- package/build/runtime-chunk-M2T4RO2D.js.br +0 -0
- package/build/runtime-chunk-M2T4RO2D.js.gz +0 -0
- package/build/runtime-chunk-MB4PQARC.js.br +0 -0
- package/build/runtime-chunk-MB4PQARC.js.gz +0 -0
- package/build/runtime-chunk-NSBTKBP4.js.br +0 -0
- package/build/runtime-chunk-NSBTKBP4.js.gz +0 -0
- package/build/runtime-chunk-OGOYYKTI.js.br +0 -0
- package/build/runtime-chunk-OGOYYKTI.js.gz +0 -0
- package/build/runtime-chunk-PLFQ6EYP.js.br +0 -0
- package/build/runtime-chunk-PLFQ6EYP.js.gz +0 -0
- package/build/runtime-chunk-RAC7ZRCY.js.br +0 -0
- package/build/runtime-chunk-RAC7ZRCY.js.gz +0 -0
- package/build/runtime-chunk-RF5RJ7WV.js.br +0 -0
- package/build/runtime-chunk-RF5RJ7WV.js.gz +0 -0
- package/build/runtime-chunk-RQMCMQVY.js +0 -1
- package/build/runtime-chunk-RQMCMQVY.js.br +0 -0
- package/build/runtime-chunk-RQMCMQVY.js.gz +0 -0
- package/build/runtime-chunk-S4LSS4IT.js +0 -1
- package/build/runtime-chunk-S4LSS4IT.js.br +0 -0
- package/build/runtime-chunk-S4LSS4IT.js.gz +0 -0
- package/build/runtime-chunk-SPQPAGPZ.js.br +0 -0
- package/build/runtime-chunk-SPQPAGPZ.js.gz +0 -0
- package/build/runtime-chunk-TSG4YZAG.js.br +0 -0
- package/build/runtime-chunk-TSG4YZAG.js.gz +0 -0
- package/build/runtime-chunk-U3FFE3XY.js.br +0 -0
- package/build/runtime-chunk-U3FFE3XY.js.gz +0 -0
- package/build/runtime-chunk-VFPHGGAW.js.br +0 -1
- package/build/runtime-chunk-VFPHGGAW.js.gz +0 -0
- package/build/runtime-chunk-XSOC3ZAU.js.br +0 -0
- package/build/runtime-chunk-XSOC3ZAU.js.gz +0 -0
- package/build/runtime-chunk-Y3BMDVJ7.js +0 -1
- package/build/runtime-chunk-Y3BMDVJ7.js.br +0 -0
- package/build/runtime-chunk-Y3BMDVJ7.js.gz +0 -0
- package/build/runtime-chunk-YF6YZ4JP.js.br +0 -0
- package/build/runtime-chunk-YF6YZ4JP.js.gz +0 -0
- package/build/runtime-chunk-ZPGBO3RF.js.br +0 -0
- package/build/runtime-chunk-ZPGBO3RF.js.gz +0 -0
- package/build/runtime-classicRuntime-FXFVFMJH.js.br +0 -0
- package/build/runtime-classicRuntime-FXFVFMJH.js.gz +0 -0
- package/build/runtime-cloners-QC75JC53.js +0 -1
- package/build/runtime-cloners-QC75JC53.js.br +0 -0
- package/build/runtime-cloners-QC75JC53.js.gz +0 -0
- package/build/runtime-components-X4VSF3YN.js.br +0 -0
- package/build/runtime-components-X4VSF3YN.js.gz +0 -0
- package/build/runtime-conditional-HF6IVW4F.js.br +0 -0
- package/build/runtime-conditional-HF6IVW4F.js.gz +0 -0
- package/build/runtime-createDestroy-VA7S3QOX.js.br +0 -0
- package/build/runtime-createDestroy-VA7S3QOX.js.gz +0 -0
- package/build/runtime-depthOfField-UOGP3RXR.js.br +0 -0
- package/build/runtime-depthOfField-UOGP3RXR.js.gz +0 -0
- package/build/runtime-dragDrop-MMW4JJK5.js.br +0 -0
- package/build/runtime-dragDrop-MMW4JJK5.js.gz +0 -0
- package/build/runtime-gameControls-RTLF3SFV.js.br +0 -0
- package/build/runtime-gameControls-RTLF3SFV.js.gz +0 -0
- package/build/runtime-hair-VQLVGARM.js +0 -1
- package/build/runtime-hair-VQLVGARM.js.br +0 -1
- package/build/runtime-hair-VQLVGARM.js.gz +0 -0
- package/build/runtime-hueSaturation-LYCL2TIK.js.br +0 -0
- package/build/runtime-hueSaturation-LYCL2TIK.js.gz +0 -0
- package/build/runtime-mergeStaticGeometries-O3ASOOEF.js.br +0 -0
- package/build/runtime-mergeStaticGeometries-O3ASOOEF.js.gz +0 -0
- package/build/runtime-miscActions-GUOUHOIP.js.br +0 -0
- package/build/runtime-miscActions-GUOUHOIP.js.gz +0 -0
- package/build/runtime-mouseHover-VESYEYPP.js.br +0 -0
- package/build/runtime-mouseHover-VESYEYPP.js.gz +0 -0
- package/build/runtime-noise-PNVGOS7A.js.br +0 -0
- package/build/runtime-noise-PNVGOS7A.js.gz +0 -0
- package/build/runtime-particles-3FGB32NG.js.br +0 -0
- package/build/runtime-particles-3FGB32NG.js.gz +0 -0
- package/build/runtime-paths-5TBOKC73.js.br +0 -0
- package/build/runtime-paths-5TBOKC73.js.gz +0 -0
- package/build/runtime-pixelation-ZVCDH6UI.js.br +0 -0
- package/build/runtime-pixelation-ZVCDH6UI.js.gz +0 -0
- package/build/runtime-resize-WYDL5VDC.js.br +0 -0
- package/build/runtime-resize-WYDL5VDC.js.gz +0 -0
- package/build/runtime-sceneTransition-JC5CBZ7Y.js.br +0 -0
- package/build/runtime-sceneTransition-JC5CBZ7Y.js.gz +0 -0
- package/build/runtime-scroll-LUQTGR3L.js.br +0 -0
- package/build/runtime-scroll-LUQTGR3L.js.gz +0 -0
- package/build/runtime-shapeBlends-FFFCEEBA.js +0 -1
- package/build/runtime-shapeBlends-FFFCEEBA.js.br +0 -3
- package/build/runtime-shapeBlends-FFFCEEBA.js.gz +0 -0
- package/build/runtime-text-NDE2MG7P.js.br +0 -0
- package/build/runtime-text-NDE2MG7P.js.gz +0 -0
- package/build/runtime-textInputs-TQVKLR6P.js.br +0 -0
- package/build/runtime-textInputs-TQVKLR6P.js.gz +0 -0
- package/build/runtime-timeline-OYV32FRI.js +0 -1
- package/build/runtime-timeline-OYV32FRI.js.br +0 -0
- package/build/runtime-timeline-OYV32FRI.js.gz +0 -0
- package/build/runtime-tracking-KGG3DGKH.js.br +0 -0
- package/build/runtime-tracking-KGG3DGKH.js.gz +0 -0
- package/build/runtime-transitions-2GXBFFKI.js.br +0 -0
- package/build/runtime-transitions-2GXBFFKI.js.gz +0 -0
- package/build/runtime-ui2d-LDNYTXUV.js.br +0 -0
- package/build/runtime-ui2d-LDNYTXUV.js.gz +0 -0
- package/build/runtime-updater-GDPFK5FP.js.br +0 -0
- package/build/runtime-updater-GDPFK5FP.js.gz +0 -0
- package/build/runtime-variables-SGC5CI6X.js.br +0 -0
- package/build/runtime-variables-SGC5CI6X.js.gz +0 -0
- package/build/runtime-vectorShapes-CYMTSR6Z.js.br +0 -0
- package/build/runtime-vectorShapes-CYMTSR6Z.js.gz +0 -0
- package/build/runtime-video-ESE3MHIR.js.br +0 -0
- package/build/runtime-video-ESE3MHIR.js.gz +0 -0
- package/build/runtime-vignette-TECYHVQU.js.br +0 -0
- package/build/runtime-vignette-TECYHVQU.js.gz +0 -0
- package/build/runtime-webgpu-K4S7CCDF.js.br +0 -0
- package/build/runtime-webgpu-K4S7CCDF.js.gz +0 -0
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as r}from"./runtime-chunk-EXHKTSKP.js";import"./runtime-chunk-YQNSWRUG.js";import"./runtime-chunk-PPYPL2FA.js";import"./runtime-chunk-6MXQXGJV.js";import"./runtime-chunk-GDQWREZV.js";import"./runtime-chunk-4YV3EXSU.js";import"./runtime-chunk-NSD7DU3P.js";import{c as m}from"./runtime-chunk-UEMEFP7N.js";import"./runtime-chunk-RTLL6WIB.js";import"./runtime-chunk-2PT2WH66.js";import"./runtime-chunk-HUXCP2PU.js";import{a as n}from"./runtime-chunk-TZCHGFVF.js";import"./runtime-chunk-JBTA64YE.js";import"./runtime-chunk-BVVSZMXD.js";import"./runtime-chunk-ML3Z74BL.js";m.Cloner=r,n("cloners");
|
|
Binary file
|
|
Binary file
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as e}from"./runtime-chunk-
|
|
1
|
+
import{a as e}from"./runtime-chunk-UQQ35LPE.js";import{a as t}from"./runtime-chunk-XLNQVH4X.js";import{d as n}from"./runtime-chunk-ZTPGBHSM.js";import{ja as i}from"./runtime-chunk-GDQWREZV.js";import"./runtime-chunk-4YV3EXSU.js";import"./runtime-chunk-NSD7DU3P.js";import{c as s,h as o}from"./runtime-chunk-UEMEFP7N.js";import{d as r,e as a}from"./runtime-chunk-RTLL6WIB.js";import"./runtime-chunk-2PT2WH66.js";import"./runtime-chunk-HUXCP2PU.js";import{a as p,d}from"./runtime-chunk-TZCHGFVF.js";import{Aa as l,Ba as c,Ia as h,J as u,h as m,i as f,va as y}from"./runtime-chunk-JBTA64YE.js";import{Oc as v,Sc as g,od as j}from"./runtime-chunk-BVVSZMXD.js";import"./runtime-chunk-ML3Z74BL.js";var k=class extends(n(g,t)){constructor(e,t,n){super(),this.isComponentObject=!0,"Instance"===t.type&&"string"==typeof e&&(t=this.transformAssignData(t,n)),this.super_Entity(e,t),this.objectHelper.update()}get isComponentRoot(){return"Component"===this.data.type&&"string"==typeof this.identity}get isInstanceRoot(){return"Instance"===this.data.type&&"string"==typeof this.identity}transformAssignData(e,t){let n=h.getComponentData({scene:t.scene.data,shared:t.shared.data},e.component);if(n){let t,i;for(let s of c.rootOverrideProps)void 0===e[s]?(void 0===t&&(t={...e}),t[s]=n.data[s]):(void 0===i&&(i={}),i[s]=e[s],void 0===t&&(t={...e}),t[s]=f.apply(n.data[s],e[s]));return this.overrideData=i,t}return{...y.defaultData,...e,...a(y.defaultData,c.rootOverrideProps)}}updateByOp(e,t,n,i){let s;if(this.isInstanceRoot&&!i)if(t=this.transformAssignData(t,n),0===e.type&&0===e.path.length&&this.component)for(let t of c.rootOverrideProps)t in e.props&&void 0===e.props[t]&&(void 0===s&&(s={...e,props:{...e.props}}),s.props[t]=this.component.data[t]);else if(0===e.type&&e.path.length>0&&c.rootOverrideProps.includes(e.path[0])){let n=e.path[0];void 0===s&&(s={...e,path:[],props:{[n]:t[n]}})}super.updateByOp(s??e,t,n,i)}updateState(e,t){this.updateState_Entity(e,t)}expandInstanceChildren(t){let n=this.data;if(void 0===this.component){let s=t.scene.find(n.component)??null,r=!1;if(s!==this.oldComponent){if(this.oldComponent){let n=0;for(let i of this.children){if(!o.is(i))break;t.scene.disposeAndUnregisterEntityRecursivelyIfNotReregistered(i),e(i),n+=1}this.children.splice(0,n)}r=!0}if(s){let e={};b(t,[this.uuid],n.overrides,this,s,s,0,r,e);for(let n of this.children)if(o.is(n)){let s=n.data;"Empty"===s.type&&s.animations&&n.traverseEntity(n=>{let s=n.dataPatched;if(n instanceof i&&s.bones&&s.boneInverses){let i=n.dataPatched;if(i.bones&&i.boneInverses){let s=i.bones.map(n=>t.scene.find(e[n])),o=i.boneInverses.map(e=>(new v).fromArray(e)),r=new j(s,o);n.bind(r,n.bindMatrix)}}else n.matrixAutoUpdate=!0})}}this.oldComponent=this.component}}};function I(e,t,n,i){return e.component===t&&r(e.identity,i)?e.overrideData===n?2:1:0}function b(e,t,n,i,r,a,p,d,c){if(p>50)return!1;if(i.component!==r){if(i.component){let e=i.component.instances.indexOf(i);e>=0&&i.component.instances.splice(e,1)}r.instances.find(e=>e===i)||r.instances.push(i),i.component=r}r instanceof k&&r.isInstanceRoot&&r.expandInstanceChildren(e);let h=0;for(let y of r.children)if(o.is(y)){let r=[...t,..."string"==typeof y.identity?[y.identity]:y.identity],v=l.resolve(n,r,1);null!=v&&!(v instanceof m)&&(Object.setPrototypeOf(v,m.prototype),console.error("wrong prototype"));let g,j=null;if(!d){let t=i.children[h];if(j=o.is(t)?t:null,null!==j){let e=I(j,y,v,r);g=e>=1?j.stateSelection:void 0,2!==e&&(j=null)}if(null===j&&(j=e.scene.findInstance(r)??null,null!==j)){let t=I(j,y,v,r);if(g=t>=1?j.stateSelection:void 0,2!==t)j=null;else{let t=j.parent.children.indexOf(j);j.parent.children.splice(t,1),i.children.splice(h,0,j),j.parent===i?t<=h&&console.error("not possible"):(j.parent=i,j.matrixWorldNeedsUpdate=!0,j.resetBBoxNeedsUpdate(),j.updateVisible(),e.pendingDeletes.delete(j))}}}if(null===j){let t=v?f.apply(y.data,v):y.data;u.is(t.type)&&(t={...t,type:"Empty"}),j=s.createEntity(r,t,e),j.overrideData=v,i.add(j),i.children.splice(i.children.length-1,1),i.children.splice(h,0,j),j.updateState(j.data,e),g&&j.changeSelectedState(g,e),e.scene.registerInstanceAndSetUuid(j)}j.isBone&&(c[j.identity[j.identity.length-1]]=j.uuid),h+=1,b(e,t,n,j,y,a,p+1,d,c)}if(!d){let t=h;for(;;){let t=i.children[h];if(!o.is(t))break;e.pendingDeletes.add(t),h+=1}i.children.splice(t,h-t)}return!0}var D=(e,t,n)=>new k(e,t,n);d("Component",D),d("Instance",D),p("components");
|
|
Binary file
|
|
Binary file
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as t,b as i}from"./runtime-chunk-DZNU62CT.js";import{f as s,g as a}from"./runtime-chunk-
|
|
1
|
+
import{a as t,b as i}from"./runtime-chunk-DZNU62CT.js";import{f as s,g as a}from"./runtime-chunk-NEOF7SBZ.js";import"./runtime-chunk-HUXCP2PU.js";import{a as n}from"./runtime-chunk-TZCHGFVF.js";import"./runtime-chunk-JBTA64YE.js";import{Ec as o,Fc as e,Oc as c,Pc as r}from"./runtime-chunk-BVVSZMXD.js";import"./runtime-chunk-ML3Z74BL.js";function h(t){return Object.values(t).some(t=>t.length>0)}var d=new e,p=new e,u=(new c,new e,new o,new e,new r,class{constructor(t,i,a,n,o){this.actionsIn=s(t,t.inActions,a,n,o,i),this.actionsOut=s(t,t.outActions,a,n,o,i)}disconnect(){a(this.actionsIn),a(this.actionsOut)}}),f=class extends u{constructor(t,i,s,a,n,o){super(i,s,a,n,o),this.id=t,this.data=i,this.object=s,this.stage="out",this.objects=[],this.onUpdateMatrixWorld=()=>{for(let t of this.objects)if(!t.visible)return;let t=d.setFromMatrixPosition(this.objects[0].matrixWorld),i=p.setFromMatrixPosition(this.objects[1].matrixWorld),s=t.distanceTo(i)<=this.distance?"in":"out";if(this.stage!==s){this.stage=s;let t="in"===s?this.actionsIn:this.actionsOut;t.Audio.forEach(t=>t.dispatchConditional()),t.Particles.forEach(t=>t.dispatchConditional()),t.Video.forEach(t=>t.dispatchConditional()),t.Link.forEach(t=>t.dispatch()),t.Create.forEach(t=>t.dispatch()),t.Destroy.forEach(t=>t.dispatch()),t.Reset.forEach(t=>t.dispatch()),t.Transition.forEach(t=>{!t.shouldReinit()||(t.object.currentTransitionEvent!==this&&(t.object.currentTransitionEvent=this),t.init())}),t.Transition.forEach(t=>t.play()),t.Animation.forEach(t=>t.play()),t.TimelineAnimation.forEach(t=>t.play()),t.SwitchCamera.forEach(t=>t.play()),t.SceneTransition.forEach(t=>t.dispatch()),t.SetVariable.forEach(t=>t.checkConditions()),t.SetVariable.forEach(t=>t.dispatch()),t.DynamicVariablePlay.forEach(t=>t.dispatch()),t.ClearLocalStorage.forEach(t=>t.dispatch()),t.UserAPI.forEach(t=>t.dispatch())}};let{distance:e,fromObject:c,toObject:r}=i.condition;this.distance=e;for(let t of[c,r]){if(!t)throw new Error("Missing property");let i=a.find(t);if(!i)throw new Error("Missing property");this.objects.push(i)}}connect(){window.setTimeout(()=>{this.objects.forEach(t=>{t.addEventListener("updateMatrixWorld",this.onUpdateMatrixWorld),t.addEventListener("updateMatrix",this.onUpdateMatrixWorld)}),this.onUpdateMatrixWorld()},0)}disconnect(){super.disconnect(),this.stage="out",this.objects.forEach(t=>{t.removeEventListener("updateMatrixWorld",this.onUpdateMatrixWorld),t.removeEventListener("updateMatrix",this.onUpdateMatrixWorld)})}},l=class extends u{constructor(t,i,s,a,n,o){super(i,s,a,n,o),this.id=t,this.data=i,this.object=s,this.onTransitionState=({settled:t,state:i})=>{t&&i===(this.toState??null)?h(this.actionsIn)&&this.runInActions():h(this.actionsOut)&&this.runOutActions()};let{condition:e}=i;if(!e.object)throw new Error("Missing property");let c=a.find(e.object)??a.scene.find2D(e.object);if(!c)throw new Error("Missing property");if(this.toObject=c,e.state&&!this.toObject.states?.[e.state])throw new Error("Missing property");this.toState=e.state}connect(){this.toObject.addEventListener("transitionState",this.onTransitionState)}disconnect(){super.disconnect(),this.toObject.removeEventListener("transitionState",this.onTransitionState)}runOutActions(){this.actionsOut.Audio.forEach(t=>t.dispatchConditional()),this.actionsOut.Particles.forEach(t=>t.dispatchConditional()),this.actionsOut.Video.forEach(t=>t.dispatchConditional()),this.actionsOut.Link.forEach(t=>t.dispatch()),this.actionsOut.Create.forEach(t=>t.dispatch()),this.actionsOut.Destroy.forEach(t=>t.dispatch()),this.actionsOut.Reset.forEach(t=>t.dispatch()),this.actionsIn.Transition.forEach(t=>{this.drivesWatchedObject(t)||t.pause()}),this.object.currentTransitionEvent=this,this.actionsOut.Transition.forEach(t=>t.play()),this.actionsOut.Animation.forEach(t=>t.play()),this.actionsOut.TimelineAnimation.forEach(t=>t.play()),this.actionsIn.SwitchCamera.forEach(t=>t.pause()),this.actionsOut.SwitchCamera.forEach(t=>t.play()),this.actionsOut.SceneTransition.forEach(t=>t.dispatch()),this.actionsOut.SetVariable.forEach(t=>t.checkConditions()),this.actionsOut.SetVariable.forEach(t=>t.dispatch()),this.actionsOut.DynamicVariablePlay.forEach(t=>t.dispatch()),this.actionsOut.ClearLocalStorage.forEach(t=>t.dispatch()),this.actionsOut.UserAPI.forEach(t=>t.dispatch())}runInActions(){this.actionsIn.Audio.forEach(t=>t.dispatchConditional()),this.actionsIn.Particles.forEach(t=>t.dispatchConditional()),this.actionsIn.Video.forEach(t=>t.dispatchConditional()),this.actionsIn.Link.forEach(t=>t.dispatch()),this.actionsIn.Create.forEach(t=>t.dispatch()),this.actionsIn.Destroy.forEach(t=>t.dispatch()),this.actionsIn.Reset.forEach(t=>t.dispatch()),this.actionsOut.Transition.forEach(t=>{this.drivesWatchedObject(t)||t.pause()}),this.object.currentTransitionEvent=this,this.actionsIn.Transition.forEach(t=>t.play()),this.actionsIn.Animation.forEach(t=>t.play()),this.actionsIn.TimelineAnimation.forEach(t=>t.play()),this.actionsOut.SwitchCamera.forEach(t=>t.pause()),this.actionsIn.SwitchCamera.forEach(t=>t.play()),this.actionsIn.SceneTransition.forEach(t=>t.dispatch()),this.actionsIn.SetVariable.forEach(t=>t.checkConditions()),this.actionsIn.SetVariable.forEach(t=>t.dispatch()),this.actionsIn.DynamicVariablePlay.forEach(t=>t.dispatch()),this.actionsOut.ClearLocalStorage.forEach(t=>t.dispatch()),this.actionsOut.UserAPI.forEach(t=>t.dispatch())}drivesWatchedObject(t){return t.object===this.toObject}},E=class extends t{constructor(t,i){super(t),this.eventManager=i,this.eventsPerConditions={Comparison:[],Distance:[],State:[]},this.hasVideoAction=!1}connect(){super.connect();let{page:t,sharedAssets:i}=this.eventContext;t.traverseEntity(s=>{if(s.data?.events.length)for(let{id:a,data:n}of s.data.events)if(!n.disabled&&"Conditional"===n.type)try{let o;"Comparison"===n.condition.type||("Distance"===n.condition.type?o=new f(a,n,s,t,i,this.eventManager):"State"===n.condition.type&&(o=new l(a,n,s,t,i,this.eventManager))),o&&(this.eventsPerConditions[n.condition.type].push(o),(o.actionsIn.Video.length||o.actionsOut.Video.length)&&(this.hasVideoAction=!0))}catch(t){}}),Object.values(this.eventsPerConditions).forEach(t=>t.forEach(t=>t.connect()))}disconnect(){super.disconnect(),Object.values(this.eventsPerConditions).forEach(t=>t.forEach(t=>t.disconnect()))}};i("Conditional",({eventContext:t,eventManager:i})=>new E(t,i)),n("conditional");
|
|
Binary file
|
|
Binary file
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as t}from"./runtime-chunk-
|
|
1
|
+
import{a as t}from"./runtime-chunk-EXHKTSKP.js";import"./runtime-chunk-YQNSWRUG.js";import"./runtime-chunk-PPYPL2FA.js";import"./runtime-chunk-6MXQXGJV.js";import{ea as e}from"./runtime-chunk-GDQWREZV.js";import"./runtime-chunk-4YV3EXSU.js";import"./runtime-chunk-NSD7DU3P.js";import{b as i,e as a}from"./runtime-chunk-NEOF7SBZ.js";import"./runtime-chunk-UEMEFP7N.js";import{b as o}from"./runtime-chunk-RTLL6WIB.js";import"./runtime-chunk-2PT2WH66.js";import"./runtime-chunk-HUXCP2PU.js";import{a as r}from"./runtime-chunk-TZCHGFVF.js";import"./runtime-chunk-JBTA64YE.js";import{Cc as s,Ec as n,Fc as d}from"./runtime-chunk-BVVSZMXD.js";import"./runtime-chunk-ML3Z74BL.js";var h=(()=>{let t,e,i,a,o=!1;function r(i){!t&&!l()&&(e?.sharedGameControlGlobals.createdObjects.length??0)>0&&(t=requestAnimationFrame(s)),i&&(e=i,a=i.requestRender,!o&&typeof document<"u"&&(document.addEventListener("visibilitychange",n),o=!0))}function s(o){if(!e||!a)return t=void 0,void(i=void 0);let r=i?o-i:0,n=e.sharedGameControlGlobals.createdObjects,d=e.sharedGameControlGlobals.nCreatedPerAction,h=n.length,l=0;for(;l<h;){let t=n[l];void 0===t.userData.createdTime&&(t.userData.createdTime=o),void 0===t.userData.lifetime&&void 0===t.userData.quantity||t.userData.lifetime&&o-t.userData.createdTime<t.userData.lifetime||t.userData.quantity&&d[t.userData.actionId]<=t.userData.quantity?(t.userData.velocity&&(t.position.addScaledVector(t.userData.velocity,r/1e3),t.updateMatrix(),a()),l++):(d[t.userData.actionId]>t.userData.quantity&&d[t.userData.actionId]--,n.splice(l,1),t.removeFromParent(),e.sharedGameControlGlobals.rapierWorld&&t.rigidBody?(e.sharedGameControlGlobals.colliderToEntity.delete(t.rigidBody.collider(0).handle),e.sharedGameControlGlobals.rapierWorld.removeRigidBody(t.rigidBody)):(t.bvhGeometry=void 0,e.sharedGameControlGlobals.entitiesWithTransformAnim=e.sharedGameControlGlobals.entitiesWithTransformAnim.filter(t=>void 0!==t.bvhGeometry)),h--,a())}t=l>0?requestAnimationFrame(s):void 0,i=l>0?o:void 0}function n(){l()?t&&(cancelAnimationFrame(t),t=void 0,i=void 0):r()}return{play:r,dispose:function(){t&&(cancelAnimationFrame(t),t=void 0),o&&typeof document<"u"&&(document.removeEventListener("visibilitychange",n),o=!1),e=void 0,a=void 0,i=void 0}}})();function l(){return!!document&&document.hidden}var c=new n,u=new d,m=new d,p=class{constructor(i,r,n,l,p){this.data=i,this.page=r,this.controlsManager=n,this.shared=l,this.condition=p,this.intervalId=null,this.timeoutIdQueue=[],this.uniqueId=s.generateUUID(),this.dispatch=()=>{if(!1===a(this.shared,this.condition))return!1;this.data.delay?this.timeoutIdQueue.push(window.setTimeout(this.dispatchInner,1e3*this.data.delay)):this.dispatchInner()},this.dispatchFromStart=()=>{if(!1===a(this.shared,this.condition))return!1;this.timeoutIdQueue.push(window.setTimeout(this.dispatchInner,1e3*this.data.delay))},this.dispatchThrottled=o(this.dispatch,1e3/this.data.creationSpeed),this.dispatchStart=()=>{null===this.intervalId&&(this.intervalId=window.setInterval(this.dispatch,1e3/this.data.creationSpeed))},this.dispatchStop=()=>{null!==this.intervalId&&(window.clearInterval(this.intervalId),this.intervalId=null)},this.dispatchInner=()=>{this.timeoutIdQueue.shift();let t=new e(this.object);if(t.playModeVisible=!0,t.expand(),"world"!==this.data.coordinateSystem){let e=this.data.coordinateSystem,i=this.page.scene.find(e);i&&(i.updateMatrixWorldRigid(),t.hiddenMatrix.copy(i.matrixWorldRigid))}t.scale.copy(this.object.scale),t.position.fromArray(this.data.position.map(t=>"number"==typeof t?t:0)),t.rotation.fromArray(this.data.rotation.map(t=>"number"==typeof t?t:0)),t.updateMatrix(),this.page.add(t);let i=this.controlsManager.sharedGameControlGlobals;i.createdObjects.push(t),void 0===i.nCreatedPerAction[this.uniqueId]?i.nCreatedPerAction[this.uniqueId]=1:i.nCreatedPerAction[this.uniqueId]++,t.updateWorldMatrix(!0,!0),t.traverseObject(this.traverseObjectCB),h.play(),this.controlsManager.requestRender()},this.traverseObjectCB=i=>{let a;if(i.hasNonUniformScale&&i.updateMatrixWorldRigid(),this.controlsManager.sharedGameControlGlobals.rapierWorld){if(i instanceof t){if(!i.objectForSample)return!0===i.object.dataPatched.physics.fusedBody&&"dynamic"===i.object.dataPatched.physics.rigidBody||void 0;if(i.objectForSample.dataPatched.physics.fusedBody)return;a=i.object}else if(i instanceof e)a=i.object;else if(a=i,a.dataPatched.cloner?.hideBase)return!0}else{if(i instanceof t)return;a=i instanceof e?i.object:i}"Time"===this.data.destroy?i.userData.lifetime=1e3*this.data.lifetime:"Quantity"===this.data.destroy&&(i.userData.quantity=this.data.destroyAfterQuantity,i.userData.actionId=this.uniqueId);let o=(new d).fromArray(this.data.velocity.map(t=>"number"==typeof t?t:0)),r=a.dataPatched;if(!("visibility"===r.physics.enabled?!r.visible:!r.physics.enabled)&&(this.controlsManager.sharedGameControlGlobals.rapierWorld?(this.controlsManager.addRigidBody(i,a,{fromCreate:!0,dynamic:this.data.dynamic}),"Collision"===this.data.destroy&&(i.rigidBody?.collider(0).setActiveEvents(1),i.userData.hasCollisionDestroy=!0),i.matrixWorld.decompose(u,c,m),o.applyQuaternion(c),this.data.velocity.some(t=>0!==t)&&this.data.dynamic&&i.rigidBody?.setLinvel(o.divideScalar(this.controlsManager.pixelsPerMeter),!0)):("geometry"in i.object&&this.controlsManager.addBoundsTree(i),this.data.velocity.some(t=>0!==t)&&this.data.dynamic&&(i.userData.velocity=o)),!0===a.dataPatched.physics?.fusedBody))return!0};let y=this.page.scene.find(this.data.object);if(!y)throw new Error("Missing Property");if(this.object=y,"world"!==this.data.coordinateSystem&&!this.page.scene.find(this.data.coordinateSystem))throw new Error("Missing Property");h.play(n)}dispose(){null!==this.intervalId&&(window.clearInterval(this.intervalId),this.intervalId=null),this.timeoutIdQueue.forEach(t=>window.clearTimeout(t)),this.timeoutIdQueue=[],this.dispatchThrottled.cancel(),this.page.remove(...this.controlsManager.sharedGameControlGlobals.createdObjects),this.controlsManager.sharedGameControlGlobals.createdObjects=[],h.dispose()}},y=class{constructor(t,e,i,a,o){this.data=t,this.page=e,this.controlsManager=i,this.shared=a,this.condition=o,this.timeoutIdQueue=[],this.dispatchInner=()=>{this.objects.forEach(this.destroyCallback)},this.destroyCallback=t=>{this.timeoutIdQueue.shift();let e=this.page.scene.find(t);if(void 0===e)return;let i=this.controlsManager.sharedGameControlGlobals.rapierWorld,a=!i||e.dataPatched.physics?.fusedBody;if(e.cloner){for(let t of e.cloner.children)a?(t.playModeVisible=!1,"positioned"===e.dataPatched.physics?.rigidBody&&this.removeBody(t),t.bvhGeometry&&(t.bvhGeometry=void 0)):void 0===this.clone||this.clone===t?(t.playModeVisible=!1,this.removeBody(t)):void 0===t.playModeVisible&&(t.playModeVisible=!0);e.cloner.syncInstanceMatrices(),(a||void 0===this.clone||!1===this.clone)&&(e.visible=!1,this.removeBody(e),e.bvhGeometry&&(e.bvhGeometry=void 0))}else this.removeBody(e),e.bvhGeometry&&(e.bvhGeometry=void 0),e.visible=!1;this.controlsManager.sharedGameControlGlobals.entitiesWithTransformAnim=void 0===i?this.controlsManager.sharedGameControlGlobals.entitiesWithTransformAnim.filter(t=>void 0!==t.bvhGeometry):this.controlsManager.sharedGameControlGlobals.entitiesWithTransformAnim.filter(t=>void 0!==t.rigidBody),e.destroyedInAction=!0,this.controlsManager.requestRender()},this.objects=[...t.objects]}removeBody(t){let e=t.rigidBody;if(!e)return;let i=this.controlsManager.sharedGameControlGlobals;i.colliderToEntity.delete(e.collider(0).handle),i.kinematicBodyToEntity.delete(e.handle);let a=this.controlsManager;a.fixedBodiesToWatch=a.fixedBodiesToWatch.filter(([,t])=>t!==e),i.rapierWorld.removeRigidBody(e),t.rigidBody=void 0}dispatch(t){if(!1===a(this.shared,this.condition))return!1;this.clone=t,this.data.delay?this.timeoutIdQueue.push(window.setTimeout(this.dispatchInner,1e3*this.data.delay)):this.dispatchInner()}dispatchFromStart(){if(!1===a(this.shared,this.condition))return!1;this.timeoutIdQueue.push(window.setTimeout(this.dispatchInner,1e3*this.data.delay))}dispose(){this.timeoutIdQueue.forEach(t=>window.clearTimeout(t))}};i("Create",({data:t,page:e,eventManager:i,shared:a,actionCondition:o})=>new p(t,e,i.controlsManager,a,o)),i("Destroy",({data:t,page:e,eventManager:i,shared:a,actionCondition:o})=>new y(t,e,i.controlsManager,a,o)),r("create-destroy");
|
|
Binary file
|
|
Binary file
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as e}from"./runtime-chunk-LGDFMPZV.js";import"./runtime-chunk-3IZ67XSS.js";import{a as t}from"./runtime-chunk-UIRA2CWJ.js";import"./runtime-chunk-Y3BMDVJ7.js";import{Bc as r,Db as n,Dc as i,Fc as s,Ib as a,Jc as l,Lc as o,Le as h,Oc as u,Tc as c,Vc as f,Zc as d,ce as g,dd as p,ld as v,m as y,qa as m,ua as x,we as w,xe as b}from"./runtime-chunk-BVVSZMXD.js";import{c as F}from"./runtime-chunk-ML3Z74BL.js";var C="varying vec2 vUv;void main(){vUv=position.xy*0.5+0.5;gl_Position=vec4(position.xy,1.0,1.0);}",S=class extends g{constructor(e=!1,t=!1){super({name:"BokehMaterial",defines:{PASS:e?"2":"1"},uniforms:{kernel64:new h(null),kernel16:new h(null),inputBuffer:new h(null),cocBuffer:new h(null),texelSize:new h(new i),scale:new h(1)},blending:y,depthWrite:!1,depthTest:!1,fragmentShader:"#ifdef FRAMEBUFFER_PRECISION_HIGH\nuniform mediump sampler2D inputBuffer;\n#else\nuniform lowp sampler2D inputBuffer;\n#endif\nuniform lowp sampler2D cocBuffer;uniform vec2 texelSize;uniform float scale;uniform vec4 kernel64[32];varying vec2 vUv;void main(){\n#ifdef FOREGROUND\nvec2 CoCNearFar=texture2D(cocBuffer,vUv).rg;float CoC=CoCNearFar.r*scale;\n#else\nfloat CoC=texture2D(cocBuffer,vUv).g*scale;\n#endif\nif(CoC==0.0){gl_FragColor=texture2D(inputBuffer,vUv);}else{\n#ifdef FOREGROUND\nvec2 step=texelSize*max(CoC,CoCNearFar.g*scale);\n#else\nvec2 step=texelSize*CoC;\n#endif\nvec4 acc=vec4(0.0);for(int i=0;i<32;++i){vec4 kernel=kernel64[i];vec2 uv=step*kernel.xy+vUv;acc+=texture2D(inputBuffer,uv);uv=step*kernel.zw+vUv;acc+=texture2D(inputBuffer,uv);}gl_FragColor=acc/64.0;}}",vertexShader:C}),this.toneMapped=!1,t&&(this.defines.FOREGROUND="1"),this.generateKernel()}set inputBuffer(e){this.uniforms.inputBuffer.value=e}setInputBuffer(e){this.uniforms.inputBuffer.value=e}set cocBuffer(e){this.uniforms.cocBuffer.value=e}setCoCBuffer(e){this.uniforms.cocBuffer.value=e}get scale(){return this.uniforms.scale.value}set scale(e){this.uniforms.scale.value=e}getScale(e){return this.uniforms.scale.value=e}setScale(e){this.uniforms.scale.value=e}generateKernel(){let e=new Float32Array(128),t=new Float32Array(32),r=0,n=0;for(let i=0;i<80;++i){let s=2.39996323*i,a=Math.sqrt(i)/Math.sqrt(80),l=a*Math.cos(s),o=a*Math.sin(s);i%5==0?(t[n++]=l,t[n++]=o):(e[r++]=l,e[r++]=o)}let i=[],s=[];for(let t=0;t<128;)i.push(new l(e[t++],e[t++],e[t++],e[t++]));for(let e=0;e<32;)s.push(new l(t[e++],t[e++],t[e++],t[e++]));this.uniforms.kernel64.value=i,this.uniforms.kernel16.value=s}setTexelSize(e,t){this.uniforms.texelSize.value.set(e,t)}setSize(e,t){this.uniforms.texelSize.value.set(1/e,1/t)}};function A(e,t,r){return e*(t-r)-t}function B(e,t,r){return Math.min(Math.max((e+t)/(t-r),0),1)}var T=class extends g{constructor(e){super({name:"CircleOfConfusionMaterial",defines:{DEPTH_PACKING:"0"},uniforms:{depthBuffer:new h(null),focusDistance:new h(0),focusRange:new h(0),cameraNear:new h(.3),cameraFar:new h(1e3)},blending:y,depthWrite:!1,depthTest:!1,fragmentShader:"#include <common>\n#include <packing>\n#ifdef GL_FRAGMENT_PRECISION_HIGH\nuniform highp sampler2D depthBuffer;\n#else\nuniform mediump sampler2D depthBuffer;\n#endif\nuniform float focusDistance;uniform float focusRange;uniform float cameraNear;uniform float cameraFar;varying vec2 vUv;float readDepth(const in vec2 uv){\n#if DEPTH_PACKING == 3201\nreturn unpackRGBAToDepth(texture2D(depthBuffer,uv));\n#else\nreturn texture2D(depthBuffer,uv).r;\n#endif\n}void main(){float depth=readDepth(vUv);\n#ifdef PERSPECTIVE_CAMERA\nfloat viewZ=perspectiveDepthToViewZ(depth,cameraNear,cameraFar);float linearDepth=viewZToOrthographicDepth(viewZ,cameraNear,cameraFar);\n#else\nfloat linearDepth=depth;\n#endif\nfloat signedDistance=linearDepth-focusDistance;float magnitude=smoothstep(0.0,focusRange,abs(signedDistance));gl_FragColor.rg=magnitude*vec2(step(signedDistance,0.0),step(0.0,signedDistance));}",vertexShader:C}),this.toneMapped=!1,this.uniforms.focalLength=this.uniforms.focusRange,this.adoptCameraSettings(e)}get near(){return this.uniforms.cameraNear.value}get far(){return this.uniforms.cameraFar.value}set depthBuffer(e){this.uniforms.depthBuffer.value=e}set depthPacking(e){this.defines.DEPTH_PACKING=e.toFixed(0),this.needsUpdate=!0}setDepthBuffer(e,t=n){this.depthBuffer=e,this.depthPacking=t}get focusDistance(){return this.uniforms.focusDistance.value}set focusDistance(e){this.uniforms.focusDistance.value=e}get worldFocusDistance(){return-A(this.focusDistance,this.near,this.far)}set worldFocusDistance(e){this.focusDistance=B(-e,this.near,this.far)}getFocusDistance(e){this.uniforms.focusDistance.value=e}setFocusDistance(e){this.uniforms.focusDistance.value=e}get focalLength(){return this.focusRange}set focalLength(e){this.focusRange=e}get focusRange(){return this.uniforms.focusRange.value}set focusRange(e){this.uniforms.focusRange.value=e}get worldFocusRange(){return-A(this.focusRange,this.near,this.far)}set worldFocusRange(e){this.focusRange=B(-e,this.near,this.far)}getFocalLength(e){return this.focusRange}setFocalLength(e){this.focusRange=e}adoptCameraSettings(e){e&&(this.uniforms.cameraNear.value=e.near,this.uniforms.cameraFar.value=e.far,e instanceof b?this.defines.PERSPECTIVE_CAMERA="1":delete this.defines.PERSPECTIVE_CAMERA,this.needsUpdate=!0)}},k=class extends g{constructor(e=new i){super({name:"KawaseBlurMaterial",uniforms:{inputBuffer:new h(null),texelSize:new h(new i),halfTexelSize:new h(new i),kernel:new h(0),scale:new h(1)},blending:y,depthWrite:!1,depthTest:!1,fragmentShader:"#include <common>\n#include <dithering_pars_fragment>\n#ifdef FRAMEBUFFER_PRECISION_HIGH\nuniform mediump sampler2D inputBuffer;\n#else\nuniform lowp sampler2D inputBuffer;\n#endif\nvarying vec2 vUv0;varying vec2 vUv1;varying vec2 vUv2;varying vec2 vUv3;void main(){vec4 sum=texture2D(inputBuffer,vUv0);sum+=texture2D(inputBuffer,vUv1);sum+=texture2D(inputBuffer,vUv2);sum+=texture2D(inputBuffer,vUv3);gl_FragColor=sum*0.25;\n#include <colorspace_fragment>\n#include <dithering_fragment>\n}",vertexShader:"uniform vec2 texelSize;uniform vec2 halfTexelSize;uniform float kernel;uniform float scale;varying vec2 vUv0;varying vec2 vUv1;varying vec2 vUv2;varying vec2 vUv3;void main(){vec2 uv=position.xy*0.5+0.5;vec2 dUv=(texelSize*vec2(kernel)+halfTexelSize)*scale;vUv0=vec2(uv.x-dUv.x,uv.y+dUv.y);vUv1=vec2(uv.x+dUv.x,uv.y+dUv.y);vUv2=vec2(uv.x+dUv.x,uv.y-dUv.y);vUv3=vec2(uv.x-dUv.x,uv.y-dUv.y);gl_Position=vec4(position.xy,1.0,1.0);}"}),this.toneMapped=!1,this.setTexelSize(e.x,e.y)}set inputBuffer(e){this.uniforms.inputBuffer.value=e}setInputBuffer(e){this.inputBuffer=e}get scale(){return this.uniforms.scale.value}set scale(e){this.uniforms.scale.value=e}getScale(){return this.uniforms.scale.value}setScale(e){this.uniforms.scale.value=e}getKernel(){return null}get kernel(){return this.uniforms.kernel.value}set kernel(e){this.uniforms.kernel.value=e}setKernel(e){this.kernel=e}setTexelSize(e,t){this.uniforms.texelSize.value.set(e,t),this.uniforms.halfTexelSize.value.set(e,t).multiplyScalar(.5)}setSize(e,t){let r=this.uniforms;r.texelSize.value.set(1/e,1/t),r.halfTexelSize.value.copy(r.texelSize.value).multiplyScalar(.5)}},M=class extends g{constructor(e=null){super({name:"MaskMaterial",uniforms:{maskTexture:new h(e),inputBuffer:new h(null),strength:new h(1)},blending:y,depthWrite:!1,depthTest:!1,fragmentShader:"#ifdef FRAMEBUFFER_PRECISION_HIGH\nuniform mediump sampler2D inputBuffer;\n#else\nuniform lowp sampler2D inputBuffer;\n#endif\n#ifdef MASK_PRECISION_HIGH\nuniform mediump sampler2D maskTexture;\n#else\nuniform lowp sampler2D maskTexture;\n#endif\n#if MASK_FUNCTION != 0\nuniform float strength;\n#endif\nvarying vec2 vUv;void main(){\n#if COLOR_CHANNEL == 0\nfloat mask=texture2D(maskTexture,vUv).r;\n#elif COLOR_CHANNEL == 1\nfloat mask=texture2D(maskTexture,vUv).g;\n#elif COLOR_CHANNEL == 2\nfloat mask=texture2D(maskTexture,vUv).b;\n#else\nfloat mask=texture2D(maskTexture,vUv).a;\n#endif\n#if MASK_FUNCTION == 0\n#ifdef INVERTED\nmask=step(mask,0.0);\n#else\nmask=1.0-step(mask,0.0);\n#endif\n#else\nmask=clamp(mask*strength,0.0,1.0);\n#ifdef INVERTED\nmask=1.0-mask;\n#endif\n#endif\n#if MASK_FUNCTION == 2\ngl_FragColor=vec4(mask*texture2D(inputBuffer,vUv).rgb,mask);\n#else\ngl_FragColor=mask*texture2D(inputBuffer,vUv);\n#endif\n}",vertexShader:C}),this.toneMapped=!1,this.setColorChannel(0),this.setMaskFunction(0)}set inputBuffer(e){this.uniforms.inputBuffer.value=e}setInputBuffer(e){this.uniforms.inputBuffer.value=e}set maskTexture(e){this.uniforms.maskTexture.value=e,delete this.defines.MASK_PRECISION_HIGH,e.type!==x&&(this.defines.MASK_PRECISION_HIGH="1"),this.needsUpdate=!0}setMaskTexture(e){this.maskTexture=e}set colorChannel(e){this.defines.COLOR_CHANNEL=e.toFixed(0),this.needsUpdate=!0}setColorChannel(e){this.colorChannel=e}set maskFunction(e){this.defines.MASK_FUNCTION=e.toFixed(0),this.needsUpdate=!0}setMaskFunction(e){this.maskFunction=e}get inverted(){return void 0!==this.defines.INVERTED}set inverted(e){this.inverted&&!e?delete this.defines.INVERTED:e&&(this.defines.INVERTED="1"),this.needsUpdate=!0}isInverted(){return this.inverted}setInverted(e){this.inverted=e}get strength(){return this.uniforms.strength.value}set strength(e){this.uniforms.strength.value=e}getStrength(){return this.strength}setStrength(e){this.strength=e}},U=new w,D=null,P=class{constructor(e="Pass",t=new f,r=U){this.name=e,this.renderer=null,this.scene=t,this.camera=r,this.screen=null,this.rtt=!0,this.needsSwap=!0,this.needsDepthTexture=!1,this.enabled=!0}get renderToScreen(){return!this.rtt}set renderToScreen(e){if(this.rtt===e){let t=this.getFullscreenMaterial();null!==t&&(t.needsUpdate=!0),this.rtt=!e}}setRenderer(e){this.renderer=e}isEnabled(){return this.enabled}setEnabled(e){this.enabled=e}get fullscreenMaterial(){return null!==this.screen?this.screen.material:null}set fullscreenMaterial(e){let t=this.screen;null!==t?t.material=e:(t=new v(function(){if(null===D){let e=new Float32Array([-1,-1,0,3,-1,0,-1,3,0]),t=new Float32Array([0,0,2,0,0,2]);void 0!==(D=new p).setAttribute?(D.setAttribute("position",new d(e,3)),D.setAttribute("uv",new d(t,2))):(D.addAttribute("position",new d(e,3)),D.addAttribute("uv",new d(t,2)))}return D}(),e),t.frustumCulled=!1,null===this.scene&&(this.scene=new f),this.scene.add(t),this.screen=t)}getFullscreenMaterial(){return this.fullscreenMaterial}setFullscreenMaterial(e){this.fullscreenMaterial=e}getDepthTexture(){return null}setDepthTexture(e,t=n){}render(e,t,r,n,i){throw new Error("Render method not implemented!")}setSize(e,t){}initialize(e,t,r){}dispose(){for(let e of Object.keys(this)){let t=this[e];if(null!==t&&"object"==typeof t&&"function"==typeof t.dispose){if(t instanceof f||t===this.renderer)continue;this[e].dispose()}}}},E=(new c,-1),R=class extends r{constructor(e,t=E,r=E,n=1){super(),this.resizable=e,this.base=new i(1,1),this.preferred=new i(t,r),this.target=this.preferred,this.s=n}get width(){let e,{base:t,preferred:r,scale:n}=this;return e=r.width!==E?r.width:r.height!==E?Math.round(r.height*(t.width/Math.max(t.height,1))):Math.round(t.width*n),e}set width(e){this.preferredWidth=e}get height(){let e,{base:t,preferred:r,scale:n}=this;return e=r.height!==E?r.height:r.width!==E?Math.round(r.width/Math.max(t.width/Math.max(t.height,1),1)):Math.round(t.height*n),e}set height(e){this.preferredHeight=e}getWidth(){return this.width}getHeight(){return this.height}get scale(){return this.s}set scale(e){this.s!==e&&(this.s=e,this.preferred.setScalar(E),this.dispatchEvent({type:"change"}),this.resizable.setSize(this.base.width,this.base.height))}getScale(){return this.scale}setScale(e){this.scale=e}get baseWidth(){return this.base.width}set baseWidth(e){this.base.width!==e&&(this.base.width=e,this.dispatchEvent({type:"change"}),this.resizable.setSize(this.base.width,this.base.height))}getBaseWidth(){return this.base.width}setBaseWidth(e){this.base.width!==e&&(this.base.width=e,this.dispatchEvent({type:"change"}),this.resizable.setSize(this.base.width,this.base.height))}get baseHeight(){return this.base.height}set baseHeight(e){this.base.height!==e&&(this.base.height=e,this.dispatchEvent({type:"change"}),this.resizable.setSize(this.base.width,this.base.height))}getBaseHeight(){return this.baseHeight}setBaseHeight(e){this.baseHeight=e}setBaseSize(e,t){(this.base.width!==e||this.base.height!==t)&&(this.base.set(e,t),this.dispatchEvent({type:"change"}),this.resizable.setSize(this.base.width,this.base.height))}get preferredWidth(){return this.preferred.width}set preferredWidth(e){this.preferred.width!==e&&(this.preferred.width=e,this.dispatchEvent({type:"change"}),this.resizable.setSize(this.base.width,this.base.height))}getPreferredWidth(){return this.preferredWidth}setPreferredWidth(e){this.preferredWidth=e}get preferredHeight(){return this.preferred.height}set preferredHeight(e){this.preferred.height!==e&&(this.preferred.height=e,this.dispatchEvent({type:"change"}),this.resizable.setSize(this.base.width,this.base.height))}getPreferredHeight(){return this.preferredHeight}setPreferredHeight(e){this.preferredHeight=e}setPreferredSize(e,t){(this.preferred.width!==e||this.preferred.height!==t)&&(this.preferred.set(e,t),this.dispatchEvent({type:"change"}),this.resizable.setSize(this.base.width,this.base.height))}copy(e){this.base.set(e.getBaseWidth(),e.getBaseHeight()),this.preferred.set(e.getPreferredWidth(),e.getPreferredHeight()),this.dispatchEvent({type:"change"}),this.resizable.setSize(this.base.width,this.base.height)}static get AUTO_SIZE(){return E}},z=(new Float32Array([255/256/256**3,255/256/65536,255/256/256,255/256]),13),N=new Map([[0,null],[1,"vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return min(x+y,1.0)*opacity+x*(1.0-opacity);}"],[2,"vec3 blend(const in vec3 x,const in vec3 y,const in float opacity){return y*opacity+x*(1.0-opacity);}vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){float a=min(y.a,opacity);return vec4(blend(x.rgb,y.rgb,a),max(x.a,a));}"],[3,"vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return(x+y)*0.5*opacity+x*(1.0-opacity);}"],[4,"float blend(const in float x,const in float y){return(y==0.0)?y:max(1.0-(1.0-x)/y,0.0);}vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec4 z=vec4(blend(x.r,y.r),blend(x.g,y.g),blend(x.b,y.b),blend(x.a,y.a));return z*opacity+x*(1.0-opacity);}"],[5,"float blend(const in float x,const in float y){return(y==1.0)?y:min(x/(1.0-y),1.0);}vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec4 z=vec4(blend(x.r,y.r),blend(x.g,y.g),blend(x.b,y.b),blend(x.a,y.a));return z*opacity+x*(1.0-opacity);}"],[6,"vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return min(x,y)*opacity+x*(1.0-opacity);}"],[7,"vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return abs(x-y)*opacity+x*(1.0-opacity);}"],[8,"vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return(x+y-2.0*x*y)*opacity+x*(1.0-opacity);}"],[9,"vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return max(x,y)*opacity+x*(1.0-opacity);}"],[10,"vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return x*y*opacity+x*(1.0-opacity);}"],[11,"float blend(const in float x,const in float y){return(y>0.0)?min(x/y,1.0):1.0;}vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec4 z=vec4(blend(x.r,y.r),blend(x.g,y.g),blend(x.b,y.b),blend(x.a,y.a));return z*opacity+x*(1.0-opacity);}"],[12,"vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return(1.0-abs(1.0-x-y))*opacity+x*(1.0-opacity);}"],[z,"vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return y*opacity+x*(1.0-opacity);}"],[14,"float blend(const in float x,const in float y){return(x<0.5)?(2.0*x*y):(1.0-2.0*(1.0-x)*(1.0-y));}vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec4 z=vec4(blend(x.r,y.r),blend(x.g,y.g),blend(x.b,y.b),blend(x.a,y.a));return z*opacity+x*(1.0-opacity);}"],[15,"float blend(const in float x,const in float y){return(y==1.0)?y:min(x*x/(1.0-y),1.0);}vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec4 z=vec4(blend(x.r,y.r),blend(x.g,y.g),blend(x.b,y.b),blend(x.a,y.a));return z*opacity+x*(1.0-opacity);}"],[16,"vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return(1.0-(1.0-x)*(1.0-y))*opacity+x*(1.0-opacity);}"],[17,"float blend(const in float x,const in float y){return(y<0.5)?(2.0*x*y+x*x*(1.0-2.0*y)):(sqrt(x)*(2.0*y-1.0)+2.0*x*(1.0-y));}vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec4 z=vec4(blend(x.r,y.r),blend(x.g,y.g),blend(x.b,y.b),blend(x.a,y.a));return z*opacity+x*(1.0-opacity);}"],[18,"vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return max(x+y-1.0,0.0)*opacity+x*(1.0-opacity);}"]]),I=class extends r{constructor(e,t=1){super(),this.f=e,this.opacity=new h(t)}getOpacity(){return this.opacity.value}setOpacity(e){this.opacity.value=e}get blendFunction(){return this.f}set blendFunction(e){this.f=e,this.dispatchEvent({type:"change"})}getBlendFunction(){return this.blendFunction}setBlendFunction(e){this.blendFunction=e}getShaderCode(){return N.get(this.blendFunction)}},O=class extends r{constructor(e,t,{attributes:r=0,blendFunction:n=16,defines:i=new Map,uniforms:s=new Map,extensions:a=null,vertexShader:l=null}={}){super(),this.name=e,this.renderer=null,this.attributes=r,this.fragmentShader=t,this.vertexShader=l,this.defines=i,this.uniforms=s,this.extensions=a,this.blendMode=new I(n),this.blendMode.addEventListener("change",e=>this.setChanged())}getName(){return this.name}setRenderer(e){this.renderer=e}getDefines(){return this.defines}getUniforms(){return this.uniforms}getExtensions(){return this.extensions}getBlendMode(){return this.blendMode}getAttributes(){return this.attributes}setAttributes(e){this.attributes=e,this.setChanged()}getFragmentShader(){return this.fragmentShader}setFragmentShader(e){this.fragmentShader=e,this.setChanged()}getVertexShader(){return this.vertexShader}setVertexShader(e){this.vertexShader=e,this.setChanged()}setChanged(){this.dispatchEvent({type:"change"})}setDepthTexture(e,t=n){}update(e,t,r){}setSize(e,t){}initialize(e,t,r){}dispose(){for(let e of Object.keys(this)){let t=this[e];if(null!==t&&"object"==typeof t&&"function"==typeof t.dispose){if(t instanceof f||t===this.renderer)continue;this[e].dispose()}}}},_=[new Float32Array([0,0]),new Float32Array([0,1,1]),new Float32Array([0,1,1,2]),new Float32Array([0,1,2,2,3]),new Float32Array([0,1,2,3,4,4,5]),new Float32Array([0,1,2,3,4,5,7,8,9,10])],H=class extends P{constructor({resolutionScale:e=.5,width:t=R.AUTO_SIZE,height:r=R.AUTO_SIZE,kernelSize:n=G.LARGE}={}){super("KawaseBlurPass"),this.renderTargetA=new o(1,1,{minFilter:m,magFilter:m,stencilBuffer:!1,depthBuffer:!1}),this.renderTargetA.texture.name="Blur.Target.A",this.renderTargetB=this.renderTargetA.clone(),this.renderTargetB.texture.name="Blur.Target.B";let i=this.resolution=new R(this,t,r,e);i.addEventListener("change",e=>this.setSize(i.baseWidth,i.baseHeight)),this.blurMaterial=new k,this.ditheredBlurMaterial=new k,this.ditheredBlurMaterial.uniforms.scale=this.blurMaterial.uniforms.scale,this.ditheredBlurMaterial.dithering=!0,this.dithering=!1,this.kernelSize=n}getResolution(){return this.resolution}get width(){return this.resolution.width}set width(e){this.resolution.preferredWidth=e}get height(){return this.resolution.height}set height(e){this.resolution.preferredHeight=e}get scale(){return this.blurMaterial.scale}set scale(e){this.blurMaterial.scale=e}getScale(){return this.blurMaterial.scale}setScale(e){this.blurMaterial.scale=e}getKernelSize(){return this.kernelSize}setKernelSize(e){this.kernelSize=e}getResolutionScale(){return this.resolution.scale}setResolutionScale(e){this.resolution.scale=e}render(e,t,r,n,i){let s,a,l=this.scene,o=this.camera,h=this.renderTargetA,u=this.renderTargetB,c=_[this.kernelSize],f=this.blurMaterial,d=t;for(this.fullscreenMaterial=f,s=0,a=c.length-1;s<a;++s){let t=1&s?u:h;f.kernel=c[s],f.inputBuffer=d.texture,e.setRenderTarget(t),e.render(l,o),d=t}this.dithering&&(f=this.ditheredBlurMaterial,this.fullscreenMaterial=f),f.kernel=c[s],f.inputBuffer=d.texture,e.setRenderTarget(this.renderToScreen?null:r),e.render(l,o)}setSize(e,t){let r=this.resolution;r.setBaseSize(e,t);let n=r.width,i=r.height;this.renderTargetA.setSize(n,i),this.renderTargetB.setSize(n,i),this.blurMaterial.setSize(n,i),this.ditheredBlurMaterial.setSize(n,i)}initialize(e,t,r){void 0!==r&&(this.renderTargetA.texture.type=r,this.renderTargetB.texture.type=r,r!==x?(this.blurMaterial.defines.FRAMEBUFFER_PRECISION_HIGH="1",this.ditheredBlurMaterial.defines.FRAMEBUFFER_PRECISION_HIGH="1"):e.outputColorSpace===a&&(this.renderTargetA.texture.colorSpace=a,this.renderTargetB.texture.colorSpace=a))}static get AUTO_SIZE(){return R.AUTO_SIZE}},L=class extends P{constructor(e,t="inputBuffer"){super("ShaderPass"),this.fullscreenMaterial=e,this.inputBufferUniform=null,this.setInput(t)}setInput(e){if(this.inputBufferUniform=null,null!==this.fullscreenMaterial){let t=this.fullscreenMaterial.uniforms;void 0!==t&&void 0!==t[e]&&(this.inputBufferUniform=t[e])}}render(e,t,r,n,i){null!==this.inputBufferUniform&&null!==t&&(this.inputBufferUniform.value=t.texture),e.setRenderTarget(this.renderToScreen?null:r),e.render(this.scene,this.camera)}initialize(e,t,r){void 0!==r&&r!==x&&(this.fullscreenMaterial.defines.FRAMEBUFFER_PRECISION_HIGH="1")}},G={VERY_SMALL:0,SMALL:1,MEDIUM:2,LARGE:3,VERY_LARGE:4,HUGE:5},W=class extends O{constructor(e,{blendFunction:t=z,worldFocusDistance:r,worldFocusRange:n,focusDistance:i=0,focalLength:a=.1,focusRange:l=a,bokehScale:u=1,width:c=R.AUTO_SIZE,height:f=R.AUTO_SIZE}={}){super("DepthOfFieldEffect","#ifdef FRAMEBUFFER_PRECISION_HIGH\nuniform mediump sampler2D nearColorBuffer;uniform mediump sampler2D farColorBuffer;\n#else\nuniform lowp sampler2D nearColorBuffer;uniform lowp sampler2D farColorBuffer;\n#endif\nuniform lowp sampler2D nearCoCBuffer;uniform float scale;void mainImage(const in vec4 inputColor,const in vec2 uv,const in float depth,out vec4 outputColor){vec4 colorNear=texture2D(nearColorBuffer,uv);vec4 colorFar=texture2D(farColorBuffer,uv);float CoCNear=texture2D(nearCoCBuffer,uv).r;CoCNear=min(CoCNear*scale,1.0);vec4 result=inputColor*(1.0-colorFar.a)+colorFar;result=mix(result,colorNear,CoCNear);outputColor=result;}",{blendFunction:t,attributes:1,uniforms:new Map([["nearColorBuffer",new h(null)],["farColorBuffer",new h(null)],["nearCoCBuffer",new h(null)],["scale",new h(1)]])}),F(this,"targetObject"),this.camera=e,this.renderTarget=new o(1,1,{minFilter:m,magFilter:m,stencilBuffer:!1,depthBuffer:!1}),this.renderTarget.texture.name="DoF.Intermediate",this.renderTarget.texture.generateMipmaps=!1,this.renderTargetMasked=this.renderTarget.clone(),this.renderTargetMasked.texture.name="DoF.Masked.Far",this.renderTargetNear=this.renderTarget.clone(),this.renderTargetNear.texture.name="DoF.Bokeh.Near",this.uniforms.get("nearColorBuffer").value=this.renderTargetNear.texture,this.renderTargetFar=this.renderTarget.clone(),this.renderTargetFar.texture.name="DoF.Bokeh.Far",this.uniforms.get("farColorBuffer").value=this.renderTargetFar.texture,this.renderTargetCoC=this.renderTarget.clone(),this.renderTargetCoC.texture.name="DoF.CoC",this.renderTargetCoCBlurred=this.renderTargetCoC.clone(),this.renderTargetCoCBlurred.texture.name="DoF.CoC.Blurred",this.uniforms.get("nearCoCBuffer").value=this.renderTargetCoCBlurred.texture,this.cocPass=new L(new T(e));let d=this.cocMaterial;d.focusDistance=i,d.focusRange=l,void 0!==r&&(d.worldFocusDistance=r),void 0!==n&&(d.worldFocusRange=n),this.blurPass=new H({kernelSize:G.MEDIUM,width:c,height:f});let g=this.blurPass.getResolution();g.addEventListener("change",e=>this.setSize(g.getBaseWidth(),g.getBaseHeight())),this.maskPass=new L(new M(this.renderTargetCoC.texture));let p=this.maskPass.fullscreenMaterial;p.maskFunction=1,p.colorChannel=1,this.bokehNearBasePass=new L(new S(!1,!0)),this.bokehNearBasePass.fullscreenMaterial.cocBuffer=this.renderTargetCoCBlurred.texture,this.bokehNearFillPass=new L(new S(!0,!0)),this.bokehNearFillPass.fullscreenMaterial.cocBuffer=this.renderTargetCoCBlurred.texture,this.bokehFarBasePass=new L(new S(!1,!1)),this.bokehFarBasePass.fullscreenMaterial.cocBuffer=this.renderTargetCoC.texture,this.bokehFarFillPass=new L(new S(!0,!1)),this.bokehFarFillPass.fullscreenMaterial.cocBuffer=this.renderTargetCoC.texture,this.target=new s,this.bokehScale=u}get cocTexture(){return this.renderTargetCoC.texture}get cocMaterial(){return this.cocPass.fullscreenMaterial}get circleOfConfusionMaterial(){return this.cocMaterial}getCircleOfConfusionMaterial(){return this.circleOfConfusionMaterial}getBlurPass(){return this.blurPass}get resolution(){return this.blurPass.getResolution()}getResolution(){return this.blurPass.getResolution()}get bokehScale(){return this.uniforms.get("scale").value}set bokehScale(e){let t=[this.bokehNearBasePass,this.bokehNearFillPass,this.bokehFarBasePass,this.bokehFarFillPass];for(let r of t)r.fullscreenMaterial.setScale(e);this.maskPass.fullscreenMaterial.setStrength(e),this.uniforms.get("scale").value=e}getBokehScale(){return this.bokehScale}setBokehScale(e){this.bokehScale=e}getTarget(){return this.target}setTarget(e){this.target=e}calculateFocusDistance(e){let t=this.camera;return B(-t.position.distanceTo(e),t.near,t.far)}setDepthTexture(e,t=n){this.circleOfConfusionMaterial.depthBuffer=e,this.circleOfConfusionMaterial.depthPacking=t}update(e,t,r){let n=this.renderTarget,i=this.renderTargetCoC,s=this.renderTargetCoCBlurred,a=this.renderTargetMasked;if(this.targetObject&&this.camera){this.target.setFromMatrixPosition(this.targetObject.matrixWorld);let e=this.calculateFocusDistance(this.target);this.circleOfConfusionMaterial.focusDistance=e}this.cocPass.render(e,null,i),this.blurPass.render(e,i,s),this.maskPass.render(e,t,a),this.bokehFarBasePass.render(e,a,n),this.bokehFarFillPass.render(e,n,this.renderTargetFar),this.bokehNearBasePass.render(e,t,n),this.bokehNearFillPass.render(e,n,this.renderTargetNear)}setSize(e,t){let r=this.resolution;r.setBaseSize(e,t);let n=r.width,i=r.height,s=[this.cocPass,this.blurPass,this.maskPass,this.bokehNearBasePass,this.bokehNearFillPass,this.bokehFarBasePass,this.bokehFarFillPass];s.push(this.renderTargetCoC,this.renderTargetMasked),s.forEach(r=>r.setSize(e,t)),s=[this.renderTarget,this.renderTargetNear,this.renderTargetFar,this.renderTargetCoCBlurred],s.forEach(e=>e.setSize(n,i)),[this.bokehNearBasePass,this.bokehNearFillPass,this.bokehFarBasePass,this.bokehFarFillPass].forEach(e=>e.fullscreenMaterial.setSize(n,i))}initialize(e,t,r){[this.cocPass,this.maskPass,this.bokehNearBasePass,this.bokehNearFillPass,this.bokehFarBasePass,this.bokehFarFillPass].forEach(n=>n.initialize(e,t,r)),this.blurPass.initialize(e,t,x),void 0!==r&&(this.renderTarget.texture.type=r,this.renderTargetNear.texture.type=r,this.renderTargetFar.texture.type=r,this.renderTargetMasked.texture.type=r,e.outputColorSpace===a&&(this.renderTarget.texture.colorSpace=a,this.renderTargetNear.texture.colorSpace=a,this.renderTargetFar.texture.colorSpace=a,this.renderTargetMasked.texture.colorSpace=a))}};function K(e,t,r){return e+(t-e)*r}function V(e,t,r,n){let i=K(e,t,.75),s=K(r,n,.75);return K(i,s,.875)}new s,new u,new c,Math.PI,new s,new s,new Float32Array(3),new Float32Array(3),new Float32Array(3),new Float32Array(3),new Float32Array(3),new Float32Array(3),new Float32Array([0,0,0]),new Float32Array([1,0,0]),new Float32Array([1,1,0]),new Float32Array([1,1,1]),new Float32Array([0,0,0]),new Float32Array([1,0,0]),new Float32Array([1,0,1]),new Float32Array([1,1,1]),new Float32Array([0,0,0]),new Float32Array([0,0,1]),new Float32Array([1,0,1]),new Float32Array([1,1,1]),new Float32Array([0,0,0]),new Float32Array([0,1,0]),new Float32Array([1,1,0]),new Float32Array([1,1,1]),new Float32Array([0,0,0]),new Float32Array([0,1,0]),new Float32Array([0,1,1]),new Float32Array([1,1,1]),new Float32Array([0,0,0]),new Float32Array([0,0,1]),new Float32Array([0,1,1]),new Float32Array([1,1,1]),new Float32Array(2),new Float32Array(2),new Float32Array([0,-.25,.25,-.125,.125,-.375,.375]),new Float32Array([0,0]),new Float32Array([.25,-.25]),new Float32Array([-.25,.25]),new Float32Array([.125,-.125]),new Float32Array([-.125,.125]),new Uint8Array([0,0]),new Uint8Array([3,0]),new Uint8Array([0,3]),new Uint8Array([3,3]),new Uint8Array([1,0]),new Uint8Array([4,0]),new Uint8Array([1,3]),new Uint8Array([4,3]),new Uint8Array([0,1]),new Uint8Array([3,1]),new Uint8Array([0,4]),new Uint8Array([3,4]),new Uint8Array([1,1]),new Uint8Array([4,1]),new Uint8Array([1,4]),new Uint8Array([4,4]),new Uint8Array([0,0]),new Uint8Array([1,0]),new Uint8Array([0,2]),new Uint8Array([1,2]),new Uint8Array([2,0]),new Uint8Array([3,0]),new Uint8Array([2,2]),new Uint8Array([3,2]),new Uint8Array([0,1]),new Uint8Array([1,1]),new Uint8Array([0,3]),new Uint8Array([1,3]),new Uint8Array([2,1]),new Uint8Array([3,1]),new Uint8Array([2,3]),new Uint8Array([3,3]),new Map([[V(0,0,0,0),new Float32Array([0,0,0,0])],[V(0,0,0,1),new Float32Array([0,0,0,1])],[V(0,0,1,0),new Float32Array([0,0,1,0])],[V(0,0,1,1),new Float32Array([0,0,1,1])],[V(0,1,0,0),new Float32Array([0,1,0,0])],[V(0,1,0,1),new Float32Array([0,1,0,1])],[V(0,1,1,0),new Float32Array([0,1,1,0])],[V(0,1,1,1),new Float32Array([0,1,1,1])],[V(1,0,0,0),new Float32Array([1,0,0,0])],[V(1,0,0,1),new Float32Array([1,0,0,1])],[V(1,0,1,0),new Float32Array([1,0,1,0])],[V(1,0,1,1),new Float32Array([1,0,1,1])],[V(1,1,0,0),new Float32Array([1,1,0,0])],[V(1,1,0,1),new Float32Array([1,1,0,1])],[V(1,1,1,0),new Float32Array([1,1,1,0])],[V(1,1,1,1),new Float32Array([1,1,1,1])]]);var Z=class extends e{constructor(e){super(W)}set focalLength(e){this.effect.circleOfConfusionMaterial.uniforms.focalLength.value=e/2e3}get focalLength(){return this.effect.circleOfConfusionMaterial.uniforms.focalLength.value}set focusDistance(e){this.effect.circleOfConfusionMaterial.uniforms.focusDistance.value=this.isPerspectiveCamera?e/2e3:(e+992)/2e3}get focusDistance(){return this.effect.circleOfConfusionMaterial.uniforms.focusDistance.value}get bokehScale(){return this.effect.bokehScale}set bokehScale(e){this.effect.bokehScale=e}setCamera(e){let t=!1;(e.isPerspectiveCamera&&!1===this.isPerspectiveCamera||!e.isPerspectiveCamera&&!0===this.isPerspectiveCamera)&&(t=!0),e.isPerspectiveCamera?(this.effect.circleOfConfusionMaterial.adoptCameraSettings(e.perspCamera),this.isPerspectiveCamera=!0):(this.effect.circleOfConfusionMaterial.adoptCameraSettings(e),this.isPerspectiveCamera=!1),t&&this.effect.setChanged()}};t("depthOfField",()=>new Z);
|
|
1
|
+
import{a as e}from"./runtime-chunk-LTIZNPR7.js";import"./runtime-chunk-EKCMGGVU.js";import{a as t}from"./runtime-chunk-UIRA2CWJ.js";import"./runtime-chunk-4XNHGXFP.js";import{Bc as r,Db as n,Dc as i,Fc as s,Ib as a,Jc as l,Lc as o,Le as h,Oc as u,Tc as c,Vc as f,Zc as d,ce as g,dd as p,ld as v,m as y,qa as m,ua as x,we as w,xe as b}from"./runtime-chunk-BVVSZMXD.js";import{c as F}from"./runtime-chunk-ML3Z74BL.js";var C="varying vec2 vUv;void main(){vUv=position.xy*0.5+0.5;gl_Position=vec4(position.xy,1.0,1.0);}",S=class extends g{constructor(e=!1,t=!1){super({name:"BokehMaterial",defines:{PASS:e?"2":"1"},uniforms:{kernel64:new h(null),kernel16:new h(null),inputBuffer:new h(null),cocBuffer:new h(null),texelSize:new h(new i),scale:new h(1)},blending:y,depthWrite:!1,depthTest:!1,fragmentShader:"#ifdef FRAMEBUFFER_PRECISION_HIGH\nuniform mediump sampler2D inputBuffer;\n#else\nuniform lowp sampler2D inputBuffer;\n#endif\nuniform lowp sampler2D cocBuffer;uniform vec2 texelSize;uniform float scale;uniform vec4 kernel64[32];varying vec2 vUv;void main(){\n#ifdef FOREGROUND\nvec2 CoCNearFar=texture2D(cocBuffer,vUv).rg;float CoC=CoCNearFar.r*scale;\n#else\nfloat CoC=texture2D(cocBuffer,vUv).g*scale;\n#endif\nif(CoC==0.0){gl_FragColor=texture2D(inputBuffer,vUv);}else{\n#ifdef FOREGROUND\nvec2 step=texelSize*max(CoC,CoCNearFar.g*scale);\n#else\nvec2 step=texelSize*CoC;\n#endif\nvec4 acc=vec4(0.0);for(int i=0;i<32;++i){vec4 kernel=kernel64[i];vec2 uv=step*kernel.xy+vUv;acc+=texture2D(inputBuffer,uv);uv=step*kernel.zw+vUv;acc+=texture2D(inputBuffer,uv);}gl_FragColor=acc/64.0;}}",vertexShader:C}),this.toneMapped=!1,t&&(this.defines.FOREGROUND="1"),this.generateKernel()}set inputBuffer(e){this.uniforms.inputBuffer.value=e}setInputBuffer(e){this.uniforms.inputBuffer.value=e}set cocBuffer(e){this.uniforms.cocBuffer.value=e}setCoCBuffer(e){this.uniforms.cocBuffer.value=e}get scale(){return this.uniforms.scale.value}set scale(e){this.uniforms.scale.value=e}getScale(e){return this.uniforms.scale.value=e}setScale(e){this.uniforms.scale.value=e}generateKernel(){let e=new Float32Array(128),t=new Float32Array(32),r=0,n=0;for(let i=0;i<80;++i){let s=2.39996323*i,a=Math.sqrt(i)/Math.sqrt(80),l=a*Math.cos(s),o=a*Math.sin(s);i%5==0?(t[n++]=l,t[n++]=o):(e[r++]=l,e[r++]=o)}let i=[],s=[];for(let t=0;t<128;)i.push(new l(e[t++],e[t++],e[t++],e[t++]));for(let e=0;e<32;)s.push(new l(t[e++],t[e++],t[e++],t[e++]));this.uniforms.kernel64.value=i,this.uniforms.kernel16.value=s}setTexelSize(e,t){this.uniforms.texelSize.value.set(e,t)}setSize(e,t){this.uniforms.texelSize.value.set(1/e,1/t)}};function A(e,t,r){return e*(t-r)-t}function B(e,t,r){return Math.min(Math.max((e+t)/(t-r),0),1)}var T=class extends g{constructor(e){super({name:"CircleOfConfusionMaterial",defines:{DEPTH_PACKING:"0"},uniforms:{depthBuffer:new h(null),focusDistance:new h(0),focusRange:new h(0),cameraNear:new h(.3),cameraFar:new h(1e3)},blending:y,depthWrite:!1,depthTest:!1,fragmentShader:"#include <common>\n#include <packing>\n#ifdef GL_FRAGMENT_PRECISION_HIGH\nuniform highp sampler2D depthBuffer;\n#else\nuniform mediump sampler2D depthBuffer;\n#endif\nuniform float focusDistance;uniform float focusRange;uniform float cameraNear;uniform float cameraFar;varying vec2 vUv;float readDepth(const in vec2 uv){\n#if DEPTH_PACKING == 3201\nreturn unpackRGBAToDepth(texture2D(depthBuffer,uv));\n#else\nreturn texture2D(depthBuffer,uv).r;\n#endif\n}void main(){float depth=readDepth(vUv);\n#ifdef PERSPECTIVE_CAMERA\nfloat viewZ=perspectiveDepthToViewZ(depth,cameraNear,cameraFar);float linearDepth=viewZToOrthographicDepth(viewZ,cameraNear,cameraFar);\n#else\nfloat linearDepth=depth;\n#endif\nfloat signedDistance=linearDepth-focusDistance;float magnitude=smoothstep(0.0,focusRange,abs(signedDistance));gl_FragColor.rg=magnitude*vec2(step(signedDistance,0.0),step(0.0,signedDistance));}",vertexShader:C}),this.toneMapped=!1,this.uniforms.focalLength=this.uniforms.focusRange,this.adoptCameraSettings(e)}get near(){return this.uniforms.cameraNear.value}get far(){return this.uniforms.cameraFar.value}set depthBuffer(e){this.uniforms.depthBuffer.value=e}set depthPacking(e){this.defines.DEPTH_PACKING=e.toFixed(0),this.needsUpdate=!0}setDepthBuffer(e,t=n){this.depthBuffer=e,this.depthPacking=t}get focusDistance(){return this.uniforms.focusDistance.value}set focusDistance(e){this.uniforms.focusDistance.value=e}get worldFocusDistance(){return-A(this.focusDistance,this.near,this.far)}set worldFocusDistance(e){this.focusDistance=B(-e,this.near,this.far)}getFocusDistance(e){this.uniforms.focusDistance.value=e}setFocusDistance(e){this.uniforms.focusDistance.value=e}get focalLength(){return this.focusRange}set focalLength(e){this.focusRange=e}get focusRange(){return this.uniforms.focusRange.value}set focusRange(e){this.uniforms.focusRange.value=e}get worldFocusRange(){return-A(this.focusRange,this.near,this.far)}set worldFocusRange(e){this.focusRange=B(-e,this.near,this.far)}getFocalLength(e){return this.focusRange}setFocalLength(e){this.focusRange=e}adoptCameraSettings(e){e&&(this.uniforms.cameraNear.value=e.near,this.uniforms.cameraFar.value=e.far,e instanceof b?this.defines.PERSPECTIVE_CAMERA="1":delete this.defines.PERSPECTIVE_CAMERA,this.needsUpdate=!0)}},k=class extends g{constructor(e=new i){super({name:"KawaseBlurMaterial",uniforms:{inputBuffer:new h(null),texelSize:new h(new i),halfTexelSize:new h(new i),kernel:new h(0),scale:new h(1)},blending:y,depthWrite:!1,depthTest:!1,fragmentShader:"#include <common>\n#include <dithering_pars_fragment>\n#ifdef FRAMEBUFFER_PRECISION_HIGH\nuniform mediump sampler2D inputBuffer;\n#else\nuniform lowp sampler2D inputBuffer;\n#endif\nvarying vec2 vUv0;varying vec2 vUv1;varying vec2 vUv2;varying vec2 vUv3;void main(){vec4 sum=texture2D(inputBuffer,vUv0);sum+=texture2D(inputBuffer,vUv1);sum+=texture2D(inputBuffer,vUv2);sum+=texture2D(inputBuffer,vUv3);gl_FragColor=sum*0.25;\n#include <colorspace_fragment>\n#include <dithering_fragment>\n}",vertexShader:"uniform vec2 texelSize;uniform vec2 halfTexelSize;uniform float kernel;uniform float scale;varying vec2 vUv0;varying vec2 vUv1;varying vec2 vUv2;varying vec2 vUv3;void main(){vec2 uv=position.xy*0.5+0.5;vec2 dUv=(texelSize*vec2(kernel)+halfTexelSize)*scale;vUv0=vec2(uv.x-dUv.x,uv.y+dUv.y);vUv1=vec2(uv.x+dUv.x,uv.y+dUv.y);vUv2=vec2(uv.x+dUv.x,uv.y-dUv.y);vUv3=vec2(uv.x-dUv.x,uv.y-dUv.y);gl_Position=vec4(position.xy,1.0,1.0);}"}),this.toneMapped=!1,this.setTexelSize(e.x,e.y)}set inputBuffer(e){this.uniforms.inputBuffer.value=e}setInputBuffer(e){this.inputBuffer=e}get scale(){return this.uniforms.scale.value}set scale(e){this.uniforms.scale.value=e}getScale(){return this.uniforms.scale.value}setScale(e){this.uniforms.scale.value=e}getKernel(){return null}get kernel(){return this.uniforms.kernel.value}set kernel(e){this.uniforms.kernel.value=e}setKernel(e){this.kernel=e}setTexelSize(e,t){this.uniforms.texelSize.value.set(e,t),this.uniforms.halfTexelSize.value.set(e,t).multiplyScalar(.5)}setSize(e,t){let r=this.uniforms;r.texelSize.value.set(1/e,1/t),r.halfTexelSize.value.copy(r.texelSize.value).multiplyScalar(.5)}},M=class extends g{constructor(e=null){super({name:"MaskMaterial",uniforms:{maskTexture:new h(e),inputBuffer:new h(null),strength:new h(1)},blending:y,depthWrite:!1,depthTest:!1,fragmentShader:"#ifdef FRAMEBUFFER_PRECISION_HIGH\nuniform mediump sampler2D inputBuffer;\n#else\nuniform lowp sampler2D inputBuffer;\n#endif\n#ifdef MASK_PRECISION_HIGH\nuniform mediump sampler2D maskTexture;\n#else\nuniform lowp sampler2D maskTexture;\n#endif\n#if MASK_FUNCTION != 0\nuniform float strength;\n#endif\nvarying vec2 vUv;void main(){\n#if COLOR_CHANNEL == 0\nfloat mask=texture2D(maskTexture,vUv).r;\n#elif COLOR_CHANNEL == 1\nfloat mask=texture2D(maskTexture,vUv).g;\n#elif COLOR_CHANNEL == 2\nfloat mask=texture2D(maskTexture,vUv).b;\n#else\nfloat mask=texture2D(maskTexture,vUv).a;\n#endif\n#if MASK_FUNCTION == 0\n#ifdef INVERTED\nmask=step(mask,0.0);\n#else\nmask=1.0-step(mask,0.0);\n#endif\n#else\nmask=clamp(mask*strength,0.0,1.0);\n#ifdef INVERTED\nmask=1.0-mask;\n#endif\n#endif\n#if MASK_FUNCTION == 2\ngl_FragColor=vec4(mask*texture2D(inputBuffer,vUv).rgb,mask);\n#else\ngl_FragColor=mask*texture2D(inputBuffer,vUv);\n#endif\n}",vertexShader:C}),this.toneMapped=!1,this.setColorChannel(0),this.setMaskFunction(0)}set inputBuffer(e){this.uniforms.inputBuffer.value=e}setInputBuffer(e){this.uniforms.inputBuffer.value=e}set maskTexture(e){this.uniforms.maskTexture.value=e,delete this.defines.MASK_PRECISION_HIGH,e.type!==x&&(this.defines.MASK_PRECISION_HIGH="1"),this.needsUpdate=!0}setMaskTexture(e){this.maskTexture=e}set colorChannel(e){this.defines.COLOR_CHANNEL=e.toFixed(0),this.needsUpdate=!0}setColorChannel(e){this.colorChannel=e}set maskFunction(e){this.defines.MASK_FUNCTION=e.toFixed(0),this.needsUpdate=!0}setMaskFunction(e){this.maskFunction=e}get inverted(){return void 0!==this.defines.INVERTED}set inverted(e){this.inverted&&!e?delete this.defines.INVERTED:e&&(this.defines.INVERTED="1"),this.needsUpdate=!0}isInverted(){return this.inverted}setInverted(e){this.inverted=e}get strength(){return this.uniforms.strength.value}set strength(e){this.uniforms.strength.value=e}getStrength(){return this.strength}setStrength(e){this.strength=e}},U=new w,D=null,P=class{constructor(e="Pass",t=new f,r=U){this.name=e,this.renderer=null,this.scene=t,this.camera=r,this.screen=null,this.rtt=!0,this.needsSwap=!0,this.needsDepthTexture=!1,this.enabled=!0}get renderToScreen(){return!this.rtt}set renderToScreen(e){if(this.rtt===e){let t=this.getFullscreenMaterial();null!==t&&(t.needsUpdate=!0),this.rtt=!e}}setRenderer(e){this.renderer=e}isEnabled(){return this.enabled}setEnabled(e){this.enabled=e}get fullscreenMaterial(){return null!==this.screen?this.screen.material:null}set fullscreenMaterial(e){let t=this.screen;null!==t?t.material=e:(t=new v(function(){if(null===D){let e=new Float32Array([-1,-1,0,3,-1,0,-1,3,0]),t=new Float32Array([0,0,2,0,0,2]);void 0!==(D=new p).setAttribute?(D.setAttribute("position",new d(e,3)),D.setAttribute("uv",new d(t,2))):(D.addAttribute("position",new d(e,3)),D.addAttribute("uv",new d(t,2)))}return D}(),e),t.frustumCulled=!1,null===this.scene&&(this.scene=new f),this.scene.add(t),this.screen=t)}getFullscreenMaterial(){return this.fullscreenMaterial}setFullscreenMaterial(e){this.fullscreenMaterial=e}getDepthTexture(){return null}setDepthTexture(e,t=n){}render(e,t,r,n,i){throw new Error("Render method not implemented!")}setSize(e,t){}initialize(e,t,r){}dispose(){for(let e of Object.keys(this)){let t=this[e];if(null!==t&&"object"==typeof t&&"function"==typeof t.dispose){if(t instanceof f||t===this.renderer)continue;this[e].dispose()}}}},E=(new c,-1),R=class extends r{constructor(e,t=E,r=E,n=1){super(),this.resizable=e,this.base=new i(1,1),this.preferred=new i(t,r),this.target=this.preferred,this.s=n}get width(){let e,{base:t,preferred:r,scale:n}=this;return e=r.width!==E?r.width:r.height!==E?Math.round(r.height*(t.width/Math.max(t.height,1))):Math.round(t.width*n),e}set width(e){this.preferredWidth=e}get height(){let e,{base:t,preferred:r,scale:n}=this;return e=r.height!==E?r.height:r.width!==E?Math.round(r.width/Math.max(t.width/Math.max(t.height,1),1)):Math.round(t.height*n),e}set height(e){this.preferredHeight=e}getWidth(){return this.width}getHeight(){return this.height}get scale(){return this.s}set scale(e){this.s!==e&&(this.s=e,this.preferred.setScalar(E),this.dispatchEvent({type:"change"}),this.resizable.setSize(this.base.width,this.base.height))}getScale(){return this.scale}setScale(e){this.scale=e}get baseWidth(){return this.base.width}set baseWidth(e){this.base.width!==e&&(this.base.width=e,this.dispatchEvent({type:"change"}),this.resizable.setSize(this.base.width,this.base.height))}getBaseWidth(){return this.base.width}setBaseWidth(e){this.base.width!==e&&(this.base.width=e,this.dispatchEvent({type:"change"}),this.resizable.setSize(this.base.width,this.base.height))}get baseHeight(){return this.base.height}set baseHeight(e){this.base.height!==e&&(this.base.height=e,this.dispatchEvent({type:"change"}),this.resizable.setSize(this.base.width,this.base.height))}getBaseHeight(){return this.baseHeight}setBaseHeight(e){this.baseHeight=e}setBaseSize(e,t){(this.base.width!==e||this.base.height!==t)&&(this.base.set(e,t),this.dispatchEvent({type:"change"}),this.resizable.setSize(this.base.width,this.base.height))}get preferredWidth(){return this.preferred.width}set preferredWidth(e){this.preferred.width!==e&&(this.preferred.width=e,this.dispatchEvent({type:"change"}),this.resizable.setSize(this.base.width,this.base.height))}getPreferredWidth(){return this.preferredWidth}setPreferredWidth(e){this.preferredWidth=e}get preferredHeight(){return this.preferred.height}set preferredHeight(e){this.preferred.height!==e&&(this.preferred.height=e,this.dispatchEvent({type:"change"}),this.resizable.setSize(this.base.width,this.base.height))}getPreferredHeight(){return this.preferredHeight}setPreferredHeight(e){this.preferredHeight=e}setPreferredSize(e,t){(this.preferred.width!==e||this.preferred.height!==t)&&(this.preferred.set(e,t),this.dispatchEvent({type:"change"}),this.resizable.setSize(this.base.width,this.base.height))}copy(e){this.base.set(e.getBaseWidth(),e.getBaseHeight()),this.preferred.set(e.getPreferredWidth(),e.getPreferredHeight()),this.dispatchEvent({type:"change"}),this.resizable.setSize(this.base.width,this.base.height)}static get AUTO_SIZE(){return E}},z=(new Float32Array([255/256/256**3,255/256/65536,255/256/256,255/256]),13),N=new Map([[0,null],[1,"vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return min(x+y,1.0)*opacity+x*(1.0-opacity);}"],[2,"vec3 blend(const in vec3 x,const in vec3 y,const in float opacity){return y*opacity+x*(1.0-opacity);}vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){float a=min(y.a,opacity);return vec4(blend(x.rgb,y.rgb,a),max(x.a,a));}"],[3,"vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return(x+y)*0.5*opacity+x*(1.0-opacity);}"],[4,"float blend(const in float x,const in float y){return(y==0.0)?y:max(1.0-(1.0-x)/y,0.0);}vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec4 z=vec4(blend(x.r,y.r),blend(x.g,y.g),blend(x.b,y.b),blend(x.a,y.a));return z*opacity+x*(1.0-opacity);}"],[5,"float blend(const in float x,const in float y){return(y==1.0)?y:min(x/(1.0-y),1.0);}vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec4 z=vec4(blend(x.r,y.r),blend(x.g,y.g),blend(x.b,y.b),blend(x.a,y.a));return z*opacity+x*(1.0-opacity);}"],[6,"vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return min(x,y)*opacity+x*(1.0-opacity);}"],[7,"vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return abs(x-y)*opacity+x*(1.0-opacity);}"],[8,"vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return(x+y-2.0*x*y)*opacity+x*(1.0-opacity);}"],[9,"vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return max(x,y)*opacity+x*(1.0-opacity);}"],[10,"vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return x*y*opacity+x*(1.0-opacity);}"],[11,"float blend(const in float x,const in float y){return(y>0.0)?min(x/y,1.0):1.0;}vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec4 z=vec4(blend(x.r,y.r),blend(x.g,y.g),blend(x.b,y.b),blend(x.a,y.a));return z*opacity+x*(1.0-opacity);}"],[12,"vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return(1.0-abs(1.0-x-y))*opacity+x*(1.0-opacity);}"],[z,"vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return y*opacity+x*(1.0-opacity);}"],[14,"float blend(const in float x,const in float y){return(x<0.5)?(2.0*x*y):(1.0-2.0*(1.0-x)*(1.0-y));}vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec4 z=vec4(blend(x.r,y.r),blend(x.g,y.g),blend(x.b,y.b),blend(x.a,y.a));return z*opacity+x*(1.0-opacity);}"],[15,"float blend(const in float x,const in float y){return(y==1.0)?y:min(x*x/(1.0-y),1.0);}vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec4 z=vec4(blend(x.r,y.r),blend(x.g,y.g),blend(x.b,y.b),blend(x.a,y.a));return z*opacity+x*(1.0-opacity);}"],[16,"vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return(1.0-(1.0-x)*(1.0-y))*opacity+x*(1.0-opacity);}"],[17,"float blend(const in float x,const in float y){return(y<0.5)?(2.0*x*y+x*x*(1.0-2.0*y)):(sqrt(x)*(2.0*y-1.0)+2.0*x*(1.0-y));}vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec4 z=vec4(blend(x.r,y.r),blend(x.g,y.g),blend(x.b,y.b),blend(x.a,y.a));return z*opacity+x*(1.0-opacity);}"],[18,"vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return max(x+y-1.0,0.0)*opacity+x*(1.0-opacity);}"]]),I=class extends r{constructor(e,t=1){super(),this.f=e,this.opacity=new h(t)}getOpacity(){return this.opacity.value}setOpacity(e){this.opacity.value=e}get blendFunction(){return this.f}set blendFunction(e){this.f=e,this.dispatchEvent({type:"change"})}getBlendFunction(){return this.blendFunction}setBlendFunction(e){this.blendFunction=e}getShaderCode(){return N.get(this.blendFunction)}},O=class extends r{constructor(e,t,{attributes:r=0,blendFunction:n=16,defines:i=new Map,uniforms:s=new Map,extensions:a=null,vertexShader:l=null}={}){super(),this.name=e,this.renderer=null,this.attributes=r,this.fragmentShader=t,this.vertexShader=l,this.defines=i,this.uniforms=s,this.extensions=a,this.blendMode=new I(n),this.blendMode.addEventListener("change",e=>this.setChanged())}getName(){return this.name}setRenderer(e){this.renderer=e}getDefines(){return this.defines}getUniforms(){return this.uniforms}getExtensions(){return this.extensions}getBlendMode(){return this.blendMode}getAttributes(){return this.attributes}setAttributes(e){this.attributes=e,this.setChanged()}getFragmentShader(){return this.fragmentShader}setFragmentShader(e){this.fragmentShader=e,this.setChanged()}getVertexShader(){return this.vertexShader}setVertexShader(e){this.vertexShader=e,this.setChanged()}setChanged(){this.dispatchEvent({type:"change"})}setDepthTexture(e,t=n){}update(e,t,r){}setSize(e,t){}initialize(e,t,r){}dispose(){for(let e of Object.keys(this)){let t=this[e];if(null!==t&&"object"==typeof t&&"function"==typeof t.dispose){if(t instanceof f||t===this.renderer)continue;this[e].dispose()}}}},_=[new Float32Array([0,0]),new Float32Array([0,1,1]),new Float32Array([0,1,1,2]),new Float32Array([0,1,2,2,3]),new Float32Array([0,1,2,3,4,4,5]),new Float32Array([0,1,2,3,4,5,7,8,9,10])],H=class extends P{constructor({resolutionScale:e=.5,width:t=R.AUTO_SIZE,height:r=R.AUTO_SIZE,kernelSize:n=G.LARGE}={}){super("KawaseBlurPass"),this.renderTargetA=new o(1,1,{minFilter:m,magFilter:m,stencilBuffer:!1,depthBuffer:!1}),this.renderTargetA.texture.name="Blur.Target.A",this.renderTargetB=this.renderTargetA.clone(),this.renderTargetB.texture.name="Blur.Target.B";let i=this.resolution=new R(this,t,r,e);i.addEventListener("change",e=>this.setSize(i.baseWidth,i.baseHeight)),this.blurMaterial=new k,this.ditheredBlurMaterial=new k,this.ditheredBlurMaterial.uniforms.scale=this.blurMaterial.uniforms.scale,this.ditheredBlurMaterial.dithering=!0,this.dithering=!1,this.kernelSize=n}getResolution(){return this.resolution}get width(){return this.resolution.width}set width(e){this.resolution.preferredWidth=e}get height(){return this.resolution.height}set height(e){this.resolution.preferredHeight=e}get scale(){return this.blurMaterial.scale}set scale(e){this.blurMaterial.scale=e}getScale(){return this.blurMaterial.scale}setScale(e){this.blurMaterial.scale=e}getKernelSize(){return this.kernelSize}setKernelSize(e){this.kernelSize=e}getResolutionScale(){return this.resolution.scale}setResolutionScale(e){this.resolution.scale=e}render(e,t,r,n,i){let s,a,l=this.scene,o=this.camera,h=this.renderTargetA,u=this.renderTargetB,c=_[this.kernelSize],f=this.blurMaterial,d=t;for(this.fullscreenMaterial=f,s=0,a=c.length-1;s<a;++s){let t=1&s?u:h;f.kernel=c[s],f.inputBuffer=d.texture,e.setRenderTarget(t),e.render(l,o),d=t}this.dithering&&(f=this.ditheredBlurMaterial,this.fullscreenMaterial=f),f.kernel=c[s],f.inputBuffer=d.texture,e.setRenderTarget(this.renderToScreen?null:r),e.render(l,o)}setSize(e,t){let r=this.resolution;r.setBaseSize(e,t);let n=r.width,i=r.height;this.renderTargetA.setSize(n,i),this.renderTargetB.setSize(n,i),this.blurMaterial.setSize(n,i),this.ditheredBlurMaterial.setSize(n,i)}initialize(e,t,r){void 0!==r&&(this.renderTargetA.texture.type=r,this.renderTargetB.texture.type=r,r!==x?(this.blurMaterial.defines.FRAMEBUFFER_PRECISION_HIGH="1",this.ditheredBlurMaterial.defines.FRAMEBUFFER_PRECISION_HIGH="1"):e.outputColorSpace===a&&(this.renderTargetA.texture.colorSpace=a,this.renderTargetB.texture.colorSpace=a))}static get AUTO_SIZE(){return R.AUTO_SIZE}},L=class extends P{constructor(e,t="inputBuffer"){super("ShaderPass"),this.fullscreenMaterial=e,this.inputBufferUniform=null,this.setInput(t)}setInput(e){if(this.inputBufferUniform=null,null!==this.fullscreenMaterial){let t=this.fullscreenMaterial.uniforms;void 0!==t&&void 0!==t[e]&&(this.inputBufferUniform=t[e])}}render(e,t,r,n,i){null!==this.inputBufferUniform&&null!==t&&(this.inputBufferUniform.value=t.texture),e.setRenderTarget(this.renderToScreen?null:r),e.render(this.scene,this.camera)}initialize(e,t,r){void 0!==r&&r!==x&&(this.fullscreenMaterial.defines.FRAMEBUFFER_PRECISION_HIGH="1")}},G={VERY_SMALL:0,SMALL:1,MEDIUM:2,LARGE:3,VERY_LARGE:4,HUGE:5},W=class extends O{constructor(e,{blendFunction:t=z,worldFocusDistance:r,worldFocusRange:n,focusDistance:i=0,focalLength:a=.1,focusRange:l=a,bokehScale:u=1,width:c=R.AUTO_SIZE,height:f=R.AUTO_SIZE}={}){super("DepthOfFieldEffect","#ifdef FRAMEBUFFER_PRECISION_HIGH\nuniform mediump sampler2D nearColorBuffer;uniform mediump sampler2D farColorBuffer;\n#else\nuniform lowp sampler2D nearColorBuffer;uniform lowp sampler2D farColorBuffer;\n#endif\nuniform lowp sampler2D nearCoCBuffer;uniform float scale;void mainImage(const in vec4 inputColor,const in vec2 uv,const in float depth,out vec4 outputColor){vec4 colorNear=texture2D(nearColorBuffer,uv);vec4 colorFar=texture2D(farColorBuffer,uv);float CoCNear=texture2D(nearCoCBuffer,uv).r;CoCNear=min(CoCNear*scale,1.0);vec4 result=inputColor*(1.0-colorFar.a)+colorFar;result=mix(result,colorNear,CoCNear);outputColor=result;}",{blendFunction:t,attributes:1,uniforms:new Map([["nearColorBuffer",new h(null)],["farColorBuffer",new h(null)],["nearCoCBuffer",new h(null)],["scale",new h(1)]])}),F(this,"targetObject"),this.camera=e,this.renderTarget=new o(1,1,{minFilter:m,magFilter:m,stencilBuffer:!1,depthBuffer:!1}),this.renderTarget.texture.name="DoF.Intermediate",this.renderTarget.texture.generateMipmaps=!1,this.renderTargetMasked=this.renderTarget.clone(),this.renderTargetMasked.texture.name="DoF.Masked.Far",this.renderTargetNear=this.renderTarget.clone(),this.renderTargetNear.texture.name="DoF.Bokeh.Near",this.uniforms.get("nearColorBuffer").value=this.renderTargetNear.texture,this.renderTargetFar=this.renderTarget.clone(),this.renderTargetFar.texture.name="DoF.Bokeh.Far",this.uniforms.get("farColorBuffer").value=this.renderTargetFar.texture,this.renderTargetCoC=this.renderTarget.clone(),this.renderTargetCoC.texture.name="DoF.CoC",this.renderTargetCoCBlurred=this.renderTargetCoC.clone(),this.renderTargetCoCBlurred.texture.name="DoF.CoC.Blurred",this.uniforms.get("nearCoCBuffer").value=this.renderTargetCoCBlurred.texture,this.cocPass=new L(new T(e));let d=this.cocMaterial;d.focusDistance=i,d.focusRange=l,void 0!==r&&(d.worldFocusDistance=r),void 0!==n&&(d.worldFocusRange=n),this.blurPass=new H({kernelSize:G.MEDIUM,width:c,height:f});let g=this.blurPass.getResolution();g.addEventListener("change",e=>this.setSize(g.getBaseWidth(),g.getBaseHeight())),this.maskPass=new L(new M(this.renderTargetCoC.texture));let p=this.maskPass.fullscreenMaterial;p.maskFunction=1,p.colorChannel=1,this.bokehNearBasePass=new L(new S(!1,!0)),this.bokehNearBasePass.fullscreenMaterial.cocBuffer=this.renderTargetCoCBlurred.texture,this.bokehNearFillPass=new L(new S(!0,!0)),this.bokehNearFillPass.fullscreenMaterial.cocBuffer=this.renderTargetCoCBlurred.texture,this.bokehFarBasePass=new L(new S(!1,!1)),this.bokehFarBasePass.fullscreenMaterial.cocBuffer=this.renderTargetCoC.texture,this.bokehFarFillPass=new L(new S(!0,!1)),this.bokehFarFillPass.fullscreenMaterial.cocBuffer=this.renderTargetCoC.texture,this.target=new s,this.bokehScale=u}get cocTexture(){return this.renderTargetCoC.texture}get cocMaterial(){return this.cocPass.fullscreenMaterial}get circleOfConfusionMaterial(){return this.cocMaterial}getCircleOfConfusionMaterial(){return this.circleOfConfusionMaterial}getBlurPass(){return this.blurPass}get resolution(){return this.blurPass.getResolution()}getResolution(){return this.blurPass.getResolution()}get bokehScale(){return this.uniforms.get("scale").value}set bokehScale(e){let t=[this.bokehNearBasePass,this.bokehNearFillPass,this.bokehFarBasePass,this.bokehFarFillPass];for(let r of t)r.fullscreenMaterial.setScale(e);this.maskPass.fullscreenMaterial.setStrength(e),this.uniforms.get("scale").value=e}getBokehScale(){return this.bokehScale}setBokehScale(e){this.bokehScale=e}getTarget(){return this.target}setTarget(e){this.target=e}calculateFocusDistance(e){let t=this.camera;return B(-t.position.distanceTo(e),t.near,t.far)}setDepthTexture(e,t=n){this.circleOfConfusionMaterial.depthBuffer=e,this.circleOfConfusionMaterial.depthPacking=t}update(e,t,r){let n=this.renderTarget,i=this.renderTargetCoC,s=this.renderTargetCoCBlurred,a=this.renderTargetMasked;if(this.targetObject&&this.camera){this.target.setFromMatrixPosition(this.targetObject.matrixWorld);let e=this.calculateFocusDistance(this.target);this.circleOfConfusionMaterial.focusDistance=e}this.cocPass.render(e,null,i),this.blurPass.render(e,i,s),this.maskPass.render(e,t,a),this.bokehFarBasePass.render(e,a,n),this.bokehFarFillPass.render(e,n,this.renderTargetFar),this.bokehNearBasePass.render(e,t,n),this.bokehNearFillPass.render(e,n,this.renderTargetNear)}setSize(e,t){let r=this.resolution;r.setBaseSize(e,t);let n=r.width,i=r.height,s=[this.cocPass,this.blurPass,this.maskPass,this.bokehNearBasePass,this.bokehNearFillPass,this.bokehFarBasePass,this.bokehFarFillPass];s.push(this.renderTargetCoC,this.renderTargetMasked),s.forEach(r=>r.setSize(e,t)),s=[this.renderTarget,this.renderTargetNear,this.renderTargetFar,this.renderTargetCoCBlurred],s.forEach(e=>e.setSize(n,i)),[this.bokehNearBasePass,this.bokehNearFillPass,this.bokehFarBasePass,this.bokehFarFillPass].forEach(e=>e.fullscreenMaterial.setSize(n,i))}initialize(e,t,r){[this.cocPass,this.maskPass,this.bokehNearBasePass,this.bokehNearFillPass,this.bokehFarBasePass,this.bokehFarFillPass].forEach(n=>n.initialize(e,t,r)),this.blurPass.initialize(e,t,x),void 0!==r&&(this.renderTarget.texture.type=r,this.renderTargetNear.texture.type=r,this.renderTargetFar.texture.type=r,this.renderTargetMasked.texture.type=r,e.outputColorSpace===a&&(this.renderTarget.texture.colorSpace=a,this.renderTargetNear.texture.colorSpace=a,this.renderTargetFar.texture.colorSpace=a,this.renderTargetMasked.texture.colorSpace=a))}};function K(e,t,r){return e+(t-e)*r}function V(e,t,r,n){let i=K(e,t,.75),s=K(r,n,.75);return K(i,s,.875)}new s,new u,new c,Math.PI,new s,new s,new Float32Array(3),new Float32Array(3),new Float32Array(3),new Float32Array(3),new Float32Array(3),new Float32Array(3),new Float32Array([0,0,0]),new Float32Array([1,0,0]),new Float32Array([1,1,0]),new Float32Array([1,1,1]),new Float32Array([0,0,0]),new Float32Array([1,0,0]),new Float32Array([1,0,1]),new Float32Array([1,1,1]),new Float32Array([0,0,0]),new Float32Array([0,0,1]),new Float32Array([1,0,1]),new Float32Array([1,1,1]),new Float32Array([0,0,0]),new Float32Array([0,1,0]),new Float32Array([1,1,0]),new Float32Array([1,1,1]),new Float32Array([0,0,0]),new Float32Array([0,1,0]),new Float32Array([0,1,1]),new Float32Array([1,1,1]),new Float32Array([0,0,0]),new Float32Array([0,0,1]),new Float32Array([0,1,1]),new Float32Array([1,1,1]),new Float32Array(2),new Float32Array(2),new Float32Array([0,-.25,.25,-.125,.125,-.375,.375]),new Float32Array([0,0]),new Float32Array([.25,-.25]),new Float32Array([-.25,.25]),new Float32Array([.125,-.125]),new Float32Array([-.125,.125]),new Uint8Array([0,0]),new Uint8Array([3,0]),new Uint8Array([0,3]),new Uint8Array([3,3]),new Uint8Array([1,0]),new Uint8Array([4,0]),new Uint8Array([1,3]),new Uint8Array([4,3]),new Uint8Array([0,1]),new Uint8Array([3,1]),new Uint8Array([0,4]),new Uint8Array([3,4]),new Uint8Array([1,1]),new Uint8Array([4,1]),new Uint8Array([1,4]),new Uint8Array([4,4]),new Uint8Array([0,0]),new Uint8Array([1,0]),new Uint8Array([0,2]),new Uint8Array([1,2]),new Uint8Array([2,0]),new Uint8Array([3,0]),new Uint8Array([2,2]),new Uint8Array([3,2]),new Uint8Array([0,1]),new Uint8Array([1,1]),new Uint8Array([0,3]),new Uint8Array([1,3]),new Uint8Array([2,1]),new Uint8Array([3,1]),new Uint8Array([2,3]),new Uint8Array([3,3]),new Map([[V(0,0,0,0),new Float32Array([0,0,0,0])],[V(0,0,0,1),new Float32Array([0,0,0,1])],[V(0,0,1,0),new Float32Array([0,0,1,0])],[V(0,0,1,1),new Float32Array([0,0,1,1])],[V(0,1,0,0),new Float32Array([0,1,0,0])],[V(0,1,0,1),new Float32Array([0,1,0,1])],[V(0,1,1,0),new Float32Array([0,1,1,0])],[V(0,1,1,1),new Float32Array([0,1,1,1])],[V(1,0,0,0),new Float32Array([1,0,0,0])],[V(1,0,0,1),new Float32Array([1,0,0,1])],[V(1,0,1,0),new Float32Array([1,0,1,0])],[V(1,0,1,1),new Float32Array([1,0,1,1])],[V(1,1,0,0),new Float32Array([1,1,0,0])],[V(1,1,0,1),new Float32Array([1,1,0,1])],[V(1,1,1,0),new Float32Array([1,1,1,0])],[V(1,1,1,1),new Float32Array([1,1,1,1])]]);var Z=class extends e{constructor(e){super(W)}set focalLength(e){this.effect.circleOfConfusionMaterial.uniforms.focalLength.value=e/2e3}get focalLength(){return this.effect.circleOfConfusionMaterial.uniforms.focalLength.value}set focusDistance(e){this.effect.circleOfConfusionMaterial.uniforms.focusDistance.value=this.isPerspectiveCamera?e/2e3:(e+992)/2e3}get focusDistance(){return this.effect.circleOfConfusionMaterial.uniforms.focusDistance.value}get bokehScale(){return this.effect.bokehScale}set bokehScale(e){this.effect.bokehScale=e}setCamera(e){let t=!1;(e.isPerspectiveCamera&&!1===this.isPerspectiveCamera||!e.isPerspectiveCamera&&!0===this.isPerspectiveCamera)&&(t=!0),e.isPerspectiveCamera?(this.effect.circleOfConfusionMaterial.adoptCameraSettings(e.perspCamera),this.isPerspectiveCamera=!0):(this.effect.circleOfConfusionMaterial.adoptCameraSettings(e),this.isPerspectiveCamera=!1),t&&this.effect.setChanged()}};t("depthOfField",()=>new Z);
|
|
Binary file
|
|
Binary file
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as t}from"./runtime-chunk-3IDUZQCX.js";import{f as e}from"./runtime-chunk-MB4PQARC.js";import{a,b as i}from"./runtime-chunk-DZNU62CT.js";import{a as r}from"./runtime-chunk-VAVYZ35B.js";import"./runtime-chunk-FQNSP44B.js";import"./runtime-chunk-2BGTDNPM.js";import"./runtime-chunk-U3FFE3XY.js";import"./runtime-chunk-LHETPF7C.js";import"./runtime-chunk-3BVK77PB.js";import"./runtime-chunk-AHV7KLQP.js";import"./runtime-chunk-4YV3EXSU.js";import"./runtime-chunk-NSD7DU3P.js";import{f as o,g as n}from"./runtime-chunk-NSBTKBP4.js";import{h as s,v as c}from"./runtime-chunk-I4ELBYXH.js";import"./runtime-chunk-RTLL6WIB.js";import"./runtime-chunk-2PT2WH66.js";import"./runtime-chunk-M2T4RO2D.js";import{a as h}from"./runtime-chunk-TZCHGFVF.js";import"./runtime-chunk-JTZ2BWZ5.js";import{Ec as d,Fc as p,Gc as l,Oc as v,rd as u}from"./runtime-chunk-BVVSZMXD.js";import"./runtime-chunk-ML3Z74BL.js";var m=new p,g=new p,E=new p,f=new u,D=new p,y=new p,b=new p,x=new d,C=new v,j=new l,M=new p,P=new p,T=.2;function w(t,e){!e||(e[0]<e[1]&&(t.x=Math.min(Math.max(t.x,e[0]),e[1])),e[2]<e[3]&&(t.y=Math.min(Math.max(t.y,e[2]),e[3])),e[4]<e[5]&&(t.z=Math.min(Math.max(t.z,e[4]),e[5])))}var I=function(){let t=new v;return(a,i,r)=>{let o=a.obj;t.copy(o.hiddenMatrix),null!==o.parent&&t.premultiply(o.parent.matrixWorld),t.invert(),o.position.copy(i),"global"===a.reference&&w(o.position,a.limits),o.position.applyMatrix4(t),"parent"===a.reference?w(o.position,a.limits):"local"===a.reference&&(x.copy(a.quat0).invert(),o.position.sub(a.position0),o.position.applyQuaternion(x),w(o.position,a.limits),x.invert(),o.position.applyQuaternion(x),o.position.add(a.position0)),t.multiply(r??o.matrixWorld).decompose(D,o.quaternion,y),o.updateMatrix(),o.hasNonUniformScale&&(o.updateMatrixWorld(),o.updateMatrixWorldRigid()),o instanceof c&&e(o.parent)&&o.invalidateDownstreamBooleanData(!0)}}(),S=class{constructor(t,e,a,i,r,n,s){this.object=t,this.id=e,this.data=a,this.dropDestIds=[],this.activeIdx=null,this.wasDragEventTriggered=!1,this.resetDampingFactor=0===this.data.resetSpeed?1:8/this.data.resetSpeed+1,this.snapDampingFactor=0===this.data.snapSpeed?1:8/this.data.snapSpeed+1,this.actionsDrag=o(a,a.dragDropActions.drag,i,r,n,this.object),this.actionsDrop=o(a,a.dragDropActions.drop,i,r,n,this.object);let c=[];this.data.objects.forEach(t=>{let e=i.find(t);!e||!1!==e.data.visible&&(c.push(e),s[e.uuid]&&s[e.uuid].forEach(t=>{let e=i.find(t);!e||!1!==e.data.visible&&c.push(e)}))}),this.data.dropDestinations.forEach(t=>{let e=i.find(t);!e||!1!==e.data.visible&&(this.dropDestIds.push(e.uuid),s[e.uuid]&&s[e.uuid].forEach(t=>{let e=i.find(t);!e||!1!==e.data.visible&&this.dropDestIds.push(e.uuid)}))}),this.dragItems=c.map(t=>("locked"===this.data.planeMode&&(t.userData.lockedPlane=!0),t.userData.worldPosition0=(new p).setFromMatrixPosition(t.matrixWorld),{obj:t,fromPosition:(new p).setFromMatrixPosition(t.matrixWorld),pointStart:new p,pointEnd:new p,paused:!0,currentDampingFactor:this.data.dampingFactor,reset:!1,position0:(new p).copy(t.position),quat0:(new d).copy(t.quaternion),snapped:!1,orientationMatrix:new v,limits:this.data.limits,reference:this.data.referenceFrame}))}get activeDragItem(){return null!==this.activeIdx?this.dragItems[this.activeIdx]:null}dispose(){n(this.actionsDrag),n(this.actionsDrop),this.dragItems.forEach(t=>{t.fromPosition.copy(t.obj.userData.worldPosition0),t.pointStart.copy(t.fromPosition),t.pointEnd.copy(t.pointStart),t.obj.recursiveBBoxNeedsUpdate=!0,t.obj.userData.lockedPlane=void 0,t.obj.position.copy(t.position0),t.obj.quaternion.copy(t.quat0),t.obj.updateMatrix()})}},F=class extends a{constructor(e,a){super(e),this.eventManager=a,this.events=[],this.lastDropDestination=null,this.dragTimeout=null,this.lastCursorRaycastTime=0,this.trailingCursorTimer=null,this.trailingCursorEvent=null,this.onPointerDown=t=>{if(r.length>1)return;this.eventContext.updateRaycaster(t);let{raycaster:e,page:a}=this.eventContext,i=a.raycastWithClones(e);if(this.lastDropDestination=null,0!==i.length){for(let t of this.events){let e=0;for(let{obj:a,pointEnd:r,pointStart:o}of t.dragItems){if(a===i[0].object||a===i[0].object.object||s.is(a)&&a.isAncestorOf(i[0].object.uuid)){if(t.activeIdx=e,t.activeDragItem.reset=!1,t.activeDragItem.currentDampingFactor=t.data.dampingFactor,t.activeDragItem.snapped=!1,"hand"===t.data.cursor&&this.setCursor("grabbing"),this.eventManager.controlsManager.usePhysics){t.activeDragItem.obj.rigidBody&&(t.activeDragItem.obj.rigidBody.setBodyType(2,!0),this.eventManager.controlsManager.sharedGameControlGlobals.kinematicBodyToEntity.set(t.activeDragItem.obj.rigidBody.handle,t.activeDragItem.obj));let e=t.activeDragItem.obj;a.hasNonUniformScale&&a.updateMatrixWorldRigid(),(e.hasNonUniformScale?e.matrixWorldRigid:e.matrixWorld).decompose(D,x,y),void 0===e.prevQ?(e.prevQ=x.clone(),e.prevT=D.clone()):(e.prevQ.copy(x),e.prevT.copy(D)),this.eventManager.controlsManager.sharedGameControlGlobals.entitiesWithTransformAnim.push(t.activeDragItem.obj)}return this.calcPlaneIntersectPos(a,o,t.data.plane,t.data.referenceFrame),r.copy(o),(this.eventManager.controlsManager.usePhysics&&"dynamic"===a.data.physics?.rigidBody||!1===t.data.drop||!1===t.data.resetOnSnapFail)&&t.activeDragItem.fromPosition.setFromMatrixPosition(t.activeDragItem.obj.matrixWorld),this.activeEvent=t,void(this.eventManager.controlsManager.orbitControls&&(this.eventManager.controlsManager.orbitControls.enabled=!1))}e++}}this.activeEvent=null}else this.activeEvent=null},this.runTrailingCursorUpdate=()=>{this.trailingCursorTimer=null;let t=this.trailingCursorEvent;this.trailingCursorEvent=null,null!==t&&0===r.length&&(this.eventContext.updateRaycaster(t),this.lastCursorRaycastTime=performance.now(),this.updateCursorFromRaycast())},this.onPointerMove=e=>{if(r.length>1)return;this.eventContext.updateRaycaster(e);let{raycaster:a,page:i}=this.eventContext;if(0===r.length){if(!this.events.some(t=>"hand"===t.data.cursor||"move"===t.data.cursor))return;let t=performance.now();return t-this.lastCursorRaycastTime<16?(this.trailingCursorEvent=e,void(null===this.trailingCursorTimer&&(this.trailingCursorTimer=window.setTimeout(this.runTrailingCursorUpdate,32)))):(this.trailingCursorEvent=null,this.lastCursorRaycastTime=t,void this.updateCursorFromRaycast())}if(this.activeEvent&&this.activeEvent.activeDragItem){let e,r=this.activeEvent.activeDragItem;if(r.snapped=!1,this.activeEvent.data.drop&&(e=i.raycastWithClones(a).filter(e=>r.obj!==e.object&&!r.obj.isAncestorOf(e.object.uuid)&&!(e.object instanceof t)&&("all"===this.activeEvent.data.dropOn||this.activeEvent.dropDestIds.some(t=>t===e.object.uuid||i.scene.find(t).isAncestorOf(e.object.uuid))))[0]),e){let t=b.copy(e.face.normal).applyMatrix3(j.getNormalMatrix(e.object.matrixWorld));if("center"===this.activeEvent.data.snapTo)r.fromPosition.setFromMatrixPosition(e.object.matrixWorld);else if("surface"===this.activeEvent.data.snapTo){if(r.fromPosition.copy(e.point),"bbox"===this.activeEvent.data.snapSurfaceMode){D.copy(t).applyMatrix3(j.setFromMatrix4(r.obj.matrixWorld).transpose());let e=r.obj;D.x>T?y.x=-e.recursiveBBox.min.x:D.x<-T&&(y.x=-e.recursiveBBox.max.x),D.y>T?y.y=-e.recursiveBBox.min.y:D.y<-T&&(y.y=-e.recursiveBBox.max.y),D.z>T?y.z=-e.recursiveBBox.min.z:D.z<-T&&(y.z=-e.recursiveBBox.max.z),y.applyMatrix3(j.invert())}else y.copy(t).multiplyScalar(this.activeEvent.data.snapSurfaceOffset);r.fromPosition.add(y)}this.activeEvent.data.autoOrient&&(D.set(0,1,0).cross(t),D.length()<1e-4&&D.set(-1,0,0).cross(t),y.crossVectors(b,D),r.orientationMatrix.makeBasis(D,y,t)),r.pointStart.copy(r.fromPosition),r.pointEnd.copy(r.pointStart),r.currentDampingFactor=this.activeEvent.snapDampingFactor,r.snapped=!0,this.lastDropDestination!==e.object&&(this.lastDropDestination=e.object,this.activeEvent.actionsDrop.Transition.forEach(t=>{t.play()}),this.activeEvent.actionsDrop.Animation.forEach(t=>{t.play()}),this.activeEvent.actionsDrop.Audio.forEach(t=>{t.dispatchGameControl("start")}),this.activeEvent.actionsDrop.Particles.forEach(t=>{t.dispatchGameControl("start")}),this.activeEvent.actionsDrop.Create.forEach(t=>{t.dispatchThrottled()}))}else r.orientationMatrix.makeRotationFromQuaternion(r.quat0),this.lastDropDestination=null,r.currentDampingFactor=this.activeEvent.data.dampingFactor,this.calcPlaneIntersectPos(r.obj,r.pointEnd,this.activeEvent.data.plane,this.activeEvent.data.referenceFrame),this.activeEvent.actionsDrop.Transition.forEach(t=>{t.stop(),null!==t.object.currentState&&t.object.changeSelectedState(null,{scene:this.eventContext.page.scene,shared:this.eventContext.sharedAssets})}),this.activeEvent.actionsDrop.Animation.forEach(t=>{t.stop()}),this.activeEvent.actionsDrop.Audio.forEach(t=>{t.dispatchGameControl("stop")}),this.activeEvent.actionsDrop.Particles.forEach(t=>{t.dispatchGameControl("stop")});this.activeEvent.actionsDrag.Create.forEach(t=>{t.dispatchThrottled()}),this.activeEvent.actionsDrag.SetVariable.forEach(t=>t.checkConditions()),this.activeEvent.actionsDrag.SetVariable.forEach(t=>t.dispatch()),this.activeEvent.actionsDrag.DynamicVariablePlay.forEach(t=>t.dispatch()),this.activeEvent.actionsDrag.ClearLocalStorage.forEach(t=>t.dispatch()),this.activeEvent.actionsDrag.UserAPI.forEach(t=>t.dispatch()),!1===this.activeEvent.wasDragEventTriggered&&(this.activeEvent.wasDragEventTriggered=!0,this.activeEvent.actionsDrag.Transition.forEach(t=>{t.play()}),this.activeEvent.actionsDrag.Animation.forEach(t=>{t.play()}),this.activeEvent.actionsDrag.Audio.forEach(t=>{t.dispatchGameControl("start")}),this.activeEvent.actionsDrag.Particles.forEach(t=>{t.dispatchGameControl("start")})),this.dragTimeout&&window.clearTimeout(this.dragTimeout),this.dragTimeout=window.setTimeout(()=>{!this.activeEvent||(this.activeEvent.wasDragEventTriggered=!1,this.activeEvent.actionsDrag.Audio.forEach(t=>{t.dispatchGameControl("stop")}),this.activeEvent.actionsDrag.Particles.forEach(t=>{t.dispatchGameControl("stop")}),this.activeEvent.actionsDrag.Transition.forEach(t=>{t.stop(),null!==t.object.currentState&&t.object.changeSelectedState(null,{scene:this.eventContext.page.scene,shared:this.eventContext.sharedAssets})}),this.activeEvent.actionsDrag.Animation.forEach(t=>{t.stop()}))},500),this.updateDragItem(r),r.obj.dispatchEvent({type:"requestRender"})}},this.onPointerUp=t=>{if(this.activeEvent&&this.activeEvent.activeDragItem){"hand"===this.activeEvent.data.cursor&&this.setCursor("grab");let t="dynamic"===this.activeEvent.activeDragItem.obj.data.physics?.rigidBody;if(!1===this.activeEvent.activeDragItem.snapped&&this.activeEvent.data.drop&&this.activeEvent.data.resetOnSnapFail&&(!1===this.eventManager.controlsManager.usePhysics||!t)&&(this.activeEvent.activeDragItem.reset=this.activeEvent.data.resetOnSnapFail,this.activeEvent.activeDragItem.paused=!1,this.activeEvent.activeDragItem.currentDampingFactor=this.activeEvent.resetDampingFactor),this.eventManager.controlsManager.usePhysics&&t){let t=this.activeEvent.activeDragItem,e=this.eventManager.controlsManager.sharedGameControlGlobals,a=e.entitiesWithTransformAnim.lastIndexOf(t.obj);-1!==a&&e.entitiesWithTransformAnim.splice(a,1);let i=t.obj.rigidBody;i&&(e.kinematicBodyToEntity.delete(i.handle),i.setBodyType(0,!0)),t.paused=!0}!0===this.activeEvent.wasDragEventTriggered&&(this.activeEvent.wasDragEventTriggered=!1,this.activeEvent.actionsDrag.Transition.forEach(t=>{t.stop(),null!==t.object.currentState&&t.object.changeSelectedState(null,{scene:this.eventContext.page.scene,shared:this.eventContext.sharedAssets})}),this.activeEvent.actionsDrag.Animation.forEach(t=>{t.stop()}),this.activeEvent.actionsDrag.Audio.forEach(t=>{t.dispatchGameControl("stop")}),this.activeEvent.actionsDrag.Particles.forEach(t=>{t.dispatchGameControl("stop")}),this.activeEvent.actionsDrop.SetVariable.forEach(t=>t.checkConditions()),this.activeEvent.actionsDrop.SetVariable.forEach(t=>t.dispatch()),this.activeEvent.actionsDrop.DynamicVariablePlay.forEach(t=>t.dispatch()),this.activeEvent.actionsDrop.ClearLocalStorage.forEach(t=>t.dispatch()),this.activeEvent.actionsDrop.UserAPI.forEach(t=>t.dispatch())),this.eventManager.controlsManager.orbitControls&&(this.eventManager.controlsManager.orbitControls.enabled=!0)}}}connect(){let t={};if(this.eventContext.page.traverseEntity(e=>{e.component&&(t[e.component.uuid]?t[e.component.uuid].push(e.uuid):t[e.component.uuid]=[e.uuid])}),this.eventContext.page.traverseEntity(e=>{e.data?.events.filter(t=>"DragDrop"===t.data.type&&!t.data.disabled).forEach(a=>{this.events.push(new S(e,a.id,a.data,this.eventContext.page,this.eventContext.sharedAssets,this.eventManager,t))})}),!this.events.length)return;this.domEventsNeeded.clear(),this.domEventsNeeded.add("pointerdown");let e=this.eventContext.domElement;e.addEventListener("pointerdown",this.onPointerDown),e.addEventListener("pointermove",this.onPointerMove),e.addEventListener("pointerup",this.onPointerUp),this.domEventsNeeded.add("pointermove")}disconnect(){if(!this.events.length)return;this.domEventsNeeded.clear();let t=this.eventContext.domElement;t.removeEventListener("pointerdown",this.onPointerDown),t.removeEventListener("pointermove",this.onPointerMove),t.removeEventListener("pointerup",this.onPointerUp),null!==this.trailingCursorTimer&&(clearTimeout(this.trailingCursorTimer),this.trailingCursorTimer=null),this.trailingCursorEvent=null,this.events.forEach(t=>t.dispose())}setCursor(t){this.eventContext.domElement.style.cursor=t}onAnimationFrameDamping(){for(let t of this.events)for(let e of t.dragItems)e.paused||this.updateDragItem(e,!0)}calcPlaneIntersectPos(t,e,a,i){let{getCamera:r,raycaster:o}=this.eventContext;r().getWorldDirection(g),g.negate();let n=x.identity();switch("parent"===i?C.multiplyMatrices(t.parent.matrixWorld,t.hiddenMatrix).decompose(D,n,y):"local"===i&&t.matrixWorld.decompose(D,n,y),a){case"x":D.set(1,0,0).applyQuaternion(n),M.copy(g).cross(D),P.copy(D).cross(M);break;case"y":D.set(0,1,0).applyQuaternion(n),M.copy(g).cross(D),P.copy(D).cross(M);break;case"z":D.set(0,0,1).applyQuaternion(n),M.copy(g).cross(D),P.copy(D).cross(M);break;case"xy":P.set(0,0,1).applyQuaternion(n);break;case"yz":P.set(1,0,0).applyQuaternion(n);break;case"xz":P.set(0,1,0).applyQuaternion(n);break;case"adaptive":g.angleTo(y.set(0,1,0))>Math.PI/6?(D.crossVectors(y.set(0,1,0),g),P.crossVectors(D,y)):P.set(0,1,0);break;default:P.copy(g)}E.setFromMatrixPosition(t.matrixWorld);let s=t.userData.lockedPlane?t.userData.worldPosition0:E;if(f.setFromNormalAndCoplanarPoint(P,s),o.ray.intersectPlane(f,e)&&("x"===a||"y"===a||"z"===a)){let t=y.subVectors(e,s).dot(D);e.copy(s).addScaledVector(D,t)}}updateDragItem(t,e=!1){E.setFromMatrixPosition(t.obj.matrixWorld),"current"===t.reset?m.subVectors(t.fromPosition,E).divideScalar(t.currentDampingFactor):"original"===t.reset?(m.subVectors(t.obj.userData.worldPosition0,E).divideScalar(t.currentDampingFactor),t.fromPosition.copy(t.obj.userData.worldPosition0),t.pointStart.copy(t.fromPosition),t.pointEnd.copy(t.pointStart)):m.subVectors(t.pointEnd,t.pointStart).add(t.fromPosition).sub(E).divideScalar(t.currentDampingFactor),t.paused=!(t.currentDampingFactor>1)||m.length()<.01,(this.activeEvent&&1===this.activeEvent.data.dampingFactor||e)&&I(t,m.add(E),this.activeEvent?.data.drop&&this.activeEvent?.data.autoOrient?t.orientationMatrix:null),t.obj.dispatchEvent({type:"beginEvent",eventName:"DragDrop"}),this.eventManager.requestRender()}updateCursorFromRaycast(){let{raycaster:t,page:e}=this.eventContext,a=e.raycastWithClones(t),i=!1;for(let t of this.events){for(let{obj:e}of t.dragItems)if(e===a[0]?.object||e===a[0]?.object?.object||s.is(e)&&e.isAncestorOf(a[0]?.object.uuid)){switch(i=!0,t.data.cursor){case"hand":this.setCursor("grab");break;case"move":this.setCursor("move")}break}if(i)break}i||this.setCursor("default")}};i("DragDrop",({eventContext:t,eventManager:e})=>new F(t,e)),h("dragdrop");
|
|
1
|
+
import{a as t}from"./runtime-chunk-KSHWLQFH.js";import{f as e}from"./runtime-chunk-LQYHP43C.js";import{a,b as i}from"./runtime-chunk-DZNU62CT.js";import{a as r}from"./runtime-chunk-VAVYZ35B.js";import"./runtime-chunk-FQNSP44B.js";import"./runtime-chunk-GIO4XHW2.js";import"./runtime-chunk-6MXQXGJV.js";import"./runtime-chunk-XLNQVH4X.js";import"./runtime-chunk-ZTPGBHSM.js";import"./runtime-chunk-GDQWREZV.js";import"./runtime-chunk-4YV3EXSU.js";import"./runtime-chunk-NSD7DU3P.js";import{f as o,g as n}from"./runtime-chunk-NEOF7SBZ.js";import{h as s,v as c}from"./runtime-chunk-UEMEFP7N.js";import"./runtime-chunk-RTLL6WIB.js";import"./runtime-chunk-2PT2WH66.js";import"./runtime-chunk-HUXCP2PU.js";import{a as h}from"./runtime-chunk-TZCHGFVF.js";import"./runtime-chunk-JBTA64YE.js";import{Ec as d,Fc as p,Gc as l,Oc as v,rd as u}from"./runtime-chunk-BVVSZMXD.js";import"./runtime-chunk-ML3Z74BL.js";var m=new p,g=new p,E=new p,f=new u,D=new p,y=new p,b=new p,x=new d,C=new v,j=new l,M=new p,P=new p,T=.2;function w(t,e){!e||(e[0]<e[1]&&(t.x=Math.min(Math.max(t.x,e[0]),e[1])),e[2]<e[3]&&(t.y=Math.min(Math.max(t.y,e[2]),e[3])),e[4]<e[5]&&(t.z=Math.min(Math.max(t.z,e[4]),e[5])))}var S=function(){let t=new v;return(a,i,r)=>{let o=a.obj;t.copy(o.hiddenMatrix),null!==o.parent&&t.premultiply(o.parent.matrixWorld),t.invert(),o.position.copy(i),"global"===a.reference&&w(o.position,a.limits),o.position.applyMatrix4(t),"parent"===a.reference?w(o.position,a.limits):"local"===a.reference&&(x.copy(a.quat0).invert(),o.position.sub(a.position0),o.position.applyQuaternion(x),w(o.position,a.limits),x.invert(),o.position.applyQuaternion(x),o.position.add(a.position0)),t.multiply(r??o.matrixWorld).decompose(D,o.quaternion,y),o.updateMatrix(),o.hasNonUniformScale&&(o.updateMatrixWorld(),o.updateMatrixWorldRigid()),o instanceof c&&e(o.parent)&&o.invalidateDownstreamBooleanData(!0)}}(),I=class{constructor(t,e,a,i,r,n,s){this.object=t,this.id=e,this.data=a,this.dropDestIds=[],this.activeIdx=null,this.wasDragEventTriggered=!1,this.resetDampingFactor=0===this.data.resetSpeed?1:8/this.data.resetSpeed+1,this.snapDampingFactor=0===this.data.snapSpeed?1:8/this.data.snapSpeed+1,this.actionsDrag=o(a,a.dragDropActions.drag,i,r,n,this.object),this.actionsDrop=o(a,a.dragDropActions.drop,i,r,n,this.object);let c=[];this.data.objects.forEach(t=>{let e=i.find(t);!e||!1!==e.data.visible&&(c.push(e),s[e.uuid]&&s[e.uuid].forEach(t=>{let e=i.find(t);!e||!1!==e.data.visible&&c.push(e)}))}),this.data.dropDestinations.forEach(t=>{let e=i.find(t);!e||!1!==e.data.visible&&(this.dropDestIds.push(e.uuid),s[e.uuid]&&s[e.uuid].forEach(t=>{let e=i.find(t);!e||!1!==e.data.visible&&this.dropDestIds.push(e.uuid)}))}),this.dragItems=c.map(t=>("locked"===this.data.planeMode&&(t.userData.lockedPlane=!0),t.userData.worldPosition0=(new p).setFromMatrixPosition(t.matrixWorld),{obj:t,fromPosition:(new p).setFromMatrixPosition(t.matrixWorld),pointStart:new p,pointEnd:new p,paused:!0,currentDampingFactor:this.data.dampingFactor,reset:!1,position0:(new p).copy(t.position),quat0:(new d).copy(t.quaternion),snapped:!1,orientationMatrix:new v,limits:this.data.limits,reference:this.data.referenceFrame}))}get activeDragItem(){return null!==this.activeIdx?this.dragItems[this.activeIdx]:null}dispose(){n(this.actionsDrag),n(this.actionsDrop),this.dragItems.forEach(t=>{t.fromPosition.copy(t.obj.userData.worldPosition0),t.pointStart.copy(t.fromPosition),t.pointEnd.copy(t.pointStart),t.obj.recursiveBBoxNeedsUpdate=!0,t.obj.userData.lockedPlane=void 0,t.obj.position.copy(t.position0),t.obj.quaternion.copy(t.quat0),t.obj.updateMatrix()})}},F=class extends a{constructor(e,a){super(e),this.eventManager=a,this.events=[],this.lastDropDestination=null,this.dragTimeout=null,this.lastCursorRaycastTime=0,this.trailingCursorTimer=null,this.trailingCursorEvent=null,this.onPointerDown=t=>{if(r.length>1)return;this.eventContext.updateRaycaster(t);let{raycaster:e,page:a}=this.eventContext,i=a.raycastWithClones(e);if(this.lastDropDestination=null,0!==i.length){for(let t of this.events){let e=0;for(let{obj:a,pointEnd:r,pointStart:o}of t.dragItems){if(a===i[0].object||a===i[0].object.object||s.is(a)&&a.isAncestorOf(i[0].object.uuid)){if(t.activeIdx=e,t.activeDragItem.reset=!1,t.activeDragItem.currentDampingFactor=t.data.dampingFactor,t.activeDragItem.snapped=!1,"hand"===t.data.cursor&&this.setCursor("grabbing"),this.eventManager.controlsManager.usePhysics){t.activeDragItem.obj.rigidBody&&(t.activeDragItem.obj.rigidBody.setBodyType(2,!0),this.eventManager.controlsManager.sharedGameControlGlobals.kinematicBodyToEntity.set(t.activeDragItem.obj.rigidBody.handle,t.activeDragItem.obj));let e=t.activeDragItem.obj;a.hasNonUniformScale&&a.updateMatrixWorldRigid(),(e.hasNonUniformScale?e.matrixWorldRigid:e.matrixWorld).decompose(D,x,y),void 0===e.prevQ?(e.prevQ=x.clone(),e.prevT=D.clone()):(e.prevQ.copy(x),e.prevT.copy(D)),this.eventManager.controlsManager.sharedGameControlGlobals.entitiesWithTransformAnim.push(t.activeDragItem.obj)}return this.calcPlaneIntersectPos(a,o,t.data.plane,t.data.referenceFrame),r.copy(o),(this.eventManager.controlsManager.usePhysics&&"dynamic"===a.data.physics?.rigidBody||!1===t.data.drop||!1===t.data.resetOnSnapFail)&&t.activeDragItem.fromPosition.setFromMatrixPosition(t.activeDragItem.obj.matrixWorld),this.activeEvent=t,void(this.eventManager.controlsManager.orbitControls&&(this.eventManager.controlsManager.orbitControls.enabled=!1))}e++}}this.activeEvent=null}else this.activeEvent=null},this.runTrailingCursorUpdate=()=>{this.trailingCursorTimer=null;let t=this.trailingCursorEvent;this.trailingCursorEvent=null,null!==t&&0===r.length&&(this.eventContext.updateRaycaster(t),this.lastCursorRaycastTime=performance.now(),this.updateCursorFromRaycast())},this.onPointerMove=e=>{if(r.length>1)return;this.eventContext.updateRaycaster(e);let{raycaster:a,page:i}=this.eventContext;if(0===r.length){if(!this.events.some(t=>"hand"===t.data.cursor||"move"===t.data.cursor))return;let t=performance.now();return t-this.lastCursorRaycastTime<16?(this.trailingCursorEvent=e,void(null===this.trailingCursorTimer&&(this.trailingCursorTimer=window.setTimeout(this.runTrailingCursorUpdate,32)))):(this.trailingCursorEvent=null,this.lastCursorRaycastTime=t,void this.updateCursorFromRaycast())}if(this.activeEvent&&this.activeEvent.activeDragItem){let e,r=this.activeEvent.activeDragItem;if(r.snapped=!1,this.activeEvent.data.drop&&(e=i.raycastWithClones(a).filter(e=>r.obj!==e.object&&!r.obj.isAncestorOf(e.object.uuid)&&!(e.object instanceof t)&&("all"===this.activeEvent.data.dropOn||this.activeEvent.dropDestIds.some(t=>t===e.object.uuid||i.scene.find(t).isAncestorOf(e.object.uuid))))[0]),e){let t=b.copy(e.face.normal).applyMatrix3(j.getNormalMatrix(e.object.matrixWorld));if("center"===this.activeEvent.data.snapTo)r.fromPosition.setFromMatrixPosition(e.object.matrixWorld);else if("surface"===this.activeEvent.data.snapTo){if(r.fromPosition.copy(e.point),"bbox"===this.activeEvent.data.snapSurfaceMode){D.copy(t).applyMatrix3(j.setFromMatrix4(r.obj.matrixWorld).transpose());let e=r.obj;D.x>T?y.x=-e.recursiveBBox.min.x:D.x<-T&&(y.x=-e.recursiveBBox.max.x),D.y>T?y.y=-e.recursiveBBox.min.y:D.y<-T&&(y.y=-e.recursiveBBox.max.y),D.z>T?y.z=-e.recursiveBBox.min.z:D.z<-T&&(y.z=-e.recursiveBBox.max.z),y.applyMatrix3(j.invert())}else y.copy(t).multiplyScalar(this.activeEvent.data.snapSurfaceOffset);r.fromPosition.add(y)}this.activeEvent.data.autoOrient&&(D.set(0,1,0).cross(t),D.length()<1e-4&&D.set(-1,0,0).cross(t),y.crossVectors(b,D),r.orientationMatrix.makeBasis(D,y,t)),r.pointStart.copy(r.fromPosition),r.pointEnd.copy(r.pointStart),r.currentDampingFactor=this.activeEvent.snapDampingFactor,r.snapped=!0,this.lastDropDestination!==e.object&&(this.lastDropDestination=e.object,this.activeEvent.actionsDrop.Transition.forEach(t=>{t.play()}),this.activeEvent.actionsDrop.Animation.forEach(t=>{t.play()}),this.activeEvent.actionsDrop.Audio.forEach(t=>{t.dispatchGameControl("start")}),this.activeEvent.actionsDrop.Particles.forEach(t=>{t.dispatchGameControl("start")}),this.activeEvent.actionsDrop.Create.forEach(t=>{t.dispatchThrottled()}))}else r.orientationMatrix.makeRotationFromQuaternion(r.quat0),this.lastDropDestination=null,r.currentDampingFactor=this.activeEvent.data.dampingFactor,this.calcPlaneIntersectPos(r.obj,r.pointEnd,this.activeEvent.data.plane,this.activeEvent.data.referenceFrame),this.activeEvent.actionsDrop.Transition.forEach(t=>{t.stop(),null!==t.object.currentState&&t.object.changeSelectedState(null,{scene:this.eventContext.page.scene,shared:this.eventContext.sharedAssets})}),this.activeEvent.actionsDrop.Animation.forEach(t=>{t.stop()}),this.activeEvent.actionsDrop.Audio.forEach(t=>{t.dispatchGameControl("stop")}),this.activeEvent.actionsDrop.Particles.forEach(t=>{t.dispatchGameControl("stop")});this.activeEvent.actionsDrag.Create.forEach(t=>{t.dispatchThrottled()}),this.activeEvent.actionsDrag.SetVariable.forEach(t=>t.checkConditions()),this.activeEvent.actionsDrag.SetVariable.forEach(t=>t.dispatch()),this.activeEvent.actionsDrag.DynamicVariablePlay.forEach(t=>t.dispatch()),this.activeEvent.actionsDrag.ClearLocalStorage.forEach(t=>t.dispatch()),this.activeEvent.actionsDrag.UserAPI.forEach(t=>t.dispatch()),!1===this.activeEvent.wasDragEventTriggered&&(this.activeEvent.wasDragEventTriggered=!0,this.activeEvent.actionsDrag.Transition.forEach(t=>{t.play()}),this.activeEvent.actionsDrag.Animation.forEach(t=>{t.play()}),this.activeEvent.actionsDrag.Audio.forEach(t=>{t.dispatchGameControl("start")}),this.activeEvent.actionsDrag.Particles.forEach(t=>{t.dispatchGameControl("start")})),this.dragTimeout&&window.clearTimeout(this.dragTimeout),this.dragTimeout=window.setTimeout(()=>{!this.activeEvent||(this.activeEvent.wasDragEventTriggered=!1,this.activeEvent.actionsDrag.Audio.forEach(t=>{t.dispatchGameControl("stop")}),this.activeEvent.actionsDrag.Particles.forEach(t=>{t.dispatchGameControl("stop")}),this.activeEvent.actionsDrag.Transition.forEach(t=>{t.stop(),null!==t.object.currentState&&t.object.changeSelectedState(null,{scene:this.eventContext.page.scene,shared:this.eventContext.sharedAssets})}),this.activeEvent.actionsDrag.Animation.forEach(t=>{t.stop()}))},500),this.updateDragItem(r),r.obj.dispatchEvent({type:"requestRender"})}},this.onPointerUp=t=>{if(this.activeEvent&&this.activeEvent.activeDragItem){"hand"===this.activeEvent.data.cursor&&this.setCursor("grab");let t="dynamic"===this.activeEvent.activeDragItem.obj.data.physics?.rigidBody;if(!1===this.activeEvent.activeDragItem.snapped&&this.activeEvent.data.drop&&this.activeEvent.data.resetOnSnapFail&&(!1===this.eventManager.controlsManager.usePhysics||!t)&&(this.activeEvent.activeDragItem.reset=this.activeEvent.data.resetOnSnapFail,this.activeEvent.activeDragItem.paused=!1,this.activeEvent.activeDragItem.currentDampingFactor=this.activeEvent.resetDampingFactor),this.eventManager.controlsManager.usePhysics&&t){let t=this.activeEvent.activeDragItem,e=this.eventManager.controlsManager.sharedGameControlGlobals,a=e.entitiesWithTransformAnim.lastIndexOf(t.obj);-1!==a&&e.entitiesWithTransformAnim.splice(a,1);let i=t.obj.rigidBody;i&&(e.kinematicBodyToEntity.delete(i.handle),i.setBodyType(0,!0)),t.paused=!0}!0===this.activeEvent.wasDragEventTriggered&&(this.activeEvent.wasDragEventTriggered=!1,this.activeEvent.actionsDrag.Transition.forEach(t=>{t.stop(),null!==t.object.currentState&&t.object.changeSelectedState(null,{scene:this.eventContext.page.scene,shared:this.eventContext.sharedAssets})}),this.activeEvent.actionsDrag.Animation.forEach(t=>{t.stop()}),this.activeEvent.actionsDrag.Audio.forEach(t=>{t.dispatchGameControl("stop")}),this.activeEvent.actionsDrag.Particles.forEach(t=>{t.dispatchGameControl("stop")}),this.activeEvent.actionsDrop.SetVariable.forEach(t=>t.checkConditions()),this.activeEvent.actionsDrop.SetVariable.forEach(t=>t.dispatch()),this.activeEvent.actionsDrop.DynamicVariablePlay.forEach(t=>t.dispatch()),this.activeEvent.actionsDrop.ClearLocalStorage.forEach(t=>t.dispatch()),this.activeEvent.actionsDrop.UserAPI.forEach(t=>t.dispatch())),this.eventManager.controlsManager.orbitControls&&(this.eventManager.controlsManager.orbitControls.enabled=!0)}}}connect(){let t={};if(this.eventContext.page.traverseEntity(e=>{e.component&&(t[e.component.uuid]?t[e.component.uuid].push(e.uuid):t[e.component.uuid]=[e.uuid])}),this.eventContext.page.traverseEntity(e=>{e.data?.events.filter(t=>"DragDrop"===t.data.type&&!t.data.disabled).forEach(a=>{this.events.push(new I(e,a.id,a.data,this.eventContext.page,this.eventContext.sharedAssets,this.eventManager,t))})}),!this.events.length)return;this.domEventsNeeded.clear(),this.domEventsNeeded.add("pointerdown");let e=this.eventContext.domElement;e.addEventListener("pointerdown",this.onPointerDown),e.addEventListener("pointermove",this.onPointerMove),e.addEventListener("pointerup",this.onPointerUp),this.domEventsNeeded.add("pointermove")}disconnect(){if(!this.events.length)return;this.domEventsNeeded.clear();let t=this.eventContext.domElement;t.removeEventListener("pointerdown",this.onPointerDown),t.removeEventListener("pointermove",this.onPointerMove),t.removeEventListener("pointerup",this.onPointerUp),null!==this.trailingCursorTimer&&(clearTimeout(this.trailingCursorTimer),this.trailingCursorTimer=null),this.trailingCursorEvent=null,this.events.forEach(t=>t.dispose())}setCursor(t){this.eventContext.domElement.style.cursor=t}onAnimationFrameDamping(){for(let t of this.events)for(let e of t.dragItems)e.paused||this.updateDragItem(e,!0)}calcPlaneIntersectPos(t,e,a,i){let{getCamera:r,raycaster:o}=this.eventContext;r().getWorldDirection(g),g.negate();let n=x.identity();switch("parent"===i?C.multiplyMatrices(t.parent.matrixWorld,t.hiddenMatrix).decompose(D,n,y):"local"===i&&t.matrixWorld.decompose(D,n,y),a){case"x":D.set(1,0,0).applyQuaternion(n),M.copy(g).cross(D),P.copy(D).cross(M);break;case"y":D.set(0,1,0).applyQuaternion(n),M.copy(g).cross(D),P.copy(D).cross(M);break;case"z":D.set(0,0,1).applyQuaternion(n),M.copy(g).cross(D),P.copy(D).cross(M);break;case"xy":P.set(0,0,1).applyQuaternion(n);break;case"yz":P.set(1,0,0).applyQuaternion(n);break;case"xz":P.set(0,1,0).applyQuaternion(n);break;case"adaptive":g.angleTo(y.set(0,1,0))>Math.PI/6?(D.crossVectors(y.set(0,1,0),g),P.crossVectors(D,y)):P.set(0,1,0);break;default:P.copy(g)}E.setFromMatrixPosition(t.matrixWorld);let s=t.userData.lockedPlane?t.userData.worldPosition0:E;if(f.setFromNormalAndCoplanarPoint(P,s),o.ray.intersectPlane(f,e)&&("x"===a||"y"===a||"z"===a)){let t=y.subVectors(e,s).dot(D);e.copy(s).addScaledVector(D,t)}}updateDragItem(t,e=!1){E.setFromMatrixPosition(t.obj.matrixWorld),"current"===t.reset?m.subVectors(t.fromPosition,E).divideScalar(t.currentDampingFactor):"original"===t.reset?(m.subVectors(t.obj.userData.worldPosition0,E).divideScalar(t.currentDampingFactor),t.fromPosition.copy(t.obj.userData.worldPosition0),t.pointStart.copy(t.fromPosition),t.pointEnd.copy(t.pointStart)):m.subVectors(t.pointEnd,t.pointStart).add(t.fromPosition).sub(E).divideScalar(t.currentDampingFactor),t.paused=!(t.currentDampingFactor>1)||m.length()<.01,(this.activeEvent&&1===this.activeEvent.data.dampingFactor||e)&&S(t,m.add(E),this.activeEvent?.data.drop&&this.activeEvent?.data.autoOrient?t.orientationMatrix:null),t.obj.dispatchEvent({type:"beginEvent",eventName:"DragDrop"}),this.eventManager.requestRender()}updateCursorFromRaycast(){let{raycaster:t,page:e}=this.eventContext,a=e.raycastWithClones(t),i=!1;for(let t of this.events){for(let{obj:e}of t.dragItems)if(e===a[0]?.object||e===a[0]?.object?.object||s.is(e)&&e.isAncestorOf(a[0]?.object.uuid)){switch(i=!0,t.data.cursor){case"hand":this.setCursor("grab");break;case"move":this.setCursor("move")}break}if(i)break}i||this.setCursor("default")}};i("DragDrop",({eventContext:t,eventManager:e})=>new F(t,e)),h("dragdrop");
|
|
Binary file
|
|
Binary file
|