@splinetool/runtime 2.0.160 → 2.0.161
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/build/{runtime-bloom-BCIKZBEA.js → runtime-bloom-AZYRBSQA.js} +1 -1
- package/build/runtime-bloom-AZYRBSQA.js.br +0 -0
- package/build/runtime-bloom-AZYRBSQA.js.gz +0 -0
- package/build/{runtime-brightnessContrast-4RZUU364.js → runtime-brightnessContrast-WEQJQA5H.js} +1 -1
- package/build/runtime-brightnessContrast-WEQJQA5H.js.br +0 -0
- package/build/runtime-brightnessContrast-WEQJQA5H.js.gz +0 -0
- package/build/{runtime-chromaticAberration-3RHGUSI4.js → runtime-chromaticAberration-GO2J5L4S.js} +1 -1
- package/build/runtime-chromaticAberration-GO2J5L4S.js.br +0 -0
- package/build/runtime-chromaticAberration-GO2J5L4S.js.gz +0 -0
- package/build/{runtime-chunk-OZLC437Q.js → runtime-chunk-3L424UNZ.js} +1 -1
- package/build/{runtime-chunk-OZLC437Q.js.br → runtime-chunk-3L424UNZ.js.br} +0 -0
- package/build/{runtime-chunk-OZLC437Q.js.gz → runtime-chunk-3L424UNZ.js.gz} +0 -0
- package/build/{runtime-chunk-XBG5ROFH.js → runtime-chunk-6I3BABUM.js} +1 -1
- package/build/runtime-chunk-6I3BABUM.js.br +0 -0
- package/build/runtime-chunk-6I3BABUM.js.gz +0 -0
- package/build/{runtime-chunk-WJPI7EAI.js → runtime-chunk-7JZHIVIE.js} +1 -1
- package/build/runtime-chunk-7JZHIVIE.js.br +0 -0
- package/build/runtime-chunk-7JZHIVIE.js.gz +0 -0
- package/build/{runtime-chunk-RYJNVDUM.js → runtime-chunk-APKU3YYA.js} +1 -1
- package/build/runtime-chunk-APKU3YYA.js.br +0 -0
- package/build/runtime-chunk-APKU3YYA.js.gz +0 -0
- package/build/{runtime-chunk-DL4A3K5P.js → runtime-chunk-ARNZDNZ5.js} +1 -1
- package/build/runtime-chunk-ARNZDNZ5.js.br +0 -0
- package/build/runtime-chunk-ARNZDNZ5.js.gz +0 -0
- package/build/{runtime-chunk-7B2VPZYM.js → runtime-chunk-CAU75OZB.js} +1 -1
- package/build/{runtime-chunk-7B2VPZYM.js.br → runtime-chunk-CAU75OZB.js.br} +0 -0
- package/build/{runtime-chunk-7B2VPZYM.js.gz → runtime-chunk-CAU75OZB.js.gz} +0 -0
- package/build/{runtime-chunk-FAV6G64D.js → runtime-chunk-D3YUMVV2.js} +1 -1
- package/build/runtime-chunk-D3YUMVV2.js.br +0 -0
- package/build/runtime-chunk-D3YUMVV2.js.gz +0 -0
- package/build/{runtime-chunk-AHZ2EI5H.js → runtime-chunk-FPOAHQL3.js} +1 -1
- package/build/runtime-chunk-FPOAHQL3.js.br +0 -0
- package/build/runtime-chunk-FPOAHQL3.js.gz +0 -0
- package/build/{runtime-chunk-O2KHHZMS.js → runtime-chunk-FX42TWCV.js} +1 -1
- package/build/runtime-chunk-FX42TWCV.js.br +0 -0
- package/build/runtime-chunk-FX42TWCV.js.gz +0 -0
- package/build/{runtime-chunk-244LC6MP.js → runtime-chunk-J3AY7A6D.js} +1 -1
- package/build/runtime-chunk-J3AY7A6D.js.br +1 -0
- package/build/runtime-chunk-J3AY7A6D.js.gz +0 -0
- package/build/{runtime-chunk-POOKT2FW.js → runtime-chunk-KEVKWE7V.js} +1 -1
- package/build/runtime-chunk-KEVKWE7V.js.br +0 -0
- package/build/runtime-chunk-KEVKWE7V.js.gz +0 -0
- package/build/{runtime-chunk-ZBHADU7F.js → runtime-chunk-R2FZWI7L.js} +1 -1
- package/build/runtime-chunk-R2FZWI7L.js.br +0 -0
- package/build/runtime-chunk-R2FZWI7L.js.gz +0 -0
- package/build/{runtime-chunk-TDGCV24Q.js → runtime-chunk-R2MDXWNY.js} +1 -1
- package/build/runtime-chunk-R2MDXWNY.js.br +0 -0
- package/build/runtime-chunk-R2MDXWNY.js.gz +0 -0
- package/build/{runtime-chunk-BOUH46YB.js → runtime-chunk-RALJRND3.js} +1 -1
- package/build/runtime-chunk-RALJRND3.js.br +0 -0
- package/build/runtime-chunk-RALJRND3.js.gz +0 -0
- package/build/{runtime-chunk-67JVRH4T.js → runtime-chunk-S5UEI4DR.js} +1 -1
- package/build/runtime-chunk-S5UEI4DR.js.br +0 -0
- package/build/runtime-chunk-S5UEI4DR.js.gz +0 -0
- package/build/{runtime-chunk-GFMUAGIR.js → runtime-chunk-SEEDV66Z.js} +1 -1
- package/build/runtime-chunk-SEEDV66Z.js.br +0 -0
- package/build/runtime-chunk-SEEDV66Z.js.gz +0 -0
- package/build/{runtime-chunk-DGTIMU6T.js → runtime-chunk-TJP5IVFO.js} +1 -1
- package/build/runtime-chunk-TJP5IVFO.js.br +0 -0
- package/build/runtime-chunk-TJP5IVFO.js.gz +0 -0
- package/build/{runtime-chunk-KAPSF5TL.js → runtime-chunk-TTAYL3F7.js} +1 -1
- package/build/runtime-chunk-TTAYL3F7.js.br +0 -0
- package/build/runtime-chunk-TTAYL3F7.js.gz +0 -0
- package/build/{runtime-chunk-C2CAU2UD.js → runtime-chunk-UCF5M2I6.js} +1 -1
- package/build/runtime-chunk-UCF5M2I6.js.br +0 -0
- package/build/runtime-chunk-UCF5M2I6.js.gz +0 -0
- package/build/{runtime-chunk-APVHFUEV.js → runtime-chunk-WCP7DFUY.js} +1 -1
- package/build/runtime-chunk-WCP7DFUY.js.br +0 -0
- package/build/runtime-chunk-WCP7DFUY.js.gz +0 -0
- package/build/{runtime-chunk-B746A6R3.js → runtime-chunk-X77TCT7I.js} +1 -1
- package/build/runtime-chunk-X77TCT7I.js.br +0 -0
- package/build/runtime-chunk-X77TCT7I.js.gz +0 -0
- package/build/{runtime-chunk-UQM7NEPK.js → runtime-chunk-XKCF5GDT.js} +1 -1
- package/build/runtime-chunk-XKCF5GDT.js.br +0 -0
- package/build/runtime-chunk-XKCF5GDT.js.gz +0 -0
- package/build/{runtime-chunk-T2V3VIUH.js → runtime-chunk-Y3KCBH76.js} +1 -1
- package/build/runtime-chunk-Y3KCBH76.js.br +0 -0
- package/build/runtime-chunk-Y3KCBH76.js.gz +0 -0
- package/build/{runtime-chunk-I3KZIMEW.js → runtime-chunk-Y7GWLY3V.js} +1 -1
- package/build/runtime-chunk-Y7GWLY3V.js.br +0 -0
- package/build/runtime-chunk-Y7GWLY3V.js.gz +0 -0
- package/build/{runtime-chunk-UEKUXDLG.js → runtime-chunk-YI4JK7UO.js} +1 -1
- package/build/runtime-chunk-YI4JK7UO.js.br +0 -0
- package/build/runtime-chunk-YI4JK7UO.js.gz +0 -0
- package/build/{runtime-chunk-CYRTVQZD.js → runtime-chunk-YQALJ3YA.js} +1 -1
- package/build/runtime-chunk-YQALJ3YA.js.br +0 -0
- package/build/runtime-chunk-YQALJ3YA.js.gz +0 -0
- package/build/{runtime-chunk-TFVTJVME.js → runtime-chunk-ZPZWHJB5.js} +1 -1
- package/build/runtime-chunk-ZPZWHJB5.js.br +0 -0
- package/build/runtime-chunk-ZPZWHJB5.js.gz +0 -0
- package/build/{runtime-classicRuntime-7UEL6B3U.js → runtime-classicRuntime-3OM2N25U.js} +1 -1
- package/build/runtime-classicRuntime-3OM2N25U.js.br +0 -0
- package/build/runtime-classicRuntime-3OM2N25U.js.gz +0 -0
- package/build/{runtime-cloners-IV5JEXST.js → runtime-cloners-WSYWA5ER.js} +1 -1
- package/build/runtime-cloners-WSYWA5ER.js.br +0 -0
- package/build/runtime-cloners-WSYWA5ER.js.gz +0 -0
- package/build/{runtime-components-ABF4V6NS.js → runtime-components-OJLETIM4.js} +1 -1
- package/build/runtime-components-OJLETIM4.js.br +0 -0
- package/build/runtime-components-OJLETIM4.js.gz +0 -0
- package/build/{runtime-createDestroy-ZXW22GR2.js → runtime-createDestroy-2N4SCER3.js} +1 -1
- package/build/runtime-createDestroy-2N4SCER3.js.br +0 -0
- package/build/runtime-createDestroy-2N4SCER3.js.gz +0 -0
- package/build/{runtime-depthOfField-CMLWIQFI.js → runtime-depthOfField-JWGMZTMT.js} +1 -1
- package/build/runtime-depthOfField-JWGMZTMT.js.br +0 -0
- package/build/runtime-depthOfField-JWGMZTMT.js.gz +0 -0
- package/build/{runtime-dragDrop-YWEZOTXF.js → runtime-dragDrop-WYPV3QDK.js} +1 -1
- package/build/runtime-dragDrop-WYPV3QDK.js.br +0 -0
- package/build/runtime-dragDrop-WYPV3QDK.js.gz +0 -0
- package/build/{runtime-gameControls-AHOA36GR.js → runtime-gameControls-3XOIAHXD.js} +1 -1
- package/build/runtime-gameControls-3XOIAHXD.js.br +0 -0
- package/build/runtime-gameControls-3XOIAHXD.js.gz +0 -0
- package/build/{runtime-hair-6WVY27RG.js → runtime-hair-TQL4XBNY.js} +1 -1
- package/build/runtime-hair-TQL4XBNY.js.br +1 -0
- package/build/runtime-hair-TQL4XBNY.js.gz +0 -0
- package/build/{runtime-hueSaturation-EW54YMQI.js → runtime-hueSaturation-JFSLUMFA.js} +1 -1
- package/build/runtime-hueSaturation-JFSLUMFA.js.br +0 -0
- package/build/runtime-hueSaturation-JFSLUMFA.js.gz +0 -0
- package/build/{runtime-mergeStaticGeometries-DUF2ZBXY.js → runtime-mergeStaticGeometries-N7N222AD.js} +1 -1
- package/build/runtime-mergeStaticGeometries-N7N222AD.js.br +0 -0
- package/build/runtime-mergeStaticGeometries-N7N222AD.js.gz +0 -0
- package/build/{runtime-miscActions-R35TOHOE.js → runtime-miscActions-JQO2WQCN.js} +1 -1
- package/build/runtime-miscActions-JQO2WQCN.js.br +0 -0
- package/build/runtime-miscActions-JQO2WQCN.js.gz +0 -0
- package/build/{runtime-mouseHover-5TKLUE6P.js → runtime-mouseHover-X3APMLF7.js} +1 -1
- package/build/runtime-mouseHover-X3APMLF7.js.br +0 -0
- package/build/runtime-mouseHover-X3APMLF7.js.gz +0 -0
- package/build/{runtime-noise-7B3N6OON.js → runtime-noise-T6QUZXNL.js} +1 -1
- package/build/runtime-noise-T6QUZXNL.js.br +0 -0
- package/build/runtime-noise-T6QUZXNL.js.gz +0 -0
- package/build/{runtime-particles-Z4L6HZL7.js → runtime-particles-MRMHJLVS.js} +1 -1
- package/build/runtime-particles-MRMHJLVS.js.br +0 -0
- package/build/runtime-particles-MRMHJLVS.js.gz +0 -0
- package/build/{runtime-paths-OB53G53L.js → runtime-paths-VUYUX4CL.js} +1 -1
- package/build/runtime-paths-VUYUX4CL.js.br +0 -0
- package/build/runtime-paths-VUYUX4CL.js.gz +0 -0
- package/build/{runtime-pixelation-TZDENYAX.js → runtime-pixelation-XL32HHQ3.js} +1 -1
- package/build/runtime-pixelation-XL32HHQ3.js.br +0 -0
- package/build/runtime-pixelation-XL32HHQ3.js.gz +0 -0
- package/build/{runtime-resize-M7XLJK2Z.js → runtime-resize-HTMZDDUB.js} +1 -1
- package/build/runtime-resize-HTMZDDUB.js.br +0 -0
- package/build/runtime-resize-HTMZDDUB.js.gz +0 -0
- package/build/{runtime-sceneTransition-AU5Y32AU.js → runtime-sceneTransition-X4AHNGUD.js} +1 -1
- package/build/runtime-sceneTransition-X4AHNGUD.js.br +0 -0
- package/build/runtime-sceneTransition-X4AHNGUD.js.gz +0 -0
- package/build/{runtime-scroll-GPW7QYFP.js → runtime-scroll-FRB22LCS.js} +1 -1
- package/build/runtime-scroll-FRB22LCS.js.br +0 -0
- package/build/runtime-scroll-FRB22LCS.js.gz +0 -0
- package/build/runtime-shapeBlends-S7C3QIM2.js +1 -0
- package/build/runtime-shapeBlends-S7C3QIM2.js.br +0 -0
- package/build/runtime-shapeBlends-S7C3QIM2.js.gz +0 -0
- package/build/{runtime-text-YREQB5BX.js → runtime-text-HWI2HJRR.js} +1 -1
- package/build/runtime-text-HWI2HJRR.js.br +0 -0
- package/build/runtime-text-HWI2HJRR.js.gz +0 -0
- package/build/{runtime-textInputs-EFSQQG2P.js → runtime-textInputs-77HD6CUE.js} +1 -1
- package/build/runtime-textInputs-77HD6CUE.js.br +0 -0
- package/build/runtime-textInputs-77HD6CUE.js.gz +0 -0
- package/build/{runtime-timeline-VMFKGIK3.js → runtime-timeline-CJTR4QKE.js} +1 -1
- package/build/runtime-timeline-CJTR4QKE.js.br +0 -0
- package/build/runtime-timeline-CJTR4QKE.js.gz +0 -0
- package/build/{runtime-tracking-OWGVF3I3.js → runtime-tracking-5XAAQOHM.js} +1 -1
- package/build/runtime-tracking-5XAAQOHM.js.br +0 -0
- package/build/runtime-tracking-5XAAQOHM.js.gz +0 -0
- package/build/{runtime-transitions-4G2IA576.js → runtime-transitions-MUC3XJNU.js} +1 -1
- package/build/runtime-transitions-MUC3XJNU.js.br +0 -0
- package/build/runtime-transitions-MUC3XJNU.js.gz +0 -0
- package/build/{runtime-ui2d-AEDWPLLS.js → runtime-ui2d-A3EXZNGO.js} +1 -1
- package/build/runtime-ui2d-A3EXZNGO.js.br +0 -0
- package/build/runtime-ui2d-A3EXZNGO.js.gz +0 -0
- package/build/{runtime-vectorShapes-DUPPP7JJ.js → runtime-vectorShapes-4QQBRQDQ.js} +1 -1
- package/build/runtime-vectorShapes-4QQBRQDQ.js.br +0 -0
- package/build/runtime-vectorShapes-4QQBRQDQ.js.gz +0 -0
- package/build/{runtime-vignette-M335YXIJ.js → runtime-vignette-OLCPV74G.js} +1 -1
- package/build/runtime-vignette-OLCPV74G.js.br +0 -0
- package/build/runtime-vignette-OLCPV74G.js.gz +0 -0
- package/build/{runtime-webgpu-NLOKHPVE.js → runtime-webgpu-TO23442C.js} +1 -1
- package/build/runtime-webgpu-TO23442C.js.br +0 -0
- package/build/runtime-webgpu-TO23442C.js.gz +0 -0
- package/build/runtime.cjs +7 -7
- 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/build/runtime-bloom-BCIKZBEA.js.br +0 -0
- package/build/runtime-bloom-BCIKZBEA.js.gz +0 -0
- package/build/runtime-brightnessContrast-4RZUU364.js.br +0 -0
- package/build/runtime-brightnessContrast-4RZUU364.js.gz +0 -0
- package/build/runtime-chromaticAberration-3RHGUSI4.js.br +0 -0
- package/build/runtime-chromaticAberration-3RHGUSI4.js.gz +0 -0
- package/build/runtime-chunk-244LC6MP.js.br +0 -1
- package/build/runtime-chunk-244LC6MP.js.gz +0 -0
- package/build/runtime-chunk-67JVRH4T.js.br +0 -0
- package/build/runtime-chunk-67JVRH4T.js.gz +0 -0
- package/build/runtime-chunk-AHZ2EI5H.js.br +0 -0
- package/build/runtime-chunk-AHZ2EI5H.js.gz +0 -0
- package/build/runtime-chunk-APVHFUEV.js.br +0 -0
- package/build/runtime-chunk-APVHFUEV.js.gz +0 -0
- package/build/runtime-chunk-B746A6R3.js.br +0 -0
- package/build/runtime-chunk-B746A6R3.js.gz +0 -0
- package/build/runtime-chunk-BOUH46YB.js.br +0 -0
- package/build/runtime-chunk-BOUH46YB.js.gz +0 -0
- package/build/runtime-chunk-C2CAU2UD.js.br +0 -0
- package/build/runtime-chunk-C2CAU2UD.js.gz +0 -0
- package/build/runtime-chunk-CYRTVQZD.js.br +0 -0
- package/build/runtime-chunk-CYRTVQZD.js.gz +0 -0
- package/build/runtime-chunk-DGTIMU6T.js.br +0 -0
- package/build/runtime-chunk-DGTIMU6T.js.gz +0 -0
- package/build/runtime-chunk-DL4A3K5P.js.br +0 -0
- package/build/runtime-chunk-DL4A3K5P.js.gz +0 -0
- package/build/runtime-chunk-FAV6G64D.js.br +0 -0
- package/build/runtime-chunk-FAV6G64D.js.gz +0 -0
- package/build/runtime-chunk-GFMUAGIR.js.br +0 -0
- package/build/runtime-chunk-GFMUAGIR.js.gz +0 -0
- package/build/runtime-chunk-I3KZIMEW.js.br +0 -0
- package/build/runtime-chunk-I3KZIMEW.js.gz +0 -0
- package/build/runtime-chunk-KAPSF5TL.js.br +0 -0
- package/build/runtime-chunk-KAPSF5TL.js.gz +0 -0
- package/build/runtime-chunk-O2KHHZMS.js.br +0 -0
- package/build/runtime-chunk-O2KHHZMS.js.gz +0 -0
- package/build/runtime-chunk-POOKT2FW.js.br +0 -0
- package/build/runtime-chunk-POOKT2FW.js.gz +0 -0
- package/build/runtime-chunk-RYJNVDUM.js.br +0 -0
- package/build/runtime-chunk-RYJNVDUM.js.gz +0 -0
- package/build/runtime-chunk-T2V3VIUH.js.br +0 -0
- package/build/runtime-chunk-T2V3VIUH.js.gz +0 -0
- package/build/runtime-chunk-TDGCV24Q.js.br +0 -0
- package/build/runtime-chunk-TDGCV24Q.js.gz +0 -0
- package/build/runtime-chunk-TFVTJVME.js.br +0 -0
- package/build/runtime-chunk-TFVTJVME.js.gz +0 -0
- package/build/runtime-chunk-UEKUXDLG.js.br +0 -0
- package/build/runtime-chunk-UEKUXDLG.js.gz +0 -0
- package/build/runtime-chunk-UQM7NEPK.js.br +0 -0
- package/build/runtime-chunk-UQM7NEPK.js.gz +0 -0
- package/build/runtime-chunk-WJPI7EAI.js.br +0 -0
- package/build/runtime-chunk-WJPI7EAI.js.gz +0 -0
- package/build/runtime-chunk-XBG5ROFH.js.br +0 -0
- package/build/runtime-chunk-XBG5ROFH.js.gz +0 -0
- package/build/runtime-chunk-ZBHADU7F.js.br +0 -0
- package/build/runtime-chunk-ZBHADU7F.js.gz +0 -0
- package/build/runtime-classicRuntime-7UEL6B3U.js.br +0 -0
- package/build/runtime-classicRuntime-7UEL6B3U.js.gz +0 -0
- package/build/runtime-cloners-IV5JEXST.js.br +0 -0
- package/build/runtime-cloners-IV5JEXST.js.gz +0 -0
- package/build/runtime-components-ABF4V6NS.js.br +0 -0
- package/build/runtime-components-ABF4V6NS.js.gz +0 -0
- package/build/runtime-createDestroy-ZXW22GR2.js.br +0 -0
- package/build/runtime-createDestroy-ZXW22GR2.js.gz +0 -0
- package/build/runtime-depthOfField-CMLWIQFI.js.br +0 -0
- package/build/runtime-depthOfField-CMLWIQFI.js.gz +0 -0
- package/build/runtime-dragDrop-YWEZOTXF.js.br +0 -0
- package/build/runtime-dragDrop-YWEZOTXF.js.gz +0 -0
- package/build/runtime-gameControls-AHOA36GR.js.br +0 -0
- package/build/runtime-gameControls-AHOA36GR.js.gz +0 -0
- package/build/runtime-hair-6WVY27RG.js.br +0 -2
- package/build/runtime-hair-6WVY27RG.js.gz +0 -0
- package/build/runtime-hueSaturation-EW54YMQI.js.br +0 -0
- package/build/runtime-hueSaturation-EW54YMQI.js.gz +0 -0
- package/build/runtime-mergeStaticGeometries-DUF2ZBXY.js.br +0 -0
- package/build/runtime-mergeStaticGeometries-DUF2ZBXY.js.gz +0 -0
- package/build/runtime-miscActions-R35TOHOE.js.br +0 -0
- package/build/runtime-miscActions-R35TOHOE.js.gz +0 -0
- package/build/runtime-mouseHover-5TKLUE6P.js.br +0 -0
- package/build/runtime-mouseHover-5TKLUE6P.js.gz +0 -0
- package/build/runtime-noise-7B3N6OON.js.br +0 -0
- package/build/runtime-noise-7B3N6OON.js.gz +0 -0
- package/build/runtime-particles-Z4L6HZL7.js.br +0 -0
- package/build/runtime-particles-Z4L6HZL7.js.gz +0 -0
- package/build/runtime-paths-OB53G53L.js.br +0 -0
- package/build/runtime-paths-OB53G53L.js.gz +0 -0
- package/build/runtime-pixelation-TZDENYAX.js.br +0 -0
- package/build/runtime-pixelation-TZDENYAX.js.gz +0 -0
- package/build/runtime-resize-M7XLJK2Z.js.br +0 -0
- package/build/runtime-resize-M7XLJK2Z.js.gz +0 -0
- package/build/runtime-sceneTransition-AU5Y32AU.js.br +0 -0
- package/build/runtime-sceneTransition-AU5Y32AU.js.gz +0 -0
- package/build/runtime-scroll-GPW7QYFP.js.br +0 -0
- package/build/runtime-scroll-GPW7QYFP.js.gz +0 -0
- package/build/runtime-shapeBlends-PDAXXKUK.js +0 -1
- package/build/runtime-shapeBlends-PDAXXKUK.js.br +0 -3
- package/build/runtime-shapeBlends-PDAXXKUK.js.gz +0 -0
- package/build/runtime-text-YREQB5BX.js.br +0 -0
- package/build/runtime-text-YREQB5BX.js.gz +0 -0
- package/build/runtime-textInputs-EFSQQG2P.js.br +0 -0
- package/build/runtime-textInputs-EFSQQG2P.js.gz +0 -0
- package/build/runtime-timeline-VMFKGIK3.js.br +0 -0
- package/build/runtime-timeline-VMFKGIK3.js.gz +0 -0
- package/build/runtime-tracking-OWGVF3I3.js.br +0 -0
- package/build/runtime-tracking-OWGVF3I3.js.gz +0 -0
- package/build/runtime-transitions-4G2IA576.js.br +0 -0
- package/build/runtime-transitions-4G2IA576.js.gz +0 -0
- package/build/runtime-ui2d-AEDWPLLS.js.br +0 -0
- package/build/runtime-ui2d-AEDWPLLS.js.gz +0 -0
- package/build/runtime-vectorShapes-DUPPP7JJ.js.br +0 -0
- package/build/runtime-vectorShapes-DUPPP7JJ.js.gz +0 -0
- package/build/runtime-vignette-M335YXIJ.js.br +0 -0
- package/build/runtime-vignette-M335YXIJ.js.gz +0 -0
- package/build/runtime-webgpu-NLOKHPVE.js.br +0 -0
- package/build/runtime-webgpu-NLOKHPVE.js.gz +0 -0
|
Binary file
|
|
Binary file
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{f as t}from"./runtime-chunk-RTLL6WIB.js";import{h as e}from"./runtime-chunk-2PT2WH66.js";import{c as i}from"./runtime-chunk-TZCHGFVF.js";import{C as s,Ca as r,Da as a,Fa as n,J as o,Sa as l,i as h,j as p,k as d,n as c}from"./runtime-chunk-ADHKZQMB.js";import{Ec as u,Gc as m,Hc as f,Md as y,Qc as v,Rc as g,Rd as x,Tc as S,Te as w,Zc as M,bd as B,dd as b,ed as P,fd as E,md as A,nd as C}from"./runtime-chunk-KPOUV3HD.js";var D={Cloner:null,changeEntityProptotype:()=>{},createEntity:()=>{}};function O(t,e){let i=[];if(e.length!==t.length)return null;{let s=0;for(;s<t.length;){if("*"===e[s])i.push(t[s]);else if(t[s]!==e[s])return null;s+=1}}return i}function _(t,e){let i=[];if(!(e.length<=t.length))return null;{let s=0;for(;s<e.length;){if("*"===e[s])i.push(t[s]);else if(t[s]!==e[s])return null;s+=1}}return i}var V=new f,R=new f,T=new v,W=[new f(-1,1,1),new f(-1,-1,1),new f(1,-1,1),new f(1,1,1),new f(-1,1,-1),new f(-1,-1,-1),new f(1,-1,-1),new f(1,1,-1)],U=[[0,3],[1,2],[5,6],[4,7],[0,1],[3,2],[7,6],[4,5],[0,4],[1,5],[2,6],[3,7]],I=[[0,2],[7,5],[4,1],[3,6],[4,3],[1,6]],L=(t,e,i)=>{t.updateEntityBoxSize(V,R),T.copy(e).multiply(t.matrixWorld),0===R.x&&0===R.y&&0===R.z?i.push(new f(V.x,V.y,V.z).applyMatrix4(T)):W.forEach(t=>{i.push(t.clone().multiply(R).add(V).applyMatrix4(T))})},F=class extends M{constructor(){super(...arguments),this.matrix=new v,this.vertices=[],this.faces=[],this.edges=[],this.centerEdges=[]}copy(t){return super.copy(t),this.matrix.copy(t.matrix),this.vertices=t.vertices.map(t=>t.clone()),this.faces=t.faces.map(t=>t.clone()),this.edges=t.edges.map(t=>t.clone()),this.centerEdges=t.centerEdges.map(t=>t.clone()),this}setFromObjectSize(t,e=!1){t.updateWorldMatrix(!1,e),this.makeEmpty(),this.matrix.copy(t.matrixWorld);let i=(new v).copy(t.matrixWorld).invert();return this.expandByObjectSize(t,i,e)}expandByObjectSize(t,e,i=!1){let s=[];if(!0===i){let i=[];t.traverseEntity(t=>{if(t.visible||t.cloner&&t.data.visible){if(!("geometry"in t))return T.copy(e).multiply(t.matrixWorld),void i.push((new f).applyMatrix4(T));L(t,e,s)}}),0===s.length&&s.push(...i)}else L(t,e,s);return this.setFromPoints(s)}getCenter(t){return(t=super.getCenter(t)).applyMatrix4(this.matrix),t}getPositionToCenter(t){return(t=super.getCenter(t)).applyMatrix4(T.copy(this.matrix).setPosition(0,0,0)),t}computeVertices(){this.getSize(R).multiplyScalar(.5),this.getCenter(V),T.copy(this.matrix).setPosition(V),this.vertices=W.map(t=>t.clone().multiply(R).applyMatrix4(T))}computeEdges(){this.vertices.length>0&&this.computeVertices(),this.edges=U.map(([t,e])=>new w(this.vertices[t],this.vertices[e])),this.centerEdges=this.edges.map(t=>t.getCenter(new f))}computeFaces(){this.vertices.length>0&&this.computeVertices(),this.faces=I.map(([t,e])=>this.vertices[t].clone().add(this.vertices[e]).multiplyScalar(.5))}},z=new f(1,1,1);function j(t,e,i,s,r=new v){return r.compose(t,e,z).multiply(i).scale(s)}var N,k=new v;(N||(N={})).is=function(t){return t&&t.__isSPEObject};var G=t=>class extends t{constructor(){super(...arguments),this.previousModelViewMatrix=new v,this.copyPreviousMatrix=!0,this.pivotMatrix=new v,this.matrixWorldRigid=new v,this.shearScale=new v,this.shearScaleInv=new v,this.shearMatrix=new v}get __isSPEObject(){return!0}getPhysicsLocalMatrix(t){return!!this.rigidBody?.isDynamic()&&(t.copy(this.matrixWorld),this.hasNonUniformScale&&t.multiply(this.shearScaleInv),this.parent&&t.premultiply(k.copy(this.parent.matrixWorld).invert()),t.multiply(k.copy(this.pivotMatrix).invert()),!0)}isDescendantOf(t){t instanceof S&&(t=t.uuid);let e=this;for(;e.parent;){if(e.parent.uuid===t)return!0;e=e.parent}return!1}updateMatrix(){!this.shearMatrix||(j(this.position,this.quaternion,this.shearMatrix,this.scale,this.matrix),this.matrixWorldNeedsUpdate=!0)}updateMatrixWorld(t){this.matrixAutoUpdate&&this.updateMatrix(),(this.matrixWorldNeedsUpdate||t)&&(null===this.parent?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix),this.matrixWorld.multiply(this.pivotMatrix),this.matrixWorldNeedsUpdate=!1,t=!0);for(let e of this.children)e.updateMatrixWorld(t)}updateWorldMatrix(t,e){let i=this.parent;if(t&&null!==i&&i.updateWorldMatrix(!0,!1),this.matrixAutoUpdate&&this.updateMatrix(),null===this.parent?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix),this.matrixWorld.multiply(this.pivotMatrix),e)for(let t of this.children)t.updateWorldMatrix(!1,!0)}traverseChildren(t,e=0){for(let i of this.children)N.is(i)&&i.traverseObject(t,e+1)}traverseObject(t,e=0){if(!0!==t(this,e))for(let i of this.children)N.is(i)&&i.traverseObject(t,e+1)}updateMatrixWorldRigid(){this.hasNonUniformScale=l(this.matrixWorld,this.matrixWorldRigid,this.shearScale),this.matrixWorldRigid.copyPosition(this.matrixWorld),this.shearScaleInv.copy(this.shearScale).invert()}attach(t,e){this.updateWorldMatrix(!0,!1);let i=(new v).copy(this.matrixWorld).invert();return null!==t.parent&&(t.parent.updateWorldMatrix(!0,!1),i.multiply(t.parent.matrixWorld)),t.applyMatrix4(i),t.updateWorldMatrix(!1,!1),this.add(t),void 0!==e&&(this.children.pop(),this.children.splice(e,0,t)),this}copy(t,e=!1){return super.copy(t,e),this}onAfterRender(t,e,i,s,r,a){this.copyPreviousMatrix&&this.previousModelViewMatrix.copy(this.modelViewMatrix)}},H=class extends x{constructor(){super()}getPoints(t=12){let e,i=[],s=this.getCurveLengths(),r=s[s.length-1]/s.length;for(let a=0,n=this.curves;a<n.length;a++){let o=n[a],l=0===a?s[a]:s[a]-s[a-1],h=Math.ceil(t*l/r),p=o.getPoints(h);for(let t=0;t<p.length;t++){let s=p[t];e&&e.equals(s)||(i.push(s),e=s)}}return this.autoClose&&i.length>1&&!i[i.length-1].equals(i[0])&&i.push(i[0]),i}},q=.001,Z=new f,Q=new f,K=new f,J=new f,X=new f,Y=new f,$=new f,tt=new f,et=new f;function it(t,e,i){return Z.subVectors(e,t),Q.subVectors(e,i),Z.cross(Q).length()<=q}var st=new WeakMap;function rt(t){let e=st.get(t.points);if(void 0!==e&&e.isClosed===t.isClosed)return e.curve;let i=function(t){let e=t.points,i=[e[0]],s=[new f(...e[0].data.position)];K.copy(s[0]);for(let t=0;t<e.length-1;t++)Z.fromArray(e[t].data.position),Q.fromArray(e[t+1].data.position),X.subVectors(Z,K),$.subVectors(Z,Q),X.cross($).length()>q&&(i.push(e[t]),s.push((new f).copy(Z)),K.copy(Z));let r=e[e.length-1];i.push(r),s.push(new f(...r.data.position));let a=t.isClosed,n=i.length-(a?0:1),o=i.length,l=[],h=[];for(let t=0;t<o;t++){let e=i[t].data;l.push(new f(...e.controlPrevious.position)),h.push(new f(...e.controlNext.position))}let p=[];for(let t=0;t<n;t++){let e=t===o-1?0:t+1;p.push(it(s[t],h[t],s[e])&&it(s[t],l[e],s[e]))}let d=[];for(let t=0;t<o;t++){let e=i[t].data,r=s[t],n={position:r,prevDir:void 0,nextDir:void 0,controlPrevious:l[t],controlNext:h[t],tan:void 0,baseRoundness:e.roundness,removedLength:0};if(d.push(n),0===e.roundness||!a&&(0===t||t===o-1))continue;let c=a&&0==t?o-1:t-1,u=a&&t==o-1?0:t+1,m=(new f).subVectors(s[c],r).normalize(),y=(new f).subVectors(s[u],r).normalize();n.prevDir=m,n.nextDir=y;let v=p[a&&0===t?o-1:t-1],g=p[t];if(v&&g){J.addVectors(m,y).normalize();let t=K.crossVectors(J,m).length()/m.dot(J);n.tan=t,n.removedLength=e.roundness/t}}for(let t=0;t<n;t++){let e=a&&t===o-1?0:t+1,i=d[t],s=d[e];if(0!==i.removedLength||0!==s.removedLength){let t=i.position.distanceTo(s.position);i.removedLength=Math.min(i.removedLength,t/2),s.removedLength=Math.min(s.removedLength,t/2)}}let c=new Array(2*o).fill(null);for(let t=0;t<n;t++){let e=a&&t===o-1?0:t+1,i=d[t],s=d[e],r=null;if(p[t]){let t=i.position.clone(),e=s.position.clone();(0!==i.removedLength||0!==s.removedLength)&&(i.nextDir&&t.add(K.copy(i.nextDir).setLength(i.removedLength)),s.prevDir&&e.add(K.copy(s.prevDir).setLength(s.removedLength))),t.distanceTo(e)>q&&(r=new y(t,t.clone().lerp(e,.3),e.clone().lerp(t,.3),e))}else i.position.distanceTo(s.position)>q&&(r=new y(i.position,i.controlNext,s.controlPrevious,s.position));c[2*t+1]=r}for(let t=0;t<o;t++){let e=d[t];if(0===e.removedLength)continue;let i=e.position,s=e.prevDir.clone().multiplyScalar(e.removedLength).add(i),r=e.nextDir.clone().multiplyScalar(e.removedLength).add(i),a=e.tan*e.removedLength;J.addVectors(e.prevDir,e.nextDir).normalize(),X.copy(s).lerp(r,.5);let n=s.distanceTo(r)/2;et.copy(J).multiplyScalar(Math.sqrt(Math.pow(a,2)-Math.pow(n,2))).add(X),Y.copy(J).multiplyScalar(-a).add(et);let o=i.distanceTo(Y)/i.distanceTo(X);$.copy(e.prevDir).multiplyScalar(o*i.distanceTo(s)).add(i),tt.copy($).lerp(Y,2);let l=s.clone().lerp($,4/3),h=r.clone().lerp(tt,4/3);c[2*t]=new y(s,l,h,r)}let u=new H;for(let t=0;t<c.length;t++){let e=c[t];e&&u.add(e)}return u}(t);return st.set(t.points,{isClosed:t.isClosed,curve:i}),i}var at,nt=new v,ot=new m,lt=new m,ht=new g,pt=new f,dt=new f(0,1,0);(at||(at={})).is=function(t){return t&&t.__isEntity};var ct=t=>at.is(t),ut={type:"completeState",isfromEntity:!0},mt=["x","y","z"],ft=new f,yt=new f(1,1,1),vt=new m,gt=new g,xt=new v,St=l=>class extends(G(l)){constructor(){super(...arguments),this.raycastLock=!1,this.scaleLock=!1,this.disposed=!1,this.stateSelection=null,this.destroyedInAction=!1,this.instances=[],this.prevState=null,this.currentState=null,this.currentAnimationAction=null,this.reversibleToState=null,this.transitionState={settled:!0,state:null},this.currentTransitionEvent=null,this.previousAction=null,this._singleBBox=new F,this._recursiveBBox=new F,this.singleBBoxNeedsUpdate=!0,this.recursiveBBoxNeedsUpdate=!0,this._needApplyPathSnapping=!0,this.attachedPaths=new Set}get __isEntity(){return!0}entityChildren(t){let e=this.children[t];if(at.is(e))return e}entityChildrenCount(){let t=this.children.length;for(;t--;)if(at.is(this.children[t]))return t+1;return 0}get isConcreteEntity(){return"string"==typeof this.identity}get isVirtualEntity(){return"string"!=typeof this.identity}get isInstanceRoot(){return this.isConcreteEntity&&"Instance"===this.data.type}nearestInstanceSelfOrParent(){let t=this;for(;"Instance"!==t.data.type;){let e=t.parent;if(!at.is(e))return;t=e}return t}forInstancesRec(t){this.instances.forEach(e=>{e.disposed||t(e),e.forInstancesRec(t)})}super_Entity(t,e){"string"==typeof t&&(this.uuid=t),this.identity=t,this.data=e,this.matrixAutoUpdate=!1,this.dataPatched=this.data}changeSelectedState(t,e,i=!1){if(0!==this.data.states.length||i){for(let t of this.data.states)n.toOps(this.data,t.data).forEach(t=>{let i=p.replaceProps(t,this.data);this.dataPatched=this.data,this.updateByPatchedOp(i,this.data,e)});if(null!==t){let i=this.data.states.data(t);i&&(this.dataPatched=n.patch(this.data,i),n.toOps(this.data,i).forEach(t=>{this.updateByPatchedOp(t,this.dataPatched,e)}))}i&&this.updateTransformState(this.dataPatched,e),this.stateSelection=t,this.updatePathSnapping(this.dataPatched.pathSnapping)}}get singleBBox(){return this.singleBBoxNeedsUpdate&&(this.singleBBoxNeedsUpdate=!1,this._singleBBox.setFromObjectSize(this,!1),this._singleBBox.computeVertices(),this._singleBBox.computeEdges(),this._singleBBox.computeFaces()),this._singleBBox}get recursiveBBox(){return this.recursiveBBoxNeedsUpdate&&(this.recursiveBBoxNeedsUpdate=!1,this._recursiveBBox.setFromObjectSize(this,!0),this._recursiveBBox.computeVertices(),this._recursiveBBox.computeEdges(),this._recursiveBBox.computeFaces()),this._recursiveBBox}updateEntityBoxSize(t,e){t.setScalar(0),e.setScalar(0)}resetBBoxNeedsUpdateSelf(){this.singleBBoxNeedsUpdate=!0,this.recursiveBBoxNeedsUpdate=!0}resetBBoxNeedsUpdate(){this.resetBBoxNeedsUpdateSelf(),this.traverseAncestors(t=>{ct(t)&&t.resetBBoxNeedsUpdateSelf()}),this.traverseEntity(t=>{t.resetBBoxNeedsUpdateSelf()})}find(t){let e;return this.traverseEntity(i=>{i.uuid===t&&(e=i)}),e}traverseSortNextHelper(){let t=this.parent;if(t){let e=t.children,i=e.indexOf(this)+1;if(at.is(e[i]))return e[i];if(at.is(t))return t.traverseSortNextHelper()}}sortNext(){let t=this.children;return this.children.length>0&&at.is(this.children[0])?t[0]:this.traverseSortNextHelper()}goUp(t){let e=this;for(;t>0&&null!==e;)e=e.parent,t-=1;return e}hasAnccestorOrSelf(t){return this===t||this.hasAnccestor(t)}hasAnccestor(t){let e=this.parent;for(;e;){if(t===e)return!0;e=e.parent}return!1}countToAccestor(t){let e=0,i=this;for(;i!==t;){if(null===i)return-1;i=i.parent,e+=1}return e}forEachEntity(t){for(let e of this.children)ct(e)&&t(e)}traverseEntityAncestors(t){this.traverseAncestors(e=>{at.is(e)&&t(e)})}traverseConcreteEntity(t,e=0){if(!0!==t(this,e))for(let i of this.children)ct(i)&&i.isConcreteEntity&&i.traverseEntity(t,e+1)}traverseEntity(t,e=0){if(!0!==t(this,e))for(let i of this.children)ct(i)&&i.traverseEntity(t,e+1)}traverseVisibleEntity(t){t(this);for(let e of this.children)ct(e)&&e.visible&&e.traverseVisibleEntity(t)}updateMatrix(){super.updateMatrix(),this.cloner&&this.cloner.onObjUpdateMatrix(),this.dispatchEvent({type:"updateMatrix"})}updateMatrixWorld(t){super.updateMatrixWorld(t),this.dispatchEvent({type:"updateMatrixWorld"})}copy(t,e=!1){return super.copy(t,e),this.dataPatched=t.dataPatched,this.raycastLock=t.raycastLock,this.scaleLock=t.scaleLock,this}hasEntityChild(){return this.children.some(t=>ct(t))}isAncestorOf(t){if(this.uuid===t)return!1;let e=!1;return this.traverseEntity(i=>{i.uuid===t&&(e=!0)}),e}toObjectTransformState(e=[]){this.updateWorldMatrix(!0,!1);let i={position:this.position.toArray(),rotation:[this.rotation.x*u.RAD2DEG,this.rotation.y*u.RAD2DEG,this.rotation.z*u.RAD2DEG],scale:this.scale.toArray(),shear:s.fromMatrix(this.shearMatrix.toArray()),pivot:[0,0,0],pivotRotation:[0,0,0]};return t(i,e)}getTransformValues(t,e,i){return e[t].map((e,s)=>i?.shared.getVariable(e,[this.uuid,t,mt[s]])??e)}updateTransformState(t,e){let i=!1;if(t.position&&(this.position.fromArray(this.getTransformValues("position",t,e)),i=!0),t.rotation&&(ft.fromArray(this.getTransformValues("rotation",t,e)).multiplyScalar(u.DEG2RAD),this.rotation.setFromVector3(ft),i=!0),t.scale&&(this.scale.fromArray(this.getTransformValues("scale",t,e)),i=!0),t.shear&&(this.shearMatrix.fromArray(s.toMatrix(t.shear)),i=!0),void 0!==t.pivot||void 0!==t.pivotRotation)if(i=!0,void 0!==t.pivot&&void 0!==t.pivotRotation)this.pivotMatrix.compose(ft.fromArray(t.pivot).negate(),vt.setFromEuler(gt.fromArray(t.pivotRotation.map(t=>t*u.DEG2RAD))).invert(),yt);else if(void 0!==t.pivot)this.pivotMatrix.setPosition(-t.pivot[0],-t.pivot[1],-t.pivot[2]);else if(void 0!==t.pivotRotation){let e=ft.setFromMatrixPosition(this.pivotMatrix);vt.setFromEuler(gt.fromArray(t.pivotRotation.map(t=>t*u.DEG2RAD))).invert(),this.pivotMatrix.compose(e,vt,yt)}return i&&(this.updateMatrix(),this.resetBBoxNeedsUpdate(),this.invalidateClonerTransform(this),this.traverseEntityAncestors(t=>{t.invalidateClonerTransform(this)})),t.position&&t.rotation&&t.scale&&this.updateWorldMatrix(!1,!0),i}onVariableUpdate(t=!1){t?this.resetBBoxNeedsUpdate():(this.updateMatrix(),this.resetBBoxNeedsUpdate(),this.invalidateClonerTransform(this),this.traverseEntityAncestors(t=>{t.invalidateClonerTransform(this)}),this.requestRender())}dispose(){this.disposed=!0,this.cloner&&(this.cloner.dispose(),this.cloner=void 0)}disposeChildrenRecursively(){for(let t of this.children)at.is(t)&&t.disposeRecursively()}disposeRecursively(){this.dispose(),this.children.forEach(t=>{at.is(t)&&t.disposeRecursively()})}toState(e=[]){let i={name:this.name,visible:this.visible,raycastLock:this.raycastLock,...this.toObjectTransformState(e)};return t(i,e)}updateByObjUpdateOp(t,e){void 0!==t&&this.updateByOp({type:0,props:t,path:[]},{...this.data,...t},e,!1)}updateByOp(t,e,i,s){let o=this.data;this.data=e;let l=t,p=_(t.path,["states","*"]);if(null!==p){if(0===t.type){let[e]=p;if(this?.stateSelection===e){let e={...t.props};if(delete e.name,Object.values(t.props).some(t=>void 0===t)){let i=this.data;if(void 0!==i){let s=c.zoom(i,t.path.slice(2));if(s)for(let i in t.props)void 0===t.props[i]&&i in s&&(e[i]=s[i])}}l={...t,props:e,path:t.path.slice(2)}}}}else if(0===t.type){let e=this.stateSelection?this.data.states.data(this.stateSelection):void 0;if(void 0!==e){if(void 0!==t.props.name&&e.name){let{name:t,...i}=e;e=i}if(void 0!==t.props.material&&"material"in e){let{material:t,...i}=e;e=i}let i=c.removeOverridden(t.path,t.props,e);l={...t,props:i}}}if(this.updateByPatchedOpBase(l,n.patch(this.data,this.stateSelection?this.data.states.data(this.stateSelection):void 0),i),_(t.path,["overrides"])){let s=[],a=[...t.path];for(s.push(a[1]),a.splice(0,2);a.length>0&&"descendants"===a[0];)s.push(a[1]),a.splice(0,2);if(void 0===s[s.length-1]){if(0===t.type)for(let e of Object.keys(t.props)){s[s.length-1]=e;let r=i.scene.findInstance([this.uuid,...s]);r&&(r.overrideData=t.props[e],r.updateState(h.apply(r.component.data,r.overrideData),i))}}else{let n=i.scene.findInstance([this.uuid,...s]);if(n){let o=c.zoom(n.component.data,a);if(0===(t={...t,path:a}).type){let e=t.props;if(o)for(let[i,s]of Object.entries(t.props))void 0===s&&(e===t.props&&(e={...t.props}),e[i]=o[i]);t={...t,props:e}}n.overrideData=r.resolve(e.overrides,s),n.updateByOp(t,d.applySimple(n.data,t),i,!1)}}}else if(this.instances.length>0){let s;if(0===t.path.length&&0===t.type){let e;for(let i of a.rootOverrideProps)i in t.props&&(void 0===e&&(e={}),e[i]=t.props[i]);e&&(s={...t,props:e})}else for(let e of a.rootOverrideProps)if(_(t.path,[e])){s=t;break}void 0!==s&&this.instances.forEach(t=>{if(t.isInstanceRoot){let e=h.filterOp(t.overrideData,s);e&&t.updateByOp(e,d.applySimple(t.data,e),i,!0)}}),this.instances.forEach(s=>{if(!s.isInstanceRoot){let r=h.filterOp(s.overrideData,t);if(r){let a;a=o===s.data&&t===r?e:d.applySimple(s.data,r),s.updateByOp(r,a,i,!0)}}})}}updateByPatchedOpBase(t,e,i){if(this.dataPatched=e,0===t.path.length&&0===t.type)void 0!==t.props.type&&!o.is(t.props.type)&&D.changeEntityProptotype(this,this.data,i);else if(1===t.path.length&&"geometry"===t.path[0]&&0===t.type&&"type"in t.props){D.changeEntityProptotype(this,this.data,i);for(let t of this.children)at.is(t)&&t.updateVisible(i.scene)}this.updateByPatchedOp(t,e,i)}updateByPatchedOp(t,e,i){if(0===t.path.length&&0===t.type?this.updateState(t.props,i):0===t.type&&("resolutionLevel"in t.props||"useChildrenColors"in t.props)&&this.updateState(e,i),"morphTargetInfluences"===t.path[0]&&0===t.type){let s=e.morphTargetInfluences.get(t.path[1])?.data.name;s&&this.updateMorphInfluences(s,i.shared.getVariable(t.props.value,[this.uuid,"morphTargetInfluences",s]))}if(null!==_(t.path,["pathSnapping"])&&(this.updatePathSnapping(e.pathSnapping),this.isVirtualEntity&&i.scene?.syncInstancePathConstraint(this)),null!==_(t.path,["cloner"])){let s=d.drop(t,1);0===s.path.length&&0===s.type&&!0===s.props.disabled?this.setFromClonerState(null,i):this.cloner?this.cloner.updateState(e.cloner,i):(this.setFromClonerState(e.cloner,i),this.expandCloner(i)),this.updateVisible(i.scene)}}updatePathSnapping(t=this.dataPatched.pathSnapping){this._updatedPathSnapping=t,this._needApplyPathSnapping=!0}get updatedPathSnapping(){return this._updatedPathSnapping}applyPathSnapping(t){if(!1===this._needApplyPathSnapping)return;let e=this._updatedPathSnapping?.pathId??this.dataPatched.pathSnapping.pathId,i=this._updatedPathSnapping?.slide??this.dataPatched.pathSnapping.slide??0,s=this._updatedPathSnapping?.offset??this.dataPatched.pathSnapping.offset??0,r=this._updatedPathSnapping?.orientation??this.dataPatched.pathSnapping.orientation;if(null===e)return;let a=t.find(this.isVirtualEntity&&t.pathConstraints.getConstraint(this.uuid)||e);if(!a)return;this._needApplyPathSnapping=!1;let n=a.data;if(n.geometry.path.points.length<=1)return;let o=rt(n.geometry.path),l=function(t){let e=t%1;return e<0?e+1:0===e&&t>0?1:e}(i+s),h=null;try{h=o.curves.length?o.getPointAt(l):null}catch(t){}if(null===h)return;a.updateMatrixWorld();let p=this.parent?xt.copy(this.parent.matrixWorld):xt.identity(),d=function(t,e,i,s){ot.setFromRotationMatrix(nt.extractRotation(s));let r=t.clone().applyMatrix4(nt.copy(s).invert().multiply(i));if(null===e)lt.setFromRotationMatrix(nt.extractRotation(i));else{let t=e.clone().applyMatrix4(nt.extractRotation(i));lt.setFromRotationMatrix(nt.lookAt(pt.set(0,0,0),t,dt))}return{position:r,rotation:(new f).setFromEuler(ht.setFromQuaternion(ot.invert().multiply(lt))).multiplyScalar(u.RAD2DEG)}}(h,"tangential"===r?o.getTangentAt(l):null,a.matrixWorld,p);this.updateTransformState({position:d.position.toArray(),rotation:d.rotation.toArray()}),this.traverseEntity(t=>{t._cameraType&&t.dispatchEvent(ut)})}updateVisible(t){if(this.visible=this.dataPatched.visible&&(!this.dataPatched.cloner||(this.dataPatched.cloner.disabled??!1)||!0!==this.dataPatched.cloner?.hideBase),!t)return;let e=!1;this.traverseEntity(t=>{if("Splat"===t.data.type)return e=!0,!0}),e&&t.reloadSplats()}updateState_Entity(t,e){void 0!==t.name&&(this.name=t.name),void 0!==t.raycastLock&&(this.raycastLock=t.raycastLock),void 0!==t.visible&&(this.updateVisible(e?.scene),this.resetBBoxNeedsUpdate()),e&&"cloner"in t&&void 0!==t.cloner&&(this.setFromClonerState(t.cloner,e),this.updateVisible(e.scene)),this.updateTransformState(t,e)}get attachedSurfaceCloners(){return this.children.filter(t=>e(t)&&"toObject"===t.parameters.type)}setFromClonerState(t,e){if(!this.disposed)if(null===t||t.disabled)this.cloner&&this.cloner.dispose(),this.cloner=void 0;else if(void 0===this.cloner){if(null===D.Cloner)return void i("cloners","a cloner");this.cloner=new D.Cloner(this,t),e.scene.addPendingExpandCloner(this)}else this.cloner.updateState(t,e)}expandCloner(t){!this.disposed&&this.cloner&&this.cloner.expandClones(t)}invalidateClonerTransform(t){this.cloner&&this.cloner.invalidateTransform(t)}requestRender(){this.dispatchEvent({type:"requestRender"})}},wt=class{static create(t){return this.build(this.normalizeInputs(t))}static normalizeInputs(t,e){let i=Object.assign({},e?.parameters??{width:100,revolutions:2,segments:40,pathRadius:10,pathType:0,pathSegments:30,cornerRadius:30,cornerSegments:4},t.parameters),s=Math.abs(i.width),r=Math.abs(i.height??s),a=Math.abs(i.depth??s),n=Math.abs(Math.min(s,a))/2;return{parameters:Object.assign(i,{width:s,height:r,depth:a,radius:n,segments:Math.round(i.segments),pathSegments:Math.round(i.pathSegments),cornerSegments:Math.round(i.cornerSegments)})}}static build(t){let{width:e,height:i,depth:s,radius:r,revolutions:a,segments:n,pathRadius:o,pathType:l,pathSegments:h,cornerRadius:p,cornerSegments:d}=t.parameters,c=new Et(!1,e,i,s,r,a,n,o,l,h,p,d);return Object.assign(c,{userData:{...t,type:"HelixGeometry"}})}},Mt=new B([0,0,0],1);function Bt(t){return"TorusGeometry"===t.type&&360===t.arc}var bt,Pt,Et=class extends E{constructor(t=!0,e=1,i=1,s=1,r=1,a=1,n=1,o=1,l=1,h=1,p=1,d=1){if(super(),0===a)return;let c=t&&1===a;c&&(d=0),p>100&&(p=100),0===p&&(d=0);let u,m,y,v,g,x,S,w,M=()=>new f,B=new f,P=M(),E=M(),A=M(),C=M(),D=M(),O=M(),_=M(),V=M(),R=M(),T=M(),W=M(),U=i-2*o+.001,I=U/a,L=Math.ceil(n*a),F=L+1,z=U/L,j=-U/2,N=h+1,k=2*Math.PI/h,G=Math.PI/2/d,H=Math.min((1-p/100)*o,o-.01),q=o-H,Z=0,Q=2*d+2,K=N*Q/2,J=K+N*F,X=Math.max(0,N*(F+Q)),[Y,$,tt]=[3,3,2].map(t=>Array(X*t).fill(0)),et=[],it=r-o;function st(e,i){let s=Math.PI/2;x=i*z,w=2*Math.PI*(x%I)/I+s,x+=j,S=Math.sin(w)*it,g=Math.cos(w)*it,t?e.set(g,S,x):e.set(g,x,S)}st(B,-1e-10),st(P,0),C.copy(B),st(B,1);let rt=B.distanceTo(P),at=c?0:q+H,nt=rt*L+2*at,ot=H,lt=nt-at;for(let e=0;e<=L;e++){st(E,e),W.subVectors(E,C).normalize(),C.copy(E),R.copy(E).setComponent(+t+1,0).normalize(),T.crossVectors(W,R).normalize();let i=0===e,s=e===L,r=i?3*Math.PI/2:G,a=i?ot:lt,n=i?N:J,l=i?0:X-N,p=W.clone().multiplyScalar(i?-q:q).add(E),u=W.clone().multiplyScalar(i?-1:1).normalize();for(let t=0;t<N;t++){let m=t*k;if(D.addVectors(B.copy(R).multiplyScalar(o*Math.cos(m)),P.copy(T).multiplyScalar(o*Math.sin(m))),O.copy(D).normalize(),i||s){c||(Z=l+t,[0,1,2].forEach(t=>{Y[3*Z+t]=p.getComponent(t),$[3*Z+t]=u.getComponent(t)}),tt[2*Z]=+s,tt[2*Z+1]=t/h),P.copy(O).multiplyScalar(H),A.addVectors(E,P);for(let e=0;e<d;e++){let s=e*G+r;_.addVectors(B.copy(W).multiplyScalar(q*Math.sin(s)),P.copy(O).multiplyScalar(q*Math.cos(s))),V.copy(_).normalize(),P.addVectors(A,_),_.normalize(),Z=n+e*N+t,[0,1,2].forEach(t=>{Y[3*Z+t]=P.getComponent(t),$[3*Z+t]=V.getComponent(t)});let o=+i+Math.sin(s);tt[2*Z]=(a+q*o)/nt,tt[2*Z+1]=t/h}}P.addVectors(E,D),Z=K+e*N+t,[0,1,2].forEach(t=>{Y[3*Z+t]=P.getComponent(t),$[3*Z+t]=O.getComponent(t)}),tt[2*Z]=(at+e*rt)/nt,tt[2*Z+1]=t/h}}let ht=F+2*d+2,[pt,dt]=[+c,ht-1];for(let t=pt;t<=dt-1;t++){let e=c&&t===dt-1;for(let i=0;i<N-1;i++)u=t*N+i,m=u+1,y=(e?i:u)+N,v=(e?i+1:m)+N,0===t?et.push(m,v,y):t===ht-2?et.push(u,m,y):et.push(u,m,y,m,v,y)}this.setIndex(et),this.setAttribute("position",new b(Y,3)),this.setAttribute("normal",new b($,3)),this.setAttribute("uv",new b(tt,2))}getClosedTorusIndicesForBooleanOrSubdiv(){let t,e,i,s,r=this.userData.parameters,a=Math.ceil(r.tubularSegments),n=r.radialSegments,o=n+1,l=[];for(let r=1;r<a;r++)for(let a=0;a<n;a++)t=r*o+a,e=t+1,i=t+o,s=e+o,l.push(t,e,i,e,s,i);for(let r=0;r<n;r++)t=a*o+r,e=t+1,i=r+o,s=r+1+o,l.push(t,e,i,e,s,i);return Mt.array=new Uint32Array(l),Mt.count=l.length,Mt}},At=new Map,Ct=0;function Dt(t){return Pt||(Pt=async function(){let e=t??"https://cdn.spline.design/@splinetool/runtime@2.0.160/build",i=import("./boolean.js"),[s,r]=await Promise.all([i,fetch(`${e}/boolean.wasm`).then(t=>t.arrayBuffer())]);await s.default({module_or_path:r}),bt=s}())}function Ot(){if(void 0===bt)throw new Error("boolean-wasm is not loaded");return bt}function _t(t){let e=At.get(t);if(void 0===e)throw new Error("Unknown csg mesh set handle "+t);return e}function Vt(t){return At.set(++Ct,t),Ct}var Rt={0:0,1:1,2:2};function Tt(t,e,i){if(void 0===bt)return-1;let{positions:s,indices:r,normals:a}=function(t,e){if(e&&void 0!==t.userData.positions){let e=t.userData,i=[];for(let t=0,s=0;t<e.verticesPerFace.length;t++){let r=e.verticesPerFace[t];for(let t=1;t<r-1;t++)i.push(e.indices[s],e.indices[s+t],e.indices[s+t+1]);s+=r}return{positions:e.positions instanceof Float32Array?e.positions:new Float32Array(e.positions),indices:new Uint32Array(i)}}let i;i=Bt(t.userData.parameters)?t.getClosedTorusIndicesForBooleanOrSubdiv():t.getIndex();let s,r=t.getAttribute("position");if(null===i){s=new Uint32Array(r.count);for(let t=0;t<s.length;t++)s[t]=t}else s=i.array instanceof Uint32Array?i.array:new Uint32Array(i.array);let a=t.getAttribute("normal"),n=void 0!==a&&3===a.itemSize&&a.count===r.count&&a.array instanceof Float32Array&&!0!==a.isInterleavedBufferAttribute?a.array:void 0;return{positions:r.array,indices:s,normals:n}}(t,e);return Vt(new bt.CsgMesh(s,r,a))}function Wt(t,e){let i=Ot(),s=Rt[e];if(void 0===s)throw new Error("Unknown boolean operation "+e);let r=t.map(_t);if(1===r.length)return i.clone_mesh(r[0]);let a,n=[];if(2===e&&r.length>2){let t=r[0];for(let e=1;e<r.length-1;e++)t=i.boolean_mesh(t,r[e],0),n.push(t);a=i.boolean_mesh(r[r.length-1],t,2)}else if(2===e)a=i.boolean_mesh(r[1],r[0],2);else{let t=r[r.length-1];for(let e=0;e<r.length-1&&(t=i.boolean_mesh(t,r[e],s),n.push(t),0!==t.tri_count());e++);a=t,n.pop()}for(let t of n)t.free();return a}function Ut(t,e,i,s){let r=Ot(),a=Wt(t,e),n=r.mesh_render_data(a,Math.max(s,0));if(i.setAttribute("position",new b(n.positions(),3)),i.setAttribute("normal",new b(n.normals(),3)),n.free(),null===i.boundingSphere&&(i.boundingSphere=new P),0===a.tri_count())i.boundingSphere.center.set(0,0,0),i.boundingSphere.radius=0,i.userData.parameters={width:0,height:0,depth:0};else{let t=a.bounds();i.boundingSphere.center.set(t[0],t[1],t[2]),i.boundingSphere.radius=(t[3]**2+t[4]**2+t[5]**2)**.5,i.userData.parameters={width:2*t[3],height:2*t[4],depth:2*t[5]}}return Vt(a)}function It(t,e){let i=Ot(),s=Wt(t,e),r=i.mesh_topological_data(s),a=r.positions(),n=r.indices();return r.free(),s.free(),{positions:a,indices:n,verticesPerFace:new Uint8Array(n.length/3).fill(3)}}function Lt(t,e){_t(t).transform(new Float32Array(e.elements))}function Ft(t){let e=At.get(t);void 0!==e&&(e.free(),At.delete(t))}function zt(t,e){return Vt(Ot().instanced_union(_t(t),e))}function jt(t){return null!==t&&"booleanOp"in t}var Nt=class extends(St(C)){constructor(){super(...arguments),this.booleanMeshSetAddress=-1,this.booleanWasTransformed=!1,this.booleanMatrixInvOld=new v}updateVisible(t){super.updateVisible(t),this.visible=!jt(this.parent)&&this.visible,jt(this.parent)&&this.parent.invalidateDownstreamBooleanData()}onClonerLayoutUpdated(){jt(this.parent)&&this.invalidateDownstreamBooleanData()}freeBooleanPointer(){-1!==this.booleanMeshSetAddress&&(Ft(this.booleanMeshSetAddress),this.booleanMeshSetAddress=-1)}dispose(){super.dispose(),this.freeBooleanPointer()}invalidateDownstreamBooleanData(t=!1){return t?this.booleanWasTransformed=!0:this.freeBooleanPointer(),jt(this.parent)?this.parent.invalidateDownstreamBooleanData():this}invalidateUpstreamBooleanData(){this.freeBooleanPointer();for(let t of this.children)t instanceof Nt&&(t.freeBooleanPointer(),jt(t)&&t.invalidateUpstreamBooleanData())}updateTransformState(t,e){let i=super.updateTransformState(t,e);return i&&jt(this.parent)&&this.invalidateDownstreamBooleanData(!0),i}onVariableUpdate(t=!1){super.onVariableUpdate(t),jt(this.parent)&&this.invalidateDownstreamBooleanData(!0)}},kt=new M;function Gt(t,e=0,i=t.count,s,r){let a=1/0,n=1/0,o=1/0,l=-1/0,h=-1/0,p=-1/0;for(let s=e;s<i;s++){let e=t.getX(s),i=t.getY(s),r=t.getZ(s);e<a&&(a=e),i<n&&(n=i),r<o&&(o=r),e>l&&(l=e),i>h&&(h=i),r>p&&(p=r)}kt.min.set(a,n,o),kt.max.set(l,h,p),kt.getCenter(s),kt.getSize(r).multiplyScalar(.5)}var Ht=new E,qt=new A,Zt=class extends Nt{constructor(t,e){super(Ht,qt),this.super_Entity(t,e)}updateState(t,e){this.updateState_Entity(t,e)}raycast(t,e){if(this.raycastDeformed(t,e))return;super.raycast(t,e)}raycastDeformed(t,e){return!1}updateEntityBoxSize(t,e){let i=this.geometry.getAttribute("position");void 0!==i?Gt(i,this.geometry.drawRange.start,this.geometry.drawRange.count<1/0?this.geometry.drawRange.count:i.count,t,e):super.updateEntityBoxSize(t,e)}};export{O as a,_ as b,D as c,j as d,N as e,G as f,rt as g,at as h,ct as i,St as j,wt as k,Bt as l,Et as m,Dt as n,Tt as o,Ut as p,It as q,Lt as r,Ft as s,zt as t,Gt as u,Zt as v};
|
|
1
|
+
import{f as t}from"./runtime-chunk-RTLL6WIB.js";import{h as e}from"./runtime-chunk-2PT2WH66.js";import{c as i}from"./runtime-chunk-TZCHGFVF.js";import{C as s,Ca as r,Da as a,Fa as n,J as o,Sa as l,i as h,j as p,k as d,n as c}from"./runtime-chunk-ADHKZQMB.js";import{Ec as u,Gc as m,Hc as f,Md as y,Qc as v,Rc as g,Rd as x,Tc as S,Te as w,Zc as M,bd as B,dd as b,ed as P,fd as E,md as A,nd as C}from"./runtime-chunk-KPOUV3HD.js";var D={Cloner:null,changeEntityProptotype:()=>{},createEntity:()=>{}};function O(t,e){let i=[];if(e.length!==t.length)return null;{let s=0;for(;s<t.length;){if("*"===e[s])i.push(t[s]);else if(t[s]!==e[s])return null;s+=1}}return i}function _(t,e){let i=[];if(!(e.length<=t.length))return null;{let s=0;for(;s<e.length;){if("*"===e[s])i.push(t[s]);else if(t[s]!==e[s])return null;s+=1}}return i}var V=new f,R=new f,T=new v,W=[new f(-1,1,1),new f(-1,-1,1),new f(1,-1,1),new f(1,1,1),new f(-1,1,-1),new f(-1,-1,-1),new f(1,-1,-1),new f(1,1,-1)],U=[[0,3],[1,2],[5,6],[4,7],[0,1],[3,2],[7,6],[4,5],[0,4],[1,5],[2,6],[3,7]],I=[[0,2],[7,5],[4,1],[3,6],[4,3],[1,6]],L=(t,e,i)=>{t.updateEntityBoxSize(V,R),T.copy(e).multiply(t.matrixWorld),0===R.x&&0===R.y&&0===R.z?i.push(new f(V.x,V.y,V.z).applyMatrix4(T)):W.forEach(t=>{i.push(t.clone().multiply(R).add(V).applyMatrix4(T))})},F=class extends M{constructor(){super(...arguments),this.matrix=new v,this.vertices=[],this.faces=[],this.edges=[],this.centerEdges=[]}copy(t){return super.copy(t),this.matrix.copy(t.matrix),this.vertices=t.vertices.map(t=>t.clone()),this.faces=t.faces.map(t=>t.clone()),this.edges=t.edges.map(t=>t.clone()),this.centerEdges=t.centerEdges.map(t=>t.clone()),this}setFromObjectSize(t,e=!1){t.updateWorldMatrix(!1,e),this.makeEmpty(),this.matrix.copy(t.matrixWorld);let i=(new v).copy(t.matrixWorld).invert();return this.expandByObjectSize(t,i,e)}expandByObjectSize(t,e,i=!1){let s=[];if(!0===i){let i=[];t.traverseEntity(t=>{if(t.visible||t.cloner&&t.data.visible){if(!("geometry"in t))return T.copy(e).multiply(t.matrixWorld),void i.push((new f).applyMatrix4(T));L(t,e,s)}}),0===s.length&&s.push(...i)}else L(t,e,s);return this.setFromPoints(s)}getCenter(t){return(t=super.getCenter(t)).applyMatrix4(this.matrix),t}getPositionToCenter(t){return(t=super.getCenter(t)).applyMatrix4(T.copy(this.matrix).setPosition(0,0,0)),t}computeVertices(){this.getSize(R).multiplyScalar(.5),this.getCenter(V),T.copy(this.matrix).setPosition(V),this.vertices=W.map(t=>t.clone().multiply(R).applyMatrix4(T))}computeEdges(){this.vertices.length>0&&this.computeVertices(),this.edges=U.map(([t,e])=>new w(this.vertices[t],this.vertices[e])),this.centerEdges=this.edges.map(t=>t.getCenter(new f))}computeFaces(){this.vertices.length>0&&this.computeVertices(),this.faces=I.map(([t,e])=>this.vertices[t].clone().add(this.vertices[e]).multiplyScalar(.5))}},z=new f(1,1,1);function j(t,e,i,s,r=new v){return r.compose(t,e,z).multiply(i).scale(s)}var N,k=new v;(N||(N={})).is=function(t){return t&&t.__isSPEObject};var G=t=>class extends t{constructor(){super(...arguments),this.previousModelViewMatrix=new v,this.copyPreviousMatrix=!0,this.pivotMatrix=new v,this.matrixWorldRigid=new v,this.shearScale=new v,this.shearScaleInv=new v,this.shearMatrix=new v}get __isSPEObject(){return!0}getPhysicsLocalMatrix(t){return!!this.rigidBody?.isDynamic()&&(t.copy(this.matrixWorld),this.hasNonUniformScale&&t.multiply(this.shearScaleInv),this.parent&&t.premultiply(k.copy(this.parent.matrixWorld).invert()),t.multiply(k.copy(this.pivotMatrix).invert()),!0)}isDescendantOf(t){t instanceof S&&(t=t.uuid);let e=this;for(;e.parent;){if(e.parent.uuid===t)return!0;e=e.parent}return!1}updateMatrix(){!this.shearMatrix||(j(this.position,this.quaternion,this.shearMatrix,this.scale,this.matrix),this.matrixWorldNeedsUpdate=!0)}updateMatrixWorld(t){this.matrixAutoUpdate&&this.updateMatrix(),(this.matrixWorldNeedsUpdate||t)&&(null===this.parent?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix),this.matrixWorld.multiply(this.pivotMatrix),this.matrixWorldNeedsUpdate=!1,t=!0);for(let e of this.children)e.updateMatrixWorld(t)}updateWorldMatrix(t,e){let i=this.parent;if(t&&null!==i&&i.updateWorldMatrix(!0,!1),this.matrixAutoUpdate&&this.updateMatrix(),null===this.parent?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix),this.matrixWorld.multiply(this.pivotMatrix),e)for(let t of this.children)t.updateWorldMatrix(!1,!0)}traverseChildren(t,e=0){for(let i of this.children)N.is(i)&&i.traverseObject(t,e+1)}traverseObject(t,e=0){if(!0!==t(this,e))for(let i of this.children)N.is(i)&&i.traverseObject(t,e+1)}updateMatrixWorldRigid(){this.hasNonUniformScale=l(this.matrixWorld,this.matrixWorldRigid,this.shearScale),this.matrixWorldRigid.copyPosition(this.matrixWorld),this.shearScaleInv.copy(this.shearScale).invert()}attach(t,e){this.updateWorldMatrix(!0,!1);let i=(new v).copy(this.matrixWorld).invert();return null!==t.parent&&(t.parent.updateWorldMatrix(!0,!1),i.multiply(t.parent.matrixWorld)),t.applyMatrix4(i),t.updateWorldMatrix(!1,!1),this.add(t),void 0!==e&&(this.children.pop(),this.children.splice(e,0,t)),this}copy(t,e=!1){return super.copy(t,e),this}onAfterRender(t,e,i,s,r,a){this.copyPreviousMatrix&&this.previousModelViewMatrix.copy(this.modelViewMatrix)}},H=class extends x{constructor(){super()}getPoints(t=12){let e,i=[],s=this.getCurveLengths(),r=s[s.length-1]/s.length;for(let a=0,n=this.curves;a<n.length;a++){let o=n[a],l=0===a?s[a]:s[a]-s[a-1],h=Math.ceil(t*l/r),p=o.getPoints(h);for(let t=0;t<p.length;t++){let s=p[t];e&&e.equals(s)||(i.push(s),e=s)}}return this.autoClose&&i.length>1&&!i[i.length-1].equals(i[0])&&i.push(i[0]),i}},q=.001,Z=new f,Q=new f,K=new f,J=new f,X=new f,Y=new f,$=new f,tt=new f,et=new f;function it(t,e,i){return Z.subVectors(e,t),Q.subVectors(e,i),Z.cross(Q).length()<=q}var st=new WeakMap;function rt(t){let e=st.get(t.points);if(void 0!==e&&e.isClosed===t.isClosed)return e.curve;let i=function(t){let e=t.points,i=[e[0]],s=[new f(...e[0].data.position)];K.copy(s[0]);for(let t=0;t<e.length-1;t++)Z.fromArray(e[t].data.position),Q.fromArray(e[t+1].data.position),X.subVectors(Z,K),$.subVectors(Z,Q),X.cross($).length()>q&&(i.push(e[t]),s.push((new f).copy(Z)),K.copy(Z));let r=e[e.length-1];i.push(r),s.push(new f(...r.data.position));let a=t.isClosed,n=i.length-(a?0:1),o=i.length,l=[],h=[];for(let t=0;t<o;t++){let e=i[t].data;l.push(new f(...e.controlPrevious.position)),h.push(new f(...e.controlNext.position))}let p=[];for(let t=0;t<n;t++){let e=t===o-1?0:t+1;p.push(it(s[t],h[t],s[e])&&it(s[t],l[e],s[e]))}let d=[];for(let t=0;t<o;t++){let e=i[t].data,r=s[t],n={position:r,prevDir:void 0,nextDir:void 0,controlPrevious:l[t],controlNext:h[t],tan:void 0,baseRoundness:e.roundness,removedLength:0};if(d.push(n),0===e.roundness||!a&&(0===t||t===o-1))continue;let c=a&&0==t?o-1:t-1,u=a&&t==o-1?0:t+1,m=(new f).subVectors(s[c],r).normalize(),y=(new f).subVectors(s[u],r).normalize();n.prevDir=m,n.nextDir=y;let v=p[a&&0===t?o-1:t-1],g=p[t];if(v&&g){J.addVectors(m,y).normalize();let t=K.crossVectors(J,m).length()/m.dot(J);n.tan=t,n.removedLength=e.roundness/t}}for(let t=0;t<n;t++){let e=a&&t===o-1?0:t+1,i=d[t],s=d[e];if(0!==i.removedLength||0!==s.removedLength){let t=i.position.distanceTo(s.position);i.removedLength=Math.min(i.removedLength,t/2),s.removedLength=Math.min(s.removedLength,t/2)}}let c=new Array(2*o).fill(null);for(let t=0;t<n;t++){let e=a&&t===o-1?0:t+1,i=d[t],s=d[e],r=null;if(p[t]){let t=i.position.clone(),e=s.position.clone();(0!==i.removedLength||0!==s.removedLength)&&(i.nextDir&&t.add(K.copy(i.nextDir).setLength(i.removedLength)),s.prevDir&&e.add(K.copy(s.prevDir).setLength(s.removedLength))),t.distanceTo(e)>q&&(r=new y(t,t.clone().lerp(e,.3),e.clone().lerp(t,.3),e))}else i.position.distanceTo(s.position)>q&&(r=new y(i.position,i.controlNext,s.controlPrevious,s.position));c[2*t+1]=r}for(let t=0;t<o;t++){let e=d[t];if(0===e.removedLength)continue;let i=e.position,s=e.prevDir.clone().multiplyScalar(e.removedLength).add(i),r=e.nextDir.clone().multiplyScalar(e.removedLength).add(i),a=e.tan*e.removedLength;J.addVectors(e.prevDir,e.nextDir).normalize(),X.copy(s).lerp(r,.5);let n=s.distanceTo(r)/2;et.copy(J).multiplyScalar(Math.sqrt(Math.pow(a,2)-Math.pow(n,2))).add(X),Y.copy(J).multiplyScalar(-a).add(et);let o=i.distanceTo(Y)/i.distanceTo(X);$.copy(e.prevDir).multiplyScalar(o*i.distanceTo(s)).add(i),tt.copy($).lerp(Y,2);let l=s.clone().lerp($,4/3),h=r.clone().lerp(tt,4/3);c[2*t]=new y(s,l,h,r)}let u=new H;for(let t=0;t<c.length;t++){let e=c[t];e&&u.add(e)}return u}(t);return st.set(t.points,{isClosed:t.isClosed,curve:i}),i}var at,nt=new v,ot=new m,lt=new m,ht=new g,pt=new f,dt=new f(0,1,0);(at||(at={})).is=function(t){return t&&t.__isEntity};var ct=t=>at.is(t),ut={type:"completeState",isfromEntity:!0},mt=["x","y","z"],ft=new f,yt=new f(1,1,1),vt=new m,gt=new g,xt=new v,St=l=>class extends(G(l)){constructor(){super(...arguments),this.raycastLock=!1,this.scaleLock=!1,this.disposed=!1,this.stateSelection=null,this.destroyedInAction=!1,this.instances=[],this.prevState=null,this.currentState=null,this.currentAnimationAction=null,this.reversibleToState=null,this.transitionState={settled:!0,state:null},this.currentTransitionEvent=null,this.previousAction=null,this._singleBBox=new F,this._recursiveBBox=new F,this.singleBBoxNeedsUpdate=!0,this.recursiveBBoxNeedsUpdate=!0,this._needApplyPathSnapping=!0,this.attachedPaths=new Set}get __isEntity(){return!0}entityChildren(t){let e=this.children[t];if(at.is(e))return e}entityChildrenCount(){let t=this.children.length;for(;t--;)if(at.is(this.children[t]))return t+1;return 0}get isConcreteEntity(){return"string"==typeof this.identity}get isVirtualEntity(){return"string"!=typeof this.identity}get isInstanceRoot(){return this.isConcreteEntity&&"Instance"===this.data.type}nearestInstanceSelfOrParent(){let t=this;for(;"Instance"!==t.data.type;){let e=t.parent;if(!at.is(e))return;t=e}return t}forInstancesRec(t){this.instances.forEach(e=>{e.disposed||t(e),e.forInstancesRec(t)})}super_Entity(t,e){"string"==typeof t&&(this.uuid=t),this.identity=t,this.data=e,this.matrixAutoUpdate=!1,this.dataPatched=this.data}changeSelectedState(t,e,i=!1){if(0!==this.data.states.length||i){for(let t of this.data.states)n.toOps(this.data,t.data).forEach(t=>{let i=p.replaceProps(t,this.data);this.dataPatched=this.data,this.updateByPatchedOp(i,this.data,e)});if(null!==t){let i=this.data.states.data(t);i&&(this.dataPatched=n.patch(this.data,i),n.toOps(this.data,i).forEach(t=>{this.updateByPatchedOp(t,this.dataPatched,e)}))}i&&this.updateTransformState(this.dataPatched,e),this.stateSelection=t,this.updatePathSnapping(this.dataPatched.pathSnapping)}}get singleBBox(){return this.singleBBoxNeedsUpdate&&(this.singleBBoxNeedsUpdate=!1,this._singleBBox.setFromObjectSize(this,!1),this._singleBBox.computeVertices(),this._singleBBox.computeEdges(),this._singleBBox.computeFaces()),this._singleBBox}get recursiveBBox(){return this.recursiveBBoxNeedsUpdate&&(this.recursiveBBoxNeedsUpdate=!1,this._recursiveBBox.setFromObjectSize(this,!0),this._recursiveBBox.computeVertices(),this._recursiveBBox.computeEdges(),this._recursiveBBox.computeFaces()),this._recursiveBBox}updateEntityBoxSize(t,e){t.setScalar(0),e.setScalar(0)}resetBBoxNeedsUpdateSelf(){this.singleBBoxNeedsUpdate=!0,this.recursiveBBoxNeedsUpdate=!0}resetBBoxNeedsUpdate(){this.resetBBoxNeedsUpdateSelf(),this.traverseAncestors(t=>{ct(t)&&t.resetBBoxNeedsUpdateSelf()}),this.traverseEntity(t=>{t.resetBBoxNeedsUpdateSelf()})}find(t){let e;return this.traverseEntity(i=>{i.uuid===t&&(e=i)}),e}traverseSortNextHelper(){let t=this.parent;if(t){let e=t.children,i=e.indexOf(this)+1;if(at.is(e[i]))return e[i];if(at.is(t))return t.traverseSortNextHelper()}}sortNext(){let t=this.children;return this.children.length>0&&at.is(this.children[0])?t[0]:this.traverseSortNextHelper()}goUp(t){let e=this;for(;t>0&&null!==e;)e=e.parent,t-=1;return e}hasAnccestorOrSelf(t){return this===t||this.hasAnccestor(t)}hasAnccestor(t){let e=this.parent;for(;e;){if(t===e)return!0;e=e.parent}return!1}countToAccestor(t){let e=0,i=this;for(;i!==t;){if(null===i)return-1;i=i.parent,e+=1}return e}forEachEntity(t){for(let e of this.children)ct(e)&&t(e)}traverseEntityAncestors(t){this.traverseAncestors(e=>{at.is(e)&&t(e)})}traverseConcreteEntity(t,e=0){if(!0!==t(this,e))for(let i of this.children)ct(i)&&i.isConcreteEntity&&i.traverseEntity(t,e+1)}traverseEntity(t,e=0){if(!0!==t(this,e))for(let i of this.children)ct(i)&&i.traverseEntity(t,e+1)}traverseVisibleEntity(t){t(this);for(let e of this.children)ct(e)&&e.visible&&e.traverseVisibleEntity(t)}updateMatrix(){super.updateMatrix(),this.cloner&&this.cloner.onObjUpdateMatrix(),this.dispatchEvent({type:"updateMatrix"})}updateMatrixWorld(t){super.updateMatrixWorld(t),this.dispatchEvent({type:"updateMatrixWorld"})}copy(t,e=!1){return super.copy(t,e),this.dataPatched=t.dataPatched,this.raycastLock=t.raycastLock,this.scaleLock=t.scaleLock,this}hasEntityChild(){return this.children.some(t=>ct(t))}isAncestorOf(t){if(this.uuid===t)return!1;let e=!1;return this.traverseEntity(i=>{i.uuid===t&&(e=!0)}),e}toObjectTransformState(e=[]){this.updateWorldMatrix(!0,!1);let i={position:this.position.toArray(),rotation:[this.rotation.x*u.RAD2DEG,this.rotation.y*u.RAD2DEG,this.rotation.z*u.RAD2DEG],scale:this.scale.toArray(),shear:s.fromMatrix(this.shearMatrix.toArray()),pivot:[0,0,0],pivotRotation:[0,0,0]};return t(i,e)}getTransformValues(t,e,i){return e[t].map((e,s)=>i?.shared.getVariable(e,[this.uuid,t,mt[s]])??e)}updateTransformState(t,e){let i=!1;if(t.position&&(this.position.fromArray(this.getTransformValues("position",t,e)),i=!0),t.rotation&&(ft.fromArray(this.getTransformValues("rotation",t,e)).multiplyScalar(u.DEG2RAD),this.rotation.setFromVector3(ft),i=!0),t.scale&&(this.scale.fromArray(this.getTransformValues("scale",t,e)),i=!0),t.shear&&(this.shearMatrix.fromArray(s.toMatrix(t.shear)),i=!0),void 0!==t.pivot||void 0!==t.pivotRotation)if(i=!0,void 0!==t.pivot&&void 0!==t.pivotRotation)this.pivotMatrix.compose(ft.fromArray(t.pivot).negate(),vt.setFromEuler(gt.fromArray(t.pivotRotation.map(t=>t*u.DEG2RAD))).invert(),yt);else if(void 0!==t.pivot)this.pivotMatrix.setPosition(-t.pivot[0],-t.pivot[1],-t.pivot[2]);else if(void 0!==t.pivotRotation){let e=ft.setFromMatrixPosition(this.pivotMatrix);vt.setFromEuler(gt.fromArray(t.pivotRotation.map(t=>t*u.DEG2RAD))).invert(),this.pivotMatrix.compose(e,vt,yt)}return i&&(this.updateMatrix(),this.resetBBoxNeedsUpdate(),this.invalidateClonerTransform(this),this.traverseEntityAncestors(t=>{t.invalidateClonerTransform(this)})),t.position&&t.rotation&&t.scale&&this.updateWorldMatrix(!1,!0),i}onVariableUpdate(t=!1){t?this.resetBBoxNeedsUpdate():(this.updateMatrix(),this.resetBBoxNeedsUpdate(),this.invalidateClonerTransform(this),this.traverseEntityAncestors(t=>{t.invalidateClonerTransform(this)}),this.requestRender())}dispose(){this.disposed=!0,this.cloner&&(this.cloner.dispose(),this.cloner=void 0)}disposeChildrenRecursively(){for(let t of this.children)at.is(t)&&t.disposeRecursively()}disposeRecursively(){this.dispose(),this.children.forEach(t=>{at.is(t)&&t.disposeRecursively()})}toState(e=[]){let i={name:this.name,visible:this.visible,raycastLock:this.raycastLock,...this.toObjectTransformState(e)};return t(i,e)}updateByObjUpdateOp(t,e){void 0!==t&&this.updateByOp({type:0,props:t,path:[]},{...this.data,...t},e,!1)}updateByOp(t,e,i,s){let o=this.data;this.data=e;let l=t,p=_(t.path,["states","*"]);if(null!==p){if(0===t.type){let[e]=p;if(this?.stateSelection===e){let e={...t.props};if(delete e.name,Object.values(t.props).some(t=>void 0===t)){let i=this.data;if(void 0!==i){let s=c.zoom(i,t.path.slice(2));if(s)for(let i in t.props)void 0===t.props[i]&&i in s&&(e[i]=s[i])}}l={...t,props:e,path:t.path.slice(2)}}}}else if(0===t.type){let e=this.stateSelection?this.data.states.data(this.stateSelection):void 0;if(void 0!==e){if(void 0!==t.props.name&&e.name){let{name:t,...i}=e;e=i}if(void 0!==t.props.material&&"material"in e){let{material:t,...i}=e;e=i}let i=c.removeOverridden(t.path,t.props,e);l={...t,props:i}}}if(this.updateByPatchedOpBase(l,n.patch(this.data,this.stateSelection?this.data.states.data(this.stateSelection):void 0),i),_(t.path,["overrides"])){let s=[],a=[...t.path];for(s.push(a[1]),a.splice(0,2);a.length>0&&"descendants"===a[0];)s.push(a[1]),a.splice(0,2);if(void 0===s[s.length-1]){if(0===t.type)for(let e of Object.keys(t.props)){s[s.length-1]=e;let r=i.scene.findInstance([this.uuid,...s]);r&&(r.overrideData=t.props[e],r.updateState(h.apply(r.component.data,r.overrideData),i))}}else{let n=i.scene.findInstance([this.uuid,...s]);if(n){let o=c.zoom(n.component.data,a);if(0===(t={...t,path:a}).type){let e=t.props;if(o)for(let[i,s]of Object.entries(t.props))void 0===s&&(e===t.props&&(e={...t.props}),e[i]=o[i]);t={...t,props:e}}n.overrideData=r.resolve(e.overrides,s),n.updateByOp(t,d.applySimple(n.data,t),i,!1)}}}else if(this.instances.length>0){let s;if(0===t.path.length&&0===t.type){let e;for(let i of a.rootOverrideProps)i in t.props&&(void 0===e&&(e={}),e[i]=t.props[i]);e&&(s={...t,props:e})}else for(let e of a.rootOverrideProps)if(_(t.path,[e])){s=t;break}void 0!==s&&this.instances.forEach(t=>{if(t.isInstanceRoot){let e=h.filterOp(t.overrideData,s);e&&t.updateByOp(e,d.applySimple(t.data,e),i,!0)}}),this.instances.forEach(s=>{if(!s.isInstanceRoot){let r=h.filterOp(s.overrideData,t);if(r){let a;a=o===s.data&&t===r?e:d.applySimple(s.data,r),s.updateByOp(r,a,i,!0)}}})}}updateByPatchedOpBase(t,e,i){if(this.dataPatched=e,0===t.path.length&&0===t.type)void 0!==t.props.type&&!o.is(t.props.type)&&D.changeEntityProptotype(this,this.data,i);else if(1===t.path.length&&"geometry"===t.path[0]&&0===t.type&&"type"in t.props){D.changeEntityProptotype(this,this.data,i);for(let t of this.children)at.is(t)&&t.updateVisible(i.scene)}this.updateByPatchedOp(t,e,i)}updateByPatchedOp(t,e,i){if(0===t.path.length&&0===t.type?this.updateState(t.props,i):0===t.type&&("resolutionLevel"in t.props||"useChildrenColors"in t.props)&&this.updateState(e,i),"morphTargetInfluences"===t.path[0]&&0===t.type){let s=e.morphTargetInfluences.get(t.path[1])?.data.name;s&&this.updateMorphInfluences(s,i.shared.getVariable(t.props.value,[this.uuid,"morphTargetInfluences",s]))}if(null!==_(t.path,["pathSnapping"])&&(this.updatePathSnapping(e.pathSnapping),this.isVirtualEntity&&i.scene?.syncInstancePathConstraint(this)),null!==_(t.path,["cloner"])){let s=d.drop(t,1);0===s.path.length&&0===s.type&&!0===s.props.disabled?this.setFromClonerState(null,i):this.cloner?this.cloner.updateState(e.cloner,i):(this.setFromClonerState(e.cloner,i),this.expandCloner(i)),this.updateVisible(i.scene)}}updatePathSnapping(t=this.dataPatched.pathSnapping){this._updatedPathSnapping=t,this._needApplyPathSnapping=!0}get updatedPathSnapping(){return this._updatedPathSnapping}applyPathSnapping(t){if(!1===this._needApplyPathSnapping)return;let e=this._updatedPathSnapping?.pathId??this.dataPatched.pathSnapping.pathId,i=this._updatedPathSnapping?.slide??this.dataPatched.pathSnapping.slide??0,s=this._updatedPathSnapping?.offset??this.dataPatched.pathSnapping.offset??0,r=this._updatedPathSnapping?.orientation??this.dataPatched.pathSnapping.orientation;if(null===e)return;let a=t.find(this.isVirtualEntity&&t.pathConstraints.getConstraint(this.uuid)||e);if(!a)return;this._needApplyPathSnapping=!1;let n=a.data;if(n.geometry.path.points.length<=1)return;let o=rt(n.geometry.path),l=function(t){let e=t%1;return e<0?e+1:0===e&&t>0?1:e}(i+s),h=null;try{h=o.curves.length?o.getPointAt(l):null}catch(t){}if(null===h)return;a.updateMatrixWorld();let p=this.parent?xt.copy(this.parent.matrixWorld):xt.identity(),d=function(t,e,i,s){ot.setFromRotationMatrix(nt.extractRotation(s));let r=t.clone().applyMatrix4(nt.copy(s).invert().multiply(i));if(null===e)lt.setFromRotationMatrix(nt.extractRotation(i));else{let t=e.clone().applyMatrix4(nt.extractRotation(i));lt.setFromRotationMatrix(nt.lookAt(pt.set(0,0,0),t,dt))}return{position:r,rotation:(new f).setFromEuler(ht.setFromQuaternion(ot.invert().multiply(lt))).multiplyScalar(u.RAD2DEG)}}(h,"tangential"===r?o.getTangentAt(l):null,a.matrixWorld,p);this.updateTransformState({position:d.position.toArray(),rotation:d.rotation.toArray()}),this.traverseEntity(t=>{t._cameraType&&t.dispatchEvent(ut)})}updateVisible(t){if(this.visible=this.dataPatched.visible&&(!this.dataPatched.cloner||(this.dataPatched.cloner.disabled??!1)||!0!==this.dataPatched.cloner?.hideBase),!t)return;let e=!1;this.traverseEntity(t=>{if("Splat"===t.data.type)return e=!0,!0}),e&&t.reloadSplats()}updateState_Entity(t,e){void 0!==t.name&&(this.name=t.name),void 0!==t.raycastLock&&(this.raycastLock=t.raycastLock),void 0!==t.visible&&(this.updateVisible(e?.scene),this.resetBBoxNeedsUpdate()),e&&"cloner"in t&&void 0!==t.cloner&&(this.setFromClonerState(t.cloner,e),this.updateVisible(e.scene)),this.updateTransformState(t,e)}get attachedSurfaceCloners(){return this.children.filter(t=>e(t)&&"toObject"===t.parameters.type)}setFromClonerState(t,e){if(!this.disposed)if(null===t||t.disabled)this.cloner&&this.cloner.dispose(),this.cloner=void 0;else if(void 0===this.cloner){if(null===D.Cloner)return void i("cloners","a cloner");this.cloner=new D.Cloner(this,t),e.scene.addPendingExpandCloner(this)}else this.cloner.updateState(t,e)}expandCloner(t){!this.disposed&&this.cloner&&this.cloner.expandClones(t)}invalidateClonerTransform(t){this.cloner&&this.cloner.invalidateTransform(t)}requestRender(){this.dispatchEvent({type:"requestRender"})}},wt=class{static create(t){return this.build(this.normalizeInputs(t))}static normalizeInputs(t,e){let i=Object.assign({},e?.parameters??{width:100,revolutions:2,segments:40,pathRadius:10,pathType:0,pathSegments:30,cornerRadius:30,cornerSegments:4},t.parameters),s=Math.abs(i.width),r=Math.abs(i.height??s),a=Math.abs(i.depth??s),n=Math.abs(Math.min(s,a))/2;return{parameters:Object.assign(i,{width:s,height:r,depth:a,radius:n,segments:Math.round(i.segments),pathSegments:Math.round(i.pathSegments),cornerSegments:Math.round(i.cornerSegments)})}}static build(t){let{width:e,height:i,depth:s,radius:r,revolutions:a,segments:n,pathRadius:o,pathType:l,pathSegments:h,cornerRadius:p,cornerSegments:d}=t.parameters,c=new Et(!1,e,i,s,r,a,n,o,l,h,p,d);return Object.assign(c,{userData:{...t,type:"HelixGeometry"}})}},Mt=new B([0,0,0],1);function Bt(t){return"TorusGeometry"===t.type&&360===t.arc}var bt,Pt,Et=class extends E{constructor(t=!0,e=1,i=1,s=1,r=1,a=1,n=1,o=1,l=1,h=1,p=1,d=1){if(super(),0===a)return;let c=t&&1===a;c&&(d=0),p>100&&(p=100),0===p&&(d=0);let u,m,y,v,g,x,S,w,M=()=>new f,B=new f,P=M(),E=M(),A=M(),C=M(),D=M(),O=M(),_=M(),V=M(),R=M(),T=M(),W=M(),U=i-2*o+.001,I=U/a,L=Math.ceil(n*a),F=L+1,z=U/L,j=-U/2,N=h+1,k=2*Math.PI/h,G=Math.PI/2/d,H=Math.min((1-p/100)*o,o-.01),q=o-H,Z=0,Q=2*d+2,K=N*Q/2,J=K+N*F,X=Math.max(0,N*(F+Q)),[Y,$,tt]=[3,3,2].map(t=>Array(X*t).fill(0)),et=[],it=r-o;function st(e,i){let s=Math.PI/2;x=i*z,w=2*Math.PI*(x%I)/I+s,x+=j,S=Math.sin(w)*it,g=Math.cos(w)*it,t?e.set(g,S,x):e.set(g,x,S)}st(B,-1e-10),st(P,0),C.copy(B),st(B,1);let rt=B.distanceTo(P),at=c?0:q+H,nt=rt*L+2*at,ot=H,lt=nt-at;for(let e=0;e<=L;e++){st(E,e),W.subVectors(E,C).normalize(),C.copy(E),R.copy(E).setComponent(+t+1,0).normalize(),T.crossVectors(W,R).normalize();let i=0===e,s=e===L,r=i?3*Math.PI/2:G,a=i?ot:lt,n=i?N:J,l=i?0:X-N,p=W.clone().multiplyScalar(i?-q:q).add(E),u=W.clone().multiplyScalar(i?-1:1).normalize();for(let t=0;t<N;t++){let m=t*k;if(D.addVectors(B.copy(R).multiplyScalar(o*Math.cos(m)),P.copy(T).multiplyScalar(o*Math.sin(m))),O.copy(D).normalize(),i||s){c||(Z=l+t,[0,1,2].forEach(t=>{Y[3*Z+t]=p.getComponent(t),$[3*Z+t]=u.getComponent(t)}),tt[2*Z]=+s,tt[2*Z+1]=t/h),P.copy(O).multiplyScalar(H),A.addVectors(E,P);for(let e=0;e<d;e++){let s=e*G+r;_.addVectors(B.copy(W).multiplyScalar(q*Math.sin(s)),P.copy(O).multiplyScalar(q*Math.cos(s))),V.copy(_).normalize(),P.addVectors(A,_),_.normalize(),Z=n+e*N+t,[0,1,2].forEach(t=>{Y[3*Z+t]=P.getComponent(t),$[3*Z+t]=V.getComponent(t)});let o=+i+Math.sin(s);tt[2*Z]=(a+q*o)/nt,tt[2*Z+1]=t/h}}P.addVectors(E,D),Z=K+e*N+t,[0,1,2].forEach(t=>{Y[3*Z+t]=P.getComponent(t),$[3*Z+t]=O.getComponent(t)}),tt[2*Z]=(at+e*rt)/nt,tt[2*Z+1]=t/h}}let ht=F+2*d+2,[pt,dt]=[+c,ht-1];for(let t=pt;t<=dt-1;t++){let e=c&&t===dt-1;for(let i=0;i<N-1;i++)u=t*N+i,m=u+1,y=(e?i:u)+N,v=(e?i+1:m)+N,0===t?et.push(m,v,y):t===ht-2?et.push(u,m,y):et.push(u,m,y,m,v,y)}this.setIndex(et),this.setAttribute("position",new b(Y,3)),this.setAttribute("normal",new b($,3)),this.setAttribute("uv",new b(tt,2))}getClosedTorusIndicesForBooleanOrSubdiv(){let t,e,i,s,r=this.userData.parameters,a=Math.ceil(r.tubularSegments),n=r.radialSegments,o=n+1,l=[];for(let r=1;r<a;r++)for(let a=0;a<n;a++)t=r*o+a,e=t+1,i=t+o,s=e+o,l.push(t,e,i,e,s,i);for(let r=0;r<n;r++)t=a*o+r,e=t+1,i=r+o,s=r+1+o,l.push(t,e,i,e,s,i);return Mt.array=new Uint32Array(l),Mt.count=l.length,Mt}},At=new Map,Ct=0;function Dt(t){return Pt||(Pt=async function(){let e=t??"https://cdn.spline.design/@splinetool/runtime@2.0.161/build",i=import("./boolean.js"),[s,r]=await Promise.all([i,fetch(`${e}/boolean.wasm`).then(t=>t.arrayBuffer())]);await s.default({module_or_path:r}),bt=s}())}function Ot(){if(void 0===bt)throw new Error("boolean-wasm is not loaded");return bt}function _t(t){let e=At.get(t);if(void 0===e)throw new Error("Unknown csg mesh set handle "+t);return e}function Vt(t){return At.set(++Ct,t),Ct}var Rt={0:0,1:1,2:2};function Tt(t,e,i){if(void 0===bt)return-1;let{positions:s,indices:r,normals:a}=function(t,e){if(e&&void 0!==t.userData.positions){let e=t.userData,i=[];for(let t=0,s=0;t<e.verticesPerFace.length;t++){let r=e.verticesPerFace[t];for(let t=1;t<r-1;t++)i.push(e.indices[s],e.indices[s+t],e.indices[s+t+1]);s+=r}return{positions:e.positions instanceof Float32Array?e.positions:new Float32Array(e.positions),indices:new Uint32Array(i)}}let i;i=Bt(t.userData.parameters)?t.getClosedTorusIndicesForBooleanOrSubdiv():t.getIndex();let s,r=t.getAttribute("position");if(null===i){s=new Uint32Array(r.count);for(let t=0;t<s.length;t++)s[t]=t}else s=i.array instanceof Uint32Array?i.array:new Uint32Array(i.array);let a=t.getAttribute("normal"),n=void 0!==a&&3===a.itemSize&&a.count===r.count&&a.array instanceof Float32Array&&!0!==a.isInterleavedBufferAttribute?a.array:void 0;return{positions:r.array,indices:s,normals:n}}(t,e);return Vt(new bt.CsgMesh(s,r,a))}function Wt(t,e){let i=Ot(),s=Rt[e];if(void 0===s)throw new Error("Unknown boolean operation "+e);let r=t.map(_t);if(1===r.length)return i.clone_mesh(r[0]);let a,n=[];if(2===e&&r.length>2){let t=r[0];for(let e=1;e<r.length-1;e++)t=i.boolean_mesh(t,r[e],0),n.push(t);a=i.boolean_mesh(r[r.length-1],t,2)}else if(2===e)a=i.boolean_mesh(r[1],r[0],2);else{let t=r[r.length-1];for(let e=0;e<r.length-1&&(t=i.boolean_mesh(t,r[e],s),n.push(t),0!==t.tri_count());e++);a=t,n.pop()}for(let t of n)t.free();return a}function Ut(t,e,i,s){let r=Ot(),a=Wt(t,e),n=r.mesh_render_data(a,Math.max(s,0));if(i.setAttribute("position",new b(n.positions(),3)),i.setAttribute("normal",new b(n.normals(),3)),n.free(),null===i.boundingSphere&&(i.boundingSphere=new P),0===a.tri_count())i.boundingSphere.center.set(0,0,0),i.boundingSphere.radius=0,i.userData.parameters={width:0,height:0,depth:0};else{let t=a.bounds();i.boundingSphere.center.set(t[0],t[1],t[2]),i.boundingSphere.radius=(t[3]**2+t[4]**2+t[5]**2)**.5,i.userData.parameters={width:2*t[3],height:2*t[4],depth:2*t[5]}}return Vt(a)}function It(t,e){let i=Ot(),s=Wt(t,e),r=i.mesh_topological_data(s),a=r.positions(),n=r.indices();return r.free(),s.free(),{positions:a,indices:n,verticesPerFace:new Uint8Array(n.length/3).fill(3)}}function Lt(t,e){_t(t).transform(new Float32Array(e.elements))}function Ft(t){let e=At.get(t);void 0!==e&&(e.free(),At.delete(t))}function zt(t,e){return Vt(Ot().instanced_union(_t(t),e))}function jt(t){return null!==t&&"booleanOp"in t}var Nt=class extends(St(C)){constructor(){super(...arguments),this.booleanMeshSetAddress=-1,this.booleanWasTransformed=!1,this.booleanMatrixInvOld=new v}updateVisible(t){super.updateVisible(t),this.visible=!jt(this.parent)&&this.visible,jt(this.parent)&&this.parent.invalidateDownstreamBooleanData()}onClonerLayoutUpdated(){jt(this.parent)&&this.invalidateDownstreamBooleanData()}freeBooleanPointer(){-1!==this.booleanMeshSetAddress&&(Ft(this.booleanMeshSetAddress),this.booleanMeshSetAddress=-1)}dispose(){super.dispose(),this.freeBooleanPointer()}invalidateDownstreamBooleanData(t=!1){return t?this.booleanWasTransformed=!0:this.freeBooleanPointer(),jt(this.parent)?this.parent.invalidateDownstreamBooleanData():this}invalidateUpstreamBooleanData(){this.freeBooleanPointer();for(let t of this.children)t instanceof Nt&&(t.freeBooleanPointer(),jt(t)&&t.invalidateUpstreamBooleanData())}updateTransformState(t,e){let i=super.updateTransformState(t,e);return i&&jt(this.parent)&&this.invalidateDownstreamBooleanData(!0),i}onVariableUpdate(t=!1){super.onVariableUpdate(t),jt(this.parent)&&this.invalidateDownstreamBooleanData(!0)}},kt=new M;function Gt(t,e=0,i=t.count,s,r){let a=1/0,n=1/0,o=1/0,l=-1/0,h=-1/0,p=-1/0;for(let s=e;s<i;s++){let e=t.getX(s),i=t.getY(s),r=t.getZ(s);e<a&&(a=e),i<n&&(n=i),r<o&&(o=r),e>l&&(l=e),i>h&&(h=i),r>p&&(p=r)}kt.min.set(a,n,o),kt.max.set(l,h,p),kt.getCenter(s),kt.getSize(r).multiplyScalar(.5)}var Ht=new E,qt=new A,Zt=class extends Nt{constructor(t,e){super(Ht,qt),this.super_Entity(t,e)}updateState(t,e){this.updateState_Entity(t,e)}raycast(t,e){if(this.raycastDeformed(t,e))return;super.raycast(t,e)}raycastDeformed(t,e){return!1}updateEntityBoxSize(t,e){let i=this.geometry.getAttribute("position");void 0!==i?Gt(i,this.geometry.drawRange.start,this.geometry.drawRange.count<1/0?this.geometry.drawRange.count:i.count,t,e):super.updateEntityBoxSize(t,e)}};export{O as a,_ as b,D as c,j as d,N as e,G as f,rt as g,at as h,ct as i,St as j,wt as k,Bt as l,Et as m,Dt as n,Tt as o,Ut as p,It as q,Lt as r,Ft as s,zt as t,Gt as u,Zt as v};
|
|
Binary file
|
|
Binary file
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as e,b as t}from"./runtime-chunk-
|
|
1
|
+
import{a as e,b as t}from"./runtime-chunk-7JZHIVIE.js";import{a,c as i,g as s,i as r}from"./runtime-chunk-KEVKWE7V.js";import{a as n}from"./runtime-chunk-TU4KDRKR.js";import{a as l,b as o}from"./runtime-chunk-APKU3YYA.js";import{Y as h,d as u,e as c,i as d,na as p}from"./runtime-chunk-ARNZDNZ5.js";import{b as y,h as g,j as f,v as m}from"./runtime-chunk-CAU75OZB.js";import{c as b}from"./runtime-chunk-2PT2WH66.js";import{c as v,l as C}from"./runtime-chunk-TZCHGFVF.js";import{Aa as k,ra as S,ua as A,w}from"./runtime-chunk-ADHKZQMB.js";import{Pe as F,Qc as L,Vc as O,Wc as H,Xc as j,ed as B,ld as D,nd as M,xe as U}from"./runtime-chunk-KPOUV3HD.js";function T(e){return e instanceof p&&e.needsAO&&!b(e)&&!0!==e.isDecalObject}function z(e){let t=e.cloner;if(t&&Array.isArray(t.children))for(let a of t.children)a?.layers&&(a.layers.mask=e.layers.mask)}function P(e){return e.getLayersOfType("reflection").filter(e=>e.data.visible).length}function E(e){return e.getLayersOfType("reflection").some(e=>e.data.visible&&1===e.data.mirror)}function x(e){let t=1/0,a=-1/0;for(let i of e.getLayersOfType("reflection")){let e=i.data;if(!e.visible||1===e.mirror)continue;let s="number"==typeof e.blur?e.blur:null;t=Math.min(t,s??0),a=Math.max(a,s??10)}return t===1/0?null:{min:t,max:a}}function I(e){for(let t of e.getLayersOfType("reflection")){let e=t.data;if(!e.visible)continue;let{blur:a,thickness:i,steps:s,stepSize:r}=e;return"number"!=typeof a||"number"!=typeof i||"number"!=typeof s||"number"!=typeof r?"variable":{blur:a,thickness:i,steps:s,stepSize:r,tracingMode:1===e.tracingMode?1:0}}return null}function V(e,t){let a={outline:!1,cavity:!1},i=512&e.layers.mask,s=t.getLayersOfType("transmission"),r=t.getLayersOfType("outline"),n=P(t),h=t.getLayersOfType("cavity");return(r.length>0||h.length>0)&&(e.layers.set(8),s.length>0&&e.layers.enable(3),n>0&&e.layers.enable(4),a.outline=r.length>0,a.cavity=h.length>0,o(e),l(e)),0===s.length&&0===r.length&&0===h.length&&0===n&&e.layers.set(0),i&&e.layers.set(9),!i&&T(e)&&e.layers.enable(5),z(e),a}function W(e,t){if(!t.layers)return!1;let a=512&e.layers.mask,i=!1,s=t.getLayersOfType("transmission").filter(e=>e.data.visible),r=t.getLayersOfType("outline").filter(e=>e.data.visible),n=P(t),l=t.getLayersOfType("cavity").filter(e=>e.data.visible);return s.length>0&&(e.layers.set(3),(r.length>0||l.length>0)&&e.layers.enable(8),n>0&&e.layers.enable(4),i=!0),0===s.length&&0===r.length&&0===l.length&&0===n&&e.layers.set(0),a&&e.layers.set(9),!a&&T(e)&&e.layers.enable(5),z(e),i}function K(e,t){var a;if(!t.layers)return!1;let i=512&e.layers.mask,s=!1,r=P(t),n=t.getLayersOfType("transmission").filter(e=>e.data.visible),l=t.getLayersOfType("outline").filter(e=>e.data.visible),o=t.getLayersOfType("cavity").filter(e=>e.data.visible);return r>0&&((a=e.userData).__splinePlanarMirror??(a.__splinePlanarMirror=0),e.layers.set(4),n.length>0&&e.layers.enable(3),(l.length>0||o.length>0)&&e.layers.enable(8),s=!0),0===r&&0===n.length&&0===l.length&&0===o.length&&e.layers.set(0),i&&e.layers.set(9),!i&&T(e)&&e.layers.enable(5),z(e),s}function Z(e){let t={outline:!1,cavity:!1},a=e=>{t.outline=t.outline||e.outline,t.cavity=t.cavity||e.cavity};return e.traverseEntity(e=>{if(e instanceof p)if(Array.isArray(e.material))for(let t=0;t<e.material.length;t++)a(V(e,e.material[t]));else a(V(e,e.material))}),t}function _(e){let t=!1;return e.traverseEntity(e=>{if(e instanceof p)if(Array.isArray(e.material))for(let a=0;a<e.material.length;a++)W(e,e.material[a])&&(t=!0);else W(e,e.material)&&(t=!0)}),t}function G(e){let t=!1;return e.traverseEntity(e=>{if(e instanceof p)if(Array.isArray(e.material))for(let a=0;a<e.material.length;a++)K(e,e.material[a])&&(t=!0);else K(e,e.material)&&(t=!0)}),t}var Q=new F,R=new L,Y=new D,N=new B;function J(e,t,a,i=!1){let s=e.cloner;if(s){let r=null;if((e.raycast===M.prototype.raycast||e.raycast===m.prototype.raycast)&&!0!==e.isSkinnedMesh){let t=e.geometry;t&&(null===t.boundingSphere&&t.computeBoundingSphere(),r=t.boundingSphere)}for(let n of s.children){if(null!==r&&(N.copy(r).applyMatrix4(n.matrixWorld),!t.ray.intersectsSphere(N)))continue;let s=R.copy(n.matrixWorld).invert(),l=Y.copy(t.ray).applyMatrix4(s),o=e.matrixWorld;l.applyMatrix4(o);let h=Q;h.set(l.origin,l.direction),h.near=t.near,h.far=t.far,h.layers.mask=t.layers.mask;let u=h.intersectObject(e,!1);u.length>0&&a.push({...u[0],object:i?n:e})}}}var X=class extends(f(j)){constructor(e,t,i){if(super(),this.data=t,this.bgColor=new d(1,1,1,1),this.fog=null,this.backupFog=new H(16777215,.1,2e3),this.fogUseBGColor=!1,this.fogMode="linear",this.fogDensity=S.getDensity({}),this.fogHeightFalloff=S.getHeightFalloff({}),this.fogHeightBase=S.getHeightBase({}),this.isActive=!1,this.skyState=null,this.skyStateVersion=0,this.gradingState=null,this.skyHdriHolder=null,this.aoColor=new O,this.penumbraSizeArrayCache=null,this.super_Entity(e,t),this.personalCamera=new a(w,{...k.defaultData,...t.camera,name:"Personal Camera"}),this.personalCamera.objectHelper.visible=!1,this.add(this.personalCamera),this.activeCamera=this.personalCamera,this.ambientLight=new U(13882323,8553090,.75*Math.PI),this.ambientLight.name="Default Ambient Light",this.ambientLight.layers.enable(3),this.ambientLight.removeFromParent(),this.add(this.ambientLight),t.uiScene){let a=C();null===a?v("ui-2d","a page's 2D scene"):this.uiScene=new a.Scene2D((Array.isArray(e)?e[0]:e)+"-ui",t.uiScene,{dpr:window.devicePixelRatio,shared:i.shared})}else t.uiFrame&&this.createUICanvas(t.uiFrame,i)}get scene(){return this.parent}get postprocessing(){return this.data.postprocessing}get frameId(){return this.data.uiFrame}get frame(){return this.uiCanvas?.frame}createUICanvas(e,t){let a=C();null!==a?(this.uiCanvas=new a.UICanvas(this.uuid+"-uiscreen",window.innerWidth,window.innerHeight,t),this.uiCanvas.isScreenSpace=!0,this.uiCanvas.promise.then(()=>{this.uiCanvas?.applyFrame(e),this.uiCanvas?.applySize()})):v("ui-2d","a page's UI canvas")}updateVisible(){}setBackgroundColor(e){this.bgColor=e,!0===this.fogUseBGColor&&(this.backupFog.color=e)}entityChildrenCount(){return this.uiScene?this.uiScene.children.length:super.entityChildrenCount()}updateAmbientLight(e,t){void 0!==e.color&&(this.ambientLight.color=n(e.color,t)),void 0!==e.intensity&&(this.ambientLight.intensity=e.intensity*Math.PI),void 0!==e.enabled&&(e.enabled?this.add(this.ambientLight):this.remove(this.ambientLight))}onDeactive(){this.isActive=!1}onActive(e){this.isActive=!0,e.fog=this.fog,this.traverseEntity(e=>{e instanceof i&&e.recomputeBoolean()}),this.updateShadow(this.data.shadow)}forceMaterialsUpdate(){this.traverseEntity(e=>{if(e instanceof p)if(Array.isArray(e.material))for(let t of e.material)t.needsUpdate=!0;else e.material.needsUpdate=!0,e.material.dispose()})}updateShadow(e){if(void 0===e.softShadowQuality&&void 0===e.type||!this.isActive)return;let t=this.data.shadow,a=A.isSoft(t);h(a,t?.softShadowQuality)&&this.forceMaterialsUpdate()}updateFog(e,t){e.enabled?this.fog=this.backupFog:this.fog=null,this.isActive&&(this.scene.fog=this.fog),this.fogUseBGColor=e.useBackgroundColor,e.useBackgroundColor?this.backupFog.color.set(this.bgColor):this.backupFog.color=n(e.color,t),this.backupFog.near=e.near,this.backupFog.far=e.far,this.fogMode=S.getMode(e),this.fogDensity=S.getDensity(e),this.fogHeightFalloff=S.getHeightFalloff(e),this.fogHeightBase=S.getHeightBase(e)}updateSky(e,t){this.skyState=e??null,this.skyStateVersion++;let a=e?.hdri?.image;this.skyHdriHolder=null!=a?t.image(a):null}updateAo(e,t){void 0!==e.aoColor&&(this.aoColor=n(e.aoColor,t))}updateByOp(e,t,a,i){let s=this.data.uiFrame;super.updateByOp(e,t,a,i);let r=t;y(e.path,["fog"])?this.updateFog(r.fog,a.shared):y(e.path,["sky"])?this.updateSky(r.sky,a.shared):y(e.path,["grading"])?this.gradingState=r.grading??null:y(e.path,["ao"])?this.updateAo(r.ao,a.shared):y(e.path,["ambient"])?this.updateAmbientLight(r.ambient,a.shared):y(e.path,["shadow"])?this.updateShadow(r.shadow):0===e.type&&0===e.path.length&&(void 0!==e.props.uiFrame||s!==r.uiFrame)&&this.updateUIFrame(e.props.uiFrame,a)}updateUIFrame(e,t){e?(this.uiCanvas||this.createUICanvas(e,t),this.uiCanvas.enabled=!0,this.uiCanvas.applyFrame(e)):this.uiCanvas&&(this.uiCanvas.enabled=!1)}updateState(e,t){this.updateState_Entity(e,t),void 0!==e.backgroundColor&&this.setBackgroundColor(n(e.backgroundColor,t.shared)),void 0!==e.fog&&this.updateFog(e.fog,t.shared),void 0!==e.sky&&this.updateSky(e.sky,t.shared),void 0!==e.grading&&(this.gradingState=e.grading),void 0!==e.ambient&&this.updateAmbientLight(e.ambient,t.shared),void 0!==e.ao&&this.updateAo(e.ao,t.shared),void 0!==e.shadow&&this.updateShadow(e.shadow)}createFrame(e,t){}raycast(e,t){super.raycast(e,t)}switchActiveCamera(e){e instanceof a&&e.isDescendantOf(this)&&(this.activeCamera!==this.personalCamera&&(this.activeCamera.objectHelper.visible=!0),this.activeCamera=e,e.objectHelper.visible=!1)}get playCamera(){let e=this.scene?.find(this.data.publish.playCamera);return e instanceof a?e:this.personalCamera}switchToPlayCamera(){this.switchActiveCamera(this.playCamera)}get penumbraSizeArray(){return null===this.penumbraSizeArrayCache&&this.updatePenumbraSizeArray(),this.penumbraSizeArrayCache}updatePenumbraSizeArray(){this.penumbraSizeArrayCache=new Array(u).fill(.5);let a=0,i=0;this.traverseEntity(s=>{if(!s.visible)return!0;s instanceof e&&s.visible&&a<c&&(this.penumbraSizeArrayCache[a]=s.data.penumbraSize??.5,a+=1),s instanceof t&&s.visible&&a<u-c&&(this.penumbraSizeArrayCache[c+i]=s.data.penumbraSize??.5,i+=1)})}raycastWithClones(e){let t=[],a=i=>{for(let n of i.children){let i=n.cloner;g.is(n)&&(n.visible||i?.object.data.visible)&&((s(n)||r(n)&&this.scene.enableHelpers&&n.objectHelper.visible)&&(e.intersectObject(n,!1,t),J(n,e,t,!0)),a(n))}};return a(this),t}updateEntity2DByOp(e,t,a,i){this.uiCanvas?.updateEntity2DByOp(e,t,a,i)}};export{E as a,x as b,I as c,Z as d,_ as e,G as f,J as g,X as h};
|
|
Binary file
|
|
Binary file
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{v as e}from"./runtime-chunk-7B2VPZYM.js";import{$c as t,Gc as s,Hc as a,Hd as i,Ib as r,Ic as n,Ie as h,Qc as o,Vc as l,Yd as d,Zd as c,md as u,nd as g}from"./runtime-chunk-KPOUV3HD.js";var p=null;function b(e){p=e}function S(){return p}var m=null;function f(e){m=e}function M(){return m}var y=new l;function R(e,t,s){return y.setRGB(e,t,s,r),{r:y.r,g:y.g,b:y.b}}var w=(e,t)=>"number"==typeof e&&Number.isFinite(e)?e:t,x=e=>Array.isArray(e)&&"number"==typeof e[0]&&"number"==typeof e[1]?[e[0],e[1]]:[0,0];function v(e,t,s){let a,i=w(e.angle,0),[r,n]=x(e.offset),[h,o]=x(e.morph),l=e.colors??[],d=e.steps??[],c=Math.min(10,l.length,d.length);if(0===c)return[1,1,1,1];if(1===e.gradientType){let e=3*(t+h)-(t+r)-1,l=3*(s+o)-(s+n)-1;a=Math.hypot(e,l)+i}else if(2===e.gradientType){let e=-1*Math.atan2(t+h-.5+r,s+o-.5+n),l=i/Math.PI/-2+.5*e/Math.PI;a=l-Math.floor(l)}else{let e=.5+h/(0!==t?t:1e-6),l=o/(0!==s?s:1e-6),d=Math.cos(i)*e-Math.sin(i)*l,c=Math.sin(i)*e+Math.cos(i)*l,u=d*d+c*c;a=u>1e-12?(((t-.5+r)/2+d/2)*d+((s-.5+n)/2+c/2)*c)/u:0}let u=l[0][0],g=l[0][1],p=l[0][2],b=l[0][3];for(let t=1;t<c;t++){let s=d[t-1],i=d[t]-s,r=0!==i?Math.min(1,Math.max(0,(a-s)/i)):a>=s?1:0;e.smooth&&(r=r*r*(3-2*r)),u+=(l[t][0]-u)*r,g+=(l[t][1]-g)*r,p+=(l[t][2]-p)*r,b+=(l[t][3]-b)*r}return[u,g,p,b]}function A(e,t){let s=e,a=s?.data?.layers;if(a&&"function"==typeof a.forEach){let e=t,s=[];return a.forEach(t=>{let a=t.data;if(!1===a.visible||!0===a.isMask)return;let i=w(a.alpha,1);if(!(i<=0))if("color"===a.type){let t,r=a.color;"string"==typeof r?t="function"==typeof e?.color?e.color(r):void 0:r&&"number"==typeof r.r&&(t=r),t&&s.push({kind:"color",layer:a,rgb:{...R(t.r,t.g,t.b),a:t.a??1},alpha:i})}else"gradient"===a.type&&s.push({kind:"gradient",layer:a,alpha:i})}),0===s.length?null:(e,t)=>{let a=1,i=1,r=1,n=!0;for(let h of s){let s,o,l,d;if("color"===h.kind)({r:s,g:o,b:l}=h.rgb),d=h.rgb.a;else{let[a,i,r,n]=v(h.layer,e,t);({r:s,g:o,b:l}=R(a,i,r)),d=n}let c=n?1:Math.min(1,Math.max(0,d*h.alpha));a+=(s-a)*c,i+=(o-i)*c,r+=(l-r)*c,n=!1}return{r:a,g:i,b:r}}}if(s?.color&&!0===s.color.isColor){let{r:e,g:t,b:a}=s.color;return()=>({r:e,g:t,b:a})}return null}var j=32,I=16384,B=32*I,H=100;function F(e,t){if("torus"===e){let e=t()*Math.PI*2,s=t()*Math.PI*2,a=Math.cos(e),i=Math.sin(e),r=Math.cos(s),n=Math.sin(s);return{x:(1.4+.7*r)*a,y:-(1.4+.7*r)*i,z:.7*n,nx:r*a,ny:-r*i,nz:n,cr:1,cg:1,cb:1}}if("cylinder"===e){let e=t()*Math.PI*2,s=Math.cos(e),a=Math.sin(e);return{x:.8*s,y:1.6*(t()-.5),z:.8*a,nx:s,ny:0,nz:a,cr:1,cg:1,cb:1}}let s=t()*Math.PI*2,a=2*t()-1,i=Math.acos(a),r=Math.sin(i)*Math.cos(s),n=Math.cos(i),h=Math.sin(i)*Math.sin(s);return{x:r,y:n,z:h,nx:r,ny:n,nz:h,cr:1,cg:1,cb:1}}function W(e){let{geometry:t,matrix:s}=e,a=t.getAttribute("position");if(!a||a.count<3)return null;let i=t.getAttribute("normal"),r=t.getAttribute("uv"),h=t.getAttribute("color"),o=t.getIndex(),l=o?o.count/3:a.count/3;if(l<1)return null;let d=(e,t)=>o?o.getX(3*e+t):3*e+t,c=s?s.elements:null,u=s?(new n).getNormalMatrix(s).elements:null,g=e=>{let t=a.getX(e),s=a.getY(e),i=a.getZ(e);return c?c[0]*t+c[4]*s+c[8]*i+c[12]:t},p=e=>{let t=a.getX(e),s=a.getY(e),i=a.getZ(e);return c?c[1]*t+c[5]*s+c[9]*i+c[13]:s},b=e=>{let t=a.getX(e),s=a.getY(e),i=a.getZ(e);return c?c[2]*t+c[6]*s+c[10]*i+c[14]:i},S=new Float64Array(l),m=0;for(let e=0;e<l;e++){let t=d(e,0),s=d(e,1),a=d(e,2),i=g(t),r=p(t),n=b(t),h=g(s)-i,o=p(s)-r,l=b(s)-n,c=g(a)-i,u=p(a)-r,f=b(a)-n,M=o*f-l*u,y=l*c-h*f,R=h*u-o*c;m+=.5*Math.sqrt(M*M+y*y+R*R),S[e]=m}return m<=0?null:{total:m,sample:(t,s)=>{let a=0,n=l-1;for(;a<n;){let e=a+n>>1;S[e]<t?a=e+1:n=e}let o=a,c=d(o,0),m=d(o,1),f=d(o,2),M=s(),y=s();M+y>1&&(M=1-M,y=1-y);let R,w,x,v=1-M-y,A=g(c)*v+g(m)*M+g(f)*y,j=p(c)*v+p(m)*M+p(f)*y,I=b(c)*v+b(m)*M+b(f)*y;if(i){if(R=i.getX(c)*v+i.getX(m)*M+i.getX(f)*y,w=i.getY(c)*v+i.getY(m)*M+i.getY(f)*y,x=i.getZ(c)*v+i.getZ(m)*M+i.getZ(f)*y,u){let e=u[0]*R+u[3]*w+u[6]*x,t=u[1]*R+u[4]*w+u[7]*x,s=u[2]*R+u[5]*w+u[8]*x;R=e,w=t,x=s}}else{let e=g(c),t=p(c),s=b(c),a=g(m)-e,i=p(m)-t,r=b(m)-s,n=g(f)-e,h=p(f)-t,o=b(f)-s;R=i*o-r*h,w=r*n-a*o,x=a*h-i*n}let B=Math.sqrt(R*R+w*w+x*x)||1,H=1,F=1,W=1;if(h)H=h.getX(c)*v+h.getX(m)*M+h.getX(f)*y,F=h.getY(c)*v+h.getY(m)*M+h.getY(f)*y,W=h.getZ(c)*v+h.getZ(m)*M+h.getZ(f)*y;else if(e.sampleColor){let t=r?r.getX(c)*v+r.getX(m)*M+r.getX(f)*y:.5,s=r?r.getY(c)*v+r.getY(m)*M+r.getY(f)*y:.5,a=e.sampleColor(t,s);a&&(H=a.r,F=a.g,W=a.b)}return{x:A,y:j,z:I,nx:R/B,ny:w/B,nz:x/B,cr:H,cg:F,cb:W}}}}function k(e){let t=Math.min(Math.max(1,Math.floor(e.guideStrands)),I),s=function(e){let t=e>>>0;return()=>{t|=0,t=t+1831565813|0;let e=Math.imul(t^t>>>15,1|t);return e=e+Math.imul(e^e>>>7,61|e)^e,((e^e>>>14)>>>0)/4294967296}}(e.seed??1337),a="object"===e.shape&&e.sampler,i=a?e.samplerRadius??H:H,r=new Float32Array(4*B),n=new Float32Array(B),h=new Float32Array(4*I).fill(1);for(let o=0;o<t;o++){let t=a?e.sampler(s):F(e.shape,s),l=a?t.x:t.x*i,d=a?t.y:t.y*i,c=a?t.z:t.z*i,{nx:u,ny:g,nz:p}=t;h[4*o+0]=t.cr,h[4*o+1]=t.cg,h[4*o+2]=t.cb;let b,S,m,f=32*o,M=(1.8+.8*s())*e.hairLength*i/31,y=.5+1.5*s(),R=(.02+.06*s())*i;Math.abs(g)<.99?(b=-p,S=0,m=u):(b=1,S=0,m=0);let w=Math.sqrt(b*b+S*S+m*m)||1;for(let e=0;e<32;e++){let t=e/31,s=t*t*.4*i,a=R*Math.sin(t*y*Math.PI*2),h=4*(f+e);r[h+0]=l+u*M*e+a*b/w,r[h+1]=d+g*M*e-s+a*S/w,r[h+2]=c+p*M*e+a*m/w,r[h+3]=0===e?0:1,e<31&&(n[f+e]=M)}}return{initialPositions:r,restLengths:n,unitScale:i,rootColors:h}}var C=1/60,P=4,O=new o,L=new s,z=new a,q=new a,Y=class extends e{constructor(e,i,r){super(e,i),this.type="HairSystem",this.isHairSystem=!0,this.simRunning=!1,this.previewRequested=!1,this.playModeActive=!1,this.pendingSimSeconds=0,this.simTime=0,this.resetRequested=!0,this.generation=0,this.settledSimSeconds=0,this.lastMotionFingerprint=0,this.lastBoneQuat=new s,this.lastBonePos=new a,this.hasLastBone=!1,this.baseFoundAtRegen=!1,this.baseSourceGeomsAtRegen=[],this.baseSourceHashesAtRegen=[],this.baseColorHashAtRegen=0,this.baseScaleAtRegen=0,this.classicFallbackWarned=!1,this.regenSnapshot=null,this.context=r,this.data=i,this.geometry.setAttribute("position",new t(new Float32Array(0),3)),this.material=new u({colorWrite:!1,depthWrite:!1}),this.frustumCulled=!1,this.scalpMesh=new g(new d(H,48,32),new u({color:5448477})),this.scalpMesh.name="HairScalp",this.add(this.scalpMesh);let n=new h;n.setAttribute("position",new t(new Float32Array(12),3)),n.setIndex([0,2,1,2,3,1]),n.instanceCount=0,this.ribbonMesh=new g(n,new u({visible:!1})),this.ribbonMesh.name="HairRibbons",this.ribbonMesh.frustumCulled=!1,this.ribbonMesh.visible=!1,this.ribbonMesh.matrixAutoUpdate=!1,this.ribbonMesh.updateMatrixWorld=()=>{this.ribbonMesh.matrixWorld.identity()},this.ribbonMesh.updateWorldMatrix=()=>{this.ribbonMesh.matrixWorld.identity()},this.add(this.ribbonMesh),this.activeGuideStrands=i.guideStrands,this.roots=this.buildRoots(),this.regenSnapshot={guideStrands:i.guideStrands,hairLength:i.hairLength,spreadRadius:i.spreadRadius,headShape:i.headShape,baseObjectId:i.baseObjectId},this.applyScalpState(),this.applyShadowState(),this.syncSimRunning()}update(e){!this.simRunning||(this.pendingSimSeconds=Math.min(this.pendingSimSeconds+e/1e3,4*C*2),this.trackMotionRest(e/1e3))}trackMotionRest(e){this.boneTransform(L,z);let t=this.hasLastBone&&(Math.abs(this.lastBoneQuat.dot(L))<.9999995||this.lastBonePos.distanceToSquared(z)>1e-8),s=this.motionFingerprint(),a=!this.hasLastBone||t||this.resetRequested||s!==this.lastMotionFingerprint||this.data.windStrength>.001;this.lastBoneQuat.copy(L),this.lastBonePos.copy(z),this.lastMotionFingerprint=s,this.hasLastBone=!0,this.settledSimSeconds=a?0:this.settledSimSeconds+e}motionFingerprint(){let e=this.data;return e.gravity+2*e.damping+3*e.localStiffness+4*e.globalStiffness+5*e.globalRange+6*e.stiffnessFalloff+7*e.windStrength+8*e.vspCoefficient+9*e.kink+10*e.kinkFrequency+11*e.clumpStrength+12*e.clumpSize+13*e.clumpTipScale}get isSimulating(){return(this.simRunning||this.resetRequested)&&this.visible}get isMotionSettled(){return this.settledSimSeconds>6}get isVisiblyAnimating(){return this.isSimulating&&!this.isMotionSettled}startPreview(){this.previewRequested=!0,this.syncSimRunning()}stopPreview(){this.previewRequested=!1,this.syncSimRunning()}setPlayMode(e){this.playModeActive=e,e&&this.resetSimulation(),this.syncSimRunning()}resetSimulation(){this.resetRequested=!0,this.pendingSimSeconds=0,this.simTime=0,this.settledSimSeconds=0}warnClassicFallbackOnce(){this.classicFallbackWarned||(this.classicFallbackWarned=!0,console.warn("[spline] Hair System strands require the WebGPU renderer — the WebGL fallback shows only the scalp. Reload with ?renderer=webgpu in a WebGPU-capable browser."))}syncSimRunning(){this.simRunning=this.playModeActive||this.previewRequested||this.data.autoPlay}updateState(e,t){super.updateState(e,t),this.updateHairState(e)}updateHairState(e){if((void 0!==e.guideStrands||void 0!==e.hairLength||void 0!==e.spreadRadius||void 0!==e.headShape||void 0!==e.baseObjectId)&&this.regenerate(),(void 0!==e.headShape||void 0!==e.baseObjectId)&&this.applyScalpState(),void 0!==e.headColor){let t=this.scalpMesh.material;!0===t.isMeshBasicMaterial&&t.color.setRGB(e.headColor.r,e.headColor.g,e.headColor.b,r)}(void 0!==e.castShadow||void 0!==e.receiveShadow)&&this.applyShadowState(),void 0!==e.autoPlay&&this.syncSimRunning()}applyShadowState(){let e=this.data.castShadow??!0,t=this.data.receiveShadow??!0;this.castShadow=e,this.receiveShadow=t,this.scalpMesh.castShadow=e,this.scalpMesh.receiveShadow=t,this.ribbonMesh.castShadow=e,this.ribbonMesh.receiveShadow=t}regenerate(){this.activeGuideStrands=Math.max(1,Math.min(Math.floor(this.data.guideStrands),16384)),this.roots=this.buildRoots(),this.generation++,this.regenSnapshot={guideStrands:this.data.guideStrands,hairLength:this.data.hairLength,spreadRadius:this.data.spreadRadius,headShape:this.data.headShape,baseObjectId:this.data.baseObjectId},this.resetSimulation()}checkDataDrift(){let e=this.data,t=this.regenSnapshot;if(null===t||t.guideStrands!==e.guideStrands||t.hairLength!==e.hairLength||t.spreadRadius!==e.spreadRadius||t.headShape!==e.headShape||t.baseObjectId!==e.baseObjectId){let s=null===t||t.headShape!==e.headShape||t.baseObjectId!==e.baseObjectId;this.regenerate(),s&&this.applyScalpState()}this.syncSimRunning(),this.applyShadowState(),this.checkBaseDrift()}buildRoots(){let{headShape:e,baseObjectId:t,guideStrands:s,hairLength:a}=this.data;if(this.baseFoundAtRegen=!1,this.baseSourceGeomsAtRegen=[],this.baseSourceHashesAtRegen=[],this.baseColorHashAtRegen=0,this.baseScaleAtRegen=0,"object"===e&&t){let e=this.context.scene.find(t);if(e){this.baseFoundAtRegen=!0,e.updateWorldMatrix(!0,!0);let t=this.collectBaseSources(e),i=t?function(e){let t=[];for(let s of e){let e=W(s);e&&t.push(e)}if(0===t.length)return null;let s=new Float64Array(t.length),a=0;for(let e=0;e<t.length;e++)a+=t[e].total,s[e]=a;return a<=0?null:e=>{let i=e()*a,r=0,n=t.length-1;for(;r<n;){let e=r+n>>1;s[e]<i?r=e+1:n=e}let h=0===r?i:i-s[r-1];return t[r].sample(h,e)}}(t.sources):null;if(this.baseSourceGeomsAtRegen=t?.sources.map(e=>e.geometry)??[],this.baseSourceHashesAtRegen=t?.hashes??[],this.baseColorHashAtRegen=t?.colorHash??0,t&&i){let r=this.baseWorldScale(e),n=Math.max(t.radius*r,.001);this.baseScaleAtRegen=r;let h=r;return k({shape:"object",guideStrands:s,hairLength:a,sampler:e=>{let t=i(e);return{...t,x:t.x*h,y:t.y*h,z:t.z*h}},samplerRadius:n})}}}return k({shape:"object"===e?"sphere":e,guideStrands:s,hairLength:a})}collectBaseSources(e){let t=[],s=[],a=0,i=0;O.copy(e.matrixWorld).invert();let r=O.clone(),n=h=>{if(!0===h.isHairSystem||h!==e&&!1===h.visible)return;let l=h.geometry;if(!0===h.isMesh&&l&&(l.getAttribute("position")?.count??0)>=3){let n=h===e?void 0:(new o).multiplyMatrices(r,h.matrixWorld),d=Array.isArray(h.material)?h.material[0]:h.material;t.push({geometry:l,matrix:n,sampleColor:A(d,this.context.shared)??void 0}),s.push(Y.matrixHash(n)),i+=function(e,t){let s=e,a=0,i=1,r=e=>{a+=e*i,i+=1},n=s?.data?.layers;if(n&&"function"==typeof n.forEach){let e=t;n.forEach(t=>{let s=t.data;if(!1!==s.visible)if("color"===s.type){let t=s.color,a="string"==typeof t?"function"==typeof e?.color?e.color(t):void 0:t;a&&"number"==typeof a.r&&(r(a.r),r(a.g),r(a.b)),r(w(s.alpha,1))}else if("gradient"===s.type){let e=s;for(let t of e.colors??[])r(t[0]),r(t[1]),r(t[2]),r(t[3]);for(let t of e.steps??[])r(t);r(w(e.angle,0)),r(e.gradientType),r(e.smooth?1:0)}})}else s?.color&&!0===s.color.isColor&&(r(s.color.r),r(s.color.g),r(s.color.b));return a}(d,this.context.shared),null===l.boundingSphere&&l.computeBoundingSphere();let c=l.boundingSphere;if(c){let e=0,t=1;n?(z.copy(c.center).applyMatrix4(n),e=z.length(),t=Y.matrixMaxScale(n)):e=c.center.length(),a=Math.max(a,e+c.radius*t)}}for(let e of h.children)n(e)};return n(e),0===t.length?null:{sources:t,hashes:s,radius:Math.max(a,.001),colorHash:i}}static matrixHash(e){if(!e)return 0;let t=e.elements,s=0;for(let e=0;e<16;e++)s+=t[e]*(e+1);return s}static matrixMaxScale(e){let t=e.elements,s=Math.hypot(t[0],t[1],t[2]),a=Math.hypot(t[4],t[5],t[6]),i=Math.hypot(t[8],t[9],t[10]);return Math.max(s,a,i,1e-6)}baseWorldScale(e){return O.copy(e.matrixWorld).decompose(z,L,q),Math.max(Math.abs(q.x),Math.abs(q.y),Math.abs(q.z),1e-6)}get widthWorldScale(){return"object"===this.data.headShape&&this.data.baseObjectId&&this.baseScaleAtRegen>0?this.baseScaleAtRegen:1}checkBaseDrift(){if("object"!==this.data.headShape||!this.data.baseObjectId)return;let e=this.context.scene.find(this.data.baseObjectId);if(!e)return;if(!this.baseFoundAtRegen)return void this.regenerate();e.updateWorldMatrix(!0,!0);let t=this.collectBaseSources(e),s=t?.sources??[],a=t?.hashes??[],i=this.baseSourceGeomsAtRegen,r=this.baseSourceHashesAtRegen,n=s.length!==i.length;if(!n)for(let e=0;e<s.length;e++)if(s[e].geometry!==i[e]||Math.abs(a[e]-r[e])>1e-4*Math.max(Math.abs(r[e]),1)){n=!0;break}if(!n&&"object"===this.data.hairColorSource&&(t?.colorHash??0)!==this.baseColorHashAtRegen&&(n=!0),!n&&s.length>0){let t=this.baseWorldScale(e);n=Math.abs(t-this.baseScaleAtRegen)>.001*Math.max(this.baseScaleAtRegen,1e-6)}n&&this.regenerate()}applyScalpState(){let e=this.data.headShape,t="object"===e&&null!==this.data.baseObjectId;this.scalpMesh.visible=!t,!t&&(this.scalpMesh.geometry.dispose(),this.scalpMesh.geometry="torus"===e?new c(140,70,24,48):"cylinder"===e?new i(80,80,160,48,1):new d(H,48,32))}boneTransform(e,t){let s=this.matrixWorld;if("object"===this.data.headShape&&this.data.baseObjectId){let e=this.context.scene.find(this.data.baseObjectId)?.matrixWorld;e&&(s=e)}O.copy(s).decompose(t,e,q)}raycast(e,t){if(!this.scalpMesh.visible)return;let s=[];this.scalpMesh.raycast(e,s);for(let e of s)e.object=this,t.push(e)}get shadowBoundsRadius(){let e="torus"===this.data.headShape?2.6:1.5;return this.roots.unitScale*(e+2.6*Math.max(this.data.hairLength,0))}getShadowBoundsCenter(e){return this.boneTransform(L,e),e}updateEntityBoxSize(e,t){let s=this.shadowBoundsRadius;e.set(0,0,0),t.set(s,s,s)}dispose(){super.dispose(),this.scalpMesh.geometry.dispose(),this.scalpMesh.material.dispose(),this.ribbonMesh.geometry.dispose(),this.ribbonMesh.material.dispose?.(),M()?.release(this)}};export{b as a,S as b,f as c,M as d,j as e,I as f,B as g,H as h,C as i,P as j,Y as k};
|
|
1
|
+
import{v as e}from"./runtime-chunk-CAU75OZB.js";import{$c as t,Gc as s,Hc as a,Hd as i,Ib as r,Ic as n,Ie as h,Qc as o,Vc as l,Yd as d,Zd as c,md as u,nd as g}from"./runtime-chunk-KPOUV3HD.js";var p=null;function b(e){p=e}function S(){return p}var m=null;function f(e){m=e}function M(){return m}var y=new l;function R(e,t,s){return y.setRGB(e,t,s,r),{r:y.r,g:y.g,b:y.b}}var w=(e,t)=>"number"==typeof e&&Number.isFinite(e)?e:t,x=e=>Array.isArray(e)&&"number"==typeof e[0]&&"number"==typeof e[1]?[e[0],e[1]]:[0,0];function v(e,t,s){let a,i=w(e.angle,0),[r,n]=x(e.offset),[h,o]=x(e.morph),l=e.colors??[],d=e.steps??[],c=Math.min(10,l.length,d.length);if(0===c)return[1,1,1,1];if(1===e.gradientType){let e=3*(t+h)-(t+r)-1,l=3*(s+o)-(s+n)-1;a=Math.hypot(e,l)+i}else if(2===e.gradientType){let e=-1*Math.atan2(t+h-.5+r,s+o-.5+n),l=i/Math.PI/-2+.5*e/Math.PI;a=l-Math.floor(l)}else{let e=.5+h/(0!==t?t:1e-6),l=o/(0!==s?s:1e-6),d=Math.cos(i)*e-Math.sin(i)*l,c=Math.sin(i)*e+Math.cos(i)*l,u=d*d+c*c;a=u>1e-12?(((t-.5+r)/2+d/2)*d+((s-.5+n)/2+c/2)*c)/u:0}let u=l[0][0],g=l[0][1],p=l[0][2],b=l[0][3];for(let t=1;t<c;t++){let s=d[t-1],i=d[t]-s,r=0!==i?Math.min(1,Math.max(0,(a-s)/i)):a>=s?1:0;e.smooth&&(r=r*r*(3-2*r)),u+=(l[t][0]-u)*r,g+=(l[t][1]-g)*r,p+=(l[t][2]-p)*r,b+=(l[t][3]-b)*r}return[u,g,p,b]}function A(e,t){let s=e,a=s?.data?.layers;if(a&&"function"==typeof a.forEach){let e=t,s=[];return a.forEach(t=>{let a=t.data;if(!1===a.visible||!0===a.isMask)return;let i=w(a.alpha,1);if(!(i<=0))if("color"===a.type){let t,r=a.color;"string"==typeof r?t="function"==typeof e?.color?e.color(r):void 0:r&&"number"==typeof r.r&&(t=r),t&&s.push({kind:"color",layer:a,rgb:{...R(t.r,t.g,t.b),a:t.a??1},alpha:i})}else"gradient"===a.type&&s.push({kind:"gradient",layer:a,alpha:i})}),0===s.length?null:(e,t)=>{let a=1,i=1,r=1,n=!0;for(let h of s){let s,o,l,d;if("color"===h.kind)({r:s,g:o,b:l}=h.rgb),d=h.rgb.a;else{let[a,i,r,n]=v(h.layer,e,t);({r:s,g:o,b:l}=R(a,i,r)),d=n}let c=n?1:Math.min(1,Math.max(0,d*h.alpha));a+=(s-a)*c,i+=(o-i)*c,r+=(l-r)*c,n=!1}return{r:a,g:i,b:r}}}if(s?.color&&!0===s.color.isColor){let{r:e,g:t,b:a}=s.color;return()=>({r:e,g:t,b:a})}return null}var j=32,I=16384,B=32*I,H=100;function F(e,t){if("torus"===e){let e=t()*Math.PI*2,s=t()*Math.PI*2,a=Math.cos(e),i=Math.sin(e),r=Math.cos(s),n=Math.sin(s);return{x:(1.4+.7*r)*a,y:-(1.4+.7*r)*i,z:.7*n,nx:r*a,ny:-r*i,nz:n,cr:1,cg:1,cb:1}}if("cylinder"===e){let e=t()*Math.PI*2,s=Math.cos(e),a=Math.sin(e);return{x:.8*s,y:1.6*(t()-.5),z:.8*a,nx:s,ny:0,nz:a,cr:1,cg:1,cb:1}}let s=t()*Math.PI*2,a=2*t()-1,i=Math.acos(a),r=Math.sin(i)*Math.cos(s),n=Math.cos(i),h=Math.sin(i)*Math.sin(s);return{x:r,y:n,z:h,nx:r,ny:n,nz:h,cr:1,cg:1,cb:1}}function W(e){let{geometry:t,matrix:s}=e,a=t.getAttribute("position");if(!a||a.count<3)return null;let i=t.getAttribute("normal"),r=t.getAttribute("uv"),h=t.getAttribute("color"),o=t.getIndex(),l=o?o.count/3:a.count/3;if(l<1)return null;let d=(e,t)=>o?o.getX(3*e+t):3*e+t,c=s?s.elements:null,u=s?(new n).getNormalMatrix(s).elements:null,g=e=>{let t=a.getX(e),s=a.getY(e),i=a.getZ(e);return c?c[0]*t+c[4]*s+c[8]*i+c[12]:t},p=e=>{let t=a.getX(e),s=a.getY(e),i=a.getZ(e);return c?c[1]*t+c[5]*s+c[9]*i+c[13]:s},b=e=>{let t=a.getX(e),s=a.getY(e),i=a.getZ(e);return c?c[2]*t+c[6]*s+c[10]*i+c[14]:i},S=new Float64Array(l),m=0;for(let e=0;e<l;e++){let t=d(e,0),s=d(e,1),a=d(e,2),i=g(t),r=p(t),n=b(t),h=g(s)-i,o=p(s)-r,l=b(s)-n,c=g(a)-i,u=p(a)-r,f=b(a)-n,M=o*f-l*u,y=l*c-h*f,R=h*u-o*c;m+=.5*Math.sqrt(M*M+y*y+R*R),S[e]=m}return m<=0?null:{total:m,sample:(t,s)=>{let a=0,n=l-1;for(;a<n;){let e=a+n>>1;S[e]<t?a=e+1:n=e}let o=a,c=d(o,0),m=d(o,1),f=d(o,2),M=s(),y=s();M+y>1&&(M=1-M,y=1-y);let R,w,x,v=1-M-y,A=g(c)*v+g(m)*M+g(f)*y,j=p(c)*v+p(m)*M+p(f)*y,I=b(c)*v+b(m)*M+b(f)*y;if(i){if(R=i.getX(c)*v+i.getX(m)*M+i.getX(f)*y,w=i.getY(c)*v+i.getY(m)*M+i.getY(f)*y,x=i.getZ(c)*v+i.getZ(m)*M+i.getZ(f)*y,u){let e=u[0]*R+u[3]*w+u[6]*x,t=u[1]*R+u[4]*w+u[7]*x,s=u[2]*R+u[5]*w+u[8]*x;R=e,w=t,x=s}}else{let e=g(c),t=p(c),s=b(c),a=g(m)-e,i=p(m)-t,r=b(m)-s,n=g(f)-e,h=p(f)-t,o=b(f)-s;R=i*o-r*h,w=r*n-a*o,x=a*h-i*n}let B=Math.sqrt(R*R+w*w+x*x)||1,H=1,F=1,W=1;if(h)H=h.getX(c)*v+h.getX(m)*M+h.getX(f)*y,F=h.getY(c)*v+h.getY(m)*M+h.getY(f)*y,W=h.getZ(c)*v+h.getZ(m)*M+h.getZ(f)*y;else if(e.sampleColor){let t=r?r.getX(c)*v+r.getX(m)*M+r.getX(f)*y:.5,s=r?r.getY(c)*v+r.getY(m)*M+r.getY(f)*y:.5,a=e.sampleColor(t,s);a&&(H=a.r,F=a.g,W=a.b)}return{x:A,y:j,z:I,nx:R/B,ny:w/B,nz:x/B,cr:H,cg:F,cb:W}}}}function k(e){let t=Math.min(Math.max(1,Math.floor(e.guideStrands)),I),s=function(e){let t=e>>>0;return()=>{t|=0,t=t+1831565813|0;let e=Math.imul(t^t>>>15,1|t);return e=e+Math.imul(e^e>>>7,61|e)^e,((e^e>>>14)>>>0)/4294967296}}(e.seed??1337),a="object"===e.shape&&e.sampler,i=a?e.samplerRadius??H:H,r=new Float32Array(4*B),n=new Float32Array(B),h=new Float32Array(4*I).fill(1);for(let o=0;o<t;o++){let t=a?e.sampler(s):F(e.shape,s),l=a?t.x:t.x*i,d=a?t.y:t.y*i,c=a?t.z:t.z*i,{nx:u,ny:g,nz:p}=t;h[4*o+0]=t.cr,h[4*o+1]=t.cg,h[4*o+2]=t.cb;let b,S,m,f=32*o,M=(1.8+.8*s())*e.hairLength*i/31,y=.5+1.5*s(),R=(.02+.06*s())*i;Math.abs(g)<.99?(b=-p,S=0,m=u):(b=1,S=0,m=0);let w=Math.sqrt(b*b+S*S+m*m)||1;for(let e=0;e<32;e++){let t=e/31,s=t*t*.4*i,a=R*Math.sin(t*y*Math.PI*2),h=4*(f+e);r[h+0]=l+u*M*e+a*b/w,r[h+1]=d+g*M*e-s+a*S/w,r[h+2]=c+p*M*e+a*m/w,r[h+3]=0===e?0:1,e<31&&(n[f+e]=M)}}return{initialPositions:r,restLengths:n,unitScale:i,rootColors:h}}var C=1/60,O=4,P=new o,L=new s,z=new a,q=new a,X=class extends e{constructor(e,i,r){super(e,i),this.type="HairSystem",this.isHairSystem=!0,this.simRunning=!1,this.previewRequested=!1,this.playModeActive=!1,this.pendingSimSeconds=0,this.simTime=0,this.resetRequested=!0,this.generation=0,this.settledSimSeconds=0,this.lastMotionFingerprint=0,this.lastBoneQuat=new s,this.lastBonePos=new a,this.hasLastBone=!1,this.baseFoundAtRegen=!1,this.baseSourceGeomsAtRegen=[],this.baseSourceHashesAtRegen=[],this.baseColorHashAtRegen=0,this.baseScaleAtRegen=0,this.classicFallbackWarned=!1,this.regenSnapshot=null,this.context=r,this.data=i,this.geometry.setAttribute("position",new t(new Float32Array(0),3)),this.material=new u({colorWrite:!1,depthWrite:!1}),this.frustumCulled=!1,this.scalpMesh=new g(new d(H,48,32),new u({color:5448477})),this.scalpMesh.name="HairScalp",this.add(this.scalpMesh);let n=new h;n.setAttribute("position",new t(new Float32Array(12),3)),n.setIndex([0,2,1,2,3,1]),n.instanceCount=0,this.ribbonMesh=new g(n,new u({visible:!1})),this.ribbonMesh.name="HairRibbons",this.ribbonMesh.frustumCulled=!1,this.ribbonMesh.visible=!1,this.ribbonMesh.matrixAutoUpdate=!1,this.ribbonMesh.updateMatrixWorld=()=>{this.ribbonMesh.matrixWorld.identity()},this.ribbonMesh.updateWorldMatrix=()=>{this.ribbonMesh.matrixWorld.identity()},this.add(this.ribbonMesh),this.activeGuideStrands=i.guideStrands,this.roots=this.buildRoots(),this.regenSnapshot={guideStrands:i.guideStrands,hairLength:i.hairLength,spreadRadius:i.spreadRadius,headShape:i.headShape,baseObjectId:i.baseObjectId},this.applyScalpState(),this.applyShadowState(),this.syncSimRunning()}update(e){!this.simRunning||(this.pendingSimSeconds=Math.min(this.pendingSimSeconds+e/1e3,4*C*2),this.trackMotionRest(e/1e3))}trackMotionRest(e){this.boneTransform(L,z);let t=this.hasLastBone&&(Math.abs(this.lastBoneQuat.dot(L))<.9999995||this.lastBonePos.distanceToSquared(z)>1e-8),s=this.motionFingerprint(),a=!this.hasLastBone||t||this.resetRequested||s!==this.lastMotionFingerprint||this.data.windStrength>.001;this.lastBoneQuat.copy(L),this.lastBonePos.copy(z),this.lastMotionFingerprint=s,this.hasLastBone=!0,this.settledSimSeconds=a?0:this.settledSimSeconds+e}motionFingerprint(){let e=this.data;return e.gravity+2*e.damping+3*e.localStiffness+4*e.globalStiffness+5*e.globalRange+6*e.stiffnessFalloff+7*e.windStrength+8*e.vspCoefficient+9*e.kink+10*e.kinkFrequency+11*e.clumpStrength+12*e.clumpSize+13*e.clumpTipScale}get isSimulating(){return(this.simRunning||this.resetRequested)&&this.visible}get isMotionSettled(){return this.settledSimSeconds>6}get isVisiblyAnimating(){return this.isSimulating&&!this.isMotionSettled}startPreview(){this.previewRequested=!0,this.syncSimRunning()}stopPreview(){this.previewRequested=!1,this.syncSimRunning()}setPlayMode(e){this.playModeActive=e,e&&this.resetSimulation(),this.syncSimRunning()}resetSimulation(){this.resetRequested=!0,this.pendingSimSeconds=0,this.simTime=0,this.settledSimSeconds=0}warnClassicFallbackOnce(){this.classicFallbackWarned||(this.classicFallbackWarned=!0,console.warn("[spline] Hair System strands require the WebGPU renderer — the WebGL fallback shows only the scalp. Reload with ?renderer=webgpu in a WebGPU-capable browser."))}syncSimRunning(){this.simRunning=this.playModeActive||this.previewRequested||this.data.autoPlay}updateState(e,t){super.updateState(e,t),this.updateHairState(e)}updateHairState(e){if((void 0!==e.guideStrands||void 0!==e.hairLength||void 0!==e.spreadRadius||void 0!==e.headShape||void 0!==e.baseObjectId)&&this.regenerate(),(void 0!==e.headShape||void 0!==e.baseObjectId)&&this.applyScalpState(),void 0!==e.headColor){let t=this.scalpMesh.material;!0===t.isMeshBasicMaterial&&t.color.setRGB(e.headColor.r,e.headColor.g,e.headColor.b,r)}(void 0!==e.castShadow||void 0!==e.receiveShadow)&&this.applyShadowState(),void 0!==e.autoPlay&&this.syncSimRunning()}applyShadowState(){let e=this.data.castShadow??!0,t=this.data.receiveShadow??!0;this.castShadow=e,this.receiveShadow=t,this.scalpMesh.castShadow=e,this.scalpMesh.receiveShadow=t,this.ribbonMesh.castShadow=e,this.ribbonMesh.receiveShadow=t}regenerate(){this.activeGuideStrands=Math.max(1,Math.min(Math.floor(this.data.guideStrands),16384)),this.roots=this.buildRoots(),this.generation++,this.regenSnapshot={guideStrands:this.data.guideStrands,hairLength:this.data.hairLength,spreadRadius:this.data.spreadRadius,headShape:this.data.headShape,baseObjectId:this.data.baseObjectId},this.resetSimulation()}checkDataDrift(){let e=this.data,t=this.regenSnapshot;if(null===t||t.guideStrands!==e.guideStrands||t.hairLength!==e.hairLength||t.spreadRadius!==e.spreadRadius||t.headShape!==e.headShape||t.baseObjectId!==e.baseObjectId){let s=null===t||t.headShape!==e.headShape||t.baseObjectId!==e.baseObjectId;this.regenerate(),s&&this.applyScalpState()}this.syncSimRunning(),this.applyShadowState(),this.checkBaseDrift()}buildRoots(){let{headShape:e,baseObjectId:t,guideStrands:s,hairLength:a}=this.data;if(this.baseFoundAtRegen=!1,this.baseSourceGeomsAtRegen=[],this.baseSourceHashesAtRegen=[],this.baseColorHashAtRegen=0,this.baseScaleAtRegen=0,"object"===e&&t){let e=this.context.scene.find(t);if(e){this.baseFoundAtRegen=!0,e.updateWorldMatrix(!0,!0);let t=this.collectBaseSources(e),i=t?function(e){let t=[];for(let s of e){let e=W(s);e&&t.push(e)}if(0===t.length)return null;let s=new Float64Array(t.length),a=0;for(let e=0;e<t.length;e++)a+=t[e].total,s[e]=a;return a<=0?null:e=>{let i=e()*a,r=0,n=t.length-1;for(;r<n;){let e=r+n>>1;s[e]<i?r=e+1:n=e}let h=0===r?i:i-s[r-1];return t[r].sample(h,e)}}(t.sources):null;if(this.baseSourceGeomsAtRegen=t?.sources.map(e=>e.geometry)??[],this.baseSourceHashesAtRegen=t?.hashes??[],this.baseColorHashAtRegen=t?.colorHash??0,t&&i){let r=this.baseWorldScale(e),n=Math.max(t.radius*r,.001);this.baseScaleAtRegen=r;let h=r;return k({shape:"object",guideStrands:s,hairLength:a,sampler:e=>{let t=i(e);return{...t,x:t.x*h,y:t.y*h,z:t.z*h}},samplerRadius:n})}}}return k({shape:"object"===e?"sphere":e,guideStrands:s,hairLength:a})}collectBaseSources(e){let t=[],s=[],a=0,i=0;P.copy(e.matrixWorld).invert();let r=P.clone(),n=h=>{if(!0===h.isHairSystem||h!==e&&!1===h.visible)return;let l=h.geometry;if(!0===h.isMesh&&l&&(l.getAttribute("position")?.count??0)>=3){let n=h===e?void 0:(new o).multiplyMatrices(r,h.matrixWorld),d=Array.isArray(h.material)?h.material[0]:h.material;t.push({geometry:l,matrix:n,sampleColor:A(d,this.context.shared)??void 0}),s.push(X.matrixHash(n)),i+=function(e,t){let s=e,a=0,i=1,r=e=>{a+=e*i,i+=1},n=s?.data?.layers;if(n&&"function"==typeof n.forEach){let e=t;n.forEach(t=>{let s=t.data;if(!1!==s.visible)if("color"===s.type){let t=s.color,a="string"==typeof t?"function"==typeof e?.color?e.color(t):void 0:t;a&&"number"==typeof a.r&&(r(a.r),r(a.g),r(a.b)),r(w(s.alpha,1))}else if("gradient"===s.type){let e=s;for(let t of e.colors??[])r(t[0]),r(t[1]),r(t[2]),r(t[3]);for(let t of e.steps??[])r(t);r(w(e.angle,0)),r(e.gradientType),r(e.smooth?1:0)}})}else s?.color&&!0===s.color.isColor&&(r(s.color.r),r(s.color.g),r(s.color.b));return a}(d,this.context.shared),null===l.boundingSphere&&l.computeBoundingSphere();let c=l.boundingSphere;if(c){let e=0,t=1;n?(z.copy(c.center).applyMatrix4(n),e=z.length(),t=X.matrixMaxScale(n)):e=c.center.length(),a=Math.max(a,e+c.radius*t)}}for(let e of h.children)n(e)};return n(e),0===t.length?null:{sources:t,hashes:s,radius:Math.max(a,.001),colorHash:i}}static matrixHash(e){if(!e)return 0;let t=e.elements,s=0;for(let e=0;e<16;e++)s+=t[e]*(e+1);return s}static matrixMaxScale(e){let t=e.elements,s=Math.hypot(t[0],t[1],t[2]),a=Math.hypot(t[4],t[5],t[6]),i=Math.hypot(t[8],t[9],t[10]);return Math.max(s,a,i,1e-6)}baseWorldScale(e){return P.copy(e.matrixWorld).decompose(z,L,q),Math.max(Math.abs(q.x),Math.abs(q.y),Math.abs(q.z),1e-6)}get widthWorldScale(){return"object"===this.data.headShape&&this.data.baseObjectId&&this.baseScaleAtRegen>0?this.baseScaleAtRegen:1}checkBaseDrift(){if("object"!==this.data.headShape||!this.data.baseObjectId)return;let e=this.context.scene.find(this.data.baseObjectId);if(!e)return;if(!this.baseFoundAtRegen)return void this.regenerate();e.updateWorldMatrix(!0,!0);let t=this.collectBaseSources(e),s=t?.sources??[],a=t?.hashes??[],i=this.baseSourceGeomsAtRegen,r=this.baseSourceHashesAtRegen,n=s.length!==i.length;if(!n)for(let e=0;e<s.length;e++)if(s[e].geometry!==i[e]||Math.abs(a[e]-r[e])>1e-4*Math.max(Math.abs(r[e]),1)){n=!0;break}if(!n&&"object"===this.data.hairColorSource&&(t?.colorHash??0)!==this.baseColorHashAtRegen&&(n=!0),!n&&s.length>0){let t=this.baseWorldScale(e);n=Math.abs(t-this.baseScaleAtRegen)>.001*Math.max(this.baseScaleAtRegen,1e-6)}n&&this.regenerate()}applyScalpState(){let e=this.data.headShape,t="object"===e&&null!==this.data.baseObjectId;this.scalpMesh.visible=!t,!t&&(this.scalpMesh.geometry.dispose(),this.scalpMesh.geometry="torus"===e?new c(140,70,24,48):"cylinder"===e?new i(80,80,160,48,1):new d(H,48,32))}boneTransform(e,t){let s=this.matrixWorld;if("object"===this.data.headShape&&this.data.baseObjectId){let e=this.context.scene.find(this.data.baseObjectId)?.matrixWorld;e&&(s=e)}P.copy(s).decompose(t,e,q)}raycast(e,t){if(!this.scalpMesh.visible)return;let s=[];this.scalpMesh.raycast(e,s);for(let e of s)e.object=this,t.push(e)}get shadowBoundsRadius(){let e="torus"===this.data.headShape?2.6:1.5;return this.roots.unitScale*(e+2.6*Math.max(this.data.hairLength,0))}getShadowBoundsCenter(e){return this.boneTransform(L,e),e}updateEntityBoxSize(e,t){let s=this.shadowBoundsRadius;e.set(0,0,0),t.set(s,s,s)}dispose(){super.dispose(),this.scalpMesh.geometry.dispose(),this.scalpMesh.material.dispose(),this.ribbonMesh.geometry.dispose(),this.ribbonMesh.material.dispose?.(),M()?.release(this)}};export{b as a,S as b,f as c,M as d,j as e,I as f,B as g,H as h,C as i,O as j,X as k};
|
|
Binary file
|
|
Binary file
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as e}from"./runtime-chunk-
|
|
1
|
+
import{j as e}from"./runtime-chunk-CAU75OZB.js";import{Gd as t,Hc as r,Qc as i,Ye as n,ed as a,ld as o}from"./runtime-chunk-KPOUV3HD.js";var s;(s||(s={})).is=e=>"objectHelper"in e;var l=(r,i)=>class extends(e(r)){constructor(){super(...arguments),this.objectHelper=new i(this),this.gizmos={}}get geometryHelper(){return i.geometryHelper}raycast(e,t){this.objectHelper.raycast(e,t)}showGizmos(){for(let e in this.gizmos){let t=this.gizmos[e];t instanceof n&&(t.visible=!0)}}updateEntityBoxSize(e,r){this.objectHelper.visible&&this.geometryHelper instanceof t?(e.setScalar(0),r.set(this.geometryHelper.parameters.width,this.geometryHelper.parameters.height,this.geometryHelper.parameters.height).multiplyScalar(.5)):super.updateEntityBoxSize(e,r)}hideGizmos(){for(let e in this.gizmos){let t=this.gizmos[e];t instanceof n&&(t.visible=!1)}}},c=e=>{var r;return(r=class extends e{}).geometryHelper=new t(30,30,30),r},p=new o,u=new a,m=new i,f=(e,t,i,n,a=!1,o=e)=>{let s=t,l=o.matrixWorld;if(null===s.boundingSphere&&s.computeBoundingSphere(),u.copy(s.boundingSphere),u.applyMatrix4(l),!1===i.ray.intersectsSphere(u)||(m.copy(l).invert(),p.copy(i.ray).applyMatrix4(m),null!==s.boundingBox&&!1===p.intersectsBox(s.boundingBox)))return;let c,f,h,d,g,y,x=s.index,b=s.attributes.position,w=s.drawRange;if(!1===a){for(g=Math.max(0,w.start),y=Math.min(x.count,w.start+w.count);g<y;g+=3)if(f=x.getX(g),h=x.getX(g+1),d=x.getX(g+2),c=H(e,i,p,b,f,h,d),c)return c.faceIndex=Math.floor(g/3),void n.push(c)}else{let t=s.attributes.position,a=new r,l=new r,c=new r,u=new r,m=2,f=1/((o.scale.x+o.scale.y+o.scale.z)/3),h=f*f;for(let r=Math.max(0,w.start),s=Math.min(t.count,w.start+w.count)-1;r<s;r+=m){if(a.fromBufferAttribute(t,r),l.fromBufferAttribute(t,r+1),p.distanceSqToSegment(a,l,u,c)>h)continue;u.applyMatrix4(o.matrixWorld);let s=i.ray.origin.distanceTo(u);s<i.near||s>i.far||n.push({distance:s,point:c.clone().applyMatrix4(o.matrixWorld),object:e})}}function H(e,t,i,n,a,o,s){let l=new r,c=new r,p=new r,u=new r,m=new r;if(l.fromBufferAttribute(n,a),c.fromBufferAttribute(n,o),p.fromBufferAttribute(n,s),null===i.intersectTriangle(l,c,p,!1,u))return null;m.copy(u),m.applyMatrix4(e.matrixWorld);let f=t.ray.origin.distanceTo(m);return f<t.near||f>t.far?null:{faceIndex:1,distance:f,point:m.clone(),object:e}}};export{c as a,f as b,s as c,l as d};
|
|
Binary file
|
|
Binary file
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as t}from"./runtime-chunk-
|
|
1
|
+
import{a as t}from"./runtime-chunk-SEEDV66Z.js";import{d as e}from"./runtime-chunk-FX42TWCV.js";import{Uc as s}from"./runtime-chunk-KPOUV3HD.js";var r=class extends(e(s,t)){constructor(t,e,s){super(),this.super_Entity(t,e),this.context=s,this.objectHelper.update()}updateState(t,e){this.updateState_Entity(t,e)}};export{r as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
G ��8�K���6�*G�C�(i����'f���B?,�����v^��%�
|
|
Binary file
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as e,b as t}from"./runtime-chunk-RYJNVDUM.js";import{a as r,b as i,c as s,d as o}from"./runtime-chunk-O2KHHZMS.js";import{na as a}from"./runtime-chunk-DL4A3K5P.js";import{h as n,o as h,p,q as c,r as m,s as d,t as l,v as u}from"./runtime-chunk-7B2VPZYM.js";import{f}from"./runtime-chunk-RTLL6WIB.js";import{i as g}from"./runtime-chunk-2PT2WH66.js";import{Aa as y,K as v}from"./runtime-chunk-ADHKZQMB.js";import{Ce as C,Gc as b,Hc as T,Qc as j,Tc as w,Vc as P,dd as M,fd as x,wd as O,we as A,yd as S,ye as _,ze as F}from"./runtime-chunk-KPOUV3HD.js";var D=new T,V=new _,W=class extends S{constructor(e){let t=new x,r=new O({color:16777215,vertexColors:!0,toneMapped:!1}),i=[],s=[],o={},a=new P(15711266),n=new P(15711266),h=new P(2857471);function p(e,t,r){c(e,r),c(t,r)}function c(e,t){i.push(0,0,0),s.push(t.r,t.g,t.b),void 0===o[e]&&(o[e]=[]),o[e].push(i.length/3-1)}p("n1","n2",a),p("n2","n4",a),p("n4","n3",a),p("n3","n1",a),p("f1","f2",a),p("f2","f4",a),p("f4","f3",a),p("f3","f1",a),p("n1","f1",a),p("n2","f2",a),p("n3","f3",a),p("n4","f4",a),p("p","n1",n),p("p","n2",n),p("p","n3",n),p("p","n4",n),p("u1","u2",h),p("u2","u3",h),p("u3","u1",h),t.setAttribute("position",new M(i,3)),t.setAttribute("color",new M(s,3)),super(t,r),this.type="CameraHelper",this.camera=e,this.camera.updateProjectionMatrix&&this.camera.updateProjectionMatrix(),this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.pointMap=o,this.update()}update(){let e=this.geometry,t=this.pointMap;V.projectionMatrixInverse.elements=[.5112609807824982,-0,-0,-0,-0,.41421356237309503,-0,-0,-0,-0,-0,-.099999,-0,-0,-1.0000000000000002,.100001];let r=.8;U("n1",t,e,V,-1,-1,r),U("n2",t,e,V,1,-1,r),U("n3",t,e,V,-1,1,r),U("n4",t,e,V,1,1,r);let i=r;U("f1",t,e,V,-1,-1,i),U("f2",t,e,V,1,-1,i),U("f3",t,e,V,-1,1,i),U("f4",t,e,V,1,1,i);let s=i;U("u1",t,e,V,.35,1.1,s),U("u2",t,e,V,-.35,1.1,s),U("u3",t,e,V,0,1.55,s),e.getAttribute("position").needsUpdate=!0}dispose(){this.geometry.dispose(),this.material.dispose()}};function U(e,t,r,i,s,o,a){D.set(s,o,a).unproject(i);let n=t[e];if(void 0!==n){let e=r.getAttribute("position");for(let t=0,r=n.length;t<r;t++)e.setXYZ(n[t],D.x,D.y,D.z)}}var z=class extends(r(W)){constructor(e){super(e),this.object=e,this.name=`CombinedCameraHelper: ${e.uuid}`}updateMatrixWorld(e){super.updateMatrixWorld(e),this.updateTarget()}updateTarget(){let e=this.object.getTarget();this.updateWorldMatrix(!0,!1),this.worldToLocal(e)}raycast(e,t){i(this.object,this.geometry,e,t,!0)}};function B(e){return 1-Math.pow(1-e,3)}var I=new T,L=new T,H=new b,k=new T,R=new T,q=new T,E=class extends(o(_,z)){constructor(e="",t={...y.defaultData,name:""}){super(),this._cameraType="OrthographicCamera",this.targetOffset=v.DefaultTargetOffset,this.isUpVectorFlipped=!1,this.angleOffsetFromUp=0,this.wasMovedByUser=!1,this.wasMovedBySwitchCameraAction=!1,this._createdAt=typeof performance<"u"?performance.now():0,this._tickProjectionTransition=()=>{let e=this._projectionTransition;if(void 0===e)return;if(this.disposed)return void this._endProjectionTransition();e.raf=requestAnimationFrame(this._tickProjectionTransition);let t=E.projectionTransitionRequestRender??e.requestRender;this.updateProjectionMatrix(),t?.()},this.super_Entity(e,t),this.previousProjectionMatrix=new j,this.matrixAutoUpdate=!0,this.width=window.innerWidth,this.height=window.innerHeight;let r=this.width,i=this.height;this.orthoCamera=new C(-.5*r,.5*r,.5*i,-.5*i,-5e4,1e4),this.perspCamera=new F(45,r/i,50,1e4),this.left=this.orthoCamera.left,this.right=this.orthoCamera.right,this.top=this.orthoCamera.top,this.bottom=this.orthoCamera.bottom,this.far=this.orthoCamera.far,this.view=this.orthoCamera.view,this.aspect=this.perspCamera.aspect,this.focus=this.perspCamera.focus,this.filmGauge=this.perspCamera.filmGauge,this.filmOffset=this.perspCamera.filmOffset,this.objectHelper.update()}static withoutProjectionTransition(e){let t=E.projectionTransitionsEnabled;E.projectionTransitionsEnabled=!1;try{return e()}finally{E.projectionTransitionsEnabled=t}}get isPerspectiveCamera(){return"PerspectiveCamera"===this.cameraType}get isOrthographicCamera(){return!this.isPerspectiveCamera}get cameraType(){return this._cameraType}set fov(e){this.perspCamera.fov=e}get fov(){return this.perspCamera.fov}setNear(e,t){"PerspectiveCamera"===e?this.perspCamera.near=t:this.orthoCamera.near=t}setZoom(e,t){t>=0&&("PerspectiveCamera"===e?this.perspCamera.zoom=t:this.orthoCamera.zoom=t)}set cameraType(e){"PerspectiveCamera"===e?this.toPerspective():"OrthographicCamera"===e&&this.toOrthographic()}get near(){return"PerspectiveCamera"===this._cameraType?this.perspCamera.near:this.orthoCamera.near}set near(e){"PerspectiveCamera"===this._cameraType?this.perspCamera.near=e:this.orthoCamera.near=e}get zoom(){return"PerspectiveCamera"===this._cameraType?this.perspCamera.zoom:this.orthoCamera.zoom}set zoom(e){e>=0&&("PerspectiveCamera"===this._cameraType?this.perspCamera.zoom=e:this.orthoCamera.zoom=e)}lookAt(e,t,r){"number"==typeof e&&(e=new T(e,t,r)),super.lookAt(e),this.getWorldPosition(I),this.targetOffset=I.distanceTo(e)}getTarget(e=new T){return this.getWorldDirection(L),this.getWorldPosition(I),L.multiplyScalar(this.targetOffset),e.copy(I).add(L),e}getDistanceToTarget(){let e=this.getTarget();return this.getWorldPosition(I),I.distanceTo(e)}updateUp(){this.getWorldQuaternion(H),k.set(0,0,1).applyQuaternion(H),R.copy(w.DEFAULT_UP),this.isUpVectorFlipped&&R.negate(),R.applyQuaternion(H),q.copy(w.DEFAULT_UP).projectOnPlane(k),this.angleOffsetFromUp=q.angleTo(R),this.angleOffsetFromUp*=q.cross(R).dot(k)>=0?1:-1}updateTransformState(e,t){let r=super.updateTransformState(e,t);return void 0!==e.isUpVectorFlipped&&(this.isUpVectorFlipped=e.isUpVectorFlipped),this.updateUp(),r}getViewFrontToObject(e){let t=e.getWorldPosition(new T),r=e.getWorldDirection(new T).multiplyScalar(this.targetOffset);return{position:t.clone().add(r),target:t}}getViewToTarget(e){let t=this.getWorldDirection(new T).multiplyScalar(this.targetOffset);return{position:e.clone().sub(t),target:e}}getViewToObject(e){let t=new T;return e.getWorldPosition(t),this.getViewToTarget(t)}setViewplaneSize(e,t,r=!1){if(this.aspect=e/t,r){let r=e>t?this.aspect:1,i=e>t?1:this.aspect;this.left=-395*r,this.right=395*r,this.top=1/i*395,this.bottom=1/i*-395}else this.left=.5*-e,this.right=.5*e,this.top=.5*t,this.bottom=.5*-t;this.updateProjectionMatrix()}copyViewPlaneSize(e){this.aspect=e.aspect,this.left=e.left,this.right=e.right,this.top=e.top,this.bottom=e.bottom,this.updateProjectionMatrix()}toOrthographic(){this.orthoCamera.left=this.left,this.orthoCamera.right=this.right,this.orthoCamera.top=this.top,this.orthoCamera.bottom=this.bottom,this.orthoCamera.view=this.view,this.orthoCamera.far=this.far,this.orthoCamera.updateProjectionMatrix(),this.projectionMatrix=this.orthoCamera.projectionMatrix,this.projectionMatrixInverse=this.orthoCamera.projectionMatrixInverse,this._cameraType="OrthographicCamera",this._applyProjectionTransition(),this.objectHelper&&this.objectHelper.update()}toPerspective(){this.perspCamera.aspect=this.aspect,this.perspCamera.fov=this.fov,this.perspCamera.view=this.view,this.perspCamera.far=this.far,this.perspCamera.updateProjectionMatrix(),this.projectionMatrix=this.perspCamera.projectionMatrix,this.projectionMatrixInverse=this.perspCamera.projectionMatrixInverse,this._cameraType="PerspectiveCamera",this._applyProjectionTransition(),this.objectHelper&&this.objectHelper.update()}get isProjectionTransitioning(){return void 0!==this._projectionTransition}get projectionTransitionProgress(){let e=this._projectionTransition;if(void 0===e)return 1;let t=(performance.now()-e.start)/e.duration;return t>=1?1:t<=0?0:B(t)}get _activeSubCamera(){return"PerspectiveCamera"===this._cameraType?this.perspCamera:this.orthoCamera}_canAnimateProjection(){return E.projectionTransitionsEnabled&&"function"==typeof requestAnimationFrame&&typeof performance<"u"&&performance.now()-this._createdAt>=E.projectionTransitionMinAgeMs}_beginProjectionTransition(e){let t=this._projectionTransition;void 0===t&&(t={from:new j,blend:new j,blendInverse:new j,start:0,duration:E.projectionTransitionDuration,referenceDepth:1,raf:0,requestRender:e},this._projectionTransition=t),t.from.copy(this.projectionMatrix),t.start=performance.now(),t.duration=E.projectionTransitionDuration,t.referenceDepth=Number.isFinite(this.targetOffset)?Math.max(1,this.targetOffset):1,e&&(t.requestRender=e),0!==t.raf&&cancelAnimationFrame(t.raf),t.raf=requestAnimationFrame(this._tickProjectionTransition)}_applyProjectionTransition(){let e=this._projectionTransition;if(void 0===e)return;let t=(performance.now()-e.start)/e.duration;if(t>=1)return void this._endProjectionTransition();let r=B(t),i=e.from.elements,s=this._activeSubCamera.projectionMatrix.elements,o=e.blend.elements,a=e.referenceDepth,n=Math.max(1e-6,i[15]-i[11]*a),h=r*n/(r*n+(1-r)*Math.max(1e-6,s[15]-s[11]*a));for(let e=0;e<16;e++)o[e]=i[e]+(s[e]-i[e])*h;e.blendInverse.copy(e.blend).invert(),this.projectionMatrix=e.blend,this.projectionMatrixInverse=e.blendInverse}_endProjectionTransition(){let e=this._projectionTransition;if(void 0===e)return;0!==e.raf&&cancelAnimationFrame(e.raf),this._projectionTransition=void 0;let t=this._activeSubCamera;this.projectionMatrix=t.projectionMatrix,this.projectionMatrixInverse=t.projectionMatrixInverse}_syncProjectionTransition(e){let t=e._projectionTransition;if(void 0===t)return void(void 0!==this._projectionTransition&&this._endProjectionTransition());let r=this._projectionTransition;void 0===r?(r={from:new j,blend:new j,blendInverse:new j,start:0,duration:1,referenceDepth:1,raf:0,requestRender:void 0},this._projectionTransition=r):0!==r.raf&&(cancelAnimationFrame(r.raf),r.raf=0),r.requestRender=void 0,r.from.copy(t.from),r.start=t.start,r.duration=t.duration,r.referenceDepth=t.referenceDepth,this._applyProjectionTransition()}setFocalLength(e){this.perspCamera.setFocalLength(e),this.toPerspective()}getFocalLength(){return this.perspCamera.getFocalLength()}getEffectiveFOV(){return this.perspCamera.getEffectiveFOV()}getFilmWidth(){return this.perspCamera.getFilmWidth()}getFilmHeight(){return this.perspCamera.getFilmHeight()}setViewOffset(e,t,r,i,s,o){"PerspectiveCamera"===this._cameraType?this.perspCamera.setViewOffset(e,t,r,i,s,o):this.orthoCamera.setViewOffset(e,t,r,i,s,o),this._applyProjectionTransition()}clearViewOffset(){"PerspectiveCamera"===this._cameraType?(this.perspCamera.clearViewOffset(),this.toPerspective()):(this.orthoCamera.clearViewOffset(),this.toOrthographic())}copyHistory(){this.previousProjectionMatrix&&this.previousProjectionMatrix.copy(this.projectionMatrix)}updateProjectionMatrix(){"PerspectiveCamera"===this._cameraType?this.toPerspective():"OrthographicCamera"===this._cameraType&&this.toOrthographic()}updateMatrixWorld(e){super.updateMatrixWorld(e),this.matrixWorldInverse.copy(this.matrixWorld).invert()}updateWorldMatrix(e,t){super.updateWorldMatrix(e,t),this.matrixWorldInverse.copy(this.matrixWorld).invert()}copy(e,t){return super.copy(e,t),this.parent=e.parent,this.orthoCamera.copy(e.orthoCamera),this.perspCamera.copy(e.perspCamera),this.left=e.left,this.right=e.right,this.top=e.top,this.bottom=e.bottom,this.far=e.far,this.view=null===e.view?null:Object.assign({},e.view),this._cameraType=e._cameraType,this.aspect=e.aspect,this.fov=e.fov,this.focus=e.focus,this.filmGauge=e.filmGauge,this.filmOffset=e.filmOffset,this.targetOffset=v.sanitizeTargetOffset(e.targetOffset),this.updateProjectionMatrix(),this._syncProjectionTransition(e),this}toCameraState(e=[]){let t={type:this.cameraType,far:this.far,orthographic:{near:this.orthoCamera.near,zoom:this.orthoCamera.zoom},perspective:{near:this.perspCamera.near,fov:this.perspCamera.fov,zoom:this.perspCamera.zoom},up:this.up.toArray(),targetOffset:this.targetOffset,isUpVectorFlipped:this.isUpVectorFlipped};return f(t,e)}updateCameraSubtype(e,t){let r="perspective"===e?"PerspectiveCamera":"OrthographicCamera";void 0!==t.zoom&&this.setZoom(r,t.zoom),void 0!==t.near&&this.setNear(r,t.near),void 0!==t.fov&&"PerspectiveCamera"===r&&(this.fov=t.fov)}updateState(e,t){this.updateCameraState(e,t)}updateCameraState(e,t){this.updateState_Entity(e,t),void 0!==e.far&&(this.far=e.far),void 0!==e.orthographic&&this.updateCameraSubtype("orthographic",e.orthographic),void 0!==e.perspective&&this.updateCameraSubtype("perspective",e.perspective),void 0!==e.type&&(e.type!==this._cameraType&&this._canAnimateProjection()&&this._beginProjectionTransition(t?.shared.requestRender),this.cameraType=e.type),void 0!==e.up&&this.up.fromArray(e.up.map(e=>"number"==typeof e?e:0)),void 0!==e.targetOffset&&(this.targetOffset=v.sanitizeTargetOffset(e.targetOffset)),void 0!==e.isUpVectorFlipped&&(this.isUpVectorFlipped=e.isUpVectorFlipped),this.updateProjectionMatrix()}updateByPatchedOp(e,t,r){super.updateByPatchedOp(e,t,r),1===e.path.length&&0===e.type&&this.updateCameraSubtype(e.path[0],e.props)}toState(e){return{...super.toState(e),...this.toCameraState(e),type:this.cameraType}}},G=E;G.projectionTransitionsEnabled=!1,G.projectionTransitionDuration=350,G.projectionTransitionMinAgeMs=1e3;var Z=new j,K=new j,N=new j,Q=new j,Y=new j;function J(e){let t=!1;return e.scene.objects.traverse((e,r)=>{"BooleanGeometry"===r.geometry?.type&&(t=!0)}),t}function X(e,t){let r=e.cloner;return void 0!==r&&r.parent===t?r:void 0}var $=new Float32Array(0);function ee(e,t,r,i){let s=16*(t.children.length+1);$.length<s&&($=new Float32Array(s));let o=0,a=e=>{e.toArray($,16*o),o++},n=!0!==t.parameters.hideBase;n&&a(i),N.copy(e.matrix);for(let e of t.children)!g(e)||!1===e.playModeVisible||(Q.copy(e.matrix).multiply(e.pivotMatrix),Y.multiplyMatrices(N,Q),(!n||!Y.equals(i))&&a(Y));try{return 0===o?0:l(r,$.subarray(0,16*o))}finally{d(r)}}var te=class extends a{constructor(e,t,r){super(e,t),this.data=t,this.meshSetAddresses=[],this.needsTransformForDownstream=!1,this.geometry=new x,this.onAfterRender=(e,t,r,i,s,o)=>{super.onAfterRender(e,t,r,i,s,o),this.recomputeBoolean()},this.geometry.userData.parameters={width:0,height:0,depth:0}}get booleanOp(){return this.data.geometry.operation}get phongAngle(){return this.data.geometry.phongAngle??45}get isLOD(){return this.recomputeBoolean(),!1}updateByPatchedOp(e,t,r){super.updateByPatchedOp(e,t,r),1===e.path.length&&"geometry"===e.path[0]&&0===e.type&&void 0!==e.props.operation&&(this.freeBooleanPointer(),this.resetBBoxNeedsUpdate())}freeBooleanPointer(){super.freeBooleanPointer(),this.geometry.dispose()}recomputeBoolean(r,i=!0){if(-1!==this.booleanMeshSetAddress&&!r)return;for(let e=0;e<this.children.length;e++){let t=this.children[e];t instanceof te&&!0===t.dataPatched.visible&&t.recomputeBoolean(!0===r,i)}this.meshSetAddresses=[];for(let e=0;e<this.children.length;e++){let t=this.children[e];if(t instanceof u&&!0===t.dataPatched.visible&&t.geometry.attributes.position?.count>0&&t.geometry.drawRange.count>0&&0!==t.booleanMeshSetAddress){Z.copy(t.matrix).multiply(t.pivotMatrix);try{let e=X(t,this);if(-1===t.booleanMeshSetAddress){if((t.geometry.index??t.geometry.getAttribute("position")).count/3<15e5){let s=h(t.geometry,!0===r,i);t.booleanMeshSetAddress=void 0===e||-1===s?s:ee(t,e,s,Z)}if(-1===t.booleanMeshSetAddress)return;void 0===e&&m(t.booleanMeshSetAddress,Z),t.booleanMatrixInvOld.copy(Z).invert(),t.booleanWasTransformed=!1}else t instanceof te&&!0===t.needsTransformForDownstream?(void 0===e?m(t.booleanMeshSetAddress,Z):t.booleanMeshSetAddress=ee(t,e,t.booleanMeshSetAddress,Z),t.needsTransformForDownstream=!1):!0===t.booleanWasTransformed&&(m(t.booleanMeshSetAddress,K.multiplyMatrices(Z,t.booleanMatrixInvOld)),t.booleanMatrixInvOld.copy(Z).invert(),t.booleanWasTransformed=!1)}catch(e){console.error(e),t.booleanMeshSetAddress=0,t.geometry.userData.booleanOperationDidFail=!0;continue}if(0===t.booleanMeshSetAddress)continue;this.meshSetAddresses.push(t.booleanMeshSetAddress),t.geometry.userData.booleanOperationDidFail=!1}}if(0===this.meshSetAddresses.length){if(0!==this.geometry.getAttribute("position")?.array.length){let e=this.geometry;e.dispose(),this.geometry=new x,this.geometry.userData=e.userData,this.geometry.boundingSphere=e.boundingSphere,this.geometry.setAttribute("position",new M([],3))}return void this.geometry.setDrawRange(0,0)}if(!0===r)return c(this.meshSetAddresses,this.booleanOp);let s=this.geometry;s.dispose(),this.geometry=new x,this.geometry.userData=s.userData,this.geometry.boundingSphere=s.boundingSphere;try{this.booleanMeshSetAddress=p(this.meshSetAddresses,this.booleanOp,this.geometry,this.phongAngle)}catch(e){this.booleanMeshSetAddress=0,this.geometry.userData.booleanOperationDidFail=!0,console.error(e)}this.booleanMatrixInvOld.copy(this.matrix).invert(),this.needsTransformForDownstream=!0,e(this),t(this)}dispose(){super.dispose(),this.geometry.dispose()}},re=new WeakSet;function ie(e){return e.isPointLight?1:(e.isSpotLight,3)}function se(e){return e.isDirectionalLight?0:e.isSpotLight?1:2}var oe,ae=[];function ne(e){ae.length=0,e.traverseVisible(e=>{(function(e){let t=e;return!0===t.isPointLight||!0===t.isSpotLight||!0===t.isDirectionalLight})(e)&&(!0===e.castShadow||re.has(e))&&ae.push(e)});let t=!1;if(0===ae.length)return t;ae.sort((e,t)=>se(e)-se(t)||e.id-t.id);let r=12;for(let e of ae){let i=ie(e);i<=r?(r-=i,re.delete(e)&&(e.castShadow=!0,t=!0)):!0===e.castShadow&&(e.castShadow=!1,re.add(e))}return ae.length=0,t}(oe||(oe={})).is=function(e){return n.is(e)&&e instanceof A};var he=(e,t)=>class extends(o(e,t)){updateState_Light(e,t){if(this.updateState_Entity(e,t),void 0!==e.color&&(this.color=t.shared.color(e.color)),void 0!==e.intensity&&(this.intensity=e.intensity*Math.PI),void 0!==e.depth){let t=this.shadow;t.camera.far=e.depth,t.needsUpdate=!0}void 0!==e.shadows&&(function(e){re.delete(e)}(this),this.castShadow=e.shadows)}},pe=e=>e instanceof u,ce=e=>null!==e&&e instanceof te,me=e=>s.is(e);export{G as a,J as b,te as c,ne as d,oe as e,he as f,pe as g,ce as h,me as i};
|
|
1
|
+
import{a as e,b as t}from"./runtime-chunk-APKU3YYA.js";import{a as r,b as i,c as s,d as o}from"./runtime-chunk-FX42TWCV.js";import{na as a}from"./runtime-chunk-ARNZDNZ5.js";import{h as n,o as h,p,q as c,r as m,s as d,t as l,v as u}from"./runtime-chunk-CAU75OZB.js";import{f}from"./runtime-chunk-RTLL6WIB.js";import{i as g}from"./runtime-chunk-2PT2WH66.js";import{Aa as y,K as v}from"./runtime-chunk-ADHKZQMB.js";import{Ce as C,Gc as b,Hc as T,Qc as j,Tc as w,Vc as P,dd as M,fd as x,wd as A,we as O,yd as S,ye as _,ze as F}from"./runtime-chunk-KPOUV3HD.js";var D=new T,W=new _,V=class extends S{constructor(e){let t=new x,r=new A({color:16777215,vertexColors:!0,toneMapped:!1}),i=[],s=[],o={},a=new P(15711266),n=new P(15711266),h=new P(2857471);function p(e,t,r){c(e,r),c(t,r)}function c(e,t){i.push(0,0,0),s.push(t.r,t.g,t.b),void 0===o[e]&&(o[e]=[]),o[e].push(i.length/3-1)}p("n1","n2",a),p("n2","n4",a),p("n4","n3",a),p("n3","n1",a),p("f1","f2",a),p("f2","f4",a),p("f4","f3",a),p("f3","f1",a),p("n1","f1",a),p("n2","f2",a),p("n3","f3",a),p("n4","f4",a),p("p","n1",n),p("p","n2",n),p("p","n3",n),p("p","n4",n),p("u1","u2",h),p("u2","u3",h),p("u3","u1",h),t.setAttribute("position",new M(i,3)),t.setAttribute("color",new M(s,3)),super(t,r),this.type="CameraHelper",this.camera=e,this.camera.updateProjectionMatrix&&this.camera.updateProjectionMatrix(),this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.pointMap=o,this.update()}update(){let e=this.geometry,t=this.pointMap;W.projectionMatrixInverse.elements=[.5112609807824982,-0,-0,-0,-0,.41421356237309503,-0,-0,-0,-0,-0,-.099999,-0,-0,-1.0000000000000002,.100001];let r=.8;U("n1",t,e,W,-1,-1,r),U("n2",t,e,W,1,-1,r),U("n3",t,e,W,-1,1,r),U("n4",t,e,W,1,1,r);let i=r;U("f1",t,e,W,-1,-1,i),U("f2",t,e,W,1,-1,i),U("f3",t,e,W,-1,1,i),U("f4",t,e,W,1,1,i);let s=i;U("u1",t,e,W,.35,1.1,s),U("u2",t,e,W,-.35,1.1,s),U("u3",t,e,W,0,1.55,s),e.getAttribute("position").needsUpdate=!0}dispose(){this.geometry.dispose(),this.material.dispose()}};function U(e,t,r,i,s,o,a){D.set(s,o,a).unproject(i);let n=t[e];if(void 0!==n){let e=r.getAttribute("position");for(let t=0,r=n.length;t<r;t++)e.setXYZ(n[t],D.x,D.y,D.z)}}var z=class extends(r(V)){constructor(e){super(e),this.object=e,this.name=`CombinedCameraHelper: ${e.uuid}`}updateMatrixWorld(e){super.updateMatrixWorld(e),this.updateTarget()}updateTarget(){let e=this.object.getTarget();this.updateWorldMatrix(!0,!1),this.worldToLocal(e)}raycast(e,t){i(this.object,this.geometry,e,t,!0)}};function B(e){return 1-Math.pow(1-e,3)}var I=new T,L=new T,H=new b,k=new T,R=new T,q=new T,E=class extends(o(_,z)){constructor(e="",t={...y.defaultData,name:""}){super(),this._cameraType="OrthographicCamera",this.targetOffset=v.DefaultTargetOffset,this.isUpVectorFlipped=!1,this.angleOffsetFromUp=0,this.wasMovedByUser=!1,this.wasMovedBySwitchCameraAction=!1,this._createdAt=typeof performance<"u"?performance.now():0,this._tickProjectionTransition=()=>{let e=this._projectionTransition;if(void 0===e)return;if(this.disposed)return void this._endProjectionTransition();e.raf=requestAnimationFrame(this._tickProjectionTransition);let t=E.projectionTransitionRequestRender??e.requestRender;this.updateProjectionMatrix(),t?.()},this.super_Entity(e,t),this.previousProjectionMatrix=new j,this.matrixAutoUpdate=!0,this.width=window.innerWidth,this.height=window.innerHeight;let r=this.width,i=this.height;this.orthoCamera=new C(-.5*r,.5*r,.5*i,-.5*i,-5e4,1e4),this.perspCamera=new F(45,r/i,50,1e4),this.left=this.orthoCamera.left,this.right=this.orthoCamera.right,this.top=this.orthoCamera.top,this.bottom=this.orthoCamera.bottom,this.far=this.orthoCamera.far,this.view=this.orthoCamera.view,this.aspect=this.perspCamera.aspect,this.focus=this.perspCamera.focus,this.filmGauge=this.perspCamera.filmGauge,this.filmOffset=this.perspCamera.filmOffset,this.objectHelper.update()}static withoutProjectionTransition(e){let t=E.projectionTransitionsEnabled;E.projectionTransitionsEnabled=!1;try{return e()}finally{E.projectionTransitionsEnabled=t}}get isPerspectiveCamera(){return"PerspectiveCamera"===this.cameraType}get isOrthographicCamera(){return!this.isPerspectiveCamera}get cameraType(){return this._cameraType}set fov(e){this.perspCamera.fov=e}get fov(){return this.perspCamera.fov}setNear(e,t){"PerspectiveCamera"===e?this.perspCamera.near=t:this.orthoCamera.near=t}setZoom(e,t){t>=0&&("PerspectiveCamera"===e?this.perspCamera.zoom=t:this.orthoCamera.zoom=t)}set cameraType(e){"PerspectiveCamera"===e?this.toPerspective():"OrthographicCamera"===e&&this.toOrthographic()}get near(){return"PerspectiveCamera"===this._cameraType?this.perspCamera.near:this.orthoCamera.near}set near(e){"PerspectiveCamera"===this._cameraType?this.perspCamera.near=e:this.orthoCamera.near=e}get zoom(){return"PerspectiveCamera"===this._cameraType?this.perspCamera.zoom:this.orthoCamera.zoom}set zoom(e){e>=0&&("PerspectiveCamera"===this._cameraType?this.perspCamera.zoom=e:this.orthoCamera.zoom=e)}lookAt(e,t,r){"number"==typeof e&&(e=new T(e,t,r)),super.lookAt(e),this.getWorldPosition(I),this.targetOffset=I.distanceTo(e)}getTarget(e=new T){return this.getWorldDirection(L),this.getWorldPosition(I),L.multiplyScalar(this.targetOffset),e.copy(I).add(L),e}getDistanceToTarget(){let e=this.getTarget();return this.getWorldPosition(I),I.distanceTo(e)}updateUp(){this.getWorldQuaternion(H),k.set(0,0,1).applyQuaternion(H),R.copy(w.DEFAULT_UP),this.isUpVectorFlipped&&R.negate(),R.applyQuaternion(H),q.copy(w.DEFAULT_UP).projectOnPlane(k),this.angleOffsetFromUp=q.angleTo(R),this.angleOffsetFromUp*=q.cross(R).dot(k)>=0?1:-1}updateTransformState(e,t){let r=super.updateTransformState(e,t);return void 0!==e.isUpVectorFlipped&&(this.isUpVectorFlipped=e.isUpVectorFlipped),this.updateUp(),r}getViewFrontToObject(e){let t=e.getWorldPosition(new T),r=e.getWorldDirection(new T).multiplyScalar(this.targetOffset);return{position:t.clone().add(r),target:t}}getViewToTarget(e){let t=this.getWorldDirection(new T).multiplyScalar(this.targetOffset);return{position:e.clone().sub(t),target:e}}getViewToObject(e){let t=new T;return e.getWorldPosition(t),this.getViewToTarget(t)}setViewplaneSize(e,t,r=!1){if(this.aspect=e/t,r){let r=e>t?this.aspect:1,i=e>t?1:this.aspect;this.left=-395*r,this.right=395*r,this.top=1/i*395,this.bottom=1/i*-395}else this.left=.5*-e,this.right=.5*e,this.top=.5*t,this.bottom=.5*-t;this.updateProjectionMatrix()}copyViewPlaneSize(e){this.aspect=e.aspect,this.left=e.left,this.right=e.right,this.top=e.top,this.bottom=e.bottom,this.updateProjectionMatrix()}toOrthographic(){this.orthoCamera.left=this.left,this.orthoCamera.right=this.right,this.orthoCamera.top=this.top,this.orthoCamera.bottom=this.bottom,this.orthoCamera.view=this.view,this.orthoCamera.far=this.far,this.orthoCamera.updateProjectionMatrix(),this.projectionMatrix=this.orthoCamera.projectionMatrix,this.projectionMatrixInverse=this.orthoCamera.projectionMatrixInverse,this._cameraType="OrthographicCamera",this._applyProjectionTransition(),this.objectHelper&&this.objectHelper.update()}toPerspective(){this.perspCamera.aspect=this.aspect,this.perspCamera.fov=this.fov,this.perspCamera.view=this.view,this.perspCamera.far=this.far,this.perspCamera.updateProjectionMatrix(),this.projectionMatrix=this.perspCamera.projectionMatrix,this.projectionMatrixInverse=this.perspCamera.projectionMatrixInverse,this._cameraType="PerspectiveCamera",this._applyProjectionTransition(),this.objectHelper&&this.objectHelper.update()}get isProjectionTransitioning(){return void 0!==this._projectionTransition}get projectionTransitionProgress(){let e=this._projectionTransition;if(void 0===e)return 1;let t=(performance.now()-e.start)/e.duration;return t>=1?1:t<=0?0:B(t)}get _activeSubCamera(){return"PerspectiveCamera"===this._cameraType?this.perspCamera:this.orthoCamera}_canAnimateProjection(){return E.projectionTransitionsEnabled&&"function"==typeof requestAnimationFrame&&typeof performance<"u"&&performance.now()-this._createdAt>=E.projectionTransitionMinAgeMs}_beginProjectionTransition(e){let t=this._projectionTransition;void 0===t&&(t={from:new j,blend:new j,blendInverse:new j,start:0,duration:E.projectionTransitionDuration,referenceDepth:1,raf:0,requestRender:e},this._projectionTransition=t),t.from.copy(this.projectionMatrix),t.start=performance.now(),t.duration=E.projectionTransitionDuration,t.referenceDepth=Number.isFinite(this.targetOffset)?Math.max(1,this.targetOffset):1,e&&(t.requestRender=e),0!==t.raf&&cancelAnimationFrame(t.raf),t.raf=requestAnimationFrame(this._tickProjectionTransition)}_applyProjectionTransition(){let e=this._projectionTransition;if(void 0===e)return;let t=(performance.now()-e.start)/e.duration;if(t>=1)return void this._endProjectionTransition();let r=B(t),i=e.from.elements,s=this._activeSubCamera.projectionMatrix.elements,o=e.blend.elements,a=e.referenceDepth,n=Math.max(1e-6,i[15]-i[11]*a),h=r*n/(r*n+(1-r)*Math.max(1e-6,s[15]-s[11]*a));for(let e=0;e<16;e++)o[e]=i[e]+(s[e]-i[e])*h;e.blendInverse.copy(e.blend).invert(),this.projectionMatrix=e.blend,this.projectionMatrixInverse=e.blendInverse}_endProjectionTransition(){let e=this._projectionTransition;if(void 0===e)return;0!==e.raf&&cancelAnimationFrame(e.raf),this._projectionTransition=void 0;let t=this._activeSubCamera;this.projectionMatrix=t.projectionMatrix,this.projectionMatrixInverse=t.projectionMatrixInverse}_syncProjectionTransition(e){let t=e._projectionTransition;if(void 0===t)return void(void 0!==this._projectionTransition&&this._endProjectionTransition());let r=this._projectionTransition;void 0===r?(r={from:new j,blend:new j,blendInverse:new j,start:0,duration:1,referenceDepth:1,raf:0,requestRender:void 0},this._projectionTransition=r):0!==r.raf&&(cancelAnimationFrame(r.raf),r.raf=0),r.requestRender=void 0,r.from.copy(t.from),r.start=t.start,r.duration=t.duration,r.referenceDepth=t.referenceDepth,this._applyProjectionTransition()}setFocalLength(e){this.perspCamera.setFocalLength(e),this.toPerspective()}getFocalLength(){return this.perspCamera.getFocalLength()}getEffectiveFOV(){return this.perspCamera.getEffectiveFOV()}getFilmWidth(){return this.perspCamera.getFilmWidth()}getFilmHeight(){return this.perspCamera.getFilmHeight()}setViewOffset(e,t,r,i,s,o){"PerspectiveCamera"===this._cameraType?this.perspCamera.setViewOffset(e,t,r,i,s,o):this.orthoCamera.setViewOffset(e,t,r,i,s,o),this._applyProjectionTransition()}clearViewOffset(){"PerspectiveCamera"===this._cameraType?(this.perspCamera.clearViewOffset(),this.toPerspective()):(this.orthoCamera.clearViewOffset(),this.toOrthographic())}copyHistory(){this.previousProjectionMatrix&&this.previousProjectionMatrix.copy(this.projectionMatrix)}updateProjectionMatrix(){"PerspectiveCamera"===this._cameraType?this.toPerspective():"OrthographicCamera"===this._cameraType&&this.toOrthographic()}updateMatrixWorld(e){super.updateMatrixWorld(e),this.matrixWorldInverse.copy(this.matrixWorld).invert()}updateWorldMatrix(e,t){super.updateWorldMatrix(e,t),this.matrixWorldInverse.copy(this.matrixWorld).invert()}copy(e,t){return super.copy(e,t),this.parent=e.parent,this.orthoCamera.copy(e.orthoCamera),this.perspCamera.copy(e.perspCamera),this.left=e.left,this.right=e.right,this.top=e.top,this.bottom=e.bottom,this.far=e.far,this.view=null===e.view?null:Object.assign({},e.view),this._cameraType=e._cameraType,this.aspect=e.aspect,this.fov=e.fov,this.focus=e.focus,this.filmGauge=e.filmGauge,this.filmOffset=e.filmOffset,this.targetOffset=v.sanitizeTargetOffset(e.targetOffset),this.updateProjectionMatrix(),this._syncProjectionTransition(e),this}toCameraState(e=[]){let t={type:this.cameraType,far:this.far,orthographic:{near:this.orthoCamera.near,zoom:this.orthoCamera.zoom},perspective:{near:this.perspCamera.near,fov:this.perspCamera.fov,zoom:this.perspCamera.zoom},up:this.up.toArray(),targetOffset:this.targetOffset,isUpVectorFlipped:this.isUpVectorFlipped};return f(t,e)}updateCameraSubtype(e,t){let r="perspective"===e?"PerspectiveCamera":"OrthographicCamera";void 0!==t.zoom&&this.setZoom(r,t.zoom),void 0!==t.near&&this.setNear(r,t.near),void 0!==t.fov&&"PerspectiveCamera"===r&&(this.fov=t.fov)}updateState(e,t){this.updateCameraState(e,t)}updateCameraState(e,t){this.updateState_Entity(e,t),void 0!==e.far&&(this.far=e.far),void 0!==e.orthographic&&this.updateCameraSubtype("orthographic",e.orthographic),void 0!==e.perspective&&this.updateCameraSubtype("perspective",e.perspective),void 0!==e.type&&(e.type!==this._cameraType&&this._canAnimateProjection()&&this._beginProjectionTransition(t?.shared.requestRender),this.cameraType=e.type),void 0!==e.up&&this.up.fromArray(e.up.map(e=>"number"==typeof e?e:0)),void 0!==e.targetOffset&&(this.targetOffset=v.sanitizeTargetOffset(e.targetOffset)),void 0!==e.isUpVectorFlipped&&(this.isUpVectorFlipped=e.isUpVectorFlipped),this.updateProjectionMatrix()}updateByPatchedOp(e,t,r){super.updateByPatchedOp(e,t,r),1===e.path.length&&0===e.type&&this.updateCameraSubtype(e.path[0],e.props)}toState(e){return{...super.toState(e),...this.toCameraState(e),type:this.cameraType}}},Z=E;Z.projectionTransitionsEnabled=!1,Z.projectionTransitionDuration=350,Z.projectionTransitionMinAgeMs=1e3;var G=new j,N=new j,Q=new j,K=new j,Y=new j;function X(e){let t=!1;return e.scene.objects.traverse((e,r)=>{"BooleanGeometry"===r.geometry?.type&&(t=!0)}),t}function $(e,t){let r=e.cloner;return void 0!==r&&r.parent===t?r:void 0}var J=new Float32Array(0);function ee(e,t,r,i){let s=16*(t.children.length+1);J.length<s&&(J=new Float32Array(s));let o=0,a=e=>{e.toArray(J,16*o),o++},n=!0!==t.parameters.hideBase;n&&a(i),Q.copy(e.matrix);for(let e of t.children)!g(e)||!1===e.playModeVisible||(K.copy(e.matrix).multiply(e.pivotMatrix),Y.multiplyMatrices(Q,K),(!n||!Y.equals(i))&&a(Y));try{return 0===o?0:l(r,J.subarray(0,16*o))}finally{d(r)}}var te=class extends a{constructor(e,t,r){super(e,t),this.data=t,this.meshSetAddresses=[],this.needsTransformForDownstream=!1,this.geometry=new x,this.onAfterRender=(e,t,r,i,s,o)=>{super.onAfterRender(e,t,r,i,s,o),this.recomputeBoolean()},this.geometry.userData.parameters={width:0,height:0,depth:0}}get booleanOp(){return this.data.geometry.operation}get phongAngle(){return this.data.geometry.phongAngle??45}get isLOD(){return this.recomputeBoolean(),!1}updateByPatchedOp(e,t,r){super.updateByPatchedOp(e,t,r),1===e.path.length&&"geometry"===e.path[0]&&0===e.type&&void 0!==e.props.operation&&(this.freeBooleanPointer(),this.resetBBoxNeedsUpdate())}freeBooleanPointer(){super.freeBooleanPointer(),this.geometry.dispose()}recomputeBoolean(r,i=!0){if(-1!==this.booleanMeshSetAddress&&!r)return;for(let e=0;e<this.children.length;e++){let t=this.children[e];t instanceof te&&!0===t.dataPatched.visible&&t.recomputeBoolean(!0===r,i)}this.meshSetAddresses=[];for(let e=0;e<this.children.length;e++){let t=this.children[e];if(t instanceof u&&!0===t.dataPatched.visible&&t.geometry.attributes.position?.count>0&&t.geometry.drawRange.count>0&&0!==t.booleanMeshSetAddress){G.copy(t.matrix).multiply(t.pivotMatrix);try{let e=$(t,this);if(-1===t.booleanMeshSetAddress){if((t.geometry.index??t.geometry.getAttribute("position")).count/3<15e5){let s=h(t.geometry,!0===r,i);t.booleanMeshSetAddress=void 0===e||-1===s?s:ee(t,e,s,G)}if(-1===t.booleanMeshSetAddress)return;void 0===e&&m(t.booleanMeshSetAddress,G),t.booleanMatrixInvOld.copy(G).invert(),t.booleanWasTransformed=!1}else t instanceof te&&!0===t.needsTransformForDownstream?(void 0===e?m(t.booleanMeshSetAddress,G):t.booleanMeshSetAddress=ee(t,e,t.booleanMeshSetAddress,G),t.needsTransformForDownstream=!1):!0===t.booleanWasTransformed&&(m(t.booleanMeshSetAddress,N.multiplyMatrices(G,t.booleanMatrixInvOld)),t.booleanMatrixInvOld.copy(G).invert(),t.booleanWasTransformed=!1)}catch(e){console.error(e),t.booleanMeshSetAddress=0,t.geometry.userData.booleanOperationDidFail=!0;continue}if(0===t.booleanMeshSetAddress)continue;this.meshSetAddresses.push(t.booleanMeshSetAddress),t.geometry.userData.booleanOperationDidFail=!1}}if(0===this.meshSetAddresses.length){if(0!==this.geometry.getAttribute("position")?.array.length){let e=this.geometry;e.dispose(),this.geometry=new x,this.geometry.userData=e.userData,this.geometry.boundingSphere=e.boundingSphere,this.geometry.setAttribute("position",new M([],3))}return void this.geometry.setDrawRange(0,0)}if(!0===r)return c(this.meshSetAddresses,this.booleanOp);let s=this.geometry;s.dispose(),this.geometry=new x,this.geometry.userData=s.userData,this.geometry.boundingSphere=s.boundingSphere;try{this.booleanMeshSetAddress=p(this.meshSetAddresses,this.booleanOp,this.geometry,this.phongAngle)}catch(e){this.booleanMeshSetAddress=0,this.geometry.userData.booleanOperationDidFail=!0,console.error(e)}this.booleanMatrixInvOld.copy(this.matrix).invert(),this.needsTransformForDownstream=!0,e(this),t(this)}dispose(){super.dispose(),this.geometry.dispose()}},re=new WeakSet;function ie(e){return e.isPointLight?1:(e.isSpotLight,3)}function se(e){return e.isDirectionalLight?0:e.isSpotLight?1:2}var oe,ae=[];function ne(e){ae.length=0,e.traverseVisible(e=>{(function(e){let t=e;return!0===t.isPointLight||!0===t.isSpotLight||!0===t.isDirectionalLight})(e)&&(!0===e.castShadow||re.has(e))&&ae.push(e)});let t=!1;if(0===ae.length)return t;ae.sort((e,t)=>se(e)-se(t)||e.id-t.id);let r=12;for(let e of ae){let i=ie(e);i<=r?(r-=i,re.delete(e)&&(e.castShadow=!0,t=!0)):!0===e.castShadow&&(e.castShadow=!1,re.add(e))}return ae.length=0,t}(oe||(oe={})).is=function(e){return n.is(e)&&e instanceof O};var he=(e,t)=>class extends(o(e,t)){updateState_Light(e,t){if(this.updateState_Entity(e,t),void 0!==e.color&&(this.color=t.shared.color(e.color)),void 0!==e.intensity&&(this.intensity=e.intensity*Math.PI),void 0!==e.depth){let t=this.shadow;t.camera.far=e.depth,t.needsUpdate=!0}void 0!==e.shadows&&(function(e){re.delete(e)}(this),this.castShadow=e.shadows)}},pe=e=>e instanceof u,ce=e=>null!==e&&e instanceof te,me=e=>s.is(e);export{Z as a,X as b,te as c,ne as d,oe as e,he as f,pe as g,ce as h,me as i};
|
|
Binary file
|
|
Binary file
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as e}from"./runtime-chunk-
|
|
1
|
+
import{a as e}from"./runtime-chunk-KEVKWE7V.js";import{oa as t}from"./runtime-chunk-ARNZDNZ5.js";import{h as a}from"./runtime-chunk-CAU75OZB.js";import{c as s,e as o,f as r}from"./runtime-chunk-2PT2WH66.js";import{b as i}from"./runtime-chunk-MOPA2GCL.js";import{Fa as n,w as d}from"./runtime-chunk-ADHKZQMB.js";import{Hc as c}from"./runtime-chunk-KPOUV3HD.js";var l=new c;function u(e,t,s=!1){let o=[],c=a=>{let s=a.data;delete a.states,a.currentState=null,a.reversibleToState=null,a.currentTransitionEvent=null;for(let e of s.states){let t={...e.data};a.states||(a.states={}),a.states[e.id]=i.patch(s,t)}p(e.scene,a,null,t,void 0!==s.events.find(e=>"Follow"===e.data.type||"LookAt"===e.data.type)),f(e)};e.scene.traverse2D(c),e.traverseChildren(i=>{if(s&&(i.rigidBody?.setTranslation(i.position0,!0),i.rigidBody?.setRotation(i.rotation0,!0),i.rigidBody?.setLinvel(l,!0),i.rigidBody?.setAngvel(l,!0)),!a.is(i))return;let u=i.uuid,f=i.data;if(delete i.states,i.uuid===d)return;let m=!1;o.some(t=>e.scene.find(u)?.isDescendantOf(t))?m=!0:!0===f.physics?.fusedBody&&"dynamic"===f.physics.rigidBody&&o.push(u),i.data=f,i.currentState=null,i.reversibleToState=null,i.currentTransitionEvent=null,i.transitionState={settled:!0,state:null};for(let t of f.states){let a={...t.data};!0===e.data.globalPhysics.usePhysics&&f.physics&&("dynamic"===f.physics.rigidBody||m)&&(void 0!==t.data.position&&delete a.position,void 0!==t.data.rotation&&delete a.rotation),i.states||(i.states={}),i.states[t.id]=n.patch(f,a)}p(e.scene,i,null,t,void 0!==f.events.find(e=>"Follow"===e.data.type||"LookAt"===e.data.type)),r(i)&&i.frame&&(i.frame.traverse(e=>c(e)),i.uiCanvas?.applySize())}),f(e),e.frame&&(e.frame.traverse(e=>c(e)),e.uiCanvas?.applySize())}function f(e){e.traverseEntity(t=>{for(let a of t.data.events){let t=[];switch(a.data.type){case"Follow":case"MouseHover":case"Scroll":case"MouseDown":case"MouseUp":case"MousePress":case"KeyUp":case"KeyDown":case"KeyPress":case"Collision":t.push(...a.data.actions);break;case"GameControl":for(let e of Object.values(a.data.gameActions))t.push(...e);break;case"DragDrop":t.push(...a.data.dragDropActions.drag,...a.data.dragDropActions.drop);break;case"Conditional":t.push(...a.data.inActions,...a.data.outActions)}for(let a of t)if("Create"===a.data.type&&"Yes"===a.data.hideBase){let t=e.scene.find(a.data.object);t&&(t.visible=!1)}}})}function p(a,r,i,n,d=!1){if(a.markShadowsDirty(),r instanceof t&&!s(r)&&r.removeInteractionGeometry(n),o(r)?r.changeSelectedState(i,{shared:n},d):r.changeSelectedState(i,{scene:a,shared:n},d),r instanceof t&&r.updateGeometryGroupsIfNeeded(),r instanceof e&&r.updateCameraState(r.dataPatched,{scene:a,shared:n}),!o(r)){if(r.cloner){let e=!1;for(let t of r.cloner.children)t.playModeVisible=void 0,void 0!==t.transformOverride&&(t.transformOverride=void 0,e=!0);e&&a.addPendingUpdateCloner(r),r.cloner.syncInstanceMatrices()}r.updateVisible()}}export{u as a};
|
|
Binary file
|
|
Binary file
|