@volter/game-editor 0.5.65 → 0.5.66
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 +1962 -363
- package/catalog/entries/bake.json +0 -1
- package/catalog/entries/blender.json +2 -2
- package/catalog/entries/reflections.json +2 -4
- package/catalog/project-source/src/lib/bake/asset-seed.ts +1 -2
- package/catalog/project-source/src/lib/bake/clip-layering.ts +3 -4
- package/catalog/project-source/src/lib/bake/gltf-bake.ts +1 -1
- package/catalog/project-source/src/lib/bake/params.ts +3 -5
- package/catalog/project-source/src/lib/bake/rest-relative-animation.ts +2 -3
- package/dist/.vite/manifest.json +2406 -2182
- package/dist/assets/{AssetBudgetPanel-J9--TZPU.js → AssetBudgetPanel-csYWK2H4.js} +8 -8
- package/dist/assets/{AudioViewer-CR7333fe.js → AudioViewer-BH_LUYs5.js} +1 -1
- package/dist/assets/{BVHLoader-6bQIXhMX.js → BVHLoader-Jkzh8hMf.js} +1 -1
- package/dist/assets/BufferGeometryUtils-CAbuTPOA.js +1 -0
- package/dist/assets/{CCDIKSolver-CD7vLpsK.js → CCDIKSolver-D4NvkJ8d.js} +1 -1
- package/dist/assets/{CSS3DRenderer-CL7ABLVK.js → CSS3DRenderer-CAS2WZZy.js} +1 -1
- package/dist/assets/CanvasSceneViewport-BlsRTk-X.js +1 -0
- package/dist/assets/ColladaLoader-DxYB89DA.js +3 -0
- package/dist/assets/{ColorInput-DQBNrW-K.js → ColorInput-CPQNsDf1.js} +1 -1
- package/dist/assets/{ConvexGeometry-CAzXlPVG.js → ConvexGeometry-Dinf-sev.js} +1 -1
- package/dist/assets/{ConvexHull-BINCESFp.js → ConvexHull-CrJ8FY-w.js} +1 -1
- package/dist/assets/{DecalGeometry-160KRdfg.js → DecalGeometry-owkbefLa.js} +1 -1
- package/dist/assets/EffectComposer-BHDH-NLz.js +1 -0
- package/dist/assets/EntityModelDocument-DuQivdvc.js +1 -0
- package/dist/assets/EnvironmentAssetDocument-CnTEMn3A.js +1 -0
- package/dist/assets/FBXLoader-BMUbIhtE.js +1 -0
- package/dist/assets/Fbo-DrK7CWlB.js +1 -0
- package/dist/assets/{FontLoader-CvGoVI5a.js → FontLoader-BR_K6Baw.js} +2 -2
- package/dist/assets/GLTFExporter-BZqAQJbw.js +1 -0
- package/dist/assets/{GameplaySessionTimeline-B52W3FVZ.js → GameplaySessionTimeline-Crqwv2fP.js} +1 -1
- package/dist/assets/Gltf-7cVbZUzT.js +2 -0
- package/dist/assets/ImageViewer-BkFie7Hm.js +1 -0
- package/dist/assets/InspectorObjectPreview-Dl3tyJBn.js +1 -0
- package/dist/assets/JsonAssetDocument-BUFzubHM.js +2 -0
- package/dist/assets/{LineSegments2-CsOpKSiM.js → LineSegments2-Cicm_Hu1.js} +2 -2
- package/dist/assets/LiveModuleDocument-C3OQxiba.js +1 -0
- package/dist/assets/LutAssetDocument-DVzd1RZ9.js +1 -0
- package/dist/assets/{MTLLoader-_Xzd4_0p.js → MTLLoader-Bg_grNiT.js} +2 -2
- package/dist/assets/{MarchingCubes-Bsp4wrzd.js → MarchingCubes-a78AL3HB.js} +1 -1
- package/dist/assets/MeshBVH-BCSLNEeP.js +1 -0
- package/dist/assets/ModelAssetDocument-pN84goRT.js +1 -0
- package/dist/assets/{NonThreeAuthoringBootstrap-C3woOMxX.js → NonThreeAuthoringBootstrap-BKNejRiW.js} +1 -1
- package/dist/assets/{OBJLoader-BhIC6Hwo.js → OBJLoader-BiwzVj5b.js} +2 -2
- package/dist/assets/Object3DDocumentToolbar-D5Bg5FEf.js +1 -0
- package/dist/assets/Object3DDocumentViewport-DFHqru3a.js +2 -0
- package/dist/assets/Object3DPreview-BTtZ-41z.js +2 -0
- package/dist/assets/OnlineAssetDetail-BAqozdAp.js +1 -0
- package/dist/assets/{OrbitControls-DLpayAaK.js → OrbitControls-CzKVCORl.js} +1 -1
- package/dist/assets/{OrbitControls-CM3bPray.js → OrbitControls-CzTRRI7x.js} +1 -1
- package/dist/assets/{OrthographicCamera-bQozawrh.js → OrthographicCamera-CSDDsvu7.js} +1 -1
- package/dist/assets/{PLYLoader-DYQqs5Ik.js → PLYLoader-QxrxxMpE.js} +2 -2
- package/dist/assets/{PerspectiveCamera-CQ2lh01o.js → PerspectiveCamera-DzD_NfVh.js} +1 -1
- package/dist/assets/PlayBar-qVJpgwJt.js +2 -0
- package/dist/assets/QuarksAssetDocument-B4vBlUsS.js +2 -0
- package/dist/assets/RGBELoader-WQ7xZofE.js +1 -0
- package/dist/assets/RectAreaLightUniformsLib-CwcuoVqt.js +1 -0
- package/dist/assets/{RenderPass-DPrn-Uky.js → RenderPass-C_CeQNdh.js} +1 -1
- package/dist/assets/{ResolutionPicker-C67vs1F3.js → ResolutionPicker-DpHVJxn5.js} +1 -1
- package/dist/assets/RootSelectionOverlay-BxvsunO4.js +1 -0
- package/dist/assets/{RoundedBox-BDGBg6QZ.js → RoundedBox-B_cZ0NFy.js} +1 -1
- package/dist/assets/{RoundedBoxGeometry-CyUuYPfW.js → RoundedBoxGeometry-Y4rcSIvX.js} +1 -1
- package/dist/assets/STLLoader-Bej_Nkpr.js +1 -0
- package/dist/assets/{SelectionBox-D_75KrNW.js → SelectionBox-Cn9vm7f9.js} +1 -1
- package/dist/assets/ShaderAssetDocument-Dx2x8CLr.js +12 -0
- package/dist/assets/{ShaderPass-QYRpPuFJ.js → ShaderPass-qtkA7CQ8.js} +1 -1
- package/dist/assets/{ShadowEditor-DkImwu1Y.js → ShadowEditor-BEIUkrHL.js} +1 -1
- package/dist/assets/SimplifyModifier-D2EesGr2.js +1 -0
- package/dist/assets/{SkeletonUtils-Cps8GOC6.js → SkeletonUtils-C8ayciDc.js} +1 -1
- package/dist/assets/{Sky-CQKCgYDs.js → Sky-BBpnAJZV.js} +1 -1
- package/dist/assets/SourceAssetViewer-BpMbbuy6.js +1 -0
- package/dist/assets/StageHost-lB8f---y.js +2 -0
- package/dist/assets/{StoryPreviewMount-DjyxRCXu.js → StoryPreviewMount-BIfxmkYh.js} +1 -1
- package/dist/assets/{TDSLoader-D_T8XJ81.js → TDSLoader-rHl5Uwc0.js} +1 -1
- package/dist/assets/{TextGeometry-DOWAEUV0.js → TextGeometry-BRHSufuM.js} +1 -1
- package/dist/assets/ThreeBoardDocument-BHV92Ia3.js +2 -0
- package/dist/assets/{ThreeIsolationSceneContent-C8C8whSF.js → ThreeIsolationSceneContent-BqtgDHBK.js} +1 -1
- package/dist/assets/{ToolObject3DPreview-BRoDWe4Q.js → ToolObject3DPreview-CcaPJTyH.js} +1 -1
- package/dist/assets/Toolbar-keHcSvDD.js +1 -0
- package/dist/assets/{TrackballControls-DfznuQTh.js → TrackballControls-Cce-6Ff5.js} +1 -1
- package/dist/assets/{TransientHint-BB1fwrvK.js → TransientHint-Dlslh3oX.js} +1 -1
- package/dist/assets/{UnrealBloomPass-CR-cS_K5.js → UnrealBloomPass-DiseEiFK.js} +2 -2
- package/dist/assets/{VideoViewer-C6kocgIU.js → VideoViewer-naGSXHd6.js} +1 -1
- package/dist/assets/ViewportShadingMenu-C7Hdhtca.js +1 -0
- package/dist/assets/{active-ingest-CT6jSGhr.js → active-ingest-DEgq9JiA.js} +3 -3
- package/dist/assets/{animation-clock-CnjZqfJp.js → animation-clock-lTIb6nk3.js} +1 -1
- package/dist/assets/animation-mixers.service-2O2rVwQf.js +1 -0
- package/dist/assets/asset-budget-asset.menu-9NhdHAC9.js +1 -0
- package/dist/assets/asset-budget.action-yg6-luUJ.js +1 -0
- package/dist/assets/asset-budget.document-B46_VFqa.js +1 -0
- package/dist/assets/asset-budget.menu-DuH07N-e.js +1 -0
- package/dist/assets/{asset-editor-persistence-BBaONOJt.js → asset-editor-persistence-BVtzjadu.js} +1 -1
- package/dist/assets/{asset-loaders-BOy5Ss8k.js → asset-loaders-BxG1LykH.js} +2 -2
- package/dist/assets/{assets-BuSoGjBX.js → assets-Do88ZdV_.js} +1 -1
- package/dist/assets/{audio-unlock.service-CfUgUQVy.js → audio-unlock.service-BJH0mWvX.js} +1 -1
- package/dist/assets/{audio.utility-C6K6jem8.js → audio.utility-Cp4aVYFU.js} +1 -1
- package/dist/assets/autoplay.service-FxpRy7Ev.js +1 -0
- package/dist/assets/{babylon-authoring-adapter-CL02gWDn.js → babylon-authoring-adapter-B_8iE8fK.js} +1 -1
- package/dist/assets/{binding-resolver-Dsh-6Vor.js → binding-resolver-BWwG10zJ.js} +2 -2
- package/dist/assets/blender-emscripten-engine-CEsWgnR7.js +2 -0
- package/dist/assets/{blender-node-editor.document-iIDkB9sI.js → blender-node-editor.document-DTgwy8KC.js} +1 -1
- package/dist/assets/blender-properties-tab-DWSJpkxq.js +3 -0
- package/dist/assets/blender-runtime-host-OGjPjTrG.js +4 -0
- package/dist/assets/{blender-runtime-skin-DyQ9B6CR.js → blender-runtime-skin-DymtXlpt.js} +37 -39
- package/dist/assets/blender-runtime.document-CzH2ohHR.js +8 -0
- package/dist/assets/{blender-timeline.document-77fx96N7.js → blender-timeline.document-BRy_QPHt.js} +1 -1
- package/dist/assets/{blender-uv-editor.document-fsT7B4gV.js → blender-uv-editor.document-D-AbUCqz.js} +1 -1
- package/dist/assets/{blender-version.status-o6dBm3n6.js → blender-version.status-B7flzX_7.js} +1 -1
- package/dist/assets/{blender-wali-engine-wTOcrOMC.js → blender-wali-engine-D3iKpzn9.js} +1 -1
- package/dist/assets/blender.command-BVHtgTQy.js +1 -0
- package/dist/assets/blender.environment-CG-pC7sk.js +1 -0
- package/dist/assets/{blender.style-Dcem5f_T.js → blender.style-CxfbTFcE.js} +1 -1
- package/dist/assets/{board-guides-DziKSTss.js → board-guides-C3usUZZk.js} +1 -1
- package/dist/assets/body-marks-D8iaje6y.js +1 -0
- package/dist/assets/bridge.command-BF9u6r0A.js +3 -0
- package/dist/assets/browserAll-38aBu-cf.js +1 -0
- package/dist/assets/{build-profiles.document-kW8iw8Xj.js → build-profiles.document-DO7oNRuo.js} +2 -2
- package/dist/assets/{build-progress.status-BNRLytg2.js → build-progress.status-COeNVhYd.js} +1 -1
- package/dist/assets/{build-session-C_sg3CEn.js → build-session-IWIriS5P.js} +1 -1
- package/dist/assets/{build.action-lYjTLb7K.js → build.action-DlkFvZf6.js} +1 -1
- package/dist/assets/{build.command-DIGgUPU_.js → build.command-DPqQIYj_.js} +1 -1
- package/dist/assets/{build.header-CKajx5U3.js → build.header-CNLG-pV8.js} +1 -1
- package/dist/assets/{build.menu-BdU0QXny.js → build.menu-hUlH6loi.js} +1 -1
- package/dist/assets/{build.service-CbBAyeu3.js → build.service-C86Td3_9.js} +1 -1
- package/dist/assets/{camera-KEsKvOL7.js → camera-CKbyBXMe.js} +1 -1
- package/dist/assets/camera-authoring-Ci3KnE-W.js +1 -0
- package/dist/assets/{camera-runtime.inspector-B7unX4g1.js → camera-runtime.inspector-DdR3P2BF.js} +1 -1
- package/dist/assets/canvas-entry-runtime-E5YjSgre.js +2 -0
- package/dist/assets/canvas-preview-frames-CiAx7dpV.js +1 -0
- package/dist/assets/{capability-coverage-Czas4C18.js → capability-coverage-CfUeULDN.js} +5 -5
- package/dist/assets/city-EkhAOo5s.exr +0 -0
- package/dist/assets/{collaboration-presence-DLoZ7EA3.js → collaboration-presence-CSLFNT7m.js} +1 -1
- package/dist/assets/{collider-Bw0mXlsW.js → collider-DRSaLRM9.js} +1 -1
- package/dist/assets/{component-board.service-DCwcUssB.js → component-board.service-B7Sv8b7m.js} +2 -2
- package/dist/assets/component-board.service-B8UHw8dn.js +2 -0
- package/dist/assets/component-contracts.service-LFGekycZ.js +1 -0
- package/dist/assets/{component-verbs.command-7xzfjGMZ.js → component-verbs.command-D4SvFjfG.js} +1 -1
- package/dist/assets/component-verbs.service-TGvWxf2b.js +1 -0
- package/dist/assets/{config-CEZk921y.js → config-DB_RH-hO.js} +3 -3
- package/dist/assets/{configurations-DTBMdaTL.js → configurations-C2qgJNnW.js} +1 -1
- package/dist/assets/{connection.status-BifnQdOs.js → connection.status-CG7X2brL.js} +1 -1
- package/dist/assets/{console-bridge-CHcb-xk5.js → console-bridge-B5Ltae37.js} +1 -1
- package/dist/assets/{constraint-De8f1Uiq.js → constraint-C_Jj7dXy.js} +1 -1
- package/dist/assets/constraints.inspector-D6QZJS4b.js +1 -0
- package/dist/assets/courtyard-DqlebbpC.exr +0 -0
- package/dist/assets/coverage.service-Clo86874.js +3 -0
- package/dist/assets/{create-runtime-CVCc1BDx.js → create-runtime-lmA910XT.js} +1 -1
- package/dist/assets/{curve-7Q79VgU4.js → curve-6-TR6dNb.js} +1 -1
- package/dist/assets/{data-asset-4hjS642k.js → data-asset-BNbd309U.js} +1 -1
- package/dist/assets/{data-ref-CQI28C0D.js → data-ref-Dvmd7eb1.js} +1 -1
- package/dist/assets/{debug-bridge-CCohG-d-.js → debug-bridge-BUNhgyY6.js} +1 -1
- package/dist/assets/{debug-registry-Dgvitx8M.js → debug-registry-B3Cnne3x.js} +1 -1
- package/dist/assets/deferred-ingest-play-7V8OrW3e.js +2 -0
- package/dist/assets/design-time-layers-g9VS6amb.js +1 -0
- package/dist/assets/design-time-mount.service-HtMr_vBd.js +2 -0
- package/dist/assets/design-time-react-mount-Dx6fJ-Hg.js +1 -0
- package/dist/assets/{directional-shadow-fit-BVkOKAv2.js → directional-shadow-fit-Cjz_Eg2b.js} +1 -1
- package/dist/assets/{document-preview-three-Kbg2GCLm.js → document-preview-three-C3y0syYQ.js} +1 -1
- package/dist/assets/{dom-authoring-adapter-CY8C7f4T.js → dom-authoring-adapter-CEeFyatF.js} +1 -1
- package/dist/assets/{draco3d-BBUTcNkz.js → draco3d-FKy0apkb.js} +1 -1
- package/dist/assets/drei-asset-caches-jJoHXbTj.js +2 -0
- package/dist/assets/{edit-mode-audio.service-Bzetwd5B.js → edit-mode-audio.service-DZTnrW6t.js} +1 -1
- package/dist/assets/edit-mode-authoring-D_BiHCQj.js +1 -0
- package/dist/assets/{edit-mode-networking.service-YCX6RRb_.js → edit-mode-networking.service-BzMI2VxO.js} +1 -1
- package/dist/assets/editor-api-Bzmo0o8_.js +1 -0
- package/dist/assets/{entry-adjudication-Cq8Yeb74.js → entry-adjudication-BYy7TXOB.js} +1 -1
- package/dist/assets/{events-156d8d12.esm-ErOhDXXB.js → events-156d8d12.esm-C734MYnx.js} +7 -7
- package/dist/assets/{extend-B-eOccUm.js → extend-CLG0ymiX.js} +1 -1
- package/dist/assets/forest-P_CQY3b_.exr +0 -0
- package/dist/assets/fork-menu-De7HU6_H.js +1 -0
- package/dist/assets/{frame-debugger-store-D1Mf_5up.js → frame-debugger-store-BZgIOlU6.js} +1 -1
- package/dist/assets/{game-DHOZVb-7.js → game-D5EJoILQ.js} +1 -1
- package/dist/assets/{game-contract-seams-a5YXejOu.js → game-contract-seams-TCpIMmHP.js} +1 -1
- package/dist/assets/{game-css-scope-transform-Eng4wS8E.js → game-css-scope-transform-NbpajQr-.js} +1 -1
- package/dist/assets/game-document.service-6eRlrI-d.js +1 -0
- package/dist/assets/game-eval.command-hKnSMlX0.js +2 -0
- package/dist/assets/{game-input-seams-CIQdetRw.js → game-input-seams-BC6xhZy3.js} +1 -1
- package/dist/assets/{game-module-access-B2mFxv-i.js → game-module-access-ry3xb1Ix.js} +1 -1
- package/dist/assets/{gameplay-export-BoKXm51x.js → gameplay-export-DiLQuPpn.js} +1 -1
- package/dist/assets/gameplay-replay-Bsre-1K8.js +1 -0
- package/dist/assets/{gameplay-rng-trap-CTNhm-UW.js → gameplay-rng-trap-BhRx_CtU.js} +1 -1
- package/dist/assets/gameplay.command-BqiyGn-I.js +1 -0
- package/dist/assets/{generation-jobs-BQrXbGp_.js → generation-jobs-BYcpgeGk.js} +1 -1
- package/dist/assets/generation.service-O81IqA-6.js +1 -0
- package/dist/assets/{generations-DzUogZsM.js → generations-CsGQ3twi.js} +1 -1
- package/dist/assets/{generations.status-CgOUBCum.js → generations.status-C3YU0_ml.js} +1 -1
- package/dist/assets/godot.style-DxJaFWOP.js +1 -0
- package/dist/assets/godot.view-BFsHk8b2.js +1 -0
- package/dist/assets/{hosted-asset-materialization-CiIvWkGU.js → hosted-asset-materialization-Bk-plQF6.js} +2 -2
- package/dist/assets/{ibl-override-material-BlmCxFKq.js → ibl-override-material-BhbGwgS1.js} +1 -1
- package/dist/assets/{index-mjWQmGhM.js → index-0n9eSzwT.js} +1 -1
- package/dist/assets/index-B4bmKkgY.css +1 -0
- package/dist/assets/index-BLo2LE8C.js +3404 -0
- package/dist/assets/index-BWW4-DBH.js +1 -0
- package/dist/assets/index-CLcsjKUs.js +1 -0
- package/dist/assets/index-CU5YUq-x.js +134 -0
- package/dist/assets/{index-DUpHH6JR.js → index-Cb6o_Td_.js} +1 -1
- package/dist/assets/index-Ckxb31Yz.js +1500 -0
- package/dist/assets/index-CnpsJMao.js +1 -0
- package/dist/assets/index-Cr23XhNm.js +1 -0
- package/dist/assets/index-DO1rWQ_r.js +487 -0
- package/dist/assets/{index-BcCBqgM_.js → index-DUh02lTr.js} +1 -1
- package/dist/assets/index-DXEHfb0b.js +1 -0
- package/dist/assets/{index-V1R-e5Bd.js → index-wRCvCebM.js} +1 -1
- package/dist/assets/{inference-diagnostics-Dhmtfbq_.js → inference-diagnostics-YW0yJkKx.js} +1 -1
- package/dist/assets/{ingest-BbYMC2vQ.js → ingest-BlQnR7s3.js} +1 -1
- package/dist/assets/ingest-boot-viewport-uG9jQ1zm.js +1 -0
- package/dist/assets/ingest-siblings-DRQXSWax.js +1 -0
- package/dist/assets/{ingest-source-persistence-C_6Hiyra.js → ingest-source-persistence-DH6ioCOu.js} +1 -1
- package/dist/assets/{ingest.service-BTDnQfM1.js → ingest.service-GeaWMaZX.js} +1 -1
- package/dist/assets/{input-manager-DH_hGW6d.js → input-manager-Cxx3RJgG.js} +1 -1
- package/dist/assets/{input-router-BNQvtIqw.js → input-router-FzxO5ld6.js} +1 -1
- package/dist/assets/{inspect-BZfi3mmo.js → inspect-BRgDdtVk.js} +1 -1
- package/dist/assets/instances.command-CFOMPSj3.js +1 -0
- package/dist/assets/{instruments-CKR02Y8I.js → instruments-IKn-vvNb.js} +1 -1
- package/dist/assets/interior-Bo_lba15.exr +0 -0
- package/dist/assets/{json-history-resource-BbxllWfV.js → json-history-resource-r-9q_hxP.js} +1 -1
- package/dist/assets/{light-D-_wsKTq.js → light-CFAor97k.js} +1 -1
- package/dist/assets/light-camera-factory-D1sgz3YB.js +1 -0
- package/dist/assets/live-mixers-BRkRHd6g.js +1 -0
- package/dist/assets/{loader-CaF_I7Yt.js → loader-BbMsvIxP.js} +1 -1
- package/dist/assets/machine.document-CgmsOh-s.js +24 -0
- package/dist/assets/machines.finder-nxiCgQc2.js +1 -0
- package/dist/assets/matcap-texture-Dh65bX5V.js +1 -0
- package/dist/assets/{material-CpAdjDxn.js → material-D5kXEZWQ.js} +1 -1
- package/dist/assets/{material-factory-Bz6h__6g.js → material-factory-0Qb0VuZ5.js} +1 -1
- package/dist/assets/material-preview.view-DqNcpd_b.js +1 -0
- package/dist/assets/{mesh-B3WPtNKO.js → mesh-BKPgNTwh.js} +1 -1
- package/dist/assets/{mesh-shadow-CZnXrw_l.js → mesh-shadow-BDQP4mHs.js} +1 -1
- package/dist/assets/model-asset-sections.service-DWPLmkqa.js +1 -0
- package/dist/assets/model-inspection-Cxfg_Fei.js +1 -0
- package/dist/assets/model.layout-BpZE1W9V.js +1 -0
- package/dist/assets/{models.finder-G2jQgIRu.js → models.finder-DHW17ZEa.js} +1 -1
- package/dist/assets/module-mode-CRfHyIMS.js +2 -0
- package/dist/assets/mount-canvas-ingest-root-BZZ8M3Lu.js +2 -0
- package/dist/assets/mount-dom-ingest-root-D1GV6Jjt.js +2 -0
- package/dist/assets/{mount-game-6t9cKNo4.js → mount-game-F9e76auh.js} +1 -1
- package/dist/assets/mount-ingest-root-B5D-Lmmk.js +2 -0
- package/dist/assets/{mount-manifest-CGVxhmAw.js → mount-manifest-cYRhgHfo.js} +1 -1
- package/dist/assets/mount-three-ingest-root-BNnouaBn.js +1 -0
- package/dist/assets/{mounted-authoring-Dmg5xmhP.js → mounted-authoring-TIN5EnCb.js} +1 -1
- package/dist/assets/{mounted-story-viewport-source-DjP6RA9U.js → mounted-story-viewport-source-CAlEmE0_.js} +1 -1
- package/dist/assets/{native-debug-module-CWicoSGD.js → native-debug-module-j-MekcLS.js} +1 -1
- package/dist/assets/{navigation-CIiCx-SM.js → navigation-DmR1BDVo.js} +1 -1
- package/dist/assets/{navmesh.menu-CAKiH8PW.js → navmesh.menu-FhL1pGx1.js} +1 -1
- package/dist/assets/{navmesh.service-jgDWlgj1.js → navmesh.service-usyDeJlm.js} +1 -1
- package/dist/assets/{network.utility-CEu5nHf7.js → network.utility-BPh4hTmh.js} +1 -1
- package/dist/assets/night-CvV4Gybt.exr +0 -0
- package/dist/assets/{object3d-authoring-subject-CH5sI2oP.js → object3d-authoring-subject-CyE4rQ2A.js} +1 -1
- package/dist/assets/oid-transform-BOqL6YH6.js +2 -0
- package/dist/assets/{particles-Y626p22p.js → particles-C47L-dda.js} +1 -1
- package/dist/assets/particles-factory-CRqPLdS7.js +1 -0
- package/dist/assets/pixi-authoring-adapter-C5Ikqj5-.js +1 -0
- package/dist/assets/{pixi-live-write-target-DuWydlWb.js → pixi-live-write-target-OWBk79dp.js} +1 -1
- package/dist/assets/pixi-primitive-D5igywJ_.js +1 -0
- package/dist/assets/pixi-react-root-factory-9lZ0Yz-n.js +1 -0
- package/dist/assets/play-mode-DomOvQie.js +22 -0
- package/dist/assets/play.command-DoqjH-Pp.js +2 -0
- package/dist/assets/{playtest-BXIL1JEF.js → playtest-BnFenMBW.js} +1 -1
- package/dist/assets/{pose-guard-6Osb2cFu.js → pose-guard-Bb3gZOzk.js} +1 -1
- package/dist/assets/{product-DFhyARJj.js → product-CTDJoVo5.js} +1 -1
- package/dist/assets/{profiler.action-CaXJDp3t.js → profiler.action-C_OFGkDw.js} +1 -1
- package/dist/assets/{profiler.menu-BIMF6Bi4.js → profiler.menu-BJbnVoo4.js} +1 -1
- package/dist/assets/{profiler.utility-BExw9wBO.js → profiler.utility-qpfhuwRw.js} +1 -1
- package/dist/assets/project-authoring-session-BV-MM8Fl.js +2 -0
- package/dist/assets/{project-provenance-BoP3nrle.js → project-provenance-4ldz-EOG.js} +1 -1
- package/dist/assets/{properties-bone-constraints.inspector-ByT6p7S-.js → properties-bone-constraints.inspector-C-ByIdg1.js} +1 -1
- package/dist/assets/{properties-bone.inspector-z4qJwKO5.js → properties-bone.inspector-CXY0xCQB.js} +1 -1
- package/dist/assets/{properties-collection.inspector-D0_3ijWU.js → properties-collection.inspector-DIfkZAel.js} +1 -1
- package/dist/assets/{properties-constraints.inspector-CESzjuls.js → properties-constraints.inspector-BaunL5nT.js} +1 -1
- package/dist/assets/{properties-data.inspector-hG8Wgyzb.js → properties-data.inspector-DQD-jfO2.js} +1 -1
- package/dist/assets/{properties-material.inspector-CzY0JCQ6.js → properties-material.inspector-A0HZ4SX6.js} +1 -1
- package/dist/assets/{properties-modifiers.inspector-3dDhwf7g.js → properties-modifiers.inspector-GUnVhVwZ.js} +1 -1
- package/dist/assets/{properties-object.inspector-CiarfxkT.js → properties-object.inspector-Chsfa4Xa.js} +1 -1
- package/dist/assets/{properties-output.inspector-DKJxmKSD.js → properties-output.inspector-U7ZmD0Me.js} +1 -1
- package/dist/assets/{properties-particles.inspector-CCEdYWGm.js → properties-particles.inspector-umkW-OlI.js} +1 -1
- package/dist/assets/{properties-physics.inspector-B2c0KUyA.js → properties-physics.inspector-CLVBlWwL.js} +1 -1
- package/dist/assets/{properties-render.inspector-Bcm0HLRW.js → properties-render.inspector-D0u9taKy.js} +1 -1
- package/dist/assets/{properties-scene.inspector-PIM_eTb_.js → properties-scene.inspector-JwGCZQAx.js} +1 -1
- package/dist/assets/{properties-texture.inspector-CgFlnyr8.js → properties-texture.inspector-B1vC28pw.js} +1 -1
- package/dist/assets/{properties-view-layer.inspector-DGjF_Aqo.js → properties-view-layer.inspector-BuUKyBFp.js} +1 -1
- package/dist/assets/{properties-world.inspector-CrMvaRvB.js → properties-world.inspector-VXUj4dT4.js} +1 -1
- package/dist/assets/r3f-design-session-qJ2v5SrB.js +2 -0
- package/dist/assets/r3f-physics-binding-C8OqNRG2.js +1 -0
- package/dist/assets/{r3f-root-factory-z9llD1OU.js → r3f-root-factory-DjGnbU4n.js} +1 -1
- package/dist/assets/r3f-source-authoring-adapter-CG9heazM.js +12 -0
- package/dist/assets/{rapier-physics-bridge-CMoeVo3Y.js → rapier-physics-bridge-B-EK7KYV.js} +1 -1
- package/dist/assets/react-inspector.service-DWeXDHJq.js +1 -0
- package/dist/assets/{react-root-CEz5NTck.js → react-root-DGLRLr-F.js} +1 -1
- package/dist/assets/react-story-board-CSqHY0Cg.js +1 -0
- package/dist/assets/{react-three-fiber.esm-CycrbDlA.js → react-three-fiber.esm-BxIoqVh1.js} +1 -1
- package/dist/assets/{react-three-rapier.esm-CEfKpvxT.js → react-three-rapier.esm-BYzLhdSV.js} +1 -1
- package/dist/assets/react-world-authoring-adapter-BMT9kLWU.js +1 -0
- package/dist/assets/{realm-services-CobQsq_X.js → realm-services-D25JHoqD.js} +1 -1
- package/dist/assets/{reflection-probe-Don-M3Fj.js → reflection-probe-CqXWlicu.js} +1 -1
- package/dist/assets/{reflection-probe-capture.inspector-CmFUoJCx.js → reflection-probe-capture.inspector-B7Qa30vB.js} +1 -1
- package/dist/assets/regions-DWeEBnE2.js +1 -0
- package/dist/assets/{register-render-vitals-BiZk29b2.js → register-render-vitals-BO7x64kR.js} +1 -1
- package/dist/assets/{registry-02YZjMNp.js → registry-DlTluc4x.js} +1 -1
- package/dist/assets/{render-audio-control-vMRlePWb.js → render-audio-control-DCa_bOBI.js} +1 -1
- package/dist/assets/{render-batch-system-0vq7p0VC.js → render-batch-system-CzCp9YKM.js} +1 -1
- package/dist/assets/{render-control-Df3yTiyr.js → render-control-BNQr1eNO.js} +1 -1
- package/dist/assets/{render-env-D2IV2x5k.js → render-env-emvlfeTG.js} +1 -1
- package/dist/assets/{render-features-CPQ_e568.js → render-features-COF7MSQ9.js} +1 -1
- package/dist/assets/{render-settings-Bw4W9SYF.js → render-settings-C_kIMq8Y.js} +1 -1
- package/dist/assets/{resolve-three-SZE_WWUM.js → resolve-three-C-nx-QdA.js} +13 -13
- package/dist/assets/{root-seam-contract-Z0VWX3Bk.js → root-seam-contract-C7GOxf5x.js} +1 -1
- package/dist/assets/{run-ticks-settled-C4ksViyA.js → run-ticks-settled-B0cTtmhQ.js} +1 -1
- package/dist/assets/{scene-capture-CGYF-Viw.js → scene-capture-CLOc7GXc.js} +1 -1
- package/dist/assets/{scene-capture-BQKzU0NT.js → scene-capture-D10Nxkvp.js} +1 -1
- package/dist/assets/scene-document.service-B7kAVTko.js +2 -0
- package/dist/assets/{scene-framing-Cat0GtyJ.js → scene-framing-50N7SKuX.js} +1 -1
- package/dist/assets/{scene-index-B6BZOHMk.js → scene-index-Bce459yu.js} +1 -1
- package/dist/assets/{scene-query-C7_N-TpI.js → scene-query-IUZhw6pA.js} +1 -1
- package/dist/assets/{schema-kl9-2B_J.js → schema-Iy-mbzll.js} +1 -1
- package/dist/assets/sculpt.layout-D-K5cLw6.js +1 -0
- package/dist/assets/{seeded-random-i3mtgBKZ.js → seeded-random-CN0scLZj.js} +1 -1
- package/dist/assets/{session-CZ5JPg-z.js → session-CsR0lApe.js} +24 -15
- package/dist/assets/{setup-audio-S8GQF91f.js → setup-audio-BJ18gvXZ.js} +1 -1
- package/dist/assets/setup-particles-B6H-GbAA.js +1 -0
- package/dist/assets/{setup-physics-BeZ7-LKD.js → setup-physics-GugbTT0J.js} +1 -1
- package/dist/assets/{setup-renderer-DVXaSGin.js → setup-renderer-wt_a-p8r.js} +20 -20
- package/dist/assets/shading.layout-CZZHKBer.js +1 -0
- package/dist/assets/{sim-clock-CLflx7kg.js → sim-clock-DEfbb_-P.js} +1 -1
- package/dist/assets/{soft-particle-depth-DGvfQDi1.js → soft-particle-depth-CKUS1j0Y.js} +1 -1
- package/dist/assets/source-object3d-authoring-adapter-CfHQLFAL.js +1 -0
- package/dist/assets/{source-persistence-backend-C-aR-B_Y.js → source-persistence-backend-_-JMEXxE.js} +1 -1
- package/dist/assets/{spark-renderer-lifecycle-ynWESJcv.js → spark-renderer-lifecycle-9mnMW3Z4.js} +1 -1
- package/dist/assets/{spark.module-4pXQoz5d.js → spark.module-CXth-y_a.js} +1 -1
- package/dist/assets/stage-keyboard-C0FdDLOQ.js +1 -0
- package/dist/assets/stage-overlay-set-CwhCzbOy.js +1 -0
- package/dist/assets/stage-presence-markers-DVMDKiB-.js +1 -0
- package/dist/assets/stage-transform-tools-B09Z7v0o.js +1 -0
- package/dist/assets/standard-viewport-dressing-GUUr6GuK.js +20 -0
- package/dist/assets/{state-watch.action-BOvQR2qt.js → state-watch.action-CgF8qoFC.js} +1 -1
- package/dist/assets/{state-watch.menu-CNLvDeeY.js → state-watch.menu-CIMncESW.js} +1 -1
- package/dist/assets/{state-watch.utility-Bg1tTTQU.js → state-watch.utility-zTHkUALC.js} +1 -1
- package/dist/assets/static-batch-advisor-DqfXWRUq.js +1 -0
- package/dist/assets/story-capture-COQgezzl.js +1 -0
- package/dist/assets/story-documents-DQ0KORmd.js +3 -0
- package/dist/assets/story-documents.service-DOSaqPqv.js +1 -0
- package/dist/assets/story-documents.service-Gb7oUkbg.js +1 -0
- package/dist/assets/{story-media-presence-BHzk2IV5.js → story-media-presence-nW3zJqKv.js} +1 -1
- package/dist/assets/story-pixi-preview-COPTEsHo.js +1 -0
- package/dist/assets/story-presentation-CxADj5oz.js +1 -0
- package/dist/assets/{story-three-preview-BHEDZzcl.js → story-three-preview-C9W__8Or.js} +2 -2
- package/dist/assets/{structural-ids-Dc-7rEwi.js → structural-ids-CblajJQK.js} +1 -1
- package/dist/assets/studio-CysTBGIb.exr +0 -0
- package/dist/assets/sunrise-Dj0psFrf.exr +0 -0
- package/dist/assets/sunset-Bw3x2Bot.exr +0 -0
- package/dist/assets/{surface-state-DaxyruCj.js → surface-state-BAUJu6GY.js} +1 -1
- package/dist/assets/{system-runner-DkOjxEBt.js → system-runner-D_DtVrer.js} +1 -1
- package/dist/assets/team-playtest.service--79O6xkx.js +1 -0
- package/dist/assets/{three-CDSueJyJ.js → three-DSsr_Lvp.js} +1 -1
- package/dist/assets/{three-authoring-adapter-CmSQ3Vui.js → three-authoring-adapter-Yqsank46.js} +1 -1
- package/dist/assets/three-authoring.service-BDos-bRt.js +2 -0
- package/dist/assets/{three-ingest-runtime-QzDYk6tU.js → three-ingest-runtime-DWijtqQ8.js} +1 -1
- package/dist/assets/{three-projection-core-BmKMZ-nf.js → three-projection-core-kubBTx0s.js} +1 -1
- package/dist/assets/three-story-model-BraQFA9h.js +1 -0
- package/dist/assets/three-viewport-presentation-BL7Uc2i6.js +1 -0
- package/dist/assets/{three.module-D396a9Mn.js → three.module-IFn-4i31.js} +1 -1
- package/dist/assets/three.quarks.esm-CRKGjKAH.js +1039 -0
- package/dist/assets/transform-mode-request-Cu7ewbtr.js +1 -0
- package/dist/assets/{transform-writer-BhBBTx33.js → transform-writer-DXxrI4t7.js} +1 -1
- package/dist/assets/transport.header-CeND8Vzh.js +1 -0
- package/dist/assets/{trigger-volume-BNK2XzPL.js → trigger-volume-BCVRS3NM.js} +1 -1
- package/dist/assets/{tuples-CIQ4Bn1U.js → tuples-DKDGrN1t.js} +1 -1
- package/dist/assets/ui-board-document-DD2CAEAo.js +2 -0
- package/dist/assets/unity.style-vCmLw4gI.js +1 -0
- package/dist/assets/unity.view-DIn2S6Do.js +1 -0
- package/dist/assets/unreal.style-BQn-HhOX.js +1 -0
- package/dist/assets/unreal.view-adNBETZK.js +1 -0
- package/dist/assets/user-data-CZqsJDk-.js +1 -0
- package/dist/assets/{utility-view-state-BHypxA33.js → utility-view-state-DYJY8V8O.js} +1 -1
- package/dist/assets/uv-editing.layout-A8RA-cbM.js +1 -0
- package/dist/assets/{vgai-shared-three-Bc5PvpLM.js → vgai-shared-three-D_RAEumG.js} +1 -1
- package/dist/assets/{viewport-root-presentation-CWsE56K6.js → viewport-root-presentation-C9M98VNM.js} +1 -1
- package/dist/assets/{viewport-shading-BuA88e_A.js → viewport-shading-BzcvgJhK.js} +1 -1
- package/dist/assets/viewport-shading-boundary-CBvvzS-p.js +84 -0
- package/dist/assets/{viewport-surface-status-B3om4Kcf.js → viewport-surface-status-BFmnWp7z.js} +1 -1
- package/dist/assets/voxel-surface-ROWYug7H.js +1 -0
- package/dist/assets/webgl-frame-capture-CRKX73E9.js +1 -0
- package/dist/assets/webworkerAll-CehoCtFb.js +1 -0
- package/dist/assets/{worker-UrMcrc5_.js → worker-B7zhIsFh.js} +2 -2
- package/dist/assets/world-documents-DErHq15h.js +1 -0
- package/dist/assets/world-root-stage-binding-BIymcQ4K.js +1 -0
- package/dist/assets/{world-state-BWG-IcOd.js → world-state-ZGDGY_Xl.js} +1 -1
- package/dist/assets/{writer-B-KovzkA.js → writer-BPbm4_my.js} +5 -5
- package/dist/assets/xstate-animation-binding-Cvd4JbEY.js +1 -0
- package/dist/assets/{xstate-animation-meta-Q3u9zh_m.js → xstate-animation-meta-B3OZR8Q2.js} +1 -1
- package/dist/vgai-shared-three.json +1 -1
- package/dist-node/cli.js +317 -73
- package/dist-node/create.js +59 -19
- package/package.json +16 -13
- package/src/index.ts +6 -0
- package/template/.agents/skills/vgai-3d-models/SKILL.md +3 -3
- package/template/.agents/skills/vgai-threejs-authoring/SKILL.md +4 -9
- package/template/.claude/skills/vgai-3d-models/SKILL.md +3 -3
- package/template/.claude/skills/vgai-threejs-authoring/SKILL.md +4 -9
- package/template/.github/skills/vgai-3d-models/SKILL.md +3 -3
- package/template/.github/skills/vgai-threejs-authoring/SKILL.md +4 -9
- package/template/AGENTS.md +1 -1
- package/template/check-idioms.ts +4 -5
- package/template/package.json +9 -9
- package/template/tsconfig.json +1 -0
- package/template/vgai.adapter.ts +1 -0
- package/template-dotfiles/gitignore +2 -0
- package/workbench/src/media/game-cover.css +1 -1
- package/catalog/project-source/src/lib/bake/mesh-slice.ts +0 -157
- package/dist/assets/BufferGeometryUtils-Nz37EVXf.js +0 -1
- package/dist/assets/CanvasSceneViewport-Bpi6gVTC.js +0 -1
- package/dist/assets/ColladaLoader-aVOPIsCh.js +0 -3
- package/dist/assets/EXRLoader-Cdans_oJ.js +0 -1
- package/dist/assets/EffectComposer-DQxfsXBZ.js +0 -1
- package/dist/assets/EntityModelDocument-Ccvw66N9.js +0 -1
- package/dist/assets/EnvironmentAssetDocument-Dg-Qq6O6.js +0 -1
- package/dist/assets/FBXLoader-B4MoUtAn.js +0 -1
- package/dist/assets/Fbo-Dz-Soul3.js +0 -1
- package/dist/assets/GLTFExporter-HgrCle4L.js +0 -1
- package/dist/assets/Gltf-UHVWKz65.js +0 -2
- package/dist/assets/HDRLoader-THU88oVD.js +0 -5
- package/dist/assets/ImageViewer-Tn7s_MnW.js +0 -1
- package/dist/assets/InspectorObjectPreview-CVejvLRg.js +0 -1
- package/dist/assets/JsonAssetDocument-C7VGcLhu.js +0 -3
- package/dist/assets/MeshBVH-BiDHDcu-.js +0 -1
- package/dist/assets/ModelAssetDocument-F5GACirk.js +0 -1
- package/dist/assets/Object3DDocumentViewport-DB7T0NTl.js +0 -2
- package/dist/assets/Object3DPreview-DL8oi7Xs.js +0 -2
- package/dist/assets/OnlineAssetDetail-C6z9RvYK.js +0 -2
- package/dist/assets/PlayBar-BR-Vg3Jb.js +0 -2
- package/dist/assets/RGBELoader-BgBcQv8j.js +0 -1
- package/dist/assets/RectAreaLightUniformsLib-CMMoWfll.js +0 -1
- package/dist/assets/RootSelectionOverlay-BZPlxmXU.js +0 -1
- package/dist/assets/STLLoader-Dyv3lsxY.js +0 -1
- package/dist/assets/SimplifyModifier-C8ayvRzd.js +0 -1
- package/dist/assets/SourceAssetViewer-2SWQoUut.js +0 -12
- package/dist/assets/StageHost-BN-IoTef.js +0 -2
- package/dist/assets/ThreeBoardDocument-CVncZyIq.js +0 -2
- package/dist/assets/asset-budget-asset.menu-Di3KiQCd.js +0 -1
- package/dist/assets/asset-budget.action-DCzzcuTh.js +0 -1
- package/dist/assets/asset-budget.document-BWU8wnVW.js +0 -1
- package/dist/assets/asset-budget.menu-BGZpT_31.js +0 -1
- package/dist/assets/autoplay.service-BZBGNSvt.js +0 -1
- package/dist/assets/blender-emscripten-engine-9ZIRYNhe.js +0 -2
- package/dist/assets/blender-properties-tab-C5CyPydi.js +0 -3
- package/dist/assets/blender-runtime-host-BpBwGv7r.js +0 -4
- package/dist/assets/blender-runtime.document-lIYhhPtv.js +0 -8
- package/dist/assets/blender.command-BtJeWk-A.js +0 -1
- package/dist/assets/body-marks-h_xDxiDE.js +0 -1
- package/dist/assets/bridge.command-o5gDNEwa.js +0 -3
- package/dist/assets/browserAll-DeWblVez.js +0 -1
- package/dist/assets/canvas-entry-runtime-SfBxaR9M.js +0 -2
- package/dist/assets/component-board.service-DidCyM4O.js +0 -2
- package/dist/assets/component-verbs.service-Bv9jId3q.js +0 -1
- package/dist/assets/constraints.inspector-B9U9Yj-u.js +0 -1
- package/dist/assets/coverage.service-VTX5Mcsx.js +0 -3
- package/dist/assets/deferred-ingest-play-DCJi_Pgu.js +0 -2
- package/dist/assets/design-time-layers-wYgOTgni.js +0 -1
- package/dist/assets/design-time-mount.service-BzY21e1F.js +0 -2
- package/dist/assets/design-time-react-mount-DM9WLrF2.js +0 -1
- package/dist/assets/edit-mode-authoring-B47TfLqu.js +0 -1
- package/dist/assets/editor-api-BoJIcyZG.js +0 -1
- package/dist/assets/fflate.module-DPuTF8aG.js +0 -6
- package/dist/assets/fork-menu-BoVyw2Wu.js +0 -1
- package/dist/assets/game-document.service-DbRfx2V0.js +0 -1
- package/dist/assets/game-eval.command-D-7Dxbj_.js +0 -2
- package/dist/assets/gameplay-replay-e5umMlXv.js +0 -1
- package/dist/assets/gameplay.command-DxcVYX6F.js +0 -1
- package/dist/assets/generation.service-CDIgObuw.js +0 -1
- package/dist/assets/index-96FBF1Oj.js +0 -1
- package/dist/assets/index-BAWkB0dv.js +0 -1
- package/dist/assets/index-BDnS2b6S.js +0 -1
- package/dist/assets/index-BjTCPEQ7.js +0 -134
- package/dist/assets/index-CVCb_ImQ.js +0 -1
- package/dist/assets/index-CZd9o7Lu.js +0 -1
- package/dist/assets/index-D2fNXpHa.css +0 -1
- package/dist/assets/index-GIL7oGEO.js +0 -4894
- package/dist/assets/index-OrYXPk3Z.js +0 -487
- package/dist/assets/ingest-boot-viewport-D5rI_Kk_.js +0 -1
- package/dist/assets/ingest-siblings-Bop2kqVl.js +0 -1
- package/dist/assets/instances.command-D6UkZNO8.js +0 -1
- package/dist/assets/light-camera-factory-CWbbe9gI.js +0 -1
- package/dist/assets/live-behaviors-Bxq49Maz.js +0 -1
- package/dist/assets/matcap-texture-CVfalpWT.js +0 -1
- package/dist/assets/model-asset-sections.service-CHhFS3ZX.js +0 -1
- package/dist/assets/model.layout-BJUEQYUI.js +0 -1
- package/dist/assets/module-mode-DVBLT9d-.js +0 -2
- package/dist/assets/mount-canvas-ingest-root-DDuAWf_C.js +0 -2
- package/dist/assets/mount-dom-ingest-root-D_EiBgpn.js +0 -2
- package/dist/assets/mount-ingest-root-glv2SSWf.js +0 -2
- package/dist/assets/mount-three-ingest-root-hrUt9VVU.js +0 -1
- package/dist/assets/particles-factory-DnLOHXT8.js +0 -1
- package/dist/assets/pasteboard-materialize-BqSS4QzV.js +0 -20
- package/dist/assets/pasteboard.action-DU3UHtJG.js +0 -2
- package/dist/assets/pixi-authoring-adapter-CjibysC3.js +0 -1
- package/dist/assets/pixi-primitive-DlWbUPN9.js +0 -1
- package/dist/assets/pixi-react-root-factory-DYsznYRQ.js +0 -1
- package/dist/assets/play-mode-BFU2PCkG.js +0 -22
- package/dist/assets/play.command-BpqqLqkq.js +0 -2
- package/dist/assets/project-authoring-session-Bnt6icLr.js +0 -2
- package/dist/assets/r3f-design-session-D-4yyDO9.js +0 -2
- package/dist/assets/r3f-physics-binding-BBo8oma9.js +0 -1
- package/dist/assets/r3f-source-authoring-adapter-w6Bc60K-.js +0 -13
- package/dist/assets/react-inspector.service-B_neRnSK.js +0 -1
- package/dist/assets/react-story-board-BDDwiE2H.js +0 -1
- package/dist/assets/react-world-authoring-adapter-DmrwM3py.js +0 -1
- package/dist/assets/runtime-inspection-l2iFQSsg.js +0 -1
- package/dist/assets/scene-document.service-qkDjUrlP.js +0 -2
- package/dist/assets/sculpt.layout-zJF55yCR.js +0 -1
- package/dist/assets/setup-particles-GCXlnkj_.js +0 -1
- package/dist/assets/shading.layout-DULYZV6M.js +0 -1
- package/dist/assets/source-object3d-authoring-adapter-B-L6Ha6f.js +0 -1
- package/dist/assets/stage-invalidation-DBg3C3Ta.js +0 -1
- package/dist/assets/stage-keyboard-n-5kKH-m.js +0 -1
- package/dist/assets/stage-overlay-set-B9zp2sLB.js +0 -1
- package/dist/assets/stage-presence-markers-DiGI6A45.js +0 -1
- package/dist/assets/standard-viewport-dressing-CzjAe_0A.js +0 -7
- package/dist/assets/static-batch-advisor-B13QEH7d.js +0 -1
- package/dist/assets/story-capture-_gC8dXV-.js +0 -1
- package/dist/assets/story-documents--TDLaPeL.js +0 -3
- package/dist/assets/story-documents.service-BiS_YbNQ.js +0 -1
- package/dist/assets/story-documents.service-CxOPYJ2j.js +0 -1
- package/dist/assets/story-pixi-preview-BUrOJZXS.js +0 -1
- package/dist/assets/story-presentation-j2AVN-mK.js +0 -1
- package/dist/assets/team-playtest.service-DqOinFVA.js +0 -1
- package/dist/assets/three-authoring.service-iuHLwtf1.js +0 -2
- package/dist/assets/three-viewport-presentation-QBQpSdMh.js +0 -1
- package/dist/assets/three.quarks.esm-B1C61jGo.js +0 -1039
- package/dist/assets/transport.header-B-6HQlU2.js +0 -1
- package/dist/assets/ui-board-document-Bwtt--xp.js +0 -2
- package/dist/assets/use-live-actor-state-DErbWQWF.js +0 -1
- package/dist/assets/user-data-BB2Of6Ht.js +0 -1
- package/dist/assets/uv-editing.layout-BEKHxmHw.js +0 -1
- package/dist/assets/viewport-shading-boundary-B_-_gABg.js +0 -82
- package/dist/assets/voxel-surface-DtcsSWRL.js +0 -1
- package/dist/assets/webgl-frame-capture-FlF9zQmW.js +0 -1
- package/dist/assets/webworkerAll-CM2o_dnz.js +0 -1
- package/dist/assets/world-documents-147tiFZe.js +0 -1
- package/dist/assets/world-root-stage-binding-vwTrtBz6.js +0 -1
- package/dist/assets/xstate-animation-binding-Brd0NST6.js +0 -1
- package/dist/assets/xstate-behavior.action-B8UluFBK.js +0 -1
- package/dist/assets/xstate-behavior.document-CKAsE45I.js +0 -1
- package/dist/assets/xstate-behavior.inspector-vJJyuifc.js +0 -1
- package/dist/assets/xstate-behavior.menu-BXbPICIh.js +0 -1
- package/dist/assets/xstate-inspection-BsZv8LS9.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as e}from"./jsx-runtime-DPjLkJKQ.js";import{r as l}from"./index-nmcBqr7Y.js";import"./index-CtzuWnCS.js";import{
|
|
1
|
+
import{a as e}from"./jsx-runtime-DPjLkJKQ.js";import{r as l}from"./index-nmcBqr7Y.js";import"./index-CtzuWnCS.js";import{ap as r,a5 as k,aR as w,aS as z,aT as C}from"./index-Ckxb31Yz.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-IFn-4i31.js";const m={fontSize:11,color:r.content.dim,marginBottom:2};function M({assetPath:s}){const i=l.useRef(null),[a,p]=l.useState(!1),[n,f]=l.useState(null),[c,x]=l.useState(0),[h,g]=l.useState(!1),[v,y]=l.useState(1),j=s.split("/").pop()??s,b=s.split(".").pop()?.toUpperCase()??"";l.useEffect(()=>()=>{i.current?.pause()},[]);const S=()=>{const t=i.current;t&&(a?t.pause():t.play(),p(!a))},d=t=>{const o=Math.floor(t/60),u=Math.floor(t%60);return`${o}:${u.toString().padStart(2,"0")}`};return e.jsxs("div",{style:{padding:8,display:"flex",flexDirection:"column",gap:8},children:[e.jsx("div",{style:{fontWeight:600,fontSize:12,color:r.content.primary,wordBreak:"break-all"},children:j}),e.jsxs("div",{className:"vgai-content-frost",style:{width:"100%",border:`1px solid ${r.boundary.default}`,borderRadius:r.shape.small,display:"flex",alignItems:"center",justifyContent:"center",flexDirection:"column",gap:8,padding:16},children:[e.jsxs("svg",{viewBox:"0 0 24 24",width:48,height:48,children:[e.jsx("rect",{x:"3",y:"3",width:"18",height:"18",rx:"2",fill:"var(--vgai-asset-icon-audio)"}),e.jsx("path",{d:"M9 8l4-2v12l-4-2H7V10h2zm6 1v6m2-5v4",stroke:"var(--vgai-text-1)",strokeWidth:"1.5",fill:"none",strokeLinecap:"round"})]}),n!=null&&e.jsxs("div",{style:{width:"100%",fontSize:10,color:r.content.muted,textAlign:"center"},children:[d(c)," / ",d(n)]}),n!=null&&n>0&&e.jsx("div",{style:{width:"100%",height:4,background:r.surface.raised,borderRadius:r.shape.small,cursor:"pointer",position:"relative"},onClick:t=>{const o=t.currentTarget.getBoundingClientRect(),u=(t.clientX-o.left)/o.width;i.current&&(i.current.currentTime=u*n)},children:e.jsx("div",{style:{width:`${c/n*100}%`,height:"100%",background:"var(--vgai-asset-icon-audio)",borderRadius:r.shape.small}})}),e.jsx(k,{type:"button",variant:"secondary",size:"comfortable",onClick:S,children:a?"Pause":"Play"}),e.jsx("div",{role:"img","aria-label":"Audio waveform",style:{width:"100%",height:36,display:"flex",alignItems:"center",gap:2},children:Array.from({length:48},(t,o)=>e.jsx("i",{style:{flex:1,height:`${20+o*37%75}%`,background:"var(--vgai-asset-icon-audio)",opacity:o/48<=c/(n||1)?1:.3}},o))}),e.jsxs("label",{style:{fontSize:11,color:r.content.muted},children:[e.jsx(w,{checked:h,onChange:t=>g(t.target.checked)})," Loop"]}),e.jsxs("label",{style:{fontSize:11,color:r.content.muted},children:["Volume"," ",e.jsx(z,{"aria-label":"Audio volume",min:"0",max:"1",step:"0.05",value:v,onChange:t=>{const o=Number(t.target.value);y(o),i.current&&(i.current.volume=o)}})]})]}),e.jsx("audio",{ref:i,src:s,loop:h,onLoadedMetadata:()=>{i.current&&f(i.current.duration)},onTimeUpdate:()=>{i.current&&x(i.current.currentTime)},onEnded:()=>p(!1)}),e.jsx(C,{label:"Info",children:e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:4},children:[e.jsxs("div",{children:[e.jsx("div",{style:m,children:"Path"}),e.jsx("div",{style:{fontSize:11,color:r.content.primary,wordBreak:"break-all"},children:s})]}),n!=null&&e.jsxs("div",{children:[e.jsx("div",{style:m,children:"Duration"}),e.jsx("div",{style:{fontSize:11,color:r.content.primary},children:d(n)})]}),e.jsxs("div",{children:[e.jsx("div",{style:m,children:"Format"}),e.jsx("div",{style:{fontSize:11,color:r.content.primary},children:b})]})]})})]})}export{M as AudioViewer};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{ae as B,af as I,b2 as R,V as u,Q as N,b3 as x,b as L,c as g,d as k}from"./three.module-IFn-4i31.js";class A extends B{constructor(c){super(c),this.animateBonePositions=!0,this.animateBoneRotations=!0}load(c,H,d,f){const l=this,h=new I(l.manager);h.setPath(l.path),h.setRequestHeader(l.requestHeader),h.setWithCredentials(l.withCredentials),h.load(c,function(p){try{H(l.parse(p))}catch(m){f?f(m):console.error(m),l.manager.itemError(c)}},d,f)}parse(c){function H(t){p(t)!=="HIERARCHY"&&console.error("THREE.BVHLoader: HIERARCHY expected.");const s=[],n=f(t,p(t),s);p(t)!=="MOTION"&&console.error("THREE.BVHLoader: MOTION expected.");let e=p(t).split(/[\s]+/);const o=parseInt(e[1]);isNaN(o)&&console.error("THREE.BVHLoader: Failed to read number of frames."),e=p(t).split(/[\s]+/);const i=parseFloat(e[2]);isNaN(i)&&console.error("THREE.BVHLoader: Failed to read frame time.");for(let r=0;r<o;r++)e=p(t).split(/[\s]+/),d(e,r*i,n);return s}function d(t,s,n){if(n.type==="ENDSITE")return;const e={time:s,position:new u,rotation:new N};n.frames.push(e);const o=new N,i=new u(1,0,0),r=new u(0,1,0),E=new u(0,0,1);for(let a=0;a<n.channels.length;a++)switch(n.channels[a]){case"Xposition":e.position.x=parseFloat(t.shift().trim());break;case"Yposition":e.position.y=parseFloat(t.shift().trim());break;case"Zposition":e.position.z=parseFloat(t.shift().trim());break;case"Xrotation":o.setFromAxisAngle(i,parseFloat(t.shift().trim())*Math.PI/180),e.rotation.multiply(o);break;case"Yrotation":o.setFromAxisAngle(r,parseFloat(t.shift().trim())*Math.PI/180),e.rotation.multiply(o);break;case"Zrotation":o.setFromAxisAngle(E,parseFloat(t.shift().trim())*Math.PI/180),e.rotation.multiply(o);break;default:console.warn("THREE.BVHLoader: Invalid channel type.")}for(let a=0;a<n.children.length;a++)d(t,s,n.children[a])}function f(t,s,n){const e={name:"",type:"",frames:[]};n.push(e);let o=s.split(/[\s]+/);o[0].toUpperCase()==="END"&&o[1].toUpperCase()==="SITE"?(e.type="ENDSITE",e.name="ENDSITE"):(e.name=o[1],e.type=o[0].toUpperCase()),p(t)!=="{"&&console.error("THREE.BVHLoader: Expected opening { after type & name"),o=p(t).split(/[\s]+/),o[0]!=="OFFSET"&&console.error("THREE.BVHLoader: Expected OFFSET but got: "+o[0]),o.length!==4&&console.error("THREE.BVHLoader: Invalid number of values for OFFSET.");const i=new u(parseFloat(o[1]),parseFloat(o[2]),parseFloat(o[3]));if((isNaN(i.x)||isNaN(i.y)||isNaN(i.z))&&console.error("THREE.BVHLoader: Invalid values of OFFSET."),e.offset=i,e.type!=="ENDSITE"){o=p(t).split(/[\s]+/),o[0]!=="CHANNELS"&&console.error("THREE.BVHLoader: Expected CHANNELS definition.");const r=parseInt(o[1]);e.channels=o.splice(2,r),e.children=[]}for(;;){const r=p(t);if(r==="}")return e;e.children.push(f(t,r,n))}}function l(t,s){const n=new x;if(s.push(n),n.position.add(t.offset),n.name=t.name,t.type!=="ENDSITE")for(let e=0;e<t.children.length;e++)n.add(l(t.children[e],s));return n}function h(t){const s=[];for(let n=0;n<t.length;n++){const e=t[n];if(e.type==="ENDSITE")continue;const o=[],i=[],r=[];for(let E=0;E<e.frames.length;E++){const a=e.frames[E];o.push(a.time),i.push(a.position.x+e.offset.x),i.push(a.position.y+e.offset.y),i.push(a.position.z+e.offset.z),r.push(a.rotation.x),r.push(a.rotation.y),r.push(a.rotation.z),r.push(a.rotation.w)}m.animateBonePositions&&s.push(new L(e.name+".position",o,i)),m.animateBoneRotations&&s.push(new g(e.name+".quaternion",o,r))}return new k("animation",-1,s)}function p(t){let s;for(;(s=t.shift().trim()).length===0;);return s}const m=this,y=c.split(/[\r\n]+/g),T=H(y),F=[];l(T[0],F);const w=h(T);return{skeleton:new R(F),clip:w}}}export{A as BVHLoader};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{ay as N,b6 as U,b7 as S,b8 as k,V as z}from"./three.module-IFn-4i31.js";function v(o,b=1e-4){b=Math.max(b,Number.EPSILON);const i={},h=o.getIndex(),r=o.getAttribute("position"),g=h?h.count:r.count;let e=0;const u=Object.keys(o.attributes),a={},x={},M=[],p=["getX","getY","getZ","getW"];for(let n=0,f=u.length;n<f;n++){const t=u[n];a[t]=[];const s=o.morphAttributes[t];s&&(x[t]=new Array(s.length).fill(0).map(()=>[]))}const I=Math.log10(1/b),E=Math.pow(10,I);for(let n=0;n<g;n++){const f=h?h.getX(n):n;let t="";for(let s=0,d=u.length;s<d;s++){const m=u[s],c=o.getAttribute(m),l=c.itemSize;for(let A=0;A<l;A++)t+=`${~~(c[p[A]](f)*E)},`}if(t in i)M.push(i[t]);else{for(let s=0,d=u.length;s<d;s++){const m=u[s],c=o.getAttribute(m),l=o.morphAttributes[m],A=c.itemSize,w=a[m],V=x[m];for(let X=0;X<A;X++){const B=p[X];if(w.push(c[B](f)),l)for(let D=0,G=l.length;D<G;D++)V[D].push(l[D][B](f))}}i[t]=e,M.push(e),e++}}const T=o.clone();for(let n=0,f=u.length;n<f;n++){const t=u[n],s=o.getAttribute(t),d=new s.array.constructor(a[t]),m=new N(d,s.itemSize,s.normalized);if(T.setAttribute(t,m),t in x)for(let c=0;c<x[t].length;c++){const l=o.morphAttributes[t][c],A=new l.array.constructor(x[t][c]),w=new N(A,l.itemSize,l.normalized);T.morphAttributes[t][c]=w}}return T.setIndex(M),T}function y(o,b){if(b===U)return console.warn("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Geometry already defined as triangles."),o;if(b===S||b===k){let i=o.getIndex();if(i===null){const e=[],u=o.getAttribute("position");if(u!==void 0){for(let a=0;a<u.count;a++)e.push(a);o.setIndex(e),i=o.getIndex()}else return console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Undefined position attribute. Processing not possible."),o}const h=i.count-2,r=[];if(i)if(b===S)for(let e=1;e<=h;e++)r.push(i.getX(0)),r.push(i.getX(e)),r.push(i.getX(e+1));else for(let e=0;e<h;e++)e%2===0?(r.push(i.getX(e)),r.push(i.getX(e+1)),r.push(i.getX(e+2))):(r.push(i.getX(e+2)),r.push(i.getX(e+1)),r.push(i.getX(e)));r.length/3!==h&&console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Unable to generate correct amount of triangles.");const g=o.clone();return g.setIndex(r),g.clearGroups(),g}else return console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Unknown draw mode:",b),o}function H(o,b=Math.PI/3){const i=Math.cos(b),h=(1+1e-10)*100,r=[new z,new z,new z],g=new z,e=new z,u=new z,a=new z;function x(n){const f=~~(n.x*h),t=~~(n.y*h),s=~~(n.z*h);return`${f},${t},${s}`}const M=o.index?o.toNonIndexed():o,p=M.attributes.position,I={};for(let n=0,f=p.count/3;n<f;n++){const t=3*n,s=r[0].fromBufferAttribute(p,t+0),d=r[1].fromBufferAttribute(p,t+1),m=r[2].fromBufferAttribute(p,t+2);g.subVectors(m,d),e.subVectors(s,d);const c=new z().crossVectors(g,e).normalize();for(let l=0;l<3;l++){const A=r[l],w=x(A);w in I||(I[w]=[]),I[w].push(c)}}const E=new Float32Array(p.count*3),T=new N(E,3,!1);for(let n=0,f=p.count/3;n<f;n++){const t=3*n,s=r[0].fromBufferAttribute(p,t+0),d=r[1].fromBufferAttribute(p,t+1),m=r[2].fromBufferAttribute(p,t+2);g.subVectors(m,d),e.subVectors(s,d),u.crossVectors(g,e).normalize();for(let c=0;c<3;c++){const l=r[c],A=x(l),w=I[A];a.set(0,0,0);for(let V=0,X=w.length;V<X;V++){const B=w[V];u.dot(B)>i&&a.add(B)}a.normalize(),T.setXYZ(t+c,a.x,a.y,a.z)}}return M.setAttribute("normal",T),M}export{y as a,v as m,H as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{O as I,
|
|
1
|
+
import{O as I,z as O,x as B,v as A,aW as E,a as D,Q as S,V as k,M as V,be as H,ax as K,ay as U}from"./three.module-IFn-4i31.js";const L=new S,T=new k,_=new k,z=new k,W=new k,q=new k,j=new S,R=new k,G=new k,C=new k,w=new D;class X{constructor(e,n=[]){this.mesh=e,this.iks=n,this._initialQuaternions=[],this._workingQuaternion=new S;for(const t of n){const o=[];for(let l=0;l<t.links.length;l++)o.push(new S);this._initialQuaternions.push(o)}this._valid()}update(e=1){const n=this.iks;for(let t=0,o=n.length;t<o;t++)this.updateOne(n[t],e);return this}updateOne(e,n=1){const t=e.blendFactor!==void 0?e.blendFactor:n,o=this.mesh.skeleton.bones,l=this.iks.indexOf(e),d=this._initialQuaternions[l],u=Math,s=o[e.effector],c=o[e.target];T.setFromMatrixPosition(c.matrixWorld);const i=e.links,x=e.iteration!==void 0?e.iteration:1;if(t<1)for(let r=0;r<i.length;r++){const m=i[r].index;d[r].copy(o[m].quaternion)}for(let r=0;r<x;r++){let m=!1;for(let a=0,p=i.length;a<p;a++){const h=o[i[a].index];if(i[a].enabled===!1)break;const g=i[a].limitation,y=i[a].rotationMin,v=i[a].rotationMax;h.matrixWorld.decompose(q,j,R),j.invert(),z.setFromMatrixPosition(s.matrixWorld),W.subVectors(z,q),W.applyQuaternion(j),W.normalize(),_.subVectors(T,q),_.applyQuaternion(j),_.normalize();let f=_.dot(W);if(f>1?f=1:f<-1&&(f=-1),f=u.acos(f),!(f<1e-5)){if(e.minAngle!==void 0&&f<e.minAngle&&(f=e.minAngle),e.maxAngle!==void 0&&f>e.maxAngle&&(f=e.maxAngle),G.crossVectors(W,_),G.normalize(),L.setFromAxisAngle(G,f),h.quaternion.multiply(L),g!==void 0){let b=h.quaternion.w;b>1&&(b=1);const F=u.sqrt(1-b*b);h.quaternion.set(g.x*F,g.y*F,g.z*F,b)}y!==void 0&&h.rotation.setFromVector3(C.setFromEuler(h.rotation).max(y)),v!==void 0&&h.rotation.setFromVector3(C.setFromEuler(h.rotation).min(v)),h.updateMatrixWorld(!0),m=!0}}if(!m)break}if(t<1)for(let r=0;r<i.length;r++){const m=i[r].index,a=o[m];this._workingQuaternion.copy(d[r]).slerp(a.quaternion,t),a.quaternion.copy(this._workingQuaternion),a.updateMatrixWorld(!0)}return this}createHelper(e){return new J(this.mesh,this.iks,e)}_valid(){const e=this.iks,n=this.mesh.skeleton.bones;for(let t=0,o=e.length;t<o;t++){const l=e[t],d=n[l.effector],u=l.links;let s,c;s=d;for(let i=0,x=u.length;i<x;i++)c=n[u[i].index],s.parent!==c&&console.warn("THREE.CCDIKSolver: bone "+s.name+" is not the child of bone "+c.name),s=c}}}function Q(M,e){return C.setFromMatrixPosition(M.matrixWorld).applyMatrix4(e)}function P(M,e,n,t){const o=Q(n,t);M[e*3+0]=o.x,M[e*3+1]=o.y,M[e*3+2]=o.z}class J extends I{constructor(e,n=[],t=.25){super(),this.root=e,this.iks=n,this.matrix.copy(e.matrixWorld),this.matrixAutoUpdate=!1,this.sphereGeometry=new O(t,16,8),this.targetSphereMaterial=new B({color:new A(16746632),depthTest:!1,depthWrite:!1,transparent:!0}),this.effectorSphereMaterial=new B({color:new A(8978312),depthTest:!1,depthWrite:!1,transparent:!0}),this.linkSphereMaterial=new B({color:new A(8947967),depthTest:!1,depthWrite:!1,transparent:!0}),this.lineMaterial=new E({color:new A(16711680),depthTest:!1,depthWrite:!1,transparent:!0}),this._init()}updateMatrixWorld(e){const n=this.root;if(this.visible){let t=0;const o=this.iks,l=n.skeleton.bones;w.copy(n.matrixWorld).invert();for(let d=0,u=o.length;d<u;d++){const s=o[d],c=l[s.target],i=l[s.effector],x=this.children[t++],r=this.children[t++];x.position.copy(Q(c,w)),r.position.copy(Q(i,w));for(let p=0,h=s.links.length;p<h;p++){const g=s.links[p],y=l[g.index];this.children[t++].position.copy(Q(y,w))}const m=this.children[t++],a=m.geometry.attributes.position.array;P(a,0,c,w),P(a,1,i,w);for(let p=0,h=s.links.length;p<h;p++){const g=s.links[p],y=l[g.index];P(a,p+2,y,w)}m.geometry.attributes.position.needsUpdate=!0}}this.matrix.copy(n.matrixWorld),super.updateMatrixWorld(e)}dispose(){this.sphereGeometry.dispose(),this.targetSphereMaterial.dispose(),this.effectorSphereMaterial.dispose(),this.linkSphereMaterial.dispose(),this.lineMaterial.dispose();const e=this.children;for(let n=0;n<e.length;n++){const t=e[n];t.isLine&&t.geometry.dispose()}}_init(){const e=this,n=this.iks;function t(s){const c=new K,i=new Float32Array((2+s.links.length)*3);return c.setAttribute("position",new U(i,3)),c}function o(){return new V(e.sphereGeometry,e.targetSphereMaterial)}function l(){return new V(e.sphereGeometry,e.effectorSphereMaterial)}function d(){return new V(e.sphereGeometry,e.linkSphereMaterial)}function u(s){return new H(t(s),e.lineMaterial)}for(let s=0,c=n.length;s<c;s++){const i=n[s];this.add(o()),this.add(l());for(let x=0,r=i.links.length;x<r;x++)this.add(d());this.add(u(i))}}}export{J as CCDIKHelper,X as CCDIKSolver};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as _,V as $,Q as A,O as H}from"./three.module-
|
|
1
|
+
import{a as _,V as $,Q as A,O as H}from"./three.module-IFn-4i31.js";const W=new $,R=new A,M=new $;class V extends H{constructor(i=document.createElement("div")){super(),this.isCSS3DObject=!0,this.element=i,this.element.style.position="absolute",this.element.style.pointerEvents="auto",this.element.style.userSelect="none",this.element.setAttribute("draggable",!1),this.addEventListener("removed",function(){this.traverse(function(l){l.element instanceof l.element.ownerDocument.defaultView.Element&&l.element.parentNode!==null&&l.element.remove()})})}copy(i,l){return super.copy(i,l),this.element=i.element.cloneNode(!0),this}}class k extends V{constructor(i){super(i),this.isCSS3DSprite=!0,this.rotation2D=0}copy(i,l){return super.copy(i,l),this.rotation2D=i.rotation2D,this}}const r=new _,I=new _;class z{constructor(i={}){const l=this;let m,c,g,x;const y={camera:{style:""},objects:new WeakMap},f=i.element!==void 0?i.element:document.createElement("div");f.style.overflow="hidden",this.domElement=f;const o=document.createElement("div");o.style.transformOrigin="0 0",o.style.pointerEvents="none",f.appendChild(o);const a=document.createElement("div");a.style.transformStyle="preserve-3d",o.appendChild(a),this.getSize=function(){return{width:m,height:c}},this.render=function(t,e){const s=e.projectionMatrix.elements[5]*x;e.view&&e.view.enabled?(o.style.transform=`translate( ${-e.view.offsetX*(m/e.view.width)}px, ${-e.view.offsetY*(c/e.view.height)}px )`,o.style.transform+=`scale( ${e.view.fullWidth/e.view.width}, ${e.view.fullHeight/e.view.height} )`):o.style.transform="",t.matrixWorldAutoUpdate===!0&&t.updateMatrixWorld(),e.parent===null&&e.matrixWorldAutoUpdate===!0&&e.updateMatrixWorld();let v,d;e.isOrthographicCamera&&(v=-(e.right+e.left)/2,d=(e.top+e.bottom)/2);const p=e.view&&e.view.enabled?e.view.height/e.view.fullHeight:1,h=e.isOrthographicCamera?`scale( ${p} )scale(`+s+")translate("+n(v)+"px,"+n(d)+"px)"+C(e.matrixWorldInverse):`scale( ${p} )translateZ(`+s+"px)"+C(e.matrixWorldInverse),u=(e.isPerspectiveCamera?"perspective("+s+"px) ":"")+h+"translate("+g+"px,"+x+"px)";y.camera.style!==u&&(a.style.transform=u,y.camera.style=u),E(t,t,e)},this.setSize=function(t,e){m=t,c=e,g=m/2,x=c/2,f.style.width=t+"px",f.style.height=e+"px",o.style.width=t+"px",o.style.height=e+"px",a.style.width=t+"px",a.style.height=e+"px"};function n(t){return Math.abs(t)<1e-10?0:t}function C(t){const e=t.elements;return"matrix3d("+n(e[0])+","+n(-e[1])+","+n(e[2])+","+n(e[3])+","+n(e[4])+","+n(-e[5])+","+n(e[6])+","+n(e[7])+","+n(e[8])+","+n(-e[9])+","+n(e[10])+","+n(e[11])+","+n(e[12])+","+n(-e[13])+","+n(e[14])+","+n(e[15])+")"}function D(t){const e=t.elements;return"translate(-50%,-50%)"+("matrix3d("+n(e[0])+","+n(e[1])+","+n(e[2])+","+n(e[3])+","+n(-e[4])+","+n(-e[5])+","+n(-e[6])+","+n(-e[7])+","+n(e[8])+","+n(e[9])+","+n(e[10])+","+n(e[11])+","+n(e[12])+","+n(e[13])+","+n(e[14])+","+n(e[15])+")")}function O(t){t.isCSS3DObject&&(t.element.style.display="none");for(let e=0,s=t.children.length;e<s;e++)O(t.children[e])}function E(t,e,s,v){if(t.visible===!1){O(t);return}if(t.isCSS3DObject){const d=t.layers.test(s.layers)===!0,p=t.element;if(p.style.display=d===!0?"":"none",d===!0){t.onBeforeRender(l,e,s);let h;t.isCSS3DSprite?(r.copy(s.matrixWorldInverse),r.transpose(),t.rotation2D!==0&&r.multiply(I.makeRotationZ(t.rotation2D)),t.matrixWorld.decompose(W,R,M),r.setPosition(W),r.scale(M),r.elements[3]=0,r.elements[7]=0,r.elements[11]=0,r.elements[15]=1,h=D(r)):h=D(t.matrixWorld);const S=y.objects.get(t);if(S===void 0||S.style!==h){p.style.transform=h;const u={style:h};y.objects.set(t,u)}p.parentNode!==a&&a.appendChild(p),t.onAfterRender(l,e,s)}}for(let d=0,p=t.children.length;d<p;d++)E(t.children[d],e,s)}}}export{V as CSS3DObject,z as CSS3DRenderer,k as CSS3DSprite};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{g6 as B,bq as N,br as D,g7 as $,bO as X,bP as R,c7 as T,g8 as _,dG as Y,bU as W,bV as S,a6 as z,g9 as H,c6 as K,a5 as L,bW as Z,ga as U,gb as q}from"./index-Ckxb31Yz.js";import{a as c}from"./jsx-runtime-DPjLkJKQ.js";import{r as b}from"./index-nmcBqr7Y.js";import"./index-CtzuWnCS.js";import{s as J,c as Q,a as ee,r as te,m as G,b as oe}from"./RootSelectionOverlay-BxvsunO4.js";import{a as ne}from"./Toolbar-keHcSvDD.js";import{T as re}from"./TransientHint-Dlslh3oX.js";const V=.1,O=4,F=.002,se=4;function I(e,o,r){return o===1?e*16:o===2?e*r:e}function ae(e,o){let r=I(o.deltaX,o.deltaMode,o.bounds.width),a=I(o.deltaY,o.deltaMode,o.bounds.height);if(o.ctrlKey||o.metaKey){const n=Math.min(O,Math.max(V,e.zoom*Math.exp(-a*F))),i=o.clientX-o.bounds.left,g=o.clientY-o.bounds.top,h=(i-e.x)/e.zoom,u=(g-e.y)/e.zoom;return{x:i-h*n,y:g-u*n,zoom:n}}return o.shiftKey&&r===0&&(r=a,a=0),{x:e.x-r,y:e.y-a,zoom:e.zoom}}function ie(e,o){const r=I(o.deltaY,o.deltaMode,o.bounds.height),a=Math.min(O,Math.max(V,e.zoom*Math.exp(-r*F))),n=o.clientX-o.bounds.left,i=o.clientY-o.bounds.top,g=(n-e.x)/e.zoom,h=(i-e.y)/e.zoom;return{x:n-g*a,y:i-h*a,zoom:a}}function C(e){return e instanceof Element&&e.closest('[data-vgai-canvas-navigation-ignore="true"]')!==null}function k(e,o,r,a={}){let n=null,i=!1,g="";const h=()=>e.querySelector('[data-testid="world-selection-overlay-interaction"]'),u=t=>{e.dataset.canvasPanning=t?"true":"false",e.style.cursor=t?"grabbing":"";const d=h();d&&(t?(g=d.style.cursor,d.style.cursor="grabbing"):d.style.cursor=g)},f=t=>{if(!n||t.pointerId!==n.pointerId)return;const d=n.button===1?4:2;if((t.buttons&d)===0){m(t);return}const v=t.clientX-n.startClientX,y=t.clientY-n.startClientY;if(!n.moved){if(Math.hypot(v,y)<=se)return;n.moved=!0,u(!0)}o.setPan(n.startPan.x+v,n.startPan.y+y)},m=t=>{if(!n||t.pointerId!==n.pointerId)return;const d=n.pointerId;n.button===2&&n.moved&&(i=!0),n=null,u(!1),e.hasPointerCapture?.(d)&&e.releasePointerCapture(d),window.removeEventListener("pointermove",f),window.removeEventListener("pointerup",m),window.removeEventListener("pointercancel",m)},s=t=>{const d=t.button===1,v=a.rightDragPans===!0&&t.button===2;!d&&!v||C(t.target)||(v&&(i=!1),t.preventDefault(),d&&t.stopPropagation(),n={pointerId:t.pointerId,button:t.button,startClientX:t.clientX,startClientY:t.clientY,startPan:o.get(),moved:d},e.setPointerCapture?.(t.pointerId),u(d),window.addEventListener("pointermove",f),window.addEventListener("pointerup",m),window.addEventListener("pointercancel",m))},l=t=>{t.button===1&&!C(t.target)&&t.preventDefault()},p=t=>{a.rightDragPans!==!0||!(n?.button===2&&n.moved)&&!i||(i=!1,t.preventDefault(),t.stopPropagation())},x=t=>{if(C(t.target))return;t.preventDefault(),t.stopPropagation();const d=r(o.get(),{clientX:t.clientX,clientY:t.clientY,deltaX:t.deltaX,deltaY:t.deltaY,deltaMode:t.deltaMode,ctrlKey:t.ctrlKey,metaKey:t.metaKey,shiftKey:t.shiftKey,bounds:e.getBoundingClientRect()});o.setView(d.x,d.y,d.zoom)};return e.addEventListener("pointerdown",s,!0),e.addEventListener("lostpointercapture",m,!0),e.addEventListener("mousedown",l,!0),e.addEventListener("contextmenu",p,!0),e.addEventListener("wheel",x,{capture:!0,passive:!1}),()=>{n=null,u(!1),e.removeEventListener("pointerdown",s,!0),e.removeEventListener("lostpointercapture",m,!0),e.removeEventListener("mousedown",l,!0),e.removeEventListener("contextmenu",p,!0),e.removeEventListener("wheel",x,!0),window.removeEventListener("pointermove",f),window.removeEventListener("pointerup",m),window.removeEventListener("pointercancel",m)}}function fe(e,o=B){return k(e,o,ae)}function xe(e,o){return k(e,o,ie,{rightDragPans:!0})}const ve="#111214";function A(e){let o=32;for(;o*e<12;)o*=2;for(;o*e>48;)o/=2;return o}function le(e){return A(e)*e}function M(e){if(e.length===0)return null;let o=Number.POSITIVE_INFINITY,r=Number.POSITIVE_INFINITY,a=Number.NEGATIVE_INFINITY,n=Number.NEGATIVE_INFINITY;for(const i of e)o=Math.min(o,i.x),r=Math.min(r,i.y),a=Math.max(a,i.x+i.width),n=Math.max(n,i.y+i.height);return{x:o,y:r,width:a-o,height:n-r}}function j(e,o,r){if(!r||!(r.width>0)||!(r.height>0))return;const a=Math.max(1,e.clientWidth-96),n=Math.max(1,e.clientHeight-96),i=Math.min(4,Math.max(.1,Math.min(a/r.width,n/r.height)));o.setView(e.clientWidth/2-(r.x+r.width/2)*i,e.clientHeight/2-(r.y+r.height/2)*i,i)}function ye({view:e,documentId:o}){const r=N(D());b.useSyncExternalStore(r.subscribe,r.getSnapshot),b.useEffect(()=>$(o,"canvas"),[o]),b.useSyncExternalStore(X,R);const a=T(o),n=b.useSyncExternalStore(e.subscribe,e.get,e.get);b.useSyncExternalStore(b.useCallback(u=>J(e,u),[e]),b.useCallback(()=>Q(e),[e]));const i=ee(e),g=le(n.zoom),h=g*4;return c.jsxs("div",{"data-testid":"canvas-scene-backdrop",style:{position:"absolute",inset:0,zIndex:2,overflow:"hidden",pointerEvents:"none"},children:[a&&c.jsx("div",{style:{position:"absolute",inset:0,backgroundImage:"linear-gradient(rgba(255,255,255,.075) 1px, transparent 1px),linear-gradient(90deg, rgba(255,255,255,.075) 1px, transparent 1px),linear-gradient(rgba(255,255,255,.14) 1px, transparent 1px),linear-gradient(90deg, rgba(255,255,255,.14) 1px, transparent 1px)",backgroundPosition:`${n.x}px ${n.y}px`,backgroundSize:`${g}px ${g}px, ${g}px ${g}px, ${h}px ${h}px, ${h}px ${h}px`}}),c.jsx("div",{"data-testid":"canvas-scene-origin-y",style:{position:"absolute",left:0,right:0,top:n.y,height:1,background:"rgba(238, 91, 91, .8)"}}),c.jsx("div",{"data-testid":"canvas-scene-origin-x",style:{position:"absolute",top:0,bottom:0,left:n.x,width:1,background:"rgba(87, 199, 126, .8)"}}),c.jsx("div",{style:{position:"absolute",left:n.x+6,top:n.y+6,color:"rgba(255,255,255,.68)",font:"10px ui-monospace, SFMono-Regular, Menlo, monospace"},children:"0, 0"}),i.map(u=>c.jsx("div",{"data-testid":`canvas-scene-guide-${u.axis}`,title:`${u.axis.toUpperCase()} ${Math.round(u.value*100)/100} · drag to move · right-click to remove`,onContextMenu:f=>{f.preventDefault(),te(e,u.id)},onPointerDown:f=>{f.preventDefault(),f.stopPropagation();const m=f.currentTarget.parentElement?.getBoundingClientRect();if(!m)return;const s=p=>{const x=u.axis==="x"?p.clientX-m.left:p.clientY-m.top,t=e.get();G(e,u.id,(x-(u.axis==="x"?t.x:t.y))/t.zoom)},l=()=>{window.removeEventListener("pointermove",s),window.removeEventListener("pointerup",l)};window.addEventListener("pointermove",s),window.addEventListener("pointerup",l,{once:!0})},style:{position:"absolute",pointerEvents:"auto",cursor:u.axis==="x"?"ew-resize":"ns-resize",...u.axis==="x"?{left:n.x+u.value*n.zoom-4,top:20,bottom:0,width:9,borderLeft:"1px solid rgba(74, 180, 255, .95)"}:{top:n.y+u.value*n.zoom-4,left:20,right:0,height:9,borderTop:"1px solid rgba(74, 180, 255, .95)"}}},u.id)),c.jsx(ce,{view:e})]})}function ce({view:e}){const o=b.useSyncExternalStore(e.subscribe,e.get,e.get),r=b.useRef(null),a=b.useRef(null),[n,i]=b.useState({width:0,height:0});b.useEffect(()=>{const s=()=>{const p=r.current?.clientWidth??0,x=a.current?.clientHeight??0;i(t=>t.width===p&&t.height===x?t:{width:p,height:x})};if(s(),typeof ResizeObserver>"u")return;const l=new ResizeObserver(s);return r.current&&l.observe(r.current),a.current&&l.observe(a.current),()=>l.disconnect()},[]);const g=(s,l)=>{if(!(l>0))return[];const p=s==="x"?o.x:o.y,x=A(o.zoom),t=x*o.zoom,d=20,v=Math.ceil((d-p)/t),y=Math.floor((d+l-p)/t);return Array.from({length:Math.max(0,y-v+1)},(P,E)=>{const w=v+E;return{major:w%4===0,screen:p+w*t-d,value:w*x}})},h=g("x",n.width),u=g("y",n.height),f=(s,l)=>{l.preventDefault(),l.stopPropagation();const p=l.currentTarget.parentElement?.getBoundingClientRect();if(!p)return;const x=(y,P)=>{const E=e.get();return((s==="x"?y-p.left:P-p.top)-(s==="x"?E.x:E.y))/E.zoom},t=oe(e,s,x(l.clientX,l.clientY)),d=y=>G(e,t,x(y.clientX,y.clientY)),v=()=>{window.removeEventListener("pointermove",d),window.removeEventListener("pointerup",v)};window.addEventListener("pointermove",d),window.addEventListener("pointerup",v,{once:!0})},m={position:"absolute",pointerEvents:"auto",backgroundColor:"rgba(24, 26, 30, .96)",border:0,borderColor:"rgba(255,255,255,.14)",boxSizing:"border-box"};return c.jsxs(c.Fragment,{children:[c.jsx("button",{ref:r,type:"button","data-testid":"canvas-scene-ruler-x","aria-label":"Horizontal ruler; drag to create a horizontal guide",onPointerDown:s=>f("y",s),style:{...m,left:20,right:0,top:0,height:20,borderBottomStyle:"solid",borderBottomWidth:1,cursor:"row-resize",padding:0,overflow:"hidden"},children:h.map(s=>c.jsx("span",{"aria-hidden":"true","data-ruler-axis":"x","data-ruler-value":s.value,style:{position:"absolute",left:s.screen,bottom:0,width:1,height:s.major?8:4,background:s.major?"rgba(255,255,255,.5)":"rgba(255,255,255,.28)",pointerEvents:"none"},children:s.major&&c.jsx("span",{style:{position:"absolute",left:3,bottom:5,color:"rgba(255,255,255,.62)",font:"9px ui-monospace, SFMono-Regular, Menlo, monospace",lineHeight:1,whiteSpace:"nowrap"},children:s.value})},s.value))}),c.jsx("button",{ref:a,type:"button","data-testid":"canvas-scene-ruler-y","aria-label":"Vertical ruler; drag to create a vertical guide",onPointerDown:s=>f("x",s),style:{...m,top:20,bottom:0,left:0,width:20,borderRightStyle:"solid",borderRightWidth:1,cursor:"col-resize",padding:0,overflow:"hidden"},children:u.map(s=>c.jsx("span",{"aria-hidden":"true","data-ruler-axis":"y","data-ruler-value":s.value,style:{position:"absolute",top:s.screen,right:0,width:s.major?8:4,height:1,background:s.major?"rgba(255,255,255,.5)":"rgba(255,255,255,.28)",pointerEvents:"none"},children:s.major&&c.jsx("span",{style:{position:"absolute",right:4,top:3,color:"rgba(255,255,255,.62)",font:"9px ui-monospace, SFMono-Regular, Menlo, monospace",lineHeight:1,whiteSpace:"nowrap",writingMode:"vertical-rl",transform:"rotate(180deg)"},children:s.value})},s.value))}),c.jsx("div",{style:{...m,left:0,top:0,width:20,height:20}})]})}function Ee({active:e,adapter:o,containerRef:r,view:a,documentId:n}){const i=N(D());b.useSyncExternalStore(i.subscribe,i.getSnapshot),b.useSyncExternalStore(X,R);const g=T(n),h=b.useSyncExternalStore(a.subscribe,a.get,a.get),u=b.useCallback(l=>{const p=r.current;if(!p)return;const x=Math.min(4,Math.max(.1,l)),t=p.clientWidth/2,d=p.clientHeight/2,v=(t-h.x)/h.zoom,y=(d-h.y)/h.zoom;a.setView(t-v*x,d-y*x,x)},[r,h,a]),f=b.useCallback(l=>{if(!o?.rects)return[];const p=[];for(const x of l){const t=o.rects.rect(x);t&&t.width>0&&t.height>0&&p.push(t)}return p},[o]),m=b.useCallback(()=>{const l=r.current;l&&j(l,a,M(f(i.selectedEntityIds)))},[r,f,i,a]),s=b.useCallback(()=>{const l=r.current;!l||!o||j(l,a,M(f(_(o))))},[o,r,f,a]);return b.useEffect(()=>{if(e)return i.onViewportAction(l=>{if(l.type==="focus-entity"){const p=r.current;if(!p)return;j(p,a,M(f([l.id])))}else l.type==="focus-selection"?m():l.type==="focus-scene"&&s()})},[e,r,s,m,f,i,a]),c.jsxs(c.Fragment,{children:[c.jsx(re,{}),c.jsx(ne,{dimensions:"2d"}),c.jsxs(Y,{label:"2D scene display",className:"vgai-viewport-toolbar vgai-viewport-toolbar-right","data-vgai-canvas-navigation-ignore":"true",children:[c.jsx(W,{text:`Grid: ${g?"On":"Off"}`,children:c.jsx(S,{"aria-label":"Toggle 2D grid","aria-pressed":g,size:"comfortable",onClick:()=>K(n,!g),children:c.jsx(z,{icon:H,size:"md"})})}),c.jsx(L,{"aria-label":"Frame all",variant:"ghost",size:"comfortable",onClick:s,children:"Frame all"})]}),c.jsxs(Y,{label:"2D scene navigation",className:"vgai-canvas-scene-navigation","data-vgai-canvas-navigation-ignore":"true",children:[c.jsx(S,{"aria-label":"Frame selection",title:"Frame selection",size:"comfortable",disabled:i.selectedEntityIds.size===0,onClick:m,children:c.jsx(z,{icon:Z,size:"md"})}),c.jsx(S,{"aria-label":"Zoom out",title:"Zoom out",size:"comfortable",onClick:()=>u(h.zoom/1.2),children:c.jsx(z,{icon:U,size:"md"})}),c.jsxs(L,{variant:"ghost","aria-label":"Reset zoom to 100%",title:"Reset zoom to 100%",size:"comfortable",onClick:()=>u(1),children:[Math.round(h.zoom*100),"%"]}),c.jsx(S,{"aria-label":"Zoom in",title:"Zoom in",size:"comfortable",onClick:()=>u(h.zoom*1.2),children:c.jsx(z,{icon:q,size:"md"})})]})]})}export{ve as C,fe as a,ye as b,Ee as c,xe as i};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import{bZ as kn,ar as wn,ae as it,a$ as Nn,af as An,V as $,a as X,x as rt,t as Tn,e as En,v as at,o as pe,d as ot,b_ as _n,aY as ct,b0 as Ee,r as ee,g as xn,al as Cn,am as vn,u as lt,an as In,bK as Ln,bD as Rn,bE as Mn,bA as Sn,aU as dt,Q as Gn,b as ut,c as On,ax as jn,aV as ne,b3 as qn,aW as ft,bV as Pn,M as Hn,be as Un,aZ as Bn,b2 as zn,I as _e,ag as ht}from"./three.module-IFn-4i31.js";class pt extends kn{constructor(D){super(D)}parse(D){function se(h){switch(h.image_type){case me:case z:if(h.colormap_length>256||h.colormap_size!==24||h.colormap_type!==1)throw new Error("THREE.TGALoader: Invalid type colormap data for indexed type.");break;case B:case V:case ue:case be:if(h.colormap_type)throw new Error("THREE.TGALoader: Invalid type colormap data for colormap type.");break;case Ce:throw new Error("THREE.TGALoader: No data.");default:throw new Error("THREE.TGALoader: Invalid type "+h.image_type)}if(h.width<=0||h.height<=0)throw new Error("THREE.TGALoader: Invalid image size.");if(h.pixel_size!==8&&h.pixel_size!==16&&h.pixel_size!==24&&h.pixel_size!==32)throw new Error("THREE.TGALoader: Invalid pixel size "+h.pixel_size)}function U(h,q,R,C,P){let _,v;const A=R.pixel_size>>3,N=R.width*R.height*A;if(q&&(v=P.subarray(C,C+=R.colormap_length*(R.colormap_size>>3))),h){_=new Uint8Array(N);let y,u,k,M=0;const W=new Uint8Array(A);for(;M<N;)if(y=P[C++],u=(y&127)+1,y&128){for(k=0;k<A;++k)W[k]=P[C++];for(k=0;k<u;++k)_.set(W,M+k*A);M+=A*u}else{for(u*=A,k=0;k<u;++k)_[M+k]=P[C++];M+=u}}else _=P.subarray(C,C+=q?R.width*R.height:N);return{pixel_data:_,palettes:v}}function te(h,q,R,C,P,_,v,A,N){const y=N;let u,k=0,M,W;const ae=j.width;for(W=q;W!==C;W+=R)for(M=P;M!==v;M+=_,k++)u=A[k],h[(M+ae*W)*4+3]=255,h[(M+ae*W)*4+2]=y[u*3+0],h[(M+ae*W)*4+1]=y[u*3+1],h[(M+ae*W)*4+0]=y[u*3+2];return h}function I(h,q,R,C,P,_,v,A){let N,y=0,u,k;const M=j.width;for(k=q;k!==C;k+=R)for(u=P;u!==v;u+=_,y+=2)N=A[y+0]+(A[y+1]<<8),h[(u+M*k)*4+0]=(N&31744)>>7,h[(u+M*k)*4+1]=(N&992)>>2,h[(u+M*k)*4+2]=(N&31)<<3,h[(u+M*k)*4+3]=N&32768?0:255;return h}function Z(h,q,R,C,P,_,v,A){let N=0,y,u;const k=j.width;for(u=q;u!==C;u+=R)for(y=P;y!==v;y+=_,N+=3)h[(y+k*u)*4+3]=255,h[(y+k*u)*4+2]=A[N+0],h[(y+k*u)*4+1]=A[N+1],h[(y+k*u)*4+0]=A[N+2];return h}function S(h,q,R,C,P,_,v,A){let N=0,y,u;const k=j.width;for(u=q;u!==C;u+=R)for(y=P;y!==v;y+=_,N+=4)h[(y+k*u)*4+2]=A[N+0],h[(y+k*u)*4+1]=A[N+1],h[(y+k*u)*4+0]=A[N+2],h[(y+k*u)*4+3]=A[N+3];return h}function de(h,q,R,C,P,_,v,A){let N,y=0,u,k;const M=j.width;for(k=q;k!==C;k+=R)for(u=P;u!==v;u+=_,y++)N=A[y],h[(u+M*k)*4+0]=N,h[(u+M*k)*4+1]=N,h[(u+M*k)*4+2]=N,h[(u+M*k)*4+3]=255;return h}function Q(h,q,R,C,P,_,v,A){let N=0,y,u;const k=j.width;for(u=q;u!==C;u+=R)for(y=P;y!==v;y+=_,N+=2)h[(y+k*u)*4+0]=A[N+0],h[(y+k*u)*4+1]=A[N+0],h[(y+k*u)*4+2]=A[N+0],h[(y+k*u)*4+3]=A[N+1];return h}function xe(h,q,R,C,P){let _,v,A,N,y,u;switch((j.flags&ve)>>ge){default:case Le:_=0,A=1,y=q,v=0,N=1,u=R;break;case ye:_=0,A=1,y=q,v=R-1,N=-1,u=-1;break;case ie:_=q-1,A=-1,y=-1,v=0,N=1,u=R;break;case Ie:_=q-1,A=-1,y=-1,v=R-1,N=-1,u=-1;break}if(he)switch(j.pixel_size){case 8:de(h,v,N,u,_,A,y,C);break;case 16:Q(h,v,N,u,_,A,y,C);break;default:throw new Error("THREE.TGALoader: Format not supported.")}else switch(j.pixel_size){case 8:te(h,v,N,u,_,A,y,C,P);break;case 16:I(h,v,N,u,_,A,y,C);break;case 24:Z(h,v,N,u,_,A,y,C);break;case 32:S(h,v,N,u,_,A,y,C);break;default:throw new Error("THREE.TGALoader: Format not supported.")}return h}const Ce=0,me=1,B=2,V=3,z=9,ue=10,be=11,ve=48,ge=4,ye=0,Ie=1,Le=2,ie=3;if(D.length<19)throw new Error("THREE.TGALoader: Not enough data to contain header.");let L=0;const G=new Uint8Array(D),j={id_length:G[L++],colormap_type:G[L++],image_type:G[L++],colormap_index:G[L++]|G[L++]<<8,colormap_length:G[L++]|G[L++]<<8,colormap_size:G[L++],origin:[G[L++]|G[L++]<<8,G[L++]|G[L++]<<8],width:G[L++]|G[L++]<<8,height:G[L++]|G[L++]<<8,pixel_size:G[L++],flags:G[L++]};if(se(j),j.id_length+L>D.length)throw new Error("THREE.TGALoader: No data.");L+=j.id_length;let re=!1,fe=!1,he=!1;switch(j.image_type){case z:re=!0,fe=!0;break;case me:fe=!0;break;case ue:re=!0;break;case B:break;case be:re=!0,he=!0;break;case V:he=!0;break}const ke=new Uint8Array(j.width*j.height*4),we=U(re,fe,j,L,G);return xe(ke,j.width,j.height,we.pixel_data,we.palettes),{data:ke,width:j.width,height:j.height,flipY:!0,generateMipmaps:!0,minFilter:wn}}}class Vn extends it{load(D,se,U,te){const I=this,Z=I.path===""?Nn.extractUrlBase(D):I.path,S=new An(I.manager);S.setPath(I.path),S.setRequestHeader(I.requestHeader),S.setWithCredentials(I.withCredentials),S.load(D,function(de){try{se(I.parse(de,Z))}catch(Q){te?te(Q):console.error(Q),I.manager.itemError(D)}},U,te)}parse(D,se){function U(t,e){const s=[],n=t.childNodes;for(let i=0,r=n.length;i<r;i++){const a=n[i];a.nodeName===e&&s.push(a)}return s}function te(t){if(t.length===0)return[];const e=t.trim().split(/\s+/),s=new Array(e.length);for(let n=0,i=e.length;n<i;n++)s[n]=e[n];return s}function I(t){if(t.length===0)return[];const e=t.trim().split(/\s+/),s=new Array(e.length);for(let n=0,i=e.length;n<i;n++)s[n]=parseFloat(e[n]);return s}function Z(t){if(t.length===0)return[];const e=t.trim().split(/\s+/),s=new Array(e.length);for(let n=0,i=e.length;n<i;n++)s[n]=parseInt(e[n]);return s}function S(t){return t.substring(1)}function de(){return"three_default_"+gn++}function Q(t){return Object.keys(t).length===0}function xe(t){return{unit:Ce(U(t,"unit")[0]),upAxis:me(U(t,"up_axis")[0])}}function Ce(t){return t!==void 0&&t.hasAttribute("meter")===!0?parseFloat(t.getAttribute("meter")):1}function me(t){return t!==void 0?t.textContent:"Y_UP"}function B(t,e,s,n){const i=U(t,e)[0];if(i!==void 0){const r=U(i,s);for(let a=0;a<r.length;a++)n(r[a])}}function V(t,e){for(const s in t){const n=t[s];n.build=e(t[s])}}function z(t,e){return t.build!==void 0||(t.build=e(t)),t.build}function ue(t){const e={sources:{},samplers:{},channels:{}};let s=!1;for(let n=0,i=t.childNodes.length;n<i;n++){const r=t.childNodes[n];if(r.nodeType!==1)continue;let a;switch(r.nodeName){case"source":a=r.getAttribute("id"),e.sources[a]=Re(r);break;case"sampler":a=r.getAttribute("id"),e.samplers[a]=be(r);break;case"channel":a=r.getAttribute("target"),e.channels[a]=ve(r);break;case"animation":ue(r),s=!0;break;default:console.log(r)}}s===!1&&(w.animations[t.getAttribute("id")||pe.generateUUID()]=e)}function be(t){const e={inputs:{}};for(let s=0,n=t.childNodes.length;s<n;s++){const i=t.childNodes[s];if(i.nodeType===1)switch(i.nodeName){case"input":const r=S(i.getAttribute("source")),a=i.getAttribute("semantic");e.inputs[a]=r;break}}return e}function ve(t){const e={};let n=t.getAttribute("target").split("/");const i=n.shift();let r=n.shift();const a=r.indexOf("(")!==-1,d=r.indexOf(".")!==-1;if(d)n=r.split("."),r=n.shift(),e.member=n.shift();else if(a){const c=r.split("(");r=c.shift();for(let l=0;l<c.length;l++)c[l]=parseInt(c[l].replace(/\)/,""));e.indices=c}return e.id=i,e.sid=r,e.arraySyntax=a,e.memberSyntax=d,e.sampler=S(t.getAttribute("source")),e}function ge(t){const e=[],s=t.channels,n=t.samplers,i=t.sources;for(const r in s)if(s.hasOwnProperty(r)){const a=s[r],d=n[a.sampler],c=d.inputs.INPUT,l=d.inputs.OUTPUT,m=i[c],o=i[l],p=Ie(a,m,o);j(p,e)}return e}function ye(t){return z(w.animations[t],ge)}function Ie(t,e,s){const n=w.nodes[t.id],i=ce(n.id),r=n.transforms[t.sid],a=n.matrix.clone().transpose();let d,c,l,m,o,p;const f={};switch(r){case"matrix":for(l=0,m=e.array.length;l<m;l++)if(d=e.array[l],c=l*s.stride,f[d]===void 0&&(f[d]={}),t.arraySyntax===!0){const O=s.array[c],x=t.indices[0]+4*t.indices[1];f[d][x]=O}else for(o=0,p=s.stride;o<p;o++)f[d][o]=s.array[c+o];break;case"translate":console.warn('THREE.ColladaLoader: Animation transform type "%s" not yet implemented.',r);break;case"rotate":console.warn('THREE.ColladaLoader: Animation transform type "%s" not yet implemented.',r);break;case"scale":console.warn('THREE.ColladaLoader: Animation transform type "%s" not yet implemented.',r);break}const g=Le(f,a);return{name:i.uuid,keyframes:g}}function Le(t,e){const s=[];for(const i in t)s.push({time:parseFloat(i),value:t[i]});s.sort(n);for(let i=0;i<16;i++)re(s,i,e.elements[i]);return s;function n(i,r){return i.time-r.time}}const ie=new $,L=new $,G=new Gn;function j(t,e){const s=t.keyframes,n=t.name,i=[],r=[],a=[],d=[];for(let c=0,l=s.length;c<l;c++){const m=s[c],o=m.time,p=m.value;K.fromArray(p).transpose(),K.decompose(ie,G,L),i.push(o),r.push(ie.x,ie.y,ie.z),a.push(G.x,G.y,G.z,G.w),d.push(L.x,L.y,L.z)}return r.length>0&&e.push(new ut(n+".position",i,r)),a.length>0&&e.push(new On(n+".quaternion",i,a)),d.length>0&&e.push(new ut(n+".scale",i,d)),e}function re(t,e,s){let n,i=!0,r,a;for(r=0,a=t.length;r<a;r++)n=t[r],n.value[e]===void 0?n.value[e]=null:i=!1;if(i===!0)for(r=0,a=t.length;r<a;r++)n=t[r],n.value[e]=s;else fe(t,e)}function fe(t,e){let s,n;for(let i=0,r=t.length;i<r;i++){const a=t[i];if(a.value[e]===null){if(s=he(t,i,e),n=ke(t,i,e),s===null){a.value[e]=n.value[e];continue}if(n===null){a.value[e]=s.value[e];continue}we(a,s,n,e)}}}function he(t,e,s){for(;e>=0;){const n=t[e];if(n.value[s]!==null)return n;e--}return null}function ke(t,e,s){for(;e<t.length;){const n=t[e];if(n.value[s]!==null)return n;e++}return null}function we(t,e,s,n){if(s.time-e.time===0){t.value[n]=e.value[n];return}t.value[n]=(t.time-e.time)*(s.value[n]-e.value[n])/(s.time-e.time)+e.value[n]}function h(t){const e={name:t.getAttribute("id")||"default",start:parseFloat(t.getAttribute("start")||0),end:parseFloat(t.getAttribute("end")||0),animations:[]};for(let s=0,n=t.childNodes.length;s<n;s++){const i=t.childNodes[s];if(i.nodeType===1)switch(i.nodeName){case"instance_animation":e.animations.push(S(i.getAttribute("url")));break}}w.clips[t.getAttribute("id")]=e}function q(t){const e=[],s=t.name,n=t.end-t.start||-1,i=t.animations;for(let r=0,a=i.length;r<a;r++){const d=ye(i[r]);for(let c=0,l=d.length;c<l;c++)e.push(d[c])}return new ot(s,n,e)}function R(t){return z(w.clips[t],q)}function C(t){const e={};for(let s=0,n=t.childNodes.length;s<n;s++){const i=t.childNodes[s];if(i.nodeType===1)switch(i.nodeName){case"skin":e.id=S(i.getAttribute("source")),e.skin=P(i);break;case"morph":e.id=S(i.getAttribute("source")),console.warn("THREE.ColladaLoader: Morph target animation not supported yet.");break}}w.controllers[t.getAttribute("id")]=e}function P(t){const e={sources:{}};for(let s=0,n=t.childNodes.length;s<n;s++){const i=t.childNodes[s];if(i.nodeType===1)switch(i.nodeName){case"bind_shape_matrix":e.bindShapeMatrix=I(i.textContent);break;case"source":const r=i.getAttribute("id");e.sources[r]=Re(i);break;case"joints":e.joints=_(i);break;case"vertex_weights":e.vertexWeights=v(i);break}}return e}function _(t){const e={inputs:{}};for(let s=0,n=t.childNodes.length;s<n;s++){const i=t.childNodes[s];if(i.nodeType===1)switch(i.nodeName){case"input":const r=i.getAttribute("semantic"),a=S(i.getAttribute("source"));e.inputs[r]=a;break}}return e}function v(t){const e={inputs:{}};for(let s=0,n=t.childNodes.length;s<n;s++){const i=t.childNodes[s];if(i.nodeType===1)switch(i.nodeName){case"input":const r=i.getAttribute("semantic"),a=S(i.getAttribute("source")),d=parseInt(i.getAttribute("offset"));e.inputs[r]={id:a,offset:d};break;case"vcount":e.vcount=Z(i.textContent);break;case"v":e.v=Z(i.textContent);break}}return e}function A(t){const e={id:t.id},s=w.geometries[e.id];return t.skin!==void 0&&(e.skin=N(t.skin),s.sources.skinIndices=e.skin.indices,s.sources.skinWeights=e.skin.weights),e}function N(t){const s={joints:[],indices:{array:[],stride:4},weights:{array:[],stride:4}},n=t.sources,i=t.vertexWeights,r=i.vcount,a=i.v,d=i.inputs.JOINT.offset,c=i.inputs.WEIGHT.offset,l=t.sources[t.joints.inputs.JOINT],m=t.sources[t.joints.inputs.INV_BIND_MATRIX],o=n[i.inputs.WEIGHT.id].array;let p=0,f,g,b;for(f=0,b=r.length;f<b;f++){const x=r[f],T=[];for(g=0;g<x;g++){const E=a[p+d],Y=a[p+c],F=o[Y];T.push({index:E,weight:F}),p+=2}for(T.sort(O),g=0;g<4;g++){const E=T[g];E!==void 0?(s.indices.array.push(E.index),s.weights.array.push(E.weight)):(s.indices.array.push(0),s.weights.array.push(0))}}for(t.bindShapeMatrix?s.bindMatrix=new X().fromArray(t.bindShapeMatrix).transpose():s.bindMatrix=new X().identity(),f=0,b=l.array.length;f<b;f++){const x=l.array[f],T=new X().fromArray(m.array,f*m.stride).transpose();s.joints.push({name:x,boneInverse:T})}return s;function O(x,T){return T.weight-x.weight}}function y(t){return z(w.controllers[t],A)}function u(t){const e={init_from:U(t,"init_from")[0].textContent};w.images[t.getAttribute("id")]=e}function k(t){return t.build!==void 0?t.build:t.init_from}function M(t){const e=w.images[t];return e!==void 0?z(e,k):(console.warn("THREE.ColladaLoader: Couldn't find image with ID:",t),null)}function W(t){const e={};for(let s=0,n=t.childNodes.length;s<n;s++){const i=t.childNodes[s];if(i.nodeType===1)switch(i.nodeName){case"profile_COMMON":e.profile=ae(i);break}}w.effects[t.getAttribute("id")]=e}function ae(t){const e={surfaces:{},samplers:{}};for(let s=0,n=t.childNodes.length;s<n;s++){const i=t.childNodes[s];if(i.nodeType===1)switch(i.nodeName){case"newparam":bt(i,e);break;case"technique":e.technique=kt(i);break;case"extra":e.extra=qe(i);break}}return e}function bt(t,e){const s=t.getAttribute("sid");for(let n=0,i=t.childNodes.length;n<i;n++){const r=t.childNodes[n];if(r.nodeType===1)switch(r.nodeName){case"surface":e.surfaces[s]=gt(r);break;case"sampler2D":e.samplers[s]=yt(r);break}}}function gt(t){const e={};for(let s=0,n=t.childNodes.length;s<n;s++){const i=t.childNodes[s];if(i.nodeType===1)switch(i.nodeName){case"init_from":e.init_from=i.textContent;break}}return e}function yt(t){const e={};for(let s=0,n=t.childNodes.length;s<n;s++){const i=t.childNodes[s];if(i.nodeType===1)switch(i.nodeName){case"source":e.source=i.textContent;break}}return e}function kt(t){const e={};for(let s=0,n=t.childNodes.length;s<n;s++){const i=t.childNodes[s];if(i.nodeType===1)switch(i.nodeName){case"constant":case"lambert":case"blinn":case"phong":e.type=i.nodeName,e.parameters=wt(i);break;case"extra":e.extra=qe(i);break}}return e}function wt(t){const e={};for(let s=0,n=t.childNodes.length;s<n;s++){const i=t.childNodes[s];if(i.nodeType===1)switch(i.nodeName){case"emission":case"diffuse":case"specular":case"bump":case"ambient":case"shininess":case"transparency":e[i.nodeName]=Oe(i);break;case"transparent":e[i.nodeName]={opaque:i.hasAttribute("opaque")?i.getAttribute("opaque"):"A_ONE",data:Oe(i)};break}}return e}function Oe(t){const e={};for(let s=0,n=t.childNodes.length;s<n;s++){const i=t.childNodes[s];if(i.nodeType===1)switch(i.nodeName){case"color":e[i.nodeName]=I(i.textContent);break;case"float":e[i.nodeName]=parseFloat(i.textContent);break;case"texture":e[i.nodeName]={id:i.getAttribute("texture"),extra:je(i)};break}}return e}function je(t){const e={technique:{}};for(let s=0,n=t.childNodes.length;s<n;s++){const i=t.childNodes[s];if(i.nodeType===1)switch(i.nodeName){case"extra":Nt(i,e);break}}return e}function Nt(t,e){for(let s=0,n=t.childNodes.length;s<n;s++){const i=t.childNodes[s];if(i.nodeType===1)switch(i.nodeName){case"technique":At(i,e);break}}}function At(t,e){for(let s=0,n=t.childNodes.length;s<n;s++){const i=t.childNodes[s];if(i.nodeType===1)switch(i.nodeName){case"repeatU":case"repeatV":case"offsetU":case"offsetV":e.technique[i.nodeName]=parseFloat(i.textContent);break;case"wrapU":case"wrapV":i.textContent.toUpperCase()==="TRUE"?e.technique[i.nodeName]=1:i.textContent.toUpperCase()==="FALSE"?e.technique[i.nodeName]=0:e.technique[i.nodeName]=parseInt(i.textContent);break;case"bump":e[i.nodeName]=Pe(i);break}}}function qe(t){const e={};for(let s=0,n=t.childNodes.length;s<n;s++){const i=t.childNodes[s];if(i.nodeType===1)switch(i.nodeName){case"technique":e.technique=Tt(i);break}}return e}function Tt(t){const e={};for(let s=0,n=t.childNodes.length;s<n;s++){const i=t.childNodes[s];if(i.nodeType===1)switch(i.nodeName){case"double_sided":e[i.nodeName]=parseInt(i.textContent);break;case"bump":e[i.nodeName]=Pe(i);break}}return e}function Pe(t){const e={};for(let s=0,n=t.childNodes.length;s<n;s++){const i=t.childNodes[s];if(i.nodeType===1)switch(i.nodeName){case"texture":e[i.nodeName]={id:i.getAttribute("texture"),texcoord:i.getAttribute("texcoord"),extra:je(i)};break}}return e}function He(t){return t}function Et(t){return z(w.effects[t],He)}function _t(t){const e={name:t.getAttribute("name")};for(let s=0,n=t.childNodes.length;s<n;s++){const i=t.childNodes[s];if(i.nodeType===1)switch(i.nodeName){case"instance_effect":e.url=S(i.getAttribute("url"));break}}w.materials[t.getAttribute("id")]=e}function xt(t){let e,s=t.slice((t.lastIndexOf(".")-1>>>0)+2);switch(s=s.toLowerCase(),s){case"tga":e=Ge;break;default:e=tt}return e}function Ue(t){const e=Et(t.url),s=e.profile.technique;let n;switch(s.type){case"phong":case"blinn":n=new ct;break;case"lambert":n=new _n;break;default:n=new rt;break}n.name=t.name||"";function i(c,l=null){const m=e.profile.samplers[c.id];let o=null;if(m!==void 0){const p=e.profile.surfaces[m.source];o=M(p.init_from)}else console.warn("THREE.ColladaLoader: Undefined sampler. Access image directly (see #12530)."),o=M(c.id);if(o!==null){const p=xt(o);if(p!==void 0){const f=p.load(o),g=c.extra;if(g!==void 0&&g.technique!==void 0&&Q(g.technique)===!1){const b=g.technique;f.wrapS=b.wrapU?_e:ht,f.wrapT=b.wrapV?_e:ht,f.offset.set(b.offsetU||0,b.offsetV||0),f.repeat.set(b.repeatU||1,b.repeatV||1)}else f.wrapS=_e,f.wrapT=_e;return l!==null&&(f.colorSpace=l),f}else return console.warn("THREE.ColladaLoader: Loader for texture %s not found.",o),null}else return console.warn("THREE.ColladaLoader: Couldn't create texture with ID:",c.id),null}const r=s.parameters;for(const c in r){const l=r[c];switch(c){case"diffuse":l.color&&n.color.fromArray(l.color),l.texture&&(n.map=i(l.texture,ee));break;case"specular":l.color&&n.specular&&n.specular.fromArray(l.color),l.texture&&(n.specularMap=i(l.texture));break;case"bump":l.texture&&(n.normalMap=i(l.texture));break;case"ambient":l.texture&&(n.lightMap=i(l.texture,ee));break;case"shininess":l.float&&n.shininess&&(n.shininess=l.float);break;case"emission":l.color&&n.emissive&&n.emissive.fromArray(l.color),l.texture&&(n.emissiveMap=i(l.texture,ee));break}}Ee.colorSpaceToWorking(n.color,ee),n.specular&&Ee.colorSpaceToWorking(n.specular,ee),n.emissive&&Ee.colorSpaceToWorking(n.emissive,ee);let a=r.transparent,d=r.transparency;if(d===void 0&&a&&(d={float:1}),a===void 0&&d&&(a={opaque:"A_ONE",data:{color:[1,1,1,1]}}),a&&d)if(a.data.texture)n.transparent=!0;else{const c=a.data.color;switch(a.opaque){case"A_ONE":n.opacity=c[3]*d.float;break;case"RGB_ZERO":n.opacity=1-c[0]*d.float;break;case"A_ZERO":n.opacity=1-c[3]*d.float;break;case"RGB_ONE":n.opacity=c[0]*d.float;break;default:console.warn('THREE.ColladaLoader: Invalid opaque type "%s" of transparent tag.',a.opaque)}n.opacity<1&&(n.transparent=!0)}if(s.extra!==void 0&&s.extra.technique!==void 0){const c=s.extra.technique;for(const l in c){const m=c[l];switch(l){case"double_sided":n.side=m===1?Cn:vn;break;case"bump":n.normalMap=i(m.texture),n.normalScale=new xn(1,1);break}}}return n}function Ct(t){return z(w.materials[t],Ue)}function vt(t){const e={name:t.getAttribute("name")};for(let s=0,n=t.childNodes.length;s<n;s++){const i=t.childNodes[s];if(i.nodeType===1)switch(i.nodeName){case"optics":e.optics=It(i);break}}w.cameras[t.getAttribute("id")]=e}function It(t){for(let e=0;e<t.childNodes.length;e++){const s=t.childNodes[e];switch(s.nodeName){case"technique_common":return Lt(s)}}return{}}function Lt(t){const e={};for(let s=0;s<t.childNodes.length;s++){const n=t.childNodes[s];switch(n.nodeName){case"perspective":case"orthographic":e.technique=n.nodeName,e.parameters=Rt(n);break}}return e}function Rt(t){const e={};for(let s=0;s<t.childNodes.length;s++){const n=t.childNodes[s];switch(n.nodeName){case"xfov":case"yfov":case"xmag":case"ymag":case"znear":case"zfar":case"aspect_ratio":e[n.nodeName]=parseFloat(n.textContent);break}}return e}function Be(t){let e;switch(t.optics.technique){case"perspective":e=new lt(t.optics.parameters.yfov,t.optics.parameters.aspect_ratio,t.optics.parameters.znear,t.optics.parameters.zfar);break;case"orthographic":let s=t.optics.parameters.ymag,n=t.optics.parameters.xmag;const i=t.optics.parameters.aspect_ratio;n=n===void 0?s*i:n,s=s===void 0?n/i:s,n*=.5,s*=.5,e=new In(-n,n,s,-s,t.optics.parameters.znear,t.optics.parameters.zfar);break;default:e=new lt;break}return e.name=t.name||"",e}function Mt(t){const e=w.cameras[t];return e!==void 0?z(e,Be):(console.warn("THREE.ColladaLoader: Couldn't find camera with ID:",t),null)}function St(t){let e={};for(let s=0,n=t.childNodes.length;s<n;s++){const i=t.childNodes[s];if(i.nodeType===1)switch(i.nodeName){case"technique_common":e=Gt(i);break}}w.lights[t.getAttribute("id")]=e}function Gt(t){const e={};for(let s=0,n=t.childNodes.length;s<n;s++){const i=t.childNodes[s];if(i.nodeType===1)switch(i.nodeName){case"directional":case"point":case"spot":case"ambient":e.technique=i.nodeName,e.parameters=Ot(i)}}return e}function Ot(t){const e={};for(let s=0,n=t.childNodes.length;s<n;s++){const i=t.childNodes[s];if(i.nodeType===1)switch(i.nodeName){case"color":const r=I(i.textContent);e.color=new at().fromArray(r),Ee.colorSpaceToWorking(e.color,ee);break;case"falloff_angle":e.falloffAngle=parseFloat(i.textContent);break;case"quadratic_attenuation":const a=parseFloat(i.textContent);e.distance=a?Math.sqrt(1/a):0;break}}return e}function ze(t){let e;switch(t.technique){case"directional":e=new Sn;break;case"point":e=new Mn;break;case"spot":e=new Rn;break;case"ambient":e=new Ln;break}return t.parameters.color&&e.color.copy(t.parameters.color),t.parameters.distance&&(e.distance=t.parameters.distance),e}function jt(t){const e=w.lights[t];return e!==void 0?z(e,ze):(console.warn("THREE.ColladaLoader: Couldn't find light with ID:",t),null)}function qt(t){const e={name:t.getAttribute("name"),sources:{},vertices:{},primitives:[]},s=U(t,"mesh")[0];if(s!==void 0){for(let n=0;n<s.childNodes.length;n++){const i=s.childNodes[n];if(i.nodeType!==1)continue;const r=i.getAttribute("id");switch(i.nodeName){case"source":e.sources[r]=Re(i);break;case"vertices":e.vertices=Pt(i);break;case"polygons":console.warn("THREE.ColladaLoader: Unsupported primitive type: ",i.nodeName);break;case"lines":case"linestrips":case"polylist":case"triangles":e.primitives.push(Ht(i));break;default:console.log(i)}}w.geometries[t.getAttribute("id")]=e}}function Re(t){const e={array:[],stride:3};for(let s=0;s<t.childNodes.length;s++){const n=t.childNodes[s];if(n.nodeType===1)switch(n.nodeName){case"float_array":e.array=I(n.textContent);break;case"Name_array":e.array=te(n.textContent);break;case"technique_common":const i=U(n,"accessor")[0];i!==void 0&&(e.stride=parseInt(i.getAttribute("stride")));break}}return e}function Pt(t){const e={};for(let s=0;s<t.childNodes.length;s++){const n=t.childNodes[s];n.nodeType===1&&(e[n.getAttribute("semantic")]=S(n.getAttribute("source")))}return e}function Ht(t){const e={type:t.nodeName,material:t.getAttribute("material"),count:parseInt(t.getAttribute("count")),inputs:{},stride:0,hasUV:!1};for(let s=0,n=t.childNodes.length;s<n;s++){const i=t.childNodes[s];if(i.nodeType===1)switch(i.nodeName){case"input":const r=S(i.getAttribute("source")),a=i.getAttribute("semantic"),d=parseInt(i.getAttribute("offset")),c=parseInt(i.getAttribute("set")),l=c>0?a+c:a;e.inputs[l]={id:r,offset:d},e.stride=Math.max(e.stride,d+1),a==="TEXCOORD"&&(e.hasUV=!0);break;case"vcount":e.vcount=Z(i.textContent);break;case"p":e.p=Z(i.textContent);break}}return e}function Ut(t){const e={};for(let s=0;s<t.length;s++){const n=t[s];e[n.type]===void 0&&(e[n.type]=[]),e[n.type].push(n)}return e}function Bt(t){let e=0;for(let s=0,n=t.length;s<n;s++)t[s].hasUV===!0&&e++;e>0&&e<t.length&&(t.uvsNeedsFix=!0)}function Fe(t){const e={},s=t.sources,n=t.vertices,i=t.primitives;if(i.length===0)return{};const r=Ut(i);for(const a in r){const d=r[a];Bt(d),e[a]=zt(d,s,n)}return e}function zt(t,e,s){const n={},i={array:[],stride:0},r={array:[],stride:0},a={array:[],stride:0},d={array:[],stride:0},c={array:[],stride:0},l={array:[],stride:4},m={array:[],stride:4},o=new jn,p=[];let f=0;for(let g=0;g<t.length;g++){const b=t[g],O=b.inputs;let x=0;switch(b.type){case"lines":case"linestrips":x=b.count*2;break;case"triangles":x=b.count*3;break;case"polylist":for(let T=0;T<b.count;T++){const E=b.vcount[T];switch(E){case 3:x+=3;break;case 4:x+=6;break;default:x+=(E-2)*3;break}}break;default:console.warn("THREE.ColladaLoader: Unknown primitive type:",b.type)}o.addGroup(f,x,g),f+=x,b.material&&p.push(b.material);for(const T in O){const E=O[T];switch(T){case"VERTEX":for(const Y in s){const F=s[Y];switch(Y){case"POSITION":const le=i.array.length;if(J(b,e[F],E.offset,i.array),i.stride=e[F].stride,e.skinWeights&&e.skinIndices&&(J(b,e.skinIndices,E.offset,l.array),J(b,e.skinWeights,E.offset,m.array)),b.hasUV===!1&&t.uvsNeedsFix===!0){const yn=(i.array.length-le)/i.stride;for(let st=0;st<yn;st++)a.array.push(0,0)}break;case"NORMAL":J(b,e[F],E.offset,r.array),r.stride=e[F].stride;break;case"COLOR":J(b,e[F],E.offset,c.array),c.stride=e[F].stride;break;case"TEXCOORD":J(b,e[F],E.offset,a.array),a.stride=e[F].stride;break;case"TEXCOORD1":J(b,e[F],E.offset,d.array),a.stride=e[F].stride;break;default:console.warn('THREE.ColladaLoader: Semantic "%s" not handled in geometry build process.',Y)}}break;case"NORMAL":J(b,e[E.id],E.offset,r.array),r.stride=e[E.id].stride;break;case"COLOR":J(b,e[E.id],E.offset,c.array,!0),c.stride=e[E.id].stride;break;case"TEXCOORD":J(b,e[E.id],E.offset,a.array),a.stride=e[E.id].stride;break;case"TEXCOORD1":J(b,e[E.id],E.offset,d.array),d.stride=e[E.id].stride;break}}}return i.array.length>0&&o.setAttribute("position",new ne(i.array,i.stride)),r.array.length>0&&o.setAttribute("normal",new ne(r.array,r.stride)),c.array.length>0&&o.setAttribute("color",new ne(c.array,c.stride)),a.array.length>0&&o.setAttribute("uv",new ne(a.array,a.stride)),d.array.length>0&&o.setAttribute("uv1",new ne(d.array,d.stride)),l.array.length>0&&o.setAttribute("skinIndex",new ne(l.array,l.stride)),m.array.length>0&&o.setAttribute("skinWeight",new ne(m.array,m.stride)),n.data=o,n.type=t[0].type,n.materialKeys=p,n}function J(t,e,s,n,i=!1){const r=t.p,a=t.stride,d=t.vcount;function c(o){let p=r[o+s]*m;const f=p+m;for(;p<f;p++)n.push(l[p]);if(i){const g=n.length-m-1;Ne.setRGB(n[g+0],n[g+1],n[g+2],ee),n[g+0]=Ne.r,n[g+1]=Ne.g,n[g+2]=Ne.b}}const l=e.array,m=e.stride;if(t.vcount!==void 0){let o=0;for(let p=0,f=d.length;p<f;p++){const g=d[p];if(g===4){const b=o+a*0,O=o+a*1,x=o+a*2,T=o+a*3;c(b),c(O),c(T),c(O),c(x),c(T)}else if(g===3){const b=o+a*0,O=o+a*1,x=o+a*2;c(b),c(O),c(x)}else if(g>4)for(let b=1,O=g-2;b<=O;b++){const x=o+a*0,T=o+a*b,E=o+a*(b+1);c(x),c(T),c(E)}o+=a*g}}else for(let o=0,p=r.length;o<p;o+=a)c(o)}function Ve(t){return z(w.geometries[t],Fe)}function Ft(t){const e={name:t.getAttribute("name")||"",joints:{},links:[]};for(let s=0;s<t.childNodes.length;s++){const n=t.childNodes[s];if(n.nodeType===1)switch(n.nodeName){case"technique_common":Dt(n,e);break}}w.kinematicsModels[t.getAttribute("id")]=e}function Vt(t){return t.build!==void 0?t.build:t}function Kt(t){return z(w.kinematicsModels[t],Vt)}function Dt(t,e){for(let s=0;s<t.childNodes.length;s++){const n=t.childNodes[s];if(n.nodeType===1)switch(n.nodeName){case"joint":e.joints[n.getAttribute("sid")]=Wt(n);break;case"link":e.links.push(Ke(n));break}}}function Wt(t){let e;for(let s=0;s<t.childNodes.length;s++){const n=t.childNodes[s];if(n.nodeType===1)switch(n.nodeName){case"prismatic":case"revolute":e=Jt(n);break}}return e}function Jt(t){const e={sid:t.getAttribute("sid"),name:t.getAttribute("name")||"",axis:new $,limits:{min:0,max:0},type:t.nodeName,static:!1,zeroPosition:0,middlePosition:0};for(let s=0;s<t.childNodes.length;s++){const n=t.childNodes[s];if(n.nodeType===1)switch(n.nodeName){case"axis":const i=I(n.textContent);e.axis.fromArray(i);break;case"limits":const r=n.getElementsByTagName("max")[0],a=n.getElementsByTagName("min")[0];e.limits.max=parseFloat(r.textContent),e.limits.min=parseFloat(a.textContent);break}}return e.limits.min>=e.limits.max&&(e.static=!0),e.middlePosition=(e.limits.min+e.limits.max)/2,e}function Ke(t){const e={sid:t.getAttribute("sid"),name:t.getAttribute("name")||"",attachments:[],transforms:[]};for(let s=0;s<t.childNodes.length;s++){const n=t.childNodes[s];if(n.nodeType===1)switch(n.nodeName){case"attachment_full":e.attachments.push(Yt(n));break;case"matrix":case"translate":case"rotate":e.transforms.push(De(n));break}}return e}function Yt(t){const e={joint:t.getAttribute("joint").split("/").pop(),transforms:[],links:[]};for(let s=0;s<t.childNodes.length;s++){const n=t.childNodes[s];if(n.nodeType===1)switch(n.nodeName){case"link":e.links.push(Ke(n));break;case"matrix":case"translate":case"rotate":e.transforms.push(De(n));break}}return e}function De(t){const e={type:t.nodeName},s=I(t.textContent);switch(e.type){case"matrix":e.obj=new X,e.obj.fromArray(s).transpose();break;case"translate":e.obj=new $,e.obj.fromArray(s);break;case"rotate":e.obj=new $,e.obj.fromArray(s),e.angle=pe.degToRad(s[3]);break}return e}function Xt(t){const e={name:t.getAttribute("name")||"",rigidBodies:{}};for(let s=0;s<t.childNodes.length;s++){const n=t.childNodes[s];if(n.nodeType===1)switch(n.nodeName){case"rigid_body":e.rigidBodies[n.getAttribute("name")]={},Zt(n,e.rigidBodies[n.getAttribute("name")]);break}}w.physicsModels[t.getAttribute("id")]=e}function Zt(t,e){for(let s=0;s<t.childNodes.length;s++){const n=t.childNodes[s];if(n.nodeType===1)switch(n.nodeName){case"technique_common":Qt(n,e);break}}}function Qt(t,e){for(let s=0;s<t.childNodes.length;s++){const n=t.childNodes[s];if(n.nodeType===1)switch(n.nodeName){case"inertia":e.inertia=I(n.textContent);break;case"mass":e.mass=I(n.textContent)[0];break}}}function $t(t){const e={bindJointAxis:[]};for(let s=0;s<t.childNodes.length;s++){const n=t.childNodes[s];if(n.nodeType===1)switch(n.nodeName){case"bind_joint_axis":e.bindJointAxis.push(en(n));break}}w.kinematicsScenes[S(t.getAttribute("url"))]=e}function en(t){const e={target:t.getAttribute("target").split("/").pop()};for(let s=0;s<t.childNodes.length;s++){const n=t.childNodes[s];if(n.nodeType===1)switch(n.nodeName){case"axis":const i=n.getElementsByTagName("param")[0];e.axis=i.textContent;const r=e.axis.split("inst_").pop().split("axis")[0];e.jointIndex=r.substring(0,r.length-1);break}}return e}function tn(t){return t.build!==void 0?t.build:t}function nn(t){return z(w.kinematicsScenes[t],tn)}function sn(){const t=Object.keys(w.kinematicsModels)[0],e=Object.keys(w.kinematicsScenes)[0],s=Object.keys(w.visualScenes)[0];if(t===void 0||e===void 0)return;const n=Kt(t),i=nn(e),r=Qe(s),a=i.bindJointAxis,d={};for(let m=0,o=a.length;m<o;m++){const p=a[m],f=H.querySelector('[sid="'+p.target+'"]');if(f){const g=f.parentElement;c(p.jointIndex,g)}}function c(m,o){const p=o.getAttribute("name"),f=n.joints[m];r.traverse(function(g){g.name===p&&(d[m]={object:g,transforms:rn(o),joint:f,position:f.zeroPosition})})}const l=new X;nt={joints:n&&n.joints,getJointValue:function(m){const o=d[m];if(o)return o.position;console.warn("THREE.ColladaLoader: Joint "+m+" doesn't exist.")},setJointValue:function(m,o){const p=d[m];if(p){const f=p.joint;if(o>f.limits.max||o<f.limits.min)console.warn("THREE.ColladaLoader: Joint "+m+" value "+o+" outside of limits (min: "+f.limits.min+", max: "+f.limits.max+").");else if(f.static)console.warn("THREE.ColladaLoader: Joint "+m+" is static.");else{const g=p.object,b=f.axis,O=p.transforms;K.identity();for(let x=0;x<O.length;x++){const T=O[x];if(T.sid&&T.sid.indexOf(m)!==-1)switch(f.type){case"revolute":K.multiply(l.makeRotationAxis(b,pe.degToRad(o)));break;case"prismatic":K.multiply(l.makeTranslation(b.x*o,b.y*o,b.z*o));break;default:console.warn("THREE.ColladaLoader: Unknown joint type: "+f.type);break}else switch(T.type){case"matrix":K.multiply(T.obj);break;case"translate":K.multiply(l.makeTranslation(T.obj.x,T.obj.y,T.obj.z));break;case"scale":K.scale(T.obj);break;case"rotate":K.multiply(l.makeRotationAxis(T.obj,T.angle));break}}g.matrix.copy(K),g.matrix.decompose(g.position,g.quaternion,g.scale),d[m].position=o}}else console.log("THREE.ColladaLoader: "+m+" does not exist.")}}}function rn(t){const e=[],s=H.querySelector('[id="'+t.id+'"]');for(let n=0;n<s.childNodes.length;n++){const i=s.childNodes[n];if(i.nodeType!==1)continue;let r,a;switch(i.nodeName){case"matrix":r=I(i.textContent);const d=new X().fromArray(r).transpose();e.push({sid:i.getAttribute("sid"),type:i.nodeName,obj:d});break;case"translate":case"scale":r=I(i.textContent),a=new $().fromArray(r),e.push({sid:i.getAttribute("sid"),type:i.nodeName,obj:a});break;case"rotate":r=I(i.textContent),a=new $().fromArray(r);const c=pe.degToRad(r[3]);e.push({sid:i.getAttribute("sid"),type:i.nodeName,obj:a,angle:c});break}}return e}function an(t){const e=t.getElementsByTagName("node");for(let s=0;s<e.length;s++){const n=e[s];n.hasAttribute("id")===!1&&n.setAttribute("id",de())}}const K=new X,oe=new $;function Me(t){const e={name:t.getAttribute("name")||"",type:t.getAttribute("type"),id:t.getAttribute("id"),sid:t.getAttribute("sid"),matrix:new X,nodes:[],instanceCameras:[],instanceControllers:[],instanceLights:[],instanceGeometries:[],instanceNodes:[],transforms:{}};for(let s=0;s<t.childNodes.length;s++){const n=t.childNodes[s];if(n.nodeType!==1)continue;let i;switch(n.nodeName){case"node":e.nodes.push(n.getAttribute("id")),Me(n);break;case"instance_camera":e.instanceCameras.push(S(n.getAttribute("url")));break;case"instance_controller":e.instanceControllers.push(We(n));break;case"instance_light":e.instanceLights.push(S(n.getAttribute("url")));break;case"instance_geometry":e.instanceGeometries.push(We(n));break;case"instance_node":e.instanceNodes.push(S(n.getAttribute("url")));break;case"matrix":i=I(n.textContent),e.matrix.multiply(K.fromArray(i).transpose()),e.transforms[n.getAttribute("sid")]=n.nodeName;break;case"translate":i=I(n.textContent),oe.fromArray(i),e.matrix.multiply(K.makeTranslation(oe.x,oe.y,oe.z)),e.transforms[n.getAttribute("sid")]=n.nodeName;break;case"rotate":i=I(n.textContent);const r=pe.degToRad(i[3]);e.matrix.multiply(K.makeRotationAxis(oe.fromArray(i),r)),e.transforms[n.getAttribute("sid")]=n.nodeName;break;case"scale":i=I(n.textContent),e.matrix.scale(oe.fromArray(i)),e.transforms[n.getAttribute("sid")]=n.nodeName;break;case"extra":break;default:console.log(n)}}return Xe(e.id)?console.warn("THREE.ColladaLoader: There is already a node with ID %s. Exclude current node from further processing.",e.id):w.nodes[e.id]=e,e}function We(t){const e={id:S(t.getAttribute("url")),materials:{},skeletons:[]};for(let s=0;s<t.childNodes.length;s++){const n=t.childNodes[s];switch(n.nodeName){case"bind_material":const i=n.getElementsByTagName("instance_material");for(let r=0;r<i.length;r++){const a=i[r],d=a.getAttribute("symbol"),c=a.getAttribute("target");e.materials[d]=S(c)}break;case"skeleton":e.skeletons.push(S(n.textContent));break}}return e}function on(t,e){const s=[],n=[];let i,r,a;for(i=0;i<t.length;i++){const l=t[i];let m;if(Xe(l))m=ce(l),Je(m,e,s);else if(fn(l)){const p=w.visualScenes[l].children;for(let f=0;f<p.length;f++){const g=p[f];if(g.type==="JOINT"){const b=ce(g.id);Je(b,e,s)}}}else console.error("THREE.ColladaLoader: Unable to find root bone of skeleton with ID:",l)}for(i=0;i<e.length;i++)for(r=0;r<s.length;r++)if(a=s[r],a.bone.name===e[i].name){n[i]=a,a.processed=!0;break}for(i=0;i<s.length;i++)a=s[i],a.processed===!1&&(n.push(a),a.processed=!0);const d=[],c=[];for(i=0;i<n.length;i++)a=n[i],d.push(a.bone),c.push(a.boneInverse);return new zn(d,c)}function Je(t,e,s){t.traverse(function(n){if(n.isBone===!0){let i;for(let r=0;r<e.length;r++){const a=e[r];if(a.name===n.name){i=a.boneInverse;break}}i===void 0&&(i=new X),s.push({bone:n,boneInverse:i,processed:!1})}})}function cn(t){const e=[],s=t.matrix,n=t.nodes,i=t.type,r=t.instanceCameras,a=t.instanceControllers,d=t.instanceLights,c=t.instanceGeometries,l=t.instanceNodes;for(let o=0,p=n.length;o<p;o++)e.push(ce(n[o]));for(let o=0,p=r.length;o<p;o++){const f=Mt(r[o]);f!==null&&e.push(f.clone())}for(let o=0,p=a.length;o<p;o++){const f=a[o],g=y(f.id),b=Ve(g.id),O=Ye(b,f.materials),x=f.skeletons,T=g.skin.joints,E=on(x,T);for(let Y=0,F=O.length;Y<F;Y++){const le=O[Y];le.isSkinnedMesh&&(le.bind(E,g.skin.bindMatrix),le.normalizeSkinWeights()),e.push(le)}}for(let o=0,p=d.length;o<p;o++){const f=jt(d[o]);f!==null&&e.push(f.clone())}for(let o=0,p=c.length;o<p;o++){const f=c[o],g=Ve(f.id),b=Ye(g,f.materials);for(let O=0,x=b.length;O<x;O++)e.push(b[O])}for(let o=0,p=l.length;o<p;o++)e.push(ce(l[o]).clone());let m;if(n.length===0&&e.length===1)m=e[0];else{m=i==="JOINT"?new qn:new dt;for(let o=0;o<e.length;o++)m.add(e[o])}return m.name=i==="JOINT"?t.sid:t.name,m.matrix.copy(s),m.matrix.decompose(m.position,m.quaternion,m.scale),m}const ln=new rt({name:it.DEFAULT_MATERIAL_NAME,color:16711935});function dn(t,e){const s=[];for(let n=0,i=t.length;n<i;n++){const r=e[t[n]];r===void 0?(console.warn("THREE.ColladaLoader: Material with key %s not found. Apply fallback material.",t[n]),s.push(ln)):s.push(Ct(r))}return s}function Ye(t,e){const s=[];for(const n in t){const i=t[n],r=dn(i.materialKeys,e);if(r.length===0&&(n==="lines"||n==="linestrips"?r.push(new ft):r.push(new ct)),n==="lines"||n==="linestrips")for(let l=0,m=r.length;l<m;l++){const o=r[l];if(o.isMeshPhongMaterial===!0||o.isMeshLambertMaterial===!0){const p=new ft;p.color.copy(o.color),p.opacity=o.opacity,p.transparent=o.transparent,r[l]=p}}const a=i.data.attributes.skinIndex!==void 0,d=r.length===1?r[0]:r;let c;switch(n){case"lines":c=new Bn(i.data,d);break;case"linestrips":c=new Un(i.data,d);break;case"triangles":case"polylist":a?c=new Pn(i.data,d):c=new Hn(i.data,d);break}s.push(c)}return s}function Xe(t){return w.nodes[t]!==void 0}function ce(t){return z(w.nodes[t],cn)}function un(t){const e={name:t.getAttribute("name"),children:[]};an(t);const s=U(t,"node");for(let n=0;n<s.length;n++)e.children.push(Me(s[n]));w.visualScenes[t.getAttribute("id")]=e}function Ze(t){const e=new dt;e.name=t.name;const s=t.children;for(let n=0;n<s.length;n++){const i=s[n];e.add(ce(i.id))}return e}function fn(t){return w.visualScenes[t]!==void 0}function Qe(t){return z(w.visualScenes[t],Ze)}function hn(t){const e=U(t,"instance_visual_scene")[0];return Qe(S(e.getAttribute("url")))}function pn(){const t=w.clips;if(Q(t)===!0){if(Q(w.animations)===!1){const e=[];for(const s in w.animations){const n=ye(s);for(let i=0,r=n.length;i<r;i++)e.push(n[i])}Ae.push(new ot("default",-1,e))}}else for(const e in t)Ae.push(R(e))}function mn(t){let e="";const s=[t];for(;s.length;){const n=s.shift();n.nodeType===Node.TEXT_NODE?e+=n.textContent:(e+=`
|
|
2
|
+
`,s.push(...n.childNodes))}return e.trim()}if(D.length===0)return{scene:new Tn};const $e=new DOMParser().parseFromString(D,"application/xml"),H=U($e,"COLLADA")[0],Se=$e.getElementsByTagName("parsererror")[0];if(Se!==void 0){const t=U(Se,"div")[0];let e;return t?e=t.textContent:e=mn(Se),console.error(`THREE.ColladaLoader: Failed to parse collada file.
|
|
3
|
+
`,e),null}const bn=H.getAttribute("version");console.debug("THREE.ColladaLoader: File version",bn);const et=xe(U(H,"asset")[0]),tt=new En(this.manager);tt.setPath(this.resourcePath||se).setCrossOrigin(this.crossOrigin);let Ge;pt&&(Ge=new pt(this.manager),Ge.setPath(this.resourcePath||se));const Ne=new at,Ae=[];let nt={},gn=0;const w={animations:{},clips:{},controllers:{},images:{},effects:{},materials:{},cameras:{},lights:{},geometries:{},nodes:{},visualScenes:{},kinematicsModels:{},physicsModels:{},kinematicsScenes:{}};B(H,"library_animations","animation",ue),B(H,"library_animation_clips","animation_clip",h),B(H,"library_controllers","controller",C),B(H,"library_images","image",u),B(H,"library_effects","effect",W),B(H,"library_materials","material",_t),B(H,"library_cameras","camera",vt),B(H,"library_lights","light",St),B(H,"library_geometries","geometry",qt),B(H,"library_nodes","node",Me),B(H,"library_visual_scenes","visual_scene",un),B(H,"library_kinematics_models","kinematics_model",Ft),B(H,"library_physics_models","physics_model",Xt),B(H,"scene","instance_kinematics_scene",$t),V(w.animations,ge),V(w.clips,q),V(w.controllers,A),V(w.images,k),V(w.effects,He),V(w.materials,Ue),V(w.cameras,Be),V(w.lights,ze),V(w.geometries,Fe),V(w.visualScenes,Ze),pn(),sn();const Te=hn(U(H,"scene")[0]);return Te.animations=Ae,et.upAxis==="Z_UP"&&(console.warn("THREE.ColladaLoader: You are loading an asset with a Z-UP coordinate system. The loader just rotates the asset to transform it into Y-UP. The vertex data are not converted, see #24289."),Te.rotation.set(-Math.PI/2,0,0)),Te.scale.multiplyScalar(et.unit),{get animations(){return console.warn("THREE.ColladaLoader: Please access animations over scene.animations now."),Ae},kinematics:nt,library:w,scene:Te}}}export{Vn as ColladaLoader};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as e}from"./jsx-runtime-DPjLkJKQ.js";import{r as u}from"./index-nmcBqr7Y.js";import{
|
|
1
|
+
import{a as e}from"./jsx-runtime-DPjLkJKQ.js";import{r as u}from"./index-nmcBqr7Y.js";import{bC as m,bD as l,bE as p}from"./index-Ckxb31Yz.js";function d({value:r,onChange:o,disabled:s=!1}){const[i,a]=u.useState(r??""),n=m();u.useEffect(()=>{a(r??"")},[r]);const c=()=>{const t=i.trim();t&&t!==r&&o(t)};return r===null?e.jsxs("div",{className:"vgai-color-input",children:[e.jsx("div",{className:"vgai-color-input-mixed"}),e.jsx(l,{placeholder:"—",disabled:s,onChange:t=>{t.target.value&&o(t.target.value)},"data-mixed":"true"})]}):e.jsxs("div",{className:"vgai-color-input",children:[e.jsx(p,{value:r,disabled:s,onChange:t=>{n?.begin(),o(t.target.value)},onBlur:()=>n?.end()}),e.jsx(l,{value:i,disabled:s,onChange:t=>a(t.target.value),onBlur:c,onKeyDown:t=>{t.key==="Enter"?(c(),t.target.blur()):t.key==="Escape"&&(a(r),t.target.blur())}})]})}export{d as C};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{ax as i,aV as a}from"./three.module-IFn-4i31.js";import{ConvexHull as m}from"./ConvexHull-CrJ8FY-w.js";class h extends i{constructor(c=[]){super();const s=[],r=[],l=new m().setFromPoints(c).faces;for(let o=0;o<l.length;o++){const e=l[o];let t=e.edge;do{const n=t.head().point;s.push(n.x,n.y,n.z),r.push(e.normal.x,e.normal.y,e.normal.z),t=t.next}while(t!==e.edge)}this.setAttribute("position",new a(s,3)),this.setAttribute("normal",new a(r,3))}}export{h as ConvexGeometry};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{V as g,
|
|
1
|
+
import{V as g,bf as C,n as y,bg as b}from"./three.module-IFn-4i31.js";const _=0,A=1,H=new g,V=new C,F=new y,P=new g,w=new b;class S{constructor(){this.tolerance=-1,this.faces=[],this.newFaces=[],this.assigned=new M,this.unassigned=new M,this.vertices=[]}setFromPoints(t){if(t.length>=4){this.makeEmpty();for(let e=0,i=t.length;e<i;e++)this.vertices.push(new k(t[e]));this._compute()}return this}setFromObject(t){const e=[];return t.updateMatrixWorld(!0),t.traverse(function(i){const s=i.geometry;if(s!==void 0){const n=s.attributes.position;if(n!==void 0)for(let r=0,o=n.count;r<o;r++){const c=new g;c.fromBufferAttribute(n,r).applyMatrix4(i.matrixWorld),e.push(c)}}}),this.setFromPoints(e)}containsPoint(t){const e=this.faces;for(let i=0,s=e.length;i<s;i++)if(e[i].distanceToPoint(t)>this.tolerance)return!1;return!0}intersectRay(t,e){const i=this.faces;let s=-1/0,n=1/0;for(let r=0,o=i.length;r<o;r++){const c=i[r],a=c.distanceToPoint(t.origin),d=c.normal.dot(t.direction);if(a>0&&d>=0)return null;const u=d!==0?-a/d:0;if(!(u<=0)&&(d>0?n=Math.min(u,n):s=Math.max(u,s),s>n))return null}return s!==-1/0?t.at(s,e):t.at(n,e),e}intersectsRay(t){return this.intersectRay(t,H)!==null}makeEmpty(){return this.faces=[],this.vertices=[],this}_addVertexToFace(t,e){return t.face=e,e.outside===null?this.assigned.append(t):this.assigned.insertBefore(e.outside,t),e.outside=t,this}_removeVertexFromFace(t,e){return t===e.outside&&(t.next!==null&&t.next.face===e?e.outside=t.next:e.outside=null),this.assigned.remove(t),this}_removeAllVerticesFromFace(t){if(t.outside!==null){const e=t.outside;let i=t.outside;for(;i.next!==null&&i.next.face===t;)i=i.next;return this.assigned.removeSubList(e,i),e.prev=i.next=null,t.outside=null,e}}_deleteFaceVertices(t,e){const i=this._removeAllVerticesFromFace(t);if(i!==void 0)if(e===void 0)this.unassigned.appendChain(i);else{let s=i;do{const n=s.next;e.distanceToPoint(s.point)>this.tolerance?this._addVertexToFace(s,e):this.unassigned.append(s),s=n}while(s!==null)}return this}_resolveUnassignedPoints(t){if(this.unassigned.isEmpty()===!1){let e=this.unassigned.first();do{const i=e.next;let s=this.tolerance,n=null;for(let r=0;r<t.length;r++){const o=t[r];if(o.mark===_){const c=o.distanceToPoint(e.point);if(c>s&&(s=c,n=o),s>1e3*this.tolerance)break}}n!==null&&this._addVertexToFace(e,n),e=i}while(e!==null)}return this}_computeExtremes(){const t=new g,e=new g,i=[],s=[];for(let n=0;n<3;n++)i[n]=s[n]=this.vertices[0];t.copy(this.vertices[0].point),e.copy(this.vertices[0].point);for(let n=0,r=this.vertices.length;n<r;n++){const o=this.vertices[n],c=o.point;for(let a=0;a<3;a++)c.getComponent(a)<t.getComponent(a)&&(t.setComponent(a,c.getComponent(a)),i[a]=o);for(let a=0;a<3;a++)c.getComponent(a)>e.getComponent(a)&&(e.setComponent(a,c.getComponent(a)),s[a]=o)}return this.tolerance=3*Number.EPSILON*(Math.max(Math.abs(t.x),Math.abs(e.x))+Math.max(Math.abs(t.y),Math.abs(e.y))+Math.max(Math.abs(t.z),Math.abs(e.z))),{min:i,max:s}}_computeInitialHull(){const t=this.vertices,e=this._computeExtremes(),i=e.min,s=e.max;let n=0,r=0;for(let l=0;l<3;l++){const p=s[l].point.getComponent(l)-i[l].point.getComponent(l);p>n&&(n=p,r=l)}const o=i[r],c=s[r];let a,d;n=0,V.set(o.point,c.point);for(let l=0,p=this.vertices.length;l<p;l++){const h=t[l];if(h!==o&&h!==c){V.closestPointToPoint(h.point,!0,P);const m=P.distanceToSquared(h.point);m>n&&(n=m,a=h)}}n=-1,F.setFromCoplanarPoints(o.point,c.point,a.point);for(let l=0,p=this.vertices.length;l<p;l++){const h=t[l];if(h!==o&&h!==c&&h!==a){const m=Math.abs(F.distanceToPoint(h.point));m>n&&(n=m,d=h)}}const u=[];if(F.distanceToPoint(d.point)<0){u.push(f.create(o,c,a),f.create(d,c,o),f.create(d,a,c),f.create(d,o,a));for(let l=0;l<3;l++){const p=(l+1)%3;u[l+1].getEdge(2).setTwin(u[0].getEdge(p)),u[l+1].getEdge(1).setTwin(u[p+1].getEdge(0))}}else{u.push(f.create(o,a,c),f.create(d,o,c),f.create(d,c,a),f.create(d,a,o));for(let l=0;l<3;l++){const p=(l+1)%3;u[l+1].getEdge(2).setTwin(u[0].getEdge((3-l)%3)),u[l+1].getEdge(0).setTwin(u[p+1].getEdge(1))}}for(let l=0;l<4;l++)this.faces.push(u[l]);for(let l=0,p=t.length;l<p;l++){const h=t[l];if(h!==o&&h!==c&&h!==a&&h!==d){n=this.tolerance;let m=null;for(let x=0;x<4;x++){const E=this.faces[x].distanceToPoint(h.point);E>n&&(n=E,m=this.faces[x])}m!==null&&this._addVertexToFace(h,m)}}return this}_reindexFaces(){const t=[];for(let e=0;e<this.faces.length;e++){const i=this.faces[e];i.mark===_&&t.push(i)}return this.faces=t,this}_nextVertexToAdd(){if(this.assigned.isEmpty()===!1){let t,e=0;const i=this.assigned.first().face;let s=i.outside;do{const n=i.distanceToPoint(s.point);n>e&&(e=n,t=s),s=s.next}while(s!==null&&s.face===i);return t}}_computeHorizon(t,e,i,s){this._deleteFaceVertices(i),i.mark=A;let n;e===null?n=e=i.getEdge(0):n=e.next;do{const r=n.twin,o=r.face;o.mark===_&&(o.distanceToPoint(t)>this.tolerance?this._computeHorizon(t,r,o,s):s.push(n)),n=n.next}while(n!==e);return this}_addAdjoiningFace(t,e){const i=f.create(t,e.tail(),e.head());return this.faces.push(i),i.getEdge(-1).setTwin(e.twin),i.getEdge(0)}_addNewFaces(t,e){this.newFaces=[];let i=null,s=null;for(let n=0;n<e.length;n++){const r=e[n],o=this._addAdjoiningFace(t,r);i===null?i=o:o.next.setTwin(s),this.newFaces.push(o.face),s=o}return i.next.setTwin(s),this}_addVertexToHull(t){const e=[];return this.unassigned.clear(),this._removeVertexFromFace(t,t.face),this._computeHorizon(t.point,null,t.face,e),this._addNewFaces(t,e),this._resolveUnassignedPoints(this.newFaces),this}_cleanup(){return this.assigned.clear(),this.unassigned.clear(),this.newFaces=[],this}_compute(){let t;for(this._computeInitialHull();(t=this._nextVertexToAdd())!==void 0;)this._addVertexToHull(t);return this._reindexFaces(),this._cleanup(),this}}class f{constructor(){this.normal=new g,this.midpoint=new g,this.area=0,this.constant=0,this.outside=null,this.mark=_,this.edge=null}static create(t,e,i){const s=new f,n=new T(t,s),r=new T(e,s),o=new T(i,s);return n.next=o.prev=r,r.next=n.prev=o,o.next=r.prev=n,s.edge=n,s.compute()}getEdge(t){let e=this.edge;for(;t>0;)e=e.next,t--;for(;t<0;)e=e.prev,t++;return e}compute(){const t=this.edge.tail(),e=this.edge.head(),i=this.edge.next.head();return w.set(t.point,e.point,i.point),w.getNormal(this.normal),w.getMidpoint(this.midpoint),this.area=w.getArea(),this.constant=this.normal.dot(this.midpoint),this}distanceToPoint(t){return this.normal.dot(t)-this.constant}}class T{constructor(t,e){this.vertex=t,this.prev=null,this.next=null,this.twin=null,this.face=e}head(){return this.vertex}tail(){return this.prev?this.prev.vertex:null}length(){const t=this.head(),e=this.tail();return e!==null?e.point.distanceTo(t.point):-1}lengthSquared(){const t=this.head(),e=this.tail();return e!==null?e.point.distanceToSquared(t.point):-1}setTwin(t){return this.twin=t,t.twin=this,this}}class k{constructor(t){this.point=t,this.prev=null,this.next=null,this.face=null}}class M{constructor(){this.head=null,this.tail=null}first(){return this.head}last(){return this.tail}clear(){return this.head=this.tail=null,this}insertBefore(t,e){return e.prev=t.prev,e.next=t,e.prev===null?this.head=e:e.prev.next=e,t.prev=e,this}insertAfter(t,e){return e.prev=t,e.next=t.next,e.next===null?this.tail=e:e.next.prev=e,t.next=e,this}append(t){return this.head===null?this.head=t:this.tail.next=t,t.prev=this.tail,t.next=null,this.tail=t,this}appendChain(t){for(this.head===null?this.head=t:this.tail.next=t,t.prev=this.tail;t.next!==null;)t=t.next;return this.tail=t,this}remove(t){return t.prev===null?this.head=t.next:t.prev.next=t.next,t.next===null?this.tail=t.prev:t.next.prev=t.prev,this}removeSubList(t,e){return t.prev===null?this.head=e.next:t.prev.next=e.next,e.next===null?this.tail=t.prev:e.next.prev=t.prev,this}isEmpty(){return this.head===null}}export{S as ConvexHull,f as Face,T as HalfEdge,M as VertexList,k as VertexNode};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{ax as I,M as P,V as c,aN as R,aC as q,a as N,aV as z}from"./three.module-IFn-4i31.js";class J extends I{constructor(p=new P,x=new c,j=new R,y=new c(1,1,1)){super();const k=[],b=[],D=[],h=new c,E=new q().getNormalMatrix(p.matrixWorld),d=new N;d.makeRotationFromEuler(j),d.setPosition(x);const G=new N;G.copy(d).invert(),F(),this.setAttribute("position",new z(k,3)),this.setAttribute("uv",new z(D,2)),b.length>0&&this.setAttribute("normal",new z(b,3));function F(){let o=[];const n=new c,s=new c,u=p.geometry,l=u.attributes.position,a=u.attributes.normal;if(u.index!==null){const t=u.index;for(let r=0;r<t.count;r++)n.fromBufferAttribute(l,t.getX(r)),a?(s.fromBufferAttribute(a,t.getX(r)),w(o,n,s)):w(o,n)}else{if(l===void 0)return;for(let t=0;t<l.count;t++)n.fromBufferAttribute(l,t),a?(s.fromBufferAttribute(a,t),w(o,n,s)):w(o,n)}o=f(o,h.set(1,0,0)),o=f(o,h.set(-1,0,0)),o=f(o,h.set(0,1,0)),o=f(o,h.set(0,-1,0)),o=f(o,h.set(0,0,1)),o=f(o,h.set(0,0,-1));for(let t=0;t<o.length;t++){const r=o[t];D.push(.5+r.position.x/y.x,.5+r.position.y/y.y),r.position.applyMatrix4(d),k.push(r.position.x,r.position.y,r.position.z),r.normal!==null&&b.push(r.normal.x,r.normal.y,r.normal.z)}}function w(o,n,s=null){n.applyMatrix4(p.matrixWorld),n.applyMatrix4(G),s?(s.applyNormalMatrix(E),o.push(new B(n.clone(),s.clone()))):o.push(new B(n.clone()))}function f(o,n){const s=[],u=.5*Math.abs(y.dot(n));for(let l=0;l<o.length;l+=3){let a=0,t,r,e,m;const W=o[l+0].position.dot(n)-u,X=o[l+1].position.dot(n)-u,C=o[l+2].position.dot(n)-u,M=W>0,A=X>0,g=C>0;switch(a=(M?1:0)+(A?1:0)+(g?1:0),a){case 0:{s.push(o[l]),s.push(o[l+1]),s.push(o[l+2]);break}case 1:{if(M&&(t=o[l+1],r=o[l+2],e=i(o[l],t,n,u),m=i(o[l],r,n,u)),A){t=o[l],r=o[l+2],e=i(o[l+1],t,n,u),m=i(o[l+1],r,n,u),s.push(e),s.push(r.clone()),s.push(t.clone()),s.push(r.clone()),s.push(e.clone()),s.push(m);break}g&&(t=o[l],r=o[l+1],e=i(o[l+2],t,n,u),m=i(o[l+2],r,n,u)),s.push(t.clone()),s.push(r.clone()),s.push(e),s.push(m),s.push(e.clone()),s.push(r.clone());break}case 2:{M||(t=o[l].clone(),r=i(t,o[l+1],n,u),e=i(t,o[l+2],n,u),s.push(t),s.push(r),s.push(e)),A||(t=o[l+1].clone(),r=i(t,o[l+2],n,u),e=i(t,o[l],n,u),s.push(t),s.push(r),s.push(e)),g||(t=o[l+2].clone(),r=i(t,o[l],n,u),e=i(t,o[l+1],n,u),s.push(t),s.push(r),s.push(e));break}}}return s}function i(o,n,s,u){const l=o.position.dot(s)-u,a=n.position.dot(s)-u,t=l/(l-a),r=new c(o.position.x+t*(n.position.x-o.position.x),o.position.y+t*(n.position.y-o.position.y),o.position.z+t*(n.position.z-o.position.z));let e=null;return o.normal!==null&&n.normal!==null&&(e=new c(o.normal.x+t*(n.normal.x-o.normal.x),o.normal.y+t*(n.normal.y-o.normal.y),o.normal.z+t*(n.normal.z-o.normal.z))),new B(r,e)}}}class B{constructor(p,x=null){this.position=p,this.normal=x}clone(){const p=this.position.clone(),x=this.normal!==null?this.normal.clone():null;return new this.constructor(p,x)}}export{J as DecalGeometry,B as DecalVertex};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{g as o,J as d,ac as p,N as u,aB as g}from"./three.module-IFn-4i31.js";import{C as _}from"./CopyShader-BzTUYzf6.js";import{ShaderPass as x}from"./ShaderPass-qtkA7CQ8.js";import{Y as l}from"./index-Ckxb31Yz.js";import"./index-nmcBqr7Y.js";import"./_commonjsHelpers-D6-XlEtG.js";import"./index-D_NuPfjr.js";import"./jsx-runtime-DPjLkJKQ.js";import"./index-CtzuWnCS.js";import"./index-CinJrH5C.js";import"./index-FUuS4qwW.js";import"./client-DNXj_opT.js";class c extends l{constructor(e,s){super(),this.scene=e,this.camera=s,this.clear=!0,this.needsSwap=!1,this.inverse=!1}render(e,s,r){const i=e.getContext(),t=e.state;t.buffers.color.setMask(!1),t.buffers.depth.setMask(!1),t.buffers.color.setLocked(!0),t.buffers.depth.setLocked(!0);let h,f;this.inverse?(h=0,f=1):(h=1,f=0),t.buffers.stencil.setTest(!0),t.buffers.stencil.setOp(i.REPLACE,i.REPLACE,i.REPLACE),t.buffers.stencil.setFunc(i.ALWAYS,h,4294967295),t.buffers.stencil.setClear(f),t.buffers.stencil.setLocked(!0),e.setRenderTarget(r),this.clear&&e.clear(),e.render(this.scene,this.camera),e.setRenderTarget(s),this.clear&&e.clear(),e.render(this.scene,this.camera),t.buffers.color.setLocked(!1),t.buffers.depth.setLocked(!1),t.buffers.color.setMask(!0),t.buffers.depth.setMask(!0),t.buffers.stencil.setLocked(!1),t.buffers.stencil.setFunc(i.EQUAL,1,4294967295),t.buffers.stencil.setOp(i.KEEP,i.KEEP,i.KEEP),t.buffers.stencil.setLocked(!0)}}class w extends l{constructor(){super(),this.needsSwap=!1}render(e){e.state.buffers.stencil.setLocked(!1),e.state.buffers.stencil.setTest(!1)}}class A{constructor(e,s){if(this.renderer=e,this._pixelRatio=e.getPixelRatio(),s===void 0){const r=e.getSize(new o);this._width=r.width,this._height=r.height,s=new d(this._width*this._pixelRatio,this._height*this._pixelRatio,{type:p}),s.texture.name="EffectComposer.rt1"}else this._width=s.width,this._height=s.height;this.renderTarget1=s,this.renderTarget2=s.clone(),this.renderTarget2.texture.name="EffectComposer.rt2",this.writeBuffer=this.renderTarget1,this.readBuffer=this.renderTarget2,this.renderToScreen=!0,this.passes=[],this.copyPass=new x(_),this.copyPass.material.blending=u,this.clock=new g}swapBuffers(){const e=this.readBuffer;this.readBuffer=this.writeBuffer,this.writeBuffer=e}addPass(e){this.passes.push(e),e.setSize(this._width*this._pixelRatio,this._height*this._pixelRatio)}insertPass(e,s){this.passes.splice(s,0,e),e.setSize(this._width*this._pixelRatio,this._height*this._pixelRatio)}removePass(e){const s=this.passes.indexOf(e);s!==-1&&this.passes.splice(s,1)}isLastEnabledPass(e){for(let s=e+1;s<this.passes.length;s++)if(this.passes[s].enabled)return!1;return!0}render(e){e===void 0&&(e=this.clock.getDelta());const s=this.renderer.getRenderTarget();let r=!1;for(let i=0,t=this.passes.length;i<t;i++){const h=this.passes[i];if(h.enabled!==!1){if(h.renderToScreen=this.renderToScreen&&this.isLastEnabledPass(i),h.render(this.renderer,this.writeBuffer,this.readBuffer,e,r),h.needsSwap){if(r){const f=this.renderer.getContext(),n=this.renderer.state.buffers.stencil;n.setFunc(f.NOTEQUAL,1,4294967295),this.copyPass.render(this.renderer,this.writeBuffer,this.readBuffer,e),n.setFunc(f.EQUAL,1,4294967295)}this.swapBuffers()}c!==void 0&&(h instanceof c?r=!0:h instanceof w&&(r=!1))}}this.renderer.setRenderTarget(s)}reset(e){if(e===void 0){const s=this.renderer.getSize(new o);this._pixelRatio=this.renderer.getPixelRatio(),this._width=s.width,this._height=s.height,e=this.renderTarget1.clone(),e.setSize(this._width*this._pixelRatio,this._height*this._pixelRatio)}this.renderTarget1.dispose(),this.renderTarget2.dispose(),this.renderTarget1=e,this.renderTarget2=e.clone(),this.writeBuffer=this.renderTarget1,this.readBuffer=this.renderTarget2}setSize(e,s){this._width=e,this._height=s;const r=this._width*this._pixelRatio,i=this._height*this._pixelRatio;this.renderTarget1.setSize(r,i),this.renderTarget2.setSize(r,i);for(let t=0;t<this.passes.length;t++)this.passes[t].setSize(r,i)}setPixelRatio(e){this._pixelRatio=e,this.setSize(this._width,this._height)}dispose(){this.renderTarget1.dispose(),this.renderTarget2.dispose(),this.copyPass.dispose()}}export{A as EffectComposer};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as p}from"./jsx-runtime-DPjLkJKQ.js";import{bq as f,br as d,ap as b,bs as v,bt as S,bu as x}from"./index-Ckxb31Yz.js";import{r as u}from"./index-nmcBqr7Y.js";import"./index-CtzuWnCS.js";import{a as h}from"./live-mixers-BRkRHd6g.js";import{O as j}from"./StageHost-lB8f---y.js";import"./_commonjsHelpers-D6-XlEtG.js";import"./index-FUuS4qwW.js";import"./client-DNXj_opT.js";import"./index-D_NuPfjr.js";import"./index-CinJrH5C.js";import"./three.module-IFn-4i31.js";import"./standard-viewport-dressing-GUUr6GuK.js";import"./live-gesture-lock-DJbrjOqf.js";import"./model-inspection-Cxfg_Fei.js";import"./viewport-shading-boundary-CBvvzS-p.js";import"./clip-planes-CnAI6DZn.js";import"./three-DSsr_Lvp.js";import"./viewport-pick-context-DkawXbEi.js";import"./OrbitControls-CzTRRI7x.js";import"./LineSegments2-Cicm_Hu1.js";import"./three.quarks.esm-CRKGjKAH.js";import"./scene-framing-50N7SKuX.js";import"./source-object3d-authoring-adapter-CfHQLFAL.js";import"./three-projection-core-kubBTx0s.js";import"./editor-presentation-activity-C7SNSmTd.js";import"./viewport-surface-status-BFmnWp7z.js";function w(i){const t=new Set;return i.traverse(e=>{const r=h(e);if(r)for(const o of r.clips.values())t.add(o);for(const o of e.animations)t.add(o)}),[...t]}function E({documentId:i,source:t,sourcePath:e,displayName:r,active:o,chromeless:s=!1,revision:n=0,modelSource:m}){const l=u.useCallback(()=>{const a=v(S(t)),c=w(t);return a.animations=[...c],{root:a,animations:c,dispose(){x(a)}}},[t,n]);return p.jsx(j,{documentId:i,sourcePath:e??r,displayName:r,build:l,active:o,chromeless:s,rendererLane:s?"inspector-preview":"own",assetType:"entity",...m?{modelSource:m}:{}})}function Z({documentId:i,entityId:t,displayName:e,active:r}){const o=f(d()),s=u.useSyncExternalStore(o.subscribe,o.getSnapshot),n=o.objectMap.get(t);return n?p.jsx(E,{documentId:i,source:n,sourcePath:`Entity ${t}`,displayName:e,active:r,revision:s,modelSource:{kind:"entity",entityId:t}}):p.jsxs("div",{role:"alert",style:{padding:20,color:b.semantic.danger},children:["Scene entity ",t," is no longer available."]})}export{Z as EntityModelDocument,E as Object3DSnapshotDocument};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as o}from"./jsx-runtime-DPjLkJKQ.js";import{bv as M,bw as C,bx as D,by as k,ap as y,b4 as R,bz as z,bA as A,bB as v}from"./index-Ckxb31Yz.js";import{r as f}from"./index-nmcBqr7Y.js";import"./index-CtzuWnCS.js";import{E as P,W as B,r as I,s as L,t as O,u as T,v as F,w as H,x as G,M as E,y as j,z as S,D as $,o as N}from"./three.module-IFn-4i31.js";import{OrbitControls as q}from"./OrbitControls-CzTRRI7x.js";import{s as _}from"./asset-editor-persistence-BVtzjadu.js";import"./_commonjsHelpers-D6-XlEtG.js";import"./index-FUuS4qwW.js";import"./client-DNXj_opT.js";import"./index-D_NuPfjr.js";import"./index-CinJrH5C.js";function U(e){return e.split("/").pop()??e}function b(e,t,r){return Math.min(r,Math.max(t,e))}function W(e){return e.split(/[?#]/,1)[0].toLowerCase().endsWith(".exr")}async function X(e){const t=W(e)?"EXR":"HDR",s=await(t==="EXR"?new z:new A).loadAsync(e),p=s.image,n=p.width??0,a=p.height??0,c=n>0&&a>0&&Math.abs(n/a-2)<=.04;return s.mapping=P,s.needsUpdate=!0,{texture:s,width:n,height:a,format:t,panorama:c}}function V(e){const t=new O,r=new T(38,1,.05,100);r.position.set(6.2,3.4,7.8),r.lookAt(0,.7,0);const s=[],p=[];if(!e.panorama){t.background=new F("#11141b");const i=e.width>0&&e.height>0?e.width/e.height:1,d=new H(i>=1?4.8:4.8*i,i>=1?4.8/i:4.8),m=new G({map:e.texture,toneMapped:!0});return s.push(d),p.push(m),t.add(new E(d,m)),r.position.set(0,0,6.5),r.lookAt(0,0,0),{scene:t,camera:r,geometries:s,materials:p}}t.background=e.texture,t.environment=e.texture;const n=(i,d,m)=>{s.push(i),p.push(d);const x=new E(i,d);x.position.set(...m),t.add(x)};n(new S(1,64,40),new j({color:"#d8dde5",roughness:.08,metalness:1}),[-2.3,1.15,0]),n(new S(1,64,40),new j({color:"#c97341",roughness:.32,metalness:.25}),[0,1.15,0]),n(new S(1,64,40),new j({color:"#d7d5cf",roughness:.82,metalness:0}),[2.3,1.15,0]);const a=new $(5.7,96),c=new j({color:"#737881",roughness:.58,metalness:0});s.push(a),p.push(c);const l=new E(a,c);return l.rotation.x=-Math.PI/2,l.position.y=.08,t.add(l),{scene:t,camera:r,geometries:s,materials:p}}function J({image:e,settingsRef:t}){const r=f.useRef(null);return f.useEffect(()=>{const s=r.current;if(!s)return;let p=!1,n=0;const a=document.createElement("canvas");a.setAttribute("aria-label",`${e.format} environment preview`),a.style.width="100%",a.style.height="100%",a.style.display="block",s.replaceChildren(a);const c=new B({canvas:a,antialias:!0});c.outputColorSpace=I,c.toneMapping=L;const l=V(e),i=new q(l.camera,a);i.target.set(0,e.panorama?.8:0,0),i.enableDamping=!0,i.enablePan=!1,i.minDistance=e.panorama?3.8:4,i.maxDistance=e.panorama?14:10,i.update();const d={width:1,height:1},m=()=>{const u=t.current;if(c.toneMappingExposure=b(u.exposure,.05,8),e.panorama){const h=N.degToRad(u.rotation);l.scene.backgroundRotation.y=h,l.scene.environmentRotation.y=h,l.scene.backgroundBlurriness=b(u.blur,0,1),l.scene.environmentIntensity=b(u.intensity,0,8)}i.update(),c.render(l.scene,l.camera)},x=()=>{const u=s.getBoundingClientRect();d.width=Math.max(1,Math.floor(u.width)),d.height=Math.max(1,Math.floor(u.height)),c.setPixelRatio(Math.min(window.devicePixelRatio||1,2)),c.setSize(d.width,d.height,!1),l.camera.aspect=d.width/d.height,l.camera.updateProjectionMatrix(),m()};x();const w=new ResizeObserver(x);w.observe(s);const g=()=>{p||(m(),n=requestAnimationFrame(g))};return n=requestAnimationFrame(g),()=>{p=!0,cancelAnimationFrame(n),w.disconnect(),i.dispose();for(const u of l.geometries)u.dispose();for(const u of l.materials)u.dispose();c.dispose(),a.remove()}},[e,t]),o.jsx("div",{ref:r,"data-testid":"environment-preview",style:{width:"100%",height:"100%",minHeight:260,background:"#11141b"}})}function K({panorama:e,settings:t,onChange:r}){return o.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:12,padding:4},children:[o.jsxs("label",{style:{display:"flex",flexDirection:"column",gap:5,fontSize:11},children:["Exposure",o.jsx(v,{value:t.exposure,onChange:s=>r({...t,exposure:b(s,.05,8)}),step:.05,precision:2})]}),e&&o.jsxs(o.Fragment,{children:[o.jsxs("label",{style:{display:"flex",flexDirection:"column",gap:5,fontSize:11},children:["Lighting intensity",o.jsx(v,{value:t.intensity,onChange:s=>r({...t,intensity:b(s,0,8)}),step:.05,precision:2})]}),o.jsxs("label",{style:{display:"flex",flexDirection:"column",gap:5,fontSize:11},children:["Rotation",o.jsx(v,{value:t.rotation,onChange:s=>r({...t,rotation:s%360}),step:1,precision:0})]}),o.jsxs("label",{style:{display:"flex",flexDirection:"column",gap:5,fontSize:11},children:["Background blur",o.jsx(v,{value:t.blur,onChange:s=>r({...t,blur:b(s,0,1)}),step:.05,precision:2})]})]}),o.jsx("div",{style:{color:y.content.muted,fontSize:10,lineHeight:1.45},children:"Preview controls are session-only. Bind the image, orientation, and accepted intensity in the owning scene source."})]})}function ce({documentId:e,assetPath:t,active:r=!0}){const[s,p]=f.useState(0),[n,a]=f.useState(null),[c,l]=f.useState(null),[i,d]=f.useState({exposure:1,intensity:1,rotation:0,blur:0}),m=f.useRef(i);m.current=i,f.useEffect(()=>{if(r)return _(t,()=>p(g=>g+1))},[r,t]),f.useEffect(()=>{if(!r)return;let g=!1,u=null;return a(null),l(null),X(t).then(h=>{if(u=h,g){h.texture.dispose();return}a(h)},h=>{g||l(h instanceof Error?h.message:String(h))}),()=>{g=!0,u?.texture.dispose()}},[r,t,s]);const x=f.useMemo(()=>[{id:"environment-image",title:"Environment Image",icon:C,order:M,body:{kind:"custom",...n?{data:{format:n.format,width:n.width,height:n.height,panorama:n.panorama}}:{},render:()=>o.jsxs("div",{style:{display:"grid",gridTemplateColumns:"auto 1fr",gap:"6px 10px"},children:[o.jsx("span",{style:{color:y.content.muted},children:"Format"}),o.jsx("span",{children:n?.format??"—"}),o.jsx("span",{style:{color:y.content.muted},children:"Resolution"}),o.jsx("span",{children:n?`${n.width} × ${n.height}`:"—"}),o.jsx("span",{style:{color:y.content.muted},children:"Projection"}),o.jsx("span",{children:n?.panorama?"2:1 equirectangular":"Flat image"})]})}},{id:"environment-preview-settings",title:"Preview",icon:k,order:D,body:{kind:"custom",data:{...i},render:()=>o.jsx(K,{panorama:n?.panorama??!1,settings:i,onChange:d})}}],[n,i]),w=U(t);return c?o.jsx(R,{documentId:e,active:r,type:"environment image",title:w,status:"HDR image unavailable",children:o.jsx("div",{role:"alert",style:{padding:20,color:y.semantic.danger},children:c})}):n?o.jsx(R,{documentId:e,active:r,type:"environment image",title:w,sections:x,status:`${n.format} · ${n.width} × ${n.height}`,fill:!0,children:o.jsxs("div",{style:{position:"relative",width:"100%",height:"100%",minHeight:0},children:[o.jsx(J,{image:n,settingsRef:m}),o.jsx("div",{style:{position:"absolute",left:12,bottom:12,padding:"4px 7px",borderRadius:4,background:"rgba(12,14,20,0.72)",color:"#f2f4f8",fontSize:10,pointerEvents:"none"},children:n.panorama?"Drag to orbit · wheel to frame":"Non-2:1 image · flat preview"})]})}):o.jsx(R,{documentId:e,active:r,type:"environment image",title:w,status:"Loading HDR image",children:o.jsx("div",{style:{padding:20,color:y.content.muted},children:"Loading environment…"})})}export{ce as EnvironmentAssetDocument};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{G,V as M,ce as ue,ae as q,a$ as he,af as fe,e as me,I as Z,ag as J,ao as de,aY as _,b_ as ge,b0 as B,v as b,r as D,E as ye,a as I,aU as ee,b3 as te,i as W,O as K,u as ve,bE as ne,o as S,bD as we,bA as Te,bV as Ie,M as Fe,aW as xe,be as Pe,b2 as Ae,bK as Se,ax as Y,aV as V,cf as Ee,aC as De,g as Le,cg as Me,aN as O,d as Ce,Q as R,b as ke,c as re,ch as be}from"./three.module-IFn-4i31.js";import{h5 as Re}from"./index-Ckxb31Yz.js";import"./index-nmcBqr7Y.js";import"./_commonjsHelpers-D6-XlEtG.js";import"./index-D_NuPfjr.js";import"./jsx-runtime-DPjLkJKQ.js";import"./index-CtzuWnCS.js";import"./index-CinJrH5C.js";import"./index-FUuS4qwW.js";import"./client-DNXj_opT.js";function ae(h,e,t){const n=t.length-h-1;if(e>=t[n])return n-1;if(e<=t[h])return h;let r=h,s=n,i=Math.floor((r+s)/2);for(;e<t[i]||e>=t[i+1];)e<t[i]?s=i:r=i,i=Math.floor((r+s)/2);return i}function Be(h,e,t,n){const r=[],s=[],i=[];r[0]=1;for(let a=1;a<=t;++a){s[a]=e-n[h+1-a],i[a]=n[h+a]-e;let o=0;for(let l=0;l<a;++l){const p=i[l+1],c=s[a-l],u=r[l]/(p+c);r[l]=o+p*u,o=c*u}r[a]=o}return r}function Oe(h,e,t,n){const r=ae(h,n,e),s=Be(r,n,h,e),i=new G(0,0,0,0);for(let a=0;a<=h;++a){const o=t[r-h+a],l=s[a],p=o.w*l;i.x+=o.x*p,i.y+=o.y*p,i.z+=o.z*p,i.w+=o.w*l}return i}function Ve(h,e,t,n,r){const s=[];for(let c=0;c<=t;++c)s[c]=0;const i=[];for(let c=0;c<=n;++c)i[c]=s.slice(0);const a=[];for(let c=0;c<=t;++c)a[c]=s.slice(0);a[0][0]=1;const o=s.slice(0),l=s.slice(0);for(let c=1;c<=t;++c){o[c]=e-r[h+1-c],l[c]=r[h+c]-e;let u=0;for(let f=0;f<c;++f){const m=l[f+1],g=o[c-f];a[c][f]=m+g;const d=a[f][c-1]/a[c][f];a[f][c]=u+m*d,u=g*d}a[c][c]=u}for(let c=0;c<=t;++c)i[0][c]=a[c][t];for(let c=0;c<=t;++c){let u=0,f=1;const m=[];for(let g=0;g<=t;++g)m[g]=s.slice(0);m[0][0]=1;for(let g=1;g<=n;++g){let d=0;const w=c-g,T=t-g;c>=g&&(m[f][0]=m[u][0]/a[T+1][w],d=m[f][0]*a[w][T]);const v=w>=-1?1:-w,x=c-1<=T?g-1:t-c;for(let P=v;P<=x;++P)m[f][P]=(m[u][P]-m[u][P-1])/a[T+1][w+P],d+=m[f][P]*a[w+P][T];c<=T&&(m[f][g]=-m[u][g-1]/a[T+1][c],d+=m[f][g]*a[c][T]),i[g][c]=d;const E=u;u=f,f=E}}let p=t;for(let c=1;c<=n;++c){for(let u=0;u<=t;++u)i[c][u]*=p;p*=t-c}return i}function Ue(h,e,t,n,r){const s=r<h?r:h,i=[],a=ae(h,n,e),o=Ve(a,n,h,s,e),l=[];for(let p=0;p<t.length;++p){const c=t[p].clone(),u=c.w;c.x*=u,c.y*=u,c.z*=u,l[p]=c}for(let p=0;p<=s;++p){const c=l[a-h].clone().multiplyScalar(o[p][0]);for(let u=1;u<=h;++u)c.add(l[a-h+u].clone().multiplyScalar(o[p][u]));i[p]=c}for(let p=s+1;p<=r+1;++p)i[p]=new G(0,0,0);return i}function Xe(h,e){let t=1;for(let r=2;r<=h;++r)t*=r;let n=1;for(let r=2;r<=e;++r)n*=r;for(let r=2;r<=h-e;++r)n*=r;return t/n}function Ge(h){const e=h.length,t=[],n=[];for(let s=0;s<e;++s){const i=h[s];t[s]=new M(i.x,i.y,i.z),n[s]=i.w}const r=[];for(let s=0;s<e;++s){const i=t[s].clone();for(let a=1;a<=s;++a)i.sub(r[s-a].clone().multiplyScalar(Xe(s,a)*n[a]));r[s]=i.divideScalar(n[0])}return r}function ze(h,e,t,n,r){const s=Ue(h,e,t,n,r);return Ge(s)}class je extends ue{constructor(e,t,n,r,s){super();const i=t?t.length-1:0,a=n?n.length:0;this.degree=e,this.knots=t,this.controlPoints=[],this.startKnot=r||0,this.endKnot=s||i;for(let o=0;o<a;++o){const l=n[o];this.controlPoints[o]=new G(l.x,l.y,l.z,l.w)}}getPoint(e,t=new M){const n=t,r=this.knots[this.startKnot]+e*(this.knots[this.endKnot]-this.knots[this.startKnot]),s=Oe(this.degree,this.knots,this.controlPoints,r);return s.w!==1&&s.divideScalar(s.w),n.set(s.x,s.y,s.z)}getTangent(e,t=new M){const n=t,r=this.knots[0]+e*(this.knots[this.knots.length-1]-this.knots[0]),s=ze(this.degree,this.knots,this.controlPoints,r,1);return n.copy(s[1]).normalize(),n}toJSON(){const e=super.toJSON();return e.degree=this.degree,e.knots=[...this.knots],e.controlPoints=this.controlPoints.map(t=>t.toArray()),e.startKnot=this.startKnot,e.endKnot=this.endKnot,e}fromJSON(e){return super.fromJSON(e),this.degree=e.degree,this.knots=[...e.knots],this.controlPoints=e.controlPoints.map(t=>new G(t[0],t[1],t[2],t[3])),this.startKnot=e.startKnot,this.endKnot=e.endKnot,this}}let y,F,A;class pt extends q{constructor(e){super(e)}load(e,t,n,r){const s=this,i=s.path===""?he.extractUrlBase(e):s.path,a=new fe(this.manager);a.setPath(s.path),a.setResponseType("arraybuffer"),a.setRequestHeader(s.requestHeader),a.setWithCredentials(s.withCredentials),a.load(e,function(o){try{t(s.parse(o,i))}catch(l){r?r(l):console.error(l),s.manager.itemError(e)}},n,r)}parse(e,t){if(Ye(e))y=new Ne().parse(e);else{const r=ce(e);if(!Qe(r))throw new Error("THREE.FBXLoader: Unknown format.");if(ie(r)<7e3)throw new Error("THREE.FBXLoader: FBX version not supported, FileVersion: "+ie(r));y=new We().parse(r)}const n=new me(this.manager).setPath(this.resourcePath||t).setCrossOrigin(this.crossOrigin);return new _e(n,this.manager).parse(y)}}class _e{constructor(e,t){this.textureLoader=e,this.manager=t}parse(){F=this.parseConnections();const e=this.parseImages(),t=this.parseTextures(e),n=this.parseMaterials(t),r=this.parseDeformers(),s=new Ke().parse(r);return this.parseScene(r,s,n),A}parseConnections(){const e=new Map;return"Connections"in y&&y.Connections.connections.forEach(function(n){const r=n[0],s=n[1],i=n[2];e.has(r)||e.set(r,{parents:[],children:[]});const a={ID:s,relationship:i};e.get(r).parents.push(a),e.has(s)||e.set(s,{parents:[],children:[]});const o={ID:r,relationship:i};e.get(s).children.push(o)}),e}parseImages(){const e={},t={};if("Video"in y.Objects){const n=y.Objects.Video;for(const r in n){const s=n[r],i=parseInt(r);if(e[i]=s.RelativeFilename||s.Filename,"Content"in s){const a=s.Content instanceof ArrayBuffer&&s.Content.byteLength>0,o=typeof s.Content=="string"&&s.Content!=="";if(a||o){const l=this.parseImage(n[r]);t[s.RelativeFilename||s.Filename]=l}}}}for(const n in e){const r=e[n];t[r]!==void 0?e[n]=t[r]:e[n]=e[n].split("\\").pop()}return e}parseImage(e){const t=e.Content,n=e.RelativeFilename||e.Filename,r=n.slice(n.lastIndexOf(".")+1).toLowerCase();let s;switch(r){case"bmp":s="image/bmp";break;case"jpg":case"jpeg":s="image/jpeg";break;case"png":s="image/png";break;case"tif":s="image/tiff";break;case"tga":this.manager.getHandler(".tga")===null&&console.warn("FBXLoader: TGA loader not found, skipping ",n),s="image/tga";break;case"webp":s="image/webp";break;default:console.warn('FBXLoader: Image type "'+r+'" is not supported.');return}if(typeof t=="string")return"data:"+s+";base64,"+t;{const i=new Uint8Array(t);return window.URL.createObjectURL(new Blob([i],{type:s}))}}parseTextures(e){const t=new Map;if("Texture"in y.Objects){const n=y.Objects.Texture;for(const r in n){const s=this.parseTexture(n[r],e);t.set(parseInt(r),s)}}return t}parseTexture(e,t){const n=this.loadTexture(e,t);n.ID=e.id,n.name=e.attrName;const r=e.WrapModeU,s=e.WrapModeV,i=r!==void 0?r.value:0,a=s!==void 0?s.value:0;if(n.wrapS=i===0?Z:J,n.wrapT=a===0?Z:J,"Scaling"in e){const o=e.Scaling.value;n.repeat.x=o[0],n.repeat.y=o[1]}if("Translation"in e){const o=e.Translation.value;n.offset.x=o[0],n.offset.y=o[1]}return n}loadTexture(e,t){const n=e.FileName.split(".").pop().toLowerCase();let r=this.manager.getHandler(`.${n}`);r===null&&(r=this.textureLoader);const s=r.path;s||r.setPath(this.textureLoader.path);const i=F.get(e.id).children;let a;if(i!==void 0&&i.length>0&&t[i[0].ID]!==void 0&&(a=t[i[0].ID],(a.indexOf("blob:")===0||a.indexOf("data:")===0)&&r.setPath(void 0)),a===void 0)return console.warn("FBXLoader: Undefined filename, creating placeholder texture."),new de;const o=r.load(a);return r.setPath(s),o}parseMaterials(e){const t=new Map;if("Material"in y.Objects){const n=y.Objects.Material;for(const r in n){const s=this.parseMaterial(n[r],e);s!==null&&t.set(parseInt(r),s)}}return t}parseMaterial(e,t){const n=e.id,r=e.attrName;let s=e.ShadingModel;if(typeof s=="object"&&(s=s.value),!F.has(n))return null;const i=this.parseParameters(e,t,n);let a;switch(s.toLowerCase()){case"phong":a=new _;break;case"lambert":a=new ge;break;default:console.warn('THREE.FBXLoader: unknown material type "%s". Defaulting to MeshPhongMaterial.',s),a=new _;break}return a.setValues(i),a.name=r,a}parseParameters(e,t,n){const r={};e.BumpFactor&&(r.bumpScale=e.BumpFactor.value),e.Diffuse?r.color=B.colorSpaceToWorking(new b().fromArray(e.Diffuse.value),D):e.DiffuseColor&&(e.DiffuseColor.type==="Color"||e.DiffuseColor.type==="ColorRGB")&&(r.color=B.colorSpaceToWorking(new b().fromArray(e.DiffuseColor.value),D)),e.DisplacementFactor&&(r.displacementScale=e.DisplacementFactor.value),e.Emissive?r.emissive=B.colorSpaceToWorking(new b().fromArray(e.Emissive.value),D):e.EmissiveColor&&(e.EmissiveColor.type==="Color"||e.EmissiveColor.type==="ColorRGB")&&(r.emissive=B.colorSpaceToWorking(new b().fromArray(e.EmissiveColor.value),D)),e.EmissiveFactor&&(r.emissiveIntensity=parseFloat(e.EmissiveFactor.value)),r.opacity=1-(e.TransparencyFactor?parseFloat(e.TransparencyFactor.value):0),(r.opacity===1||r.opacity===0)&&(r.opacity=e.Opacity?parseFloat(e.Opacity.value):null,r.opacity===null&&(r.opacity=1-(e.TransparentColor?parseFloat(e.TransparentColor.value[0]):0))),r.opacity<1&&(r.transparent=!0),e.ReflectionFactor&&(r.reflectivity=e.ReflectionFactor.value),e.Shininess&&(r.shininess=e.Shininess.value),e.Specular?r.specular=B.colorSpaceToWorking(new b().fromArray(e.Specular.value),D):e.SpecularColor&&e.SpecularColor.type==="Color"&&(r.specular=B.colorSpaceToWorking(new b().fromArray(e.SpecularColor.value),D));const s=this;return F.get(n).children.forEach(function(i){const a=i.relationship;switch(a){case"Bump":r.bumpMap=s.getTexture(t,i.ID);break;case"Maya|TEX_ao_map":r.aoMap=s.getTexture(t,i.ID);break;case"DiffuseColor":case"Maya|TEX_color_map":r.map=s.getTexture(t,i.ID),r.map!==void 0&&(r.map.colorSpace=D);break;case"DisplacementColor":r.displacementMap=s.getTexture(t,i.ID);break;case"EmissiveColor":r.emissiveMap=s.getTexture(t,i.ID),r.emissiveMap!==void 0&&(r.emissiveMap.colorSpace=D);break;case"NormalMap":case"Maya|TEX_normal_map":r.normalMap=s.getTexture(t,i.ID);break;case"ReflectionColor":r.envMap=s.getTexture(t,i.ID),r.envMap!==void 0&&(r.envMap.mapping=ye,r.envMap.colorSpace=D);break;case"SpecularColor":r.specularMap=s.getTexture(t,i.ID),r.specularMap!==void 0&&(r.specularMap.colorSpace=D);break;case"TransparentColor":case"TransparencyFactor":r.alphaMap=s.getTexture(t,i.ID),r.transparent=!0;break;case"AmbientColor":case"ShininessExponent":case"SpecularFactor":case"VectorDisplacementColor":default:console.warn("THREE.FBXLoader: %s map is not supported in three.js, skipping texture.",a);break}}),r}getTexture(e,t){return"LayeredTexture"in y.Objects&&t in y.Objects.LayeredTexture&&(console.warn("THREE.FBXLoader: layered textures are not supported in three.js. Discarding all but first layer."),t=F.get(t).children[0].ID),e.get(t)}parseDeformers(){const e={},t={};if("Deformer"in y.Objects){const n=y.Objects.Deformer;for(const r in n){const s=n[r],i=F.get(parseInt(r));if(s.attrType==="Skin"){const a=this.parseSkeleton(i,n);a.ID=r,i.parents.length>1&&console.warn("THREE.FBXLoader: skeleton attached to more than one geometry is not supported."),a.geometryID=i.parents[0].ID,e[r]=a}else if(s.attrType==="BlendShape"){const a={id:r};a.rawTargets=this.parseMorphTargets(i,n),a.id=r,i.parents.length>1&&console.warn("THREE.FBXLoader: morph target attached to more than one geometry is not supported."),t[r]=a}}}return{skeletons:e,morphTargets:t}}parseSkeleton(e,t){const n=[];return e.children.forEach(function(r){const s=t[r.ID];if(s.attrType!=="Cluster")return;const i={ID:r.ID,indices:[],weights:[],transformLink:new I().fromArray(s.TransformLink.a)};"Indexes"in s&&(i.indices=s.Indexes.a,i.weights=s.Weights.a),n.push(i)}),{rawBones:n,bones:[]}}parseMorphTargets(e,t){const n=[];for(let r=0;r<e.children.length;r++){const s=e.children[r],i=t[s.ID],a={name:i.attrName,initialWeight:i.DeformPercent,id:i.id,fullWeights:i.FullWeights.a};if(i.attrType!=="BlendShapeChannel")return;a.geoID=F.get(parseInt(s.ID)).children.filter(function(o){return o.relationship===void 0})[0].ID,n.push(a)}return n}parseScene(e,t,n){A=new ee;const r=this.parseModels(e.skeletons,t,n),s=y.Objects.Model,i=this;r.forEach(function(o){const l=s[o.ID];i.setLookAtProperties(o,l),F.get(o.ID).parents.forEach(function(c){const u=r.get(c.ID);u!==void 0&&u.add(o)}),o.parent===null&&A.add(o)}),this.bindSkeleton(e.skeletons,t,r),this.addGlobalSceneSettings(),A.traverse(function(o){if(o.userData.transformData){o.parent&&(o.userData.transformData.parentMatrix=o.parent.matrix,o.userData.transformData.parentMatrixWorld=o.parent.matrixWorld);const l=le(o.userData.transformData);o.applyMatrix4(l),o.updateWorldMatrix()}});const a=new He().parse();A.children.length===1&&A.children[0].isGroup&&(A.children[0].animations=a,A=A.children[0]),A.animations=a}parseModels(e,t,n){const r=new Map,s=y.Objects.Model;for(const i in s){const a=parseInt(i),o=s[i],l=F.get(a);let p=this.buildSkeleton(l,e,a,o.attrName);if(!p){switch(o.attrType){case"Camera":p=this.createCamera(l);break;case"Light":p=this.createLight(l);break;case"Mesh":p=this.createMesh(l,t,n);break;case"NurbsCurve":p=this.createCurve(l,t);break;case"LimbNode":case"Root":p=new te;break;case"Null":default:p=new ee;break}p.name=o.attrName?W.sanitizeNodeName(o.attrName):"",p.userData.originalName=o.attrName,p.ID=a}this.getTransformData(p,o),r.set(a,p)}return r}buildSkeleton(e,t,n,r){let s=null;return e.parents.forEach(function(i){for(const a in t){const o=t[a];o.rawBones.forEach(function(l,p){if(l.ID===i.ID){const c=s;s=new te,s.matrixWorld.copy(l.transformLink),s.name=r?W.sanitizeNodeName(r):"",s.userData.originalName=r,s.ID=n,o.bones[p]=s,c!==null&&s.add(c)}})}}),s}createCamera(e){let t,n;if(e.children.forEach(function(r){const s=y.Objects.NodeAttribute[r.ID];s!==void 0&&(n=s)}),n===void 0)t=new K;else{let r=0;n.CameraProjectionType!==void 0&&n.CameraProjectionType.value===1&&(r=1);let s=1;n.NearPlane!==void 0&&(s=n.NearPlane.value/1e3);let i=1e3;n.FarPlane!==void 0&&(i=n.FarPlane.value/1e3);let a=window.innerWidth,o=window.innerHeight;n.AspectWidth!==void 0&&n.AspectHeight!==void 0&&(a=n.AspectWidth.value,o=n.AspectHeight.value);const l=a/o;let p=45;n.FieldOfView!==void 0&&(p=n.FieldOfView.value);const c=n.FocalLength?n.FocalLength.value:null;switch(r){case 0:t=new ve(p,l,s,i),c!==null&&t.setFocalLength(c);break;case 1:console.warn("THREE.FBXLoader: Orthographic cameras not supported yet."),t=new K;break;default:console.warn("THREE.FBXLoader: Unknown camera type "+r+"."),t=new K;break}}return t}createLight(e){let t,n;if(e.children.forEach(function(r){const s=y.Objects.NodeAttribute[r.ID];s!==void 0&&(n=s)}),n===void 0)t=new K;else{let r;n.LightType===void 0?r=0:r=n.LightType.value;let s=16777215;n.Color!==void 0&&(s=B.colorSpaceToWorking(new b().fromArray(n.Color.value),D));let i=n.Intensity===void 0?1:n.Intensity.value/100;n.CastLightOnObject!==void 0&&n.CastLightOnObject.value===0&&(i=0);let a=0;n.FarAttenuationEnd!==void 0&&(n.EnableFarAttenuation!==void 0&&n.EnableFarAttenuation.value===0?a=0:a=n.FarAttenuationEnd.value);const o=1;switch(r){case 0:t=new ne(s,i,a,o);break;case 1:t=new Te(s,i);break;case 2:let l=Math.PI/3;n.InnerAngle!==void 0&&(l=S.degToRad(n.InnerAngle.value));let p=0;n.OuterAngle!==void 0&&(p=S.degToRad(n.OuterAngle.value),p=Math.max(p,1)),t=new we(s,i,a,l,p,o);break;default:console.warn("THREE.FBXLoader: Unknown light type "+n.LightType.value+", defaulting to a PointLight."),t=new ne(s,i);break}n.CastShadows!==void 0&&n.CastShadows.value===1&&(t.castShadow=!0)}return t}createMesh(e,t,n){let r,s=null,i=null;const a=[];if(e.children.forEach(function(o){t.has(o.ID)&&(s=t.get(o.ID)),n.has(o.ID)&&a.push(n.get(o.ID))}),a.length>1?i=a:a.length>0?i=a[0]:(i=new _({name:q.DEFAULT_MATERIAL_NAME,color:13421772}),a.push(i)),"color"in s.attributes&&a.forEach(function(o){o.vertexColors=!0}),s.groups.length>0){let o=!1;for(let l=0,p=s.groups.length;l<p;l++){const c=s.groups[l];(c.materialIndex<0||c.materialIndex>=a.length)&&(c.materialIndex=a.length,o=!0)}if(o){const l=new _;a.push(l)}}return s.FBX_Deformer?(r=new Ie(s,i),r.normalizeSkinWeights()):r=new Fe(s,i),r}createCurve(e,t){const n=e.children.reduce(function(s,i){return t.has(i.ID)&&(s=t.get(i.ID)),s},null),r=new xe({name:q.DEFAULT_MATERIAL_NAME,color:3342591,linewidth:1});return new Pe(n,r)}getTransformData(e,t){const n={};"InheritType"in t&&(n.inheritType=parseInt(t.InheritType.value)),"RotationOrder"in t?n.eulerOrder=z(t.RotationOrder.value):n.eulerOrder=z(0),"Lcl_Translation"in t&&(n.translation=t.Lcl_Translation.value),"PreRotation"in t&&(n.preRotation=t.PreRotation.value),"Lcl_Rotation"in t&&(n.rotation=t.Lcl_Rotation.value),"PostRotation"in t&&(n.postRotation=t.PostRotation.value),"Lcl_Scaling"in t&&(n.scale=t.Lcl_Scaling.value),"ScalingOffset"in t&&(n.scalingOffset=t.ScalingOffset.value),"ScalingPivot"in t&&(n.scalingPivot=t.ScalingPivot.value),"RotationOffset"in t&&(n.rotationOffset=t.RotationOffset.value),"RotationPivot"in t&&(n.rotationPivot=t.RotationPivot.value),e.userData.transformData=n}setLookAtProperties(e,t){"LookAtProperty"in t&&F.get(e.ID).children.forEach(function(r){if(r.relationship==="LookAtProperty"){const s=y.Objects.Model[r.ID];if("Lcl_Translation"in s){const i=s.Lcl_Translation.value;e.target!==void 0?(e.target.position.fromArray(i),A.add(e.target)):e.lookAt(new M().fromArray(i))}}})}bindSkeleton(e,t,n){const r=this.parsePoseNodes();for(const s in e){const i=e[s];F.get(parseInt(i.ID)).parents.forEach(function(o){if(t.has(o.ID)){const l=o.ID;F.get(l).parents.forEach(function(c){n.has(c.ID)&&n.get(c.ID).bind(new Ae(i.bones),r[c.ID])})}})}}parsePoseNodes(){const e={};if("Pose"in y.Objects){const t=y.Objects.Pose;for(const n in t)if(t[n].attrType==="BindPose"&&t[n].NbPoseNodes>0){const r=t[n].PoseNode;Array.isArray(r)?r.forEach(function(s){e[s.Node]=new I().fromArray(s.Matrix.a)}):e[r.Node]=new I().fromArray(r.Matrix.a)}}return e}addGlobalSceneSettings(){if("GlobalSettings"in y){if("AmbientColor"in y.GlobalSettings){const e=y.GlobalSettings.AmbientColor.value,t=e[0],n=e[1],r=e[2];if(t!==0||n!==0||r!==0){const s=new b().setRGB(t,n,r,D);A.add(new Se(s,1))}}"UnitScaleFactor"in y.GlobalSettings&&(A.userData.unitScaleFactor=y.GlobalSettings.UnitScaleFactor.value)}}}class Ke{constructor(){this.negativeMaterialIndices=!1}parse(e){const t=new Map;if("Geometry"in y.Objects){const n=y.Objects.Geometry;for(const r in n){const s=F.get(parseInt(r)),i=this.parseGeometry(s,n[r],e);t.set(parseInt(r),i)}}return this.negativeMaterialIndices===!0&&console.warn("THREE.FBXLoader: The FBX file contains invalid (negative) material indices. The asset might not render as expected."),t}parseGeometry(e,t,n){switch(t.attrType){case"Mesh":return this.parseMeshGeometry(e,t,n);case"NurbsCurve":return this.parseNurbsGeometry(t)}}parseMeshGeometry(e,t,n){const r=n.skeletons,s=[],i=e.parents.map(function(c){return y.Objects.Model[c.ID]});if(i.length===0)return;const a=e.children.reduce(function(c,u){return r[u.ID]!==void 0&&(c=r[u.ID]),c},null);e.children.forEach(function(c){n.morphTargets[c.ID]!==void 0&&s.push(n.morphTargets[c.ID])});const o=i[0],l={};"RotationOrder"in o&&(l.eulerOrder=z(o.RotationOrder.value)),"InheritType"in o&&(l.inheritType=parseInt(o.InheritType.value)),"GeometricTranslation"in o&&(l.translation=o.GeometricTranslation.value),"GeometricRotation"in o&&(l.rotation=o.GeometricRotation.value),"GeometricScaling"in o&&(l.scale=o.GeometricScaling.value);const p=le(l);return this.genGeometry(t,a,s,p)}genGeometry(e,t,n,r){const s=new Y;e.attrName&&(s.name=e.attrName);const i=this.parseGeoNode(e,t),a=this.genBuffers(i),o=new V(a.vertex,3);if(o.applyMatrix4(r),s.setAttribute("position",o),a.colors.length>0&&s.setAttribute("color",new V(a.colors,3)),t&&(s.setAttribute("skinIndex",new Ee(a.weightsIndices,4)),s.setAttribute("skinWeight",new V(a.vertexWeights,4)),s.FBX_Deformer=t),a.normal.length>0){const l=new De().getNormalMatrix(r),p=new V(a.normal,3);p.applyNormalMatrix(l),s.setAttribute("normal",p)}if(a.uvs.forEach(function(l,p){const c=p===0?"uv":`uv${p}`;s.setAttribute(c,new V(a.uvs[p],2))}),i.material&&i.material.mappingType!=="AllSame"){let l=a.materialIndex[0],p=0;if(a.materialIndex.forEach(function(c,u){c!==l&&(s.addGroup(p,u-p,l),l=c,p=u)}),s.groups.length>0){const c=s.groups[s.groups.length-1],u=c.start+c.count;u!==a.materialIndex.length&&s.addGroup(u,a.materialIndex.length-u,l)}s.groups.length===0&&s.addGroup(0,a.materialIndex.length,a.materialIndex[0])}return this.addMorphTargets(s,e,n,r),s}parseGeoNode(e,t){const n={};if(n.vertexPositions=e.Vertices!==void 0?e.Vertices.a:[],n.vertexIndices=e.PolygonVertexIndex!==void 0?e.PolygonVertexIndex.a:[],e.LayerElementColor&&e.LayerElementColor[0].Colors&&(n.color=this.parseVertexColors(e.LayerElementColor[0])),e.LayerElementMaterial&&(n.material=this.parseMaterialIndices(e.LayerElementMaterial[0])),e.LayerElementNormal&&(n.normal=this.parseNormals(e.LayerElementNormal[0])),e.LayerElementUV){n.uv=[];let r=0;for(;e.LayerElementUV[r];)e.LayerElementUV[r].UV&&n.uv.push(this.parseUVs(e.LayerElementUV[r])),r++}return n.weightTable={},t!==null&&(n.skeleton=t,t.rawBones.forEach(function(r,s){r.indices.forEach(function(i,a){n.weightTable[i]===void 0&&(n.weightTable[i]=[]),n.weightTable[i].push({id:s,weight:r.weights[a]})})})),n}genBuffers(e){const t={vertex:[],normal:[],colors:[],uvs:[],materialIndex:[],vertexWeights:[],weightsIndices:[]};let n=0,r=0,s=!1,i=[],a=[],o=[],l=[],p=[],c=[];const u=this;return e.vertexIndices.forEach(function(f,m){let g,d=!1;f<0&&(f=f^-1,d=!0);let w=[],T=[];if(i.push(f*3,f*3+1,f*3+2),e.color){const v=H(m,n,f,e.color);o.push(v[0],v[1],v[2])}if(e.skeleton){if(e.weightTable[f]!==void 0&&e.weightTable[f].forEach(function(v){T.push(v.weight),w.push(v.id)}),T.length>4){s||(console.warn("THREE.FBXLoader: Vertex has more than 4 skinning weights assigned to vertex. Deleting additional weights."),s=!0);const v=[0,0,0,0],x=[0,0,0,0];T.forEach(function(E,P){let k=E,L=w[P];x.forEach(function(j,X,C){if(k>j){C[X]=k,k=j;const N=v[X];v[X]=L,L=N}})}),w=v,T=x}for(;T.length<4;)T.push(0),w.push(0);for(let v=0;v<4;++v)p.push(T[v]),c.push(w[v])}if(e.normal){const v=H(m,n,f,e.normal);a.push(v[0],v[1],v[2])}e.material&&e.material.mappingType!=="AllSame"&&(g=H(m,n,f,e.material)[0],g<0&&(u.negativeMaterialIndices=!0,g=0)),e.uv&&e.uv.forEach(function(v,x){const E=H(m,n,f,v);l[x]===void 0&&(l[x]=[]),l[x].push(E[0]),l[x].push(E[1])}),r++,d&&(u.genFace(t,e,i,g,a,o,l,p,c,r),n++,r=0,i=[],a=[],o=[],l=[],p=[],c=[])}),t}getNormalNewell(e){const t=new M(0,0,0);for(let n=0;n<e.length;n++){const r=e[n],s=e[(n+1)%e.length];t.x+=(r.y-s.y)*(r.z+s.z),t.y+=(r.z-s.z)*(r.x+s.x),t.z+=(r.x-s.x)*(r.y+s.y)}return t.normalize(),t}getNormalTangentAndBitangent(e){const t=this.getNormalNewell(e),r=(Math.abs(t.z)>.5?new M(0,1,0):new M(0,0,1)).cross(t).normalize(),s=t.clone().cross(r).normalize();return{normal:t,tangent:r,bitangent:s}}flattenVertex(e,t,n){return new Le(e.dot(t),e.dot(n))}genFace(e,t,n,r,s,i,a,o,l,p){let c;if(p>3){const u=[],f=t.baseVertexPositions||t.vertexPositions;for(let w=0;w<n.length;w+=3)u.push(new M(f[n[w]],f[n[w+1]],f[n[w+2]]));const{tangent:m,bitangent:g}=this.getNormalTangentAndBitangent(u),d=[];for(const w of u)d.push(this.flattenVertex(w,m,g));c=Me.triangulateShape(d,[])}else c=[[0,1,2]];for(const[u,f,m]of c)e.vertex.push(t.vertexPositions[n[u*3]]),e.vertex.push(t.vertexPositions[n[u*3+1]]),e.vertex.push(t.vertexPositions[n[u*3+2]]),e.vertex.push(t.vertexPositions[n[f*3]]),e.vertex.push(t.vertexPositions[n[f*3+1]]),e.vertex.push(t.vertexPositions[n[f*3+2]]),e.vertex.push(t.vertexPositions[n[m*3]]),e.vertex.push(t.vertexPositions[n[m*3+1]]),e.vertex.push(t.vertexPositions[n[m*3+2]]),t.skeleton&&(e.vertexWeights.push(o[u*4]),e.vertexWeights.push(o[u*4+1]),e.vertexWeights.push(o[u*4+2]),e.vertexWeights.push(o[u*4+3]),e.vertexWeights.push(o[f*4]),e.vertexWeights.push(o[f*4+1]),e.vertexWeights.push(o[f*4+2]),e.vertexWeights.push(o[f*4+3]),e.vertexWeights.push(o[m*4]),e.vertexWeights.push(o[m*4+1]),e.vertexWeights.push(o[m*4+2]),e.vertexWeights.push(o[m*4+3]),e.weightsIndices.push(l[u*4]),e.weightsIndices.push(l[u*4+1]),e.weightsIndices.push(l[u*4+2]),e.weightsIndices.push(l[u*4+3]),e.weightsIndices.push(l[f*4]),e.weightsIndices.push(l[f*4+1]),e.weightsIndices.push(l[f*4+2]),e.weightsIndices.push(l[f*4+3]),e.weightsIndices.push(l[m*4]),e.weightsIndices.push(l[m*4+1]),e.weightsIndices.push(l[m*4+2]),e.weightsIndices.push(l[m*4+3])),t.color&&(e.colors.push(i[u*3]),e.colors.push(i[u*3+1]),e.colors.push(i[u*3+2]),e.colors.push(i[f*3]),e.colors.push(i[f*3+1]),e.colors.push(i[f*3+2]),e.colors.push(i[m*3]),e.colors.push(i[m*3+1]),e.colors.push(i[m*3+2])),t.material&&t.material.mappingType!=="AllSame"&&(e.materialIndex.push(r),e.materialIndex.push(r),e.materialIndex.push(r)),t.normal&&(e.normal.push(s[u*3]),e.normal.push(s[u*3+1]),e.normal.push(s[u*3+2]),e.normal.push(s[f*3]),e.normal.push(s[f*3+1]),e.normal.push(s[f*3+2]),e.normal.push(s[m*3]),e.normal.push(s[m*3+1]),e.normal.push(s[m*3+2])),t.uv&&t.uv.forEach(function(g,d){e.uvs[d]===void 0&&(e.uvs[d]=[]),e.uvs[d].push(a[d][u*2]),e.uvs[d].push(a[d][u*2+1]),e.uvs[d].push(a[d][f*2]),e.uvs[d].push(a[d][f*2+1]),e.uvs[d].push(a[d][m*2]),e.uvs[d].push(a[d][m*2+1])})}addMorphTargets(e,t,n,r){if(n.length===0)return;e.morphTargetsRelative=!0,e.morphAttributes.position=[];const s=this;n.forEach(function(i){i.rawTargets.forEach(function(a){const o=y.Objects.Geometry[a.geoID];o!==void 0&&s.genMorphGeometry(e,t,o,r,a.name)})})}genMorphGeometry(e,t,n,r,s){const i=t.Vertices!==void 0?t.Vertices.a:[],a=t.PolygonVertexIndex!==void 0?t.PolygonVertexIndex.a:[],o=n.Vertices!==void 0?n.Vertices.a:[],l=n.Indexes!==void 0?n.Indexes.a:[],p=e.attributes.position.count*3,c=new Float32Array(p);for(let g=0;g<l.length;g++){const d=l[g]*3;c[d]=o[g*3],c[d+1]=o[g*3+1],c[d+2]=o[g*3+2]}const u={vertexIndices:a,vertexPositions:c,baseVertexPositions:i},f=this.genBuffers(u),m=new V(f.vertex,3);m.name=s||n.attrName,m.applyMatrix4(r),e.morphAttributes.position.push(m)}parseNormals(e){const t=e.MappingInformationType,n=e.ReferenceInformationType,r=e.Normals.a;let s=[];return n==="IndexToDirect"&&("NormalIndex"in e?s=e.NormalIndex.a:"NormalsIndex"in e&&(s=e.NormalsIndex.a)),{dataSize:3,buffer:r,indices:s,mappingType:t,referenceType:n}}parseUVs(e){const t=e.MappingInformationType,n=e.ReferenceInformationType,r=e.UV.a;let s=[];return n==="IndexToDirect"&&(s=e.UVIndex.a),{dataSize:2,buffer:r,indices:s,mappingType:t,referenceType:n}}parseVertexColors(e){const t=e.MappingInformationType,n=e.ReferenceInformationType,r=e.Colors.a;let s=[];n==="IndexToDirect"&&(s=e.ColorIndex.a);for(let i=0,a=new b;i<r.length;i+=4)a.fromArray(r,i),B.colorSpaceToWorking(a,D),a.toArray(r,i);return{dataSize:4,buffer:r,indices:s,mappingType:t,referenceType:n}}parseMaterialIndices(e){const t=e.MappingInformationType,n=e.ReferenceInformationType;if(t==="NoMappingInformation")return{dataSize:1,buffer:[0],indices:[0],mappingType:"AllSame",referenceType:n};const r=e.Materials.a,s=[];for(let i=0;i<r.length;++i)s.push(i);return{dataSize:1,buffer:r,indices:s,mappingType:t,referenceType:n}}parseNurbsGeometry(e){const t=parseInt(e.Order);if(isNaN(t))return console.error("THREE.FBXLoader: Invalid Order %s given for geometry ID: %s",e.Order,e.id),new Y;const n=t-1,r=e.KnotVector.a,s=[],i=e.Points.a;for(let c=0,u=i.length;c<u;c+=4)s.push(new G().fromArray(i,c));let a,o;if(e.Form==="Closed")s.push(s[0]);else if(e.Form==="Periodic"){a=n,o=r.length-1-a;for(let c=0;c<n;++c)s.push(s[c])}const p=new je(n,r,s,a,o).getPoints(s.length*12);return new Y().setFromPoints(p)}}class He{parse(){const e=[],t=this.parseClips();if(t!==void 0)for(const n in t){const r=t[n],s=this.addClip(r);e.push(s)}return e}parseClips(){if(y.Objects.AnimationCurve===void 0)return;const e=this.parseAnimationCurveNodes();this.parseAnimationCurves(e);const t=this.parseAnimationLayers(e);return this.parseAnimStacks(t)}parseAnimationCurveNodes(){const e=y.Objects.AnimationCurveNode,t=new Map;for(const n in e){const r=e[n];if(r.attrName.match(/S|R|T|DeformPercent/)!==null){const s={id:r.id,attr:r.attrName,curves:{}};t.set(s.id,s)}}return t}parseAnimationCurves(e){const t=y.Objects.AnimationCurve;for(const n in t){const r={id:t[n].id,times:t[n].KeyTime.a.map($e),values:t[n].KeyValueFloat.a},s=F.get(r.id);if(s!==void 0){const i=s.parents[0].ID,a=s.parents[0].relationship;a.match(/X/)?e.get(i).curves.x=r:a.match(/Y/)?e.get(i).curves.y=r:a.match(/Z/)?e.get(i).curves.z=r:a.match(/DeformPercent/)&&e.has(i)&&(e.get(i).curves.morph=r)}}}parseAnimationLayers(e){const t=y.Objects.AnimationLayer,n=new Map;for(const r in t){const s=[],i=F.get(parseInt(r));i!==void 0&&(i.children.forEach(function(o,l){if(e.has(o.ID)){const p=e.get(o.ID);if(p.curves.x!==void 0||p.curves.y!==void 0||p.curves.z!==void 0){if(s[l]===void 0){const c=F.get(o.ID).parents.filter(function(u){return u.relationship!==void 0})[0].ID;if(c!==void 0){const u=y.Objects.Model[c.toString()];if(u===void 0){console.warn("THREE.FBXLoader: Encountered a unused curve.",o);return}const f={modelName:u.attrName?W.sanitizeNodeName(u.attrName):"",ID:u.id,initialPosition:[0,0,0],initialRotation:[0,0,0],initialScale:[1,1,1]};A.traverse(function(m){m.ID===u.id&&(f.transform=m.matrix,m.userData.transformData&&(f.eulerOrder=m.userData.transformData.eulerOrder))}),f.transform||(f.transform=new I),"PreRotation"in u&&(f.preRotation=u.PreRotation.value),"PostRotation"in u&&(f.postRotation=u.PostRotation.value),s[l]=f}}s[l]&&(s[l][p.attr]=p)}else if(p.curves.morph!==void 0){if(s[l]===void 0){const c=F.get(o.ID).parents.filter(function(w){return w.relationship!==void 0})[0].ID,u=F.get(c).parents[0].ID,f=F.get(u).parents[0].ID,m=F.get(f).parents[0].ID,g=y.Objects.Model[m],d={modelName:g.attrName?W.sanitizeNodeName(g.attrName):"",morphName:y.Objects.Deformer[c].attrName};s[l]=d}s[l][p.attr]=p}}}),n.set(parseInt(r),s))}return n}parseAnimStacks(e){const t=y.Objects.AnimationStack,n={};for(const r in t){const s=F.get(parseInt(r)).children;s.length>1&&console.warn("THREE.FBXLoader: Encountered an animation stack with multiple layers, this is currently not supported. Ignoring subsequent layers.");const i=e.get(s[0].ID);n[r]={name:t[r].attrName,layer:i}}return n}addClip(e){let t=[];const n=this;return e.layer.forEach(function(r){t=t.concat(n.generateTracks(r))}),new Ce(e.name,-1,t)}generateTracks(e){const t=[];let n=new M,r=new M;if(e.transform&&e.transform.decompose(n,new R,r),n=n.toArray(),r=r.toArray(),e.T!==void 0&&Object.keys(e.T.curves).length>0){const s=this.generateVectorTrack(e.modelName,e.T.curves,n,"position");s!==void 0&&t.push(s)}if(e.R!==void 0&&Object.keys(e.R.curves).length>0){const s=this.generateRotationTrack(e.modelName,e.R.curves,e.preRotation,e.postRotation,e.eulerOrder);s!==void 0&&t.push(s)}if(e.S!==void 0&&Object.keys(e.S.curves).length>0){const s=this.generateVectorTrack(e.modelName,e.S.curves,r,"scale");s!==void 0&&t.push(s)}if(e.DeformPercent!==void 0){const s=this.generateMorphTrack(e);s!==void 0&&t.push(s)}return t}generateVectorTrack(e,t,n,r){const s=this.getTimesForAllAxes(t),i=this.getKeyframeTrackValues(s,t,n);return new ke(e+"."+r,s,i)}generateRotationTrack(e,t,n,r,s){let i,a;if(t.x!==void 0&&t.y!==void 0&&t.z!==void 0){const u=this.interpolateRotations(t.x,t.y,t.z,s);i=u[0],a=u[1]}const o=z(0);n!==void 0&&(n=n.map(S.degToRad),n.push(o),n=new O().fromArray(n),n=new R().setFromEuler(n)),r!==void 0&&(r=r.map(S.degToRad),r.push(o),r=new O().fromArray(r),r=new R().setFromEuler(r).invert());const l=new R,p=new O,c=[];if(!a||!i)return new re(e+".quaternion",[0],[0]);for(let u=0;u<a.length;u+=3)p.set(a[u],a[u+1],a[u+2],s),l.setFromEuler(p),n!==void 0&&l.premultiply(n),r!==void 0&&l.multiply(r),u>2&&new R().fromArray(c,(u-3)/3*4).dot(l)<0&&l.set(-l.x,-l.y,-l.z,-l.w),l.toArray(c,u/3*4);return new re(e+".quaternion",i,c)}generateMorphTrack(e){const t=e.DeformPercent.curves.morph,n=t.values.map(function(s){return s/100}),r=A.getObjectByName(e.modelName).morphTargetDictionary[e.morphName];return new be(e.modelName+".morphTargetInfluences["+r+"]",t.times,n)}getTimesForAllAxes(e){let t=[];if(e.x!==void 0&&(t=t.concat(e.x.times)),e.y!==void 0&&(t=t.concat(e.y.times)),e.z!==void 0&&(t=t.concat(e.z.times)),t=t.sort(function(n,r){return n-r}),t.length>1){let n=1,r=t[0];for(let s=1;s<t.length;s++){const i=t[s];i!==r&&(t[n]=i,r=i,n++)}t=t.slice(0,n)}return t}getKeyframeTrackValues(e,t,n){const r=n,s=[];let i=-1,a=-1,o=-1;return e.forEach(function(l){if(t.x&&(i=t.x.times.indexOf(l)),t.y&&(a=t.y.times.indexOf(l)),t.z&&(o=t.z.times.indexOf(l)),i!==-1){const p=t.x.values[i];s.push(p),r[0]=p}else s.push(r[0]);if(a!==-1){const p=t.y.values[a];s.push(p),r[1]=p}else s.push(r[1]);if(o!==-1){const p=t.z.values[o];s.push(p),r[2]=p}else s.push(r[2])}),s}interpolateRotations(e,t,n,r){const s=[],i=[];s.push(e.times[0]),i.push(S.degToRad(e.values[0])),i.push(S.degToRad(t.values[0])),i.push(S.degToRad(n.values[0]));for(let a=1;a<e.values.length;a++){const o=[e.values[a-1],t.values[a-1],n.values[a-1]];if(isNaN(o[0])||isNaN(o[1])||isNaN(o[2]))continue;const l=o.map(S.degToRad),p=[e.values[a],t.values[a],n.values[a]];if(isNaN(p[0])||isNaN(p[1])||isNaN(p[2]))continue;const c=p.map(S.degToRad),u=[p[0]-o[0],p[1]-o[1],p[2]-o[2]],f=[Math.abs(u[0]),Math.abs(u[1]),Math.abs(u[2])];if(f[0]>=180||f[1]>=180||f[2]>=180){const g=Math.max(...f)/180,d=new O(...l,r),w=new O(...c,r),T=new R().setFromEuler(d),v=new R().setFromEuler(w);T.dot(v)&&v.set(-v.x,-v.y,-v.z,-v.w);const x=e.times[a-1],E=e.times[a]-x,P=new R,k=new O;for(let L=0;L<1;L+=1/g)P.copy(T.clone().slerp(v.clone(),L)),s.push(x+L*E),k.setFromQuaternion(P,r),i.push(k.x),i.push(k.y),i.push(k.z)}else s.push(e.times[a]),i.push(S.degToRad(e.values[a])),i.push(S.degToRad(t.values[a])),i.push(S.degToRad(n.values[a]))}return[s,i]}}class We{getPrevNode(){return this.nodeStack[this.currentIndent-2]}getCurrentNode(){return this.nodeStack[this.currentIndent-1]}getCurrentProp(){return this.currentProp}pushStack(e){this.nodeStack.push(e),this.currentIndent+=1}popStack(){this.nodeStack.pop(),this.currentIndent-=1}setCurrentProp(e,t){this.currentProp=e,this.currentPropName=t}parse(e){this.currentIndent=0,this.allNodes=new oe,this.nodeStack=[],this.currentProp=[],this.currentPropName="";const t=this,n=e.split(/[\r\n]+/);return n.forEach(function(r,s){const i=r.match(/^[\s\t]*;/),a=r.match(/^[\s\t]*$/);if(i||a)return;const o=r.match("^\\t{"+t.currentIndent+"}(\\w+):(.*){",""),l=r.match("^\\t{"+t.currentIndent+"}(\\w+):[\\s\\t\\r\\n](.*)"),p=r.match("^\\t{"+(t.currentIndent-1)+"}}");o?t.parseNodeBegin(r,o):l?t.parseNodeProperty(r,l,n[++s]):p?t.popStack():r.match(/^[^\s\t}]/)&&t.parseNodePropertyContinued(r)}),this.allNodes}parseNodeBegin(e,t){const n=t[1].trim().replace(/^"/,"").replace(/"$/,""),r=t[2].split(",").map(function(o){return o.trim().replace(/^"/,"").replace(/"$/,"")}),s={name:n},i=this.parseNodeAttr(r),a=this.getCurrentNode();this.currentIndent===0?this.allNodes.add(n,s):n in a?(n==="PoseNode"?a.PoseNode.push(s):a[n].id!==void 0&&(a[n]={},a[n][a[n].id]=a[n]),i.id!==""&&(a[n][i.id]=s)):typeof i.id=="number"?(a[n]={},a[n][i.id]=s):n!=="Properties70"&&(n==="PoseNode"?a[n]=[s]:a[n]=s),typeof i.id=="number"&&(s.id=i.id),i.name!==""&&(s.attrName=i.name),i.type!==""&&(s.attrType=i.type),this.pushStack(s)}parseNodeAttr(e){let t=e[0];e[0]!==""&&(t=parseInt(e[0]),isNaN(t)&&(t=e[0]));let n="",r="";return e.length>1&&(n=e[1].replace(/^(\w+)::/,""),r=e[2]),{id:t,name:n,type:r}}parseNodeProperty(e,t,n){let r=t[1].replace(/^"/,"").replace(/"$/,"").trim(),s=t[2].replace(/^"/,"").replace(/"$/,"").trim();r==="Content"&&s===","&&(s=n.replace(/"/g,"").replace(/,$/,"").trim());const i=this.getCurrentNode();if(i.name==="Properties70"){this.parseNodeSpecialProperty(e,r,s);return}if(r==="C"){const o=s.split(",").slice(1),l=parseInt(o[0]),p=parseInt(o[1]);let c=s.split(",").slice(3);c=c.map(function(u){return u.trim().replace(/^"/,"")}),r="connections",s=[l,p],Ze(s,c),i[r]===void 0&&(i[r]=[])}r==="Node"&&(i.id=s),r in i&&Array.isArray(i[r])?i[r].push(s):r!=="a"?i[r]=s:i.a=s,this.setCurrentProp(i,r),r==="a"&&s.slice(-1)!==","&&(i.a=$(s))}parseNodePropertyContinued(e){const t=this.getCurrentNode();t.a+=e,e.slice(-1)!==","&&(t.a=$(t.a))}parseNodeSpecialProperty(e,t,n){const r=n.split('",').map(function(p){return p.trim().replace(/^\"/,"").replace(/\s/,"_")}),s=r[0],i=r[1],a=r[2],o=r[3];let l=r[4];switch(i){case"int":case"enum":case"bool":case"ULongLong":case"double":case"Number":case"FieldOfView":l=parseFloat(l);break;case"Color":case"ColorRGB":case"Vector3D":case"Lcl_Translation":case"Lcl_Rotation":case"Lcl_Scaling":l=$(l);break}this.getPrevNode()[s]={type:i,type2:a,flag:o,value:l},this.setCurrentProp(this.getPrevNode(),s)}}class Ne{parse(e){const t=new se(e);t.skip(23);const n=t.getUint32();if(n<6400)throw new Error("THREE.FBXLoader: FBX version not supported, FileVersion: "+n);const r=new oe;for(;!this.endOfContent(t);){const s=this.parseNode(t,n);s!==null&&r.add(s.name,s)}return r}endOfContent(e){return e.size()%16===0?(e.getOffset()+160+16&-16)>=e.size():e.getOffset()+160+16>=e.size()}parseNode(e,t){const n={},r=t>=7500?e.getUint64():e.getUint32(),s=t>=7500?e.getUint64():e.getUint32();t>=7500?e.getUint64():e.getUint32();const i=e.getUint8(),a=e.getString(i);if(r===0)return null;const o=[];for(let u=0;u<s;u++)o.push(this.parseProperty(e));const l=o.length>0?o[0]:"",p=o.length>1?o[1]:"",c=o.length>2?o[2]:"";for(n.singleProperty=s===1&&e.getOffset()===r;r>e.getOffset();){const u=this.parseNode(e,t);u!==null&&this.parseSubNode(a,n,u)}return n.propertyList=o,typeof l=="number"&&(n.id=l),p!==""&&(n.attrName=p),c!==""&&(n.attrType=c),a!==""&&(n.name=a),n}parseSubNode(e,t,n){if(n.singleProperty===!0){const r=n.propertyList[0];Array.isArray(r)?(t[n.name]=n,n.a=r):t[n.name]=r}else if(e==="Connections"&&n.name==="C"){const r=[];n.propertyList.forEach(function(s,i){i!==0&&r.push(s)}),t.connections===void 0&&(t.connections=[]),t.connections.push(r)}else if(n.name==="Properties70")Object.keys(n).forEach(function(s){t[s]=n[s]});else if(e==="Properties70"&&n.name==="P"){let r=n.propertyList[0],s=n.propertyList[1];const i=n.propertyList[2],a=n.propertyList[3];let o;r.indexOf("Lcl ")===0&&(r=r.replace("Lcl ","Lcl_")),s.indexOf("Lcl ")===0&&(s=s.replace("Lcl ","Lcl_")),s==="Color"||s==="ColorRGB"||s==="Vector"||s==="Vector3D"||s.indexOf("Lcl_")===0?o=[n.propertyList[4],n.propertyList[5],n.propertyList[6]]:o=n.propertyList[4],t[r]={type:s,type2:i,flag:a,value:o}}else t[n.name]===void 0?typeof n.id=="number"?(t[n.name]={},t[n.name][n.id]=n):t[n.name]=n:n.name==="PoseNode"?(Array.isArray(t[n.name])||(t[n.name]=[t[n.name]]),t[n.name].push(n)):t[n.name][n.id]===void 0&&(t[n.name][n.id]=n)}parseProperty(e){const t=e.getString(1);let n;switch(t){case"C":return e.getBoolean();case"D":return e.getFloat64();case"F":return e.getFloat32();case"I":return e.getInt32();case"L":return e.getInt64();case"R":return n=e.getUint32(),e.getArrayBuffer(n);case"S":return n=e.getUint32(),e.getString(n);case"Y":return e.getInt16();case"b":case"c":case"d":case"f":case"i":case"l":const r=e.getUint32(),s=e.getUint32(),i=e.getUint32();if(s===0)switch(t){case"b":case"c":return e.getBooleanArray(r);case"d":return e.getFloat64Array(r);case"f":return e.getFloat32Array(r);case"i":return e.getInt32Array(r);case"l":return e.getInt64Array(r)}const a=Re(new Uint8Array(e.getArrayBuffer(i))),o=new se(a.buffer);switch(t){case"b":case"c":return o.getBooleanArray(r);case"d":return o.getFloat64Array(r);case"f":return o.getFloat32Array(r);case"i":return o.getInt32Array(r);case"l":return o.getInt64Array(r)}break;default:throw new Error("THREE.FBXLoader: Unknown property type "+t)}}}class se{constructor(e,t){this.dv=new DataView(e),this.offset=0,this.littleEndian=t!==void 0?t:!0,this._textDecoder=new TextDecoder}getOffset(){return this.offset}size(){return this.dv.buffer.byteLength}skip(e){this.offset+=e}getBoolean(){return(this.getUint8()&1)===1}getBooleanArray(e){const t=[];for(let n=0;n<e;n++)t.push(this.getBoolean());return t}getUint8(){const e=this.dv.getUint8(this.offset);return this.offset+=1,e}getInt16(){const e=this.dv.getInt16(this.offset,this.littleEndian);return this.offset+=2,e}getInt32(){const e=this.dv.getInt32(this.offset,this.littleEndian);return this.offset+=4,e}getInt32Array(e){const t=[];for(let n=0;n<e;n++)t.push(this.getInt32());return t}getUint32(){const e=this.dv.getUint32(this.offset,this.littleEndian);return this.offset+=4,e}getInt64(){let e,t;return this.littleEndian?(e=this.getUint32(),t=this.getUint32()):(t=this.getUint32(),e=this.getUint32()),t&2147483648?(t=~t&4294967295,e=~e&4294967295,e===4294967295&&(t=t+1&4294967295),e=e+1&4294967295,-(t*4294967296+e)):t*4294967296+e}getInt64Array(e){const t=[];for(let n=0;n<e;n++)t.push(this.getInt64());return t}getUint64(){let e,t;return this.littleEndian?(e=this.getUint32(),t=this.getUint32()):(t=this.getUint32(),e=this.getUint32()),t*4294967296+e}getFloat32(){const e=this.dv.getFloat32(this.offset,this.littleEndian);return this.offset+=4,e}getFloat32Array(e){const t=[];for(let n=0;n<e;n++)t.push(this.getFloat32());return t}getFloat64(){const e=this.dv.getFloat64(this.offset,this.littleEndian);return this.offset+=8,e}getFloat64Array(e){const t=[];for(let n=0;n<e;n++)t.push(this.getFloat64());return t}getArrayBuffer(e){const t=this.dv.buffer.slice(this.offset,this.offset+e);return this.offset+=e,t}getString(e){const t=this.offset;let n=new Uint8Array(this.dv.buffer,t,e);this.skip(e);const r=n.indexOf(0);return r>=0&&(n=new Uint8Array(this.dv.buffer,t,r)),this._textDecoder.decode(n)}}class oe{add(e,t){this[e]=t}}function Ye(h){const e="Kaydara FBX Binary \0";return h.byteLength>=e.length&&e===ce(h,0,e.length)}function Qe(h){const e=["K","a","y","d","a","r","a","\\","F","B","X","\\","B","i","n","a","r","y","\\","\\"];let t=0;function n(r){const s=h[r-1];return h=h.slice(t+r),t++,s}for(let r=0;r<e.length;++r)if(n(1)===e[r])return!1;return!0}function ie(h){const e=/FBXVersion: (\d+)/,t=h.match(e);if(t)return parseInt(t[1]);throw new Error("THREE.FBXLoader: Cannot find the version number for the file given.")}function $e(h){return h/46186158e3}const qe=[];function H(h,e,t,n){let r;switch(n.mappingType){case"ByPolygonVertex":r=h;break;case"ByPolygon":r=e;break;case"ByVertice":r=t;break;case"AllSame":r=n.indices[0];break;default:console.warn("THREE.FBXLoader: unknown attribute mapping type "+n.mappingType)}n.referenceType==="IndexToDirect"&&(r=n.indices[r]);const s=r*n.dataSize,i=s+n.dataSize;return Je(qe,n.buffer,s,i)}const Q=new O,U=new M;function le(h){const e=new I,t=new I,n=new I,r=new I,s=new I,i=new I,a=new I,o=new I,l=new I,p=new I,c=new I,u=new I,f=h.inheritType?h.inheritType:0;h.translation&&e.setPosition(U.fromArray(h.translation));const m=z(0);if(h.preRotation){const C=h.preRotation.map(S.degToRad);C.push(m),t.makeRotationFromEuler(Q.fromArray(C))}if(h.rotation){const C=h.rotation.map(S.degToRad);C.push(h.eulerOrder||m),n.makeRotationFromEuler(Q.fromArray(C))}if(h.postRotation){const C=h.postRotation.map(S.degToRad);C.push(m),r.makeRotationFromEuler(Q.fromArray(C)),r.invert()}h.scale&&s.scale(U.fromArray(h.scale)),h.scalingOffset&&a.setPosition(U.fromArray(h.scalingOffset)),h.scalingPivot&&i.setPosition(U.fromArray(h.scalingPivot)),h.rotationOffset&&o.setPosition(U.fromArray(h.rotationOffset)),h.rotationPivot&&l.setPosition(U.fromArray(h.rotationPivot)),h.parentMatrixWorld&&(c.copy(h.parentMatrix),p.copy(h.parentMatrixWorld));const g=t.clone().multiply(n).multiply(r),d=new I;d.extractRotation(p);const w=new I;w.copyPosition(p);const T=w.clone().invert().multiply(p),v=d.clone().invert().multiply(T),x=s,E=new I;if(f===0)E.copy(d).multiply(g).multiply(v).multiply(x);else if(f===1)E.copy(d).multiply(v).multiply(g).multiply(x);else{const N=new I().scale(new M().setFromMatrixScale(c)).clone().invert(),pe=v.clone().multiply(N);E.copy(d).multiply(g).multiply(pe).multiply(x)}const P=l.clone().invert(),k=i.clone().invert();let L=e.clone().multiply(o).multiply(l).multiply(t).multiply(n).multiply(r).multiply(P).multiply(a).multiply(i).multiply(s).multiply(k);const j=new I().copyPosition(L),X=p.clone().multiply(j);return u.copyPosition(X),L=u.clone().multiply(E),L.premultiply(p.invert()),L}function z(h){h=h||0;const e=["ZYX","YZX","XZY","ZXY","YXZ","XYZ"];return h===6?(console.warn("THREE.FBXLoader: unsupported Euler Order: Spherical XYZ. Animations and rotations may be incorrect."),e[0]):e[h]}function $(h){return h.split(",").map(function(t){return parseFloat(t)})}function ce(h,e,t){return e===void 0&&(e=0),t===void 0&&(t=h.byteLength),new TextDecoder().decode(new Uint8Array(h,e,t))}function Ze(h,e){for(let t=0,n=h.length,r=e.length;t<r;t++,n++)h[n]=e[t]}function Je(h,e,t,n){for(let r=t,s=0;r<n;r++,s++)h[s]=e[r];return h}export{pt as FBXLoader};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as s}from"./index-nmcBqr7Y.js";import{u as l}from"./events-156d8d12.esm-C734MYnx.js";import{J as y,ac as h,a0 as d,a7 as T,a2 as b}from"./three.module-IFn-4i31.js";function v(t,a,f){const n=l(r=>r.size),p=l(r=>r.viewport),e=typeof t=="number"?t:n.width*p.dpr,u=typeof a=="number"?a:n.height*p.dpr,c=(typeof t=="number"?f:t)||{},{samples:i=0,depth:m,...g}=c,F=m??c.depthBuffer,o=s.useMemo(()=>{const r=new y(e,u,{minFilter:d,magFilter:d,type:h,...g});return F&&(r.depthTexture=new T(e,u,b)),r.samples=i,r},[]);return s.useLayoutEffect(()=>{o.setSize(e,u),i&&(o.samples=i)},[i,o,e,u]),s.useEffect(()=>()=>o.dispose(),[]),o}const z=s.forwardRef(({children:t,width:a,height:f,...n},p)=>{const e=v(a,f,n);return s.useImperativeHandle(p,()=>e,[e]),s.createElement(s.Fragment,null,t?.(e))});export{z as F,v as u};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{
|
|
2
|
-
`)a=0,c-=i;else{const l=q(u,h,a,c,e);a+=l.offsetX,s.push(l.path)}}return s}function q(d,t,e,o,h){const i=h.glyphs[d]||h.glyphs["?"];if(!i){console.error('THREE.Font: character "'+d+'" does not exists in font family '+h.familyName+".");return}const s=new
|
|
1
|
+
import{ae as m,af as F,bj as T}from"./three.module-IFn-4i31.js";class S extends m{constructor(t){super(t)}load(t,e,o,h){const i=this,s=new F(this.manager);s.setPath(this.path),s.setRequestHeader(this.requestHeader),s.setWithCredentials(this.withCredentials),s.load(t,function(a){const c=i.parse(JSON.parse(a));e&&e(c)},o,h)}parse(t){return new k(t)}}class k{constructor(t){this.isFont=!0,this.type="Font",this.data=t}generateShapes(t,e=100){const o=[],h=w(t,e,this.data);for(let i=0,s=h.length;i<s;i++)o.push(...h[i].toShapes());return o}}function w(d,t,e){const o=Array.from(d),h=t/e.resolution,i=(e.boundingBox.yMax-e.boundingBox.yMin+e.underlineThickness)*h,s=[];let a=0,c=0;for(let p=0;p<o.length;p++){const u=o[p];if(u===`
|
|
2
|
+
`)a=0,c-=i;else{const l=q(u,h,a,c,e);a+=l.offsetX,s.push(l.path)}}return s}function q(d,t,e,o,h){const i=h.glyphs[d]||h.glyphs["?"];if(!i){console.error('THREE.Font: character "'+d+'" does not exists in font family '+h.familyName+".");return}const s=new T;let a,c,p,u,l,y,g,x;if(i.o){const n=i._cachedOutline||(i._cachedOutline=i.o.split(" "));for(let r=0,b=n.length;r<b;)switch(n[r++]){case"m":a=n[r++]*t+e,c=n[r++]*t+o,s.moveTo(a,c);break;case"l":a=n[r++]*t+e,c=n[r++]*t+o,s.lineTo(a,c);break;case"q":p=n[r++]*t+e,u=n[r++]*t+o,l=n[r++]*t+e,y=n[r++]*t+o,s.quadraticCurveTo(l,y,p,u);break;case"b":p=n[r++]*t+e,u=n[r++]*t+o,l=n[r++]*t+e,y=n[r++]*t+o,g=n[r++]*t+e,x=n[r++]*t+o,s.bezierCurveTo(l,y,g,x,p,u);break}}return{offsetX:i.ha*t,path:s}}export{k as Font,S as FontLoader};
|