@splinetool/runtime 2.0.8 → 2.0.10
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/hana-ui.js +122 -42
- package/build/hana-ui.js.br +0 -0
- package/build/hana-ui.js.gz +0 -0
- package/build/hana-ui.wasm +0 -0
- package/build/hana-ui.wasm.br +0 -0
- package/build/hana-ui.wasm.gz +0 -0
- package/build/{runtime-chunk-PDASWDVC.js → runtime-chunk-4LKRNVPP.js} +1 -1
- package/build/{runtime-chunk-PDASWDVC.js.br → runtime-chunk-4LKRNVPP.js.br} +0 -0
- package/build/runtime-chunk-4LKRNVPP.js.gz +0 -0
- package/build/{runtime-chunk-DK66VKWP.js → runtime-chunk-7FDJ7IIR.js} +1 -1
- package/build/runtime-chunk-7FDJ7IIR.js.br +0 -0
- package/build/runtime-chunk-7FDJ7IIR.js.gz +0 -0
- package/build/{runtime-chunk-23QXG35G.js → runtime-chunk-BLFFIB2B.js} +1 -1
- package/build/runtime-chunk-BLFFIB2B.js.br +0 -0
- package/build/runtime-chunk-BLFFIB2B.js.gz +0 -0
- package/build/{runtime-chunk-DHWGP6NU.js → runtime-chunk-CDR3AZNB.js} +1 -1
- package/build/runtime-chunk-CDR3AZNB.js.br +0 -0
- package/build/runtime-chunk-CDR3AZNB.js.gz +0 -0
- package/build/{runtime-chunk-HZ6FL5GH.js → runtime-chunk-CDYE22J6.js} +1 -1
- package/build/runtime-chunk-CDYE22J6.js.br +0 -0
- package/build/runtime-chunk-CDYE22J6.js.gz +0 -0
- package/build/runtime-chunk-DZIH7EMN.js +1 -0
- package/build/runtime-chunk-DZIH7EMN.js.br +0 -0
- package/build/runtime-chunk-DZIH7EMN.js.gz +0 -0
- package/build/{runtime-chunk-TAY7IXEZ.js → runtime-chunk-FN2C54JM.js} +1 -1
- package/build/runtime-chunk-FN2C54JM.js.br +0 -0
- package/build/runtime-chunk-FN2C54JM.js.gz +0 -0
- package/build/runtime-chunk-I6B5A36U.js +1 -0
- package/build/runtime-chunk-I6B5A36U.js.br +0 -0
- package/build/runtime-chunk-I6B5A36U.js.gz +0 -0
- package/build/{runtime-chunk-E3IEBR27.js → runtime-chunk-JSRKKIOS.js} +1 -1
- package/build/runtime-chunk-JSRKKIOS.js.br +0 -0
- package/build/runtime-chunk-JSRKKIOS.js.gz +0 -0
- package/build/{runtime-chunk-BMA5KYBS.js → runtime-chunk-KKDM5MC5.js} +1 -1
- package/build/runtime-chunk-KKDM5MC5.js.br +0 -0
- package/build/runtime-chunk-KKDM5MC5.js.gz +0 -0
- package/build/{runtime-chunk-3GRN37GY.js → runtime-chunk-L2C7JGYG.js} +1 -1
- package/build/runtime-chunk-L2C7JGYG.js.br +0 -0
- package/build/runtime-chunk-L2C7JGYG.js.gz +0 -0
- package/build/{runtime-chunk-GZ7C2GJM.js → runtime-chunk-LQL2PJVX.js} +1 -1
- package/build/runtime-chunk-LQL2PJVX.js.br +0 -0
- package/build/runtime-chunk-LQL2PJVX.js.gz +0 -0
- package/build/{runtime-chunk-EJJZJ5MV.js → runtime-chunk-M4BPCY7K.js} +1 -1
- package/build/runtime-chunk-M4BPCY7K.js.br +0 -0
- package/build/runtime-chunk-M4BPCY7K.js.gz +0 -0
- package/build/{runtime-chunk-CKT62HES.js → runtime-chunk-MOZWC42D.js} +1 -1
- package/build/runtime-chunk-MOZWC42D.js.br +0 -0
- package/build/runtime-chunk-MOZWC42D.js.gz +0 -0
- package/build/{runtime-chunk-RLYG5YBB.js → runtime-chunk-MVJAFW5H.js} +1 -1
- package/build/runtime-chunk-MVJAFW5H.js.br +1 -0
- package/build/runtime-chunk-MVJAFW5H.js.gz +0 -0
- package/build/{runtime-chunk-USGQ26QU.js → runtime-chunk-QSJVWNNM.js} +1 -1
- package/build/runtime-chunk-QSJVWNNM.js.br +0 -0
- package/build/runtime-chunk-QSJVWNNM.js.gz +0 -0
- package/build/{runtime-chunk-F3ZACLZW.js → runtime-chunk-RTRWO43P.js} +1 -1
- package/build/runtime-chunk-RTRWO43P.js.br +0 -0
- package/build/runtime-chunk-RTRWO43P.js.gz +0 -0
- package/build/{runtime-chunk-HK23JJVH.js → runtime-chunk-RX3SW5K2.js} +1 -1
- package/build/runtime-chunk-RX3SW5K2.js.br +0 -0
- package/build/runtime-chunk-RX3SW5K2.js.gz +0 -0
- package/build/{runtime-chunk-5RXW5MNJ.js → runtime-chunk-UHCXLQHA.js} +1 -1
- package/build/runtime-chunk-UHCXLQHA.js.br +0 -0
- package/build/runtime-chunk-UHCXLQHA.js.gz +0 -0
- package/build/{runtime-chunk-AELTGHV2.js → runtime-chunk-VNO2DW74.js} +1 -1
- package/build/{runtime-chunk-AELTGHV2.js.br → runtime-chunk-VNO2DW74.js.br} +0 -0
- package/build/runtime-chunk-VNO2DW74.js.gz +0 -0
- package/build/{runtime-chunk-UIM3XKIT.js → runtime-chunk-WQ2NXI3U.js} +1 -1
- package/build/runtime-chunk-WQ2NXI3U.js.br +0 -0
- package/build/runtime-chunk-WQ2NXI3U.js.gz +0 -0
- package/build/{runtime-chunk-557KVSJL.js → runtime-chunk-YO3XFDZF.js} +1 -1
- package/build/runtime-chunk-YO3XFDZF.js.br +0 -0
- package/build/runtime-chunk-YO3XFDZF.js.gz +0 -0
- package/build/{runtime-chunk-32KZP4YN.js → runtime-chunk-YS7K3AW3.js} +1 -1
- package/build/runtime-chunk-YS7K3AW3.js.br +0 -0
- package/build/runtime-chunk-YS7K3AW3.js.gz +0 -0
- package/build/{runtime-chunk-YULW5JRE.js → runtime-chunk-ZASM3KKC.js} +1 -1
- package/build/runtime-chunk-ZASM3KKC.js.br +0 -0
- package/build/runtime-chunk-ZASM3KKC.js.gz +0 -0
- package/build/{runtime-chunk-OUXEWX5Z.js → runtime-chunk-ZLOMOV3N.js} +1 -1
- package/build/runtime-chunk-ZLOMOV3N.js.br +0 -0
- package/build/runtime-chunk-ZLOMOV3N.js.gz +0 -0
- package/build/{runtime-chunk-5JEZ42OM.js → runtime-chunk-ZM7N5SZG.js} +1 -1
- package/build/runtime-chunk-ZM7N5SZG.js.br +0 -0
- package/build/runtime-chunk-ZM7N5SZG.js.gz +0 -0
- package/build/{runtime-classicRuntime-U672GAGM.js → runtime-classicRuntime-A3DEJ3YH.js} +1 -1
- package/build/runtime-classicRuntime-A3DEJ3YH.js.br +0 -0
- package/build/runtime-classicRuntime-A3DEJ3YH.js.gz +0 -0
- package/build/{runtime-cloners-2AC7OZRC.js → runtime-cloners-UFF7A36S.js} +1 -1
- package/build/runtime-cloners-UFF7A36S.js.br +1 -0
- package/build/runtime-cloners-UFF7A36S.js.gz +0 -0
- package/build/{runtime-components-L63NUGAO.js → runtime-components-EESAIEPO.js} +1 -1
- package/build/runtime-components-EESAIEPO.js.br +0 -0
- package/build/runtime-components-EESAIEPO.js.gz +0 -0
- package/build/{runtime-createDestroy-QHHQ6LYS.js → runtime-createDestroy-WBIIVRMC.js} +1 -1
- package/build/runtime-createDestroy-WBIIVRMC.js.br +0 -0
- package/build/runtime-createDestroy-WBIIVRMC.js.gz +0 -0
- package/build/{runtime-dragDrop-YBSWK3ET.js → runtime-dragDrop-D45J5GQ5.js} +1 -1
- package/build/runtime-dragDrop-D45J5GQ5.js.br +0 -0
- package/build/runtime-dragDrop-D45J5GQ5.js.gz +0 -0
- package/build/{runtime-gameControls-DSJRSTW5.js → runtime-gameControls-GNLQ3FT6.js} +1 -1
- package/build/runtime-gameControls-GNLQ3FT6.js.br +0 -0
- package/build/runtime-gameControls-GNLQ3FT6.js.gz +0 -0
- package/build/{runtime-hair-V4RTCES2.js → runtime-hair-55OFZZFY.js} +1 -1
- package/build/runtime-hair-55OFZZFY.js.br +1 -0
- package/build/runtime-hair-55OFZZFY.js.gz +0 -0
- package/build/{runtime-mergeStaticGeometries-VXENKMD4.js → runtime-mergeStaticGeometries-NLUOSGZB.js} +1 -1
- package/build/runtime-mergeStaticGeometries-NLUOSGZB.js.br +0 -0
- package/build/runtime-mergeStaticGeometries-NLUOSGZB.js.gz +0 -0
- package/build/{runtime-miscActions-RPUPHHGJ.js → runtime-miscActions-5YY5ARQT.js} +1 -1
- package/build/runtime-miscActions-5YY5ARQT.js.br +0 -0
- package/build/runtime-miscActions-5YY5ARQT.js.gz +0 -0
- package/build/{runtime-mouseHover-HG6AHA2L.js → runtime-mouseHover-MTTJI6DT.js} +1 -1
- package/build/runtime-mouseHover-MTTJI6DT.js.br +0 -0
- package/build/runtime-mouseHover-MTTJI6DT.js.gz +0 -0
- package/build/{runtime-particles-ZHE2MC33.js → runtime-particles-VZVZJ35I.js} +1 -1
- package/build/runtime-particles-VZVZJ35I.js.br +0 -0
- package/build/runtime-particles-VZVZJ35I.js.gz +0 -0
- package/build/{runtime-paths-GN6E6ZYL.js → runtime-paths-4UDUBYZN.js} +1 -1
- package/build/runtime-paths-4UDUBYZN.js.br +0 -0
- package/build/runtime-paths-4UDUBYZN.js.gz +0 -0
- package/build/{runtime-resize-LACR4RFK.js → runtime-resize-QYCZUOPF.js} +1 -1
- package/build/runtime-resize-QYCZUOPF.js.br +0 -0
- package/build/runtime-resize-QYCZUOPF.js.gz +0 -0
- package/build/{runtime-sceneTransition-QLPFYHHY.js → runtime-sceneTransition-FC5TQNCH.js} +1 -1
- package/build/runtime-sceneTransition-FC5TQNCH.js.br +0 -0
- package/build/runtime-sceneTransition-FC5TQNCH.js.gz +0 -0
- package/build/{runtime-scroll-WZZBT2XR.js → runtime-scroll-VKMCDMAZ.js} +1 -1
- package/build/runtime-scroll-VKMCDMAZ.js.br +0 -0
- package/build/runtime-scroll-VKMCDMAZ.js.gz +0 -0
- package/build/runtime-shapeBlends-3QLNRN2O.js +1 -0
- package/build/runtime-shapeBlends-3QLNRN2O.js.br +4 -0
- package/build/runtime-shapeBlends-3QLNRN2O.js.gz +0 -0
- package/build/{runtime-text-UADJSRL4.js → runtime-text-IYCY3PFB.js} +1 -1
- package/build/runtime-text-IYCY3PFB.js.br +0 -0
- package/build/runtime-text-IYCY3PFB.js.gz +0 -0
- package/build/{runtime-textInputs-7U3TTJ4X.js → runtime-textInputs-LFDWIRLC.js} +1 -1
- package/build/runtime-textInputs-LFDWIRLC.js.br +0 -0
- package/build/runtime-textInputs-LFDWIRLC.js.gz +0 -0
- package/build/runtime-timeline-WNUPRRKW.js +1 -0
- package/build/runtime-timeline-WNUPRRKW.js.br +0 -0
- package/build/runtime-timeline-WNUPRRKW.js.gz +0 -0
- package/build/{runtime-tracking-MC74576T.js → runtime-tracking-HMTCBZ7J.js} +1 -1
- package/build/runtime-tracking-HMTCBZ7J.js.br +0 -0
- package/build/runtime-tracking-HMTCBZ7J.js.gz +0 -0
- package/build/{runtime-transitions-S22YS7E6.js → runtime-transitions-NPD3CNKU.js} +1 -1
- package/build/runtime-transitions-NPD3CNKU.js.br +0 -0
- package/build/runtime-transitions-NPD3CNKU.js.gz +0 -0
- package/build/{runtime-ui2d-EX3RBXPP.js → runtime-ui2d-NZTQW5UJ.js} +1 -1
- package/build/runtime-ui2d-NZTQW5UJ.js.br +0 -0
- package/build/runtime-ui2d-NZTQW5UJ.js.gz +0 -0
- package/build/{runtime-vectorShapes-J5Y3LMND.js → runtime-vectorShapes-26IDV3ZL.js} +1 -1
- package/build/runtime-vectorShapes-26IDV3ZL.js.br +0 -0
- package/build/runtime-vectorShapes-26IDV3ZL.js.gz +0 -0
- package/build/{runtime-webgpu-LDZ3N2D5.js → runtime-webgpu-CDBERG7X.js} +1 -1
- package/build/runtime-webgpu-CDBERG7X.js.br +0 -0
- package/build/runtime-webgpu-CDBERG7X.js.gz +0 -0
- package/build/runtime.cjs +5 -5
- 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/build/snippets/hana-82e9eb82a79dead4/js-imports.js +204 -77
- package/package.json +1 -1
- package/build/runtime-chunk-23QXG35G.js.br +0 -0
- package/build/runtime-chunk-23QXG35G.js.gz +0 -0
- package/build/runtime-chunk-32KZP4YN.js.br +0 -0
- package/build/runtime-chunk-32KZP4YN.js.gz +0 -0
- package/build/runtime-chunk-3GRN37GY.js.br +0 -0
- package/build/runtime-chunk-3GRN37GY.js.gz +0 -0
- package/build/runtime-chunk-557KVSJL.js.br +0 -0
- package/build/runtime-chunk-557KVSJL.js.gz +0 -0
- package/build/runtime-chunk-5JEZ42OM.js.br +0 -0
- package/build/runtime-chunk-5JEZ42OM.js.gz +0 -0
- package/build/runtime-chunk-5RXW5MNJ.js.br +0 -0
- package/build/runtime-chunk-5RXW5MNJ.js.gz +0 -0
- package/build/runtime-chunk-AELTGHV2.js.gz +0 -0
- package/build/runtime-chunk-BMA5KYBS.js.br +0 -0
- package/build/runtime-chunk-BMA5KYBS.js.gz +0 -0
- package/build/runtime-chunk-CKT62HES.js.br +0 -0
- package/build/runtime-chunk-CKT62HES.js.gz +0 -0
- package/build/runtime-chunk-DHWGP6NU.js.br +0 -0
- package/build/runtime-chunk-DHWGP6NU.js.gz +0 -0
- package/build/runtime-chunk-DK66VKWP.js.br +0 -0
- package/build/runtime-chunk-DK66VKWP.js.gz +0 -0
- package/build/runtime-chunk-E3IEBR27.js.br +0 -0
- package/build/runtime-chunk-E3IEBR27.js.gz +0 -0
- package/build/runtime-chunk-EJJZJ5MV.js.br +0 -0
- package/build/runtime-chunk-EJJZJ5MV.js.gz +0 -0
- package/build/runtime-chunk-F3ZACLZW.js.br +0 -0
- package/build/runtime-chunk-F3ZACLZW.js.gz +0 -0
- package/build/runtime-chunk-GZ7C2GJM.js.br +0 -0
- package/build/runtime-chunk-GZ7C2GJM.js.gz +0 -0
- package/build/runtime-chunk-HK23JJVH.js.br +0 -0
- package/build/runtime-chunk-HK23JJVH.js.gz +0 -0
- package/build/runtime-chunk-HZ6FL5GH.js.br +0 -0
- package/build/runtime-chunk-HZ6FL5GH.js.gz +0 -0
- package/build/runtime-chunk-KE6HNYUL.js +0 -1
- package/build/runtime-chunk-KE6HNYUL.js.br +0 -0
- package/build/runtime-chunk-KE6HNYUL.js.gz +0 -0
- package/build/runtime-chunk-KNL33WN7.js +0 -1
- package/build/runtime-chunk-KNL33WN7.js.br +0 -0
- package/build/runtime-chunk-KNL33WN7.js.gz +0 -0
- package/build/runtime-chunk-OUXEWX5Z.js.br +0 -0
- package/build/runtime-chunk-OUXEWX5Z.js.gz +0 -0
- package/build/runtime-chunk-PDASWDVC.js.gz +0 -0
- package/build/runtime-chunk-RLYG5YBB.js.br +0 -1
- package/build/runtime-chunk-RLYG5YBB.js.gz +0 -0
- package/build/runtime-chunk-TAY7IXEZ.js.br +0 -0
- package/build/runtime-chunk-TAY7IXEZ.js.gz +0 -0
- package/build/runtime-chunk-UIM3XKIT.js.br +0 -0
- package/build/runtime-chunk-UIM3XKIT.js.gz +0 -0
- package/build/runtime-chunk-USGQ26QU.js.br +0 -0
- package/build/runtime-chunk-USGQ26QU.js.gz +0 -0
- package/build/runtime-chunk-YULW5JRE.js.br +0 -0
- package/build/runtime-chunk-YULW5JRE.js.gz +0 -0
- package/build/runtime-classicRuntime-U672GAGM.js.br +0 -0
- package/build/runtime-classicRuntime-U672GAGM.js.gz +0 -0
- package/build/runtime-cloners-2AC7OZRC.js.br +0 -0
- package/build/runtime-cloners-2AC7OZRC.js.gz +0 -0
- package/build/runtime-components-L63NUGAO.js.br +0 -0
- package/build/runtime-components-L63NUGAO.js.gz +0 -0
- package/build/runtime-createDestroy-QHHQ6LYS.js.br +0 -0
- package/build/runtime-createDestroy-QHHQ6LYS.js.gz +0 -0
- package/build/runtime-dragDrop-YBSWK3ET.js.br +0 -0
- package/build/runtime-dragDrop-YBSWK3ET.js.gz +0 -0
- package/build/runtime-gameControls-DSJRSTW5.js.br +0 -0
- package/build/runtime-gameControls-DSJRSTW5.js.gz +0 -0
- package/build/runtime-hair-V4RTCES2.js.br +0 -2
- package/build/runtime-hair-V4RTCES2.js.gz +0 -0
- package/build/runtime-mergeStaticGeometries-VXENKMD4.js.br +0 -0
- package/build/runtime-mergeStaticGeometries-VXENKMD4.js.gz +0 -0
- package/build/runtime-miscActions-RPUPHHGJ.js.br +0 -0
- package/build/runtime-miscActions-RPUPHHGJ.js.gz +0 -0
- package/build/runtime-mouseHover-HG6AHA2L.js.br +0 -0
- package/build/runtime-mouseHover-HG6AHA2L.js.gz +0 -0
- package/build/runtime-particles-ZHE2MC33.js.br +0 -0
- package/build/runtime-particles-ZHE2MC33.js.gz +0 -0
- package/build/runtime-paths-GN6E6ZYL.js.br +0 -0
- package/build/runtime-paths-GN6E6ZYL.js.gz +0 -0
- package/build/runtime-resize-LACR4RFK.js.br +0 -0
- package/build/runtime-resize-LACR4RFK.js.gz +0 -0
- package/build/runtime-sceneTransition-QLPFYHHY.js.br +0 -0
- package/build/runtime-sceneTransition-QLPFYHHY.js.gz +0 -0
- package/build/runtime-scroll-WZZBT2XR.js.br +0 -0
- package/build/runtime-scroll-WZZBT2XR.js.gz +0 -0
- package/build/runtime-shapeBlends-O6ATLCCA.js +0 -1
- package/build/runtime-shapeBlends-O6ATLCCA.js.br +0 -0
- package/build/runtime-shapeBlends-O6ATLCCA.js.gz +0 -0
- package/build/runtime-text-UADJSRL4.js.br +0 -0
- package/build/runtime-text-UADJSRL4.js.gz +0 -0
- package/build/runtime-textInputs-7U3TTJ4X.js.br +0 -0
- package/build/runtime-textInputs-7U3TTJ4X.js.gz +0 -0
- package/build/runtime-timeline-JXKHKUAC.js +0 -1
- package/build/runtime-timeline-JXKHKUAC.js.br +0 -0
- package/build/runtime-timeline-JXKHKUAC.js.gz +0 -0
- package/build/runtime-tracking-MC74576T.js.br +0 -0
- package/build/runtime-tracking-MC74576T.js.gz +0 -0
- package/build/runtime-transitions-S22YS7E6.js.br +0 -0
- package/build/runtime-transitions-S22YS7E6.js.gz +0 -0
- package/build/runtime-ui2d-EX3RBXPP.js.br +0 -0
- package/build/runtime-ui2d-EX3RBXPP.js.gz +0 -0
- package/build/runtime-vectorShapes-J5Y3LMND.js.br +0 -0
- package/build/runtime-vectorShapes-J5Y3LMND.js.gz +0 -0
- package/build/runtime-webgpu-LDZ3N2D5.js.br +0 -0
- package/build/runtime-webgpu-LDZ3N2D5.js.gz +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
import{h as t}from"./runtime-chunk-2PT2WH66.js";import{g as e}from"./runtime-chunk-4KZXQGUQ.js";import{c as i}from"./runtime-chunk-TZCHGFVF.js";import{Ba as r,C as s,Ca as a,Ea as n,K as o,j as l,k as h,l as p,o as d}from"./runtime-chunk-VPEJ5BFD.js";import{$c as c,Cc as u,Ec as m,Fc as f,Kd as y,Oc as g,Pc as v,Pd as x,Rc as S,Re as w,Xc as M,bd as b,cd as B,dd as P,kd as E,ld as A}from"./runtime-chunk-VGN7YHB7.js";var C={Cloner:null,changeEntityProptotype:()=>{},createEntity:()=>{}};function D(t,e){let i=[];if(e.length!==t.length)return null;{let r=0;for(;r<t.length;){if("*"===e[r])i.push(t[r]);else if(t[r]!==e[r])return null;r+=1}}return i}function O(t,e){let i=[];if(!(e.length<=t.length))return null;{let r=0;for(;r<e.length;){if("*"===e[r])i.push(t[r]);else if(t[r]!==e[r])return null;r+=1}}return i}var V=new f,W=new f,_=new g,T=[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]],R=[[0,2],[7,5],[4,1],[3,6],[4,3],[1,6]],z=(t,e,i)=>{t.updateEntityBoxSize(V,W),_.copy(e).multiply(t.matrixWorld),0===W.x&&0===W.y&&0===W.z?i.push(new f(V.x,V.y,V.z).applyMatrix4(_)):T.forEach(t=>{i.push(t.clone().multiply(W).add(V).applyMatrix4(_))})},I=class extends M{constructor(){super(...arguments),this.matrix=new g,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 g).copy(t.matrixWorld).invert();return this.expandByObjectSize(t,i,e)}expandByObjectSize(t,e,i=!1){let r=[];if(!0===i){let i=[];t.traverseEntity(t=>{if(t.visible||t.cloner&&t.data.visible){if(!("geometry"in t))return _.copy(e).multiply(t.matrixWorld),void i.push((new f).applyMatrix4(_));z(t,e,r)}}),0===r.length&&r.push(...i)}else z(t,e,r);return this.setFromPoints(r)}getCenter(t){return(t=super.getCenter(t)).applyMatrix4(this.matrix),t}getPositionToCenter(t){return(t=super.getCenter(t)).applyMatrix4(_.copy(this.matrix).setPosition(0,0,0)),t}computeVertices(){this.getSize(W).multiplyScalar(.5),this.getCenter(V),_.copy(this.matrix).setPosition(V),this.vertices=T.map(t=>t.clone().multiply(W).applyMatrix4(_))}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=R.map(([t,e])=>this.vertices[t].clone().add(this.vertices[e]).multiplyScalar(.5))}},L=new f,N=new f,F=new f,j=new f,k=new f,q=new f,G=new g,H=1e-12,K=.01;function X(t){let e=t.elements;L.set(e[0],e[1],e[2]),N.set(e[4],e[5],e[6]),F.set(e[8],e[9],e[10])}function Z(){let t=Math.max(L.lengthSq(),N.lengthSq(),F.lengthSq());L.lengthSq()>H*t?j.copy(L).normalize():j.set(1,0,0),k.crossVectors(F,j),k.lengthSq()<=H*t&&(k.copy(N).addScaledVector(j,-N.dot(j)),k.lengthSq()<=H*t&&function(t,e){t.set(1,0,0).cross(e),t.lengthSq()<=H&&t.set(0,1,0).cross(e),t.normalize()}(k,j)),k.normalize(),q.crossVectors(j,k)}function Q(t){return X(t),Z(),G.makeBasis(j,k,q)}var Y,$=new g;(Y||(Y={})).is=function(t){return t&&t.__isSPEObject};var J=t=>class extends t{constructor(){super(...arguments),this.previousModelViewMatrix=new g,this.copyPreviousMatrix=!0,this.hiddenMatrix=new g,this.pivotMatrix=new g,this.matrixWorldRigid=new g,this.shearScale=new g,this.shearScaleInv=new g}get __isSPEObject(){return!0}getPhysicsLocalMatrix(t){return!!this.rigidBody?.isDynamic()&&(t.copy(this.matrixWorld),this.hasNonUniformScale&&t.multiply(this.shearScaleInv),this.parent&&t.premultiply($.copy(this.parent.matrixWorld).invert()),t.premultiply($.copy(this.hiddenMatrix).invert()),t.multiply($.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}updateMatrixWorld(t){this.matrixAutoUpdate&&this.updateMatrix(),(this.matrixWorldNeedsUpdate||t)&&(null===this.parent?this.matrixWorld.multiplyMatrices(this.hiddenMatrix,this.matrix):(this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.hiddenMatrix),this.matrixWorld.multiplyMatrices(this.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.multiplyMatrices(this.hiddenMatrix,this.matrix):(this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.hiddenMatrix),this.matrixWorld.multiplyMatrices(this.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)Y.is(i)&&i.traverseObject(t,e+1)}traverseObject(t,e=0){if(!0!==t(this,e))for(let i of this.children)Y.is(i)&&i.traverseObject(t,e+1)}updateMatrixWorldRigid(){this.hasNonUniformScale=function(t,e,i){return X(t),Z(),e.makeBasis(j,k,q),i.set(j.dot(L),j.dot(N),j.dot(F),0,k.dot(L),k.dot(N),k.dot(F),0,q.dot(L),q.dot(N),q.dot(F),0,0,0,0,1),function(){let t=L.length(),e=N.length(),i=F.length(),r=Math.max(t,e,i);if(r-t>K||r-e>K||r-i>K)return!0;let s=K*r*r;return Math.abs(L.dot(N))>s||Math.abs(L.dot(F))>s||Math.abs(N.dot(F))>s}()}(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 g).copy(this.matrixWorld).invert();return null!==t.parent&&(t.parent.updateWorldMatrix(!0,!1),i.multiply(t.parent.matrixWorld)),"hiddenMatrix"in t&&t.hiddenMatrix instanceof g?t.hiddenMatrix.premultiply(i):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.hasNonUniformScale=t.hasNonUniformScale,this}onAfterRender(t,e,i,r,s,a){this.copyPreviousMatrix&&this.previousModelViewMatrix.copy(this.modelViewMatrix)}},tt=class extends x{constructor(){super()}getPoints(t=12){let e,i=[],r=this.getCurveLengths(),s=r[r.length-1]/r.length;for(let a=0,n=this.curves;a<n.length;a++){let o=n[a],l=0===a?r[a]:r[a]-r[a-1],h=Math.ceil(t*l/s),p=o.getPoints(h);for(let t=0;t<p.length;t++){let r=p[t];e&&e.equals(r)||(i.push(r),e=r)}}return this.autoClose&&i.length>1&&!i[i.length-1].equals(i[0])&&i.push(i[0]),i}},et=.001,it=new f,rt=new f,st=new f,at=new f,nt=new f,ot=new f,lt=new f,ht=new f,pt=new f;function dt(t,e,i){return it.subVectors(e,t),rt.subVectors(e,i),it.cross(rt).length()<=et}var ct,ut=new WeakMap;function mt(t){let e=ut.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]],r=[new f(...e[0].data.position)];st.copy(r[0]);for(let t=0;t<e.length-1;t++)it.fromArray(e[t].data.position),rt.fromArray(e[t+1].data.position),nt.subVectors(it,st),lt.subVectors(it,rt),nt.cross(lt).length()>et&&(i.push(e[t]),r.push((new f).copy(it)),st.copy(it));let s=e[e.length-1];i.push(s),r.push(new f(...s.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(dt(r[t],h[t],r[e])&&dt(r[t],l[e],r[e]))}let d=[];for(let t=0;t<o;t++){let e=i[t].data,s=r[t],n={position:s,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(r[c],s).normalize(),y=(new f).subVectors(r[u],s).normalize();n.prevDir=m,n.nextDir=y;let g=p[a&&0===t?o-1:t-1],v=p[t];if(g&&v){at.addVectors(m,y).normalize();let t=st.crossVectors(at,m).length()/m.dot(at);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],r=d[e];if(0!==i.removedLength||0!==r.removedLength){let t=i.position.distanceTo(r.position);i.removedLength=Math.min(i.removedLength,t/2),r.removedLength=Math.min(r.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],r=d[e],s=null;if(p[t]){let t=i.position.clone(),e=r.position.clone();(0!==i.removedLength||0!==r.removedLength)&&(i.nextDir&&t.add(st.copy(i.nextDir).setLength(i.removedLength)),r.prevDir&&e.add(st.copy(r.prevDir).setLength(r.removedLength))),t.distanceTo(e)>et&&(s=new y(t,t.clone().lerp(e,.3),e.clone().lerp(t,.3),e))}else i.position.distanceTo(r.position)>et&&(s=new y(i.position,i.controlNext,r.controlPrevious,r.position));c[2*t+1]=s}for(let t=0;t<o;t++){let e=d[t];if(0===e.removedLength)continue;let i=e.position,r=e.prevDir.clone().multiplyScalar(e.removedLength).add(i),s=e.nextDir.clone().multiplyScalar(e.removedLength).add(i),a=e.tan*e.removedLength;at.addVectors(e.prevDir,e.nextDir).normalize(),nt.copy(r).lerp(s,.5);let n=r.distanceTo(s)/2;pt.copy(at).multiplyScalar(Math.sqrt(Math.pow(a,2)-Math.pow(n,2))).add(nt),ot.copy(at).multiplyScalar(-a).add(pt);let o=i.distanceTo(ot)/i.distanceTo(nt);lt.copy(e.prevDir).multiplyScalar(o*i.distanceTo(r)).add(i),ht.copy(lt).lerp(ot,2);let l=r.clone().lerp(lt,4/3),h=s.clone().lerp(ht,4/3);c[2*t]=new y(r,l,h,s)}let u=new tt;for(let t=0;t<c.length;t++){let e=c[t];e&&u.add(e)}return u}(t);return ut.set(t.points,{isClosed:t.isClosed,curve:i}),i}(ct||(ct={})).is=function(t){return t&&t.__isEntity};var ft=t=>ct.is(t),yt={type:"completeState",isfromEntity:!0},gt=["x","y","z"],vt=new f,xt=new f(1,1,1),St=new m,wt=new v,Mt=(new f).set(0,1,0),bt=new g,Bt=new g,Pt=c=>class extends(J(c)){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.currentTransitionEvent=null,this.previousAction=null,this._singleBBox=new I,this._recursiveBBox=new I,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(ct.is(e))return e}entityChildrenCount(){let t=this.children.length;for(;t--;)if(ct.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(!ct.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=h.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=>{ft(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(ct.is(e[i]))return e[i];if(ct.is(t))return t.traverseSortNextHelper()}}sortNext(){let t=this.children;return this.children.length>0&&ct.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)ft(e)&&t(e)}traverseEntityAncestors(t){this.traverseAncestors(e=>{ct.is(e)&&t(e)})}traverseConcreteEntity(t,e=0){if(!0!==t(this,e))for(let i of this.children)ft(i)&&i.isConcreteEntity&&i.traverseEntity(t,e+1)}traverseEntity(t,e=0){if(!0!==t(this,e))for(let i of this.children)ft(i)&&i.traverseEntity(t,e+1)}traverseVisibleEntity(t){t(this);for(let e of this.children)ft(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.hiddenMatrix.copy(t.hiddenMatrix),this}hasEntityChild(){return this.children.some(t=>ft(t))}isAncestorOf(t){if(this.uuid===t)return!1;let e=!1;return this.traverseEntity(i=>{i.uuid===t&&(e=!0)}),e}toObjectTransformState(t=[]){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(),hiddenMatrix:this.hiddenMatrix.toArray(),pivot:[0,0,0],pivotRotation:[0,0,0]};return e(i,t)}getTransformValues(t,e,i){return e[t].map((e,r)=>i?.shared.getVariable(e,[this.uuid,t,gt[r]])??e)}updateTransformState(t,e){let i=!1;if(t.position&&(this.position.fromArray(this.getTransformValues("position",t,e)),i=!0),t.rotation&&(vt.fromArray(this.getTransformValues("rotation",t,e)).multiplyScalar(u.DEG2RAD),this.rotation.setFromVector3(vt),i=!0),t.scale&&(this.scale.fromArray(this.getTransformValues("scale",t,e)),i=!0),void 0!==t.hiddenMatrix&&(i=!0,this.hiddenMatrix.fromArray(t.hiddenMatrix??s.identity)),void 0!==t.pivot||void 0!==t.pivotRotation)if(i=!0,void 0!==t.pivot&&void 0!==t.pivotRotation)this.pivotMatrix.compose(vt.fromArray(t.pivot).negate(),St.setFromEuler(wt.fromArray(t.pivotRotation.map(t=>t*u.DEG2RAD))).invert(),xt);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=vt.setFromMatrixPosition(this.pivotMatrix);St.setFromEuler(wt.fromArray(t.pivotRotation.map(t=>t*u.DEG2RAD))).invert(),this.pivotMatrix.compose(e,St,xt)}return i&&(this.updateMatrix(),this.resetBBoxNeedsUpdate(),this.invalidateClonerTransform(this),this.traverseEntityAncestors(t=>{t.invalidateClonerTransform(this)})),t.position&&t.rotation&&t.scale&&void 0!==t.hiddenMatrix&&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)ct.is(t)&&t.disposeRecursively()}disposeRecursively(){this.dispose(),this.children.forEach(t=>{ct.is(t)&&t.disposeRecursively()})}toState(t=[]){let i={name:this.name,visible:this.visible,raycastLock:this.raycastLock,...this.toObjectTransformState(t)};return e(i,t)}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 h=t,c=O(t.path,["states","*"]);if(null!==c){if(0===t.type){let[e]=c;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 r=d.zoom(i,t.path.slice(2));if(r)for(let i in t.props)void 0===t.props[i]&&i in r&&(e[i]=r[i])}}h={...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=d.removeOverridden(t.path,t.props,e);h={...t,props:i}}}if(this.updateByPatchedOpBase(h,n.patch(this.data,this.stateSelection?this.data.states.data(this.stateSelection):void 0),i),O(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(l.apply(r.component.data,r.overrideData),i))}}else{let n=i.scene.findInstance([this.uuid,...s]);if(n){let o=d.zoom(n.component.data,a);if(0===(t={...t,path:a}).type){let e=t.props;if(o)for(let[i,r]of Object.entries(t.props))void 0===r&&(e===t.props&&(e={...t.props}),e[i]=o[i]);t={...t,props:e}}n.overrideData=r.resolve(e.overrides,s),n.updateByOp(t,p.applySimple(n.data,t),i,!1)}}}else if(this.instances.length>0){let r;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&&(r={...t,props:e})}else for(let e of a.rootOverrideProps)if(O(t.path,[e])){r=t;break}void 0!==r&&this.instances.forEach(t=>{if(t.isInstanceRoot){let e=l.filterOp(t.overrideData,r);e&&t.updateByOp(e,p.applySimple(t.data,e),i,!0)}}),this.instances.forEach(r=>{if(!r.isInstanceRoot){let s=l.filterOp(r.overrideData,t);if(s){let a;a=o===r.data&&t===s?e:p.applySimple(r.data,s),r.updateByOp(s,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)&&C.changeEntityProptotype(this,e,i);else if(1===t.path.length&&"geometry"===t.path[0]&&0===t.type&&"type"in t.props){C.changeEntityProptotype(this,e,i);for(let t of this.children)ct.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 r=e.morphTargetInfluences.get(t.path[1])?.data.name;r&&this.updateMorphInfluences(r,i.shared.getVariable(t.props.value,[this.uuid,"morphTargetInfluences",r]))}if(null!==O(t.path,["pathSnapping"])&&this.updatePathSnapping(e.pathSnapping),null!==O(t.path,["cloner"])){let r=p.drop(t,1);0===r.path.length&&0===r.type&&!0===r.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,r=this._updatedPathSnapping?.offset??this.dataPatched.pathSnapping.offset??0,s=this._updatedPathSnapping?.orientation??this.dataPatched.pathSnapping.orientation;if(null===e)return;let a=t.find(e);if(!a)return;this._needApplyPathSnapping=!1;let n=a.data;if(n.geometry.path.points.length<=1)return;let o=mt(n.geometry.path),l=(i+r)%1;i+r===1&&0===l&&(l=1);let h=null;try{h=o.curves.length?o.getPointAt(l):null}catch(t){}if(null===h)return;a.updateMatrixWorld();let p=this.parent?bt.copy(this.parent.matrixWorld).invert():bt.identity();p.multiply(a.matrixWorld),h.applyMatrix4(p);let d={position:h.toArray(),rotation:n.rotation};if("tangential"===s){let t=Bt.extractRotation(a.matrixWorld),e=o.getTangentAt(l).applyMatrix4(t).add(h),i=Bt.lookAt(h,e,Mt),r=vt.setFromEuler(wt.setFromRotationMatrix(i)).multiplyScalar(u.RAD2DEG);d={...d,rotation:r.toArray()}}this.updateTransformState(d),this.traverseEntity(t=>{t._cameraType&&t.dispatchEvent(yt)})}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(e=>t(e)&&"toObject"===e.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===C.Cloner)return void i("cloners","a cloner");this.cloner=new C.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"})}},Et=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),r=Math.abs(i.width),s=Math.abs(i.height??r),a=Math.abs(i.depth??r),n=Math.abs(Math.min(r,a))/2;return{parameters:Object.assign(i,{width:r,height:s,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:r,radius:s,revolutions:a,segments:n,pathRadius:o,pathType:l,pathSegments:h,cornerRadius:p,cornerSegments:d}=t.parameters,c=new Vt(!1,e,i,r,s,a,n,o,l,h,p,d);return Object.assign(c,{userData:{...t,type:"HelixGeometry"}})}},At=new c([0,0,0],1);function Ct(t){return"TorusGeometry"===t.type&&360===t.arc}var Dt,Ot,Vt=class extends P{constructor(t=!0,e=1,i=1,r=1,s=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,g,v,x,S,w,M=()=>new f,B=new f,P=M(),E=M(),A=M(),C=M(),D=M(),O=M(),V=M(),W=M(),_=M(),T=M(),U=M(),R=i-2*o+.001,z=R/a,I=Math.ceil(n*a),L=I+1,N=R/I,F=-R/2,j=h+1,k=2*Math.PI/h,q=Math.PI/2/d,G=Math.min((1-p/100)*o,o-.01),H=o-G,K=0,X=2*d+2,Z=j*X/2,Q=Z+j*L,Y=Math.max(0,j*(L+X)),[$,J,tt]=[3,3,2].map(t=>Array(Y*t).fill(0)),et=[],it=s-o;function rt(e,i){let r=Math.PI/2;x=i*N,w=2*Math.PI*(x%z)/z+r,x+=F,S=Math.sin(w)*it,v=Math.cos(w)*it,t?e.set(v,S,x):e.set(v,x,S)}rt(B,-1e-10),rt(P,0),C.copy(B),rt(B,1);let st=B.distanceTo(P),at=c?0:H+G,nt=st*I+2*at,ot=G,lt=nt-at;for(let e=0;e<=I;e++){rt(E,e),U.subVectors(E,C).normalize(),C.copy(E),_.copy(E).setComponent(+t+1,0).normalize(),T.crossVectors(U,_).normalize();let i=0===e,r=e===I,s=i?3*Math.PI/2:q,a=i?ot:lt,n=i?j:Q,l=i?0:Y-j,p=U.clone().multiplyScalar(i?-H:H).add(E),u=U.clone().multiplyScalar(i?-1:1).normalize();for(let t=0;t<j;t++){let m=t*k;if(D.addVectors(B.copy(_).multiplyScalar(o*Math.cos(m)),P.copy(T).multiplyScalar(o*Math.sin(m))),O.copy(D).normalize(),i||r){c||(K=l+t,[0,1,2].forEach(t=>{$[3*K+t]=p.getComponent(t),J[3*K+t]=u.getComponent(t)}),tt[2*K]=+r,tt[2*K+1]=t/h),P.copy(O).multiplyScalar(G),A.addVectors(E,P);for(let e=0;e<d;e++){let r=e*q+s;V.addVectors(B.copy(U).multiplyScalar(H*Math.sin(r)),P.copy(O).multiplyScalar(H*Math.cos(r))),W.copy(V).normalize(),P.addVectors(A,V),V.normalize(),K=n+e*j+t,[0,1,2].forEach(t=>{$[3*K+t]=P.getComponent(t),J[3*K+t]=W.getComponent(t)});let o=+i+Math.sin(r);tt[2*K]=(a+H*o)/nt,tt[2*K+1]=t/h}}P.addVectors(E,D),K=Z+e*j+t,[0,1,2].forEach(t=>{$[3*K+t]=P.getComponent(t),J[3*K+t]=O.getComponent(t)}),tt[2*K]=(at+e*st)/nt,tt[2*K+1]=t/h}}let ht=L+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<j-1;i++)u=t*j+i,m=u+1,y=(e?i:u)+j,g=(e?i+1:m)+j,0===t?et.push(m,g,y):t===ht-2?et.push(u,m,y):et.push(u,m,y,m,g,y)}this.setIndex(et),this.setAttribute("position",new b($,3)),this.setAttribute("normal",new b(J,3)),this.setAttribute("uv",new b(tt,2))}getClosedTorusIndicesForBooleanOrSubdiv(){let t,e,i,r,s=this.userData.parameters,a=Math.ceil(s.tubularSegments),n=s.radialSegments,o=n+1,l=[];for(let s=1;s<a;s++)for(let a=0;a<n;a++)t=s*o+a,e=t+1,i=t+o,r=e+o,l.push(t,e,i,e,r,i);for(let s=0;s<n;s++)t=a*o+s,e=t+1,i=s+o,r=s+1+o,l.push(t,e,i,e,r,i);return At.array=new Uint32Array(l),At.count=l.length,At}},Wt=new Map,_t=0;function Tt(t){return Ot||(Ot=async function(){let e=t??"https://cdn.spline.design/@splinetool/runtime@2.0.8/build",i=import("./boolean.js"),[r,s]=await Promise.all([i,fetch(`${e}/boolean.wasm`).then(t=>t.arrayBuffer())]);await r.default({module_or_path:s}),Dt=r}())}function Ut(){if(void 0===Dt)throw new Error("boolean-wasm is not loaded");return Dt}function Rt(t){let e=Wt.get(t);if(void 0===e)throw new Error("Unknown csg mesh set handle "+t);return e}function zt(t){return Wt.set(++_t,t),_t}var It={0:0,1:1,2:2};function Lt(t,e,i){if(void 0===Dt)return-1;let{positions:r,indices:s,normals:a}=function(t,e){if(e&&void 0!==t.userData.positions){let e=t.userData,i=[];for(let t=0,r=0;t<e.verticesPerFace.length;t++){let s=e.verticesPerFace[t];for(let t=1;t<s-1;t++)i.push(e.indices[r],e.indices[r+t],e.indices[r+t+1]);r+=s}return{positions:e.positions instanceof Float32Array?e.positions:new Float32Array(e.positions),indices:new Uint32Array(i)}}let i;i=Ct(t.userData.parameters)?t.getClosedTorusIndicesForBooleanOrSubdiv():t.getIndex();let r,s=t.getAttribute("position");if(null===i){r=new Uint32Array(s.count);for(let t=0;t<r.length;t++)r[t]=t}else r=i.array instanceof Uint32Array?i.array:new Uint32Array(i.array);let a=t.getAttribute("normal"),n=void 0!==a&&3===a.itemSize&&a.count===s.count&&a.array instanceof Float32Array&&!0!==a.isInterleavedBufferAttribute?a.array:void 0;return{positions:s.array,indices:r,normals:n}}(t,e);return zt(new Dt.CsgMesh(r,s,a))}function Nt(t,e){let i=Ut(),r=It[e];if(void 0===r)throw new Error("Unknown boolean operation "+e);let s=t.map(Rt);if(1===s.length)return i.clone_mesh(s[0]);let a,n=[];if(2===e&&s.length>2){let t=s[0];for(let e=1;e<s.length-1;e++)t=i.boolean_mesh(t,s[e],0),n.push(t);a=i.boolean_mesh(s[s.length-1],t,2)}else if(2===e)a=i.boolean_mesh(s[1],s[0],2);else{let t=s[s.length-1];for(let e=0;e<s.length-1&&(t=i.boolean_mesh(t,s[e],r),n.push(t),0!==t.tri_count());e++);a=t,n.pop()}for(let t of n)t.free();return a}function Ft(t,e,i,r){let s=Ut(),a=Nt(t,e),n=s.mesh_render_data(a,Math.max(r,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 B),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 zt(a)}function jt(t,e){let i=Ut(),r=Nt(t,e),s=i.mesh_topological_data(r),a=s.positions(),n=s.indices();return s.free(),r.free(),{positions:a,indices:n,verticesPerFace:new Uint8Array(n.length/3).fill(3)}}function kt(t,e){Rt(t).transform(new Float32Array(e.elements))}function qt(t){let e=Wt.get(t);void 0!==e&&(e.free(),Wt.delete(t))}function Gt(t,e){return zt(Ut().instanced_union(Rt(t),e))}function Ht(t){return null!==t&&"booleanOp"in t}var Kt=class extends(Pt(A)){constructor(){super(...arguments),this.booleanMeshSetAddress=-1,this.booleanWasTransformed=!1,this.booleanMatrixInvOld=new g}updateVisible(t){super.updateVisible(t),this.visible=!Ht(this.parent)&&this.visible,Ht(this.parent)&&this.parent.invalidateDownstreamBooleanData()}onClonerLayoutUpdated(){Ht(this.parent)&&this.invalidateDownstreamBooleanData()}freeBooleanPointer(){-1!==this.booleanMeshSetAddress&&(qt(this.booleanMeshSetAddress),this.booleanMeshSetAddress=-1)}invalidateDownstreamBooleanData(t=!1){return t?this.booleanWasTransformed=!0:this.freeBooleanPointer(),Ht(this.parent)?this.parent.invalidateDownstreamBooleanData():this}invalidateUpstreamBooleanData(){this.freeBooleanPointer();for(let t of this.children)t instanceof Kt&&(t.freeBooleanPointer(),Ht(t)&&t.invalidateUpstreamBooleanData())}updateTransformState(t,e){let i=super.updateTransformState(t,e);return i&&Ht(this.parent)&&this.invalidateDownstreamBooleanData(!0),i}onVariableUpdate(t=!1){super.onVariableUpdate(t),Ht(this.parent)&&this.invalidateDownstreamBooleanData(!0)}},Xt=new M;function Zt(t,e=0,i=t.count,r,s){let a=1/0,n=1/0,o=1/0,l=-1/0,h=-1/0,p=-1/0;for(let r=e;r<i;r++){let e=t.getX(r),i=t.getY(r),s=t.getZ(r);e<a&&(a=e),i<n&&(n=i),s<o&&(o=s),e>l&&(l=e),i>h&&(h=i),s>p&&(p=s)}Xt.min.set(a,n,o),Xt.max.set(l,h,p),Xt.getCenter(r),Xt.getSize(s).multiplyScalar(.5)}var Qt=new P,Yt=new E,$t=class extends Kt{constructor(t,e){super(Qt,Yt),this.super_Entity(t,e)}updateState(t,e){this.updateState_Entity(t,e)}raycast(t,e){super.raycast(t,e)}updateEntityBoxSize(t,e){let i=this.geometry.getAttribute("position");void 0!==i?Zt(i,this.geometry.drawRange.start,this.geometry.drawRange.count<1/0?this.geometry.drawRange.count:i.count,t,e):super.updateEntityBoxSize(t,e)}};export{D as a,O as b,C as c,Q as d,Y as e,J as f,mt as g,ct as h,ft as i,Pt as j,Et as k,Ct as l,Vt as m,Tt as n,Lt as o,Ft as p,jt as q,kt as r,qt as s,Gt as t,Zt as u,$t as v};
|
|
1
|
+
import{h as t}from"./runtime-chunk-2PT2WH66.js";import{g as e}from"./runtime-chunk-4KZXQGUQ.js";import{c as i}from"./runtime-chunk-TZCHGFVF.js";import{Ba as r,C as s,Ca as a,Ea as n,K as o,j as l,k as h,l as p,o as d}from"./runtime-chunk-VPEJ5BFD.js";import{$c as c,Cc as u,Ec as m,Fc as f,Kd as y,Oc as g,Pc as v,Pd as x,Rc as S,Re as w,Xc as M,bd as b,cd as B,dd as P,kd as E,ld as A}from"./runtime-chunk-VGN7YHB7.js";var C={Cloner:null,changeEntityProptotype:()=>{},createEntity:()=>{}};function D(t,e){let i=[];if(e.length!==t.length)return null;{let r=0;for(;r<t.length;){if("*"===e[r])i.push(t[r]);else if(t[r]!==e[r])return null;r+=1}}return i}function O(t,e){let i=[];if(!(e.length<=t.length))return null;{let r=0;for(;r<e.length;){if("*"===e[r])i.push(t[r]);else if(t[r]!==e[r])return null;r+=1}}return i}var V=new f,W=new f,_=new g,T=[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]],R=[[0,2],[7,5],[4,1],[3,6],[4,3],[1,6]],z=(t,e,i)=>{t.updateEntityBoxSize(V,W),_.copy(e).multiply(t.matrixWorld),0===W.x&&0===W.y&&0===W.z?i.push(new f(V.x,V.y,V.z).applyMatrix4(_)):T.forEach(t=>{i.push(t.clone().multiply(W).add(V).applyMatrix4(_))})},I=class extends M{constructor(){super(...arguments),this.matrix=new g,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 g).copy(t.matrixWorld).invert();return this.expandByObjectSize(t,i,e)}expandByObjectSize(t,e,i=!1){let r=[];if(!0===i){let i=[];t.traverseEntity(t=>{if(t.visible||t.cloner&&t.data.visible){if(!("geometry"in t))return _.copy(e).multiply(t.matrixWorld),void i.push((new f).applyMatrix4(_));z(t,e,r)}}),0===r.length&&r.push(...i)}else z(t,e,r);return this.setFromPoints(r)}getCenter(t){return(t=super.getCenter(t)).applyMatrix4(this.matrix),t}getPositionToCenter(t){return(t=super.getCenter(t)).applyMatrix4(_.copy(this.matrix).setPosition(0,0,0)),t}computeVertices(){this.getSize(W).multiplyScalar(.5),this.getCenter(V),_.copy(this.matrix).setPosition(V),this.vertices=T.map(t=>t.clone().multiply(W).applyMatrix4(_))}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=R.map(([t,e])=>this.vertices[t].clone().add(this.vertices[e]).multiplyScalar(.5))}},L=new f,N=new f,F=new f,j=new f,k=new f,q=new f,G=new g,H=1e-12,K=.01;function X(t){let e=t.elements;L.set(e[0],e[1],e[2]),N.set(e[4],e[5],e[6]),F.set(e[8],e[9],e[10])}function Z(){let t=Math.max(L.lengthSq(),N.lengthSq(),F.lengthSq());L.lengthSq()>H*t?j.copy(L).normalize():j.set(1,0,0),k.crossVectors(F,j),k.lengthSq()<=H*t&&(k.copy(N).addScaledVector(j,-N.dot(j)),k.lengthSq()<=H*t&&function(t,e){t.set(1,0,0).cross(e),t.lengthSq()<=H&&t.set(0,1,0).cross(e),t.normalize()}(k,j)),k.normalize(),q.crossVectors(j,k)}function Q(t){return X(t),Z(),G.makeBasis(j,k,q)}var Y,$=new g;(Y||(Y={})).is=function(t){return t&&t.__isSPEObject};var J=t=>class extends t{constructor(){super(...arguments),this.previousModelViewMatrix=new g,this.copyPreviousMatrix=!0,this.hiddenMatrix=new g,this.pivotMatrix=new g,this.matrixWorldRigid=new g,this.shearScale=new g,this.shearScaleInv=new g}get __isSPEObject(){return!0}getPhysicsLocalMatrix(t){return!!this.rigidBody?.isDynamic()&&(t.copy(this.matrixWorld),this.hasNonUniformScale&&t.multiply(this.shearScaleInv),this.parent&&t.premultiply($.copy(this.parent.matrixWorld).invert()),t.premultiply($.copy(this.hiddenMatrix).invert()),t.multiply($.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}updateMatrixWorld(t){this.matrixAutoUpdate&&this.updateMatrix(),(this.matrixWorldNeedsUpdate||t)&&(null===this.parent?this.matrixWorld.multiplyMatrices(this.hiddenMatrix,this.matrix):(this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.hiddenMatrix),this.matrixWorld.multiplyMatrices(this.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.multiplyMatrices(this.hiddenMatrix,this.matrix):(this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.hiddenMatrix),this.matrixWorld.multiplyMatrices(this.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)Y.is(i)&&i.traverseObject(t,e+1)}traverseObject(t,e=0){if(!0!==t(this,e))for(let i of this.children)Y.is(i)&&i.traverseObject(t,e+1)}updateMatrixWorldRigid(){this.hasNonUniformScale=function(t,e,i){return X(t),Z(),e.makeBasis(j,k,q),i.set(j.dot(L),j.dot(N),j.dot(F),0,k.dot(L),k.dot(N),k.dot(F),0,q.dot(L),q.dot(N),q.dot(F),0,0,0,0,1),function(){let t=L.length(),e=N.length(),i=F.length(),r=Math.max(t,e,i);if(r-t>K||r-e>K||r-i>K)return!0;let s=K*r*r;return Math.abs(L.dot(N))>s||Math.abs(L.dot(F))>s||Math.abs(N.dot(F))>s}()}(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 g).copy(this.matrixWorld).invert();return null!==t.parent&&(t.parent.updateWorldMatrix(!0,!1),i.multiply(t.parent.matrixWorld)),"hiddenMatrix"in t&&t.hiddenMatrix instanceof g?t.hiddenMatrix.premultiply(i):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.hasNonUniformScale=t.hasNonUniformScale,this}onAfterRender(t,e,i,r,s,a){this.copyPreviousMatrix&&this.previousModelViewMatrix.copy(this.modelViewMatrix)}},tt=class extends x{constructor(){super()}getPoints(t=12){let e,i=[],r=this.getCurveLengths(),s=r[r.length-1]/r.length;for(let a=0,n=this.curves;a<n.length;a++){let o=n[a],l=0===a?r[a]:r[a]-r[a-1],h=Math.ceil(t*l/s),p=o.getPoints(h);for(let t=0;t<p.length;t++){let r=p[t];e&&e.equals(r)||(i.push(r),e=r)}}return this.autoClose&&i.length>1&&!i[i.length-1].equals(i[0])&&i.push(i[0]),i}},et=.001,it=new f,rt=new f,st=new f,at=new f,nt=new f,ot=new f,lt=new f,ht=new f,pt=new f;function dt(t,e,i){return it.subVectors(e,t),rt.subVectors(e,i),it.cross(rt).length()<=et}var ct,ut=new WeakMap;function mt(t){let e=ut.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]],r=[new f(...e[0].data.position)];st.copy(r[0]);for(let t=0;t<e.length-1;t++)it.fromArray(e[t].data.position),rt.fromArray(e[t+1].data.position),nt.subVectors(it,st),lt.subVectors(it,rt),nt.cross(lt).length()>et&&(i.push(e[t]),r.push((new f).copy(it)),st.copy(it));let s=e[e.length-1];i.push(s),r.push(new f(...s.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(dt(r[t],h[t],r[e])&&dt(r[t],l[e],r[e]))}let d=[];for(let t=0;t<o;t++){let e=i[t].data,s=r[t],n={position:s,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(r[c],s).normalize(),y=(new f).subVectors(r[u],s).normalize();n.prevDir=m,n.nextDir=y;let g=p[a&&0===t?o-1:t-1],v=p[t];if(g&&v){at.addVectors(m,y).normalize();let t=st.crossVectors(at,m).length()/m.dot(at);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],r=d[e];if(0!==i.removedLength||0!==r.removedLength){let t=i.position.distanceTo(r.position);i.removedLength=Math.min(i.removedLength,t/2),r.removedLength=Math.min(r.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],r=d[e],s=null;if(p[t]){let t=i.position.clone(),e=r.position.clone();(0!==i.removedLength||0!==r.removedLength)&&(i.nextDir&&t.add(st.copy(i.nextDir).setLength(i.removedLength)),r.prevDir&&e.add(st.copy(r.prevDir).setLength(r.removedLength))),t.distanceTo(e)>et&&(s=new y(t,t.clone().lerp(e,.3),e.clone().lerp(t,.3),e))}else i.position.distanceTo(r.position)>et&&(s=new y(i.position,i.controlNext,r.controlPrevious,r.position));c[2*t+1]=s}for(let t=0;t<o;t++){let e=d[t];if(0===e.removedLength)continue;let i=e.position,r=e.prevDir.clone().multiplyScalar(e.removedLength).add(i),s=e.nextDir.clone().multiplyScalar(e.removedLength).add(i),a=e.tan*e.removedLength;at.addVectors(e.prevDir,e.nextDir).normalize(),nt.copy(r).lerp(s,.5);let n=r.distanceTo(s)/2;pt.copy(at).multiplyScalar(Math.sqrt(Math.pow(a,2)-Math.pow(n,2))).add(nt),ot.copy(at).multiplyScalar(-a).add(pt);let o=i.distanceTo(ot)/i.distanceTo(nt);lt.copy(e.prevDir).multiplyScalar(o*i.distanceTo(r)).add(i),ht.copy(lt).lerp(ot,2);let l=r.clone().lerp(lt,4/3),h=s.clone().lerp(ht,4/3);c[2*t]=new y(r,l,h,s)}let u=new tt;for(let t=0;t<c.length;t++){let e=c[t];e&&u.add(e)}return u}(t);return ut.set(t.points,{isClosed:t.isClosed,curve:i}),i}(ct||(ct={})).is=function(t){return t&&t.__isEntity};var ft=t=>ct.is(t),yt={type:"completeState",isfromEntity:!0},gt=["x","y","z"],vt=new f,xt=new f(1,1,1),St=new m,wt=new v,Mt=(new f).set(0,1,0),bt=new g,Bt=new g,Pt=c=>class extends(J(c)){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.currentTransitionEvent=null,this.previousAction=null,this._singleBBox=new I,this._recursiveBBox=new I,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(ct.is(e))return e}entityChildrenCount(){let t=this.children.length;for(;t--;)if(ct.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(!ct.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=h.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=>{ft(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(ct.is(e[i]))return e[i];if(ct.is(t))return t.traverseSortNextHelper()}}sortNext(){let t=this.children;return this.children.length>0&&ct.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)ft(e)&&t(e)}traverseEntityAncestors(t){this.traverseAncestors(e=>{ct.is(e)&&t(e)})}traverseConcreteEntity(t,e=0){if(!0!==t(this,e))for(let i of this.children)ft(i)&&i.isConcreteEntity&&i.traverseEntity(t,e+1)}traverseEntity(t,e=0){if(!0!==t(this,e))for(let i of this.children)ft(i)&&i.traverseEntity(t,e+1)}traverseVisibleEntity(t){t(this);for(let e of this.children)ft(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.hiddenMatrix.copy(t.hiddenMatrix),this}hasEntityChild(){return this.children.some(t=>ft(t))}isAncestorOf(t){if(this.uuid===t)return!1;let e=!1;return this.traverseEntity(i=>{i.uuid===t&&(e=!0)}),e}toObjectTransformState(t=[]){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(),hiddenMatrix:this.hiddenMatrix.toArray(),pivot:[0,0,0],pivotRotation:[0,0,0]};return e(i,t)}getTransformValues(t,e,i){return e[t].map((e,r)=>i?.shared.getVariable(e,[this.uuid,t,gt[r]])??e)}updateTransformState(t,e){let i=!1;if(t.position&&(this.position.fromArray(this.getTransformValues("position",t,e)),i=!0),t.rotation&&(vt.fromArray(this.getTransformValues("rotation",t,e)).multiplyScalar(u.DEG2RAD),this.rotation.setFromVector3(vt),i=!0),t.scale&&(this.scale.fromArray(this.getTransformValues("scale",t,e)),i=!0),void 0!==t.hiddenMatrix&&(i=!0,this.hiddenMatrix.fromArray(t.hiddenMatrix??s.identity)),void 0!==t.pivot||void 0!==t.pivotRotation)if(i=!0,void 0!==t.pivot&&void 0!==t.pivotRotation)this.pivotMatrix.compose(vt.fromArray(t.pivot).negate(),St.setFromEuler(wt.fromArray(t.pivotRotation.map(t=>t*u.DEG2RAD))).invert(),xt);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=vt.setFromMatrixPosition(this.pivotMatrix);St.setFromEuler(wt.fromArray(t.pivotRotation.map(t=>t*u.DEG2RAD))).invert(),this.pivotMatrix.compose(e,St,xt)}return i&&(this.updateMatrix(),this.resetBBoxNeedsUpdate(),this.invalidateClonerTransform(this),this.traverseEntityAncestors(t=>{t.invalidateClonerTransform(this)})),t.position&&t.rotation&&t.scale&&void 0!==t.hiddenMatrix&&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)ct.is(t)&&t.disposeRecursively()}disposeRecursively(){this.dispose(),this.children.forEach(t=>{ct.is(t)&&t.disposeRecursively()})}toState(t=[]){let i={name:this.name,visible:this.visible,raycastLock:this.raycastLock,...this.toObjectTransformState(t)};return e(i,t)}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 h=t,c=O(t.path,["states","*"]);if(null!==c){if(0===t.type){let[e]=c;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 r=d.zoom(i,t.path.slice(2));if(r)for(let i in t.props)void 0===t.props[i]&&i in r&&(e[i]=r[i])}}h={...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=d.removeOverridden(t.path,t.props,e);h={...t,props:i}}}if(this.updateByPatchedOpBase(h,n.patch(this.data,this.stateSelection?this.data.states.data(this.stateSelection):void 0),i),O(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(l.apply(r.component.data,r.overrideData),i))}}else{let n=i.scene.findInstance([this.uuid,...s]);if(n){let o=d.zoom(n.component.data,a);if(0===(t={...t,path:a}).type){let e=t.props;if(o)for(let[i,r]of Object.entries(t.props))void 0===r&&(e===t.props&&(e={...t.props}),e[i]=o[i]);t={...t,props:e}}n.overrideData=r.resolve(e.overrides,s),n.updateByOp(t,p.applySimple(n.data,t),i,!1)}}}else if(this.instances.length>0){let r;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&&(r={...t,props:e})}else for(let e of a.rootOverrideProps)if(O(t.path,[e])){r=t;break}void 0!==r&&this.instances.forEach(t=>{if(t.isInstanceRoot){let e=l.filterOp(t.overrideData,r);e&&t.updateByOp(e,p.applySimple(t.data,e),i,!0)}}),this.instances.forEach(r=>{if(!r.isInstanceRoot){let s=l.filterOp(r.overrideData,t);if(s){let a;a=o===r.data&&t===s?e:p.applySimple(r.data,s),r.updateByOp(s,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)&&C.changeEntityProptotype(this,e,i);else if(1===t.path.length&&"geometry"===t.path[0]&&0===t.type&&"type"in t.props){C.changeEntityProptotype(this,e,i);for(let t of this.children)ct.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 r=e.morphTargetInfluences.get(t.path[1])?.data.name;r&&this.updateMorphInfluences(r,i.shared.getVariable(t.props.value,[this.uuid,"morphTargetInfluences",r]))}if(null!==O(t.path,["pathSnapping"])&&this.updatePathSnapping(e.pathSnapping),null!==O(t.path,["cloner"])){let r=p.drop(t,1);0===r.path.length&&0===r.type&&!0===r.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,r=this._updatedPathSnapping?.offset??this.dataPatched.pathSnapping.offset??0,s=this._updatedPathSnapping?.orientation??this.dataPatched.pathSnapping.orientation;if(null===e)return;let a=t.find(e);if(!a)return;this._needApplyPathSnapping=!1;let n=a.data;if(n.geometry.path.points.length<=1)return;let o=mt(n.geometry.path),l=(i+r)%1;i+r===1&&0===l&&(l=1);let h=null;try{h=o.curves.length?o.getPointAt(l):null}catch(t){}if(null===h)return;a.updateMatrixWorld();let p=this.parent?bt.copy(this.parent.matrixWorld).invert():bt.identity();p.multiply(a.matrixWorld),h.applyMatrix4(p);let d={position:h.toArray(),rotation:n.rotation};if("tangential"===s){let t=Bt.extractRotation(a.matrixWorld),e=o.getTangentAt(l).applyMatrix4(t).add(h),i=Bt.lookAt(h,e,Mt),r=vt.setFromEuler(wt.setFromRotationMatrix(i)).multiplyScalar(u.RAD2DEG);d={...d,rotation:r.toArray()}}this.updateTransformState(d),this.traverseEntity(t=>{t._cameraType&&t.dispatchEvent(yt)})}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(e=>t(e)&&"toObject"===e.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===C.Cloner)return void i("cloners","a cloner");this.cloner=new C.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"})}},Et=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),r=Math.abs(i.width),s=Math.abs(i.height??r),a=Math.abs(i.depth??r),n=Math.abs(Math.min(r,a))/2;return{parameters:Object.assign(i,{width:r,height:s,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:r,radius:s,revolutions:a,segments:n,pathRadius:o,pathType:l,pathSegments:h,cornerRadius:p,cornerSegments:d}=t.parameters,c=new Vt(!1,e,i,r,s,a,n,o,l,h,p,d);return Object.assign(c,{userData:{...t,type:"HelixGeometry"}})}},At=new c([0,0,0],1);function Ct(t){return"TorusGeometry"===t.type&&360===t.arc}var Dt,Ot,Vt=class extends P{constructor(t=!0,e=1,i=1,r=1,s=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,g,v,x,S,w,M=()=>new f,B=new f,P=M(),E=M(),A=M(),C=M(),D=M(),O=M(),V=M(),W=M(),_=M(),T=M(),U=M(),R=i-2*o+.001,z=R/a,I=Math.ceil(n*a),L=I+1,N=R/I,F=-R/2,j=h+1,k=2*Math.PI/h,q=Math.PI/2/d,G=Math.min((1-p/100)*o,o-.01),H=o-G,K=0,X=2*d+2,Z=j*X/2,Q=Z+j*L,Y=Math.max(0,j*(L+X)),[$,J,tt]=[3,3,2].map(t=>Array(Y*t).fill(0)),et=[],it=s-o;function rt(e,i){let r=Math.PI/2;x=i*N,w=2*Math.PI*(x%z)/z+r,x+=F,S=Math.sin(w)*it,v=Math.cos(w)*it,t?e.set(v,S,x):e.set(v,x,S)}rt(B,-1e-10),rt(P,0),C.copy(B),rt(B,1);let st=B.distanceTo(P),at=c?0:H+G,nt=st*I+2*at,ot=G,lt=nt-at;for(let e=0;e<=I;e++){rt(E,e),U.subVectors(E,C).normalize(),C.copy(E),_.copy(E).setComponent(+t+1,0).normalize(),T.crossVectors(U,_).normalize();let i=0===e,r=e===I,s=i?3*Math.PI/2:q,a=i?ot:lt,n=i?j:Q,l=i?0:Y-j,p=U.clone().multiplyScalar(i?-H:H).add(E),u=U.clone().multiplyScalar(i?-1:1).normalize();for(let t=0;t<j;t++){let m=t*k;if(D.addVectors(B.copy(_).multiplyScalar(o*Math.cos(m)),P.copy(T).multiplyScalar(o*Math.sin(m))),O.copy(D).normalize(),i||r){c||(K=l+t,[0,1,2].forEach(t=>{$[3*K+t]=p.getComponent(t),J[3*K+t]=u.getComponent(t)}),tt[2*K]=+r,tt[2*K+1]=t/h),P.copy(O).multiplyScalar(G),A.addVectors(E,P);for(let e=0;e<d;e++){let r=e*q+s;V.addVectors(B.copy(U).multiplyScalar(H*Math.sin(r)),P.copy(O).multiplyScalar(H*Math.cos(r))),W.copy(V).normalize(),P.addVectors(A,V),V.normalize(),K=n+e*j+t,[0,1,2].forEach(t=>{$[3*K+t]=P.getComponent(t),J[3*K+t]=W.getComponent(t)});let o=+i+Math.sin(r);tt[2*K]=(a+H*o)/nt,tt[2*K+1]=t/h}}P.addVectors(E,D),K=Z+e*j+t,[0,1,2].forEach(t=>{$[3*K+t]=P.getComponent(t),J[3*K+t]=O.getComponent(t)}),tt[2*K]=(at+e*st)/nt,tt[2*K+1]=t/h}}let ht=L+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<j-1;i++)u=t*j+i,m=u+1,y=(e?i:u)+j,g=(e?i+1:m)+j,0===t?et.push(m,g,y):t===ht-2?et.push(u,m,y):et.push(u,m,y,m,g,y)}this.setIndex(et),this.setAttribute("position",new b($,3)),this.setAttribute("normal",new b(J,3)),this.setAttribute("uv",new b(tt,2))}getClosedTorusIndicesForBooleanOrSubdiv(){let t,e,i,r,s=this.userData.parameters,a=Math.ceil(s.tubularSegments),n=s.radialSegments,o=n+1,l=[];for(let s=1;s<a;s++)for(let a=0;a<n;a++)t=s*o+a,e=t+1,i=t+o,r=e+o,l.push(t,e,i,e,r,i);for(let s=0;s<n;s++)t=a*o+s,e=t+1,i=s+o,r=s+1+o,l.push(t,e,i,e,r,i);return At.array=new Uint32Array(l),At.count=l.length,At}},Wt=new Map,_t=0;function Tt(t){return Ot||(Ot=async function(){let e=t??"https://cdn.spline.design/@splinetool/runtime@2.0.10/build",i=import("./boolean.js"),[r,s]=await Promise.all([i,fetch(`${e}/boolean.wasm`).then(t=>t.arrayBuffer())]);await r.default({module_or_path:s}),Dt=r}())}function Ut(){if(void 0===Dt)throw new Error("boolean-wasm is not loaded");return Dt}function Rt(t){let e=Wt.get(t);if(void 0===e)throw new Error("Unknown csg mesh set handle "+t);return e}function zt(t){return Wt.set(++_t,t),_t}var It={0:0,1:1,2:2};function Lt(t,e,i){if(void 0===Dt)return-1;let{positions:r,indices:s,normals:a}=function(t,e){if(e&&void 0!==t.userData.positions){let e=t.userData,i=[];for(let t=0,r=0;t<e.verticesPerFace.length;t++){let s=e.verticesPerFace[t];for(let t=1;t<s-1;t++)i.push(e.indices[r],e.indices[r+t],e.indices[r+t+1]);r+=s}return{positions:e.positions instanceof Float32Array?e.positions:new Float32Array(e.positions),indices:new Uint32Array(i)}}let i;i=Ct(t.userData.parameters)?t.getClosedTorusIndicesForBooleanOrSubdiv():t.getIndex();let r,s=t.getAttribute("position");if(null===i){r=new Uint32Array(s.count);for(let t=0;t<r.length;t++)r[t]=t}else r=i.array instanceof Uint32Array?i.array:new Uint32Array(i.array);let a=t.getAttribute("normal"),n=void 0!==a&&3===a.itemSize&&a.count===s.count&&a.array instanceof Float32Array&&!0!==a.isInterleavedBufferAttribute?a.array:void 0;return{positions:s.array,indices:r,normals:n}}(t,e);return zt(new Dt.CsgMesh(r,s,a))}function Nt(t,e){let i=Ut(),r=It[e];if(void 0===r)throw new Error("Unknown boolean operation "+e);let s=t.map(Rt);if(1===s.length)return i.clone_mesh(s[0]);let a,n=[];if(2===e&&s.length>2){let t=s[0];for(let e=1;e<s.length-1;e++)t=i.boolean_mesh(t,s[e],0),n.push(t);a=i.boolean_mesh(s[s.length-1],t,2)}else if(2===e)a=i.boolean_mesh(s[1],s[0],2);else{let t=s[s.length-1];for(let e=0;e<s.length-1&&(t=i.boolean_mesh(t,s[e],r),n.push(t),0!==t.tri_count());e++);a=t,n.pop()}for(let t of n)t.free();return a}function Ft(t,e,i,r){let s=Ut(),a=Nt(t,e),n=s.mesh_render_data(a,Math.max(r,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 B),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 zt(a)}function jt(t,e){let i=Ut(),r=Nt(t,e),s=i.mesh_topological_data(r),a=s.positions(),n=s.indices();return s.free(),r.free(),{positions:a,indices:n,verticesPerFace:new Uint8Array(n.length/3).fill(3)}}function kt(t,e){Rt(t).transform(new Float32Array(e.elements))}function qt(t){let e=Wt.get(t);void 0!==e&&(e.free(),Wt.delete(t))}function Gt(t,e){return zt(Ut().instanced_union(Rt(t),e))}function Ht(t){return null!==t&&"booleanOp"in t}var Kt=class extends(Pt(A)){constructor(){super(...arguments),this.booleanMeshSetAddress=-1,this.booleanWasTransformed=!1,this.booleanMatrixInvOld=new g}updateVisible(t){super.updateVisible(t),this.visible=!Ht(this.parent)&&this.visible,Ht(this.parent)&&this.parent.invalidateDownstreamBooleanData()}onClonerLayoutUpdated(){Ht(this.parent)&&this.invalidateDownstreamBooleanData()}freeBooleanPointer(){-1!==this.booleanMeshSetAddress&&(qt(this.booleanMeshSetAddress),this.booleanMeshSetAddress=-1)}invalidateDownstreamBooleanData(t=!1){return t?this.booleanWasTransformed=!0:this.freeBooleanPointer(),Ht(this.parent)?this.parent.invalidateDownstreamBooleanData():this}invalidateUpstreamBooleanData(){this.freeBooleanPointer();for(let t of this.children)t instanceof Kt&&(t.freeBooleanPointer(),Ht(t)&&t.invalidateUpstreamBooleanData())}updateTransformState(t,e){let i=super.updateTransformState(t,e);return i&&Ht(this.parent)&&this.invalidateDownstreamBooleanData(!0),i}onVariableUpdate(t=!1){super.onVariableUpdate(t),Ht(this.parent)&&this.invalidateDownstreamBooleanData(!0)}},Xt=new M;function Zt(t,e=0,i=t.count,r,s){let a=1/0,n=1/0,o=1/0,l=-1/0,h=-1/0,p=-1/0;for(let r=e;r<i;r++){let e=t.getX(r),i=t.getY(r),s=t.getZ(r);e<a&&(a=e),i<n&&(n=i),s<o&&(o=s),e>l&&(l=e),i>h&&(h=i),s>p&&(p=s)}Xt.min.set(a,n,o),Xt.max.set(l,h,p),Xt.getCenter(r),Xt.getSize(s).multiplyScalar(.5)}var Qt=new P,Yt=new E,$t=class extends Kt{constructor(t,e){super(Qt,Yt),this.super_Entity(t,e)}updateState(t,e){this.updateState_Entity(t,e)}raycast(t,e){super.raycast(t,e)}updateEntityBoxSize(t,e){let i=this.geometry.getAttribute("position");void 0!==i?Zt(i,this.geometry.drawRange.start,this.geometry.drawRange.count<1/0?this.geometry.drawRange.count:i.count,t,e):super.updateEntityBoxSize(t,e)}};export{D as a,O as b,C as c,Q as d,Y as e,J as f,mt as g,ct as h,ft as i,Pt as j,Et as k,Ct as l,Vt as m,Tt as n,Lt as o,Ft as p,jt as q,kt as r,qt as s,Gt as t,Zt as u,$t as v};
|
|
Binary file
|
|
Binary file
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as t}from"./runtime-chunk-
|
|
1
|
+
import{a as t}from"./runtime-chunk-QSJVWNNM.js";import{d as e}from"./runtime-chunk-VNO2DW74.js";import{Sc as s}from"./runtime-chunk-VGN7YHB7.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 �w?�]���)����J�}�k`�,)����[y��Yph�3�-�.@��:�R�C[��5�
|
|
Binary file
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as t,b as e}from"./runtime-chunk-
|
|
1
|
+
import{a as t,b as e}from"./runtime-chunk-VNO2DW74.js";import{Ec as s,Fc as r,Sc as a,Xe as i}from"./runtime-chunk-VGN7YHB7.js";var o=new r(1,1,1),m=new r,d=new r,u=new s,c=class extends(t(i)){constructor(t,e=15){super(e),this.object=t,this.dummy=new a,this.object.updateMatrixWorld(),this.name=`EmptyObjectHelper: ${t.uuid}`,this.matrix=this.dummy.matrixWorld,this.matrixAutoUpdate=!1,this.object.isBone&&(this.visible=!1)}raycast(t,s){e(this.object,c.geometryHelper,t,s,!1,this.dummy)}update(){}updateMatrix(){}updateMatrixWorld(t){this.object.matrixWorld.decompose(m,u,d),this.matrix.compose(m,u,o),super.updateMatrixWorld(t)}updateWorldMatrix(t,e){}};export{c as a};
|
|
Binary file
|
|
Binary file
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{d as t}from"./runtime-chunk-
|
|
1
|
+
import{d as t}from"./runtime-chunk-ZASM3KKC.js";import{a as s,b as a}from"./runtime-chunk-VNO2DW74.js";import{Be as e,Cc as i,Ec as o,Fc as h,Se as r,Ue as d,Ve as n,ye as c}from"./runtime-chunk-VGN7YHB7.js";var l=class extends(s(d)){constructor(t,s=15,a=10066329){super(t,s,a),this.object=t,this.added=!1,this.name=`DirectionalLightHelper: ${t.uuid}`}raycast(t,s){a(this.object,l.geometryHelper,t,s)}},p=class extends(t(e,l)){constructor(t,s,a){super(),this.super_Entity(t,s),this.castShadow=!0,this.shadow.mapSize.width=2048,this.shadow.mapSize.height=2048,this.shadow.normalBias=1,this.layers.enable(3);let e=this.shadow.camera;e.top=1250,e.bottom=-1250,e.right=1250,e.left=-1250,e.near=-1e4,e.far=2500;let i=new n(this.shadow.camera);i.visible=!1,this.gizmos.shadowmap=i}update(){this.shadow.camera.updateProjectionMatrix();for(let t in this.gizmos){let s=this.gizmos[t];s instanceof n&&s.update()}}updateMatrixWorld(t){super.updateMatrixWorld(t),this.objectHelper&&this.objectHelper.update()}updateState(t,s){this.updateState_Light(t,s);let a=void 0!==t.depth&&t.depth!==this.shadow.camera.far||void 0!==t.size&&t.size/2!==this.shadow.camera.right;void 0!==t.size&&function(t,s){t.shadow.camera.right=s/2,t.shadow.camera.left=-s/2,t.shadow.camera.top=s/2,t.shadow.camera.bottom=-s/2,t.shadow.needsUpdate=!0}(this,t.size),void 0!==t.shadowRadius&&(this.shadow.radius=t.shadowRadius),void 0!==t.shadowResolution&&(this.shadow.mapSize.set(t.shadowResolution,t.shadowResolution),this.shadow.map&&(this.shadow.map.dispose(),this.shadow.map=null)),void 0!==t.penumbraSize&&s.scene.markPenumbraSizeDirty(),a&&this.update()}},m=class extends(s(r)){constructor(t,s=6710886){super(t,s),this.object=t,this.matrix=t.matrixWorld,this.name=`SpotLightHelper: ${t.uuid}`}raycast(t,s){a(this.object,m.geometryHelper,t,s)}update(){if(void 0!==this.object){let t=m._vector,s=this.object.distance?this.object.distance:1e3,a=s*Math.tan(this.object.angle);this.cone.scale.set(a,a,s),t.setFromMatrixPosition(this.object.target.matrixWorld),this.cone.lookAt(t);let e=void 0!==this.color?this.color:this.light.color;if(this.cone.material instanceof Array)for(let t=0,s=this.cone.material.length;t<s;t++)this.cone.material[t].color.set(e);else this.cone.material.color.set(e)}}},u=m;u._vector=new h;var w=new h,b=new h,g=new o,v=class extends(t(c,u)){constructor(t,s,a){super(),this.super_Entity(t,s),this.castShadow=!0,this.shadow.mapSize.width=1024,this.shadow.mapSize.height=1024,this.shadow.normalBias=1,this.layers.enable(3);let e=this.shadow.camera;e.fov=2*i.RAD2DEG*this.angle,e.aspect=1,e.near=100,e.far=2500;let o=new n(this.shadow.camera);o.visible=!1,this.gizmos.shadowmap=o,this.update()}update(){this.shadow.camera.updateProjectionMatrix();for(let t in this.gizmos){let s=this.gizmos[t];s instanceof n&&s.update()}}updateMatrixWorld(t){super.updateMatrixWorld(t),b.setFromMatrixPosition(this.matrixWorld),g.setFromRotationMatrix(this.matrixWorld),w.copy(this.up).applyQuaternion(g).negate().multiplyScalar(this.distance),this.target.position.copy(b).add(w),this.target.updateMatrixWorld(),this.objectHelper&&this.objectHelper.update()}updateState(t,s){this.updateState_Light(t,s),void 0!==t.distance&&(this.distance=t.distance),void 0!==t.decay&&(this.decay=t.decay),void 0!==t.angle&&(this.angle=t.angle),void 0!==t.penumbra&&(this.penumbra=t.penumbra),void 0!==t.shadowRadius&&(this.shadow.radius=t.shadowRadius),void 0!==t.penumbraSize&&s.scene.markPenumbraSizeDirty(),void 0!==t.shadowResolution&&(this.shadow.mapSize.set(t.shadowResolution,t.shadowResolution),this.shadow.map&&(this.shadow.map.dispose(),this.shadow.map=null))}};export{p as a,v as b};
|
|
Binary file
|
|
Binary file
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as t}from"./runtime-chunk-GZ7C2GJM.js";import{a as e}from"./runtime-chunk-RLYG5YBB.js";import{$ as i,ea as a}from"./runtime-chunk-DK66VKWP.js";import{e as n,h as s}from"./runtime-chunk-CKT62HES.js";import{a as r}from"./runtime-chunk-2PT2WH66.js";import{Aa as o,Dc as l,Ec as h,Fc as p,Ja as d,Jc as c,Lc as f,Ma as u,Oc as v,Qe as m,Vc as x,Vd as y,Zc as g,ce as S,dd as b,de as T,ld as P,na as _,nc as z,nd as w,we as R}from"./runtime-chunk-VGN7YHB7.js";var O=new b;O.setAttribute("position",new g(new Float32Array([-1,-1,0,3,-1,0,-1,3,0]),3));var L=class extends T{constructor(t){super({...t,depthTest:!1,depthWrite:!1,glslVersion:z,vertexShader:"\n\t\t\t\tprecision highp float;\n\t\t\t\tin vec3 position;\n\t\t\t\tvoid main() {\n\t\t\t\t\tgl_Position = vec4(position, 1);\n\t\t\t\t}\n\t\t\t"})}customProgramCacheKey(){return""}};function k(){return{shapeInput:()=>"\n\t\t\tconst float posRowCoord = 0.1; \n\t\t\tconst float quatRowCoord = 0.3; \n\t\t\tconst float param1RowCoord = 0.5;\n\t\t\tconst float param2RowCoord = 0.7;\n\t\t\tconst float colorRowCoord = 0.9; \n\t\t\tuniform sampler2D shapesDataTexture;\n\t\t\tvec4 shapePos(float iin) { \n\t\t\t\tvec4 r = texture(shapesDataTexture, vec2(iin, posRowCoord));\n\t\t\t\treturn r;\n\t\t\t}\n\t\t\tvec4 shapeQuat(float iin) {\n\t\t\t\tvec4 r = texture(shapesDataTexture, vec2(iin, quatRowCoord));\n\t\t\t\treturn r;\n\t\t\t}\n\t\t\tvec4 shapeParams1(float iin) {\n\t\t\t\tvec4 r = texture(shapesDataTexture, vec2(iin, param1RowCoord));\n\t\t\t\treturn r;\n\t\t\t}\n\t\t\tvec4 shapeParams2(float iin) {\n\t\t\t\tvec4 r = texture(shapesDataTexture, vec2(iin, param2RowCoord));\n\t\t\t\treturn r;\n\t\t\t}\n\t\t\tvec4 shapeColor(float iin) {\n\t\t\t\tvec4 r = texture(shapesDataTexture, vec2(iin, colorRowCoord));\n\t\t\t\treturn r;\n\t\t\t}\n\t\t",getxyzi:"\n\t\t\t// this code must complement lookup\n\t\t\tfloat xi = mod(gl_FragCoord.x - 0.5, VOXEL_RESOLUTION);\n\t\t\tfloat yi = mod(gl_FragCoord.y - 0.5, VOXEL_RESOLUTION);\n\t\t\tfloat zi = floor((gl_FragCoord.x - 0.5) * INV_VOXEL_RESOLUTION) + floor((gl_FragCoord.y - 0.5) * INV_VOXEL_RESOLUTION) * Z_LAYERS_PER_ROW;\n\t\t",lookup:"\n\t\t\tuniform sampler2D potentialPassTexture;\n\t\t\tuniform sampler2D voxelPassTexture; \n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\tvec4 look(float xi, float yi, float zi, sampler2D rt) {\n\t\t\t\tvec2 uv = vec2(\n\t\t\t\t\tmod(zi, Z_LAYERS_PER_ROW) + (xi + 0.5) / VOXEL_RESOLUTION,\n\t\t\t\t\tfloor(zi / Z_LAYERS_PER_ROW) + (yi + 0.5) / VOXEL_RESOLUTION\n\t\t\t\t); \n\t\t\t\tuv /= Z_LAYERS_PER_ROW;\n\t\t\t\treturn texture(rt, uv);\n\t\t\t}\n\t\t",getpart:"\n\t\t\tfloat getpart(inout float a, float b) {\n\t\t\t\tfloat t = floor(a/b);\n\t\t\t\tfloat r = a - t*b;\n\t\t\t\ta = t;\n\t\t\t\treturn r;\n\t\t\t}\n\t\t",triTable:new Float32Array([-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,3,8,0,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,9,1,0,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,3,8,1,1,8,9,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,10,2,1,-1,-1,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,8,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,11,2,3,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,8,3,2,10,8,2,9,8,10,-1,-1,-1,-1,-1,-1,-1,2,10,9,2,9,0,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,8,3,2,10,8,2,8,1,0,8,10,1,-1,-1,-1,-1,2,10,1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,8,3,1,8,1,9,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,1,9,0,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,8,3,0,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1]),numTrisTable:new Float32Array([0,1,1,2,1,2,2,3,1,2,2,3,2,3,3,2,1,2,2,3,2,3,3,4,2,3,3,4,3,4,4,3,1,2,2,3,2,3,3,4,2,3,3,4,3,4,4,3,2,3,3,2,3,4,4,3,3,4,4,3,4,5,5,2,1,2,2,3,2,3,3,4,2,3,3,4,3,4,4,3,2,3,3,4,3,4,4,5,3,4,4,5,4,5,5,4,2,3,3,4,3,4,2,3,3,4,4,5,4,5,3,2,3,4,4,3,4,5,3,2,4,5,5,4,5,2,4,1,1,2,2,3,2,3,3,4,2,3,3,4,3,4,4,3,2,3,3,4,3,4,4,5,3,2,4,3,4,3,5,2,2,3,3,4,3,4,4,5,3,4,4,5,4,5,5,4,3,4,4,3,4,5,5,4,4,3,5,2,5,4,2,1,2,3,3,4,3,4,4,5,3,4,4,5,2,3,3,2,3,4,4,5,4,5,5,2,4,3,5,4,3,2,4,1,3,4,4,5,4,5,3,4,4,5,5,2,3,4,2,1,2,3,3,2,3,4,2,1,3,2,4,1,2,1,1,0])}}var D=new R,E=null;function U(t){E=t}function M(){return E}var C=null;function F(t){C=t}function N(){return C}var I=null;function V(t){I=t}function B(){return I}var X=k(),A=24,W=96,H=!1,q=!0;try{let t=new URLSearchParams(window.location.search);H="0"===t.get("dbgsbstatic"),q="0"!==t.get("sb512")}catch{}function K(t){let e=t.getAttribute("position");return void 0===e?-1:1048576*(e.version??e.data?.version??0)+(e.count??0)%1048576}var G=class extends a{constructor(t,e,i){super(t,e,i),this.data=e,this.isShapeBlendEntity=!0,this.needsRebuild=!0,this.customDepthMaterialNeedsUpdate=!1,this._prevShapeData=null,this._prevSpan=-1,this._reach=new Float32Array(96),this._prevReach=new Float32Array(96),this._fieldDirtyFull=!0,this._fieldDirtyMin=new p,this._fieldDirtyMax=new p,this._maxBlendK=0,this._meshSdfBaked=new Map,this._meshSdfWanted=new Map,this._passesRenderer=null,this._npart=-1,this.spatialn=1,this.drawRangeNeedsForceUpdate=!0,this._resolutionLevel=-1,this._authoredResolutionLevel=-1,this.ultraFieldResolution=0,this.resolution=64,this.spatialDivisions=25,this.zLayersPerRow=8,this.basePyramidSize=512,this.pyramidTexture1Width=341,this.pyramidTexture1Height=256,this.pyramidTexture2Width=170,this.pyramidTexture2Height=128,this.numLevels=9,this.pyramidLevelSizes=[1,2,4,8,16,32,64,128,256,512],this.bboxSize=0,this.bboxOffset=0,this.shapesDataTexture={value:void 0},this.spatialscene=new x,this.potentialPassScene=new x,this.voxelPassScene=new x,this._spatialPassRenderTargets=[],this._potentialPassRenderTargets=[],this._voxelPassRenderTargets=[],this._pyramidRenderTargets=[],this.geometry=new b,this.geometry.drawRange.count=0,this.spatialPassUniforms={span:{value:-1},shapesDataTexture:this.shapesDataTexture,npart:{value:this.npart},spatialn:{value:this.spatialn}},this.spatialMesh=new P(O,this.spatialPassMaterial()),this.spatialMesh.frustumCulled=!1,this.spatialscene.add(this.spatialMesh);let a=new w(X.triTable,16,256,u,o);a.needsUpdate=!0;let n=new w(X.numTrisTable,256,1,u,o);n.needsUpdate=!0,this.voxelPassUniforms={potentialPassTexture:{value:void 0},numTrisTable:{value:n}},this.voxelMesh=new P(O,this.voxelPassMaterial()),this.voxelMesh.frustumCulled=!1,this.voxelPassScene.add(this.voxelMesh),this.potentialPassUniforms={shapesDataTexture:this.shapesDataTexture,spatialPassTexture:{value:void 0},npart:{value:this.npart},spatialn:{value:this.spatialn}},this.potentialMesh=new P(O,this.potentialPassMaterial()),this.potentialMesh.frustumCulled=!1,this.potentialPassScene.add(this.potentialMesh),this.marchPassUniforms={triTable:{value:a},potentialPassTexture:{value:void 0},voxelPassTexture:{value:void 0},pyramidTexture1:{value:void 0},pyramidTexture1Size:{value:void 0},pyramidTexture2:{value:void 0},pyramidTexture2Size:{value:void 0}},this.frustumCulled=!1,this.onBeforeShadowPass=t=>{let e=at.call(this);if(0===this.npart)return void(this.geometry.drawRange.count=0);let i=this.material.root;if(i.shadersPatchedForShapeBlend){if(this.customDepthMaterialNeedsUpdate){this.customDepthMaterialNeedsUpdate=!1,this.customDepthMaterial=new S({vertexShader:i.vertexShader,fragmentShader:"\n\t\t\t\t\t\t#include <packing>\n\t\t\t\t\t\tvoid main()\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tgl_FragColor = packDepthToRGBA(gl_FragCoord.z);\n\t\t\t\t\t\t}\n\t\t\t\t\t",uniforms:i.uniforms,defines:this.material.defines}),this.isMeshDepthMaterial=!0,this.customDistanceMaterial=new S({vertexShader:i.vertexShader,fragmentShader:"\n\t\t\t\t\t#include <common>\n\t\t\t\t\t#include <packing>\n\t\t\t\t\tuniform vec3 referencePosition;\n\t\t\t\t\tuniform float nearDistance;\n\t\t\t\t\tuniform float farDistance;\n\t\t\t\t\t\n\t\t\t\t\tvarying vec3 vWPosition;\n\t\t\t\t\tvoid main()\n\t\t\t\t\t{\n\t\t\t\t\t\tfloat dist = length(vWPosition - referencePosition);\n\t\t\t\t\t\tdist = (dist - nearDistance) / (farDistance - nearDistance);\n\t\t\t\t\t\tdist = saturate(dist);\n\t\t\t\t\t\t\n\t\t\t\t\t\tgl_FragColor = packDepthToRGBA( dist );\n\t\t\t\t\t}",uniforms:{nearDistance:{value:0},farDistance:{value:0},referencePosition:{value:new p},opacity:{value:0},...i.uniforms},defines:this.material.defines});let t=this.customDistanceMaterial;t.referencePosition=new p,t.nearDistance=0,t.farDistance=0,t.opacity=1,t.isMeshDistanceMaterial=!0}}else this.patchVertexShaderForShapeBlend(i),i.shadersPatchedForShapeBlend=!0,this.customDepthMaterialNeedsUpdate=!0;this.spatialPassUniforms.npart.value=this.npart,this.spatialPassUniforms.spatialn.value=this.spatialn,this.potentialPassUniforms.npart.value=this.npart,this.potentialPassUniforms.spatialn.value=this.spatialn;let a=this.needsRebuild;if(this.needsRebuild){this.needsRebuild=!1,this.spatialMesh.material.defines.RES=this.resolutionLevel,this.spatialMesh.material.needsUpdate=!0,this.potentialMesh.material.defines.RES=this.resolutionLevel,this.potentialPassUniforms.spatialPassTexture.value=this.spatialPassRenderTarget.texture,this.potentialMesh.material.needsUpdate=!0,this.voxelMesh.material.defines.RES=this.resolutionLevel,this.voxelMesh.material.needsUpdate=!0,this.voxelPassUniforms.potentialPassTexture.value=this.potentialPassRenderTarget.texture,this.marchPassUniforms.potentialPassTexture.value=this.potentialPassRenderTarget.texture,this.marchPassUniforms.voxelPassTexture.value=this.voxelPassRenderTarget.textures[0],this.material.defines.RES=this.resolutionLevel,this.material.defines.LEVELS=this.pyramidLevelSizes.length,this.material.defines.LOOP=this.pyramidLevelSizes.length%2==0?this.pyramidLevelSizes.length-3:this.pyramidLevelSizes.length-2,this.material.defines.HALF=this.pyramidLevelSizes.length%2==0?1:0,this.material.needsUpdate=!0;let t=this.pyramidLevelSizes.length%2==0?0:1,e=this.pyramidLevelSizes.length%2==0?1:0;this.marchPassUniforms.pyramidTexture2.value=this.pyramidRenderTarget[t].texture,this.marchPassUniforms.pyramidTexture2Size.value=new l(this.pyramidRenderTarget[t].width,this.pyramidRenderTarget[t].height),this.marchPassUniforms.pyramidTexture1.value=this.pyramidRenderTarget[e].texture,this.marchPassUniforms.pyramidTexture1Size.value=new l(this.pyramidRenderTarget[e].width,this.pyramidRenderTarget[e].height),Object.assign(this.material.uniforms,this.marchPassUniforms)}if(!e&&!a&&!this.drawRangeNeedsForceUpdate&&this._passesRenderer===t)return;this._passesRenderer=t;let n=t.shadowMap.enabled;t.shadowMap.enabled=!1;let s=t.getRenderTarget();t.setRenderTarget(this.spatialPassRenderTarget),t.render(this.spatialscene,D),t.setRenderTarget(this.potentialPassRenderTarget),t.render(this.potentialPassScene,D),t.setRenderTarget(this.voxelPassRenderTarget),t.render(this.voxelPassScene,D),G.streamCompaction.renderPyramid(this.resolutionLevel,this.pyramidLevelSizes,t,this.voxelPassRenderTarget,this.pyramidRenderTarget).then(t=>{this.material.wireframe&&(3*t>this.geometry.attributes.position.count||this.drawRangeNeedsForceUpdate)&&(this.geometry.dispose(),this.geometry=new b,this.geometry.userData.parameters={width:this.bboxSize,height:this.bboxSize,depth:this.bboxSize,centerOffset:[this.bboxOffset,this.bboxOffset,this.bboxOffset]},this.geometry.attributes.position=new g(new Float32Array(3*t*2),3)),(3*t>this.geometry.drawRange.count||this.drawRangeNeedsForceUpdate)&&(this.geometry.drawRange.count=3*Math.floor(1.2*t),this.markSceneShadowsDirty()),this.drawRangeNeedsForceUpdate=!1}),t.shadowMap.enabled=n,t.setRenderTarget(s)}}markSceneShadowsDirty(){let t=this.parent;if(null!==t){for(;t.parent;)t=t.parent;t.markShadowsDirty?.()}}set npart(t){t!==this._npart&&(this.drawRangeNeedsForceUpdate=!0,this._npart=t,this.spatialn=Math.ceil(t/96))}get npart(){return this._npart}set resolutionLevel(t){let e=Math.min(q?9:8,Math.max(5,t));if(e===this._authoredResolutionLevel)return;this._authoredResolutionLevel=e,this.ultraFieldResolution=Math.pow(2,e);let i=Math.min(8,e);switch(this._resolutionLevel=i,this.resolution=Math.pow(2,i),this.resolutionLevel){case 5:this.pyramidLevelSizes=[1,2,4,6,12,24,48,96,192],this.bboxSize=496,this.bboxOffset=-8;break;case 6:this.pyramidLevelSizes=[1,2,4,8,16,32,64,128,256,512],this.bboxSize=504,this.bboxOffset=-4;break;case 7:this.pyramidLevelSizes=[1,2,4,6,12,24,48,96,192,384,768,1536],this.bboxSize=508,this.bboxOffset=-2;break;case 8:this.pyramidLevelSizes=[1,2,4,8,16,32,64,128,256,512,1024,2048,4096],this.bboxSize=510,this.bboxOffset=-1}this.pyramidTexture1Width=0,this.pyramidTexture2Width=0,this.pyramidTexture1Height=this.pyramidLevelSizes[this.pyramidLevelSizes.length-2],this.pyramidTexture2Height=this.pyramidLevelSizes[this.pyramidLevelSizes.length-3];for(let t=this.pyramidLevelSizes.length-2;t>=0;t--)(this.pyramidLevelSizes.length-2)%2==t%2?this.pyramidTexture1Width+=this.pyramidLevelSizes[t]:this.pyramidTexture2Width+=this.pyramidLevelSizes[t];this.basePyramidSize=this.pyramidLevelSizes[this.pyramidLevelSizes.length-1],this.zLayersPerRow=this.basePyramidSize/this.resolution,this.numLevels=this.pyramidLevelSizes.length-1,this.geometry.userData.parameters={width:this.bboxSize,height:this.bboxSize,depth:this.bboxSize,centerOffset:[this.bboxOffset,this.bboxOffset,this.bboxOffset]},this.needsRebuild=!0,this.customDepthMaterialNeedsUpdate=!0}get resolutionLevel(){return this._resolutionLevel}get spatialPassRenderTarget(){let t=this._spatialPassRenderTargets[this.resolutionLevel];return t||(t=new f(this.spatialDivisions*this.spatialn,this.spatialDivisions**2,{format:d,type:o,stencilBuffer:!1,depthBuffer:!1,generateMipmaps:!1,minFilter:_,magFilter:_}),this._spatialPassRenderTargets[this.resolutionLevel]=t),t}get potentialPassRenderTarget(){let t=this._potentialPassRenderTargets[this.resolutionLevel];return t||(t=new f(this.basePyramidSize,this.basePyramidSize,{format:d,type:o,stencilBuffer:!1,depthBuffer:!1,generateMipmaps:!1,minFilter:_,magFilter:_}),this._potentialPassRenderTargets[this.resolutionLevel]=t),t}get voxelPassRenderTarget(){let t=this._voxelPassRenderTargets[this.resolutionLevel];return t||(t=new f(this.basePyramidSize,this.basePyramidSize,{count:2,stencilBuffer:!1,depthBuffer:!1,generateMipmaps:!1,minFilter:_,magFilter:_}),t.textures[0].format=d,t.textures[0].type=o,t.textures[1].format=u,t.textures[1].type=o,this._voxelPassRenderTargets[this.resolutionLevel]=t),t}get pyramidRenderTarget(){let t=this._pyramidRenderTargets[this.resolutionLevel];return t||(t=[new f(this.pyramidTexture1Width,this.pyramidTexture1Height,{format:d,type:o,stencilBuffer:!1,depthBuffer:!1,magFilter:_,minFilter:_}),new f(this.pyramidTexture2Width,this.pyramidTexture2Height,{format:d,type:o,stencilBuffer:!1,depthBuffer:!1,magFilter:_,minFilter:_})],this._pyramidRenderTargets[this.resolutionLevel]=t),t}updateState(t,e){let i=this.material;super.updateState(t,e),i!==this.material&&(this.needsRebuild=!0),t.geometry&&(this.resolutionLevel=t.geometry.resolutionLevel,this.geometry.userData.parameters={width:this.bboxSize,height:this.bboxSize,depth:this.bboxSize,centerOffset:[this.bboxOffset,this.bboxOffset,this.bboxOffset]}),t.wireframe&&!this.geometry.getAttribute("position")?this.geometry.setAttribute("position",new g(new Float32Array(3*this.geometry.drawRange.count),3)):!t.wireframe&&this.geometry.getAttribute("position")&&this.geometry.deleteAttribute("position")}spatialPassMaterial(){let t=`\n\t\t\tprecision highp float;\n\t\t\tout vec4 pc_FragColor;\n\t\t\tconst float spatialDivisions = ${this.spatialDivisions}.;\n\t\t\tuniform float span;\n\t\t\tuniform float npart;\n\t\t\tuniform float spatialn;\n\t\t\t${X.shapeInput()}\n\n\t\t\tvec3 low, high; \n\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\tfloat spatialKey(float lowi) {\n\t\t\t\tfloat t = 0.;\n\t\t\t\tfor (float ii = 23.; ii >= 0.; ii--) {\n\t\t\t\t\tfloat i = ii + lowi;\n\t\t\t\t\tfloat iin = (i + 0.5) / 96.;\n\t\t\t\t\tvec4 shape = shapePos(iin);\n\t\t\t\t\tvec3 d = shape.xyz;\n\t\t\t\t\tfloat op = shape.w;\n\t\n\t\t\t\t\tt *= 2.;\n\t\t\t\t\tt += (\n\t\t\t\t\t\tlow.x < d.x && d.x < high.x &&\n\t\t\t\t\t\tlow.y < d.y && d.y < high.y &&\n\t\t\t\t\t\tlow.z < d.z && d.z < high.z &&\n\t\t\t\t\t\ti < npart || op == -2. \n\t\t\t\t\t) ? 1. : 0.;\n\t\t\t\t}\n\t\t\t\treturn t;\n\t\t\t}\n\n\t\t\t${X.getpart}\n\n\t\t\tvoid main() { \n\t\t\t\t\n\t\t\t\tvec3 div; \n\t\t\t\t\n\t\t\t\tfloat yz = float(gl_FragCoord.y - 0.5); \n\t\t\t\tdiv.y = getpart(yz, spatialDivisions);\n\t\t\t\tdiv.z = yz; \n\n\t\t\t\tfloat lx = float(gl_FragCoord.x - 0.5); \n\t\t\t\tfloat lowi = getpart(lx, spatialn) * 96.;\n\t\t\t\tdiv.x = lx;\n\n\t\t\t\tlow = div / spatialDivisions * 2. - 1. - span;\n\t\t\t\thigh = (div+1.) / spatialDivisions * 2. - 1. + span;\n\n\t\t\t\t\n\t\t\t\tpc_FragColor.x = spatialKey(lowi);\n\t\t\t\tpc_FragColor.y = spatialKey(lowi+24.);\n\t\t\t\tpc_FragColor.z = spatialKey(lowi+48.);\n\t\t\t\tpc_FragColor.w = spatialKey(lowi+72.);\n\t\t\t}\n\t\t`;return new L({name:"Spatial Pass",fragmentShader:t,uniforms:this.spatialPassUniforms})}potentialPassMaterial(){let t=`\n\t\t\tprecision highp float;\n\t\t\tout vec4 pc_FragColor;\n\n\t\t\t${X.shapeInput()}\n\t\t\tuniform sampler2D spatialPassTexture;\n\n\t\t\tconst float res = float(RES);\n\t\t\tconst float VOXEL_RESOLUTION = pow(2., res);\n\t\t\tconst float Z_LAYERS_PER_ROW = ceil(pow(2., res / 2.));\n\t\t\tconst float VOXEL_RESOLUTION_SUB1 = VOXEL_RESOLUTION - 1.;\n\t\t\tconst float INV_VOXEL_RESOLUTION = 1.0 / VOXEL_RESOLUTION;\n\n\t\t\tuniform float npart;\n\t\t\tuniform float spatialn;\n\t\t\tconst float spatialDivisions = ${this.spatialDivisions}.;\n\t\t\tconst float spatialDivisions2 = spatialDivisions * spatialDivisions;\n\t\t\tconst float spatialDivisionsSub1 = spatialDivisions - 1.;\n\n\t\t\t${X.getpart}\n\n\t\t\tvec3 packRGBAToVec3(vec4 color) {\n\t\t\t\tuint r = uint(color.r * 255.);\n\t\t\t\tuint g = uint(color.g * 255.);\n\t\t\t\tuint combined = (r << 8) | g; \n\t\t\t\treturn vec3(float(combined) * 0.00001525902, color.b, color.a); \n\t\t\t}\n\n\t\t\tvoid applyQuaternionToVector(in vec4 q, inout vec3 v) {\n\t\t\t\tv += 2.0 * cross(q.xyz, cross(q.xyz, v) + q.w * v);\n\t\t\t}\n\n\t\t\t\n\n\n\n\t\t\t\n\t\t\tfloat smoothOperation(float op, float sdf, float d, float k) {\n\t\t\t \n\t\t\t \n\t\t\t\t\n\n\t\t\t\tfloat signSubtract = clamp(op, -1., 1.);\n\t\t\t\tfloat signIntersection = 2. * (op - signSubtract) + 1.;\n\t\t\t\tfloat h = clamp(\n\t\t\t\t\t0.5 + signSubtract * 0.5 * (sdf - signSubtract * signIntersection * d) / k,\n\t\t\t\t\t0.0,\n\t\t\t\t\t1.0\n\t\t\t\t);\n\t\t\t\treturn mix(sdf, signSubtract * signIntersection * d, h) - \n\t\t\t\t\t\t\t signSubtract * k * h * (1.0 - h);\n\t\t\t}\n\n\t\t\tfloat sdSphere( vec3 p, float s )\n\t\t\t{\n\t\t\t\treturn length(p)-s;\n\t\t\t}\n\n\t\t\tfloat sdEllipsoid( vec3 p, vec3 r )\n\t\t\t{\n\t\t\t\tfloat k0 = length(p/r);\n\t\t\t\tfloat k1 = length(p/(r*r));\n\t\t\t\treturn k0*(k0-1.0)/k1;\n\t\t\t}\n\n\t\t\tfloat sdBox( vec3 p, vec3 b )\n\t\t\t{\n\t\t\t\tvec3 q = abs(p) - b;\n\t\t\t\treturn length(max(q,0.0)) + min(max(q.x,max(q.y,q.z)),0.0);\n\t\t\t}\n\n\t\t\tfloat sdTorus( vec3 p, vec2 t )\n\t\t\t{\n\t\t\t\tvec2 q = vec2(length(p.xy)-t.x,p.z);\n\t\t\t\treturn length(q)-t.y;\n\t\t\t}\n\n\t\t\tfloat sdCappedTorus( vec3 p, vec2 sc, float ra, float rb)\n\t\t\t{\n\t\t\t\tp.x = abs(p.x);\n\t\t\t\tfloat k = (sc.y*p.x>sc.x*p.y) ? dot(p.xy,sc) : length(p.xy);\n\t\t\t\treturn sqrt( dot(p,p) + ra*ra - 2.0*ra*k ) - rb;\n\t\t\t}\n\n\t\t\tfloat dot2( in vec2 v ) { return dot(v,v); }\n\t\t\tfloat sdCappedCone( vec3 p, float h, float r1, float r2 )\n\t\t\t{\n\t\t\t\tvec2 q = vec2( length(p.xz), p.y );\n\t\t\t\tvec2 k1 = vec2(r2,h);\n\t\t\t\tvec2 k2 = vec2(r2-r1,2.0*h);\n\t\t\t\tvec2 ca = vec2(q.x-min(q.x,(q.y<0.0)?r1:r2), abs(q.y)-h);\n\t\t\t\tvec2 cb = q - k1 + k2*clamp( dot(k1-q,k2)/dot2(k2), 0.0, 1.0 );\n\t\t\t\tfloat s = (cb.x<0.0 && ca.y<0.0) ? -1.0 : 1.0;\n\t\t\t\treturn s*sqrt( min(dot2(ca),dot2(cb)) );\n\t\t\t}\n\n\t\t\tfloat sdCappedCylinder( vec3 p, float h, float r )\n\t\t\t{\n\t\t\t\tvec2 d = abs(vec2(length(p.xz),p.y)) - vec2(r,h);\n\t\t\t\treturn min(max(d.x,d.y),0.0) + length(max(d,0.0));\n\t\t\t}\n\n\t\t\tfloat maxBlend = 0.0;\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\tvoid fillSpatialInner(\n\t\t\t\tfloat ii,\n\t\t\t\tfloat activeKey,\n\t\t\t\tvec3 corner,\n\t\t\t\tinout float sdf,\n\t\t\t\tinout float colorDivisor,\n\t\t\t\tinout vec4 trackColor\n\t\t\t) {\n\t\t\t\tfor (float i = 0.; i < 24.; i++) {\n\t\t\t\t\tif (activeKey < 1.) break; \n\t\t\t\t\tactiveKey *= 0.5;\n\t\t\t\t\tif (fract(activeKey) < 0.5) continue;\n\n\t\t\t\t\tfloat iin = (i + ii + 0.5) * ${1/96};\n\t\t\t\t\tvec4 shape = shapePos(iin);\n\t\t\t\t\tvec4 quat = shapeQuat(iin);\n\t\t\t\t\tvec4 params1 = shapeParams1(iin);\n\t\t\t\t\tvec4 params2 = shapeParams2(iin);\n\n\t\t\t\t\tvec3 p = corner - shape.xyz;\n\t\t\t\t\tapplyQuaternionToVector(quat, p);\n\t\t\t\t\tp /= params2.z; // scale\n\t\t\t\t\tfloat d; // d in -1..1 coordinates\n\t\t\t\t\tswitch (int(params1.x)) {\n\t\t\t\t\t\tcase 0: d = sdSphere(p, params1.y); break;\n\t\t\t\t\t\tcase 1: d = sdEllipsoid(p, params1.yzw); break;\n\t\t\t\t\t\tcase 2: d = sdBox(p, params1.yzw); break;\n\t\t\t\t\t\tcase 3: d = sdCappedCylinder(p, params1.y, params1.z); break;\n\t\t\t\t\t\tcase 4: d = sdCappedCone(p, params1.y, params1.z, params1.w); break;\n\t\t\t\t\t\tcase 5: d = sdTorus(p, params1.yz); break;\n\t\t\t\t\t\tcase 6: d = sdCappedTorus(p, params1.yz, params1.w, params2.w); break;\n\t\t\t\t\t\t// Mesh children (type 7) live in a WebGPU-only baked SDF\n\t\t\t\t\t\t// atlas — the GLSL evaluator skips the shape entirely\n\t\t\t\t\t\t// (also closes the latent uninitialized-d default).\n\t\t\t\t\t\tdefault: continue;\n\t\t\t\t\t}\n\t\t\t\t\td -= params2.y; // rounded edge\n\t\t\t\t\td *= params2.z; // scale\n\n\t\t\t\t\tfloat k = params2.x;\n\t\t\t\t\tfloat op = shape.w;\n\n\t\t\t\t\tsdf = smoothOperation(shape.w, sdf, d, k);\n\n\t\t\t\t\tfloat isNegativeOne = step(-1.5, op) * step(op, -0.5); // 1 when op == -1, 0 otherwise\n\t\t\t\t\tfloat colorCull = smoothstep(maxBlend, 0., -d);\n\t\t\t\t\tfloat cullFactor = mix(1.0, colorCull, isNegativeOne);\n\t\t\t\t\ttrackColor *= cullFactor;\n\t\t\t\t\tcolorDivisor *= cullFactor;\n\n\t\t\t\t\tmaxBlend = max(maxBlend, k);\n\n\t\t\t\t\tk += 2. * INV_VOXEL_RESOLUTION; // avoid division by zero, and other color artifacts with very small k\n\t\t\t\t\tfloat nearness = smoothstep(k, 0., d);\n\n\t\t\t\t\tvec4 color = shapeColor(iin);\n\t\t\t\t\tnearness *= float(color.a >= 0.);\n\n\t\t\t\t\tcolorDivisor += nearness;\n\t\t\t\t\ttrackColor += color * nearness;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tvec3 div;\n\t\t\t// compute potential from all spheres; collect +ve and =ve values separately\n\t\t\t// work in blocks of A*4 (=96) spheres, using the bit flags in 4 float channel 'activeKey' values\n\t\t\t// TODO check if extra vec3 output useful, not really used at present\n\t\t\tfloat fillSpatial(vec3 corner, inout vec4 trackColor) {\n\t\t\t\tfloat sdf = 1e3; // hack: initialize to large value\n\t\t\t\tfloat colorDivisor = 0.;\n\t\t\t\t// spatialPassTexture holds x=> lowi, x faster moving and y=> z, y faster moving\n\t\t\t\tfloat divyz = (div.y + div.z * spatialDivisions + 0.5) / (spatialDivisions2);\n\t\t\t\tfor (float ii = 0.; ii < spatialn; ii++) {\n\t\t\t\t\tfloat i = ii * 96.;\n\n\t\t\t\t\tvec4 activeKey = texture(spatialPassTexture, vec2((div.x * spatialn + ii + 0.5)/(spatialn * spatialDivisions), divyz));\n\t\t\t\t\tfillSpatialInner(i, activeKey.x, corner, sdf, colorDivisor, trackColor);\n\t\t\t\t\tfillSpatialInner(i+24., activeKey.y, corner, sdf, colorDivisor, trackColor);\n\t\t\t\t\tfillSpatialInner(i+48., activeKey.z, corner, sdf, colorDivisor, trackColor);\n\t\t\t\t\tfillSpatialInner(i+72., activeKey.w, corner, sdf, colorDivisor, trackColor);\n\t\t\t\t}\n\n\t\t\t\ttrackColor /= colorDivisor;\n\t\t\t\treturn mix(sdf, 0.0, step(1e20 - 0.1, sdf));\n\t\t\t}\n\n\t\t\tvoid main() {\n\t\t\t\t${X.getxyzi} \n\n\t\t\t\tvec3 xyzi = vec3(xi,yi,zi);\n\t\t\t\tvec3 corner = xyzi / VOXEL_RESOLUTION_SUB1 * 2. - 1.; \n\n\t\t\t\tdiv = floor(xyzi / VOXEL_RESOLUTION_SUB1 * spatialDivisionsSub1);\n\n\t\t\t\tvec4 c = vec4(0.);\n\t\t\t\tfloat t = fillSpatial(corner, c);\n\n\t\t\t\tpc_FragColor = vec4(t, packRGBAToVec3(c)); \n\t\t\t}\n\t\t`;return new L({name:"PotentialPass",fragmentShader:t,uniforms:this.potentialPassUniforms})}voxelPassMaterial(){let t=`\n\t\t\tprecision highp float;\n\t\t\tlayout(location = 0) out vec4 pc_FragColor;\n\t\t\tlayout(location = 1) out vec4 numTris;\n\n\t\t\tconst float res = float(RES);\n\t\t\tconst float VOXEL_RESOLUTION = pow(2., res);\n\t\t\tconst float VOXEL_RESOLUTION_SUB1 = VOXEL_RESOLUTION - 1.; \n\t\t\tconst float Z_LAYERS_PER_ROW = ceil(pow(2., res / 2.));\n\t\t\tconst float INV_VOXEL_RESOLUTION = 1.0 / VOXEL_RESOLUTION;\n\t\t\tuniform sampler2D numTrisTable; \n\n\t\t\tfloat keyi(float f000, float f100, float f010, float f110, float f001, float f101, float f011, float f111) {\n\t\t\t\treturn (float(f000 < 0.) * 1.) +\n\t\t\t\t\t\t\t (float(f100 < 0.) * 2.) +\n\t\t\t\t\t\t\t (float(f010 < 0.) * 8.) +\n\t\t\t\t\t\t\t (float(f110 < 0.) * 4.) +\n\t\t\t\t\t\t\t (float(f001 < 0.) * 16.) +\n\t\t\t\t\t\t\t (float(f101 < 0.) * 32.) +\n\t\t\t\t\t\t\t (float(f011 < 0.) * 128.) +\n\t\t\t\t\t\t\t (float(f111 < 0.) * 64.);\n\t\t\t}\n\n\t\t\t${X.lookup}\n\n\t\t\tvec3 compNormi(float xi, float yi, float zi) {\n\t\t\t\tfloat dx = look(xi + 1., yi, zi, potentialPassTexture).r - look(xi - 1., yi, zi, potentialPassTexture).r;\n\t\t\t\tfloat dy = look(xi, yi + 1., zi, potentialPassTexture).r - look(xi, yi - 1., zi, potentialPassTexture).r;\n\t\t\t\tfloat dz = look(xi, yi, zi + 1., potentialPassTexture).r - look(xi, yi, zi - 1., potentialPassTexture).r;\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tif (dx == 0.0 && dy == 0.0 && dz == 0.0) {\n\t\t\t\t\treturn vec3(0.199, 0.299, 0.399);\n\t\t\t\t}\n\t\t\t\treturn normalize(vec3(dx, dy, dz));\n\t\t\t}\n\n\t\t\tvoid main() {\n\t\t\t\t${X.getxyzi} \n\n\t\t\t\tvec3 normal = compNormi(xi, yi, zi); \n\n\t\t\t\tif (xi >= VOXEL_RESOLUTION_SUB1 || yi >= VOXEL_RESOLUTION_SUB1 || zi >= VOXEL_RESOLUTION_SUB1) {\n\t\t\t\t\tpc_FragColor = vec4(normal, 0.);\n\t\t\t\t\tnumTris = vec4(0.);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tfloat\n\t\t\t\t\tf000 = look(xi, yi, zi, potentialPassTexture).r,\n\t\t\t\t\tf100 = look(xi+1., yi, zi, potentialPassTexture).r,\n\t\t\t\t\tf010 = look(xi, yi+1., zi, potentialPassTexture).r,\n\t\t\t\t\tf110 = look(xi+1., yi+1., zi, potentialPassTexture).r,\n\t\t\t\t\tf001 = look(xi, yi, zi+1., potentialPassTexture).r,\n\t\t\t\t\tf101 = look(xi+1., yi, zi+1., potentialPassTexture).r,\n\t\t\t\t\tf011 = look(xi, yi+1., zi+1., potentialPassTexture).r,\n\t\t\t\t\tf111 = look(xi+1., yi+1., zi+1., potentialPassTexture).r;\n\t\t\t\tfloat key = keyi(f000, f100, f010, f110, f001, f101, f011, f111);\n\n\t\t\t\tpc_FragColor = vec4(normal, key);\n\n\t\t\t\tnumTris = texture(numTrisTable, vec2((key + 0.5) / 256., 0.5));\n\t\t\t}\n\t\t`;return new L({name:"VoxelPass",fragmentShader:t,uniforms:this.voxelPassUniforms})}patchVertexShaderForShapeBlend(t){let e=`\n\t\t#ifdef SHAPEBLEND \n\t\t\tprecision highp sampler2D;\n\n\t\t\tuniform float isol;\n\n\t\t\tuniform sampler2D triTable; \n\t\t\tuniform sampler2D pyramidTexture1;\n\t\t\tuniform vec2 pyramidTexture1Size;\n\t\t\tuniform sampler2D pyramidTexture2;\n\t\t\tuniform vec2 pyramidTexture2Size;\n\n\t\t\tconst vec2 halfPixelOffset = vec2(0.5, 0.5);\n\n\t\t\tconst vec2 rShift = vec2(0., 1.);\n\t\t\tconst vec2 gShift = vec2(1., 1.);\n\t\t\tconst vec2 bShift = vec2(1., 0.);\n\n\t\t\tconst float res = float(RES);\n\t\t\tconst float VOXEL_RESOLUTION = pow(2., res);\n\t\t\tconst float Z_LAYERS_PER_ROW = ceil(pow(2., res / 2.));\n\t\t\tconst float INV_VOXEL_RESOLUTION = 1.0 / VOXEL_RESOLUTION;\n\n\t\t\tconst float scale_factor = 2.;\n\n\t\t\t#if SHAPEBLEND == 5\n\t\t\t\tconst float levelShiftX[7] = float[7](4., 6., 12., 24., 48., 96., 192.);\n\t\t\t\tconst float scale = 8. * scale_factor;\n\t\t\t\tconst vec3 originOffset = vec3(16.);\n\t\t\t#elif SHAPEBLEND == 7\n\t\t\t\tconst float levelShiftX[10] = float[10](4., 6., 12., 24., 48., 96., 192., 384., 768., 1536.); \n\t\t\t\tconst float scale = 2. * scale_factor;\n\t\t\t\tconst vec3 originOffset = vec3(64.);\n\t\t\t#elif SHAPEBLEND == 8\n\t\t\t\tconst float levelShiftX[11] = float[11](4., 8., 16., 32., 64., 128., 256., 512., 1024., 2048., 4096.);\n\t\t\t\tconst float scale = scale_factor;\n\t\t\t\tconst vec3 originOffset = vec3(128.);\n\t\t\t#else\n\t\t\t\tconst float levelShiftX[8] = float[8](4., 8., 16., 32., 64., 128., 256., 512.);\n\t\t\t\tconst float scale = 4. * scale_factor;\n\t\t\t\tconst vec3 originOffset = vec3(32.);\n\t\t\t#endif\n\n\t\t\t${X.lookup}\n\n\t\t\tconst vec3 offsets[24] = vec3[](\n\t\t\t\tvec3(0., 0., 0.), vec3(1., 0., 0.),\n\t\t\t\tvec3(1., 0., 0.), vec3(1., 1., 0.),\n\t\t\t\tvec3(0., 1., 0.), vec3(1., 1., 0.),\n\t\t\t\tvec3(0., 0., 0.), vec3(0., 1., 0.),\n\t\t\t\tvec3(0., 0., 1.), vec3(1., 0., 1.),\n\t\t\t\tvec3(1., 0., 1.), vec3(1., 1., 1.),\n\t\t\t\tvec3(0., 1., 1.), vec3(1., 1., 1.),\n\t\t\t\tvec3(0., 0., 1.), vec3(0., 1., 1.),\n\t\t\t\tvec3(0., 0., 0.), vec3(0., 0., 1.),\n\t\t\t\tvec3(1., 0., 0.), vec3(1., 0., 1.),\n\t\t\t\tvec3(1., 1., 0.), vec3(1., 1., 1.),\n\t\t\t\tvec3(0., 1., 0.), vec3(0., 1., 1.)\n\t\t\t);\n\n\t\t\tvec2 computeShiftedPosition1(vec2 xy, float levelOriginX) {\n\t\t\t\tvec2 xyShifted = xy;\n\t\t\t\txyShifted.x += levelOriginX;\n\t\t\t\treturn (xyShifted + halfPixelOffset) / pyramidTexture1Size;\n\t\t\t}\n\n\t\t\tvec2 computeShiftedPosition2(vec2 xy, float levelOriginX) {\n\t\t\t\tvec2 xyShifted = xy;\n\t\t\t\txyShifted.x += levelOriginX;\n\t\t\t\treturn (xyShifted + halfPixelOffset) / pyramidTexture2Size;\n\t\t\t}\n\n\t\t\tvec4 unpackVec3ToRGBA(vec3 vec) {\n\t\t\t\tuint combined = uint(vec.x * 65535.0 + 0.5); \n\t\t\t\tfloat g = float(combined & uint(0xFF)) * 0.00392156862; \n\t\t\t\tfloat r = float((combined >> 8) & uint(0xFF)) * 0.00392156862; \n\t\t\n\t\t\t\treturn vec4(r, g, vec.y, vec.z);\n\t\t\t}\n\n\t\t\tout vec4 marchColor;\n\t\t\t\n\t\t#endif\n\t\t`;t.vertexShader=e+t.vertexShader.replace("#include <project_vertex>","\n\t\t#ifdef SHAPEBLEND\n\t\t\tfloat triIndex = floor(float(gl_VertexID/3));\n\t\t\tfloat vertexIndex = float(gl_VertexID);\n\t\t\t\n\t\t\t\n\t\t\tfloat levelOriginX1 = pyramidTexture1Size.x - 2.;\n\t\t\tfloat levelOriginX2 = pyramidTexture2Size.x - 1.;\n\t\t\tvec2 xy = vec2(0.);\n\t\t\tvec4 lookUp = texture(pyramidTexture2, computeShiftedPosition2(xy, levelOriginX2));\n\t\t\t\n\t\t\t\n\t\t\tif (triIndex >= lookUp.r) return;\n\t\t\t\n\t\t\t\n\t\t\tfloat start = 0.;\n\t\t\tvec4 triIndexVec = vec4(triIndex);\n\t\t\t\n\t\t\t\n\t\t\tfor (int i = 0; i < LOOP;) {\n\t\t\t\t\n\t\t\t\tvec4 ends = lookUp + vec4(start);\n\t\t\t\tvec4 starts = vec4(ends.gba, start);\n\t\t\t\tvec4 check = vec4(greaterThanEqual(triIndexVec, starts)) * \n\t\t\t\t\t\t\t\t\t\t\tvec4(lessThan(triIndexVec, ends));\n\t\t\t\t\n\t\t\t\t\n\t\t\t\txy *= 2.;\n\t\t\t\txy += check.r * rShift + check.g * gShift + check.b * bShift;\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tstart = dot(check, starts);\n\t\t\t\tlevelOriginX2 -= levelShiftX[i];\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tlookUp = texture(pyramidTexture1, computeShiftedPosition1(xy, levelOriginX1));\n\t\t\t\ti++;\n\n\t\t\t\tends = lookUp + vec4(start);\n\t\t\t\tstarts = vec4(ends.gba, start);\n\t\t\t\tcheck = vec4(greaterThanEqual(triIndexVec, starts)) * \n\t\t\t\t\t\t\t\t\t\t\tvec4(lessThan(triIndexVec, ends));\n\t\t\t\t\n\t\t\t\t\n\t\t\t\txy *= 2.;\n\t\t\t\txy += check.r * rShift + check.g * gShift + check.b * bShift;\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tstart = dot(check, starts);\n\t\t\t\tlevelOriginX1 -= levelShiftX[i];\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tlookUp = texture(pyramidTexture2, computeShiftedPosition2(xy, levelOriginX2));\n\n\t\t\t\ti++;\n\t\t\t}\n\n\t\t\t#if HALF == 1\n\t\t\t\tvec4 ends = lookUp + vec4(start);\n\t\t\t\tvec4 starts = vec4(ends.gba, start);\n\t\t\t\tvec4 check = vec4(greaterThanEqual(triIndexVec, starts)) * vec4(lessThan(triIndexVec, ends));\n\t\t\t\n\t\t\t\t\n\t\t\t\txy *= 2.;\n\t\t\t\txy += check.r * rShift + check.g * gShift + check.b * bShift;\n\t\t\t\n\t\t\t\t\n\t\t\t\tstart = dot(check, starts);\n\t\t\t#endif\n\t\t\t\n\t\t\t\n\t\t\tvec3 gridPos;\n\t\t\tgridPos.x = mod(xy.x, VOXEL_RESOLUTION);\n\t\t\tgridPos.y = mod(xy.y, VOXEL_RESOLUTION);\n\t\t\tgridPos.z = floor(xy.x * INV_VOXEL_RESOLUTION) + \n\t\t\t\t\t\t\t\t\tfloor(xy.y * INV_VOXEL_RESOLUTION) * Z_LAYERS_PER_ROW;\n\t\t\t\n\t\t\t\n\t\t\tvertexIndex -= start * 3.;\n\t\t\tfloat vk = vertexIndex * 0.0625 + 0.03125; \n\t\t\t\n\t\t\t\n\t\t\tvec4 voxel = look(gridPos.x, gridPos.y, gridPos.z, voxelPassTexture);\n\t\t\tfloat key = (voxel.w + 0.5) * 0.00390625; \n\t\t\t\n\t\t\t\n\t\t\tfloat edgeNum = texture(triTable, vec2(vk, key)).x;\n\t\t\tint edgeIndex = int(edgeNum) * 2;\n\t\t\t\n\t\t\t\n\t\t\tvec3 p1 = gridPos + offsets[edgeIndex];\n\t\t\tvec3 p2 = gridPos + offsets[edgeIndex + 1];\n\t\t\t\n\t\t\t\n\t\t\tvec4 potential1 = look(p1.x, p1.y, p1.z, potentialPassTexture);\n\t\t\tvec4 potential2 = look(p2.x, p2.y, p2.z, potentialPassTexture);\n\t\t\t\n\t\t\t\n\t\t\tfloat mu = potential1.r / (potential1.r - potential2.r);\n\n\t\t\tmarchColor = mix(\n\t\t\t\tunpackVec3ToRGBA(potential1.gba),\n\t\t\t\tunpackVec3ToRGBA(potential2.gba),\n\t\t\t\tmu\n\t\t\t);\n\n\t\t\ttransformed = p1 + (p2 - p1) * mu;\n\t\t\ttransformed -= originOffset;\n\t\t\ttransformed *= scale;\n\t\t\tvec4 data1 = look(p1.x, p1.y, p1.z, voxelPassTexture);\n\t\t\tvec4 data2 = look(p2.x, p2.y, p2.z, voxelPassTexture);\n\t\t\tobjectNormal = normalize(mix(data1.xyz, data2.xyz, mu));\n\t\t\ttransformedNormal = normalMatrix * objectNormal;\n\t\t\t#ifndef FLAT_SHADED\n\t\t\t\tvNormal = transformedNormal;\n\t\t\t#endif\n\t\t#endif\n\t\t\n#include <project_vertex>");let i=t.fragmentShader.match(/vec3 diffuseColor[^\n]*\n/);if(!i)return;let a=`\n\t\t#ifdef SHAPEBLEND_C\n\t\t\t#if SHAPEBLEND_C == 1\n\t\t\t\t${i[0].replace(/nodeU0,/g,"marchColor.rgb,").replace(/nodeU\d+(?=,g_uid\d+_calpha\))/g,"marchColor.a")}\n\t\t\t#else\n\t\t\t\t${i[0]}\n\t\t\t#endif\n\t\t#else\n\t\t\t${i[0]}\n\t\t#endif\n\t\t`;t.fragmentShader="in vec4 marchColor;\n"+t.fragmentShader.replace(i[0],a),Object.assign(t.uniforms,this.marchPassUniforms)}initDebugPass(t){console.log("fboToDebug.width",t.width,t.height),this.geometry=new y(t.width,t.height),this.geometry.userData={parameters:{width:4,height:4}};let e={inputTexture:{value:t.textures.length>1?t.textures[1]:t.texture},pyramidTextureSize:{value:void 0}},i=t=>{t.vertexShader="\n\t\t\t\tprecision highp float;\n\n\t\t\t\tvarying vec2 vUv;\n\n\t\t\t\tvoid main() {\n\t\t\t\t\t\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\t\t\t\t\t\tvUv = uv;\n\t\t\t\t}\n\t\t\t",t.fragmentShader="\n\t\t\t\tlayout(location = 1) out vec4 gVelocity;\n\n\t\t\t\tprecision highp float;\n\t\t\t\t\n\t\t\t\tuniform sampler2D inputTexture;\n\t\t\t\tvarying vec2 vUv;\n\n\t\t\t\tuniform vec2 pyramidTextureSize;\n\n\t\t\t\tvoid main() {\n\t\t\t\t\t\t\n\t\t\t\t\t\tgl_FragColor = texture(inputTexture, vUv);\n\t\t\t\t\t\tgVelocity = vec4(0.0);\n\t\t\t\t}\n\t\t\t",e.pyramidTextureSize.value=new l(this.pyramidRenderTarget[0].width,this.pyramidRenderTarget[0].height),Object.assign(t.uniforms,e)};this.material.shapeBlendhack=i,this.material.root.shapeBlendhack=i}dispose(){super.dispose(),B()?.release(this)}},j=G;j.streamCompaction=new class{constructor(){this.pyramidPassScene=new x,this.pyramidPassMaterial=new L({name:"PyramidPass"}),this.pyramidPassUniforms={inputTexture:{value:void 0},inputWidth:{value:0},inputHeight:{value:0},inputShiftX:{value:0},outputShiftX:{value:0}},this.pyramidTopLevelReadPixelBuffer=new Float32Array(4),this.pyramidPassMaterial.fragmentShader="\n\t\t\tprecision highp float;\n\t\t\tprecision highp sampler2D;\n\t\t\tlayout(location = 0) out vec4 pc_FragColor;\n\t\t\tuniform sampler2D inputTexture;\n\t\t\tuniform float inputWidth;\n\t\t\tuniform float inputHeight;\n\t\t\tuniform float inputShiftX;\n\t\t\tuniform float outputShiftX;\n\t\t\tconst vec2 half_unit_coord = vec2(0.5);\n\t\t\tconst vec4 one = vec4(1.0);\n\t\t\tvoid main() {\n\t\t\t\tvec2 inputSize = vec2(inputWidth, inputHeight);\n\t\t\t\tvec2 input_pixel_uv = 1. / inputSize;\n\t\t\t\tvec2 coord = gl_FragCoord.xy - half_unit_coord;\n\t\t\t\tcoord.x -= outputShiftX;\n\t\t\t\tcoord = coord * 2. + half_unit_coord;\n\t\t\t\tcoord.x += inputShiftX;\n\n\t\t\t\t\n\t\t\t\tvec2 input_uv = coord / inputSize;\n\t\t\t\tfloat bl = texture(inputTexture, input_uv).r;\n\n\t\t\t\t\n\t\t\t\tinput_uv.x += input_pixel_uv.x;\n\t\t\t\tfloat br = texture(inputTexture, input_uv).r;\n\n\t\t\t\t\n\t\t\t\tinput_uv.y += input_pixel_uv.y;\n\t\t\t\tfloat tr = texture(inputTexture, input_uv).r;\n\n\t\t\t\t\n\t\t\t\tinput_uv.x -= input_pixel_uv.x;\n\t\t\t\tfloat tl = texture(inputTexture, input_uv).r;\n\n\t\t\t\tpc_FragColor.a = bl;\n\t\t\t\tpc_FragColor.b = pc_FragColor.a + br;\n\t\t\t\tpc_FragColor.g = pc_FragColor.b + tr;\n\t\t\t\tpc_FragColor.r = pc_FragColor.g + tl; \n\t\t\t}\n\t\t",this.pyramidPassMaterial.uniforms=this.pyramidPassUniforms,this.pyramidPassMaterial.depthTest=!1,this.pyramidPassMaterial.depthWrite=!1;let t=new P(O,this.pyramidPassMaterial);t.frustumCulled=!1,this.pyramidPassScene.add(t)}renderPyramid(t,e,i,a,n){(new m).min.setScalar(0);let s=e.length-1,r=new c;i.getViewport(r),this.pyramidPassUniforms.inputShiftX.value=0,this.pyramidPassUniforms.outputShiftX.value=0;let o=s-1;for(let s=o;s>=0;s--){let r=s%2==o%2?n[0]:n[1],l=s===o?a:s%2==o%2?n[1]:n[0];this.pyramidPassUniforms.inputTexture.value=l.textures.length>1?l.textures[1]:l.texture,this.pyramidPassUniforms.inputWidth.value="width"in l?l.width:1,this.pyramidPassUniforms.inputHeight.value="height"in l?l.height:1,i.setRenderTarget(r);let h=e[s],p=i.getPixelRatio();i.setViewport(this.pyramidPassUniforms.outputShiftX.value/p,0,h/p,h/p),2===s&&t%2!=0&&i.setViewport(this.pyramidPassUniforms.outputShiftX.value/p,0,3/p,3/p),i.render(this.pyramidPassScene,D);let d=this.pyramidPassUniforms.inputShiftX.value;this.pyramidPassUniforms.inputShiftX.value=this.pyramidPassUniforms.outputShiftX.value,this.pyramidPassUniforms.outputShiftX.value=d,s<o&&(this.pyramidPassUniforms.outputShiftX.value+=e[s+1])}i.setViewport(r);let l=e.length%2==0?0:1;return i.readRenderTargetPixelsAsync(n[l],n[l].width-1,0,1,1,this.pyramidTopLevelReadPixelBuffer).then(()=>this.pyramidTopLevelReadPixelBuffer[0])}};var $=new v,Y=new v,Z=new h,Q=new p,J=new p,tt=new h;function et(t,e=0){let i=this.children.length;for(;i--;){let a=this.children[i];n.is(a)&&it.call(a,t,e+1)}}function it(t,e=0){if(!0!==t(this,e)){let i=this.children.length;for(;i--;){let a=this.children[i];n.is(a)&&it.call(a,t,e+1)}}}function at(){if(void 0===this.shapesDataTexture.value){let t=new w(new Float32Array(1920),96,5,d,o);this.shapesDataTexture.value=t}let n=this.shapesDataTexture.value,l=n.image.data,h=0,p=0,c=this.data.geometry.blendRange,f=$.copy(this.matrixWorld).invert(),u=this._npart,v=0;this._meshSdfWanted.clear();let m=null;if(et.call(this,n=>{if(!1===n.visible)return!0;let o;if(n instanceof t)return;if(n instanceof e||r(n))return;o=n instanceof i?n.object:n;let d=n.data?.cloner;if(s.is(n)&&d&&!d.hideBase&&"radial"!==d.type&&!0!==d.disabled||!(o instanceof a))return;let u=o.geometry.userData.parameters,x=u?.shapeBlendNode??o.dataPatched?.geometry?.shapeBlendNode;if(void 0===x)return;if(Y.multiplyMatrices(f,n.matrixWorld).decompose(J,Z,Q),"TorusGeometry"===u?.type&&360!==u.arc){let t=u.arc*Math.PI/180;t/=4,Z.multiply(tt.set(0,0,Math.sin(t),Math.cos(t)))}let y=x.overrideGlobalBlend?x.blendRange:c;y=y/this.bboxSize*2,l[4*v]=(J.x-this.bboxOffset)/this.bboxSize*2,l[4*v+1]=(J.y-this.bboxOffset)/this.bboxSize*2,l[4*v+2]=(J.z-this.bboxOffset)/this.bboxSize*2,l[4*v+3]=0===x.operation?1:2===x.operation?-1:-2,l[384+4*v]=-Z.x,l[384+4*v+1]=-Z.y,l[384+4*v+2]=-Z.z,l[384+4*v+3]=Z.w;let g=new Float32Array(4),S=0,b=y;if("SphereGeometry"===u?.type)u.width===u.height&&u.width===u.depth?g[0]=0:g[0]=1,g[1]=u.width/this.bboxSize,g[2]=u.height/this.bboxSize,g[3]=u.depth/this.bboxSize,b=Math.max(g[1],g[2],g[3])*Q.x+y;else if("CubeGeometry"===u?.type){S=u.cornerRadius;let t=u.width,e=u.height,i=u.depth;g[0]=2,g[1]=(t-2*S)/this.bboxSize,g[2]=(e-2*S)/this.bboxSize,g[3]=(i-2*S)/this.bboxSize,b=Math.sqrt(t**2+e**2+i**2)/this.bboxSize*Q.x+y}else if("CylinderGeometry"===u?.type){S=u.cornerRadius;let t=u.height,e=u.radiusBottom,i=u.radiusTop;if(i>=e){let a=Math.atan2(i-e,t),n=(Math.PI/2-a)/2;i-=S/Math.tan(n),e-=S*Math.tan(n)}else if(e>i){let a=Math.atan2(e-i,t),n=(Math.PI/2-a)/2;i-=S*Math.tan(n),e-=S/Math.tan(n)}g[1]=(u.height-2*S)/this.bboxSize,e===i?(g[0]=3,g[2]=e/this.bboxSize*2):(g[0]=4,g[2]=e/this.bboxSize*2,g[3]=i/this.bboxSize*2),b=(Math.hypot(g[1],Math.max(Math.abs(g[2]),Math.abs(g[3])))+S/this.bboxSize*2)*Q.x+y}else if("TorusGeometry"===u?.type){if(g[0]=5,g[1]=(u.width-u.depth)/this.bboxSize,g[2]=u.depth/this.bboxSize,360!==u.arc){g[0]=6,g[3]=g[1],l[1152+4*v+3]=g[2];let t=2*Math.atan2(g[2]/2,g[1]),e=u.arc*Math.PI/180/2-t;g[1]=Math.sin(e),g[2]=Math.cos(e)}b=u.width*Q.x/this.bboxSize+y}else{let t=o.geometry;(m??(m=new Set)).add(t.uuid);let e=this._meshSdfBaked.get(t.uuid),i=K(t);if((void 0===e||e.posVersion!==i)&&this._meshSdfWanted.set(t.uuid,t),void 0===e)return;g[0]=7,g[1]=e.slot,g[2]=e.boxHalf.x/this.bboxSize*2,g[3]=e.boxHalf.y/this.bboxSize*2,l[1152+4*v+3]=e.boxHalf.z/this.bboxSize*2,b=Math.hypot(e.boxHalf.x,e.boxHalf.y,e.boxHalf.z)/this.bboxSize*2*Q.x+y}l.set(g,768+4*v),h=Math.max(h,b),p=Math.max(p,y),this._reach[v]=b,l[1152+4*v]=y,l[1152+4*v+1]=S/this.bboxSize*2,l[1152+4*v+2]=Q.x;let T,P,_=Array.isArray(o.material)?o.material[0]:o.material,z=_;if(z?.getShapeBlendBaseColor){let t=z.getShapeBlendBaseColor();T=t,P=t.a}else void 0!==_?.uniforms?.nodeU0?(T=_.uniforms.nodeU0.node.value,P=_.uniforms.nodeU1?.value??1):(T={r:1,g:1,b:1},P=1);0!==x.operation&&!x.useColor&&(P=-1),l[1536+4*v]=T.r,l[1536+4*v+1]=T.g,l[1536+4*v+2]=T.b,l[1536+4*v+3]=P,P<1&&1===this.material.defines?.SHAPEBLEND_C&&(this.material.transparent=!0),v++}),this._meshSdfBaked.size>0){let t=m??new Set;for(let e of this._meshSdfBaked.keys())t.has(e)||this._meshSdfBaked.delete(e)}this.npart=v,this._maxBlendK=p;let x=1.1*h+2/(this.spatialDivisions-1)+4/(this.resolution-1);this.spatialPassUniforms.span.value=x;let y=this._prevShapeData,g=u!==v,S=null===y||this._prevSpan!==x||g,b=S||H,T=this._fieldDirtyMin.set(1/0,1/0,1/0),P=this._fieldDirtyMax.set(-1/0,-1/0,-1/0);if(null!==y){let t=Math.max(v,u);for(let e=0;e<t;e++){let t=!1;for(let i=0;i<5;i++){let a=384*i+4*e;if(l[a]!==y[a]||l[a+1]!==y[a+1]||l[a+2]!==y[a+2]||l[a+3]!==y[a+3]){t=!0;break}}if(!t)continue;if(S=!0,b)break;let i=l[4*e],a=l[4*e+1],n=l[4*e+2],s=y[4*e],r=y[4*e+1],o=y[4*e+2],h=this._reach[e],p=this._prevReach[e];Number.isFinite(i+a+n+h)&&Number.isFinite(s+r+o+p)?(T.x=Math.min(T.x,i-h,s-p),T.y=Math.min(T.y,a-h,r-p),T.z=Math.min(T.z,n-h,o-p),P.x=Math.max(P.x,i+h,s+p),P.y=Math.max(P.y,a+h,r+p),P.z=Math.max(P.z,n+h,o+p)):b=!0}}return H&&(S=!0),this._fieldDirtyFull=b||T.x===1/0,S&&(null===y?this._prevShapeData=new Float32Array(l):y.set(l),this._prevReach.set(this._reach),this._prevSpan=x,n.needsUpdate=!0),S}function nt(t){return at.call(t)}export{k as a,U as b,M as c,F as d,N as e,V as f,B as g,A as h,W as i,K as j,j as k,nt as l};
|
|
1
|
+
import{a as t}from"./runtime-chunk-LQL2PJVX.js";import{a as e}from"./runtime-chunk-MVJAFW5H.js";import{$ as i,ea as a}from"./runtime-chunk-7FDJ7IIR.js";import{e as n,h as s}from"./runtime-chunk-MOZWC42D.js";import{a as r}from"./runtime-chunk-2PT2WH66.js";import{Aa as o,Dc as l,Ec as h,Fc as p,Ja as d,Jc as c,Lc as f,Ma as u,Oc as v,Qe as m,Vc as x,Vd as y,Zc as g,ce as S,dd as b,de as T,ld as P,na as _,nc as z,nd as w,we as R}from"./runtime-chunk-VGN7YHB7.js";var O=new b;O.setAttribute("position",new g(new Float32Array([-1,-1,0,3,-1,0,-1,3,0]),3));var L=class extends T{constructor(t){super({...t,depthTest:!1,depthWrite:!1,glslVersion:z,vertexShader:"\n\t\t\t\tprecision highp float;\n\t\t\t\tin vec3 position;\n\t\t\t\tvoid main() {\n\t\t\t\t\tgl_Position = vec4(position, 1);\n\t\t\t\t}\n\t\t\t"})}customProgramCacheKey(){return""}};function k(){return{shapeInput:()=>"\n\t\t\tconst float posRowCoord = 0.1; \n\t\t\tconst float quatRowCoord = 0.3; \n\t\t\tconst float param1RowCoord = 0.5;\n\t\t\tconst float param2RowCoord = 0.7;\n\t\t\tconst float colorRowCoord = 0.9; \n\t\t\tuniform sampler2D shapesDataTexture;\n\t\t\tvec4 shapePos(float iin) { \n\t\t\t\tvec4 r = texture(shapesDataTexture, vec2(iin, posRowCoord));\n\t\t\t\treturn r;\n\t\t\t}\n\t\t\tvec4 shapeQuat(float iin) {\n\t\t\t\tvec4 r = texture(shapesDataTexture, vec2(iin, quatRowCoord));\n\t\t\t\treturn r;\n\t\t\t}\n\t\t\tvec4 shapeParams1(float iin) {\n\t\t\t\tvec4 r = texture(shapesDataTexture, vec2(iin, param1RowCoord));\n\t\t\t\treturn r;\n\t\t\t}\n\t\t\tvec4 shapeParams2(float iin) {\n\t\t\t\tvec4 r = texture(shapesDataTexture, vec2(iin, param2RowCoord));\n\t\t\t\treturn r;\n\t\t\t}\n\t\t\tvec4 shapeColor(float iin) {\n\t\t\t\tvec4 r = texture(shapesDataTexture, vec2(iin, colorRowCoord));\n\t\t\t\treturn r;\n\t\t\t}\n\t\t",getxyzi:"\n\t\t\t// this code must complement lookup\n\t\t\tfloat xi = mod(gl_FragCoord.x - 0.5, VOXEL_RESOLUTION);\n\t\t\tfloat yi = mod(gl_FragCoord.y - 0.5, VOXEL_RESOLUTION);\n\t\t\tfloat zi = floor((gl_FragCoord.x - 0.5) * INV_VOXEL_RESOLUTION) + floor((gl_FragCoord.y - 0.5) * INV_VOXEL_RESOLUTION) * Z_LAYERS_PER_ROW;\n\t\t",lookup:"\n\t\t\tuniform sampler2D potentialPassTexture;\n\t\t\tuniform sampler2D voxelPassTexture; \n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\tvec4 look(float xi, float yi, float zi, sampler2D rt) {\n\t\t\t\tvec2 uv = vec2(\n\t\t\t\t\tmod(zi, Z_LAYERS_PER_ROW) + (xi + 0.5) / VOXEL_RESOLUTION,\n\t\t\t\t\tfloor(zi / Z_LAYERS_PER_ROW) + (yi + 0.5) / VOXEL_RESOLUTION\n\t\t\t\t); \n\t\t\t\tuv /= Z_LAYERS_PER_ROW;\n\t\t\t\treturn texture(rt, uv);\n\t\t\t}\n\t\t",getpart:"\n\t\t\tfloat getpart(inout float a, float b) {\n\t\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3,2,4,3,4,3,5,2,2,3,3,4,3,4,4,5,3,4,4,5,4,5,5,4,3,4,4,3,4,5,5,4,4,3,5,2,5,4,2,1,2,3,3,4,3,4,4,5,3,4,4,5,2,3,3,2,3,4,4,5,4,5,5,2,4,3,5,4,3,2,4,1,3,4,4,5,4,5,3,4,4,5,5,2,3,4,2,1,2,3,3,2,3,4,2,1,3,2,4,1,2,1,1,0])}}var D=new R,U=null;function E(t){U=t}function M(){return U}var C=null;function F(t){C=t}function I(){return C}var N=null;function V(t){N=t}function B(){return N}var X=k(),A=24,W=96,H=!1,q=!0;try{let t=new URLSearchParams(window.location.search);H="0"===t.get("dbgsbstatic"),q="0"!==t.get("sb512")}catch{}function K(t){let e=t.getAttribute("position");return void 0===e?-1:1048576*(e.version??e.data?.version??0)+(e.count??0)%1048576}var j=class extends a{constructor(t,e,i){super(t,e,i),this.data=e,this.isShapeBlendEntity=!0,this.needsRebuild=!0,this.customDepthMaterialNeedsUpdate=!1,this._prevShapeData=null,this._prevSpan=-1,this._reach=new Float32Array(96),this._prevReach=new Float32Array(96),this._fieldDirtyFull=!0,this._fieldDirtyMin=new p,this._fieldDirtyMax=new p,this._maxBlendK=0,this._meshSdfBaked=new Map,this._meshSdfWanted=new Map,this._passesRenderer=null,this._npart=-1,this.spatialn=1,this.drawRangeNeedsForceUpdate=!0,this._resolutionLevel=-1,this._authoredResolutionLevel=-1,this.ultraFieldResolution=0,this.resolution=64,this.spatialDivisions=25,this.zLayersPerRow=8,this.basePyramidSize=512,this.pyramidTexture1Width=341,this.pyramidTexture1Height=256,this.pyramidTexture2Width=170,this.pyramidTexture2Height=128,this.numLevels=9,this.pyramidLevelSizes=[1,2,4,8,16,32,64,128,256,512],this.bboxSize=0,this.bboxOffset=0,this.shapesDataTexture={value:void 0},this.spatialscene=new x,this.potentialPassScene=new x,this.voxelPassScene=new x,this._spatialPassRenderTargets=[],this._potentialPassRenderTargets=[],this._voxelPassRenderTargets=[],this._pyramidRenderTargets=[],this.geometry=new b,this.geometry.drawRange.count=0,this.spatialPassUniforms={span:{value:-1},shapesDataTexture:this.shapesDataTexture,npart:{value:this.npart},spatialn:{value:this.spatialn}},this.spatialMesh=new P(O,this.spatialPassMaterial()),this.spatialMesh.frustumCulled=!1,this.spatialscene.add(this.spatialMesh);let a=new w(X.triTable,16,256,u,o);a.needsUpdate=!0;let n=new w(X.numTrisTable,256,1,u,o);n.needsUpdate=!0,this.voxelPassUniforms={potentialPassTexture:{value:void 0},numTrisTable:{value:n}},this.voxelMesh=new P(O,this.voxelPassMaterial()),this.voxelMesh.frustumCulled=!1,this.voxelPassScene.add(this.voxelMesh),this.potentialPassUniforms={shapesDataTexture:this.shapesDataTexture,spatialPassTexture:{value:void 0},npart:{value:this.npart},spatialn:{value:this.spatialn}},this.potentialMesh=new P(O,this.potentialPassMaterial()),this.potentialMesh.frustumCulled=!1,this.potentialPassScene.add(this.potentialMesh),this.marchPassUniforms={triTable:{value:a},potentialPassTexture:{value:void 0},voxelPassTexture:{value:void 0},pyramidTexture1:{value:void 0},pyramidTexture1Size:{value:void 0},pyramidTexture2:{value:void 0},pyramidTexture2Size:{value:void 0}},this.frustumCulled=!1,this.onBeforeShadowPass=t=>{let e=at.call(this);if(0===this.npart)return void(this.geometry.drawRange.count=0);let i=this.material.root;if(i.shadersPatchedForShapeBlend){if(this.customDepthMaterialNeedsUpdate){this.customDepthMaterialNeedsUpdate=!1,this.customDepthMaterial=new S({vertexShader:i.vertexShader,fragmentShader:"\n\t\t\t\t\t\t#include <packing>\n\t\t\t\t\t\tvoid main()\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tgl_FragColor = packDepthToRGBA(gl_FragCoord.z);\n\t\t\t\t\t\t}\n\t\t\t\t\t",uniforms:i.uniforms,defines:this.material.defines}),this.isMeshDepthMaterial=!0,this.customDistanceMaterial=new S({vertexShader:i.vertexShader,fragmentShader:"\n\t\t\t\t\t#include <common>\n\t\t\t\t\t#include <packing>\n\t\t\t\t\tuniform vec3 referencePosition;\n\t\t\t\t\tuniform float nearDistance;\n\t\t\t\t\tuniform float farDistance;\n\t\t\t\t\t\n\t\t\t\t\tvarying vec3 vWPosition;\n\t\t\t\t\tvoid main()\n\t\t\t\t\t{\n\t\t\t\t\t\tfloat dist = length(vWPosition - referencePosition);\n\t\t\t\t\t\tdist = (dist - nearDistance) / (farDistance - nearDistance);\n\t\t\t\t\t\tdist = saturate(dist);\n\t\t\t\t\t\t\n\t\t\t\t\t\tgl_FragColor = packDepthToRGBA( dist );\n\t\t\t\t\t}",uniforms:{nearDistance:{value:0},farDistance:{value:0},referencePosition:{value:new p},opacity:{value:0},...i.uniforms},defines:this.material.defines});let t=this.customDistanceMaterial;t.referencePosition=new p,t.nearDistance=0,t.farDistance=0,t.opacity=1,t.isMeshDistanceMaterial=!0}}else this.patchVertexShaderForShapeBlend(i),i.shadersPatchedForShapeBlend=!0,this.customDepthMaterialNeedsUpdate=!0;this.spatialPassUniforms.npart.value=this.npart,this.spatialPassUniforms.spatialn.value=this.spatialn,this.potentialPassUniforms.npart.value=this.npart,this.potentialPassUniforms.spatialn.value=this.spatialn;let a=this.needsRebuild;if(this.needsRebuild){this.needsRebuild=!1,this.spatialMesh.material.defines.RES=this.resolutionLevel,this.spatialMesh.material.needsUpdate=!0,this.potentialMesh.material.defines.RES=this.resolutionLevel,this.potentialPassUniforms.spatialPassTexture.value=this.spatialPassRenderTarget.texture,this.potentialMesh.material.needsUpdate=!0,this.voxelMesh.material.defines.RES=this.resolutionLevel,this.voxelMesh.material.needsUpdate=!0,this.voxelPassUniforms.potentialPassTexture.value=this.potentialPassRenderTarget.texture,this.marchPassUniforms.potentialPassTexture.value=this.potentialPassRenderTarget.texture,this.marchPassUniforms.voxelPassTexture.value=this.voxelPassRenderTarget.textures[0],this.material.defines.RES=this.resolutionLevel,this.material.defines.LEVELS=this.pyramidLevelSizes.length,this.material.defines.LOOP=this.pyramidLevelSizes.length%2==0?this.pyramidLevelSizes.length-3:this.pyramidLevelSizes.length-2,this.material.defines.HALF=this.pyramidLevelSizes.length%2==0?1:0,this.material.needsUpdate=!0;let t=this.pyramidLevelSizes.length%2==0?0:1,e=this.pyramidLevelSizes.length%2==0?1:0;this.marchPassUniforms.pyramidTexture2.value=this.pyramidRenderTarget[t].texture,this.marchPassUniforms.pyramidTexture2Size.value=new l(this.pyramidRenderTarget[t].width,this.pyramidRenderTarget[t].height),this.marchPassUniforms.pyramidTexture1.value=this.pyramidRenderTarget[e].texture,this.marchPassUniforms.pyramidTexture1Size.value=new l(this.pyramidRenderTarget[e].width,this.pyramidRenderTarget[e].height),Object.assign(this.material.uniforms,this.marchPassUniforms)}if(!e&&!a&&!this.drawRangeNeedsForceUpdate&&this._passesRenderer===t)return;this._passesRenderer=t;let n=t.shadowMap.enabled;t.shadowMap.enabled=!1;let s=t.getRenderTarget();t.setRenderTarget(this.spatialPassRenderTarget),t.render(this.spatialscene,D),t.setRenderTarget(this.potentialPassRenderTarget),t.render(this.potentialPassScene,D),t.setRenderTarget(this.voxelPassRenderTarget),t.render(this.voxelPassScene,D),j.streamCompaction.renderPyramid(this.resolutionLevel,this.pyramidLevelSizes,t,this.voxelPassRenderTarget,this.pyramidRenderTarget).then(t=>{this.material.wireframe&&(3*t>this.geometry.attributes.position.count||this.drawRangeNeedsForceUpdate)&&(this.geometry.dispose(),this.geometry=new b,this.geometry.userData.parameters={width:this.bboxSize,height:this.bboxSize,depth:this.bboxSize,centerOffset:[this.bboxOffset,this.bboxOffset,this.bboxOffset]},this.geometry.attributes.position=new g(new Float32Array(3*t*2),3)),(3*t>this.geometry.drawRange.count||this.drawRangeNeedsForceUpdate)&&(this.geometry.drawRange.count=3*Math.floor(1.2*t),this.markSceneShadowsDirty()),this.drawRangeNeedsForceUpdate=!1}),t.shadowMap.enabled=n,t.setRenderTarget(s)}}markSceneShadowsDirty(){let t=this.parent;if(null!==t){for(;t.parent;)t=t.parent;t.markShadowsDirty?.()}}set npart(t){t!==this._npart&&(this.drawRangeNeedsForceUpdate=!0,this._npart=t,this.spatialn=Math.ceil(t/96))}get npart(){return this._npart}set resolutionLevel(t){let e=Math.min(q?9:8,Math.max(5,t));if(e===this._authoredResolutionLevel)return;this._authoredResolutionLevel=e,this.ultraFieldResolution=Math.pow(2,e);let i=Math.min(8,e);switch(this._resolutionLevel=i,this.resolution=Math.pow(2,i),this.resolutionLevel){case 5:this.pyramidLevelSizes=[1,2,4,6,12,24,48,96,192],this.bboxSize=496,this.bboxOffset=-8;break;case 6:this.pyramidLevelSizes=[1,2,4,8,16,32,64,128,256,512],this.bboxSize=504,this.bboxOffset=-4;break;case 7:this.pyramidLevelSizes=[1,2,4,6,12,24,48,96,192,384,768,1536],this.bboxSize=508,this.bboxOffset=-2;break;case 8:this.pyramidLevelSizes=[1,2,4,8,16,32,64,128,256,512,1024,2048,4096],this.bboxSize=510,this.bboxOffset=-1}this.pyramidTexture1Width=0,this.pyramidTexture2Width=0,this.pyramidTexture1Height=this.pyramidLevelSizes[this.pyramidLevelSizes.length-2],this.pyramidTexture2Height=this.pyramidLevelSizes[this.pyramidLevelSizes.length-3];for(let t=this.pyramidLevelSizes.length-2;t>=0;t--)(this.pyramidLevelSizes.length-2)%2==t%2?this.pyramidTexture1Width+=this.pyramidLevelSizes[t]:this.pyramidTexture2Width+=this.pyramidLevelSizes[t];this.basePyramidSize=this.pyramidLevelSizes[this.pyramidLevelSizes.length-1],this.zLayersPerRow=this.basePyramidSize/this.resolution,this.numLevels=this.pyramidLevelSizes.length-1,this.geometry.userData.parameters={width:this.bboxSize,height:this.bboxSize,depth:this.bboxSize,centerOffset:[this.bboxOffset,this.bboxOffset,this.bboxOffset]},this.needsRebuild=!0,this.customDepthMaterialNeedsUpdate=!0}get resolutionLevel(){return this._resolutionLevel}get spatialPassRenderTarget(){let t=this._spatialPassRenderTargets[this.resolutionLevel];return t||(t=new f(this.spatialDivisions*this.spatialn,this.spatialDivisions**2,{format:d,type:o,stencilBuffer:!1,depthBuffer:!1,generateMipmaps:!1,minFilter:_,magFilter:_}),this._spatialPassRenderTargets[this.resolutionLevel]=t),t}get potentialPassRenderTarget(){let t=this._potentialPassRenderTargets[this.resolutionLevel];return t||(t=new f(this.basePyramidSize,this.basePyramidSize,{format:d,type:o,stencilBuffer:!1,depthBuffer:!1,generateMipmaps:!1,minFilter:_,magFilter:_}),this._potentialPassRenderTargets[this.resolutionLevel]=t),t}get voxelPassRenderTarget(){let t=this._voxelPassRenderTargets[this.resolutionLevel];return t||(t=new f(this.basePyramidSize,this.basePyramidSize,{count:2,stencilBuffer:!1,depthBuffer:!1,generateMipmaps:!1,minFilter:_,magFilter:_}),t.textures[0].format=d,t.textures[0].type=o,t.textures[1].format=u,t.textures[1].type=o,this._voxelPassRenderTargets[this.resolutionLevel]=t),t}get pyramidRenderTarget(){let t=this._pyramidRenderTargets[this.resolutionLevel];return t||(t=[new f(this.pyramidTexture1Width,this.pyramidTexture1Height,{format:d,type:o,stencilBuffer:!1,depthBuffer:!1,magFilter:_,minFilter:_}),new f(this.pyramidTexture2Width,this.pyramidTexture2Height,{format:d,type:o,stencilBuffer:!1,depthBuffer:!1,magFilter:_,minFilter:_})],this._pyramidRenderTargets[this.resolutionLevel]=t),t}updateState(t,e){let i=this.material;super.updateState(t,e),i!==this.material&&(this.needsRebuild=!0),t.geometry&&(this.resolutionLevel=t.geometry.resolutionLevel,this.geometry.userData.parameters={width:this.bboxSize,height:this.bboxSize,depth:this.bboxSize,centerOffset:[this.bboxOffset,this.bboxOffset,this.bboxOffset]}),t.wireframe&&!this.geometry.getAttribute("position")?this.geometry.setAttribute("position",new g(new Float32Array(3*this.geometry.drawRange.count),3)):!t.wireframe&&this.geometry.getAttribute("position")&&this.geometry.deleteAttribute("position")}spatialPassMaterial(){let t=`\n\t\t\tprecision highp float;\n\t\t\tout vec4 pc_FragColor;\n\t\t\tconst float spatialDivisions = ${this.spatialDivisions}.;\n\t\t\tuniform float span;\n\t\t\tuniform float npart;\n\t\t\tuniform float spatialn;\n\t\t\t${X.shapeInput()}\n\n\t\t\tvec3 low, high; \n\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\tfloat spatialKey(float lowi) {\n\t\t\t\tfloat t = 0.;\n\t\t\t\tfor (float ii = 23.; ii >= 0.; ii--) {\n\t\t\t\t\tfloat i = ii + lowi;\n\t\t\t\t\tfloat iin = (i + 0.5) / 96.;\n\t\t\t\t\tvec4 shape = shapePos(iin);\n\t\t\t\t\tvec3 d = shape.xyz;\n\t\t\t\t\tfloat op = shape.w;\n\t\n\t\t\t\t\tt *= 2.;\n\t\t\t\t\tt += (\n\t\t\t\t\t\tlow.x < d.x && d.x < high.x &&\n\t\t\t\t\t\tlow.y < d.y && d.y < high.y &&\n\t\t\t\t\t\tlow.z < d.z && d.z < high.z &&\n\t\t\t\t\t\ti < npart || op == -2. \n\t\t\t\t\t) ? 1. : 0.;\n\t\t\t\t}\n\t\t\t\treturn t;\n\t\t\t}\n\n\t\t\t${X.getpart}\n\n\t\t\tvoid main() { \n\t\t\t\t\n\t\t\t\tvec3 div; \n\t\t\t\t\n\t\t\t\tfloat yz = float(gl_FragCoord.y - 0.5); \n\t\t\t\tdiv.y = getpart(yz, spatialDivisions);\n\t\t\t\tdiv.z = yz; \n\n\t\t\t\tfloat lx = float(gl_FragCoord.x - 0.5); \n\t\t\t\tfloat lowi = getpart(lx, spatialn) * 96.;\n\t\t\t\tdiv.x = lx;\n\n\t\t\t\tlow = div / spatialDivisions * 2. - 1. - span;\n\t\t\t\thigh = (div+1.) / spatialDivisions * 2. - 1. + span;\n\n\t\t\t\t\n\t\t\t\tpc_FragColor.x = spatialKey(lowi);\n\t\t\t\tpc_FragColor.y = spatialKey(lowi+24.);\n\t\t\t\tpc_FragColor.z = spatialKey(lowi+48.);\n\t\t\t\tpc_FragColor.w = spatialKey(lowi+72.);\n\t\t\t}\n\t\t`;return new L({name:"Spatial Pass",fragmentShader:t,uniforms:this.spatialPassUniforms})}potentialPassMaterial(){let t=`\n\t\t\tprecision highp float;\n\t\t\tout vec4 pc_FragColor;\n\n\t\t\t${X.shapeInput()}\n\t\t\tuniform sampler2D spatialPassTexture;\n\n\t\t\tconst float res = float(RES);\n\t\t\tconst float VOXEL_RESOLUTION = pow(2., res);\n\t\t\tconst float Z_LAYERS_PER_ROW = ceil(pow(2., res / 2.));\n\t\t\tconst float VOXEL_RESOLUTION_SUB1 = VOXEL_RESOLUTION - 1.;\n\t\t\tconst float INV_VOXEL_RESOLUTION = 1.0 / VOXEL_RESOLUTION;\n\n\t\t\tuniform float npart;\n\t\t\tuniform float spatialn;\n\t\t\tconst float spatialDivisions = ${this.spatialDivisions}.;\n\t\t\tconst float spatialDivisions2 = spatialDivisions * spatialDivisions;\n\t\t\tconst float spatialDivisionsSub1 = spatialDivisions - 1.;\n\n\t\t\t${X.getpart}\n\n\t\t\tvec3 packRGBAToVec3(vec4 color) {\n\t\t\t\tuint r = uint(color.r * 255.);\n\t\t\t\tuint g = uint(color.g * 255.);\n\t\t\t\tuint combined = (r << 8) | g; \n\t\t\t\treturn vec3(float(combined) * 0.00001525902, color.b, color.a); \n\t\t\t}\n\n\t\t\tvoid applyQuaternionToVector(in vec4 q, inout vec3 v) {\n\t\t\t\tv += 2.0 * cross(q.xyz, cross(q.xyz, v) + q.w * v);\n\t\t\t}\n\n\t\t\t\n\n\n\n\t\t\t\n\t\t\tfloat smoothOperation(float op, float sdf, float d, float k) {\n\t\t\t \n\t\t\t \n\t\t\t\t\n\n\t\t\t\tfloat signSubtract = clamp(op, -1., 1.);\n\t\t\t\tfloat signIntersection = 2. * (op - signSubtract) + 1.;\n\t\t\t\tfloat h = clamp(\n\t\t\t\t\t0.5 + signSubtract * 0.5 * (sdf - signSubtract * signIntersection * d) / k,\n\t\t\t\t\t0.0,\n\t\t\t\t\t1.0\n\t\t\t\t);\n\t\t\t\treturn mix(sdf, signSubtract * signIntersection * d, h) - \n\t\t\t\t\t\t\t signSubtract * k * h * (1.0 - h);\n\t\t\t}\n\n\t\t\tfloat sdSphere( vec3 p, float s )\n\t\t\t{\n\t\t\t\treturn length(p)-s;\n\t\t\t}\n\n\t\t\tfloat sdEllipsoid( vec3 p, vec3 r )\n\t\t\t{\n\t\t\t\tfloat k0 = length(p/r);\n\t\t\t\tfloat k1 = length(p/(r*r));\n\t\t\t\treturn k0*(k0-1.0)/k1;\n\t\t\t}\n\n\t\t\tfloat sdBox( vec3 p, vec3 b )\n\t\t\t{\n\t\t\t\tvec3 q = abs(p) - b;\n\t\t\t\treturn length(max(q,0.0)) + min(max(q.x,max(q.y,q.z)),0.0);\n\t\t\t}\n\n\t\t\tfloat sdTorus( vec3 p, vec2 t )\n\t\t\t{\n\t\t\t\tvec2 q = vec2(length(p.xy)-t.x,p.z);\n\t\t\t\treturn length(q)-t.y;\n\t\t\t}\n\n\t\t\tfloat sdCappedTorus( vec3 p, vec2 sc, float ra, float rb)\n\t\t\t{\n\t\t\t\tp.x = abs(p.x);\n\t\t\t\tfloat k = (sc.y*p.x>sc.x*p.y) ? dot(p.xy,sc) : length(p.xy);\n\t\t\t\treturn sqrt( dot(p,p) + ra*ra - 2.0*ra*k ) - rb;\n\t\t\t}\n\n\t\t\tfloat dot2( in vec2 v ) { return dot(v,v); }\n\t\t\tfloat sdCappedCone( vec3 p, float h, float r1, float r2 )\n\t\t\t{\n\t\t\t\tvec2 q = vec2( length(p.xz), p.y );\n\t\t\t\tvec2 k1 = vec2(r2,h);\n\t\t\t\tvec2 k2 = vec2(r2-r1,2.0*h);\n\t\t\t\tvec2 ca = vec2(q.x-min(q.x,(q.y<0.0)?r1:r2), abs(q.y)-h);\n\t\t\t\tvec2 cb = q - k1 + k2*clamp( dot(k1-q,k2)/dot2(k2), 0.0, 1.0 );\n\t\t\t\tfloat s = (cb.x<0.0 && ca.y<0.0) ? -1.0 : 1.0;\n\t\t\t\treturn s*sqrt( min(dot2(ca),dot2(cb)) );\n\t\t\t}\n\n\t\t\tfloat sdCappedCylinder( vec3 p, float h, float r )\n\t\t\t{\n\t\t\t\tvec2 d = abs(vec2(length(p.xz),p.y)) - vec2(r,h);\n\t\t\t\treturn min(max(d.x,d.y),0.0) + length(max(d,0.0));\n\t\t\t}\n\n\t\t\tfloat maxBlend = 0.0;\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\tvoid fillSpatialInner(\n\t\t\t\tfloat ii,\n\t\t\t\tfloat activeKey,\n\t\t\t\tvec3 corner,\n\t\t\t\tinout float sdf,\n\t\t\t\tinout float colorDivisor,\n\t\t\t\tinout vec4 trackColor\n\t\t\t) {\n\t\t\t\tfor (float i = 0.; i < 24.; i++) {\n\t\t\t\t\tif (activeKey < 1.) break; \n\t\t\t\t\tactiveKey *= 0.5;\n\t\t\t\t\tif (fract(activeKey) < 0.5) continue;\n\n\t\t\t\t\tfloat iin = (i + ii + 0.5) * ${1/96};\n\t\t\t\t\tvec4 shape = shapePos(iin);\n\t\t\t\t\tvec4 quat = shapeQuat(iin);\n\t\t\t\t\tvec4 params1 = shapeParams1(iin);\n\t\t\t\t\tvec4 params2 = shapeParams2(iin);\n\n\t\t\t\t\tvec3 p = corner - shape.xyz;\n\t\t\t\t\tapplyQuaternionToVector(quat, p);\n\t\t\t\t\tp /= params2.z; // scale\n\t\t\t\t\tfloat d; // d in -1..1 coordinates\n\t\t\t\t\tswitch (int(params1.x)) {\n\t\t\t\t\t\tcase 0: d = sdSphere(p, params1.y); break;\n\t\t\t\t\t\tcase 1: d = sdEllipsoid(p, params1.yzw); break;\n\t\t\t\t\t\tcase 2: d = sdBox(p, params1.yzw); break;\n\t\t\t\t\t\tcase 3: d = sdCappedCylinder(p, params1.y, params1.z); break;\n\t\t\t\t\t\tcase 4: d = sdCappedCone(p, params1.y, params1.z, params1.w); break;\n\t\t\t\t\t\tcase 5: d = sdTorus(p, params1.yz); break;\n\t\t\t\t\t\tcase 6: d = sdCappedTorus(p, params1.yz, params1.w, params2.w); break;\n\t\t\t\t\t\t// Mesh children (type 7) live in a WebGPU-only baked SDF\n\t\t\t\t\t\t// atlas — the GLSL evaluator skips the shape entirely\n\t\t\t\t\t\t// (also closes the latent uninitialized-d default).\n\t\t\t\t\t\tdefault: continue;\n\t\t\t\t\t}\n\t\t\t\t\td -= params2.y; // rounded edge\n\t\t\t\t\td *= params2.z; // scale\n\n\t\t\t\t\tfloat k = params2.x;\n\t\t\t\t\tfloat op = shape.w;\n\n\t\t\t\t\tsdf = smoothOperation(shape.w, sdf, d, k);\n\n\t\t\t\t\tfloat isNegativeOne = step(-1.5, op) * step(op, -0.5); // 1 when op == -1, 0 otherwise\n\t\t\t\t\tfloat colorCull = smoothstep(maxBlend, 0., -d);\n\t\t\t\t\tfloat cullFactor = mix(1.0, colorCull, isNegativeOne);\n\t\t\t\t\ttrackColor *= cullFactor;\n\t\t\t\t\tcolorDivisor *= cullFactor;\n\n\t\t\t\t\tmaxBlend = max(maxBlend, k);\n\n\t\t\t\t\tk += 2. * INV_VOXEL_RESOLUTION; // avoid division by zero, and other color artifacts with very small k\n\t\t\t\t\tfloat nearness = smoothstep(k, 0., d);\n\n\t\t\t\t\tvec4 color = shapeColor(iin);\n\t\t\t\t\tnearness *= float(color.a >= 0.);\n\n\t\t\t\t\tcolorDivisor += nearness;\n\t\t\t\t\ttrackColor += color * nearness;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tvec3 div;\n\t\t\t// compute potential from all spheres; collect +ve and =ve values separately\n\t\t\t// work in blocks of A*4 (=96) spheres, using the bit flags in 4 float channel 'activeKey' values\n\t\t\t// TODO check if extra vec3 output useful, not really used at present\n\t\t\tfloat fillSpatial(vec3 corner, inout vec4 trackColor) {\n\t\t\t\tfloat sdf = 1e3; // hack: initialize to large value\n\t\t\t\tfloat colorDivisor = 0.;\n\t\t\t\t// spatialPassTexture holds x=> lowi, x faster moving and y=> z, y faster moving\n\t\t\t\tfloat divyz = (div.y + div.z * spatialDivisions + 0.5) / (spatialDivisions2);\n\t\t\t\tfor (float ii = 0.; ii < spatialn; ii++) {\n\t\t\t\t\tfloat i = ii * 96.;\n\n\t\t\t\t\tvec4 activeKey = texture(spatialPassTexture, vec2((div.x * spatialn + ii + 0.5)/(spatialn * spatialDivisions), divyz));\n\t\t\t\t\tfillSpatialInner(i, activeKey.x, corner, sdf, colorDivisor, trackColor);\n\t\t\t\t\tfillSpatialInner(i+24., activeKey.y, corner, sdf, colorDivisor, trackColor);\n\t\t\t\t\tfillSpatialInner(i+48., activeKey.z, corner, sdf, colorDivisor, trackColor);\n\t\t\t\t\tfillSpatialInner(i+72., activeKey.w, corner, sdf, colorDivisor, trackColor);\n\t\t\t\t}\n\n\t\t\t\ttrackColor /= colorDivisor;\n\t\t\t\treturn mix(sdf, 0.0, step(1e20 - 0.1, sdf));\n\t\t\t}\n\n\t\t\tvoid main() {\n\t\t\t\t${X.getxyzi} \n\n\t\t\t\tvec3 xyzi = vec3(xi,yi,zi);\n\t\t\t\tvec3 corner = xyzi / VOXEL_RESOLUTION_SUB1 * 2. - 1.; \n\n\t\t\t\tdiv = floor(xyzi / VOXEL_RESOLUTION_SUB1 * spatialDivisionsSub1);\n\n\t\t\t\tvec4 c = vec4(0.);\n\t\t\t\tfloat t = fillSpatial(corner, c);\n\n\t\t\t\tpc_FragColor = vec4(t, packRGBAToVec3(c)); \n\t\t\t}\n\t\t`;return new L({name:"PotentialPass",fragmentShader:t,uniforms:this.potentialPassUniforms})}voxelPassMaterial(){let t=`\n\t\t\tprecision highp float;\n\t\t\tlayout(location = 0) out vec4 pc_FragColor;\n\t\t\tlayout(location = 1) out vec4 numTris;\n\n\t\t\tconst float res = float(RES);\n\t\t\tconst float VOXEL_RESOLUTION = pow(2., res);\n\t\t\tconst float VOXEL_RESOLUTION_SUB1 = VOXEL_RESOLUTION - 1.; \n\t\t\tconst float Z_LAYERS_PER_ROW = ceil(pow(2., res / 2.));\n\t\t\tconst float INV_VOXEL_RESOLUTION = 1.0 / VOXEL_RESOLUTION;\n\t\t\tuniform sampler2D numTrisTable; \n\n\t\t\tfloat keyi(float f000, float f100, float f010, float f110, float f001, float f101, float f011, float f111) {\n\t\t\t\treturn (float(f000 < 0.) * 1.) +\n\t\t\t\t\t\t\t (float(f100 < 0.) * 2.) +\n\t\t\t\t\t\t\t (float(f010 < 0.) * 8.) +\n\t\t\t\t\t\t\t (float(f110 < 0.) * 4.) +\n\t\t\t\t\t\t\t (float(f001 < 0.) * 16.) +\n\t\t\t\t\t\t\t (float(f101 < 0.) * 32.) +\n\t\t\t\t\t\t\t (float(f011 < 0.) * 128.) +\n\t\t\t\t\t\t\t (float(f111 < 0.) * 64.);\n\t\t\t}\n\n\t\t\t${X.lookup}\n\n\t\t\tvec3 compNormi(float xi, float yi, float zi) {\n\t\t\t\tfloat dx = look(xi + 1., yi, zi, potentialPassTexture).r - look(xi - 1., yi, zi, potentialPassTexture).r;\n\t\t\t\tfloat dy = look(xi, yi + 1., zi, potentialPassTexture).r - look(xi, yi - 1., zi, potentialPassTexture).r;\n\t\t\t\tfloat dz = look(xi, yi, zi + 1., potentialPassTexture).r - look(xi, yi, zi - 1., potentialPassTexture).r;\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tif (dx == 0.0 && dy == 0.0 && dz == 0.0) {\n\t\t\t\t\treturn vec3(0.199, 0.299, 0.399);\n\t\t\t\t}\n\t\t\t\treturn normalize(vec3(dx, dy, dz));\n\t\t\t}\n\n\t\t\tvoid main() {\n\t\t\t\t${X.getxyzi} \n\n\t\t\t\tvec3 normal = compNormi(xi, yi, zi); \n\n\t\t\t\tif (xi >= VOXEL_RESOLUTION_SUB1 || yi >= VOXEL_RESOLUTION_SUB1 || zi >= VOXEL_RESOLUTION_SUB1) {\n\t\t\t\t\tpc_FragColor = vec4(normal, 0.);\n\t\t\t\t\tnumTris = vec4(0.);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tfloat\n\t\t\t\t\tf000 = look(xi, yi, zi, potentialPassTexture).r,\n\t\t\t\t\tf100 = look(xi+1., yi, zi, potentialPassTexture).r,\n\t\t\t\t\tf010 = look(xi, yi+1., zi, potentialPassTexture).r,\n\t\t\t\t\tf110 = look(xi+1., yi+1., zi, potentialPassTexture).r,\n\t\t\t\t\tf001 = look(xi, yi, zi+1., potentialPassTexture).r,\n\t\t\t\t\tf101 = look(xi+1., yi, zi+1., potentialPassTexture).r,\n\t\t\t\t\tf011 = look(xi, yi+1., zi+1., potentialPassTexture).r,\n\t\t\t\t\tf111 = look(xi+1., yi+1., zi+1., potentialPassTexture).r;\n\t\t\t\tfloat key = keyi(f000, f100, f010, f110, f001, f101, f011, f111);\n\n\t\t\t\tpc_FragColor = vec4(normal, key);\n\n\t\t\t\tnumTris = texture(numTrisTable, vec2((key + 0.5) / 256., 0.5));\n\t\t\t}\n\t\t`;return new L({name:"VoxelPass",fragmentShader:t,uniforms:this.voxelPassUniforms})}patchVertexShaderForShapeBlend(t){let e=`\n\t\t#ifdef SHAPEBLEND \n\t\t\tprecision highp sampler2D;\n\n\t\t\tuniform float isol;\n\n\t\t\tuniform sampler2D triTable; \n\t\t\tuniform sampler2D pyramidTexture1;\n\t\t\tuniform vec2 pyramidTexture1Size;\n\t\t\tuniform sampler2D pyramidTexture2;\n\t\t\tuniform vec2 pyramidTexture2Size;\n\n\t\t\tconst vec2 halfPixelOffset = vec2(0.5, 0.5);\n\n\t\t\tconst vec2 rShift = vec2(0., 1.);\n\t\t\tconst vec2 gShift = vec2(1., 1.);\n\t\t\tconst vec2 bShift = vec2(1., 0.);\n\n\t\t\tconst float res = float(RES);\n\t\t\tconst float VOXEL_RESOLUTION = pow(2., res);\n\t\t\tconst float Z_LAYERS_PER_ROW = ceil(pow(2., res / 2.));\n\t\t\tconst float INV_VOXEL_RESOLUTION = 1.0 / VOXEL_RESOLUTION;\n\n\t\t\tconst float scale_factor = 2.;\n\n\t\t\t#if SHAPEBLEND == 5\n\t\t\t\tconst float levelShiftX[7] = float[7](4., 6., 12., 24., 48., 96., 192.);\n\t\t\t\tconst float scale = 8. * scale_factor;\n\t\t\t\tconst vec3 originOffset = vec3(16.);\n\t\t\t#elif SHAPEBLEND == 7\n\t\t\t\tconst float levelShiftX[10] = float[10](4., 6., 12., 24., 48., 96., 192., 384., 768., 1536.); \n\t\t\t\tconst float scale = 2. * scale_factor;\n\t\t\t\tconst vec3 originOffset = vec3(64.);\n\t\t\t#elif SHAPEBLEND == 8\n\t\t\t\tconst float levelShiftX[11] = float[11](4., 8., 16., 32., 64., 128., 256., 512., 1024., 2048., 4096.);\n\t\t\t\tconst float scale = scale_factor;\n\t\t\t\tconst vec3 originOffset = vec3(128.);\n\t\t\t#else\n\t\t\t\tconst float levelShiftX[8] = float[8](4., 8., 16., 32., 64., 128., 256., 512.);\n\t\t\t\tconst float scale = 4. * scale_factor;\n\t\t\t\tconst vec3 originOffset = vec3(32.);\n\t\t\t#endif\n\n\t\t\t${X.lookup}\n\n\t\t\tconst vec3 offsets[24] = vec3[](\n\t\t\t\tvec3(0., 0., 0.), vec3(1., 0., 0.),\n\t\t\t\tvec3(1., 0., 0.), vec3(1., 1., 0.),\n\t\t\t\tvec3(0., 1., 0.), vec3(1., 1., 0.),\n\t\t\t\tvec3(0., 0., 0.), vec3(0., 1., 0.),\n\t\t\t\tvec3(0., 0., 1.), vec3(1., 0., 1.),\n\t\t\t\tvec3(1., 0., 1.), vec3(1., 1., 1.),\n\t\t\t\tvec3(0., 1., 1.), vec3(1., 1., 1.),\n\t\t\t\tvec3(0., 0., 1.), vec3(0., 1., 1.),\n\t\t\t\tvec3(0., 0., 0.), vec3(0., 0., 1.),\n\t\t\t\tvec3(1., 0., 0.), vec3(1., 0., 1.),\n\t\t\t\tvec3(1., 1., 0.), vec3(1., 1., 1.),\n\t\t\t\tvec3(0., 1., 0.), vec3(0., 1., 1.)\n\t\t\t);\n\n\t\t\tvec2 computeShiftedPosition1(vec2 xy, float levelOriginX) {\n\t\t\t\tvec2 xyShifted = xy;\n\t\t\t\txyShifted.x += levelOriginX;\n\t\t\t\treturn (xyShifted + halfPixelOffset) / pyramidTexture1Size;\n\t\t\t}\n\n\t\t\tvec2 computeShiftedPosition2(vec2 xy, float levelOriginX) {\n\t\t\t\tvec2 xyShifted = xy;\n\t\t\t\txyShifted.x += levelOriginX;\n\t\t\t\treturn (xyShifted + halfPixelOffset) / pyramidTexture2Size;\n\t\t\t}\n\n\t\t\tvec4 unpackVec3ToRGBA(vec3 vec) {\n\t\t\t\tuint combined = uint(vec.x * 65535.0 + 0.5); \n\t\t\t\tfloat g = float(combined & uint(0xFF)) * 0.00392156862; \n\t\t\t\tfloat r = float((combined >> 8) & uint(0xFF)) * 0.00392156862; \n\t\t\n\t\t\t\treturn vec4(r, g, vec.y, vec.z);\n\t\t\t}\n\n\t\t\tout vec4 marchColor;\n\t\t\t\n\t\t#endif\n\t\t`;t.vertexShader=e+t.vertexShader.replace("#include <project_vertex>","\n\t\t#ifdef SHAPEBLEND\n\t\t\tfloat triIndex = floor(float(gl_VertexID/3));\n\t\t\tfloat vertexIndex = float(gl_VertexID);\n\t\t\t\n\t\t\t\n\t\t\tfloat levelOriginX1 = pyramidTexture1Size.x - 2.;\n\t\t\tfloat levelOriginX2 = pyramidTexture2Size.x - 1.;\n\t\t\tvec2 xy = vec2(0.);\n\t\t\tvec4 lookUp = texture(pyramidTexture2, computeShiftedPosition2(xy, levelOriginX2));\n\t\t\t\n\t\t\t\n\t\t\tif (triIndex >= lookUp.r) return;\n\t\t\t\n\t\t\t\n\t\t\tfloat start = 0.;\n\t\t\tvec4 triIndexVec = vec4(triIndex);\n\t\t\t\n\t\t\t\n\t\t\tfor (int i = 0; i < LOOP;) {\n\t\t\t\t\n\t\t\t\tvec4 ends = lookUp + vec4(start);\n\t\t\t\tvec4 starts = vec4(ends.gba, start);\n\t\t\t\tvec4 check = vec4(greaterThanEqual(triIndexVec, starts)) * \n\t\t\t\t\t\t\t\t\t\t\tvec4(lessThan(triIndexVec, ends));\n\t\t\t\t\n\t\t\t\t\n\t\t\t\txy *= 2.;\n\t\t\t\txy += check.r * rShift + check.g * gShift + check.b * bShift;\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tstart = dot(check, starts);\n\t\t\t\tlevelOriginX2 -= levelShiftX[i];\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tlookUp = texture(pyramidTexture1, computeShiftedPosition1(xy, levelOriginX1));\n\t\t\t\ti++;\n\n\t\t\t\tends = lookUp + vec4(start);\n\t\t\t\tstarts = vec4(ends.gba, start);\n\t\t\t\tcheck = vec4(greaterThanEqual(triIndexVec, starts)) * \n\t\t\t\t\t\t\t\t\t\t\tvec4(lessThan(triIndexVec, ends));\n\t\t\t\t\n\t\t\t\t\n\t\t\t\txy *= 2.;\n\t\t\t\txy += check.r * rShift + check.g * gShift + check.b * bShift;\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tstart = dot(check, starts);\n\t\t\t\tlevelOriginX1 -= levelShiftX[i];\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tlookUp = texture(pyramidTexture2, computeShiftedPosition2(xy, levelOriginX2));\n\n\t\t\t\ti++;\n\t\t\t}\n\n\t\t\t#if HALF == 1\n\t\t\t\tvec4 ends = lookUp + vec4(start);\n\t\t\t\tvec4 starts = vec4(ends.gba, start);\n\t\t\t\tvec4 check = vec4(greaterThanEqual(triIndexVec, starts)) * vec4(lessThan(triIndexVec, ends));\n\t\t\t\n\t\t\t\t\n\t\t\t\txy *= 2.;\n\t\t\t\txy += check.r * rShift + check.g * gShift + check.b * bShift;\n\t\t\t\n\t\t\t\t\n\t\t\t\tstart = dot(check, starts);\n\t\t\t#endif\n\t\t\t\n\t\t\t\n\t\t\tvec3 gridPos;\n\t\t\tgridPos.x = mod(xy.x, VOXEL_RESOLUTION);\n\t\t\tgridPos.y = mod(xy.y, VOXEL_RESOLUTION);\n\t\t\tgridPos.z = floor(xy.x * INV_VOXEL_RESOLUTION) + \n\t\t\t\t\t\t\t\t\tfloor(xy.y * INV_VOXEL_RESOLUTION) * Z_LAYERS_PER_ROW;\n\t\t\t\n\t\t\t\n\t\t\tvertexIndex -= start * 3.;\n\t\t\tfloat vk = vertexIndex * 0.0625 + 0.03125; \n\t\t\t\n\t\t\t\n\t\t\tvec4 voxel = look(gridPos.x, gridPos.y, gridPos.z, voxelPassTexture);\n\t\t\tfloat key = (voxel.w + 0.5) * 0.00390625; \n\t\t\t\n\t\t\t\n\t\t\tfloat edgeNum = texture(triTable, vec2(vk, key)).x;\n\t\t\tint edgeIndex = int(edgeNum) * 2;\n\t\t\t\n\t\t\t\n\t\t\tvec3 p1 = gridPos + offsets[edgeIndex];\n\t\t\tvec3 p2 = gridPos + offsets[edgeIndex + 1];\n\t\t\t\n\t\t\t\n\t\t\tvec4 potential1 = look(p1.x, p1.y, p1.z, potentialPassTexture);\n\t\t\tvec4 potential2 = look(p2.x, p2.y, p2.z, potentialPassTexture);\n\t\t\t\n\t\t\t\n\t\t\tfloat mu = potential1.r / (potential1.r - potential2.r);\n\n\t\t\tmarchColor = mix(\n\t\t\t\tunpackVec3ToRGBA(potential1.gba),\n\t\t\t\tunpackVec3ToRGBA(potential2.gba),\n\t\t\t\tmu\n\t\t\t);\n\n\t\t\ttransformed = p1 + (p2 - p1) * mu;\n\t\t\ttransformed -= originOffset;\n\t\t\ttransformed *= scale;\n\t\t\tvec4 data1 = look(p1.x, p1.y, p1.z, voxelPassTexture);\n\t\t\tvec4 data2 = look(p2.x, p2.y, p2.z, voxelPassTexture);\n\t\t\tobjectNormal = normalize(mix(data1.xyz, data2.xyz, mu));\n\t\t\ttransformedNormal = normalMatrix * objectNormal;\n\t\t\t#ifndef FLAT_SHADED\n\t\t\t\tvNormal = transformedNormal;\n\t\t\t#endif\n\t\t#endif\n\t\t\n#include <project_vertex>");let i=t.fragmentShader.match(/vec3 diffuseColor[^\n]*\n/);if(!i)return;let a=`\n\t\t#ifdef SHAPEBLEND_C\n\t\t\t#if SHAPEBLEND_C == 1\n\t\t\t\t${i[0].replace(/nodeU0,/g,"marchColor.rgb,").replace(/nodeU\d+(?=,g_uid\d+_calpha\))/g,"marchColor.a")}\n\t\t\t#else\n\t\t\t\t${i[0]}\n\t\t\t#endif\n\t\t#else\n\t\t\t${i[0]}\n\t\t#endif\n\t\t`;t.fragmentShader="in vec4 marchColor;\n"+t.fragmentShader.replace(i[0],a),Object.assign(t.uniforms,this.marchPassUniforms)}initDebugPass(t){console.log("fboToDebug.width",t.width,t.height),this.geometry=new y(t.width,t.height),this.geometry.userData={parameters:{width:4,height:4}};let e={inputTexture:{value:t.textures.length>1?t.textures[1]:t.texture},pyramidTextureSize:{value:void 0}},i=t=>{t.vertexShader="\n\t\t\t\tprecision highp float;\n\n\t\t\t\tvarying vec2 vUv;\n\n\t\t\t\tvoid main() {\n\t\t\t\t\t\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\t\t\t\t\t\tvUv = uv;\n\t\t\t\t}\n\t\t\t",t.fragmentShader="\n\t\t\t\tlayout(location = 1) out vec4 gVelocity;\n\n\t\t\t\tprecision highp float;\n\t\t\t\t\n\t\t\t\tuniform sampler2D inputTexture;\n\t\t\t\tvarying vec2 vUv;\n\n\t\t\t\tuniform vec2 pyramidTextureSize;\n\n\t\t\t\tvoid main() {\n\t\t\t\t\t\t\n\t\t\t\t\t\tgl_FragColor = texture(inputTexture, vUv);\n\t\t\t\t\t\tgVelocity = vec4(0.0);\n\t\t\t\t}\n\t\t\t",e.pyramidTextureSize.value=new l(this.pyramidRenderTarget[0].width,this.pyramidRenderTarget[0].height),Object.assign(t.uniforms,e)};this.material.shapeBlendhack=i,this.material.root.shapeBlendhack=i}dispose(){super.dispose(),B()?.release(this)}},G=j;G.streamCompaction=new class{constructor(){this.pyramidPassScene=new x,this.pyramidPassMaterial=new L({name:"PyramidPass"}),this.pyramidPassUniforms={inputTexture:{value:void 0},inputWidth:{value:0},inputHeight:{value:0},inputShiftX:{value:0},outputShiftX:{value:0}},this.pyramidTopLevelReadPixelBuffer=new Float32Array(4),this.pyramidPassMaterial.fragmentShader="\n\t\t\tprecision highp float;\n\t\t\tprecision highp sampler2D;\n\t\t\tlayout(location = 0) out vec4 pc_FragColor;\n\t\t\tuniform sampler2D inputTexture;\n\t\t\tuniform float inputWidth;\n\t\t\tuniform float inputHeight;\n\t\t\tuniform float inputShiftX;\n\t\t\tuniform float outputShiftX;\n\t\t\tconst vec2 half_unit_coord = vec2(0.5);\n\t\t\tconst vec4 one = vec4(1.0);\n\t\t\tvoid main() {\n\t\t\t\tvec2 inputSize = vec2(inputWidth, inputHeight);\n\t\t\t\tvec2 input_pixel_uv = 1. / inputSize;\n\t\t\t\tvec2 coord = gl_FragCoord.xy - half_unit_coord;\n\t\t\t\tcoord.x -= outputShiftX;\n\t\t\t\tcoord = coord * 2. + half_unit_coord;\n\t\t\t\tcoord.x += inputShiftX;\n\n\t\t\t\t\n\t\t\t\tvec2 input_uv = coord / inputSize;\n\t\t\t\tfloat bl = texture(inputTexture, input_uv).r;\n\n\t\t\t\t\n\t\t\t\tinput_uv.x += input_pixel_uv.x;\n\t\t\t\tfloat br = texture(inputTexture, input_uv).r;\n\n\t\t\t\t\n\t\t\t\tinput_uv.y += input_pixel_uv.y;\n\t\t\t\tfloat tr = texture(inputTexture, input_uv).r;\n\n\t\t\t\t\n\t\t\t\tinput_uv.x -= input_pixel_uv.x;\n\t\t\t\tfloat tl = texture(inputTexture, input_uv).r;\n\n\t\t\t\tpc_FragColor.a = bl;\n\t\t\t\tpc_FragColor.b = pc_FragColor.a + br;\n\t\t\t\tpc_FragColor.g = pc_FragColor.b + tr;\n\t\t\t\tpc_FragColor.r = pc_FragColor.g + tl; \n\t\t\t}\n\t\t",this.pyramidPassMaterial.uniforms=this.pyramidPassUniforms,this.pyramidPassMaterial.depthTest=!1,this.pyramidPassMaterial.depthWrite=!1;let t=new P(O,this.pyramidPassMaterial);t.frustumCulled=!1,this.pyramidPassScene.add(t)}renderPyramid(t,e,i,a,n){(new m).min.setScalar(0);let s=e.length-1,r=new c;i.getViewport(r),this.pyramidPassUniforms.inputShiftX.value=0,this.pyramidPassUniforms.outputShiftX.value=0;let o=s-1;for(let s=o;s>=0;s--){let r=s%2==o%2?n[0]:n[1],l=s===o?a:s%2==o%2?n[1]:n[0];this.pyramidPassUniforms.inputTexture.value=l.textures.length>1?l.textures[1]:l.texture,this.pyramidPassUniforms.inputWidth.value="width"in l?l.width:1,this.pyramidPassUniforms.inputHeight.value="height"in l?l.height:1,i.setRenderTarget(r);let h=e[s],p=i.getPixelRatio();i.setViewport(this.pyramidPassUniforms.outputShiftX.value/p,0,h/p,h/p),2===s&&t%2!=0&&i.setViewport(this.pyramidPassUniforms.outputShiftX.value/p,0,3/p,3/p),i.render(this.pyramidPassScene,D);let d=this.pyramidPassUniforms.inputShiftX.value;this.pyramidPassUniforms.inputShiftX.value=this.pyramidPassUniforms.outputShiftX.value,this.pyramidPassUniforms.outputShiftX.value=d,s<o&&(this.pyramidPassUniforms.outputShiftX.value+=e[s+1])}i.setViewport(r);let l=e.length%2==0?0:1;return i.readRenderTargetPixelsAsync(n[l],n[l].width-1,0,1,1,this.pyramidTopLevelReadPixelBuffer).then(()=>this.pyramidTopLevelReadPixelBuffer[0])}};var $=new v,Z=new v,Y=new h,Q=new p,J=new p,tt=new h;function et(t,e=0){let i=this.children.length;for(;i--;){let a=this.children[i];n.is(a)&&it.call(a,t,e+1)}}function it(t,e=0){if(!0!==t(this,e)){let i=this.children.length;for(;i--;){let a=this.children[i];n.is(a)&&it.call(a,t,e+1)}}}function at(){if(void 0===this.shapesDataTexture.value){let t=new w(new Float32Array(1920),96,5,d,o);this.shapesDataTexture.value=t}let n=this.shapesDataTexture.value,l=n.image.data,h=0,p=0,c=this.data.geometry.blendRange,f=$.copy(this.matrixWorld).invert(),u=this._npart,v=0;this._meshSdfWanted.clear();let m=null;if(et.call(this,n=>{if(!1===n.visible)return!0;let o;if(n instanceof t)return;if(n instanceof e||r(n))return;o=n instanceof i?n.object:n;let d=n.data?.cloner;if(s.is(n)&&d&&!d.hideBase&&"radial"!==d.type&&!0!==d.disabled||!(o instanceof a))return;let u=o.geometry.userData.parameters,x=u?.shapeBlendNode??o.dataPatched?.geometry?.shapeBlendNode;if(void 0===x)return;if(Z.multiplyMatrices(f,n.matrixWorld).decompose(J,Y,Q),"TorusGeometry"===u?.type&&360!==u.arc){let t=u.arc*Math.PI/180;t/=4,Y.multiply(tt.set(0,0,Math.sin(t),Math.cos(t)))}let y=x.overrideGlobalBlend?x.blendRange:c;y=y/this.bboxSize*2,l[4*v]=(J.x-this.bboxOffset)/this.bboxSize*2,l[4*v+1]=(J.y-this.bboxOffset)/this.bboxSize*2,l[4*v+2]=(J.z-this.bboxOffset)/this.bboxSize*2,l[4*v+3]=0===x.operation?1:2===x.operation?-1:-2,l[384+4*v]=-Y.x,l[384+4*v+1]=-Y.y,l[384+4*v+2]=-Y.z,l[384+4*v+3]=Y.w;let g=new Float32Array(4),S=0,b=y;if("SphereGeometry"===u?.type)u.width===u.height&&u.width===u.depth?g[0]=0:g[0]=1,g[1]=u.width/this.bboxSize,g[2]=u.height/this.bboxSize,g[3]=u.depth/this.bboxSize,b=Math.max(g[1],g[2],g[3])*Q.x+y;else if("CubeGeometry"===u?.type){S=u.cornerRadius;let t=u.width,e=u.height,i=u.depth;g[0]=2,g[1]=(t-2*S)/this.bboxSize,g[2]=(e-2*S)/this.bboxSize,g[3]=(i-2*S)/this.bboxSize,b=Math.sqrt(t**2+e**2+i**2)/this.bboxSize*Q.x+y}else if("CylinderGeometry"===u?.type){S=u.cornerRadius;let t=u.height,e=u.radiusBottom,i=u.radiusTop;if(i>=e){let a=Math.atan2(i-e,t),n=(Math.PI/2-a)/2;i-=S/Math.tan(n),e-=S*Math.tan(n)}else if(e>i){let a=Math.atan2(e-i,t),n=(Math.PI/2-a)/2;i-=S*Math.tan(n),e-=S/Math.tan(n)}g[1]=(u.height-2*S)/this.bboxSize,e===i?(g[0]=3,g[2]=e/this.bboxSize*2):(g[0]=4,g[2]=e/this.bboxSize*2,g[3]=i/this.bboxSize*2),b=(Math.hypot(g[1],Math.max(Math.abs(g[2]),Math.abs(g[3])))+S/this.bboxSize*2)*Q.x+y}else if("TorusGeometry"===u?.type){if(g[0]=5,g[1]=(u.width-u.depth)/this.bboxSize,g[2]=u.depth/this.bboxSize,360!==u.arc){g[0]=6,g[3]=g[1],l[1152+4*v+3]=g[2];let t=2*Math.atan2(g[2]/2,g[1]),e=u.arc*Math.PI/180/2-t;g[1]=Math.sin(e),g[2]=Math.cos(e)}b=u.width*Q.x/this.bboxSize+y}else{let t=o.geometry;(m??(m=new Set)).add(t.uuid);let e=this._meshSdfBaked.get(t.uuid),i=K(t);if((void 0===e||e.posVersion!==i)&&this._meshSdfWanted.set(t.uuid,t),void 0===e)return;g[0]=7,g[1]=e.slot,g[2]=e.boxHalf.x/this.bboxSize*2,g[3]=e.boxHalf.y/this.bboxSize*2,l[1152+4*v+3]=e.boxHalf.z/this.bboxSize*2,b=Math.hypot(e.boxHalf.x,e.boxHalf.y,e.boxHalf.z)/this.bboxSize*2*Q.x+y}l.set(g,768+4*v),h=Math.max(h,b),p=Math.max(p,y),this._reach[v]=b,l[1152+4*v]=y,l[1152+4*v+1]=S/this.bboxSize*2,l[1152+4*v+2]=Q.x;let T,P,_=Array.isArray(o.material)?o.material[0]:o.material,z=_;if(z?.getShapeBlendBaseColor){let t=z.getShapeBlendBaseColor();T=t,P=t.a}else void 0!==_?.uniforms?.nodeU0?(T=_.uniforms.nodeU0.node.value,P=_.uniforms.nodeU1?.value??1):(T={r:1,g:1,b:1},P=1);0!==x.operation&&!x.useColor&&(P=-1),l[1536+4*v]=T.r,l[1536+4*v+1]=T.g,l[1536+4*v+2]=T.b,l[1536+4*v+3]=P,P<1&&1===this.material.defines?.SHAPEBLEND_C&&(this.material.transparent=!0),v++}),this._meshSdfBaked.size>0){let t=m??new Set;for(let e of this._meshSdfBaked.keys())t.has(e)||this._meshSdfBaked.delete(e)}this.npart=v,this._maxBlendK=p;let x=1.1*h+2/(this.spatialDivisions-1)+4/(this.resolution-1);this.spatialPassUniforms.span.value=x;let y=this._prevShapeData,g=u!==v,S=null===y||this._prevSpan!==x||g,b=S||H,T=this._fieldDirtyMin.set(1/0,1/0,1/0),P=this._fieldDirtyMax.set(-1/0,-1/0,-1/0);if(null!==y){let t=Math.max(v,u);for(let e=0;e<t;e++){let t=!1;for(let i=0;i<5;i++){let a=384*i+4*e;if(l[a]!==y[a]||l[a+1]!==y[a+1]||l[a+2]!==y[a+2]||l[a+3]!==y[a+3]){t=!0;break}}if(!t)continue;if(S=!0,b)break;let i=l[4*e],a=l[4*e+1],n=l[4*e+2],s=y[4*e],r=y[4*e+1],o=y[4*e+2],h=this._reach[e],p=this._prevReach[e];Number.isFinite(i+a+n+h)&&Number.isFinite(s+r+o+p)?(T.x=Math.min(T.x,i-h,s-p),T.y=Math.min(T.y,a-h,r-p),T.z=Math.min(T.z,n-h,o-p),P.x=Math.max(P.x,i+h,s+p),P.y=Math.max(P.y,a+h,r+p),P.z=Math.max(P.z,n+h,o+p)):b=!0}}return H&&(S=!0),this._fieldDirtyFull=b||T.x===1/0,S&&(null===y?this._prevShapeData=new Float32Array(l):y.set(l),this._prevReach.set(this._reach),this._prevSpan=x,n.needsUpdate=!0),S}function nt(t){return at.call(t)}export{k as a,E as b,M as c,F as d,I as e,V as f,B as g,A as h,W as i,K as j,G as k,nt as l};
|
|
Binary file
|
|
Binary file
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as t}from"./runtime-chunk-
|
|
1
|
+
import{a as t}from"./runtime-chunk-QSJVWNNM.js";import{d as e}from"./runtime-chunk-VNO2DW74.js";import{Sc as s}from"./runtime-chunk-VGN7YHB7.js";var r=class extends(e(s,t)){constructor(t,e){super(),this.super_Entity(t,e),this.objectHelper.update(),"Empty"===this.data.type&&(this.objectHelper.visible=!1)}updateState(t,e){this.updateState_Entity(t,e),"buffer"in t&&1===Object.keys(t).length&&e.scene.reloadSplats()}};export{r as a};
|
|
Binary file
|
|
Binary file
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as e}from"./runtime-chunk-
|
|
1
|
+
import{j as e}from"./runtime-chunk-MOZWC42D.js";import{Ed as t,Fc as r,Oc as i,We as n,cd as a,jd as o}from"./runtime-chunk-VGN7YHB7.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=B(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 B(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{h as n}from"./runtime-chunk-
|
|
1
|
+
import{h as n}from"./runtime-chunk-MOZWC42D.js";function e(o){if(o.component){let t=o.component.instances.indexOf(o);t>=0&&o.component.instances.splice(t,1);for(let t of o.children)n.is(t)&&e(t)}}export{e as a};
|
|
Binary file
|
|
Binary file
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as e}from"./runtime-chunk-
|
|
1
|
+
import{a as e}from"./runtime-chunk-YS7K3AW3.js";import{ea as t}from"./runtime-chunk-7FDJ7IIR.js";import{h as a}from"./runtime-chunk-MOZWC42D.js";import{c as s,e as o,f as i}from"./runtime-chunk-2PT2WH66.js";import{b as r}from"./runtime-chunk-U4QOT2PX.js";import{Ea as n,w as d}from"./runtime-chunk-VPEJ5BFD.js";import{Fc as c}from"./runtime-chunk-VGN7YHB7.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]=r.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(r=>{if(s&&(r.rigidBody?.setTranslation(r.position0,!0),r.rigidBody?.setRotation(r.rotation0,!0),r.rigidBody?.setLinvel(l,!0),r.rigidBody?.setAngvel(l,!0)),!a.is(r))return;let u=r.uuid,f=r.data;if(delete r.states,r.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),r.data=f,r.currentState=null,r.reversibleToState=null,r.currentTransitionEvent=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,void 0!==t.data.hiddenMatrix&&delete a.hiddenMatrix),r.states||(r.states={}),r.states[t.id]=n.patch(f,a)}p(e.scene,r,null,t,void 0!==f.events.find(e=>"Follow"===e.data.type||"LookAt"===e.data.type)),i(r)&&r.frame&&(r.frame.traverse(e=>c(e)),r.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,i,r,n,d=!1){if(a.markShadowsDirty(),i instanceof t&&!s(i)&&i.removeInteractionGeometry(n),o(i)?i.changeSelectedState(r,{shared:n},d):i.changeSelectedState(r,{scene:a,shared:n},d),i instanceof t&&i.updateGeometryGroupsIfNeeded(),i instanceof e&&i.updateCameraState(i.dataPatched,{scene:a,shared:n}),!o(i)){if(i.cloner){let e=!1;for(let t of i.cloner.children)t.playModeVisible=void 0,void 0!==t.transformOverride&&(t.transformOverride=void 0,e=!0);e&&a.addPendingUpdateCloner(i),i.cloner.syncInstanceMatrices()}i.updateVisible()}}export{u as a};
|
|
Binary file
|
|
Binary file
|