@volter/game-editor 0.5.65
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/BUNDLED_NOTICES +11228 -0
- package/LICENSE +686 -0
- package/LICENSE-BLENDER +1409 -0
- package/LICENSE-MCP +21 -0
- package/NOTICE +21 -0
- package/catalog/entries/audio.json +14 -0
- package/catalog/entries/bake.json +36 -0
- package/catalog/entries/blender.json +17 -0
- package/catalog/entries/react-root.json +24 -0
- package/catalog/entries/reflections.json +29 -0
- package/catalog/entries/static-batch.json +25 -0
- package/catalog/project-source/LICENSE +37 -0
- package/catalog/project-source/src/contributions/bake.kind.ts +40 -0
- package/catalog/project-source/src/contributions/builder-document.tsx +65 -0
- package/catalog/project-source/src/contributions/builder-state.ts +27 -0
- package/catalog/project-source/src/contributions/builder-ui.tsx +61 -0
- package/catalog/project-source/src/contributions/module-source.ts +502 -0
- package/catalog/project-source/src/contributions/pages.finder.ts +61 -0
- package/catalog/project-source/src/lib/audio/sfx.ts +255 -0
- package/catalog/project-source/src/lib/bake/asset-seed.ts +128 -0
- package/catalog/project-source/src/lib/bake/bake-schema.ts +65 -0
- package/catalog/project-source/src/lib/bake/clip-layering.ts +203 -0
- package/catalog/project-source/src/lib/bake/gltf-bake.ts +657 -0
- package/catalog/project-source/src/lib/bake/mesh-slice.ts +157 -0
- package/catalog/project-source/src/lib/bake/node-image.ts +463 -0
- package/catalog/project-source/src/lib/bake/object3d-bake.ts +121 -0
- package/catalog/project-source/src/lib/bake/object3d-lifecycle.ts +15 -0
- package/catalog/project-source/src/lib/bake/object3d-source.ts +8 -0
- package/catalog/project-source/src/lib/bake/params.ts +75 -0
- package/catalog/project-source/src/lib/bake/rest-relative-animation.ts +217 -0
- package/catalog/project-source/src/lib/bake/use-model.ts +95 -0
- package/catalog/project-source/src/lib/react-root/index.ts +20 -0
- package/catalog/project-source/src/lib/react-root/react-root-adapter.tsx +57 -0
- package/catalog/project-source/src/lib/reflections/ReflectionProbe.tsx +201 -0
- package/catalog/project-source/src/lib/reflections/index.ts +19 -0
- package/catalog/project-source/src/lib/reflections/probe-controller.ts +75 -0
- package/catalog/project-source/src/lib/reflections/reflection-probe-registry.ts +402 -0
- package/catalog/project-source/src/lib/reflections/volume-reflection-material.ts +416 -0
- package/catalog/project-source/src/lib/static-batch/Frozen.tsx +91 -0
- package/catalog/project-source/src/lib/static-batch/freeze.ts +579 -0
- package/catalog/project-source/src/lib/static-batch/index.ts +44 -0
- package/catalog/project-source/src/lib/static-batch/mutation-watch.ts +149 -0
- package/catalog/project-source/src/lib/static-batch/shadow-cache.ts +171 -0
- package/catalog/project-source/src/tools/bake-module.tool.ts +139 -0
- package/catalog/project-source/src/tools/bake-preview.tool.ts +475 -0
- package/dist/.vite/manifest.json +8304 -0
- package/dist/assets/AssetBudgetPanel-J9--TZPU.js +23 -0
- package/dist/assets/AudioViewer-CR7333fe.js +1 -0
- package/dist/assets/BVHLoader-6bQIXhMX.js +1 -0
- package/dist/assets/BufferGeometryUtils-Nz37EVXf.js +1 -0
- package/dist/assets/CCDIKSolver-CD7vLpsK.js +1 -0
- package/dist/assets/CSS3DRenderer-CL7ABLVK.js +1 -0
- package/dist/assets/CanvasSceneViewport-Bpi6gVTC.js +1 -0
- package/dist/assets/ColladaLoader-aVOPIsCh.js +3 -0
- package/dist/assets/ColorInput-DQBNrW-K.js +1 -0
- package/dist/assets/ConvexGeometry-CAzXlPVG.js +1 -0
- package/dist/assets/ConvexHull-BINCESFp.js +1 -0
- package/dist/assets/CopyShader-BzTUYzf6.js +24 -0
- package/dist/assets/DecalGeometry-160KRdfg.js +1 -0
- package/dist/assets/EXRLoader-Cdans_oJ.js +1 -0
- package/dist/assets/EffectComposer-DQxfsXBZ.js +1 -0
- package/dist/assets/EntityModelDocument-Ccvw66N9.js +1 -0
- package/dist/assets/EnvironmentAssetDocument-Dg-Qq6O6.js +1 -0
- package/dist/assets/FBXLoader-B4MoUtAn.js +1 -0
- package/dist/assets/Fbo-Dz-Soul3.js +1 -0
- package/dist/assets/FontLoader-CvGoVI5a.js +2 -0
- package/dist/assets/GLTFExporter-HgrCle4L.js +1 -0
- package/dist/assets/GameplaySessionTimeline-B52W3FVZ.js +1 -0
- package/dist/assets/Gltf-UHVWKz65.js +2 -0
- package/dist/assets/HDRLoader-THU88oVD.js +5 -0
- package/dist/assets/ImageViewer-Tn7s_MnW.js +1 -0
- package/dist/assets/InspectorCanvasPreview-CEr_Kxna.js +1 -0
- package/dist/assets/InspectorObjectPreview-CVejvLRg.js +1 -0
- package/dist/assets/JsonAssetDocument-C7VGcLhu.js +3 -0
- package/dist/assets/LineSegments2-CsOpKSiM.js +370 -0
- package/dist/assets/MTLLoader-_Xzd4_0p.js +2 -0
- package/dist/assets/MarchingCubes-Bsp4wrzd.js +1 -0
- package/dist/assets/MeshBVH-BiDHDcu-.js +1 -0
- package/dist/assets/ModelAssetDocument-F5GACirk.js +1 -0
- package/dist/assets/NonThreeAuthoringBootstrap-C3woOMxX.js +1 -0
- package/dist/assets/OBJLoader-BhIC6Hwo.js +5 -0
- package/dist/assets/Object3DDocumentViewport-DB7T0NTl.js +2 -0
- package/dist/assets/Object3DPreview-DL8oi7Xs.js +2 -0
- package/dist/assets/OnlineAssetDetail-C6z9RvYK.js +2 -0
- package/dist/assets/OrbitControls-CM3bPray.js +1 -0
- package/dist/assets/OrbitControls-DLpayAaK.js +1 -0
- package/dist/assets/OrthographicCamera-bQozawrh.js +1 -0
- package/dist/assets/PLYLoader-DYQqs5Ik.js +2 -0
- package/dist/assets/PerspectiveCamera-CQ2lh01o.js +1 -0
- package/dist/assets/PlayBar-BR-Vg3Jb.js +2 -0
- package/dist/assets/RGBELoader-BgBcQv8j.js +1 -0
- package/dist/assets/RectAreaLightUniformsLib-CMMoWfll.js +1 -0
- package/dist/assets/RenderPass-DPrn-Uky.js +1 -0
- package/dist/assets/ResolutionPicker-C67vs1F3.js +1 -0
- package/dist/assets/RootSelectionOverlay-BZPlxmXU.js +1 -0
- package/dist/assets/RoundedBox-BDGBg6QZ.js +1 -0
- package/dist/assets/RoundedBoxGeometry-CyUuYPfW.js +1 -0
- package/dist/assets/STLLoader-Dyv3lsxY.js +1 -0
- package/dist/assets/SelectionBox-D_75KrNW.js +1 -0
- package/dist/assets/ShaderPass-QYRpPuFJ.js +1 -0
- package/dist/assets/ShadowEditor-DkImwu1Y.js +1 -0
- package/dist/assets/SimplifyModifier-C8ayvRzd.js +1 -0
- package/dist/assets/SkeletonUtils-Cps8GOC6.js +1 -0
- package/dist/assets/Sky-CQKCgYDs.js +154 -0
- package/dist/assets/SourceAssetViewer-2SWQoUut.js +12 -0
- package/dist/assets/StageHost-BN-IoTef.js +2 -0
- package/dist/assets/StoryPreviewMount-DjyxRCXu.js +1 -0
- package/dist/assets/TDSLoader-D_T8XJ81.js +1 -0
- package/dist/assets/TextGeometry-DOWAEUV0.js +1 -0
- package/dist/assets/ThreeBoardDocument-CVncZyIq.js +2 -0
- package/dist/assets/ThreeIsolationSceneContent-C8C8whSF.js +1 -0
- package/dist/assets/ToolObject3DPreview-BRoDWe4Q.js +1 -0
- package/dist/assets/TrackballControls-DfznuQTh.js +1 -0
- package/dist/assets/TransientHint-BB1fwrvK.js +1 -0
- package/dist/assets/UnrealBloomPass-CR-cS_K5.js +83 -0
- package/dist/assets/VideoViewer-C6kocgIU.js +1 -0
- package/dist/assets/_commonjsHelpers-D6-XlEtG.js +1 -0
- package/dist/assets/active-ingest-CT6jSGhr.js +3 -0
- package/dist/assets/adapter-surface-Y37Nzcyw.js +1 -0
- package/dist/assets/after-paint-CB4bz1-e.js +1 -0
- package/dist/assets/agx-base-srgb-BjWZJgrZ.lut +0 -0
- package/dist/assets/agx-look-medium-high-contrast-D5F_ob1L.lut +0 -0
- package/dist/assets/agx-look-punchy-dxsnycNs.lut +0 -0
- package/dist/assets/animation-clock-CnjZqfJp.js +1 -0
- package/dist/assets/asset-budget-asset.menu-Di3KiQCd.js +1 -0
- package/dist/assets/asset-budget.action-DCzzcuTh.js +1 -0
- package/dist/assets/asset-budget.document-BWU8wnVW.js +1 -0
- package/dist/assets/asset-budget.menu-BGZpT_31.js +1 -0
- package/dist/assets/asset-editor-persistence-BBaONOJt.js +1 -0
- package/dist/assets/asset-loaders-BOy5Ss8k.js +2 -0
- package/dist/assets/asset-parse-error-BHMwBRU3.js +3 -0
- package/dist/assets/assets-BuSoGjBX.js +1 -0
- package/dist/assets/audio-meter-CyiToeUW.js +1 -0
- package/dist/assets/audio-unlock.service-CfUgUQVy.js +1 -0
- package/dist/assets/audio.utility-C6K6jem8.js +1 -0
- package/dist/assets/authoring-CgcOFhGS.js +1 -0
- package/dist/assets/autoplay.service-BZBGNSvt.js +1 -0
- package/dist/assets/axe-LkjAB6Lv.js +30 -0
- package/dist/assets/babylon-authoring-adapter-CL02gWDn.js +1 -0
- package/dist/assets/binding-Bmxqznjk.js +1 -0
- package/dist/assets/binding-identity-DcTpbvyg.js +1 -0
- package/dist/assets/binding-resolver-Dsh-6Vor.js +2 -0
- package/dist/assets/blender-emscripten-engine-9ZIRYNhe.js +2 -0
- package/dist/assets/blender-node-editor.document-iIDkB9sI.js +1 -0
- package/dist/assets/blender-properties-tab-C5CyPydi.js +3 -0
- package/dist/assets/blender-runtime-host-BpBwGv7r.js +4 -0
- package/dist/assets/blender-runtime-skin-DyQ9B6CR.js +7140 -0
- package/dist/assets/blender-runtime.document-lIYhhPtv.js +8 -0
- package/dist/assets/blender-timeline.document-77fx96N7.js +1 -0
- package/dist/assets/blender-uv-editor.document-fsT7B4gV.js +1 -0
- package/dist/assets/blender-version.status-o6dBm3n6.js +1 -0
- package/dist/assets/blender-wali-engine-wTOcrOMC.js +2 -0
- package/dist/assets/blender.command-BtJeWk-A.js +1 -0
- package/dist/assets/blender.keymap-GAQgeklK.js +1 -0
- package/dist/assets/blender.status-ujwGU6dU.js +1 -0
- package/dist/assets/blender.style-Dcem5f_T.js +1 -0
- package/dist/assets/board-guides-DziKSTss.js +1 -0
- package/dist/assets/body-marks-h_xDxiDE.js +1 -0
- package/dist/assets/bridge.command-o5gDNEwa.js +3 -0
- package/dist/assets/browserAll-DeWblVez.js +1 -0
- package/dist/assets/build-profiles.document-kW8iw8Xj.js +2 -0
- package/dist/assets/build-progress.status-BNRLytg2.js +1 -0
- package/dist/assets/build-session-C_sg3CEn.js +9 -0
- package/dist/assets/build.action-lYjTLb7K.js +1 -0
- package/dist/assets/build.command-DIGgUPU_.js +1 -0
- package/dist/assets/build.header-CKajx5U3.js +1 -0
- package/dist/assets/build.menu-BdU0QXny.js +1 -0
- package/dist/assets/build.service-CbBAyeu3.js +1 -0
- package/dist/assets/bus-mixer-CGfWDP3C.js +1 -0
- package/dist/assets/camera-KEsKvOL7.js +1 -0
- package/dist/assets/camera-runtime.inspector-B7unX4g1.js +1 -0
- package/dist/assets/canvas-entry-runtime-SfBxaR9M.js +2 -0
- package/dist/assets/capability-coverage-Czas4C18.js +7 -0
- package/dist/assets/chrome-trace-YZHMz60-.js +1 -0
- package/dist/assets/client-DNXj_opT.js +25 -0
- package/dist/assets/clip-planes-CnAI6DZn.js +1 -0
- package/dist/assets/collaboration-presence-DLoZ7EA3.js +1 -0
- package/dist/assets/collider-Bw0mXlsW.js +1 -0
- package/dist/assets/collider-dimensions-9xoFADXN.js +1 -0
- package/dist/assets/collision-system-DpNUJRJ3.js +1 -0
- package/dist/assets/command-results-CUQD49AB.js +1 -0
- package/dist/assets/component-board-registry-DrIa2csL.js +1 -0
- package/dist/assets/component-board.service-DCwcUssB.js +2 -0
- package/dist/assets/component-board.service-DidCyM4O.js +2 -0
- package/dist/assets/component-verbs.command-7xzfjGMZ.js +1 -0
- package/dist/assets/component-verbs.service-Bv9jId3q.js +1 -0
- package/dist/assets/config-CEZk921y.js +6 -0
- package/dist/assets/configurations-DTBMdaTL.js +1 -0
- package/dist/assets/connection.status-BifnQdOs.js +1 -0
- package/dist/assets/console-bridge-CHcb-xk5.js +1 -0
- package/dist/assets/constraint-De8f1Uiq.js +1 -0
- package/dist/assets/constraints.inspector-B9U9Yj-u.js +1 -0
- package/dist/assets/countdown-timer-CUm74dom.js +1 -0
- package/dist/assets/coverage.service-VTX5Mcsx.js +3 -0
- package/dist/assets/crash-null-boundary-v3a0uEgw.js +1 -0
- package/dist/assets/create-runtime-CVCc1BDx.js +1 -0
- package/dist/assets/curve-7Q79VgU4.js +1 -0
- package/dist/assets/data-asset-4hjS642k.js +5 -0
- package/dist/assets/data-check-core-CQEjuFyt.js +1 -0
- package/dist/assets/data-ref-CQI28C0D.js +1 -0
- package/dist/assets/debug-bridge-CCohG-d-.js +1 -0
- package/dist/assets/debug-registry-Dgvitx8M.js +1 -0
- package/dist/assets/defaults-DKiBJCPN.js +1 -0
- package/dist/assets/deferred-commands-CEMmvL47.js +1 -0
- package/dist/assets/deferred-ingest-play-DCJi_Pgu.js +2 -0
- package/dist/assets/design-time-layers-wYgOTgni.js +1 -0
- package/dist/assets/design-time-mount-registry-DUpXCg1U.js +1 -0
- package/dist/assets/design-time-mount.service-BzY21e1F.js +2 -0
- package/dist/assets/design-time-react-mount-DM9WLrF2.js +1 -0
- package/dist/assets/dev-build-gDYrq68M.js +1 -0
- package/dist/assets/directional-shadow-fit-BVkOKAv2.js +1 -0
- package/dist/assets/document-preview-three-Kbg2GCLm.js +1 -0
- package/dist/assets/dom-authoring-adapter-CY8C7f4T.js +1 -0
- package/dist/assets/draco3d-BBUTcNkz.js +1 -0
- package/dist/assets/draco_decoder-DsQ12WqX.wasm +0 -0
- package/dist/assets/draco_encoder-2Tcju8Ns.wasm +0 -0
- package/dist/assets/edit-mode-audio.service-Bzetwd5B.js +1 -0
- package/dist/assets/edit-mode-authoring-B47TfLqu.js +1 -0
- package/dist/assets/edit-mode-networking.service-YCX6RRb_.js +1 -0
- package/dist/assets/editor-api-BoJIcyZG.js +1 -0
- package/dist/assets/editor-port-C_FeBdeV.js +1 -0
- package/dist/assets/editor-presentation-activity-C7SNSmTd.js +1 -0
- package/dist/assets/entry-adjudication-Cq8Yeb74.js +1 -0
- package/dist/assets/environment-capture-7himRh2L.js +1 -0
- package/dist/assets/esbuild-BHljloGq.wasm +0 -0
- package/dist/assets/events-156d8d12.esm-ErOhDXXB.js +36 -0
- package/dist/assets/extend-B-eOccUm.js +36 -0
- package/dist/assets/extends-CF3RwP-h.js +1 -0
- package/dist/assets/eyedropper-session-bjPXnfeX.js +1 -0
- package/dist/assets/fflate.module-DPuTF8aG.js +6 -0
- package/dist/assets/filmic-srgb-Ct35FIH6.lut +0 -0
- package/dist/assets/first-party-audio-system-DxnGJOER.js +1 -0
- package/dist/assets/first-party-navigation-system-CL5Bquub.js +1 -0
- package/dist/assets/fork-menu-BoVyw2Wu.js +1 -0
- package/dist/assets/frame-debugger-store-D1Mf_5up.js +1 -0
- package/dist/assets/frame-delta-D2nsw_Ht.js +1 -0
- package/dist/assets/frame-pacing-D5acoOzO.js +1 -0
- package/dist/assets/frame-selector-cache-cCeUbcjG.js +1 -0
- package/dist/assets/game-DHOZVb-7.js +1 -0
- package/dist/assets/game-contract-seams-a5YXejOu.js +1 -0
- package/dist/assets/game-css-scope-transform-Eng4wS8E.js +33 -0
- package/dist/assets/game-document.service-DbRfx2V0.js +1 -0
- package/dist/assets/game-eval.command-D-7Dxbj_.js +2 -0
- package/dist/assets/game-input-seams-CIQdetRw.js +1 -0
- package/dist/assets/game-loop-CZvXlY00.js +1 -0
- package/dist/assets/game-module-access-B2mFxv-i.js +1 -0
- package/dist/assets/game.layout-CBASrvQu.js +1 -0
- package/dist/assets/gameplay-export-BoKXm51x.js +1 -0
- package/dist/assets/gameplay-replay-e5umMlXv.js +1 -0
- package/dist/assets/gameplay-rng-trap-CTNhm-UW.js +3 -0
- package/dist/assets/gameplay.command-DxcVYX6F.js +1 -0
- package/dist/assets/generation-DhwCUHPf.css +1 -0
- package/dist/assets/generation-jobs-BQrXbGp_.js +1 -0
- package/dist/assets/generation.service-CDIgObuw.js +1 -0
- package/dist/assets/generations-DzUogZsM.js +1 -0
- package/dist/assets/generations.status-CgOUBCum.js +1 -0
- package/dist/assets/hierarchy-marks-BLPfSIym.js +1 -0
- package/dist/assets/host-pointer-DbGSCjE9.js +1 -0
- package/dist/assets/hosted-asset-materialization-CiIvWkGU.js +2 -0
- package/dist/assets/ibl-override-material-BlmCxFKq.js +6 -0
- package/dist/assets/index-96FBF1Oj.js +1 -0
- package/dist/assets/index-BAWkB0dv.js +1 -0
- package/dist/assets/index-BDnS2b6S.js +1 -0
- package/dist/assets/index-BHp07vN0.js +2 -0
- package/dist/assets/index-BMxv2MNV.js +1 -0
- package/dist/assets/index-BP6wv2A0.js +5 -0
- package/dist/assets/index-BcCBqgM_.js +952 -0
- package/dist/assets/index-Bge9JUr6.js +1 -0
- package/dist/assets/index-BjTCPEQ7.js +134 -0
- package/dist/assets/index-BncK9THk.js +1 -0
- package/dist/assets/index-CJbYy-CF.js +3 -0
- package/dist/assets/index-CVCb_ImQ.js +1 -0
- package/dist/assets/index-CZd9o7Lu.js +1 -0
- package/dist/assets/index-CanA16PU.js +2 -0
- package/dist/assets/index-CinJrH5C.js +9 -0
- package/dist/assets/index-CtzuWnCS.js +1 -0
- package/dist/assets/index-D2fNXpHa.css +1 -0
- package/dist/assets/index-DUpHH6JR.js +3120 -0
- package/dist/assets/index-DUqP1RMl.js +1 -0
- package/dist/assets/index-D_NuPfjr.js +9 -0
- package/dist/assets/index-Da9JhEvW.js +25 -0
- package/dist/assets/index-DgapqSPi.js +7 -0
- package/dist/assets/index-FUuS4qwW.js +562 -0
- package/dist/assets/index-GIL7oGEO.js +4894 -0
- package/dist/assets/index-IEjydI9d.js +1 -0
- package/dist/assets/index-OrYXPk3Z.js +487 -0
- package/dist/assets/index-V1R-e5Bd.js +1 -0
- package/dist/assets/index-bQE2NA0D.js +1 -0
- package/dist/assets/index-gHZae-lw.js +13 -0
- package/dist/assets/index-mjWQmGhM.js +1 -0
- package/dist/assets/index-nmcBqr7Y.js +1 -0
- package/dist/assets/inference-diagnostics-Dhmtfbq_.js +1 -0
- package/dist/assets/ingest-BbYMC2vQ.js +1 -0
- package/dist/assets/ingest-boot-viewport-D5rI_Kk_.js +1 -0
- package/dist/assets/ingest-siblings-Bop2kqVl.js +1 -0
- package/dist/assets/ingest-source-persistence-C_6Hiyra.js +1 -0
- package/dist/assets/ingest.service-BTDnQfM1.js +1 -0
- package/dist/assets/input-manager-DH_hGW6d.js +1 -0
- package/dist/assets/input-router-BNQvtIqw.js +1 -0
- package/dist/assets/inspect-BZfi3mmo.js +1 -0
- package/dist/assets/inspection-CObLhnrs.js +1 -0
- package/dist/assets/instance-fork-actions-D3sRzS3K.js +1 -0
- package/dist/assets/instances.command-D6UkZNO8.js +1 -0
- package/dist/assets/instruments-CKR02Y8I.js +1 -0
- package/dist/assets/json-history-resource-BbxllWfV.js +1 -0
- package/dist/assets/jsx-runtime-DPjLkJKQ.js +9 -0
- package/dist/assets/light-D-_wsKTq.js +1 -0
- package/dist/assets/light-camera-factory-CWbbe9gI.js +1 -0
- package/dist/assets/lil-gui.module.min-BF55BEwA.js +10 -0
- package/dist/assets/live-behaviors-Bxq49Maz.js +1 -0
- package/dist/assets/live-gesture-lock-DJbrjOqf.js +1 -0
- package/dist/assets/loader-CaF_I7Yt.js +1 -0
- package/dist/assets/logger-Dqis-7W1.js +1 -0
- package/dist/assets/loop-gate-report-N52EWFGD.js +1 -0
- package/dist/assets/matcap-texture-CVfalpWT.js +1 -0
- package/dist/assets/material-CpAdjDxn.js +1 -0
- package/dist/assets/material-factory-Bz6h__6g.js +1 -0
- package/dist/assets/mesh-B3WPtNKO.js +1 -0
- package/dist/assets/mesh-shadow-CZnXrw_l.js +1 -0
- package/dist/assets/mikktspace.module-DO88SLib.js +1 -0
- package/dist/assets/model-asset-sections-CFvvihfx.css +1 -0
- package/dist/assets/model-asset-sections.service-CHhFS3ZX.js +1 -0
- package/dist/assets/model.layout-BJUEQYUI.js +1 -0
- package/dist/assets/models.finder-G2jQgIRu.js +1 -0
- package/dist/assets/module-mode-DVBLT9d-.js +2 -0
- package/dist/assets/mount-canvas-ingest-root-DDuAWf_C.js +2 -0
- package/dist/assets/mount-dom-ingest-root-D_EiBgpn.js +2 -0
- package/dist/assets/mount-game-6t9cKNo4.js +1 -0
- package/dist/assets/mount-ingest-root-glv2SSWf.js +2 -0
- package/dist/assets/mount-manifest-CGVxhmAw.js +1 -0
- package/dist/assets/mount-readiness-Ds0HvvLH.js +4 -0
- package/dist/assets/mount-three-ingest-root-hrUt9VVU.js +1 -0
- package/dist/assets/mounted-authoring-Dmg5xmhP.js +1 -0
- package/dist/assets/mounted-story-viewport-source-DjP6RA9U.js +1 -0
- package/dist/assets/native-debug-module-CWicoSGD.js +1 -0
- package/dist/assets/native-entry-surface-BE8LJNdu.js +1 -0
- package/dist/assets/navigation-CIiCx-SM.js +1 -0
- package/dist/assets/navmesh-workflow-store-Cmnm57TB.js +1 -0
- package/dist/assets/navmesh.menu-CAKiH8PW.js +1 -0
- package/dist/assets/navmesh.service-jgDWlgj1.js +1 -0
- package/dist/assets/network.utility-CEu5nHf7.js +1 -0
- package/dist/assets/object-marks-DwvIEBOK.js +1 -0
- package/dist/assets/object3d-authoring-subject-CH5sI2oP.js +1 -0
- package/dist/assets/output-DK8waum9.js +195 -0
- package/dist/assets/particles-Y626p22p.js +1 -0
- package/dist/assets/particles-factory-DnLOHXT8.js +1 -0
- package/dist/assets/pasteboard-materialize-BqSS4QzV.js +20 -0
- package/dist/assets/pasteboard.action-DU3UHtJG.js +2 -0
- package/dist/assets/performance-profiler-D_Jey87L.js +1 -0
- package/dist/assets/physics-registry-B2Jkp8e6.js +1 -0
- package/dist/assets/physics-registry-CUB9cT9p.js +1 -0
- package/dist/assets/pixi-authoring-adapter-CjibysC3.js +1 -0
- package/dist/assets/pixi-live-write-target-DuWydlWb.js +1 -0
- package/dist/assets/pixi-primitive-DlWbUPN9.js +1 -0
- package/dist/assets/pixi-react-root-factory-DYsznYRQ.js +1 -0
- package/dist/assets/pixi-story-model-DNkfnWUV.js +1 -0
- package/dist/assets/pixi-transform-channels-VjdohT11.js +1 -0
- package/dist/assets/play-mode-BFU2PCkG.js +22 -0
- package/dist/assets/play.command-BpqqLqkq.js +2 -0
- package/dist/assets/playtest-BXIL1JEF.js +1 -0
- package/dist/assets/pose-guard-6Osb2cFu.js +1 -0
- package/dist/assets/presentation-BPP5pXeQ.js +1 -0
- package/dist/assets/product-DFhyARJj.js +1 -0
- package/dist/assets/profiler.action-CaXJDp3t.js +1 -0
- package/dist/assets/profiler.menu-BIMF6Bi4.js +1 -0
- package/dist/assets/profiler.utility-BExw9wBO.js +1 -0
- package/dist/assets/project-authoring-session-Bnt6icLr.js +2 -0
- package/dist/assets/project-provenance-BoP3nrle.js +1 -0
- package/dist/assets/prompt-labels-DSMdM2_B.js +1 -0
- package/dist/assets/properties-bone-constraints.inspector-ByT6p7S-.js +1 -0
- package/dist/assets/properties-bone.inspector-z4qJwKO5.js +1 -0
- package/dist/assets/properties-collection.inspector-D0_3ijWU.js +1 -0
- package/dist/assets/properties-constraints.inspector-CESzjuls.js +1 -0
- package/dist/assets/properties-data.inspector-hG8Wgyzb.js +1 -0
- package/dist/assets/properties-material.inspector-CzY0JCQ6.js +1 -0
- package/dist/assets/properties-modifiers.inspector-3dDhwf7g.js +1 -0
- package/dist/assets/properties-object.inspector-CiarfxkT.js +1 -0
- package/dist/assets/properties-output.inspector-DKJxmKSD.js +1 -0
- package/dist/assets/properties-particles.inspector-CCEdYWGm.js +1 -0
- package/dist/assets/properties-physics.inspector-B2c0KUyA.js +1 -0
- package/dist/assets/properties-render.inspector-Bcm0HLRW.js +1 -0
- package/dist/assets/properties-scene.inspector-PIM_eTb_.js +1 -0
- package/dist/assets/properties-texture.inspector-CgFlnyr8.js +1 -0
- package/dist/assets/properties-view-layer.inspector-DGjF_Aqo.js +1 -0
- package/dist/assets/properties-world.inspector-CrMvaRvB.js +1 -0
- package/dist/assets/r3f-design-session-D-4yyDO9.js +2 -0
- package/dist/assets/r3f-physics-binding-BBo8oma9.js +1 -0
- package/dist/assets/r3f-root-factory-z9llD1OU.js +1 -0
- package/dist/assets/r3f-source-authoring-adapter-w6Bc60K-.js +13 -0
- package/dist/assets/rapier-physics-adapter-CaZqWLu0.js +1 -0
- package/dist/assets/rapier-physics-bridge-CMoeVo3Y.js +1 -0
- package/dist/assets/react-18-By2b4xR9.js +1 -0
- package/dist/assets/react-inspector.service-B_neRnSK.js +1 -0
- package/dist/assets/react-root-CEz5NTck.js +1 -0
- package/dist/assets/react-story-board-BDDwiE2H.js +1 -0
- package/dist/assets/react-three-fiber.esm-CycrbDlA.js +1 -0
- package/dist/assets/react-three-rapier.esm-CEfKpvxT.js +1 -0
- package/dist/assets/react-world-authoring-adapter-DmrwM3py.js +1 -0
- package/dist/assets/realm-services-CobQsq_X.js +1 -0
- package/dist/assets/rebind-controller-Dtq19Vb3.js +1 -0
- package/dist/assets/recast-navigation.wasm-compat-Dsoa_MD-.js +1 -0
- package/dist/assets/reflection-probe-Don-M3Fj.js +1 -0
- package/dist/assets/reflection-probe-capture.inspector-CmFUoJCx.js +1 -0
- package/dist/assets/register-render-vitals-BiZk29b2.js +1 -0
- package/dist/assets/registry-02YZjMNp.js +1 -0
- package/dist/assets/relative-path-guard-GiM7Lsz8.js +1 -0
- package/dist/assets/render-audio-control-vMRlePWb.js +1 -0
- package/dist/assets/render-batch-system-0vq7p0VC.js +1 -0
- package/dist/assets/render-census-BrQX_CXv.js +1 -0
- package/dist/assets/render-control-Df3yTiyr.js +1 -0
- package/dist/assets/render-env-D2IV2x5k.js +1 -0
- package/dist/assets/render-features-CPQ_e568.js +1 -0
- package/dist/assets/render-seed-DF4JHy7P.js +1 -0
- package/dist/assets/render-settings-Bw4W9SYF.js +1 -0
- package/dist/assets/render-vitals-BZ5HtvMi.js +1 -0
- package/dist/assets/renderer-config-BqG4O8i9.js +1 -0
- package/dist/assets/resolve-three-SZE_WWUM.js +702 -0
- package/dist/assets/root-seam-contract-Z0VWX3Bk.js +1 -0
- package/dist/assets/rrweb-Cd2ifIRP.js +142 -0
- package/dist/assets/run-ticks-settled-C4ksViyA.js +1 -0
- package/dist/assets/runtime-inspection-l2iFQSsg.js +1 -0
- package/dist/assets/scene-capture-BQKzU0NT.js +1 -0
- package/dist/assets/scene-capture-CGYF-Viw.js +1 -0
- package/dist/assets/scene-document.service-qkDjUrlP.js +2 -0
- package/dist/assets/scene-framing-Cat0GtyJ.js +1 -0
- package/dist/assets/scene-index-B6BZOHMk.js +1 -0
- package/dist/assets/scene-query-C7_N-TpI.js +1 -0
- package/dist/assets/schema-kl9-2B_J.js +1 -0
- package/dist/assets/sculpt.layout-zJF55yCR.js +1 -0
- package/dist/assets/seeded-random-i3mtgBKZ.js +1 -0
- package/dist/assets/session-CZ5JPg-z.js +4877 -0
- package/dist/assets/setup-audio-S8GQF91f.js +1 -0
- package/dist/assets/setup-particles-GCXlnkj_.js +1 -0
- package/dist/assets/setup-physics-BeZ7-LKD.js +1 -0
- package/dist/assets/setup-renderer-DVXaSGin.js +1587 -0
- package/dist/assets/shading.layout-DULYZV6M.js +1 -0
- package/dist/assets/sim-clock-CLflx7kg.js +1 -0
- package/dist/assets/sky-precompute-worker-ChN7J87v.js +1 -0
- package/dist/assets/soft-particle-depth-DGvfQDi1.js +1 -0
- package/dist/assets/source-object3d-authoring-adapter-B-L6Ha6f.js +1 -0
- package/dist/assets/source-persistence-backend-C-aR-B_Y.js +1 -0
- package/dist/assets/spark-renderer-lifecycle-ynWESJcv.js +1 -0
- package/dist/assets/spark.module-4pXQoz5d.js +12120 -0
- package/dist/assets/stage-invalidation-DBg3C3Ta.js +1 -0
- package/dist/assets/stage-keyboard-n-5kKH-m.js +1 -0
- package/dist/assets/stage-overlay-set-B9zp2sLB.js +1 -0
- package/dist/assets/stage-presence-markers-DiGI6A45.js +1 -0
- package/dist/assets/standard-viewport-dressing-CzjAe_0A.js +7 -0
- package/dist/assets/state-bridge-DLP1jLRW.js +1 -0
- package/dist/assets/state-watch.action-BOvQR2qt.js +1 -0
- package/dist/assets/state-watch.menu-CNLvDeeY.js +1 -0
- package/dist/assets/state-watch.utility-Bg1tTTQU.js +1 -0
- package/dist/assets/static-batch-advisor-B13QEH7d.js +1 -0
- package/dist/assets/stats.module-BL02l9NC.js +1 -0
- package/dist/assets/story-arg-descriptors-Ek86ExX7.js +1 -0
- package/dist/assets/story-capture-_gC8dXV-.js +1 -0
- package/dist/assets/story-documents--TDLaPeL.js +3 -0
- package/dist/assets/story-documents.service-BiS_YbNQ.js +1 -0
- package/dist/assets/story-documents.service-CxOPYJ2j.js +1 -0
- package/dist/assets/story-media-presence-BHzk2IV5.js +1 -0
- package/dist/assets/story-mount-turn-DFRTj5hi.js +1 -0
- package/dist/assets/story-pixi-preview-BUrOJZXS.js +1 -0
- package/dist/assets/story-presentation-j2AVN-mK.js +1 -0
- package/dist/assets/story-three-preview-BHEDZzcl.js +2 -0
- package/dist/assets/structural-ids-Dc-7rEwi.js +1 -0
- package/dist/assets/structural-signature-0w-i_ats.js +1 -0
- package/dist/assets/surface-content-Dg9Kkazf.js +1 -0
- package/dist/assets/surface-state-DaxyruCj.js +3 -0
- package/dist/assets/system-adapters-rIC8FSGP.js +1 -0
- package/dist/assets/system-runner-DkOjxEBt.js +1 -0
- package/dist/assets/system-slot-E2mEdiih.js +1 -0
- package/dist/assets/team-playtest.service-DqOinFVA.js +1 -0
- package/dist/assets/texture.layout-DASpHVht.js +1 -0
- package/dist/assets/three-CDSueJyJ.js +1 -0
- package/dist/assets/three-authoring-adapter-CmSQ3Vui.js +1 -0
- package/dist/assets/three-authoring.service-iuHLwtf1.js +2 -0
- package/dist/assets/three-ingest-runtime-QzDYk6tU.js +1 -0
- package/dist/assets/three-projection-core-BmKMZ-nf.js +1 -0
- package/dist/assets/three-viewport-presentation-QBQpSdMh.js +1 -0
- package/dist/assets/three.module-D396a9Mn.js +3840 -0
- package/dist/assets/three.quarks.esm-B1C61jGo.js +1039 -0
- package/dist/assets/tools-B_NJsk05.js +1 -0
- package/dist/assets/transform-writer-BhBBTx33.js +1 -0
- package/dist/assets/transport.header-B-6HQlU2.js +1 -0
- package/dist/assets/trigger-volume-BNK2XzPL.js +1 -0
- package/dist/assets/tuples-CIQ4Bn1U.js +1 -0
- package/dist/assets/tween.module-DciWpAG6.js +1 -0
- package/dist/assets/ui-board-document-Bwtt--xp.js +2 -0
- package/dist/assets/unexported-game-trap-Dm1JYKHy.js +2 -0
- package/dist/assets/unmanaged-root-detector-B8CpbkSN.js +2 -0
- package/dist/assets/upstream-pin-BdgRH6ID.js +1 -0
- package/dist/assets/use-data-Dzq-MytE.js +1 -0
- package/dist/assets/use-live-actor-state-DErbWQWF.js +1 -0
- package/dist/assets/use-selection-DbR73-xd.js +1 -0
- package/dist/assets/user-data-BB2Of6Ht.js +1 -0
- package/dist/assets/utility-view-state-BHypxA33.js +1 -0
- package/dist/assets/uv-editing.layout-BEKHxmHw.js +1 -0
- package/dist/assets/vgai-shared-fontawesome-CU65D4Ij.js +1 -0
- package/dist/assets/vgai-shared-jsx-dev-runtime-DFDKL7fx.js +1 -0
- package/dist/assets/vgai-shared-jsx-runtime-DIqBpTut.js +1 -0
- package/dist/assets/vgai-shared-react-BT7rMc2H.js +1 -0
- package/dist/assets/vgai-shared-react-dom-DFajMqMT.js +1 -0
- package/dist/assets/vgai-shared-react-dom-client-S0ozfl6_.js +1 -0
- package/dist/assets/vgai-shared-three-Bc5PvpLM.js +1 -0
- package/dist/assets/viewport-pick-context-DkawXbEi.js +1 -0
- package/dist/assets/viewport-root-presentation-CWsE56K6.js +1 -0
- package/dist/assets/viewport-shading-BuA88e_A.js +1 -0
- package/dist/assets/viewport-shading-boundary-B_-_gABg.js +82 -0
- package/dist/assets/viewport-surface-status-B3om4Kcf.js +1 -0
- package/dist/assets/vision_bundle-DX0dWqEa.js +15 -0
- package/dist/assets/voxel-surface-DtcsSWRL.js +1 -0
- package/dist/assets/wav-encode-D31zWF6O.js +1 -0
- package/dist/assets/webgl-frame-capture-FlF9zQmW.js +1 -0
- package/dist/assets/webgl-gpu-timer-D3YX7RaD.js +1 -0
- package/dist/assets/webworkerAll-CM2o_dnz.js +1 -0
- package/dist/assets/worker-UrMcrc5_.js +2 -0
- package/dist/assets/world-documents-147tiFZe.js +1 -0
- package/dist/assets/world-root-stage-binding-vwTrtBz6.js +1 -0
- package/dist/assets/world-state-BWG-IcOd.js +1 -0
- package/dist/assets/writer-B-KovzkA.js +5 -0
- package/dist/assets/xstate-animation-binding-Brd0NST6.js +1 -0
- package/dist/assets/xstate-animation-meta-Q3u9zh_m.js +1 -0
- package/dist/assets/xstate-behavior.action-B8UluFBK.js +1 -0
- package/dist/assets/xstate-behavior.document-CKAsE45I.js +1 -0
- package/dist/assets/xstate-behavior.inspector-vJJyuifc.js +1 -0
- package/dist/assets/xstate-behavior.menu-BXbPICIh.js +1 -0
- package/dist/assets/xstate-inspection-BsZv8LS9.js +1 -0
- package/dist/vgai-shared-react.json +10 -0
- package/dist/vgai-shared-three.json +3 -0
- package/dist-node/cli.js +9320 -0
- package/dist-node/create.js +3239 -0
- package/package.json +91 -0
- package/presets.mjs +2 -0
- package/src/contributions.d.ts +4 -0
- package/src/index.ts +38 -0
- package/starter/cube.blend +0 -0
- package/starter/cube.py +81 -0
- package/template/.agents/references/project-manual.md +341 -0
- package/template/.agents/skills/editor/SKILL.md +53 -0
- package/template/.agents/skills/editor/agents/openai.yaml +4 -0
- package/template/.agents/skills/editor/references/editor-control.md +363 -0
- package/template/.agents/skills/vgai-3d-models/SKILL.md +64 -0
- package/template/.agents/skills/vgai-ingest-existing-game/SKILL.md +112 -0
- package/template/.agents/skills/vgai-threejs-authoring/SKILL.md +347 -0
- package/template/.agents/skills/vgai-threejs-authoring/agents/openai.yaml +4 -0
- package/template/.agents/skills/vgai-threejs-authoring/references/helper-catalog.md +65 -0
- package/template/.claude/skills/editor/SKILL.md +53 -0
- package/template/.claude/skills/editor/agents/openai.yaml +4 -0
- package/template/.claude/skills/editor/references/editor-control.md +363 -0
- package/template/.claude/skills/vgai-3d-models/SKILL.md +64 -0
- package/template/.claude/skills/vgai-ingest-existing-game/SKILL.md +112 -0
- package/template/.claude/skills/vgai-threejs-authoring/SKILL.md +347 -0
- package/template/.claude/skills/vgai-threejs-authoring/agents/openai.yaml +4 -0
- package/template/.claude/skills/vgai-threejs-authoring/references/helper-catalog.md +65 -0
- package/template/.github/copilot-instructions.md +6 -0
- package/template/.github/skills/editor/SKILL.md +53 -0
- package/template/.github/skills/editor/agents/openai.yaml +4 -0
- package/template/.github/skills/editor/references/editor-control.md +363 -0
- package/template/.github/skills/vgai-3d-models/SKILL.md +64 -0
- package/template/.github/skills/vgai-ingest-existing-game/SKILL.md +112 -0
- package/template/.github/skills/vgai-threejs-authoring/SKILL.md +347 -0
- package/template/.github/skills/vgai-threejs-authoring/agents/openai.yaml +4 -0
- package/template/.github/skills/vgai-threejs-authoring/references/helper-catalog.md +65 -0
- package/template/.mcp.json +12 -0
- package/template/.vgai/assets.json +1 -0
- package/template/.vgai/provenance.json +4 -0
- package/template/.volter/tracker/validation/.preset.base.mts +178 -0
- package/template/.volter/tracker/validation/preset.mts +186 -0
- package/template/.volter/tracker/visualizer/.extension.base.tsx +14 -0
- package/template/.volter/tracker/visualizer/extension.tsx +14 -0
- package/template/.volter/tracker-config.json +17 -0
- package/template/AGENTS.md +176 -0
- package/template/CLAUDE.md +1 -0
- package/template/DEVLOG.md +20 -0
- package/template/IDIOMS.md +118 -0
- package/template/LICENSE +30 -0
- package/template/README.md +83 -0
- package/template/ROADMAP.md +20 -0
- package/template/asset-manifest.json +3 -0
- package/template/check-idioms.ts +1533 -0
- package/template/index.html +18 -0
- package/template/manifest-entry-modules-plugin.ts +53 -0
- package/template/package.json +62 -0
- package/template/public/jsm/libs/basis/basis_transcoder.js +19 -0
- package/template/public/jsm/libs/basis/basis_transcoder.wasm +0 -0
- package/template/public/jsm/libs/draco/gltf/draco_decoder.js +33 -0
- package/template/public/jsm/libs/draco/gltf/draco_decoder.wasm +0 -0
- package/template/public/jsm/libs/draco/gltf/draco_encoder.js +33 -0
- package/template/public/jsm/libs/draco/gltf/draco_wasm_wrapper.js +116 -0
- package/template/public/shaders/daylight-sky.frag.glsl +15 -0
- package/template/public/shaders/daylight-sky.vert.glsl +7 -0
- package/template/scripts/patch-drei-stats-gl.mjs +35 -0
- package/template/server/colyseus-setup.ts +111 -0
- package/template/server/loopback.ts +76 -0
- package/template/server/main.ts +78 -0
- package/template/server/rooms/arena-room.ts +488 -0
- package/template/server/rooms/game-room.ts +274 -0
- package/template/server/rooms.ts +15 -0
- package/template/server/tsconfig.json +19 -0
- package/template/src/bot/QaTester.tsx +35 -0
- package/template/src/bot/behaviors.ts +203 -0
- package/template/src/bot/bot-station.ts +192 -0
- package/template/src/bot/tester-run.ts +238 -0
- package/template/src/bot/tester-station.ts +193 -0
- package/template/src/components/environment/DaylightSky.tsx +54 -0
- package/template/src/components/environment/Ground.tsx +129 -0
- package/template/src/components/environment/SceneAtmosphere.tsx +14 -0
- package/template/src/components/environment/SoftGroundShadow.tsx +62 -0
- package/template/src/components/environment/SunShadowFit.tsx +141 -0
- package/template/src/contributions/README.md +98 -0
- package/template/src/contributions/analytics.analytics.tsx +26 -0
- package/template/src/contributions/data.document.tsx +35 -0
- package/template/src/contributions/pages.finder.ts +61 -0
- package/template/src/contributions/tester.inspector.tsx +64 -0
- package/template/src/contributions/use-game-modules.ts +80 -0
- package/template/src/data/README.md +17 -0
- package/template/src/input.ts +97 -0
- package/template/src/lib/audio/capability.json +4 -0
- package/template/src/lib/audio/sfx.ts +255 -0
- package/template/src/lib/react-root/capability.json +4 -0
- package/template/src/lib/react-root/index.ts +20 -0
- package/template/src/lib/react-root/react-root-adapter.tsx +57 -0
- package/template/src/lib/reflections/ReflectionProbe.tsx +201 -0
- package/template/src/lib/reflections/capability.json +4 -0
- package/template/src/lib/reflections/index.ts +19 -0
- package/template/src/lib/reflections/probe-controller.ts +75 -0
- package/template/src/lib/reflections/reflection-probe-registry.ts +402 -0
- package/template/src/lib/reflections/volume-reflection-material.ts +416 -0
- package/template/src/lib/static-batch/Frozen.tsx +91 -0
- package/template/src/lib/static-batch/capability.json +4 -0
- package/template/src/lib/static-batch/freeze.ts +579 -0
- package/template/src/lib/static-batch/index.ts +44 -0
- package/template/src/lib/static-batch/mutation-watch.ts +149 -0
- package/template/src/lib/static-batch/shadow-cache.ts +171 -0
- package/template/src/main.ts +63 -0
- package/template/src/manifest-entry-modules.d.ts +3 -0
- package/template/src/prefabs/HeroBox.stories.tsx +23 -0
- package/template/src/prefabs/HeroBox.tsx +35 -0
- package/template/src/scenes/MainScene.tsx +77 -0
- package/template/src/world.tsx +87 -0
- package/template/tsconfig.json +35 -0
- package/template/tsconfig.node.json +32 -0
- package/template/tsconfig.tools.json +22 -0
- package/template/validate-asset-content.ts +27 -0
- package/template/validate-assets.ts +60 -0
- package/template/validate-manifest.ts +55 -0
- package/template/vgai.adapter.ts +76 -0
- package/template/vgai.project.json +24 -0
- package/template/vite.config.ts +247 -0
- package/template-dotfiles/gitignore +63 -0
- package/workbench/src/media/game-cover.css +83 -0
- package/workbench/src/product.contribution.ts +188 -0
- package/workbench/src/vgaiGameSkew.ts +276 -0
|
@@ -0,0 +1,370 @@
|
|
|
1
|
+
import{h as J,b$ as M,U as G,g as X,bZ as B,aM as Y,aY as I,c0 as O,c1 as _,c2 as Z,u as C,s as V,V as y,M as K,a0 as E,bi as Q,a as ee,r as te}from"./three.module-D396a9Mn.js";B.line={worldUnits:{value:1},linewidth:{value:1},resolution:{value:new X(1,1)},dashOffset:{value:0},dashScale:{value:1},dashSize:{value:1},gapSize:{value:1}};M.line={uniforms:G.merge([B.common,B.fog,B.line]),vertexShader:`
|
|
2
|
+
#include <common>
|
|
3
|
+
#include <color_pars_vertex>
|
|
4
|
+
#include <fog_pars_vertex>
|
|
5
|
+
#include <logdepthbuf_pars_vertex>
|
|
6
|
+
#include <clipping_planes_pars_vertex>
|
|
7
|
+
|
|
8
|
+
uniform float linewidth;
|
|
9
|
+
uniform vec2 resolution;
|
|
10
|
+
|
|
11
|
+
attribute vec3 instanceStart;
|
|
12
|
+
attribute vec3 instanceEnd;
|
|
13
|
+
|
|
14
|
+
attribute vec3 instanceColorStart;
|
|
15
|
+
attribute vec3 instanceColorEnd;
|
|
16
|
+
|
|
17
|
+
#ifdef WORLD_UNITS
|
|
18
|
+
|
|
19
|
+
varying vec4 worldPos;
|
|
20
|
+
varying vec3 worldStart;
|
|
21
|
+
varying vec3 worldEnd;
|
|
22
|
+
|
|
23
|
+
#ifdef USE_DASH
|
|
24
|
+
|
|
25
|
+
varying vec2 vUv;
|
|
26
|
+
|
|
27
|
+
#endif
|
|
28
|
+
|
|
29
|
+
#else
|
|
30
|
+
|
|
31
|
+
varying vec2 vUv;
|
|
32
|
+
|
|
33
|
+
#endif
|
|
34
|
+
|
|
35
|
+
#ifdef USE_DASH
|
|
36
|
+
|
|
37
|
+
uniform float dashScale;
|
|
38
|
+
attribute float instanceDistanceStart;
|
|
39
|
+
attribute float instanceDistanceEnd;
|
|
40
|
+
varying float vLineDistance;
|
|
41
|
+
|
|
42
|
+
#endif
|
|
43
|
+
|
|
44
|
+
void trimSegment( const in vec4 start, inout vec4 end ) {
|
|
45
|
+
|
|
46
|
+
// trim end segment so it terminates between the camera plane and the near plane
|
|
47
|
+
|
|
48
|
+
// conservative estimate of the near plane
|
|
49
|
+
float a = projectionMatrix[ 2 ][ 2 ]; // 3nd entry in 3th column
|
|
50
|
+
float b = projectionMatrix[ 3 ][ 2 ]; // 3nd entry in 4th column
|
|
51
|
+
float nearEstimate = - 0.5 * b / a;
|
|
52
|
+
|
|
53
|
+
float alpha = ( nearEstimate - start.z ) / ( end.z - start.z );
|
|
54
|
+
|
|
55
|
+
end.xyz = mix( start.xyz, end.xyz, alpha );
|
|
56
|
+
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
void main() {
|
|
60
|
+
|
|
61
|
+
#ifdef USE_COLOR
|
|
62
|
+
|
|
63
|
+
vColor.xyz = ( position.y < 0.5 ) ? instanceColorStart : instanceColorEnd;
|
|
64
|
+
|
|
65
|
+
#endif
|
|
66
|
+
|
|
67
|
+
#ifdef USE_DASH
|
|
68
|
+
|
|
69
|
+
vLineDistance = ( position.y < 0.5 ) ? dashScale * instanceDistanceStart : dashScale * instanceDistanceEnd;
|
|
70
|
+
vUv = uv;
|
|
71
|
+
|
|
72
|
+
#endif
|
|
73
|
+
|
|
74
|
+
float aspect = resolution.x / resolution.y;
|
|
75
|
+
|
|
76
|
+
// camera space
|
|
77
|
+
vec4 start = modelViewMatrix * vec4( instanceStart, 1.0 );
|
|
78
|
+
vec4 end = modelViewMatrix * vec4( instanceEnd, 1.0 );
|
|
79
|
+
|
|
80
|
+
#ifdef WORLD_UNITS
|
|
81
|
+
|
|
82
|
+
worldStart = start.xyz;
|
|
83
|
+
worldEnd = end.xyz;
|
|
84
|
+
|
|
85
|
+
#else
|
|
86
|
+
|
|
87
|
+
vUv = uv;
|
|
88
|
+
|
|
89
|
+
#endif
|
|
90
|
+
|
|
91
|
+
// special case for perspective projection, and segments that terminate either in, or behind, the camera plane
|
|
92
|
+
// clearly the gpu firmware has a way of addressing this issue when projecting into ndc space
|
|
93
|
+
// but we need to perform ndc-space calculations in the shader, so we must address this issue directly
|
|
94
|
+
// perhaps there is a more elegant solution -- WestLangley
|
|
95
|
+
|
|
96
|
+
bool perspective = ( projectionMatrix[ 2 ][ 3 ] == - 1.0 ); // 4th entry in the 3rd column
|
|
97
|
+
|
|
98
|
+
if ( perspective ) {
|
|
99
|
+
|
|
100
|
+
if ( start.z < 0.0 && end.z >= 0.0 ) {
|
|
101
|
+
|
|
102
|
+
trimSegment( start, end );
|
|
103
|
+
|
|
104
|
+
} else if ( end.z < 0.0 && start.z >= 0.0 ) {
|
|
105
|
+
|
|
106
|
+
trimSegment( end, start );
|
|
107
|
+
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
// clip space
|
|
113
|
+
vec4 clipStart = projectionMatrix * start;
|
|
114
|
+
vec4 clipEnd = projectionMatrix * end;
|
|
115
|
+
|
|
116
|
+
// ndc space
|
|
117
|
+
vec3 ndcStart = clipStart.xyz / clipStart.w;
|
|
118
|
+
vec3 ndcEnd = clipEnd.xyz / clipEnd.w;
|
|
119
|
+
|
|
120
|
+
// direction
|
|
121
|
+
vec2 dir = ndcEnd.xy - ndcStart.xy;
|
|
122
|
+
|
|
123
|
+
// account for clip-space aspect ratio
|
|
124
|
+
dir.x *= aspect;
|
|
125
|
+
dir = normalize( dir );
|
|
126
|
+
|
|
127
|
+
#ifdef WORLD_UNITS
|
|
128
|
+
|
|
129
|
+
vec3 worldDir = normalize( end.xyz - start.xyz );
|
|
130
|
+
vec3 tmpFwd = normalize( mix( start.xyz, end.xyz, 0.5 ) );
|
|
131
|
+
vec3 worldUp = normalize( cross( worldDir, tmpFwd ) );
|
|
132
|
+
vec3 worldFwd = cross( worldDir, worldUp );
|
|
133
|
+
worldPos = position.y < 0.5 ? start: end;
|
|
134
|
+
|
|
135
|
+
// height offset
|
|
136
|
+
float hw = linewidth * 0.5;
|
|
137
|
+
worldPos.xyz += position.x < 0.0 ? hw * worldUp : - hw * worldUp;
|
|
138
|
+
|
|
139
|
+
// don't extend the line if we're rendering dashes because we
|
|
140
|
+
// won't be rendering the endcaps
|
|
141
|
+
#ifndef USE_DASH
|
|
142
|
+
|
|
143
|
+
// cap extension
|
|
144
|
+
worldPos.xyz += position.y < 0.5 ? - hw * worldDir : hw * worldDir;
|
|
145
|
+
|
|
146
|
+
// add width to the box
|
|
147
|
+
worldPos.xyz += worldFwd * hw;
|
|
148
|
+
|
|
149
|
+
// endcaps
|
|
150
|
+
if ( position.y > 1.0 || position.y < 0.0 ) {
|
|
151
|
+
|
|
152
|
+
worldPos.xyz -= worldFwd * 2.0 * hw;
|
|
153
|
+
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
#endif
|
|
157
|
+
|
|
158
|
+
// project the worldpos
|
|
159
|
+
vec4 clip = projectionMatrix * worldPos;
|
|
160
|
+
|
|
161
|
+
// shift the depth of the projected points so the line
|
|
162
|
+
// segments overlap neatly
|
|
163
|
+
vec3 clipPose = ( position.y < 0.5 ) ? ndcStart : ndcEnd;
|
|
164
|
+
clip.z = clipPose.z * clip.w;
|
|
165
|
+
|
|
166
|
+
#else
|
|
167
|
+
|
|
168
|
+
vec2 offset = vec2( dir.y, - dir.x );
|
|
169
|
+
// undo aspect ratio adjustment
|
|
170
|
+
dir.x /= aspect;
|
|
171
|
+
offset.x /= aspect;
|
|
172
|
+
|
|
173
|
+
// sign flip
|
|
174
|
+
if ( position.x < 0.0 ) offset *= - 1.0;
|
|
175
|
+
|
|
176
|
+
// endcaps
|
|
177
|
+
if ( position.y < 0.0 ) {
|
|
178
|
+
|
|
179
|
+
offset += - dir;
|
|
180
|
+
|
|
181
|
+
} else if ( position.y > 1.0 ) {
|
|
182
|
+
|
|
183
|
+
offset += dir;
|
|
184
|
+
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
// adjust for linewidth
|
|
188
|
+
offset *= linewidth;
|
|
189
|
+
|
|
190
|
+
// adjust for clip-space to screen-space conversion // maybe resolution should be based on viewport ...
|
|
191
|
+
offset /= resolution.y;
|
|
192
|
+
|
|
193
|
+
// select end
|
|
194
|
+
vec4 clip = ( position.y < 0.5 ) ? clipStart : clipEnd;
|
|
195
|
+
|
|
196
|
+
// back to clip space
|
|
197
|
+
offset *= clip.w;
|
|
198
|
+
|
|
199
|
+
clip.xy += offset;
|
|
200
|
+
|
|
201
|
+
#endif
|
|
202
|
+
|
|
203
|
+
gl_Position = clip;
|
|
204
|
+
|
|
205
|
+
vec4 mvPosition = ( position.y < 0.5 ) ? start : end; // this is an approximation
|
|
206
|
+
|
|
207
|
+
#include <logdepthbuf_vertex>
|
|
208
|
+
#include <clipping_planes_vertex>
|
|
209
|
+
#include <fog_vertex>
|
|
210
|
+
|
|
211
|
+
}
|
|
212
|
+
`,fragmentShader:`
|
|
213
|
+
uniform vec3 diffuse;
|
|
214
|
+
uniform float opacity;
|
|
215
|
+
uniform float linewidth;
|
|
216
|
+
|
|
217
|
+
#ifdef USE_DASH
|
|
218
|
+
|
|
219
|
+
uniform float dashOffset;
|
|
220
|
+
uniform float dashSize;
|
|
221
|
+
uniform float gapSize;
|
|
222
|
+
|
|
223
|
+
#endif
|
|
224
|
+
|
|
225
|
+
varying float vLineDistance;
|
|
226
|
+
|
|
227
|
+
#ifdef WORLD_UNITS
|
|
228
|
+
|
|
229
|
+
varying vec4 worldPos;
|
|
230
|
+
varying vec3 worldStart;
|
|
231
|
+
varying vec3 worldEnd;
|
|
232
|
+
|
|
233
|
+
#ifdef USE_DASH
|
|
234
|
+
|
|
235
|
+
varying vec2 vUv;
|
|
236
|
+
|
|
237
|
+
#endif
|
|
238
|
+
|
|
239
|
+
#else
|
|
240
|
+
|
|
241
|
+
varying vec2 vUv;
|
|
242
|
+
|
|
243
|
+
#endif
|
|
244
|
+
|
|
245
|
+
#include <common>
|
|
246
|
+
#include <color_pars_fragment>
|
|
247
|
+
#include <fog_pars_fragment>
|
|
248
|
+
#include <logdepthbuf_pars_fragment>
|
|
249
|
+
#include <clipping_planes_pars_fragment>
|
|
250
|
+
|
|
251
|
+
vec2 closestLineToLine(vec3 p1, vec3 p2, vec3 p3, vec3 p4) {
|
|
252
|
+
|
|
253
|
+
float mua;
|
|
254
|
+
float mub;
|
|
255
|
+
|
|
256
|
+
vec3 p13 = p1 - p3;
|
|
257
|
+
vec3 p43 = p4 - p3;
|
|
258
|
+
|
|
259
|
+
vec3 p21 = p2 - p1;
|
|
260
|
+
|
|
261
|
+
float d1343 = dot( p13, p43 );
|
|
262
|
+
float d4321 = dot( p43, p21 );
|
|
263
|
+
float d1321 = dot( p13, p21 );
|
|
264
|
+
float d4343 = dot( p43, p43 );
|
|
265
|
+
float d2121 = dot( p21, p21 );
|
|
266
|
+
|
|
267
|
+
float denom = d2121 * d4343 - d4321 * d4321;
|
|
268
|
+
|
|
269
|
+
float numer = d1343 * d4321 - d1321 * d4343;
|
|
270
|
+
|
|
271
|
+
mua = numer / denom;
|
|
272
|
+
mua = clamp( mua, 0.0, 1.0 );
|
|
273
|
+
mub = ( d1343 + d4321 * ( mua ) ) / d4343;
|
|
274
|
+
mub = clamp( mub, 0.0, 1.0 );
|
|
275
|
+
|
|
276
|
+
return vec2( mua, mub );
|
|
277
|
+
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
void main() {
|
|
281
|
+
|
|
282
|
+
float alpha = opacity;
|
|
283
|
+
vec4 diffuseColor = vec4( diffuse, alpha );
|
|
284
|
+
|
|
285
|
+
#include <clipping_planes_fragment>
|
|
286
|
+
|
|
287
|
+
#ifdef USE_DASH
|
|
288
|
+
|
|
289
|
+
if ( vUv.y < - 1.0 || vUv.y > 1.0 ) discard; // discard endcaps
|
|
290
|
+
|
|
291
|
+
if ( mod( vLineDistance + dashOffset, dashSize + gapSize ) > dashSize ) discard; // todo - FIX
|
|
292
|
+
|
|
293
|
+
#endif
|
|
294
|
+
|
|
295
|
+
#ifdef WORLD_UNITS
|
|
296
|
+
|
|
297
|
+
// Find the closest points on the view ray and the line segment
|
|
298
|
+
vec3 rayEnd = normalize( worldPos.xyz ) * 1e5;
|
|
299
|
+
vec3 lineDir = worldEnd - worldStart;
|
|
300
|
+
vec2 params = closestLineToLine( worldStart, worldEnd, vec3( 0.0, 0.0, 0.0 ), rayEnd );
|
|
301
|
+
|
|
302
|
+
vec3 p1 = worldStart + lineDir * params.x;
|
|
303
|
+
vec3 p2 = rayEnd * params.y;
|
|
304
|
+
vec3 delta = p1 - p2;
|
|
305
|
+
float len = length( delta );
|
|
306
|
+
float norm = len / linewidth;
|
|
307
|
+
|
|
308
|
+
#ifndef USE_DASH
|
|
309
|
+
|
|
310
|
+
#ifdef USE_ALPHA_TO_COVERAGE
|
|
311
|
+
|
|
312
|
+
float dnorm = fwidth( norm );
|
|
313
|
+
alpha = 1.0 - smoothstep( 0.5 - dnorm, 0.5 + dnorm, norm );
|
|
314
|
+
|
|
315
|
+
#else
|
|
316
|
+
|
|
317
|
+
if ( norm > 0.5 ) {
|
|
318
|
+
|
|
319
|
+
discard;
|
|
320
|
+
|
|
321
|
+
}
|
|
322
|
+
|
|
323
|
+
#endif
|
|
324
|
+
|
|
325
|
+
#endif
|
|
326
|
+
|
|
327
|
+
#else
|
|
328
|
+
|
|
329
|
+
#ifdef USE_ALPHA_TO_COVERAGE
|
|
330
|
+
|
|
331
|
+
// artifacts appear on some hardware if a derivative is taken within a conditional
|
|
332
|
+
float a = vUv.x;
|
|
333
|
+
float b = ( vUv.y > 0.0 ) ? vUv.y - 1.0 : vUv.y + 1.0;
|
|
334
|
+
float len2 = a * a + b * b;
|
|
335
|
+
float dlen = fwidth( len2 );
|
|
336
|
+
|
|
337
|
+
if ( abs( vUv.y ) > 1.0 ) {
|
|
338
|
+
|
|
339
|
+
alpha = 1.0 - smoothstep( 1.0 - dlen, 1.0 + dlen, len2 );
|
|
340
|
+
|
|
341
|
+
}
|
|
342
|
+
|
|
343
|
+
#else
|
|
344
|
+
|
|
345
|
+
if ( abs( vUv.y ) > 1.0 ) {
|
|
346
|
+
|
|
347
|
+
float a = vUv.x;
|
|
348
|
+
float b = ( vUv.y > 0.0 ) ? vUv.y - 1.0 : vUv.y + 1.0;
|
|
349
|
+
float len2 = a * a + b * b;
|
|
350
|
+
|
|
351
|
+
if ( len2 > 1.0 ) discard;
|
|
352
|
+
|
|
353
|
+
}
|
|
354
|
+
|
|
355
|
+
#endif
|
|
356
|
+
|
|
357
|
+
#endif
|
|
358
|
+
|
|
359
|
+
#include <logdepthbuf_fragment>
|
|
360
|
+
#include <color_fragment>
|
|
361
|
+
|
|
362
|
+
gl_FragColor = vec4( diffuseColor.rgb, alpha );
|
|
363
|
+
|
|
364
|
+
#include <tonemapping_fragment>
|
|
365
|
+
#include <colorspace_fragment>
|
|
366
|
+
#include <fog_fragment>
|
|
367
|
+
#include <premultiplied_alpha_fragment>
|
|
368
|
+
|
|
369
|
+
}
|
|
370
|
+
`};class ie extends J{constructor(e){super({type:"LineMaterial",uniforms:G.clone(M.line.uniforms),vertexShader:M.line.vertexShader,fragmentShader:M.line.fragmentShader,clipping:!0}),this.isLineMaterial=!0,this.setValues(e)}get color(){return this.uniforms.diffuse.value}set color(e){this.uniforms.diffuse.value=e}get worldUnits(){return"WORLD_UNITS"in this.defines}set worldUnits(e){e===!0?this.defines.WORLD_UNITS="":delete this.defines.WORLD_UNITS}get linewidth(){return this.uniforms.linewidth.value}set linewidth(e){this.uniforms.linewidth&&(this.uniforms.linewidth.value=e)}get dashed(){return"USE_DASH"in this.defines}set dashed(e){e===!0!==this.dashed&&(this.needsUpdate=!0),e===!0?this.defines.USE_DASH="":delete this.defines.USE_DASH}get dashScale(){return this.uniforms.dashScale.value}set dashScale(e){this.uniforms.dashScale.value=e}get dashSize(){return this.uniforms.dashSize.value}set dashSize(e){this.uniforms.dashSize.value=e}get dashOffset(){return this.uniforms.dashOffset.value}set dashOffset(e){this.uniforms.dashOffset.value=e}get gapSize(){return this.uniforms.gapSize.value}set gapSize(e){this.uniforms.gapSize.value=e}get opacity(){return this.uniforms.opacity.value}set opacity(e){this.uniforms&&(this.uniforms.opacity.value=e)}get resolution(){return this.uniforms.resolution.value}set resolution(e){this.uniforms.resolution.value.copy(e)}get alphaToCoverage(){return"USE_ALPHA_TO_COVERAGE"in this.defines}set alphaToCoverage(e){this.defines&&(e===!0!==this.alphaToCoverage&&(this.needsUpdate=!0),e===!0?this.defines.USE_ALPHA_TO_COVERAGE="":delete this.defines.USE_ALPHA_TO_COVERAGE)}}const j=new C,z=new y;class ne extends Y{constructor(){super(),this.isLineSegmentsGeometry=!0,this.type="LineSegmentsGeometry";const e=[-1,2,0,1,2,0,-1,1,0,1,1,0,-1,0,0,1,0,0,-1,-1,0,1,-1,0],t=[-1,2,1,2,-1,1,1,1,-1,-1,1,-1,-1,-2,1,-2],i=[0,2,1,2,3,1,2,4,3,4,5,3,4,6,5,6,7,5];this.setIndex(i),this.setAttribute("position",new I(e,3)),this.setAttribute("uv",new I(t,2))}applyMatrix4(e){const t=this.attributes.instanceStart,i=this.attributes.instanceEnd;return t!==void 0&&(t.applyMatrix4(e),i.applyMatrix4(e),t.needsUpdate=!0),this.boundingBox!==null&&this.computeBoundingBox(),this.boundingSphere!==null&&this.computeBoundingSphere(),this}setPositions(e){let t;e instanceof Float32Array?t=e:Array.isArray(e)&&(t=new Float32Array(e));const i=new O(t,6,1);return this.setAttribute("instanceStart",new _(i,3,0)),this.setAttribute("instanceEnd",new _(i,3,3)),this.instanceCount=this.attributes.instanceStart.count,this.computeBoundingBox(),this.computeBoundingSphere(),this}setColors(e){let t;e instanceof Float32Array?t=e:Array.isArray(e)&&(t=new Float32Array(e));const i=new O(t,6,1);return this.setAttribute("instanceColorStart",new _(i,3,0)),this.setAttribute("instanceColorEnd",new _(i,3,3)),this}fromWireframeGeometry(e){return this.setPositions(e.attributes.position.array),this}fromEdgesGeometry(e){return this.setPositions(e.attributes.position.array),this}fromMesh(e){return this.fromWireframeGeometry(new Z(e.geometry)),this}fromLineSegments(e){const t=e.geometry;return this.setPositions(t.attributes.position.array),this}computeBoundingBox(){this.boundingBox===null&&(this.boundingBox=new C);const e=this.attributes.instanceStart,t=this.attributes.instanceEnd;e!==void 0&&t!==void 0&&(this.boundingBox.setFromBufferAttribute(e),j.setFromBufferAttribute(t),this.boundingBox.union(j))}computeBoundingSphere(){this.boundingSphere===null&&(this.boundingSphere=new V),this.boundingBox===null&&this.computeBoundingBox();const e=this.attributes.instanceStart,t=this.attributes.instanceEnd;if(e!==void 0&&t!==void 0){const i=this.boundingSphere.center;this.boundingBox.getCenter(i);let s=0;for(let r=0,l=e.count;r<l;r++)z.fromBufferAttribute(e,r),s=Math.max(s,i.distanceToSquared(z)),z.fromBufferAttribute(t,r),s=Math.max(s,i.distanceToSquared(z));this.boundingSphere.radius=Math.sqrt(s),isNaN(this.boundingSphere.radius)&&console.error("THREE.LineSegmentsGeometry.computeBoundingSphere(): Computed radius is NaN. The instanced position data is likely to have NaN values.",this)}}toJSON(){}}const L=new E,H=new y,R=new y,a=new E,o=new E,m=new E,D=new y,T=new ee,d=new Q,N=new y,U=new C,A=new V,v=new E;let g,x;function F(c,e,t){return v.set(0,0,-e,1).applyMatrix4(c.projectionMatrix),v.multiplyScalar(1/v.w),v.x=x/t.width,v.y=x/t.height,v.applyMatrix4(c.projectionMatrixInverse),v.multiplyScalar(1/v.w),Math.abs(Math.max(v.x,v.y))}function se(c,e){const t=c.matrixWorld,i=c.geometry,s=i.attributes.instanceStart,r=i.attributes.instanceEnd,l=Math.min(i.instanceCount,s.count);for(let n=0,f=l;n<f;n++){d.start.fromBufferAttribute(s,n),d.end.fromBufferAttribute(r,n),d.applyMatrix4(t);const p=new y,h=new y;g.distanceSqToSegment(d.start,d.end,h,p),h.distanceTo(p)<x*.5&&e.push({point:h,pointOnLine:p,distance:g.origin.distanceTo(h),object:c,face:null,faceIndex:n,uv:null,uv1:null})}}function re(c,e,t){const i=e.projectionMatrix,r=c.material.resolution,l=c.matrixWorld,n=c.geometry,f=n.attributes.instanceStart,p=n.attributes.instanceEnd,h=Math.min(n.instanceCount,f.count),u=-e.near;g.at(1,m),m.w=1,m.applyMatrix4(e.matrixWorldInverse),m.applyMatrix4(i),m.multiplyScalar(1/m.w),m.x*=r.x/2,m.y*=r.y/2,m.z=0,D.copy(m),T.multiplyMatrices(e.matrixWorldInverse,l);for(let S=0,q=h;S<q;S++){if(a.fromBufferAttribute(f,S),o.fromBufferAttribute(p,S),a.w=1,o.w=1,a.applyMatrix4(T),o.applyMatrix4(T),a.z>u&&o.z>u)continue;if(a.z>u){const b=a.z-o.z,w=(a.z-u)/b;a.lerp(o,w)}else if(o.z>u){const b=o.z-a.z,w=(o.z-u)/b;o.lerp(a,w)}a.applyMatrix4(i),o.applyMatrix4(i),a.multiplyScalar(1/a.w),o.multiplyScalar(1/o.w),a.x*=r.x/2,a.y*=r.y/2,o.x*=r.x/2,o.y*=r.y/2,d.start.copy(a),d.start.z=0,d.end.copy(o),d.end.z=0;const P=d.closestPointToPointParameter(D,!0);d.at(P,N);const W=te.lerp(a.z,o.z,P),k=W>=-1&&W<=1,$=D.distanceTo(N)<x*.5;if(k&&$){d.start.fromBufferAttribute(f,S),d.end.fromBufferAttribute(p,S),d.start.applyMatrix4(l),d.end.applyMatrix4(l);const b=new y,w=new y;g.distanceSqToSegment(d.start,d.end,w,b),t.push({point:w,pointOnLine:b,distance:g.origin.distanceTo(w),object:c,face:null,faceIndex:S,uv:null,uv1:null})}}}class de extends K{constructor(e=new ne,t=new ie({color:Math.random()*16777215})){super(e,t),this.isLineSegments2=!0,this.type="LineSegments2"}computeLineDistances(){const e=this.geometry,t=e.attributes.instanceStart,i=e.attributes.instanceEnd,s=new Float32Array(2*t.count);for(let l=0,n=0,f=t.count;l<f;l++,n+=2)H.fromBufferAttribute(t,l),R.fromBufferAttribute(i,l),s[n]=n===0?0:s[n-1],s[n+1]=s[n]+H.distanceTo(R);const r=new O(s,2,1);return e.setAttribute("instanceDistanceStart",new _(r,1,0)),e.setAttribute("instanceDistanceEnd",new _(r,1,1)),this}raycast(e,t){const i=this.material.worldUnits,s=e.camera;s===null&&!i&&console.error('LineSegments2: "Raycaster.camera" needs to be set in order to raycast against LineSegments2 while worldUnits is set to false.');const r=e.params.Line2!==void 0&&e.params.Line2.threshold||0;g=e.ray;const l=this.matrixWorld,n=this.geometry,f=this.material;x=f.linewidth+r,n.boundingSphere===null&&n.computeBoundingSphere(),A.copy(n.boundingSphere).applyMatrix4(l);let p;if(i)p=x*.5;else{const u=Math.max(s.near,A.distanceToPoint(g.origin));p=F(s,u,f.resolution)}if(A.radius+=p,g.intersectsSphere(A)===!1)return;n.boundingBox===null&&n.computeBoundingBox(),U.copy(n.boundingBox).applyMatrix4(l);let h;if(i)h=x*.5;else{const u=Math.max(s.near,U.distanceToPoint(g.origin));h=F(s,u,f.resolution)}U.expandByScalar(h),g.intersectsBox(U)!==!1&&(i?se(this,t):re(this,s,t))}onBeforeRender(e){const t=this.material.uniforms;t&&t.resolution&&(e.getViewport(L),this.material.uniforms.resolution.value.set(L.z,L.w))}}export{de as L,ne as a,ie as b};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{ak as b,b2 as w,al as M,aq as x,a2 as F,b3 as d,C as u,j as f,a$ as O,g,b4 as y,e as C}from"./three.module-D396a9Mn.js";class A extends b{constructor(s){super(s)}load(s,o,p,e){const a=this,n=this.path===""?w.extractUrlBase(s):this.path,r=new M(this.manager);r.setPath(this.path),r.setRequestHeader(this.requestHeader),r.setWithCredentials(this.withCredentials),r.load(s,function(t){try{o(a.parse(t,n))}catch(i){e?e(i):console.error(i),a.manager.itemError(s)}},p,e)}setMaterialOptions(s){return this.materialOptions=s,this}parse(s,o){const p=s.split(`
|
|
2
|
+
`);let e={};const a=/\s+/,n={};for(let t=0;t<p.length;t++){let i=p[t];if(i=i.trim(),i.length===0||i.charAt(0)==="#")continue;const c=i.indexOf(" ");let l=c>=0?i.substring(0,c):i;l=l.toLowerCase();let h=c>=0?i.substring(c+1):"";if(h=h.trim(),l==="newmtl")e={name:h},n[h]=e;else if(l==="ka"||l==="kd"||l==="ks"||l==="ke"){const m=h.split(a,3);e[l]=[parseFloat(m[0]),parseFloat(m[1]),parseFloat(m[2])]}else e[l]=h}const r=new L(this.resourcePath||o,this.materialOptions);return r.setCrossOrigin(this.crossOrigin),r.setManager(this.manager),r.setMaterials(n),r}}class L{constructor(s="",o={}){this.baseUrl=s,this.options=o,this.materialsInfo={},this.materials={},this.materialsArray=[],this.nameLookup={},this.crossOrigin="anonymous",this.side=this.options.side!==void 0?this.options.side:x,this.wrap=this.options.wrap!==void 0?this.options.wrap:F}setCrossOrigin(s){return this.crossOrigin=s,this}setManager(s){this.manager=s}setMaterials(s){this.materialsInfo=this.convert(s),this.materials={},this.materialsArray=[],this.nameLookup={}}convert(s){if(!this.options)return s;const o={};for(const p in s){const e=s[p],a={};o[p]=a;for(const n in e){let r=!0,t=e[n];const i=n.toLowerCase();switch(i){case"kd":case"ka":case"ks":this.options&&this.options.normalizeRGB&&(t=[t[0]/255,t[1]/255,t[2]/255]),this.options&&this.options.ignoreZeroRGBs&&t[0]===0&&t[1]===0&&t[2]===0&&(r=!1);break}r&&(a[i]=t)}}return o}preload(){for(const s in this.materialsInfo)this.create(s)}getIndex(s){return this.nameLookup[s]}getAsArray(){let s=0;for(const o in this.materialsInfo)this.materialsArray[s]=this.create(o),this.nameLookup[o]=s,s++;return this.materialsArray}create(s){return this.materials[s]===void 0&&this.createMaterial_(s),this.materials[s]}createMaterial_(s){const o=this,p=this.materialsInfo[s],e={name:s,side:this.side};function a(r,t){return typeof t!="string"||t===""?"":/^https?:\/\//i.test(t)?t:r+t}function n(r,t){if(e[r])return;const i=o.getTextureParams(t,e),c=o.loadTexture(a(o.baseUrl,i.url));c.repeat.copy(i.scale),c.offset.copy(i.offset),c.wrapS=o.wrap,c.wrapT=o.wrap,(r==="map"||r==="emissiveMap")&&(c.colorSpace=f),e[r]=c}for(const r in p){const t=p[r];let i;if(t!=="")switch(r.toLowerCase()){case"kd":e.color=d.colorSpaceToWorking(new u().fromArray(t),f);break;case"ks":e.specular=d.colorSpaceToWorking(new u().fromArray(t),f);break;case"ke":e.emissive=d.colorSpaceToWorking(new u().fromArray(t),f);break;case"map_kd":n("map",t);break;case"map_ks":n("specularMap",t);break;case"map_ke":n("emissiveMap",t);break;case"norm":n("normalMap",t);break;case"map_bump":case"bump":n("bumpMap",t);break;case"disp":n("displacementMap",t);break;case"map_d":n("alphaMap",t),e.transparent=!0;break;case"ns":e.shininess=parseFloat(t);break;case"d":i=parseFloat(t),i<1&&(e.opacity=i,e.transparent=!0);break;case"tr":i=parseFloat(t),this.options&&this.options.invertTrProperty&&(i=1-i),i>0&&(e.opacity=1-i,e.transparent=!0);break}}return this.materials[s]=new O(e),this.materials[s]}getTextureParams(s,o){const p={scale:new g(1,1),offset:new g(0,0)},e=s.split(/\s+/);let a;return a=e.indexOf("-bm"),a>=0&&(o.bumpScale=parseFloat(e[a+1]),e.splice(a,2)),a=e.indexOf("-mm"),a>=0&&(o.displacementBias=parseFloat(e[a+1]),o.displacementScale=parseFloat(e[a+2]),e.splice(a,3)),a=e.indexOf("-s"),a>=0&&(p.scale.set(parseFloat(e[a+1]),parseFloat(e[a+2])),e.splice(a,4)),a=e.indexOf("-o"),a>=0&&(p.offset.set(parseFloat(e[a+1]),parseFloat(e[a+2])),e.splice(a,4)),p.url=e.join(" ").trim(),p}loadTexture(s,o,p,e,a){const n=this.manager!==void 0?this.manager:y;let r=n.getHandler(s);r===null&&(r=new C(n)),r.setCrossOrigin&&r.setCrossOrigin(this.crossOrigin);const t=r.load(s,p,e,a);return o!==void 0&&(t.mapping=o),t}}export{A as MTLLoader};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{M as q,aB as t1,aC as H,aV as N,s as i1,V as e1,C as R}from"./three.module-D396a9Mn.js";class s1 extends q{constructor(K,L,O=!1,Q=!1,J=1e4){const v=new t1;super(v,L),this.isMarchingCubes=!0;const t=this,g=new Float32Array(36),C=new Float32Array(36),U=new Float32Array(36);this.enableUvs=O,this.enableColors=Q,this.init=function(e){this.resolution=e,this.isolation=80,this.size=e,this.size2=this.size*this.size,this.size3=this.size2*this.size,this.halfsize=this.size/2,this.delta=2/this.size,this.yd=this.size,this.zd=this.size2,this.field=new Float32Array(this.size3),this.normal_cache=new Float32Array(this.size3*3),this.palette=new Float32Array(this.size3*3),this.count=0;const i=J*3;this.positionArray=new Float32Array(i*3);const r=new H(this.positionArray,3);r.setUsage(N),v.setAttribute("position",r),this.normalArray=new Float32Array(i*3);const s=new H(this.normalArray,3);if(s.setUsage(N),v.setAttribute("normal",s),this.enableUvs){this.uvArray=new Float32Array(i*2);const x=new H(this.uvArray,2);x.setUsage(N),v.setAttribute("uv",x)}if(this.enableColors){this.colorArray=new Float32Array(i*3);const x=new H(this.colorArray,3);x.setUsage(N),v.setAttribute("color",x)}v.boundingSphere=new i1(new e1,1)};function b(e,i,r){return e+(i-e)*r}function X(e,i,r,s,x,n,a,c,f,d){const l=(r-a)/(c-a),h=t.normal_cache;g[i+0]=s+l*t.delta,g[i+1]=x,g[i+2]=n,C[i+0]=b(h[e+0],h[e+3],l),C[i+1]=b(h[e+1],h[e+4],l),C[i+2]=b(h[e+2],h[e+5],l),U[i+0]=b(t.palette[f*3+0],t.palette[d*3+0],l),U[i+1]=b(t.palette[f*3+1],t.palette[d*3+1],l),U[i+2]=b(t.palette[f*3+2],t.palette[d*3+2],l)}function Y(e,i,r,s,x,n,a,c,f,d){const l=(r-a)/(c-a),h=t.normal_cache;g[i+0]=s,g[i+1]=x+l*t.delta,g[i+2]=n;const o=e+t.yd*3;C[i+0]=b(h[e+0],h[o+0],l),C[i+1]=b(h[e+1],h[o+1],l),C[i+2]=b(h[e+2],h[o+2],l),U[i+0]=b(t.palette[f*3+0],t.palette[d*3+0],l),U[i+1]=b(t.palette[f*3+1],t.palette[d*3+1],l),U[i+2]=b(t.palette[f*3+2],t.palette[d*3+2],l)}function Z(e,i,r,s,x,n,a,c,f,d){const l=(r-a)/(c-a),h=t.normal_cache;g[i+0]=s,g[i+1]=x,g[i+2]=n+l*t.delta;const o=e+t.zd*3;C[i+0]=b(h[e+0],h[o+0],l),C[i+1]=b(h[e+1],h[o+1],l),C[i+2]=b(h[e+2],h[o+2],l),U[i+0]=b(t.palette[f*3+0],t.palette[d*3+0],l),U[i+1]=b(t.palette[f*3+1],t.palette[d*3+1],l),U[i+2]=b(t.palette[f*3+2],t.palette[d*3+2],l)}function y(e){const i=e*3;t.normal_cache[i]===0&&(t.normal_cache[i+0]=t.field[e-1]-t.field[e+1],t.normal_cache[i+1]=t.field[e-t.yd]-t.field[e+t.yd],t.normal_cache[i+2]=t.field[e-t.zd]-t.field[e+t.zd])}function W(e,i,r,s,x){const n=s+1,a=s+t.yd,c=s+t.zd,f=n+t.yd,d=n+t.zd,l=s+t.yd+t.zd,h=n+t.yd+t.zd;let o=0;const z=t.field[s],A=t.field[n],p=t.field[a],w=t.field[f],F=t.field[c],V=t.field[d],m=t.field[l],M=t.field[h];z<x&&(o|=1),A<x&&(o|=2),p<x&&(o|=8),w<x&&(o|=4),F<x&&(o|=16),V<x&&(o|=32),m<x&&(o|=128),M<x&&(o|=64);const u=a1[o];if(u===0)return 0;const I=t.delta,S=e+I,B=i+I,D=r+I;u&1&&(y(s),y(n),X(s*3,0,x,e,i,r,z,A,s,n)),u&2&&(y(n),y(f),Y(n*3,3,x,S,i,r,A,w,n,f)),u&4&&(y(a),y(f),X(a*3,6,x,e,B,r,p,w,a,f)),u&8&&(y(s),y(a),Y(s*3,9,x,e,i,r,z,p,s,a)),u&16&&(y(c),y(d),X(c*3,12,x,e,i,D,F,V,c,d)),u&32&&(y(d),y(h),Y(d*3,15,x,S,i,D,V,M,d,h)),u&64&&(y(l),y(h),X(l*3,18,x,e,B,D,m,M,l,h)),u&128&&(y(c),y(l),Y(c*3,21,x,e,i,D,F,m,c,l)),u&256&&(y(s),y(c),Z(s*3,24,x,e,i,r,z,F,s,c)),u&512&&(y(n),y(d),Z(n*3,27,x,S,i,r,A,V,n,d)),u&1024&&(y(f),y(h),Z(f*3,30,x,S,B,r,w,M,f,h)),u&2048&&(y(a),y(l),Z(a*3,33,x,e,B,r,p,m,a,l)),o<<=4;let P,E,G,T=0,_=0;for(;j[o+_]!=-1;)P=o+_,E=P+1,G=P+2,$(g,C,U,3*j[P],3*j[E],3*j[G]),_+=3,T++;return T}function $(e,i,r,s,x,n){const a=t.count*3;if(t.positionArray[a+0]=e[s],t.positionArray[a+1]=e[s+1],t.positionArray[a+2]=e[s+2],t.positionArray[a+3]=e[x],t.positionArray[a+4]=e[x+1],t.positionArray[a+5]=e[x+2],t.positionArray[a+6]=e[n],t.positionArray[a+7]=e[n+1],t.positionArray[a+8]=e[n+2],t.material.flatShading===!0){const c=(i[s+0]+i[x+0]+i[n+0])/3,f=(i[s+1]+i[x+1]+i[n+1])/3,d=(i[s+2]+i[x+2]+i[n+2])/3;t.normalArray[a+0]=c,t.normalArray[a+1]=f,t.normalArray[a+2]=d,t.normalArray[a+3]=c,t.normalArray[a+4]=f,t.normalArray[a+5]=d,t.normalArray[a+6]=c,t.normalArray[a+7]=f,t.normalArray[a+8]=d}else t.normalArray[a+0]=i[s+0],t.normalArray[a+1]=i[s+1],t.normalArray[a+2]=i[s+2],t.normalArray[a+3]=i[x+0],t.normalArray[a+4]=i[x+1],t.normalArray[a+5]=i[x+2],t.normalArray[a+6]=i[n+0],t.normalArray[a+7]=i[n+1],t.normalArray[a+8]=i[n+2];if(t.enableUvs){const c=t.count*2;t.uvArray[c+0]=e[s+0],t.uvArray[c+1]=e[s+2],t.uvArray[c+2]=e[x+0],t.uvArray[c+3]=e[x+2],t.uvArray[c+4]=e[n+0],t.uvArray[c+5]=e[n+2]}t.enableColors&&(t.colorArray[a+0]=r[s+0],t.colorArray[a+1]=r[s+1],t.colorArray[a+2]=r[s+2],t.colorArray[a+3]=r[x+0],t.colorArray[a+4]=r[x+1],t.colorArray[a+5]=r[x+2],t.colorArray[a+6]=r[n+0],t.colorArray[a+7]=r[n+1],t.colorArray[a+8]=r[n+2]),t.count+=3}this.addBall=function(e,i,r,s,x,n){const a=Math.sign(s);s=Math.abs(s);const c=n!=null;let f=new R(e,i,r);if(c)try{f=n instanceof R?n:Array.isArray(n)?new R(Math.min(Math.abs(n[0]),1),Math.min(Math.abs(n[1]),1),Math.min(Math.abs(n[2]),1)):new R(n)}catch{f=new R(e,i,r)}const d=this.size*Math.sqrt(s/x),l=r*this.size,h=i*this.size,o=e*this.size;let z=Math.floor(l-d);z<1&&(z=1);let A=Math.floor(l+d);A>this.size-1&&(A=this.size-1);let p=Math.floor(h-d);p<1&&(p=1);let w=Math.floor(h+d);w>this.size-1&&(w=this.size-1);let F=Math.floor(o-d);F<1&&(F=1);let V=Math.floor(o+d);V>this.size-1&&(V=this.size-1);let m,M,u,I,S,B,D,P,E,G,T;for(u=z;u<A;u++)for(S=this.size2*u,P=u/this.size-r,E=P*P,M=p;M<w;M++)for(I=S+this.size*M,D=M/this.size-i,G=D*D,m=F;m<V;m++)if(B=m/this.size-e,T=s/(1e-6+B*B+G+E)-x,T>0){this.field[I+m]+=T*a;const _=Math.sqrt((m-o)*(m-o)+(M-h)*(M-h)+(u-l)*(u-l))/d,k=1-_*_*_*(_*(_*6-15)+10);this.palette[(I+m)*3+0]+=f.r*k,this.palette[(I+m)*3+1]+=f.g*k,this.palette[(I+m)*3+2]+=f.b*k}},this.addPlaneX=function(e,i){const r=this.size,s=this.yd,x=this.zd,n=this.field;let a,c,f,d,l,h,o,z=r*Math.sqrt(e/i);for(z>r&&(z=r),a=0;a<z;a++)if(h=a/r,d=h*h,l=e/(1e-4+d)-i,l>0)for(c=0;c<r;c++)for(o=a+c*s,f=0;f<r;f++)n[x*f+o]+=l},this.addPlaneY=function(e,i){const r=this.size,s=this.yd,x=this.zd,n=this.field;let a,c,f,d,l,h,o,z,A=r*Math.sqrt(e/i);for(A>r&&(A=r),c=0;c<A;c++)if(h=c/r,d=h*h,l=e/(1e-4+d)-i,l>0)for(o=c*s,a=0;a<r;a++)for(z=o+a,f=0;f<r;f++)n[x*f+z]+=l},this.addPlaneZ=function(e,i){const r=this.size,s=this.yd,x=this.zd,n=this.field;let a,c,f,d,l,h,o,z,A=r*Math.sqrt(e/i);for(A>r&&(A=r),f=0;f<A;f++)if(h=f/r,d=h*h,l=e/(1e-4+d)-i,l>0)for(o=x*f,c=0;c<r;c++)for(z=o+c*s,a=0;a<r;a++)n[z+a]+=l},this.setCell=function(e,i,r,s){const x=this.size2*r+this.size*i+e;this.field[x]=s},this.getCell=function(e,i,r){const s=this.size2*r+this.size*i+e;return this.field[s]},this.blur=function(e=1){const i=this.field,r=i.slice(),s=this.size,x=this.size2;for(let n=0;n<s;n++)for(let a=0;a<s;a++)for(let c=0;c<s;c++){const f=x*c+s*a+n;let d=r[f],l=1;for(let h=-1;h<=1;h+=2){const o=h+n;if(!(o<0||o>=s))for(let z=-1;z<=1;z+=2){const A=z+a;if(!(A<0||A>=s))for(let p=-1;p<=1;p+=2){const w=p+c;if(w<0||w>=s)continue;const F=x*w+s*A+o,V=r[F];l++,d+=e*(V-d)/l}}}i[f]=d}},this.reset=function(){for(let e=0;e<this.size3;e++)this.normal_cache[e*3]=0,this.field[e]=0,this.palette[e*3]=this.palette[e*3+1]=this.palette[e*3+2]=0},this.update=function(){this.count=0;const e=this.size-2;for(let i=1;i<e;i++){const r=this.size2*i,s=(i-this.halfsize)/this.halfsize;for(let x=1;x<e;x++){const n=r+this.size*x,a=(x-this.halfsize)/this.halfsize;for(let c=1;c<e;c++){const f=(c-this.halfsize)/this.halfsize,d=n+c;W(f,a,s,d,this.isolation)}}}this.geometry.setDrawRange(0,this.count),v.getAttribute("position").needsUpdate=!0,v.getAttribute("normal").needsUpdate=!0,this.enableUvs&&(v.getAttribute("uv").needsUpdate=!0),this.enableColors&&(v.getAttribute("color").needsUpdate=!0),this.count/3>J&&console.warn("THREE.MarchingCubes: Geometry buffers too small for rendering. Please create an instance with a higher poly count.")},this.init(K)}}const a1=new Int32Array([0,265,515,778,1030,1295,1541,1804,2060,2309,2575,2822,3082,3331,3593,3840,400,153,915,666,1430,1183,1941,1692,2460,2197,2975,2710,3482,3219,3993,3728,560,825,51,314,1590,1855,1077,1340,2620,2869,2111,2358,3642,3891,3129,3376,928,681,419,170,1958,1711,1445,1196,2988,2725,2479,2214,4010,3747,3497,3232,1120,1385,1635,1898,102,367,613,876,3180,3429,3695,3942,2154,2403,2665,2912,1520,1273,2035,1786,502,255,1013,764,3580,3317,4095,3830,2554,2291,3065,2800,1616,1881,1107,1370,598,863,85,348,3676,3925,3167,3414,2650,2899,2137,2384,1984,1737,1475,1226,966,719,453,204,4044,3781,3535,3270,3018,2755,2505,2240,2240,2505,2755,3018,3270,3535,3781,4044,204,453,719,966,1226,1475,1737,1984,2384,2137,2899,2650,3414,3167,3925,3676,348,85,863,598,1370,1107,1881,1616,2800,3065,2291,2554,3830,4095,3317,3580,764,1013,255,502,1786,2035,1273,1520,2912,2665,2403,2154,3942,3695,3429,3180,876,613,367,102,1898,1635,1385,1120,3232,3497,3747,4010,2214,2479,2725,2988,1196,1445,1711,1958,170,419,681,928,3376,3129,3891,3642,2358,2111,2869,2620,1340,1077,1855,1590,314,51,825,560,3728,3993,3219,3482,2710,2975,2197,2460,1692,1941,1183,1430,666,915,153,400,3840,3593,3331,3082,2822,2575,2309,2060,1804,1541,1295,1030,778,515,265,0]),j=new Int32Array([-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,0,8,3,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,0,1,9,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,1,8,3,9,8,1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,1,2,10,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,0,8,3,1,2,10,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,9,2,10,0,2,9,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,2,8,3,2,10,8,10,9,8,-1,-1,-1,-1,-1,-1,-1,3,11,2,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,0,11,2,8,11,0,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,1,9,0,2,3,11,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,1,11,2,1,9,11,9,8,11,-1,-1,-1,-1,-1,-1,-1,3,10,1,11,10,3,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,0,10,1,0,8,10,8,11,10,-1,-1,-1,-1,-1,-1,-1,3,9,0,3,11,9,11,10,9,-1,-1,-1,-1,-1,-1,-1,9,8,10,10,8,11,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,4,7,8,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,4,3,0,7,3,4,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,0,1,9,8,4,7,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,4,1,9,4,7,1,7,3,1,-1,-1,-1,-1,-1,-1,-1,1,2,10,8,4,7,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,3,4,7,3,0,4,1,2,10,-1,-1,-1,-1,-1,-1,-1,9,2,10,9,0,2,8,4,7,-1,-1,-1,-1,-1,-1,-1,2,10,9,2,9,7,2,7,3,7,9,4,-1,-1,-1,-1,8,4,7,3,11,2,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,11,4,7,11,2,4,2,0,4,-1,-1,-1,-1,-1,-1,-1,9,0,1,8,4,7,2,3,11,-1,-1,-1,-1,-1,-1,-1,4,7,11,9,4,11,9,11,2,9,2,1,-1,-1,-1,-1,3,10,1,3,11,10,7,8,4,-1,-1,-1,-1,-1,-1,-1,1,11,10,1,4,11,1,0,4,7,11,4,-1,-1,-1,-1,4,7,8,9,0,11,9,11,10,11,0,3,-1,-1,-1,-1,4,7,11,4,11,9,9,11,10,-1,-1,-1,-1,-1,-1,-1,9,5,4,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,9,5,4,0,8,3,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,0,5,4,1,5,0,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,8,5,4,8,3,5,3,1,5,-1,-1,-1,-1,-1,-1,-1,1,2,10,9,5,4,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,3,0,8,1,2,10,4,9,5,-1,-1,-1,-1,-1,-1,-1,5,2,10,5,4,2,4,0,2,-1,-1,-1,-1,-1,-1,-1,2,10,5,3,2,5,3,5,4,3,4,8,-1,-1,-1,-1,9,5,4,2,3,11,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,0,11,2,0,8,11,4,9,5,-1,-1,-1,-1,-1,-1,-1,0,5,4,0,1,5,2,3,11,-1,-1,-1,-1,-1,-1,-1,2,1,5,2,5,8,2,8,11,4,8,5,-1,-1,-1,-1,10,3,11,10,1,3,9,5,4,-1,-1,-1,-1,-1,-1,-1,4,9,5,0,8,1,8,10,1,8,11,10,-1,-1,-1,-1,5,4,0,5,0,11,5,11,10,11,0,3,-1,-1,-1,-1,5,4,8,5,8,10,10,8,11,-1,-1,-1,-1,-1,-1,-1,9,7,8,5,7,9,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,9,3,0,9,5,3,5,7,3,-1,-1,-1,-1,-1,-1,-1,0,7,8,0,1,7,1,5,7,-1,-1,-1,-1,-1,-1,-1,1,5,3,3,5,7,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,9,7,8,9,5,7,10,1,2,-1,-1,-1,-1,-1,-1,-1,10,1,2,9,5,0,5,3,0,5,7,3,-1,-1,-1,-1,8,0,2,8,2,5,8,5,7,10,5,2,-1,-1,-1,-1,2,10,5,2,5,3,3,5,7,-1,-1,-1,-1,-1,-1,-1,7,9,5,7,8,9,3,11,2,-1,-1,-1,-1,-1,-1,-1,9,5,7,9,7,2,9,2,0,2,7,11,-1,-1,-1,-1,2,3,11,0,1,8,1,7,8,1,5,7,-1,-1,-1,-1,11,2,1,11,1,7,7,1,5,-1,-1,-1,-1,-1,-1,-1,9,5,8,8,5,7,10,1,3,10,3,11,-1,-1,-1,-1,5,7,0,5,0,9,7,11,0,1,0,10,11,10,0,-1,11,10,0,11,0,3,10,5,0,8,0,7,5,7,0,-1,11,10,5,7,11,5,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,10,6,5,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,0,8,3,5,10,6,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,9,0,1,5,10,6,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,1,8,3,1,9,8,5,10,6,-1,-1,-1,-1,-1,-1,-1,1,6,5,2,6,1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,1,6,5,1,2,6,3,0,8,-1,-1,-1,-1,-1,-1,-1,9,6,5,9,0,6,0,2,6,-1,-1,-1,-1,-1,-1,-1,5,9,8,5,8,2,5,2,6,3,2,8,-1,-1,-1,-1,2,3,11,10,6,5,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,11,0,8,11,2,0,10,6,5,-1,-1,-1,-1,-1,-1,-1,0,1,9,2,3,11,5,10,6,-1,-1,-1,-1,-1,-1,-1,5,10,6,1,9,2,9,11,2,9,8,11,-1,-1,-1,-1,6,3,11,6,5,3,5,1,3,-1,-1,-1,-1,-1,-1,-1,0,8,11,0,11,5,0,5,1,5,11,6,-1,-1,-1,-1,3,11,6,0,3,6,0,6,5,0,5,9,-1,-1,-1,-1,6,5,9,6,9,11,11,9,8,-1,-1,-1,-1,-1,-1,-1,5,10,6,4,7,8,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,4,3,0,4,7,3,6,5,10,-1,-1,-1,-1,-1,-1,-1,1,9,0,5,10,6,8,4,7,-1,-1,-1,-1,-1,-1,-1,10,6,5,1,9,7,1,7,3,7,9,4,-1,-1,-1,-1,6,1,2,6,5,1,4,7,8,-1,-1,-1,-1,-1,-1,-1,1,2,5,5,2,6,3,0,4,3,4,7,-1,-1,-1,-1,8,4,7,9,0,5,0,6,5,0,2,6,-1,-1,-1,-1,7,3,9,7,9,4,3,2,9,5,9,6,2,6,9,-1,3,11,2,7,8,4,10,6,5,-1,-1,-1,-1,-1,-1,-1,5,10,6,4,7,2,4,2,0,2,7,11,-1,-1,-1,-1,0,1,9,4,7,8,2,3,11,5,10,6,-1,-1,-1,-1,9,2,1,9,11,2,9,4,11,7,11,4,5,10,6,-1,8,4,7,3,11,5,3,5,1,5,11,6,-1,-1,-1,-1,5,1,11,5,11,6,1,0,11,7,11,4,0,4,11,-1,0,5,9,0,6,5,0,3,6,11,6,3,8,4,7,-1,6,5,9,6,9,11,4,7,9,7,11,9,-1,-1,-1,-1,10,4,9,6,4,10,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,4,10,6,4,9,10,0,8,3,-1,-1,-1,-1,-1,-1,-1,10,0,1,10,6,0,6,4,0,-1,-1,-1,-1,-1,-1,-1,8,3,1,8,1,6,8,6,4,6,1,10,-1,-1,-1,-1,1,4,9,1,2,4,2,6,4,-1,-1,-1,-1,-1,-1,-1,3,0,8,1,2,9,2,4,9,2,6,4,-1,-1,-1,-1,0,2,4,4,2,6,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,8,3,2,8,2,4,4,2,6,-1,-1,-1,-1,-1,-1,-1,10,4,9,10,6,4,11,2,3,-1,-1,-1,-1,-1,-1,-1,0,8,2,2,8,11,4,9,10,4,10,6,-1,-1,-1,-1,3,11,2,0,1,6,0,6,4,6,1,10,-1,-1,-1,-1,6,4,1,6,1,10,4,8,1,2,1,11,8,11,1,-1,9,6,4,9,3,6,9,1,3,11,6,3,-1,-1,-1,-1,8,11,1,8,1,0,11,6,1,9,1,4,6,4,1,-1,3,11,6,3,6,0,0,6,4,-1,-1,-1,-1,-1,-1,-1,6,4,8,11,6,8,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,7,10,6,7,8,10,8,9,10,-1,-1,-1,-1,-1,-1,-1,0,7,3,0,10,7,0,9,10,6,7,10,-1,-1,-1,-1,10,6,7,1,10,7,1,7,8,1,8,0,-1,-1,-1,-1,10,6,7,10,7,1,1,7,3,-1,-1,-1,-1,-1,-1,-1,1,2,6,1,6,8,1,8,9,8,6,7,-1,-1,-1,-1,2,6,9,2,9,1,6,7,9,0,9,3,7,3,9,-1,7,8,0,7,0,6,6,0,2,-1,-1,-1,-1,-1,-1,-1,7,3,2,6,7,2,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,2,3,11,10,6,8,10,8,9,8,6,7,-1,-1,-1,-1,2,0,7,2,7,11,0,9,7,6,7,10,9,10,7,-1,1,8,0,1,7,8,1,10,7,6,7,10,2,3,11,-1,11,2,1,11,1,7,10,6,1,6,7,1,-1,-1,-1,-1,8,9,6,8,6,7,9,1,6,11,6,3,1,3,6,-1,0,9,1,11,6,7,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,7,8,0,7,0,6,3,11,0,11,6,0,-1,-1,-1,-1,7,11,6,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,7,6,11,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,3,0,8,11,7,6,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,0,1,9,11,7,6,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,8,1,9,8,3,1,11,7,6,-1,-1,-1,-1,-1,-1,-1,10,1,2,6,11,7,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,1,2,10,3,0,8,6,11,7,-1,-1,-1,-1,-1,-1,-1,2,9,0,2,10,9,6,11,7,-1,-1,-1,-1,-1,-1,-1,6,11,7,2,10,3,10,8,3,10,9,8,-1,-1,-1,-1,7,2,3,6,2,7,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,7,0,8,7,6,0,6,2,0,-1,-1,-1,-1,-1,-1,-1,2,7,6,2,3,7,0,1,9,-1,-1,-1,-1,-1,-1,-1,1,6,2,1,8,6,1,9,8,8,7,6,-1,-1,-1,-1,10,7,6,10,1,7,1,3,7,-1,-1,-1,-1,-1,-1,-1,10,7,6,1,7,10,1,8,7,1,0,8,-1,-1,-1,-1,0,3,7,0,7,10,0,10,9,6,10,7,-1,-1,-1,-1,7,6,10,7,10,8,8,10,9,-1,-1,-1,-1,-1,-1,-1,6,8,4,11,8,6,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,3,6,11,3,0,6,0,4,6,-1,-1,-1,-1,-1,-1,-1,8,6,11,8,4,6,9,0,1,-1,-1,-1,-1,-1,-1,-1,9,4,6,9,6,3,9,3,1,11,3,6,-1,-1,-1,-1,6,8,4,6,11,8,2,10,1,-1,-1,-1,-1,-1,-1,-1,1,2,10,3,0,11,0,6,11,0,4,6,-1,-1,-1,-1,4,11,8,4,6,11,0,2,9,2,10,9,-1,-1,-1,-1,10,9,3,10,3,2,9,4,3,11,3,6,4,6,3,-1,8,2,3,8,4,2,4,6,2,-1,-1,-1,-1,-1,-1,-1,0,4,2,4,6,2,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,1,9,0,2,3,4,2,4,6,4,3,8,-1,-1,-1,-1,1,9,4,1,4,2,2,4,6,-1,-1,-1,-1,-1,-1,-1,8,1,3,8,6,1,8,4,6,6,10,1,-1,-1,-1,-1,10,1,0,10,0,6,6,0,4,-1,-1,-1,-1,-1,-1,-1,4,6,3,4,3,8,6,10,3,0,3,9,10,9,3,-1,10,9,4,6,10,4,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,4,9,5,7,6,11,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,0,8,3,4,9,5,11,7,6,-1,-1,-1,-1,-1,-1,-1,5,0,1,5,4,0,7,6,11,-1,-1,-1,-1,-1,-1,-1,11,7,6,8,3,4,3,5,4,3,1,5,-1,-1,-1,-1,9,5,4,10,1,2,7,6,11,-1,-1,-1,-1,-1,-1,-1,6,11,7,1,2,10,0,8,3,4,9,5,-1,-1,-1,-1,7,6,11,5,4,10,4,2,10,4,0,2,-1,-1,-1,-1,3,4,8,3,5,4,3,2,5,10,5,2,11,7,6,-1,7,2,3,7,6,2,5,4,9,-1,-1,-1,-1,-1,-1,-1,9,5,4,0,8,6,0,6,2,6,8,7,-1,-1,-1,-1,3,6,2,3,7,6,1,5,0,5,4,0,-1,-1,-1,-1,6,2,8,6,8,7,2,1,8,4,8,5,1,5,8,-1,9,5,4,10,1,6,1,7,6,1,3,7,-1,-1,-1,-1,1,6,10,1,7,6,1,0,7,8,7,0,9,5,4,-1,4,0,10,4,10,5,0,3,10,6,10,7,3,7,10,-1,7,6,10,7,10,8,5,4,10,4,8,10,-1,-1,-1,-1,6,9,5,6,11,9,11,8,9,-1,-1,-1,-1,-1,-1,-1,3,6,11,0,6,3,0,5,6,0,9,5,-1,-1,-1,-1,0,11,8,0,5,11,0,1,5,5,6,11,-1,-1,-1,-1,6,11,3,6,3,5,5,3,1,-1,-1,-1,-1,-1,-1,-1,1,2,10,9,5,11,9,11,8,11,5,6,-1,-1,-1,-1,0,11,3,0,6,11,0,9,6,5,6,9,1,2,10,-1,11,8,5,11,5,6,8,0,5,10,5,2,0,2,5,-1,6,11,3,6,3,5,2,10,3,10,5,3,-1,-1,-1,-1,5,8,9,5,2,8,5,6,2,3,8,2,-1,-1,-1,-1,9,5,6,9,6,0,0,6,2,-1,-1,-1,-1,-1,-1,-1,1,5,8,1,8,0,5,6,8,3,8,2,6,2,8,-1,1,5,6,2,1,6,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,1,3,6,1,6,10,3,8,6,5,6,9,8,9,6,-1,10,1,0,10,0,6,9,5,0,5,6,0,-1,-1,-1,-1,0,3,8,5,6,10,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,10,5,6,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,11,5,10,7,5,11,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,11,5,10,11,7,5,8,3,0,-1,-1,-1,-1,-1,-1,-1,5,11,7,5,10,11,1,9,0,-1,-1,-1,-1,-1,-1,-1,10,7,5,10,11,7,9,8,1,8,3,1,-1,-1,-1,-1,11,1,2,11,7,1,7,5,1,-1,-1,-1,-1,-1,-1,-1,0,8,3,1,2,7,1,7,5,7,2,11,-1,-1,-1,-1,9,7,5,9,2,7,9,0,2,2,11,7,-1,-1,-1,-1,7,5,2,7,2,11,5,9,2,3,2,8,9,8,2,-1,2,5,10,2,3,5,3,7,5,-1,-1,-1,-1,-1,-1,-1,8,2,0,8,5,2,8,7,5,10,2,5,-1,-1,-1,-1,9,0,1,5,10,3,5,3,7,3,10,2,-1,-1,-1,-1,9,8,2,9,2,1,8,7,2,10,2,5,7,5,2,-1,1,3,5,3,7,5,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,0,8,7,0,7,1,1,7,5,-1,-1,-1,-1,-1,-1,-1,9,0,3,9,3,5,5,3,7,-1,-1,-1,-1,-1,-1,-1,9,8,7,5,9,7,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,5,8,4,5,10,8,10,11,8,-1,-1,-1,-1,-1,-1,-1,5,0,4,5,11,0,5,10,11,11,3,0,-1,-1,-1,-1,0,1,9,8,4,10,8,10,11,10,4,5,-1,-1,-1,-1,10,11,4,10,4,5,11,3,4,9,4,1,3,1,4,-1,2,5,1,2,8,5,2,11,8,4,5,8,-1,-1,-1,-1,0,4,11,0,11,3,4,5,11,2,11,1,5,1,11,-1,0,2,5,0,5,9,2,11,5,4,5,8,11,8,5,-1,9,4,5,2,11,3,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,2,5,10,3,5,2,3,4,5,3,8,4,-1,-1,-1,-1,5,10,2,5,2,4,4,2,0,-1,-1,-1,-1,-1,-1,-1,3,10,2,3,5,10,3,8,5,4,5,8,0,1,9,-1,5,10,2,5,2,4,1,9,2,9,4,2,-1,-1,-1,-1,8,4,5,8,5,3,3,5,1,-1,-1,-1,-1,-1,-1,-1,0,4,5,1,0,5,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,8,4,5,8,5,3,9,0,5,0,3,5,-1,-1,-1,-1,9,4,5,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,4,11,7,4,9,11,9,10,11,-1,-1,-1,-1,-1,-1,-1,0,8,3,4,9,7,9,11,7,9,10,11,-1,-1,-1,-1,1,10,11,1,11,4,1,4,0,7,4,11,-1,-1,-1,-1,3,1,4,3,4,8,1,10,4,7,4,11,10,11,4,-1,4,11,7,9,11,4,9,2,11,9,1,2,-1,-1,-1,-1,9,7,4,9,11,7,9,1,11,2,11,1,0,8,3,-1,11,7,4,11,4,2,2,4,0,-1,-1,-1,-1,-1,-1,-1,11,7,4,11,4,2,8,3,4,3,2,4,-1,-1,-1,-1,2,9,10,2,7,9,2,3,7,7,4,9,-1,-1,-1,-1,9,10,7,9,7,4,10,2,7,8,7,0,2,0,7,-1,3,7,10,3,10,2,7,4,10,1,10,0,4,0,10,-1,1,10,2,8,7,4,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,4,9,1,4,1,7,7,1,3,-1,-1,-1,-1,-1,-1,-1,4,9,1,4,1,7,0,8,1,8,7,1,-1,-1,-1,-1,4,0,3,7,4,3,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,4,8,7,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,9,10,8,10,11,8,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,3,0,9,3,9,11,11,9,10,-1,-1,-1,-1,-1,-1,-1,0,1,10,0,10,8,8,10,11,-1,-1,-1,-1,-1,-1,-1,3,1,10,11,3,10,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,1,2,11,1,11,9,9,11,8,-1,-1,-1,-1,-1,-1,-1,3,0,9,3,9,11,1,2,9,2,11,9,-1,-1,-1,-1,0,2,11,8,0,11,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,3,2,11,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,2,3,8,2,8,10,10,8,9,-1,-1,-1,-1,-1,-1,-1,9,10,2,0,9,2,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,2,3,8,2,8,10,0,1,8,1,10,8,-1,-1,-1,-1,1,10,2,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,1,3,8,9,1,8,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,0,9,1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,0,3,8,-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]);export{s1 as MarchingCubes,a1 as edgeTable,j as triTable};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{u as J,a as rt,aC as se,V as C,bi as tt,q as ie,g as Y,bj as Q,ao as he,ap as xe,a9 as re,p as we,aq as Vn}from"./three.module-D396a9Mn.js";const oe=0,Ae=1,ge=2,Bs=0,Ps=1,Rn=2,en=1.25,Dn=1,$=32,N=$/4,_n=65535,Ts=_n<<16,Yt=Math.pow(2,-24),Mn=Symbol("SKIP_GENERATION"),ce={strategy:oe,maxDepth:40,targetLeafSize:10,useSharedArrayBuffer:!1,setBoundingBox:!0,onProgress:null,indirect:!1,verbose:!0,range:null,[Mn]:!1};function V(s,t,n){return n.min.x=t[s],n.min.y=t[s+1],n.min.z=t[s+2],n.max.x=t[s+3],n.max.y=t[s+4],n.max.z=t[s+5],n}function dn(s){let t=-1,n=-1/0;for(let e=0;e<3;e++){const i=s[e+3]-s[e];i>n&&(n=i,t=e)}return t}function Nn(s,t){t.set(s)}function Fn(s,t,n){let e,i;for(let o=0;o<3;o++){const r=o+3;e=s[o],i=t[o],n[o]=e<i?e:i,e=s[r],i=t[r],n[r]=e>i?e:i}}function Ut(s,t,n){for(let e=0;e<3;e++){const i=t[s+2*e],o=t[s+2*e+1],r=i-o,l=i+o;r<n[e]&&(n[e]=r),l>n[e+3]&&(n[e+3]=l)}}function gt(s){const t=s[3]-s[0],n=s[4]-s[1],e=s[5]-s[2];return 2*(t*n+n*e+e*t)}function R(s,t){return t[s+15]===_n}function q(s,t){return t[s+6]}function k(s,t){return t[s+14]}function F(s){return s+N}function H(s,t){const n=t[s+6];return s+n*N}function vn(s,t){return t[s+7]}function bs(s){return s}function sn(s,t,n,e,i){let o=1/0,r=1/0,l=1/0,c=-1/0,p=-1/0,u=-1/0,f=1/0,a=1/0,y=1/0,w=-1/0,A=-1/0,g=-1/0;const B=s.offset||0;for(let d=(t-B)*6,h=(t+n-B)*6;d<h;d+=6){const m=s[d+0],x=s[d+1],S=m-x,P=m+x;S<o&&(o=S),P>c&&(c=P),m<f&&(f=m),m>w&&(w=m);const _=s[d+2],M=s[d+3],T=_-M,v=_+M;T<r&&(r=T),v>p&&(p=v),_<a&&(a=_),_>A&&(A=_);const b=s[d+4],I=s[d+5],z=b-I,U=b+I;z<l&&(l=z),U>u&&(u=U),b<y&&(y=b),b>g&&(g=b)}e[0]=o,e[1]=r,e[2]=l,e[3]=c,e[4]=p,e[5]=u,i[0]=f,i[1]=a,i[2]=y,i[3]=w,i[4]=A,i[5]=g}const j=32,Be=(s,t)=>s.candidate-t.candidate,et=new Array(j).fill().map(()=>({count:0,bounds:new Float32Array(6),rightCacheBounds:new Float32Array(6),leftCacheBounds:new Float32Array(6),candidate:0})),Et=new Float32Array(6);function Pe(s,t,n,e,i,o){let r=-1,l=0;if(o===oe)r=dn(t),r!==-1&&(l=(t[r]+t[r+3])/2);else if(o===Ae)r=dn(s),r!==-1&&(l=Te(n,e,i,r));else if(o===ge){const c=gt(s);let p=en*i;const u=n.offset||0,f=(e-u)*6,a=(e+i-u)*6;for(let y=0;y<3;y++){const w=t[y],B=(t[y+3]-w)/j;if(i<j/4){const d=[...et];d.length=i;let h=0;for(let x=f;x<a;x+=6,h++){const S=d[h];S.candidate=n[x+2*y],S.count=0;const{bounds:P,leftCacheBounds:_,rightCacheBounds:M}=S;for(let T=0;T<3;T++)M[T]=1/0,M[T+3]=-1/0,_[T]=1/0,_[T+3]=-1/0,P[T]=1/0,P[T+3]=-1/0;Ut(x,n,P)}d.sort(Be);let m=i;for(let x=0;x<m;x++){const S=d[x];for(;x+1<m&&d[x+1].candidate===S.candidate;)d.splice(x+1,1),m--}for(let x=f;x<a;x+=6){const S=n[x+2*y];for(let P=0;P<m;P++){const _=d[P];S>=_.candidate?Ut(x,n,_.rightCacheBounds):(Ut(x,n,_.leftCacheBounds),_.count++)}}for(let x=0;x<m;x++){const S=d[x],P=S.count,_=i-S.count,M=S.leftCacheBounds,T=S.rightCacheBounds;let v=0;P!==0&&(v=gt(M)/c);let b=0;_!==0&&(b=gt(T)/c);const I=Dn+en*(v*P+b*_);I<p&&(r=y,p=I,l=S.candidate)}}else{for(let m=0;m<j;m++){const x=et[m];x.count=0,x.candidate=w+B+m*B;const S=x.bounds;for(let P=0;P<3;P++)S[P]=1/0,S[P+3]=-1/0}for(let m=f;m<a;m+=6){let P=~~((n[m+2*y]-w)/B);P>=j&&(P=j-1);const _=et[P];_.count++,Ut(m,n,_.bounds)}const d=et[j-1];Nn(d.bounds,d.rightCacheBounds);for(let m=j-2;m>=0;m--){const x=et[m],S=et[m+1];Fn(x.bounds,S.rightCacheBounds,x.rightCacheBounds)}let h=0;for(let m=0;m<j-1;m++){const x=et[m],S=x.count,P=x.bounds,M=et[m+1].rightCacheBounds;S!==0&&(h===0?Nn(P,Et):Fn(P,Et,Et)),h+=S;let T=0,v=0;h!==0&&(T=gt(Et)/c);const b=i-h;b!==0&&(v=gt(M)/c);const I=Dn+en*(T*h+v*b);I<p&&(r=y,p=I,l=x.candidate)}}}}else console.warn(`BVH: Invalid build strategy value ${o} used.`);return{axis:r,pos:l}}function Te(s,t,n,e){let i=0;const o=s.offset;for(let r=t,l=t+n;r<l;r++)i+=s[(r-o)*6+e*2];return i/n}class rn{constructor(){this.boundingData=new Float32Array(6)}}function be(s,t,n,e,i,o){let r=e,l=e+i-1;const c=o.pos,p=o.axis*2,u=n.offset||0;for(;;){for(;r<=l&&n[(r-u)*6+p]<c;)r++;for(;r<=l&&n[(l-u)*6+p]>=c;)l--;if(r<l){for(let f=0;f<t;f++){let a=s[r*t+f];s[r*t+f]=s[l*t+f],s[l*t+f]=a}for(let f=0;f<6;f++){const a=r-u,y=l-u,w=n[a*6+f];n[a*6+f]=n[y*6+f],n[y*6+f]=w}r++,l--}else return r}}let le,Kt,mn,ae;const Se=Math.pow(2,32);function hn(s){return"count"in s?1:1+hn(s.left)+hn(s.right)}function _e(s,t,n){return le=new Float32Array(n),Kt=new Uint32Array(n),mn=new Uint16Array(n),ae=new Uint8Array(n),xn(s,t)}function xn(s,t){const n=s/4,e=s/2,i="count"in t,o=t.boundingData;for(let r=0;r<6;r++)le[n+r]=o[r];if(i)return t.buffer?(ae.set(new Uint8Array(t.buffer),s),s+t.buffer.byteLength):(Kt[n+6]=t.offset,mn[e+14]=t.count,mn[e+15]=_n,s+$);{const{left:r,right:l,splitAxis:c}=t,p=s+$;let u=xn(p,r);const f=s/$,y=u/$-f;if(y>Se)throw new Error("MeshBVH: Cannot store relative child node offset greater than 32 bits.");return Kt[n+6]=y,Kt[n+7]=c,xn(u,l)}}function Me(s,t,n,e,i,o){const{maxDepth:r,verbose:l,targetLeafSize:c,_strictLeafSize:p=1/0,strategy:u,onProgress:f}=i,a=s.primitiveBuffer,y=s.primitiveBufferStride,w=new Float32Array(6);let A=!1;const g=new rn;return sn(t,n,e,g.boundingData,w),d(g,n,e,w),g;function B(h){f&&f((h-o.offset)/o.count)}function d(h,m,x,S=null,P=0){!A&&P>=r&&(A=!0,l&&console.warn(`BVH: Max depth of ${r} reached when generating BVH. Consider increasing maxDepth.`));const _=x>p;if(x<=c&&!_||P>=r)return B(m+x),h.offset=m,h.count=x,h;const M=Pe(h.boundingData,S,t,m,x,u);let T=M.axis===-1?-1:be(a,y,t,m,x,M);if(M.axis===-1||T===m||T===m+x){if(!_)return B(m+x),h.offset=m,h.count=x,h;M.axis=Math.max(0,dn(h.boundingData)),T=m+Math.max(1,Math.floor(x/2))}h.splitAxis=M.axis;const v=new rn,b=m,I=T-m;h.left=v,sn(t,b,I,v.boundingData,w),d(v,b,I,w,P+1);const z=new rn,U=T,L=x-I;return h.right=z,sn(t,U,L,z.boundingData,w),d(z,U,L,w,P+1),h}}function ve(s,t){const n=t.useSharedArrayBuffer?SharedArrayBuffer:ArrayBuffer,e=s.getRootRanges(t.range),i=e[0],o=e[e.length-1],r={offset:i.offset,count:o.offset+o.count-i.offset},l=new Float32Array(6*r.count);l.offset=r.offset,s.computePrimitiveBounds(r.offset,r.count,l),s._roots=e.map(c=>{const p=Me(s,l,c.offset,c.count,t,r),u=hn(p),f=new n($*u);return _e(0,p,f),f})}class In{constructor(t){this._getNewPrimitive=t,this._primitives=[]}getPrimitive(){const t=this._primitives;return t.length===0?this._getNewPrimitive():t.pop()}releasePrimitive(t){this._primitives.push(t)}}class Ie{constructor(){this.float32Array=null,this.uint16Array=null,this.uint32Array=null;const t=[];let n=null;this.setBuffer=e=>{n&&t.push(n),n=e,this.float32Array=new Float32Array(e),this.uint16Array=new Uint16Array(e),this.uint32Array=new Uint32Array(e)},this.clearBuffer=()=>{n=null,this.float32Array=null,this.uint16Array=null,this.uint32Array=null,t.length!==0&&this.setBuffer(t.pop())}}}const E=new Ie;let it,At;const ut=[],Lt=new In(()=>new J);function ze(s,t,n,e,i,o){it=Lt.getPrimitive(),At=Lt.getPrimitive(),ut.push(it,At),E.setBuffer(s._roots[t]);const r=wn(0,s.geometry,n,e,i,o);E.clearBuffer(),Lt.releasePrimitive(it),Lt.releasePrimitive(At),ut.pop(),ut.pop();const l=ut.length;return l>0&&(At=ut[l-1],it=ut[l-2]),r}function wn(s,t,n,e,i=null,o=0,r=0){const{float32Array:l,uint16Array:c,uint32Array:p}=E;let u=s*2;if(R(u,c)){const a=q(s,p),y=k(u,c);return V(s,l,it),e(a,y,!1,r,o+s/N,it)}else{let T=function(b){const{uint16Array:I,uint32Array:z}=E;let U=b*2;for(;!R(U,I);)b=F(b),U=b*2;return q(b,z)},v=function(b){const{uint16Array:I,uint32Array:z}=E;let U=b*2;for(;!R(U,I);)b=H(b,z),U=b*2;return q(b,z)+k(U,I)};const a=F(s),y=H(s,p);let w=a,A=y,g,B,d,h;if(i&&(d=it,h=At,V(w,l,d),V(A,l,h),g=i(d),B=i(h),B<g)){w=y,A=a;const b=g;g=B,B=b,d=h}d||(d=it,V(w,l,d));const m=R(w*2,c),x=n(d,m,g,r+1,o+w/N);let S;if(x===Rn){const b=T(w),z=v(w)-b;S=e(b,z,!0,r+1,o+w/N,d)}else S=x&&wn(w,t,n,e,i,o,r+1);if(S)return!0;h=At,V(A,l,h);const P=R(A*2,c),_=n(h,P,B,r+1,o+A/N);let M;if(_===Rn){const b=T(A),z=v(A)-b;M=e(b,z,!0,r+1,o+A/N,h)}else M=_&&wn(A,t,n,e,i,o,r+1);return!!M}}const zt=new E.constructor,Wt=new E.constructor,st=new In(()=>new J),pt=new J,yt=new J,on=new J,cn=new J;let ln=!1;function Ce(s,t,n,e){if(ln)throw new Error("MeshBVH: Recursive calls to bvhcast not supported.");ln=!0;const i=s._roots,o=t._roots;let r,l=0,c=0;const p=new rt().copy(n).invert();for(let u=0,f=i.length;u<f;u++){zt.setBuffer(i[u]),c=0;const a=st.getPrimitive();V(0,zt.float32Array,a),a.applyMatrix4(p);for(let y=0,w=o.length;y<w&&(Wt.setBuffer(o[y]),r=K(0,0,n,p,e,l,c,0,0,a),Wt.clearBuffer(),c+=o[y].byteLength/$,!r);y++);if(st.releasePrimitive(a),zt.clearBuffer(),l+=i[u].byteLength/$,r)break}return ln=!1,r}function K(s,t,n,e,i,o=0,r=0,l=0,c=0,p=null,u=!1){let f,a;u?(f=Wt,a=zt):(f=zt,a=Wt);const y=f.float32Array,w=f.uint32Array,A=f.uint16Array,g=a.float32Array,B=a.uint32Array,d=a.uint16Array,h=s*2,m=t*2,x=R(h,A),S=R(m,d);let P=!1;if(S&&x)u?P=i(q(t,B),k(t*2,d),q(s,w),k(s*2,A),c,r+t/N,l,o+s/N):P=i(q(s,w),k(s*2,A),q(t,B),k(t*2,d),l,o+s/N,c,r+t/N);else if(S){const _=st.getPrimitive();V(t,g,_),_.applyMatrix4(n);const M=F(s),T=H(s,w);V(M,y,pt),V(T,y,yt);const v=_.intersectsBox(pt),b=_.intersectsBox(yt);P=v&&K(t,M,e,n,i,r,o,c,l+1,_,!u)||b&&K(t,T,e,n,i,r,o,c,l+1,_,!u),st.releasePrimitive(_)}else{const _=F(t),M=H(t,B);V(_,g,on),V(M,g,cn);const T=p.intersectsBox(on),v=p.intersectsBox(cn);if(T&&v)P=K(s,_,n,e,i,o,r,l,c+1,p,u)||K(s,M,n,e,i,o,r,l,c+1,p,u);else if(T)if(x)P=K(s,_,n,e,i,o,r,l,c+1,p,u);else{const b=st.getPrimitive();b.copy(on).applyMatrix4(n);const I=F(s),z=H(s,w);V(I,y,pt),V(z,y,yt);const U=b.intersectsBox(pt),L=b.intersectsBox(yt);P=U&&K(_,I,e,n,i,r,o,c,l+1,b,!u)||L&&K(_,z,e,n,i,r,o,c,l+1,b,!u),st.releasePrimitive(b)}else if(v)if(x)P=K(s,M,n,e,i,o,r,l,c+1,p,u);else{const b=st.getPrimitive();b.copy(cn).applyMatrix4(n);const I=F(s),z=H(s,w);V(I,y,pt),V(z,y,yt);const U=b.intersectsBox(pt),L=b.intersectsBox(yt);P=U&&K(M,I,e,n,i,r,o,c,l+1,b,!u)||L&&K(M,z,e,n,i,r,o,c,l+1,b,!u),st.releasePrimitive(b)}}return P}const an=new class{constructor(){let s=null,t=null,n=null,e=!1;this.root=null,this.buffer=null,this.uint32Array=null,this.uint16Array=null,this.setBVH=(o,r)=>{if(e)throw new Error("BVHTraversalHelper: cannot call setBVH during an active traversal.");this.root=r,this.buffer=s=o._roots[r],this.uint16Array=n=new Uint16Array(s),this.uint32Array=t=new Uint32Array(s)},this.reset=()=>{this.root=null,this.buffer=s=null,this.uint16Array=n=null,this.uint32Array=t=null},this.getRangeStart=o=>{let r=o*2;for(;!R(r,n);)o=F(o),r=o*2;return q(o,t)},this.getRangeEnd=o=>{let r=o*2;for(;!R(r,n);)o=H(o,t),r=o*2;return q(o,t)+k(r,n)};const i=(o,r,l)=>{const c=r*2,p=R(c,n);if(!o(l,p,r)&&!p){const f=F(r),a=H(r,t);i(o,f,l+1),i(o,a,l+1)}};this.traverseBuffer=o=>{if(e)throw new Error("BVHTraversalHelper: cannot start a traversal during an active traversal.");e=!0;try{i(o,0,0)}finally{e=!1}},this.traverse=o=>{this.traverseBuffer((r,l,c)=>{if(l){const p=c*2,u=t[c+6],f=n[p+14];return o(r,l,new Float32Array(s,c*4,6),u,f)}else{const p=vn(c,t);return o(r,l,new Float32Array(s,c*4,6),p)}})}}},Hn=new J,dt=new Float32Array(6);class Ue{constructor(){this._roots=null,this.primitiveBuffer=null,this.primitiveBufferStride=null}init(t){t={...ce,...t},"maxLeafSize"in t&&(console.warn('BVH: "maxLeafSize" option has been deprecated. Use "targetLeafSize", instead.'),t={...t,targetLeafSize:t.maxLeafSize}),ve(this,t)}getRootRanges(){throw new Error("BVH: getRootRanges() not implemented")}writePrimitiveBounds(){throw new Error("BVH: writePrimitiveBounds() not implemented")}writePrimitiveRangeBounds(t,n,e,i){let o=1/0,r=1/0,l=1/0,c=-1/0,p=-1/0,u=-1/0;for(let f=t,a=t+n;f<a;f++){this.writePrimitiveBounds(f,dt,0);const[y,w,A,g,B,d]=dt;y<o&&(o=y),g>c&&(c=g),w<r&&(r=w),B>p&&(p=B),A<l&&(l=A),d>u&&(u=d)}return e[i+0]=o,e[i+1]=r,e[i+2]=l,e[i+3]=c,e[i+4]=p,e[i+5]=u,e}computePrimitiveBounds(t,n,e){const i=e.offset||0;for(let o=t,r=t+n;o<r;o++){this.writePrimitiveBounds(o,dt,0);const[l,c,p,u,f,a]=dt,y=(l+u)/2,w=(c+f)/2,A=(p+a)/2,g=(u-l)/2,B=(f-c)/2,d=(a-p)/2,h=(o-i)*6;e[h+0]=y,e[h+1]=g+(Math.abs(y)+g)*Yt,e[h+2]=w,e[h+3]=B+(Math.abs(w)+B)*Yt,e[h+4]=A,e[h+5]=d+(Math.abs(A)+d)*Yt}return e}shiftPrimitiveOffsets(t){const n=this._indirectBuffer;if(n)for(let e=0,i=n.length;e<i;e++)n[e]+=t;else{const e=this._roots;for(let i=0;i<e.length;i++){const o=e[i],r=new Uint32Array(o),l=new Uint16Array(o),c=o.byteLength/$;for(let p=0;p<c;p++){const u=N*p,f=2*u;R(f,l)&&(r[u+6]+=t)}}}}traverse(t,n=0){an.setBVH(this,n),an.traverse(t),an.reset()}refit(){const t=this._roots;for(let n=0,e=t.length;n<e;n++){const i=t[n],o=new Uint32Array(i),r=new Uint16Array(i),l=new Float32Array(i),c=i.byteLength/$;for(let p=c-1;p>=0;p--){const u=p*N,f=u*2;if(R(f,r)){const y=q(u,o),w=k(f,r);this.writePrimitiveRangeBounds(y,w,dt,0),l.set(dt,u)}else{const y=F(u),w=H(u,o);for(let A=0;A<3;A++){const g=l[y+A],B=l[y+A+3],d=l[w+A],h=l[w+A+3];l[u+A]=g<d?g:d,l[u+A+3]=B>h?B:h}}}}}getBoundingBox(t){return t.makeEmpty(),this._roots.forEach(e=>{V(0,new Float32Array(e),Hn),t.union(Hn)}),t}shapecast(t){let{boundsTraverseOrder:n,intersectsBounds:e,intersectsRange:i,intersectsPrimitive:o,scratchPrimitive:r,iterate:l}=t;if(i&&o){const f=i;i=(a,y,w,A,g)=>f(a,y,w,A,g)?!0:l(a,y,this,o,w,A,r)}else i||(o?i=(f,a,y,w)=>l(f,a,this,o,y,w,r):i=(f,a,y)=>y);let c=!1,p=0;const u=this._roots;for(let f=0,a=u.length;f<a;f++){const y=u[f];if(c=ze(this,f,e,i,n,p),c)break;p+=y.byteLength/$}return c}bvhcast(t,n,e){let{intersectsRanges:i}=e;return Ce(this,t,n,i)}}function Ee(){return typeof SharedArrayBuffer<"u"}function zn(s){return s.index?s.index.count:s.attributes.position.count}function Qt(s){return zn(s)/3}function Le(s,t=ArrayBuffer){return s>65535?new Uint32Array(new t(4*s)):new Uint16Array(new t(2*s))}function Ve(s,t){if(!s.index){const n=s.attributes.position.count,e=t.useSharedArrayBuffer?SharedArrayBuffer:ArrayBuffer,i=Le(n,e);s.setIndex(new se(i,1));for(let o=0;o<n;o++)i[o]=o}}function Re(s,t,n){const e=zn(s)/n,i=t||s.drawRange,o=i.start/n,r=(i.start+i.count)/n,l=Math.max(0,o),c=Math.min(e,r)-l;return{offset:Math.floor(l),count:Math.floor(c)}}function De(s,t){return s.groups.map(n=>({offset:n.start/t,count:n.count/t}))}function qn(s,t,n){const e=Re(s,t,n),i=De(s,n);if(!i.length)return[e];const o=[],r=e.offset,l=e.offset+e.count,c=zn(s)/n,p=[];for(const a of i){const{offset:y,count:w}=a,A=y,g=isFinite(w)?w:c-y,B=y+g;A<l&&B>r&&(p.push({pos:Math.max(r,A),isStart:!0}),p.push({pos:Math.min(l,B),isStart:!1}))}p.sort((a,y)=>a.pos!==y.pos?a.pos-y.pos:a.type==="end"?-1:1);let u=0,f=null;for(const a of p){const y=a.pos;u!==0&&y!==f&&o.push({offset:f,count:y-f}),u+=a.isStart?1:-1,f=y}return o}function Ne(s,t){const n=s[s.length-1],e=n.offset+n.count>2**16,i=s.reduce((p,u)=>p+u.count,0),o=e?4:2,r=t?new SharedArrayBuffer(i*o):new ArrayBuffer(i*o),l=e?new Uint32Array(r):new Uint16Array(r);let c=0;for(let p=0;p<s.length;p++){const{offset:u,count:f}=s[p];for(let a=0;a<f;a++)l[c+a]=u+a;c+=f}return l}class Fe extends Ue{get indirect(){return!!this._indirectBuffer}get primitiveStride(){return null}get primitiveBufferStride(){return this.indirect?1:this.primitiveStride}set primitiveBufferStride(t){}get primitiveBuffer(){return this.indirect?this._indirectBuffer:this.geometry.index.array}set primitiveBuffer(t){}constructor(t,n={}){if(t.isBufferGeometry){if(t.index&&t.index.isInterleavedBufferAttribute)throw new Error("BVH: InterleavedBufferAttribute is not supported for the index attribute.")}else throw new Error("BVH: Only BufferGeometries are supported.");if(n.useSharedArrayBuffer&&!Ee())throw new Error("BVH: SharedArrayBuffer is not available.");super(),this.geometry=t,this.resolvePrimitiveIndex=n.indirect?e=>this._indirectBuffer[e]:e=>e,this.primitiveBuffer=null,this.primitiveBufferStride=null,this._indirectBuffer=null,n={...ce,...n},n[Mn]||this.init(n)}init(t){const{geometry:n,primitiveStride:e}=this;if(t.indirect){const i=qn(n,t.range,e),o=Ne(i,t.useSharedArrayBuffer);this._indirectBuffer=o}else Ve(n,t);super.init(t),!n.boundingBox&&t.setBoundingBox&&(n.boundingBox=this.getBoundingBox(new J))}getRootRanges(t){return this.indirect?[{offset:0,count:this._indirectBuffer.length}]:qn(this.geometry,t,this.primitiveStride)}raycastObject3D(){throw new Error("BVH: raycastObject3D() not implemented")}}class nt{constructor(){this.min=1/0,this.max=-1/0}setFromPointsField(t,n){let e=1/0,i=-1/0;for(let o=0,r=t.length;o<r;o++){const c=t[o][n];e=c<e?c:e,i=c>i?c:i}this.min=e,this.max=i}setFromPoints(t,n){let e=1/0,i=-1/0;for(let o=0,r=n.length;o<r;o++){const l=n[o],c=t.dot(l);e=c<e?c:e,i=c>i?c:i}this.min=e,this.max=i}isSeparated(t){return this.min>t.max||t.min>this.max}}nt.prototype.setFromBox=(function(){const s=new C;return function(n,e){const i=e.min,o=e.max;let r=1/0,l=-1/0;for(let c=0;c<=1;c++)for(let p=0;p<=1;p++)for(let u=0;u<=1;u++){s.x=i.x*c+o.x*(1-c),s.y=i.y*p+o.y*(1-p),s.z=i.z*u+o.z*(1-u);const f=n.dot(s);r=Math.min(f,r),l=Math.max(f,l)}this.min=r,this.max=l}})();const He=(function(){const s=new C,t=new C,n=new C;return function(i,o,r){const l=i.start,c=s,p=o.start,u=t;n.subVectors(l,p),s.subVectors(i.end,i.start),t.subVectors(o.end,o.start);const f=n.dot(u),a=u.dot(c),y=u.dot(u),w=n.dot(c),g=c.dot(c)*y-a*a;let B,d;g!==0?B=(f*a-w*y)/g:B=0,d=(f+B*a)/y,r.x=B,r.y=d}})(),Cn=(function(){const s=new Y,t=new C,n=new C;return function(i,o,r,l){He(i,o,s);let c=s.x,p=s.y;if(c>=0&&c<=1&&p>=0&&p<=1){i.at(c,r),o.at(p,l);return}else if(c>=0&&c<=1){p<0?o.at(0,l):o.at(1,l),i.closestPointToPoint(l,!0,r);return}else if(p>=0&&p<=1){c<0?i.at(0,r):i.at(1,r),o.closestPointToPoint(r,!0,l);return}else{let u;c<0?u=i.start:u=i.end;let f;p<0?f=o.start:f=o.end;const a=t,y=n;if(i.closestPointToPoint(f,!0,t),o.closestPointToPoint(u,!0,n),a.distanceToSquared(f)<=y.distanceToSquared(u)){r.copy(a),l.copy(f);return}else{r.copy(u),l.copy(y);return}}}})(),qe=(function(){const s=new C,t=new C,n=new ie,e=new tt;return function(o,r){const{radius:l,center:c}=o,{a:p,b:u,c:f}=r;if(e.start=p,e.end=u,e.closestPointToPoint(c,!0,s).distanceTo(c)<=l||(e.start=p,e.end=f,e.closestPointToPoint(c,!0,s).distanceTo(c)<=l)||(e.start=u,e.end=f,e.closestPointToPoint(c,!0,s).distanceTo(c)<=l))return!0;const A=r.getPlane(n);if(Math.abs(A.distanceToPoint(c))<=l){const B=A.projectPoint(c,t);if(r.containsPoint(B))return!0}return!1}})(),$e=["x","y","z"],G=1e-15,$n=G*G;function Z(s){return Math.abs(s)<G}class W extends Q{constructor(...t){super(...t),this.isExtendedTriangle=!0,this.satAxes=new Array(4).fill().map(()=>new C),this.satBounds=new Array(4).fill().map(()=>new nt),this.points=[this.a,this.b,this.c],this.plane=new ie,this.isDegenerateIntoSegment=!1,this.isDegenerateIntoPoint=!1,this.degenerateSegment=new tt,this.needsUpdate=!0}intersectsSphere(t){return qe(t,this)}update(){const t=this.a,n=this.b,e=this.c,i=this.points,o=this.satAxes,r=this.satBounds,l=o[0],c=r[0];this.getNormal(l),c.setFromPoints(l,i);const p=o[1],u=r[1];p.subVectors(t,n),u.setFromPoints(p,i);const f=o[2],a=r[2];f.subVectors(n,e),a.setFromPoints(f,i);const y=o[3],w=r[3];y.subVectors(e,t),w.setFromPoints(y,i);const A=p.length(),g=f.length(),B=y.length();this.isDegenerateIntoPoint=!1,this.isDegenerateIntoSegment=!1,A<G?g<G||B<G?this.isDegenerateIntoPoint=!0:(this.isDegenerateIntoSegment=!0,this.degenerateSegment.start.copy(t),this.degenerateSegment.end.copy(e)):g<G?B<G?this.isDegenerateIntoPoint=!0:(this.isDegenerateIntoSegment=!0,this.degenerateSegment.start.copy(n),this.degenerateSegment.end.copy(t)):B<G&&(this.isDegenerateIntoSegment=!0,this.degenerateSegment.start.copy(e),this.degenerateSegment.end.copy(n)),this.plane.setFromNormalAndCoplanarPoint(l,t),this.needsUpdate=!1}}W.prototype.closestPointToSegment=(function(){const s=new C,t=new C,n=new tt;return function(i,o=null,r=null){const{start:l,end:c}=i,p=this.points;let u,f=1/0;for(let a=0;a<3;a++){const y=(a+1)%3;n.start.copy(p[a]),n.end.copy(p[y]),Cn(n,i,s,t),u=s.distanceToSquared(t),u<f&&(f=u,o&&o.copy(s),r&&r.copy(t))}return this.closestPointToPoint(l,s),u=l.distanceToSquared(s),u<f&&(f=u,o&&o.copy(s),r&&r.copy(l)),this.closestPointToPoint(c,s),u=c.distanceToSquared(s),u<f&&(f=u,o&&o.copy(s),r&&r.copy(c)),Math.sqrt(f)}})();W.prototype.intersectsTriangle=(function(){const s=new W,t=new nt,n=new nt,e=new C,i=new C,o=new C,r=new C,l=new tt,c=new tt,p=new C,u=new Y,f=new Y;function a(h,m,x,S){const P=e;!h.isDegenerateIntoPoint&&!h.isDegenerateIntoSegment?P.copy(h.plane.normal):P.copy(m.plane.normal);const _=h.satBounds,M=h.satAxes;for(let b=1;b<4;b++){const I=_[b],z=M[b];if(t.setFromPoints(z,m.points),I.isSeparated(t)||(r.copy(P).cross(z),t.setFromPoints(r,h.points),n.setFromPoints(r,m.points),t.isSeparated(n)))return!1}const T=m.satBounds,v=m.satAxes;for(let b=1;b<4;b++){const I=T[b],z=v[b];if(t.setFromPoints(z,h.points),I.isSeparated(t)||(r.crossVectors(P,z),t.setFromPoints(r,h.points),n.setFromPoints(r,m.points),t.isSeparated(n)))return!1}return x&&(S||console.warn("ExtendedTriangle.intersectsTriangle: Triangles are coplanar which does not support an output edge. Setting edge to 0, 0, 0."),x.start.set(0,0,0),x.end.set(0,0,0)),!0}function y(h,m,x,S,P,_,M,T,v,b,I){let z=M/(M-T);b.x=S+(P-S)*z,I.start.subVectors(m,h).multiplyScalar(z).add(h),z=M/(M-v),b.y=S+(_-S)*z,I.end.subVectors(x,h).multiplyScalar(z).add(h)}function w(h,m,x,S,P,_,M,T,v,b,I){if(P>0)y(h.c,h.a,h.b,S,m,x,v,M,T,b,I);else if(_>0)y(h.b,h.a,h.c,x,m,S,T,M,v,b,I);else if(T*v>0||M!=0)y(h.a,h.b,h.c,m,x,S,M,T,v,b,I);else if(T!=0)y(h.b,h.a,h.c,x,m,S,T,M,v,b,I);else if(v!=0)y(h.c,h.a,h.b,S,m,x,v,M,T,b,I);else return!0;return!1}function A(h,m,x,S){const P=m.degenerateSegment,_=h.plane.distanceToPoint(P.start),M=h.plane.distanceToPoint(P.end);return Z(_)?Z(M)?a(h,m,x,S):(x&&(x.start.copy(P.start),x.end.copy(P.start)),h.containsPoint(P.start)):Z(M)?(x&&(x.start.copy(P.end),x.end.copy(P.end)),h.containsPoint(P.end)):h.plane.intersectLine(P,e)!=null?(x&&(x.start.copy(e),x.end.copy(e)),h.containsPoint(e)):!1}function g(h,m,x){const S=m.a;return Z(h.plane.distanceToPoint(S))&&h.containsPoint(S)?(x&&(x.start.copy(S),x.end.copy(S)),!0):!1}function B(h,m,x){const S=h.degenerateSegment,P=m.a;return S.closestPointToPoint(P,!0,e),P.distanceToSquared(e)<$n?(x&&(x.start.copy(P),x.end.copy(P)),!0):!1}function d(h,m,x,S){if(h.isDegenerateIntoSegment)if(m.isDegenerateIntoSegment){const P=h.degenerateSegment,_=m.degenerateSegment,M=i,T=o;P.delta(M),_.delta(T);const v=e.subVectors(_.start,P.start),b=M.x*T.y-M.y*T.x;if(Z(b))return!1;const I=(v.x*T.y-v.y*T.x)/b,z=-(M.x*v.y-M.y*v.x)/b;if(I<0||I>1||z<0||z>1)return!1;const U=P.start.z+M.z*I,L=_.start.z+T.z*z;return Z(U-L)?(x&&(x.start.copy(P.start).addScaledVector(M,I),x.end.copy(P.start).addScaledVector(M,I)),!0):!1}else return m.isDegenerateIntoPoint?B(h,m,x):A(m,h,x,S);else{if(h.isDegenerateIntoPoint)return m.isDegenerateIntoPoint?m.a.distanceToSquared(h.a)<$n?(x&&(x.start.copy(h.a),x.end.copy(h.a)),!0):!1:m.isDegenerateIntoSegment?B(m,h,x):g(m,h,x);if(m.isDegenerateIntoPoint)return g(h,m,x);if(m.isDegenerateIntoSegment)return A(h,m,x,S)}}return function(m,x=null,S=!1){this.needsUpdate&&this.update(),m.isExtendedTriangle?m.needsUpdate&&m.update():(s.copy(m),s.update(),m=s);const P=d(this,m,x,S);if(P!==void 0)return P;const _=this.plane,M=m.plane;let T=M.distanceToPoint(this.a),v=M.distanceToPoint(this.b),b=M.distanceToPoint(this.c);Z(T)&&(T=0),Z(v)&&(v=0),Z(b)&&(b=0);const I=T*v,z=T*b;if(I>0&&z>0)return!1;let U=_.distanceToPoint(m.a),L=_.distanceToPoint(m.b),Ct=_.distanceToPoint(m.c);Z(U)&&(U=0),Z(L)&&(L=0),Z(Ct)&&(Ct=0);const Un=U*L,En=U*Ct;if(Un>0&&En>0)return!1;i.copy(_.normal),o.copy(M.normal);const jt=i.cross(o);let Gt=0,tn=Math.abs(jt.x);const Ln=Math.abs(jt.y);Ln>tn&&(tn=Ln,Gt=1),Math.abs(jt.z)>tn&&(Gt=2);const ft=$e[Gt],fe=this.a[ft],ue=this.b[ft],pe=this.c[ft],ye=m.a[ft],de=m.b[ft],me=m.c[ft];if(w(this,fe,ue,pe,I,z,T,v,b,u,l))return a(this,m,x,S);if(w(m,ye,de,me,Un,En,U,L,Ct,f,c))return a(this,m,x,S);if(u.y<u.x){const nn=u.y;u.y=u.x,u.x=nn,p.copy(l.start),l.start.copy(l.end),l.end.copy(p)}if(f.y<f.x){const nn=f.y;f.y=f.x,f.x=nn,p.copy(c.start),c.start.copy(c.end),c.end.copy(p)}return u.y<f.x||f.y<u.x?!1:(x&&(f.x>u.x?x.start.copy(c.start):x.start.copy(l.start),f.y<u.y?x.end.copy(c.end):x.end.copy(l.end)),!0)}})();W.prototype.distanceToPoint=(function(){const s=new C;return function(n){return this.closestPointToPoint(n,s),n.distanceTo(s)}})();W.prototype.distanceToTriangle=(function(){const s=new C,t=new C,n=["a","b","c"],e=new tt,i=new tt;return function(r,l=null,c=null){const p=l||c?e:null;if(this.intersectsTriangle(r,p,!0))return(l||c)&&(l&&p.getCenter(l),c&&p.getCenter(c)),0;let u=1/0;for(let f=0;f<3;f++){let a;const y=n[f],w=r[y];this.closestPointToPoint(w,s),a=w.distanceToSquared(s),a<u&&(u=a,l&&l.copy(s),c&&c.copy(w));const A=this[y];r.closestPointToPoint(A,s),a=A.distanceToSquared(s),a<u&&(u=a,l&&l.copy(A),c&&c.copy(s))}for(let f=0;f<3;f++){const a=n[f],y=n[(f+1)%3];e.set(this[a],this[y]);for(let w=0;w<3;w++){const A=n[w],g=n[(w+1)%3];i.set(r[A],r[g]),Cn(e,i,s,t);const B=s.distanceToSquared(t);B<u&&(u=B,l&&l.copy(s),c&&c.copy(t))}}return Math.sqrt(u)}})();class X{constructor(t,n,e){this.isOrientedBox=!0,this.min=new C,this.max=new C,this.matrix=new rt,this.invMatrix=new rt,this.points=new Array(8).fill().map(()=>new C),this.satAxes=new Array(3).fill().map(()=>new C),this.satBounds=new Array(3).fill().map(()=>new nt),this.alignedSatBounds=new Array(3).fill().map(()=>new nt),this.needsUpdate=!1,t&&this.min.copy(t),n&&this.max.copy(n),e&&this.matrix.copy(e)}set(t,n,e){this.min.copy(t),this.max.copy(n),this.matrix.copy(e),this.needsUpdate=!0}copy(t){this.min.copy(t.min),this.max.copy(t.max),this.matrix.copy(t.matrix),this.needsUpdate=!0}}X.prototype.update=(function(){return function(){const t=this.matrix,n=this.min,e=this.max,i=this.points;for(let p=0;p<=1;p++)for(let u=0;u<=1;u++)for(let f=0;f<=1;f++){const a=1*p|2*u|4*f,y=i[a];y.x=p?e.x:n.x,y.y=u?e.y:n.y,y.z=f?e.z:n.z,y.applyMatrix4(t)}const o=this.satBounds,r=this.satAxes,l=i[0];for(let p=0;p<3;p++){const u=r[p],f=o[p],a=1<<p,y=i[a];u.subVectors(l,y),f.setFromPoints(u,i)}const c=this.alignedSatBounds;c[0].setFromPointsField(i,"x"),c[1].setFromPointsField(i,"y"),c[2].setFromPointsField(i,"z"),this.invMatrix.copy(this.matrix).invert(),this.needsUpdate=!1}})();X.prototype.intersectsBox=(function(){const s=new nt;return function(n){this.needsUpdate&&this.update();const e=n.min,i=n.max,o=this.satBounds,r=this.satAxes,l=this.alignedSatBounds;if(s.min=e.x,s.max=i.x,l[0].isSeparated(s)||(s.min=e.y,s.max=i.y,l[1].isSeparated(s))||(s.min=e.z,s.max=i.z,l[2].isSeparated(s)))return!1;for(let c=0;c<3;c++){const p=r[c],u=o[c];if(s.setFromBox(p,n),u.isSeparated(s))return!1}return!0}})();X.prototype.intersectsTriangle=(function(){const s=new W,t=new Array(3),n=new nt,e=new nt,i=new C;return function(r){this.needsUpdate&&this.update(),r.isExtendedTriangle?r.needsUpdate&&r.update():(s.copy(r),s.update(),r=s);const l=this.satBounds,c=this.satAxes;t[0]=r.a,t[1]=r.b,t[2]=r.c;for(let a=0;a<3;a++){const y=l[a],w=c[a];if(n.setFromPoints(w,t),y.isSeparated(n))return!1}const p=r.satBounds,u=r.satAxes,f=this.points;for(let a=0;a<3;a++){const y=p[a],w=u[a];if(n.setFromPoints(w,f),y.isSeparated(n))return!1}for(let a=0;a<3;a++){const y=c[a];for(let w=0;w<4;w++){const A=u[w];if(i.crossVectors(y,A),n.setFromPoints(i,t),e.setFromPoints(i,f),n.isSeparated(e))return!1}}return!0}})();X.prototype.closestPointToPoint=(function(){return function(t,n){return this.needsUpdate&&this.update(),n.copy(t).applyMatrix4(this.invMatrix).clamp(this.min,this.max).applyMatrix4(this.matrix),n}})();X.prototype.distanceToPoint=(function(){const s=new C;return function(n){return this.closestPointToPoint(n,s),n.distanceTo(s)}})();X.prototype.distanceToBox=(function(){const s=["x","y","z"],t=new Array(12).fill().map(()=>new tt),n=new Array(12).fill().map(()=>new tt),e=new C,i=new C;return function(r,l=0,c=null,p=null){if(this.needsUpdate&&this.update(),this.intersectsBox(r))return(c||p)&&(r.getCenter(i),this.closestPointToPoint(i,e),r.closestPointToPoint(e,i),c&&c.copy(e),p&&p.copy(i)),0;const u=l*l,f=r.min,a=r.max,y=this.points;let w=1/0;for(let g=0;g<8;g++){const B=y[g];i.copy(B).clamp(f,a);const d=B.distanceToSquared(i);if(d<w&&(w=d,c&&c.copy(B),p&&p.copy(i),d<u))return Math.sqrt(d)}let A=0;for(let g=0;g<3;g++)for(let B=0;B<=1;B++)for(let d=0;d<=1;d++){const h=(g+1)%3,m=(g+2)%3,x=B<<h|d<<m,S=1<<g|B<<h|d<<m,P=y[x],_=y[S];t[A].set(P,_);const T=s[g],v=s[h],b=s[m],I=n[A],z=I.start,U=I.end;z[T]=f[T],z[v]=B?f[v]:a[v],z[b]=d?f[b]:a[v],U[T]=a[T],U[v]=B?f[v]:a[v],U[b]=d?f[b]:a[v],A++}for(let g=0;g<=1;g++)for(let B=0;B<=1;B++)for(let d=0;d<=1;d++){i.x=g?a.x:f.x,i.y=B?a.y:f.y,i.z=d?a.z:f.z,this.closestPointToPoint(i,e);const h=i.distanceToSquared(e);if(h<w&&(w=h,c&&c.copy(e),p&&p.copy(i),h<u))return Math.sqrt(h)}for(let g=0;g<12;g++){const B=t[g];for(let d=0;d<12;d++){const h=n[d];Cn(B,h,e,i);const m=e.distanceToSquared(i);if(m<w&&(w=m,c&&c.copy(e),p&&p.copy(i),m<u))return Math.sqrt(m)}}return Math.sqrt(w)}})();class ke extends In{constructor(){super(()=>new W)}}const O=new ke,Bt=new C,fn=new C;function Xe(s,t,n={},e=0,i=1/0){const o=e*e,r=i*i;let l=1/0,c=null;if(s.shapecast({boundsTraverseOrder:u=>(Bt.copy(t).clamp(u.min,u.max),Bt.distanceToSquared(t)),intersectsBounds:(u,f,a)=>a<l&&a<r,intersectsTriangle:(u,f)=>{u.closestPointToPoint(t,Bt);const a=t.distanceToSquared(Bt);return a<l&&(fn.copy(Bt),l=a,c=f),a<o}}),l===1/0)return null;const p=Math.sqrt(l);return n.point?n.point.copy(fn):n.point=fn.clone(),n.distance=p,n.faceIndex=c,n}const Vt=parseInt(re)>=169,Ze=parseInt(re)<=161,ct=new C,lt=new C,at=new C,Rt=new Y,Dt=new Y,Nt=new Y,kn=new C,Xn=new C,Zn=new C,Pt=new C;function Oe(s,t,n,e,i,o,r,l){let c;if(o===he?c=s.intersectTriangle(e,n,t,!0,i):c=s.intersectTriangle(t,n,e,o!==xe,i),c===null)return null;const p=s.origin.distanceTo(i);return p<r||p>l?null:{distance:p,point:i.clone()}}function On(s,t,n,e,i,o,r,l,c,p,u){ct.fromBufferAttribute(t,o),lt.fromBufferAttribute(t,r),at.fromBufferAttribute(t,l);const f=Oe(s,ct,lt,at,Pt,c,p,u);if(f){if(e){Rt.fromBufferAttribute(e,o),Dt.fromBufferAttribute(e,r),Nt.fromBufferAttribute(e,l),f.uv=new Y;const y=Q.getInterpolation(Pt,ct,lt,at,Rt,Dt,Nt,f.uv);Vt||(f.uv=y)}if(i){Rt.fromBufferAttribute(i,o),Dt.fromBufferAttribute(i,r),Nt.fromBufferAttribute(i,l),f.uv1=new Y;const y=Q.getInterpolation(Pt,ct,lt,at,Rt,Dt,Nt,f.uv1);Vt||(f.uv1=y),Ze&&(f.uv2=f.uv1)}if(n){kn.fromBufferAttribute(n,o),Xn.fromBufferAttribute(n,r),Zn.fromBufferAttribute(n,l),f.normal=new C;const y=Q.getInterpolation(Pt,ct,lt,at,kn,Xn,Zn,f.normal);f.normal.dot(s.direction)>0&&f.normal.multiplyScalar(-1),Vt||(f.normal=y)}const a={a:o,b:r,c:l,normal:new C,materialIndex:0};if(Q.getNormal(ct,lt,at,a.normal),f.face=a,f.faceIndex=o,Vt){const y=new C;Q.getBarycoord(Pt,ct,lt,at,y),f.barycoord=y}}return f}function Yn(s){return s&&s.isMaterial?s.side:s}function Jt(s,t,n,e,i,o,r){const l=e*3;let c=l+0,p=l+1,u=l+2;const{index:f,groups:a}=s;s.index&&(c=f.getX(c),p=f.getX(p),u=f.getX(u));const{position:y,normal:w,uv:A,uv1:g}=s.attributes;if(Array.isArray(t)){const B=e*3;for(let d=0,h=a.length;d<h;d++){const{start:m,count:x,materialIndex:S}=a[d];if(B>=m&&B<m+x){const P=Yn(t[S]),_=On(n,y,w,A,g,c,p,u,P,o,r);if(_)if(_.faceIndex=e,_.face.materialIndex=S,i)i.push(_);else return _}}}else{const B=Yn(t),d=On(n,y,w,A,g,c,p,u,B,o,r);if(d)if(d.faceIndex=e,d.face.materialIndex=0,i)i.push(d);else return d}return null}function D(s,t,n,e){const i=s.a,o=s.b,r=s.c;let l=t,c=t+1,p=t+2;n&&(l=n.getX(l),c=n.getX(c),p=n.getX(p)),i.x=e.getX(l),i.y=e.getY(l),i.z=e.getZ(l),o.x=e.getX(c),o.y=e.getY(c),o.z=e.getZ(c),r.x=e.getX(p),r.y=e.getY(p),r.z=e.getZ(p)}const Tt=new C,bt=new C,St=new C,Kn=new Y,Wn=new Y,Qn=new Y;function Ss(s,t,n,e){const i=t.getIndex().array,o=t.getAttribute("position"),r=t.getAttribute("uv"),l=i[n*3],c=i[n*3+1],p=i[n*3+2];Tt.fromBufferAttribute(o,l),bt.fromBufferAttribute(o,c),St.fromBufferAttribute(o,p);let u=0;const f=t.groups,a=n*3;for(let A=0,g=f.length;A<g;A++){const B=f[A],{start:d,count:h}=B;if(a>=d&&a<d+h){u=B.materialIndex;break}}const y=e&&e.barycoord?e.barycoord:new C;Q.getBarycoord(s,Tt,bt,St,y);let w=null;return r&&(Kn.fromBufferAttribute(r,l),Wn.fromBufferAttribute(r,c),Qn.fromBufferAttribute(r,p),e&&e.uv?w=e.uv:w=new Y,Q.getInterpolation(s,Tt,bt,St,Kn,Wn,Qn,w)),e?(e.face||(e.face={}),e.face.a=l,e.face.b=c,e.face.c=p,e.face.materialIndex=u,e.face.normal||(e.face.normal=new C),Q.getNormal(Tt,bt,St,e.face.normal),w&&(e.uv=w),e.barycoord=y,e):{face:{a:l,b:c,c:p,materialIndex:u,normal:Q.getNormal(Tt,bt,St,new C)},uv:w,barycoord:y}}function Ye(s,t,n,e,i,o,r,l){const{geometry:c,_indirectBuffer:p}=s;for(let u=e,f=e+i;u<f;u++)Jt(c,t,n,u,o,r,l)}function Ke(s,t,n,e,i,o,r){const{geometry:l,_indirectBuffer:c}=s;let p=1/0,u=null;for(let f=e,a=e+i;f<a;f++){let y;y=Jt(l,t,n,f,null,o,r),y&&y.distance<p&&(u=y,p=y.distance)}return u}function We(s,t,n,e,i,o,r){const{geometry:l}=n,{index:c}=l,p=l.attributes.position;for(let u=s,f=t+s;u<f;u++){let a;if(a=u,D(r,a*3,c,p),r.needsUpdate=!0,e(r,a,i,o))return!0}return!1}function Qe(s,t=null){t&&Array.isArray(t)&&(t=new Set(t));const n=s.geometry,e=n.index?n.index.array:null,i=n.attributes.position;let o,r,l,c,p=0;const u=s._roots;for(let a=0,y=u.length;a<y;a++)o=u[a],r=new Uint32Array(o),l=new Uint16Array(o),c=new Float32Array(o),f(0,p),p+=o.byteLength;function f(a,y,w=!1){const A=a*2;if(R(A,l)){const g=q(a,r),B=k(A,l);let d=1/0,h=1/0,m=1/0,x=-1/0,S=-1/0,P=-1/0;for(let _=3*g,M=3*(g+B);_<M;_++){let T=e[_];const v=i.getX(T),b=i.getY(T),I=i.getZ(T);v<d&&(d=v),v>x&&(x=v),b<h&&(h=b),b>S&&(S=b),I<m&&(m=I),I>P&&(P=I)}return c[a+0]!==d||c[a+1]!==h||c[a+2]!==m||c[a+3]!==x||c[a+4]!==S||c[a+5]!==P?(c[a+0]=d,c[a+1]=h,c[a+2]=m,c[a+3]=x,c[a+4]=S,c[a+5]=P,!0):!1}else{const g=F(a),B=H(a,r);let d=w,h=!1,m=!1;if(t){if(!d){const T=g/N+y/$,v=B/N+y/$;h=t.has(T),m=t.has(v),d=!h&&!m}}else h=!0,m=!0;const x=d||h,S=d||m;let P=!1;x&&(P=f(g,y,d));let _=!1;S&&(_=f(B,y,d));const M=P||_;if(M)for(let T=0;T<3;T++){const v=g+T,b=B+T,I=c[v],z=c[v+3],U=c[b],L=c[b+3];c[a+T]=I<U?I:U,c[a+T+3]=z>L?z:L}return M}}}function ot(s,t,n,e,i){let o,r,l,c,p,u;const f=1/n.direction.x,a=1/n.direction.y,y=1/n.direction.z,w=n.origin.x,A=n.origin.y,g=n.origin.z;let B=t[s],d=t[s+3],h=t[s+1],m=t[s+3+1],x=t[s+2],S=t[s+3+2];return f>=0?(o=(B-w)*f,r=(d-w)*f):(o=(d-w)*f,r=(B-w)*f),a>=0?(l=(h-A)*a,c=(m-A)*a):(l=(m-A)*a,c=(h-A)*a),o>c||l>r||((l>o||isNaN(o))&&(o=l),(c<r||isNaN(r))&&(r=c),y>=0?(p=(x-g)*y,u=(S-g)*y):(p=(S-g)*y,u=(x-g)*y),o>u||p>r)?!1:((p>o||o!==o)&&(o=p),(u<r||r!==r)&&(r=u),o<=i&&r>=e)}function Je(s,t,n,e,i,o,r,l){const{geometry:c,_indirectBuffer:p}=s;for(let u=e,f=e+i;u<f;u++){let a=p?p[u]:u;Jt(c,t,n,a,o,r,l)}}function je(s,t,n,e,i,o,r){const{geometry:l,_indirectBuffer:c}=s;let p=1/0,u=null;for(let f=e,a=e+i;f<a;f++){let y;y=Jt(l,t,n,c?c[f]:f,null,o,r),y&&y.distance<p&&(u=y,p=y.distance)}return u}function Ge(s,t,n,e,i,o,r){const{geometry:l}=n,{index:c}=l,p=l.attributes.position;for(let u=s,f=t+s;u<f;u++){let a;if(a=n.resolveTriangleIndex(u),D(r,a*3,c,p),r.needsUpdate=!0,e(r,a,i,o))return!0}return!1}function ts(s,t,n,e,i,o,r){E.setBuffer(s._roots[t]),An(0,s,n,e,i,o,r),E.clearBuffer()}function An(s,t,n,e,i,o,r){const{float32Array:l,uint16Array:c,uint32Array:p}=E,u=s*2;if(R(u,c)){const a=q(s,p),y=k(u,c);Ye(t,n,e,a,y,i,o,r)}else{const a=F(s);ot(a,l,e,o,r)&&An(a,t,n,e,i,o,r);const y=H(s,p);ot(y,l,e,o,r)&&An(y,t,n,e,i,o,r)}}const ns=["x","y","z"];function es(s,t,n,e,i,o){E.setBuffer(s._roots[t]);const r=gn(0,s,n,e,i,o);return E.clearBuffer(),r}function gn(s,t,n,e,i,o){const{float32Array:r,uint16Array:l,uint32Array:c}=E;let p=s*2;if(R(p,l)){const f=q(s,c),a=k(p,l);return Ke(t,n,e,f,a,i,o)}else{const f=vn(s,c),a=ns[f],w=e.direction[a]>=0;let A,g;w?(A=F(s),g=H(s,c)):(A=H(s,c),g=F(s));const d=ot(A,r,e,i,o)?gn(A,t,n,e,i,o):null;if(d){const x=d.point[a];if(w?x<=r[g+f]:x>=r[g+f+3])return d}const m=ot(g,r,e,i,o)?gn(g,t,n,e,i,o):null;return d&&m?d.distance<=m.distance?d:m:d||m||null}}const Ft=new J,mt=new W,ht=new W,_t=new rt,Jn=new X,Ht=new X;function ss(s,t,n,e){E.setBuffer(s._roots[t]);const i=Bn(0,s,n,e);return E.clearBuffer(),i}function Bn(s,t,n,e,i=null){const{float32Array:o,uint16Array:r,uint32Array:l}=E;let c=s*2;if(i===null&&(n.boundingBox||n.computeBoundingBox(),Jn.set(n.boundingBox.min,n.boundingBox.max,e),i=Jn),R(c,r)){const u=t.geometry,f=u.index,a=u.attributes.position,y=n.index,w=n.attributes.position,A=q(s,l),g=k(c,r);if(_t.copy(e).invert(),n.boundsTree)return V(s,o,Ht),Ht.matrix.copy(_t),Ht.needsUpdate=!0,n.boundsTree.shapecast({intersectsBounds:d=>Ht.intersectsBox(d),intersectsTriangle:d=>{d.a.applyMatrix4(e),d.b.applyMatrix4(e),d.c.applyMatrix4(e),d.needsUpdate=!0;for(let h=A*3,m=(g+A)*3;h<m;h+=3)if(D(ht,h,f,a),ht.needsUpdate=!0,d.intersectsTriangle(ht))return!0;return!1}});{const B=Qt(n);for(let d=A*3,h=(g+A)*3;d<h;d+=3){D(mt,d,f,a),mt.a.applyMatrix4(_t),mt.b.applyMatrix4(_t),mt.c.applyMatrix4(_t),mt.needsUpdate=!0;for(let m=0,x=B*3;m<x;m+=3)if(D(ht,m,y,w),ht.needsUpdate=!0,mt.intersectsTriangle(ht))return!0}}}else{const u=F(s),f=H(s,l);return V(u,o,Ft),!!(i.intersectsBox(Ft)&&Bn(u,t,n,e,i)||(V(f,o,Ft),i.intersectsBox(Ft)&&Bn(f,t,n,e,i)))}}const qt=new rt,un=new X,Mt=new X,is=new C,rs=new C,os=new C,cs=new C;function ls(s,t,n,e={},i={},o=0,r=1/0){t.boundingBox||t.computeBoundingBox(),un.set(t.boundingBox.min,t.boundingBox.max,n),un.needsUpdate=!0;const l=s.geometry,c=l.attributes.position,p=l.index,u=t.attributes.position,f=t.index,a=O.getPrimitive(),y=O.getPrimitive();let w=is,A=rs,g=null,B=null;i&&(g=os,B=cs);let d=1/0,h=null,m=null;return qt.copy(n).invert(),Mt.matrix.copy(qt),s.shapecast({boundsTraverseOrder:x=>un.distanceToBox(x),intersectsBounds:(x,S,P)=>P<d&&P<r?(S&&(Mt.min.copy(x.min),Mt.max.copy(x.max),Mt.needsUpdate=!0),!0):!1,intersectsRange:(x,S)=>{if(t.boundsTree)return t.boundsTree.shapecast({boundsTraverseOrder:_=>Mt.distanceToBox(_),intersectsBounds:(_,M,T)=>T<d&&T<r,intersectsRange:(_,M)=>{for(let T=_,v=_+M;T<v;T++){D(y,3*T,f,u),y.a.applyMatrix4(n),y.b.applyMatrix4(n),y.c.applyMatrix4(n),y.needsUpdate=!0;for(let b=x,I=x+S;b<I;b++){D(a,3*b,p,c),a.needsUpdate=!0;const z=a.distanceToTriangle(y,w,g);if(z<d&&(A.copy(w),B&&B.copy(g),d=z,h=b,m=T),z<o)return!0}}}});{const P=Qt(t);for(let _=0,M=P;_<M;_++){D(y,3*_,f,u),y.a.applyMatrix4(n),y.b.applyMatrix4(n),y.c.applyMatrix4(n),y.needsUpdate=!0;for(let T=x,v=x+S;T<v;T++){D(a,3*T,p,c),a.needsUpdate=!0;const b=a.distanceToTriangle(y,w,g);if(b<d&&(A.copy(w),B&&B.copy(g),d=b,h=T,m=_),b<o)return!0}}}}}),O.releasePrimitive(a),O.releasePrimitive(y),d===1/0?null:(e.point?e.point.copy(A):e.point=A.clone(),e.distance=d,e.faceIndex=h,i&&(i.point?i.point.copy(B):i.point=B.clone(),i.point.applyMatrix4(qt),A.applyMatrix4(qt),i.distance=A.sub(i.point).length(),i.faceIndex=m),e)}function as(s,t=null){t&&Array.isArray(t)&&(t=new Set(t));const n=s.geometry,e=n.index?n.index.array:null,i=n.attributes.position;let o,r,l,c,p=0;const u=s._roots;for(let a=0,y=u.length;a<y;a++)o=u[a],r=new Uint32Array(o),l=new Uint16Array(o),c=new Float32Array(o),f(0,p),p+=o.byteLength;function f(a,y,w=!1){const A=a*2;if(R(A,l)){const g=q(a,r),B=k(A,l);let d=1/0,h=1/0,m=1/0,x=-1/0,S=-1/0,P=-1/0;for(let _=g,M=g+B;_<M;_++){const T=3*s.resolveTriangleIndex(_);for(let v=0;v<3;v++){let b=T+v;b=e?e[b]:b;const I=i.getX(b),z=i.getY(b),U=i.getZ(b);I<d&&(d=I),I>x&&(x=I),z<h&&(h=z),z>S&&(S=z),U<m&&(m=U),U>P&&(P=U)}}return c[a+0]!==d||c[a+1]!==h||c[a+2]!==m||c[a+3]!==x||c[a+4]!==S||c[a+5]!==P?(c[a+0]=d,c[a+1]=h,c[a+2]=m,c[a+3]=x,c[a+4]=S,c[a+5]=P,!0):!1}else{const g=F(a),B=H(a,r);let d=w,h=!1,m=!1;if(t){if(!d){const T=g/N+y/$,v=B/N+y/$;h=t.has(T),m=t.has(v),d=!h&&!m}}else h=!0,m=!0;const x=d||h,S=d||m;let P=!1;x&&(P=f(g,y,d));let _=!1;S&&(_=f(B,y,d));const M=P||_;if(M)for(let T=0;T<3;T++){const v=g+T,b=B+T,I=c[v],z=c[v+3],U=c[b],L=c[b+3];c[a+T]=I<U?I:U,c[a+T+3]=z>L?z:L}return M}}}function fs(s,t,n,e,i,o,r){E.setBuffer(s._roots[t]),Pn(0,s,n,e,i,o,r),E.clearBuffer()}function Pn(s,t,n,e,i,o,r){const{float32Array:l,uint16Array:c,uint32Array:p}=E,u=s*2;if(R(u,c)){const a=q(s,p),y=k(u,c);Je(t,n,e,a,y,i,o,r)}else{const a=F(s);ot(a,l,e,o,r)&&Pn(a,t,n,e,i,o,r);const y=H(s,p);ot(y,l,e,o,r)&&Pn(y,t,n,e,i,o,r)}}const us=["x","y","z"];function ps(s,t,n,e,i,o){E.setBuffer(s._roots[t]);const r=Tn(0,s,n,e,i,o);return E.clearBuffer(),r}function Tn(s,t,n,e,i,o){const{float32Array:r,uint16Array:l,uint32Array:c}=E;let p=s*2;if(R(p,l)){const f=q(s,c),a=k(p,l);return je(t,n,e,f,a,i,o)}else{const f=vn(s,c),a=us[f],w=e.direction[a]>=0;let A,g;w?(A=F(s),g=H(s,c)):(A=H(s,c),g=F(s));const d=ot(A,r,e,i,o)?Tn(A,t,n,e,i,o):null;if(d){const x=d.point[a];if(w?x<=r[g+f]:x>=r[g+f+3])return d}const m=ot(g,r,e,i,o)?Tn(g,t,n,e,i,o):null;return d&&m?d.distance<=m.distance?d:m:d||m||null}}const $t=new J,xt=new W,wt=new W,vt=new rt,jn=new X,kt=new X;function ys(s,t,n,e){E.setBuffer(s._roots[t]);const i=bn(0,s,n,e);return E.clearBuffer(),i}function bn(s,t,n,e,i=null){const{float32Array:o,uint16Array:r,uint32Array:l}=E;let c=s*2;if(i===null&&(n.boundingBox||n.computeBoundingBox(),jn.set(n.boundingBox.min,n.boundingBox.max,e),i=jn),R(c,r)){const u=t.geometry,f=u.index,a=u.attributes.position,y=n.index,w=n.attributes.position,A=q(s,l),g=k(c,r);if(vt.copy(e).invert(),n.boundsTree)return V(s,o,kt),kt.matrix.copy(vt),kt.needsUpdate=!0,n.boundsTree.shapecast({intersectsBounds:d=>kt.intersectsBox(d),intersectsTriangle:d=>{d.a.applyMatrix4(e),d.b.applyMatrix4(e),d.c.applyMatrix4(e),d.needsUpdate=!0;for(let h=A,m=g+A;h<m;h++)if(D(wt,3*t.resolveTriangleIndex(h),f,a),wt.needsUpdate=!0,d.intersectsTriangle(wt))return!0;return!1}});{const B=Qt(n);for(let d=A,h=g+A;d<h;d++){const m=t.resolveTriangleIndex(d);D(xt,3*m,f,a),xt.a.applyMatrix4(vt),xt.b.applyMatrix4(vt),xt.c.applyMatrix4(vt),xt.needsUpdate=!0;for(let x=0,S=B*3;x<S;x+=3)if(D(wt,x,y,w),wt.needsUpdate=!0,xt.intersectsTriangle(wt))return!0}}}else{const u=F(s),f=H(s,l);return V(u,o,$t),!!(i.intersectsBox($t)&&bn(u,t,n,e,i)||(V(f,o,$t),i.intersectsBox($t)&&bn(f,t,n,e,i)))}}const Xt=new rt,pn=new X,It=new X,ds=new C,ms=new C,hs=new C,xs=new C;function ws(s,t,n,e={},i={},o=0,r=1/0){t.boundingBox||t.computeBoundingBox(),pn.set(t.boundingBox.min,t.boundingBox.max,n),pn.needsUpdate=!0;const l=s.geometry,c=l.attributes.position,p=l.index,u=t.attributes.position,f=t.index,a=O.getPrimitive(),y=O.getPrimitive();let w=ds,A=ms,g=null,B=null;i&&(g=hs,B=xs);let d=1/0,h=null,m=null;return Xt.copy(n).invert(),It.matrix.copy(Xt),s.shapecast({boundsTraverseOrder:x=>pn.distanceToBox(x),intersectsBounds:(x,S,P)=>P<d&&P<r?(S&&(It.min.copy(x.min),It.max.copy(x.max),It.needsUpdate=!0),!0):!1,intersectsRange:(x,S)=>{if(t.boundsTree){const P=t.boundsTree;return P.shapecast({boundsTraverseOrder:_=>It.distanceToBox(_),intersectsBounds:(_,M,T)=>T<d&&T<r,intersectsRange:(_,M)=>{for(let T=_,v=_+M;T<v;T++){const b=P.resolveTriangleIndex(T);D(y,3*b,f,u),y.a.applyMatrix4(n),y.b.applyMatrix4(n),y.c.applyMatrix4(n),y.needsUpdate=!0;for(let I=x,z=x+S;I<z;I++){const U=s.resolveTriangleIndex(I);D(a,3*U,p,c),a.needsUpdate=!0;const L=a.distanceToTriangle(y,w,g);if(L<d&&(A.copy(w),B&&B.copy(g),d=L,h=I,m=T),L<o)return!0}}}})}else{const P=Qt(t);for(let _=0,M=P;_<M;_++){D(y,3*_,f,u),y.a.applyMatrix4(n),y.b.applyMatrix4(n),y.c.applyMatrix4(n),y.needsUpdate=!0;for(let T=x,v=x+S;T<v;T++){const b=s.resolveTriangleIndex(T);D(a,3*b,p,c),a.needsUpdate=!0;const I=a.distanceToTriangle(y,w,g);if(I<d&&(A.copy(w),B&&B.copy(g),d=I,h=T,m=_),I<o)return!0}}}}}),O.releasePrimitive(a),O.releasePrimitive(y),d===1/0?null:(e.point?e.point.copy(A):e.point=A.clone(),e.distance=d,e.faceIndex=h,i&&(i.point?i.point.copy(B):i.point=B.clone(),i.point.applyMatrix4(Xt),A.applyMatrix4(Xt),i.distance=A.sub(i.point).length(),i.faceIndex=m),e)}function Gn(s,t,n){return s===null?null:(s.point.applyMatrix4(t.matrixWorld),s.distance=s.point.distanceTo(n.ray.origin),s.object=t,s)}const Zt=new X,Ot=new we,te=new C,ne=new rt,ee=new C,yn=["getX","getY","getZ"];class Sn extends Fe{static serialize(t,n={}){n={cloneBuffers:!0,...n};const e=t.geometry,i=t._roots,o=t._indirectBuffer,r=e.getIndex(),l={version:1,roots:null,index:null,indirectBuffer:null};return n.cloneBuffers?(l.roots=i.map(c=>c.slice()),l.index=r?r.array.slice():null,l.indirectBuffer=o?o.slice():null):(l.roots=i,l.index=r?r.array:null,l.indirectBuffer=o),l}static deserialize(t,n,e={}){e={setIndex:!0,indirect:!!t.indirectBuffer,...e};const{index:i,roots:o,indirectBuffer:r}=t;t.version||(console.warn("MeshBVH.deserialize: Serialization format has been changed and will be fixed up. It is recommended to regenerate any stored serialized data."),c(o));const l=new Sn(n,{...e,[Mn]:!0});if(l._roots=o,l._indirectBuffer=r||null,e.setIndex){const p=n.getIndex();if(p===null){const u=new se(t.index,1,!1);n.setIndex(u)}else p.array!==i&&(p.array.set(i),p.needsUpdate=!0)}return l;function c(p){for(let u=0;u<p.length;u++){const f=p[u],a=new Uint32Array(f),y=new Uint16Array(f);for(let w=0,A=f.byteLength/$;w<A;w++){const g=N*w,B=2*g;R(B,y)||(a[g+6]=a[g+6]/N-w)}}}}get primitiveStride(){return 3}get resolveTriangleIndex(){return this.resolvePrimitiveIndex}constructor(t,n={}){n.maxLeafTris&&(console.warn('MeshBVH: "maxLeafTris" option has been deprecated. Use "targetLeafSize", instead.'),n={...n,targetLeafSize:n.maxLeafTris}),super(t,n)}shiftTriangleOffsets(t){return super.shiftPrimitiveOffsets(t)}writePrimitiveBounds(t,n,e){const i=this.geometry,o=this._indirectBuffer,r=i.attributes.position,l=i.index?i.index.array:null,p=(o?o[t]:t)*3;let u=p+0,f=p+1,a=p+2;l&&(u=l[u],f=l[f],a=l[a]);for(let y=0;y<3;y++){const w=r[yn[y]](u),A=r[yn[y]](f),g=r[yn[y]](a);let B=w;A<B&&(B=A),g<B&&(B=g);let d=w;A>d&&(d=A),g>d&&(d=g),n[e+y]=B,n[e+y+3]=d}return n}computePrimitiveBounds(t,n,e){const i=this.geometry,o=this._indirectBuffer,r=i.attributes.position,l=i.index?i.index.array:null,c=r.normalized;if(t<0||n+t-e.offset>e.length/6)throw new Error("MeshBVH: compute triangle bounds range is invalid.");const p=r.array,u=r.offset||0;let f=3;r.isInterleavedBufferAttribute&&(f=r.data.stride);const a=["getX","getY","getZ"],y=e.offset;for(let w=t,A=t+n;w<A;w++){const B=(o?o[w]:w)*3,d=(w-y)*6;let h=B+0,m=B+1,x=B+2;l&&(h=l[h],m=l[m],x=l[x]),c||(h=h*f+u,m=m*f+u,x=x*f+u);for(let S=0;S<3;S++){let P,_,M;c?(P=r[a[S]](h),_=r[a[S]](m),M=r[a[S]](x)):(P=p[h+S],_=p[m+S],M=p[x+S]);let T=P;_<T&&(T=_),M<T&&(T=M);let v=P;_>v&&(v=_),M>v&&(v=M);const b=(v-T)/2,I=S*2;e[d+I+0]=T+b,e[d+I+1]=b+(Math.abs(T)+b)*Yt}}return e}raycastObject3D(t,n,e=[]){const{material:i}=t;if(i===void 0)return;ne.copy(t.matrixWorld).invert(),Ot.copy(n.ray).applyMatrix4(ne),ee.setFromMatrixScale(t.matrixWorld),te.copy(Ot.direction).multiply(ee);const o=te.length(),r=n.near/o,l=n.far/o;if(n.firstHitOnly===!0){let c=this.raycastFirst(Ot,i,r,l);c=Gn(c,t,n),c&&e.push(c)}else{const c=this.raycast(Ot,i,r,l);for(let p=0,u=c.length;p<u;p++){const f=Gn(c[p],t,n);f&&e.push(f)}}return e}refit(t=null){return(this.indirect?as:Qe)(this,t)}raycast(t,n=Vn,e=0,i=1/0){const o=this._roots,r=[],l=this.indirect?fs:ts;for(let c=0,p=o.length;c<p;c++)l(this,c,n,t,r,e,i);return r}raycastFirst(t,n=Vn,e=0,i=1/0){const o=this._roots;let r=null;const l=this.indirect?ps:es;for(let c=0,p=o.length;c<p;c++){const u=l(this,c,n,t,e,i);u!=null&&(r==null||u.distance<r.distance)&&(r=u)}return r}intersectsGeometry(t,n){let e=!1;const i=this._roots,o=this.indirect?ys:ss;for(let r=0,l=i.length;r<l&&(e=o(this,r,t,n),!e);r++);return e}shapecast(t){const n=O.getPrimitive(),e=super.shapecast({...t,intersectsPrimitive:t.intersectsTriangle,scratchPrimitive:n,iterate:this.indirect?Ge:We});return O.releasePrimitive(n),e}bvhcast(t,n,e){let{intersectsRanges:i,intersectsTriangles:o}=e;const r=O.getPrimitive(),l=this.geometry.index,c=this.geometry.attributes.position,p=this.indirect?w=>{const A=this.resolveTriangleIndex(w);D(r,A*3,l,c)}:w=>{D(r,w*3,l,c)},u=O.getPrimitive(),f=t.geometry.index,a=t.geometry.attributes.position,y=t.indirect?w=>{const A=t.resolveTriangleIndex(w);D(u,A*3,f,a)}:w=>{D(u,w*3,f,a)};if(o){if(!(t instanceof Sn))throw new Error('MeshBVH: "intersectsTriangles" callback can only be used with another MeshBVH.');const w=(A,g,B,d,h,m,x,S)=>{for(let P=B,_=B+d;P<_;P++){y(P),u.a.applyMatrix4(n),u.b.applyMatrix4(n),u.c.applyMatrix4(n),u.needsUpdate=!0;for(let M=A,T=A+g;M<T;M++)if(p(M),r.needsUpdate=!0,o(r,u,M,P,h,m,x,S))return!0}return!1};if(i){const A=i;i=function(g,B,d,h,m,x,S,P){return A(g,B,d,h,m,x,S,P)?!0:w(g,B,d,h,m,x,S,P)}}else i=w}return super.bvhcast(t,n,{intersectsRanges:i})}intersectsBox(t,n){return Zt.set(t.min,t.max,n),Zt.needsUpdate=!0,this.shapecast({intersectsBounds:e=>Zt.intersectsBox(e),intersectsTriangle:e=>Zt.intersectsTriangle(e)})}intersectsSphere(t){return this.shapecast({intersectsBounds:n=>t.intersectsBox(n),intersectsTriangle:n=>n.intersectsSphere(t)})}closestPointToGeometry(t,n,e={},i={},o=0,r=1/0){return(this.indirect?ws:ls)(this,t,n,e,i,o,r)}closestPointToPoint(t,n={},e=0,i=1/0){return Xe(this,t,n,e,i)}}export{Ae as A,Ue as B,k as C,W as E,Fe as G,Ps as I,Ts as L,Sn as M,Bs as N,q as O,In as P,Mn as S,Dn as T,V as a,en as b,zn as c,$ as d,R as e,vn as f,Le as g,bs as h,Ee as i,oe as j,Rn as k,X as l,ge as m,Ne as n,Ss as o};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as p}from"./jsx-runtime-DPjLkJKQ.js";import{r as n}from"./index-nmcBqr7Y.js";import"./index-CtzuWnCS.js";import{bi as w,bj as x,bk as E,bl as S,bm as a,ao as f}from"./index-GIL7oGEO.js";import{Object3DDocumentViewport as M}from"./StageHost-BN-IoTef.js";import"./_commonjsHelpers-D6-XlEtG.js";import"./index-D_NuPfjr.js";import"./index-CinJrH5C.js";import"./index-FUuS4qwW.js";import"./client-DNXj_opT.js";import"./three.module-D396a9Mn.js";import"./stage-invalidation-DBg3C3Ta.js";import"./live-gesture-lock-DJbrjOqf.js";import"./viewport-shading-boundary-B_-_gABg.js";import"./clip-planes-CnAI6DZn.js";import"./three-CDSueJyJ.js";import"./viewport-pick-context-DkawXbEi.js";import"./OrbitControls-CM3bPray.js";import"./LineSegments2-CsOpKSiM.js";import"./three.quarks.esm-B1C61jGo.js";import"./scene-framing-Cat0GtyJ.js";import"./source-object3d-authoring-adapter-B-L6Ha6f.js";import"./three-projection-core-BmKMZ-nf.js";import"./editor-presentation-activity-C7SNSmTd.js";import"./standard-viewport-dressing-CzjAe_0A.js";import"./viewport-surface-status-B3om4Kcf.js";function Y({documentId:b,assetPath:o,displayName:u,active:l}){const[g,m]=n.useState(null),[d,c]=n.useState(null);n.useEffect(()=>{if(!l){m(null);return}const i=new AbortController;let s=null;m(null),c(null);const e=w(o);return(e==="glb"||e==="gltf"||e==="spz"?x(o,i.signal):e?E({url:o,format:e}).then(S).then(r=>({root:r,sourceBytes:null})):Promise.reject(new Error(`No native Three.js model loader supports ${o}.`))).then(r=>{if(i.signal.aborted){a(r.root);return}s=r.root,m(r)},r=>{i.signal.aborted||c(r instanceof Error?r.message:String(r))}),()=>{i.abort(),s&&a(s)}},[l,o]);const t=g?.root??null,j=n.useCallback(()=>{if(!t)throw new Error(`Model asset ${o} is not loaded.`);return{root:t,animations:t.animations,dispose(){}}},[o,t]);return d?p.jsx("div",{role:"alert",style:{padding:20,color:f.semantic.danger},children:d}):t?p.jsx(M,{documentId:b,sourcePath:o,displayName:u,build:j,active:l,assetType:"model",modelSource:{kind:"project-file",path:o}}):p.jsxs("div",{style:{padding:20,color:f.content.muted},children:["Loading ",u,"…"]})}export{Y as ModelAssetDocument};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as i}from"./index-nmcBqr7Y.js";import{r as s}from"./project-authoring-session-Bnt6icLr.js";import{V as e}from"./index-GIL7oGEO.js";import"./_commonjsHelpers-D6-XlEtG.js";import"./index-D_NuPfjr.js";import"./edit-mode-authoring-B47TfLqu.js";import"./jsx-runtime-DPjLkJKQ.js";import"./index-CtzuWnCS.js";import"./index-CinJrH5C.js";import"./index-FUuS4qwW.js";import"./client-DNXj_opT.js";import"./three.module-D396a9Mn.js";function E({store:r}){return i.useEffect(()=>{const t=s(r);return t.ready.catch(o=>{e.error(`Authoring session failed: ${o instanceof Error?o.message:String(o)}`,"authoring")}),t.dispose},[r]),null}export{E as ProjectAuthoringBootstrap};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import{ak as N,al as R,C as H,j as k,aX as T,aB as P,aY as w,aZ as C,aA as U,a_ as L,a$ as J,b0 as B,b1 as z,M as D,V}from"./three.module-D396a9Mn.js";const q=/^[og]\s*(.+)?/,W=/^mtllib /,X=/^usemtl /,Y=/^usemap /,S=/\s+/,E=new V,A=new V,G=new V,O=new V,j=new V,_=new H;function Z(){const M={objects:[],object:{},vertices:[],normals:[],colors:[],uvs:[],materials:{},materialLibraries:[],startObject:function(s,e){if(this.object&&this.object.fromDeclaration===!1){this.object.name=s,this.object.fromDeclaration=e!==!1;return}const n=this.object&&typeof this.object.currentMaterial=="function"?this.object.currentMaterial():void 0;if(this.object&&typeof this.object._finalize=="function"&&this.object._finalize(!0),this.object={name:s||"",fromDeclaration:e!==!1,geometry:{vertices:[],normals:[],colors:[],uvs:[],hasUVIndices:!1},materials:[],smooth:!0,startMaterial:function(t,i){const a=this._finalize(!1);a&&(a.inherited||a.groupCount<=0)&&this.materials.splice(a.index,1);const d={index:this.materials.length,name:t||"",mtllib:Array.isArray(i)&&i.length>0?i[i.length-1]:"",smooth:a!==void 0?a.smooth:this.smooth,groupStart:a!==void 0?a.groupEnd:0,groupEnd:-1,groupCount:-1,inherited:!1,clone:function(g){const r={index:typeof g=="number"?g:this.index,name:this.name,mtllib:this.mtllib,smooth:this.smooth,groupStart:0,groupEnd:-1,groupCount:-1,inherited:!1};return r.clone=this.clone.bind(r),r}};return this.materials.push(d),d},currentMaterial:function(){if(this.materials.length>0)return this.materials[this.materials.length-1]},_finalize:function(t){const i=this.currentMaterial();if(i&&i.groupEnd===-1&&(i.groupEnd=this.geometry.vertices.length/3,i.groupCount=i.groupEnd-i.groupStart,i.inherited=!1),t&&this.materials.length>1)for(let a=this.materials.length-1;a>=0;a--)this.materials[a].groupCount<=0&&this.materials.splice(a,1);return t&&this.materials.length===0&&this.materials.push({name:"",smooth:this.smooth}),i}},n&&n.name&&typeof n.clone=="function"){const t=n.clone(0);t.inherited=!0,this.object.materials.push(t)}this.objects.push(this.object)},finalize:function(){this.object&&typeof this.object._finalize=="function"&&this.object._finalize(!0)},parseVertexIndex:function(s,e){const n=parseInt(s,10);return(n>=0?n-1:n+e/3)*3},parseNormalIndex:function(s,e){const n=parseInt(s,10);return(n>=0?n-1:n+e/3)*3},parseUVIndex:function(s,e){const n=parseInt(s,10);return(n>=0?n-1:n+e/2)*2},addVertex:function(s,e,n){const t=this.vertices,i=this.object.geometry.vertices;i.push(t[s+0],t[s+1],t[s+2]),i.push(t[e+0],t[e+1],t[e+2]),i.push(t[n+0],t[n+1],t[n+2])},addVertexPoint:function(s){const e=this.vertices;this.object.geometry.vertices.push(e[s+0],e[s+1],e[s+2])},addVertexLine:function(s){const e=this.vertices;this.object.geometry.vertices.push(e[s+0],e[s+1],e[s+2])},addNormal:function(s,e,n){const t=this.normals,i=this.object.geometry.normals;i.push(t[s+0],t[s+1],t[s+2]),i.push(t[e+0],t[e+1],t[e+2]),i.push(t[n+0],t[n+1],t[n+2])},addFaceNormal:function(s,e,n){const t=this.vertices,i=this.object.geometry.normals;E.fromArray(t,s),A.fromArray(t,e),G.fromArray(t,n),j.subVectors(G,A),O.subVectors(E,A),j.cross(O),j.normalize(),i.push(j.x,j.y,j.z),i.push(j.x,j.y,j.z),i.push(j.x,j.y,j.z)},addColor:function(s,e,n){const t=this.colors,i=this.object.geometry.colors;t[s]!==void 0&&i.push(t[s+0],t[s+1],t[s+2]),t[e]!==void 0&&i.push(t[e+0],t[e+1],t[e+2]),t[n]!==void 0&&i.push(t[n+0],t[n+1],t[n+2])},addUV:function(s,e,n){const t=this.uvs,i=this.object.geometry.uvs;i.push(t[s+0],t[s+1]),i.push(t[e+0],t[e+1]),i.push(t[n+0],t[n+1])},addDefaultUV:function(){const s=this.object.geometry.uvs;s.push(0,0),s.push(0,0),s.push(0,0)},addUVLine:function(s){const e=this.uvs;this.object.geometry.uvs.push(e[s+0],e[s+1])},addFace:function(s,e,n,t,i,a,d,g,r){const h=this.vertices.length;let o=this.parseVertexIndex(s,h),l=this.parseVertexIndex(e,h),u=this.parseVertexIndex(n,h);if(this.addVertex(o,l,u),this.addColor(o,l,u),d!==void 0&&d!==""){const m=this.normals.length;o=this.parseNormalIndex(d,m),l=this.parseNormalIndex(g,m),u=this.parseNormalIndex(r,m),this.addNormal(o,l,u)}else this.addFaceNormal(o,l,u);if(t!==void 0&&t!==""){const m=this.uvs.length;o=this.parseUVIndex(t,m),l=this.parseUVIndex(i,m),u=this.parseUVIndex(a,m),this.addUV(o,l,u),this.object.geometry.hasUVIndices=!0}else this.addDefaultUV()},addPointGeometry:function(s){this.object.geometry.type="Points";const e=this.vertices.length;for(let n=0,t=s.length;n<t;n++){const i=this.parseVertexIndex(s[n],e);this.addVertexPoint(i),this.addColor(i)}},addLineGeometry:function(s,e){this.object.geometry.type="Line";const n=this.vertices.length,t=this.uvs.length;for(let i=0,a=s.length;i<a;i++)this.addVertexLine(this.parseVertexIndex(s[i],n));for(let i=0,a=e.length;i<a;i++)this.addUVLine(this.parseUVIndex(e[i],t))}};return M.startObject("",!1),M}class K extends N{constructor(s){super(s),this.materials=null}load(s,e,n,t){const i=this,a=new R(this.manager);a.setPath(this.path),a.setRequestHeader(this.requestHeader),a.setWithCredentials(this.withCredentials),a.load(s,function(d){try{e(i.parse(d))}catch(g){t?t(g):console.error(g),i.manager.itemError(s)}},n,t)}setMaterials(s){return this.materials=s,this}parse(s){const e=new Z;s.indexOf(`\r
|
|
2
|
+
`)!==-1&&(s=s.replace(/\r\n/g,`
|
|
3
|
+
`)),s.indexOf(`\\
|
|
4
|
+
`)!==-1&&(s=s.replace(/\\\n/g,""));const n=s.split(`
|
|
5
|
+
`);let t=[];for(let d=0,g=n.length;d<g;d++){const r=n[d].trimStart();if(r.length===0)continue;const h=r.charAt(0);if(h!=="#")if(h==="v"){const o=r.split(S);switch(o[0]){case"v":e.vertices.push(parseFloat(o[1]),parseFloat(o[2]),parseFloat(o[3])),o.length>=7?(_.setRGB(parseFloat(o[4]),parseFloat(o[5]),parseFloat(o[6]),k),e.colors.push(_.r,_.g,_.b)):e.colors.push(void 0,void 0,void 0);break;case"vn":e.normals.push(parseFloat(o[1]),parseFloat(o[2]),parseFloat(o[3]));break;case"vt":e.uvs.push(parseFloat(o[1]),parseFloat(o[2]));break}}else if(h==="f"){const l=r.slice(1).trim().split(S),u=[];for(let c=0,p=l.length;c<p;c++){const b=l[c];if(b.length>0){const v=b.split("/");u.push(v)}}const m=u[0];for(let c=1,p=u.length-1;c<p;c++){const b=u[c],v=u[c+1];e.addFace(m[0],b[0],v[0],m[1],b[1],v[1],m[2],b[2],v[2])}}else if(h==="l"){const o=r.substring(1).trim().split(" ");let l=[];const u=[];if(r.indexOf("/")===-1)l=o;else for(let m=0,c=o.length;m<c;m++){const p=o[m].split("/");p[0]!==""&&l.push(p[0]),p[1]!==""&&u.push(p[1])}e.addLineGeometry(l,u)}else if(h==="p"){const l=r.slice(1).trim().split(" ");e.addPointGeometry(l)}else if((t=q.exec(r))!==null){const o=(" "+t[0].slice(1).trim()).slice(1);e.startObject(o)}else if(X.test(r))e.object.startMaterial(r.substring(7).trim(),e.materialLibraries);else if(W.test(r))e.materialLibraries.push(r.substring(7).trim());else if(Y.test(r))console.warn('THREE.OBJLoader: Rendering identifier "usemap" not supported. Textures must be defined in MTL files.');else if(h==="s"){if(t=r.split(" "),t.length>1){const l=t[1].trim().toLowerCase();e.object.smooth=l!=="0"&&l!=="off"}else e.object.smooth=!0;const o=e.object.currentMaterial();o&&(o.smooth=e.object.smooth)}else{if(r==="\0")continue;console.warn('THREE.OBJLoader: Unexpected line: "'+r+'"')}}e.finalize();const i=new T;if(i.materialLibraries=[].concat(e.materialLibraries),!(e.objects.length===1&&e.objects[0].geometry.vertices.length===0)===!0)for(let d=0,g=e.objects.length;d<g;d++){const r=e.objects[d],h=r.geometry,o=r.materials,l=h.type==="Line",u=h.type==="Points";let m=!1;if(h.vertices.length===0)continue;const c=new P;c.setAttribute("position",new w(h.vertices,3)),h.normals.length>0&&c.setAttribute("normal",new w(h.normals,3)),h.colors.length>0&&(m=!0,c.setAttribute("color",new w(h.colors,3))),h.hasUVIndices===!0&&c.setAttribute("uv",new w(h.uvs,2));const p=[];for(let v=0,I=o.length;v<I;v++){const y=o[v],F=y.name+"_"+y.smooth+"_"+m;let f=e.materials[F];if(this.materials!==null){if(f=this.materials.create(y.name),l&&f&&!(f instanceof C)){const x=new C;U.prototype.copy.call(x,f),x.color.copy(f.color),f=x}else if(u&&f&&!(f instanceof L)){const x=new L({size:10,sizeAttenuation:!1});U.prototype.copy.call(x,f),x.color.copy(f.color),x.map=f.map,f=x}}f===void 0&&(l?f=new C:u?f=new L({size:1,sizeAttenuation:!1}):f=new J,f.name=y.name,f.flatShading=!y.smooth,f.vertexColors=m,e.materials[F]=f),p.push(f)}let b;if(p.length>1){for(let v=0,I=o.length;v<I;v++){const y=o[v];c.addGroup(y.groupStart,y.groupCount,v)}l?b=new B(c,p):u?b=new z(c,p):b=new D(c,p)}else l?b=new B(c,p[0]):u?b=new z(c,p[0]):b=new D(c,p[0]);b.name=r.name,i.add(b)}else if(e.vertices.length>0){const d=new L({size:1,sizeAttenuation:!1}),g=new P;g.setAttribute("position",new w(e.vertices,3)),e.colors.length>0&&e.colors[0]!==void 0&&(g.setAttribute("color",new w(e.colors,3)),d.vertexColors=!0);const r=new z(g,d);i.add(r)}return i}}export{K as OBJLoader};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/StageHost-BN-IoTef.js","assets/index-GIL7oGEO.js","assets/index-nmcBqr7Y.js","assets/_commonjsHelpers-D6-XlEtG.js","assets/index-D_NuPfjr.js","assets/jsx-runtime-DPjLkJKQ.js","assets/index-CtzuWnCS.js","assets/index-CinJrH5C.js","assets/index-FUuS4qwW.js","assets/client-DNXj_opT.js","assets/three.module-D396a9Mn.js","assets/index-D2fNXpHa.css","assets/stage-invalidation-DBg3C3Ta.js","assets/live-gesture-lock-DJbrjOqf.js","assets/viewport-shading-boundary-B_-_gABg.js","assets/clip-planes-CnAI6DZn.js","assets/three-CDSueJyJ.js","assets/viewport-pick-context-DkawXbEi.js","assets/OrbitControls-CM3bPray.js","assets/LineSegments2-CsOpKSiM.js","assets/three.quarks.esm-B1C61jGo.js","assets/scene-framing-Cat0GtyJ.js","assets/source-object3d-authoring-adapter-B-L6Ha6f.js","assets/three-projection-core-BmKMZ-nf.js","assets/editor-presentation-activity-C7SNSmTd.js","assets/standard-viewport-dressing-CzjAe_0A.js","assets/viewport-surface-status-B3om4Kcf.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{_ as r,an as a}from"./index-GIL7oGEO.js";import{a as e}from"./jsx-runtime-DPjLkJKQ.js";import{r as o}from"./index-nmcBqr7Y.js";import{V as c,O as u}from"./viewport-surface-status-B3om4Kcf.js";const s=o.lazy(async()=>({default:(await r(()=>import("./StageHost-BN-IoTef.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26]))).Object3DDocumentViewport}));function l(t){return i(t.documentId,t.chromeless),e.jsx(o.Suspense,{fallback:e.jsx(c,{testId:"object3d-document-loading",children:u}),children:e.jsx(s,{...t})})}function i(t,n=!1){o.useEffect(()=>{if(!n)return a(t)},[t,n])}export{l as O};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/spark.module-4pXQoz5d.js","assets/three.module-D396a9Mn.js","assets/index-GIL7oGEO.js","assets/index-nmcBqr7Y.js","assets/_commonjsHelpers-D6-XlEtG.js","assets/index-D_NuPfjr.js","assets/jsx-runtime-DPjLkJKQ.js","assets/index-CtzuWnCS.js","assets/index-CinJrH5C.js","assets/index-FUuS4qwW.js","assets/client-DNXj_opT.js","assets/index-D2fNXpHa.css"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{eV as te,ao as A,eW as re,bi as ne,eX as ie,bk as oe,bl as se,bm as Y,eY as ae,_ as le,eZ as ce,e_ as de,e$ as pe}from"./index-GIL7oGEO.js";import{a as E}from"./jsx-runtime-DPjLkJKQ.js";import{r as C}from"./index-nmcBqr7Y.js";import"./index-CtzuWnCS.js";import{W as me,w as ue,x as fe,j as we,v as be,bF as he,D as ge,G as ve,aE as xe,S as ye,V as Ae,A as Ee}from"./three.module-D396a9Mn.js";import{OrbitControls as Ce}from"./OrbitControls-CM3bPray.js";import{s as Me,i as P}from"./editor-presentation-activity-C7SNSmTd.js";import"./index-FUuS4qwW.js";import"./client-DNXj_opT.js";import"./_commonjsHelpers-D6-XlEtG.js";import"./index-D_NuPfjr.js";import"./index-CinJrH5C.js";const v={webglContext:0,animationFrame:0,resizeObserver:0,objectUrl:0},Z={...v};function _(r){v[r]++,Z[r]=Math.max(Z[r],v[r]);let s=!1;return()=>{s||(s=!0,v[r]=Math.max(0,v[r]-1))}}function Se(r){const s=r.animations[0];if(!s)return null;const m=new Ee(r),b=m.clipAction(s).play();return b.paused=!0,m.update(0),m}let je=0;function $e({assetPath:r,materialPath:s,displayName:m="Object3D preview",active:b=!0,sourceFactory:M,showSkeleton:D=!1,background:z,cameraDirection:S,showGrid:H=!0,useDefaultLighting:k=!0,exposure:L=1,setupPreview:T}){const W=C.useRef(null),[j,V]=C.useState(null),[$,R]=C.useState(!0);return C.useEffect(()=>{if(!b)return;const o=W.current;if(!o)return;const x=new AbortController,J=te({id:`preview-card:${++je}`,label:`${m} (preview card)`,contentClock:()=>0}),t=new me({antialias:!0,alpha:!0}),K=_("webglContext"),N=_("animationFrame"),Q=_("resizeObserver"),a=new ue,u=new fe(35,1,.01,1e3),f=new Ce(u,t.domElement),q=new xe;let G=null,w=null,y=null,c,l=null,h=null;const F=[];let d=0,p=!1;if(V(null),R(!0),t.outputColorSpace=we,t.toneMapping=be,t.toneMappingExposure=L,t.shadowMap.enabled=!0,t.setClearColor(z??2106410,1),t.setPixelRatio(Math.min(window.devicePixelRatio,2)),t.domElement.style.width="100%",t.domElement.style.height="100%",t.domElement.style.display="block",o.appendChild(t.domElement),f.enableDamping=!0,f.dampingFactor=.1,k){a.add(new he(16777215,3489874,1.8));const e=new ge(16777215,2.2);e.position.set(3,5,4),a.add(e)}if(H){const e=new ve(10,20,5333103,3423044);a.add(e),F.push(e)}const I=(e,n)=>{if(!h)return;const i=S?new Ae(...S):void 0,g=de(h,Math.max(e,1)/Math.max(n,1),i);u.copy(g,!1),f.target.copy(h.center),f.update()},U=async e=>{if(p)return;a.add(e);let n=!1;if(e.traverse(i=>{ae(i,"gaussianSplat")&&(n=!0)}),n){const{SparkRenderer:i}=await le(async()=>{const{SparkRenderer:g}=await import("./spark.module-4pXQoz5d.js");return{SparkRenderer:g}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11]));if(p)return;l=new i({renderer:t,enableLod:!1})}if(h=ce(e,"perspective"),I(o.clientWidth,o.clientHeight),G=Se(e),D){const i=new ye(e);i.name="__compact_preview_skeleton",a.add(i),F.push(i)}c=T?.({scene:a,camera:u,renderer:t,model:e}),c?.resize?.(Math.max(o.clientWidth,1),Math.max(o.clientHeight,1),t.getPixelRatio()),R(!1)};(async()=>{try{if(M){y=re(M),await U(y.root);return}if(!r)throw new Error("Compact Object3D preview has no source.");const e=ne(r);if(!e)throw new Error(`No native Three.js loader supports ${r}.`);const n=e==="glb"||e==="gltf"||e==="spz"?await ie(r,x.signal):await oe({url:r,format:e,...s?{materialUrl:s}:{}});if(w=se(n),x.signal.aborted||p){Y(w),w=null;return}await U(w)}catch(e){!x.signal.aborted&&!p&&(V(e instanceof Error?e.message:String(e)),R(!1))}})();const B=()=>{const e=Math.max(o.clientWidth,1),n=Math.max(o.clientHeight,1);t.setSize(e,n,!1),h&&!c?I(e,n):(u.aspect=e/n,u.updateProjectionMatrix()),c?.resize?.(e,n,t.getPixelRatio())},X=new ResizeObserver(B);X.observe(o),B();const O=()=>{if(d=0,p||!P())return;const e=Math.min(q.getDelta(),.1);f.update(),l&&a.add(l);try{c?.render?c.render(e):t.render(a,u)}finally{l?.removeFromParent()}d=requestAnimationFrame(O)},ee=Me(()=>{P()?!p&&d===0&&(q.getDelta(),O()):(cancelAnimationFrame(d),d=0)});return P()&&(d=requestAnimationFrame(O)),()=>{p=!0,ee(),J(),x.abort(new Error("Compact Object3D preview closed.")),cancelAnimationFrame(d),X.disconnect(),G?.stopAllAction(),c?.dispose(),f.dispose(),l&&(l.removeFromParent(),pe(l),l=null),t.dispose(),t.forceContextLoss();for(const e of F){const n=e;n.geometry?.dispose();const i=n.material;if(Array.isArray(i))for(const g of i)g.dispose();else i?.dispose()}y&&y.dispose(),w&&Y(w),o.contains(t.domElement)&&o.removeChild(t.domElement),Q(),N(),K()}},[b,r,z,S,L,s,T,H,D,M,k]),E.jsxs("div",{ref:W,"data-testid":"object3d-compact-preview",role:"region","aria-label":`Interactive 3D preview: ${m}`,"aria-busy":$,style:{width:"100%",height:"100%",minHeight:220,overflow:"hidden",position:"relative",background:A.surface.inset},children:[$&&!j?E.jsx("span",{style:{position:"absolute",padding:10,color:A.content.muted},children:"Loading…"}):null,b?null:E.jsx("span",{style:{position:"absolute",padding:10,color:A.content.muted},children:"Preview suspended while inactive."}),j?E.jsx("div",{role:"alert",style:{position:"absolute",padding:10,color:A.semantic.danger},children:j}):null]})}export{$e as Object3DPreview};
|