@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,157 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* B8.4 — pure horizontal-slice measurement math for
|
|
3
|
-
* `project.humanoid.slice-measure`: cut a world-space triangle soup at a
|
|
4
|
-
* height, fit an axis-aligned ellipse to the cross-section, and sample the
|
|
5
|
-
* outline radially so the residual shape (relative to that ellipse) can be
|
|
6
|
-
* pasted into a body spec as a profile suggestion.
|
|
7
|
-
*
|
|
8
|
-
* Deliberately three.js-free (plain numbers in flat arrays) so every formula
|
|
9
|
-
* here is unit-testable against exact synthetic outlines — see
|
|
10
|
-
* `packages/editor/test/humanoid-slice-measure.test.ts`.
|
|
11
|
-
*
|
|
12
|
-
* Conventions (matching the humanoid body engine's ring vocabulary):
|
|
13
|
-
* - `hx`/`hz` are half-extents along +X / +Z; `ox`/`oz` the slice center.
|
|
14
|
-
* - Radial angle θ starts at +Z (the character's FRONT once the model is
|
|
15
|
-
* yaw-normalized to face +Z) and turns toward +X: direction
|
|
16
|
-
* `(x, z) = (sin θ, cos θ)`.
|
|
17
|
-
*/
|
|
18
|
-
|
|
19
|
-
export interface SliceEllipse {
|
|
20
|
-
/** Half-extent along X (metres, world space). */
|
|
21
|
-
hx: number;
|
|
22
|
-
/** Half-extent along Z. */
|
|
23
|
-
hz: number;
|
|
24
|
-
/** Slice-center offset along X. */
|
|
25
|
-
ox: number;
|
|
26
|
-
/** Slice-center offset along Z. */
|
|
27
|
-
oz: number;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
/**
|
|
31
|
-
* Intersect a triangle soup with the horizontal plane `y`, returning flat
|
|
32
|
-
* cross-section segments `[x1, z1, x2, z2, ...]`.
|
|
33
|
-
*
|
|
34
|
-
* `triangles` is a flat xyz soup: 9 numbers per triangle. An edge crosses the
|
|
35
|
-
* plane when its endpoints land on opposite sides of the half-open split
|
|
36
|
-
* `y_vertex <= y` — a deterministic convention that also resolves vertices
|
|
37
|
-
* lying exactly on the plane without epsilon tuning.
|
|
38
|
-
*/
|
|
39
|
-
export function sliceTriangleSegments(triangles: ArrayLike<number>, y: number): number[] {
|
|
40
|
-
if (triangles.length % 9 !== 0) {
|
|
41
|
-
throw new Error(`Triangle soup length must be a multiple of 9, got ${triangles.length}.`);
|
|
42
|
-
}
|
|
43
|
-
const segments: number[] = [];
|
|
44
|
-
const crossX: number[] = [0, 0];
|
|
45
|
-
const crossZ: number[] = [0, 0];
|
|
46
|
-
for (let base = 0; base < triangles.length; base += 9) {
|
|
47
|
-
let crossings = 0;
|
|
48
|
-
for (let edge = 0; edge < 3 && crossings < 2; edge++) {
|
|
49
|
-
const a = base + edge * 3;
|
|
50
|
-
const b = base + ((edge + 1) % 3) * 3;
|
|
51
|
-
const ya = triangles[a + 1]!;
|
|
52
|
-
const yb = triangles[b + 1]!;
|
|
53
|
-
if (ya <= y === yb <= y) continue;
|
|
54
|
-
const t = (y - ya) / (yb - ya);
|
|
55
|
-
crossX[crossings] = triangles[a]! + (triangles[b]! - triangles[a]!) * t;
|
|
56
|
-
crossZ[crossings] = triangles[a + 2]! + (triangles[b + 2]! - triangles[a + 2]!) * t;
|
|
57
|
-
crossings++;
|
|
58
|
-
}
|
|
59
|
-
if (crossings === 2) {
|
|
60
|
-
segments.push(crossX[0]!, crossZ[0]!, crossX[1]!, crossZ[1]!);
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
return segments;
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
/**
|
|
67
|
-
* Axis-aligned ellipse fit from the cross-section's extents: center at the
|
|
68
|
-
* middle of the X/Z bounds, half-extents to those bounds — the same shape a
|
|
69
|
-
* body-spec ring row (`hx`, `hz`, center offset) describes.
|
|
70
|
-
*/
|
|
71
|
-
export function fitSliceEllipse(segments: ArrayLike<number>): SliceEllipse {
|
|
72
|
-
if (segments.length === 0 || segments.length % 4 !== 0) {
|
|
73
|
-
throw new Error(`Slice segments must be non-empty groups of 4, got ${segments.length}.`);
|
|
74
|
-
}
|
|
75
|
-
let minX = Number.POSITIVE_INFINITY;
|
|
76
|
-
let maxX = Number.NEGATIVE_INFINITY;
|
|
77
|
-
let minZ = Number.POSITIVE_INFINITY;
|
|
78
|
-
let maxZ = Number.NEGATIVE_INFINITY;
|
|
79
|
-
for (let index = 0; index < segments.length; index += 2) {
|
|
80
|
-
const x = segments[index]!;
|
|
81
|
-
const z = segments[index + 1]!;
|
|
82
|
-
if (x < minX) minX = x;
|
|
83
|
-
if (x > maxX) maxX = x;
|
|
84
|
-
if (z < minZ) minZ = z;
|
|
85
|
-
if (z > maxZ) maxZ = z;
|
|
86
|
-
}
|
|
87
|
-
return {
|
|
88
|
-
hx: (maxX - minX) / 2,
|
|
89
|
-
hz: (maxZ - minZ) / 2,
|
|
90
|
-
ox: (minX + maxX) / 2,
|
|
91
|
-
oz: (minZ + maxZ) / 2,
|
|
92
|
-
};
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
/** Polar radius of the axis-aligned ellipse at angle θ (θ=0 → +Z, toward
|
|
96
|
-
* +X): the r solving `(r sinθ / hx)² + (r cosθ / hz)² = 1`. */
|
|
97
|
-
export function ellipseRadiusAt(hx: number, hz: number, theta: number): number {
|
|
98
|
-
if (hx <= 0 || hz <= 0) {
|
|
99
|
-
throw new Error(`Ellipse radii must be positive (hx=${hx}, hz=${hz}).`);
|
|
100
|
-
}
|
|
101
|
-
const sin = Math.sin(theta);
|
|
102
|
-
const cos = Math.cos(theta);
|
|
103
|
-
return 1 / Math.sqrt((sin * sin) / (hx * hx) + (cos * cos) / (hz * hz));
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
/** Farthest intersection distance of the ray from `(ox, oz)` in direction
|
|
107
|
-
* `(sin θ, cos θ)` against the slice segments; 0 when nothing is hit. */
|
|
108
|
-
export function radialDistance(
|
|
109
|
-
segments: ArrayLike<number>,
|
|
110
|
-
ox: number,
|
|
111
|
-
oz: number,
|
|
112
|
-
theta: number,
|
|
113
|
-
): number {
|
|
114
|
-
const dirX = Math.sin(theta);
|
|
115
|
-
const dirZ = Math.cos(theta);
|
|
116
|
-
let farthest = 0;
|
|
117
|
-
for (let index = 0; index < segments.length; index += 4) {
|
|
118
|
-
const ax = segments[index]! - ox;
|
|
119
|
-
const az = segments[index + 1]! - oz;
|
|
120
|
-
const bx = segments[index + 2]! - ox;
|
|
121
|
-
const bz = segments[index + 3]! - oz;
|
|
122
|
-
const ex = bx - ax;
|
|
123
|
-
const ez = bz - az;
|
|
124
|
-
// Solve a + s·e = t·dir for s ∈ [0,1], t ≥ 0 via 2D cross products.
|
|
125
|
-
const denominator = dirX * ez - dirZ * ex;
|
|
126
|
-
if (Math.abs(denominator) < 1e-12) continue; // parallel (or degenerate) segment
|
|
127
|
-
const s = (dirZ * ax - dirX * az) / denominator;
|
|
128
|
-
if (s < 0 || s > 1) continue;
|
|
129
|
-
const t = Math.abs(dirX) >= Math.abs(dirZ) ? (ax + s * ex) / dirX : (az + s * ez) / dirZ;
|
|
130
|
-
if (t > farthest) farthest = t;
|
|
131
|
-
}
|
|
132
|
-
return farthest;
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
/**
|
|
136
|
-
* The residual outline: the slice's radial distance from the fitted-ellipse
|
|
137
|
-
* center at `count` uniform angles, each normalized by the ellipse's own
|
|
138
|
-
* radius at that angle. 1 everywhere ⇒ the slice IS the ellipse; >1 bulges
|
|
139
|
-
* past it (a square slice reads √2 at its corners); 0 ⇒ no outline hit on
|
|
140
|
-
* that ray (e.g. a hollow/degenerate direction).
|
|
141
|
-
*/
|
|
142
|
-
export function radialResiduals(
|
|
143
|
-
segments: ArrayLike<number>,
|
|
144
|
-
ellipse: SliceEllipse,
|
|
145
|
-
count = 16,
|
|
146
|
-
): number[] {
|
|
147
|
-
if (!Number.isInteger(count) || count < 4) {
|
|
148
|
-
throw new Error(`Radial sample count must be an integer >= 4, got ${count}.`);
|
|
149
|
-
}
|
|
150
|
-
const residuals: number[] = [];
|
|
151
|
-
for (let index = 0; index < count; index++) {
|
|
152
|
-
const theta = (index * 2 * Math.PI) / count;
|
|
153
|
-
const radius = radialDistance(segments, ellipse.ox, ellipse.oz, theta);
|
|
154
|
-
residuals.push(radius / ellipseRadiusAt(ellipse.hx, ellipse.hz, theta));
|
|
155
|
-
}
|
|
156
|
-
return residuals;
|
|
157
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{aC as N,b9 as U,ba as S,bb as k,V as z}from"./three.module-D396a9Mn.js";function v(o,m=1e-4){m=Math.max(m,Number.EPSILON);const i={},h=o.getIndex(),r=o.getAttribute("position"),g=h?h.count:r.count;let e=0;const l=Object.keys(o.attributes),u={},x={},M=[],p=["getX","getY","getZ","getW"];for(let n=0,f=l.length;n<f;n++){const t=l[n];u[t]=[];const s=o.morphAttributes[t];s&&(x[t]=new Array(s.length).fill(0).map(()=>[]))}const I=Math.log10(1/m),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=l.length;s<d;s++){const b=l[s],c=o.getAttribute(b),a=c.itemSize;for(let A=0;A<a;A++)t+=`${~~(c[p[A]](f)*E)},`}if(t in i)M.push(i[t]);else{for(let s=0,d=l.length;s<d;s++){const b=l[s],c=o.getAttribute(b),a=o.morphAttributes[b],A=c.itemSize,w=u[b],V=x[b];for(let X=0;X<A;X++){const B=p[X];if(w.push(c[B](f)),a)for(let D=0,G=a.length;D<G;D++)V[D].push(a[D][B](f))}}i[t]=e,M.push(e),e++}}const T=o.clone();for(let n=0,f=l.length;n<f;n++){const t=l[n],s=o.getAttribute(t),d=new s.array.constructor(u[t]),b=new N(d,s.itemSize,s.normalized);if(T.setAttribute(t,b),t in x)for(let c=0;c<x[t].length;c++){const a=o.morphAttributes[t][c],A=new a.array.constructor(x[t][c]),w=new N(A,a.itemSize,a.normalized);T.morphAttributes[t][c]=w}}return T.setIndex(M),T}function H(o,m){if(m===U)return console.warn("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Geometry already defined as triangles."),o;if(m===S||m===k){let i=o.getIndex();if(i===null){const e=[],l=o.getAttribute("position");if(l!==void 0){for(let u=0;u<l.count;u++)e.push(u);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(m===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:",m),o}function R(o,m=Math.PI/3){const i=Math.cos(m),h=(1+1e-10)*100,r=[new z,new z,new z],g=new z,e=new z,l=new z,u=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),b=r[2].fromBufferAttribute(p,t+2);g.subVectors(b,d),e.subVectors(s,d);const c=new z().crossVectors(g,e).normalize();for(let a=0;a<3;a++){const A=r[a],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),b=r[2].fromBufferAttribute(p,t+2);g.subVectors(b,d),e.subVectors(s,d),l.crossVectors(g,e).normalize();for(let c=0;c<3;c++){const a=r[c],A=x(a),w=I[A];u.set(0,0,0);for(let V=0,X=w.length;V<X;V++){const B=w[V];l.dot(B)>i&&u.add(B)}u.normalize(),T.setXYZ(t+c,u.x,u.y,u.z)}}return M.setAttribute("normal",T),M}export{H as a,v as m,R as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{f3 as O,aY as P,f4 as k,f5 as A,f6 as L,f7 as B,f8 as S,a5 as z,f9 as $,a4 as N,fa as _,fb as V,fc as H}from"./index-GIL7oGEO.js";import{a as l}from"./jsx-runtime-DPjLkJKQ.js";import{r as g}from"./index-nmcBqr7Y.js";import"./index-CtzuWnCS.js";import{s as W,c as K,a as Z,r as U,m as D,b as q}from"./RootSelectionOverlay-BZPlxmXU.js";import{T as J}from"./TransientHint-BB1fwrvK.js";const X=.1,R=4,T=.002,Q=4;function I(e,t,r){return t===1?e*16:t===2?e*r:e}function ee(e,t){let r=I(t.deltaX,t.deltaMode,t.bounds.width),i=I(t.deltaY,t.deltaMode,t.bounds.height);if(t.ctrlKey||t.metaKey){const n=Math.min(R,Math.max(X,e.zoom*Math.exp(-i*T))),a=t.clientX-t.bounds.left,d=t.clientY-t.bounds.top,h=(a-e.x)/e.zoom,f=(d-e.y)/e.zoom;return{x:a-h*n,y:d-f*n,zoom:n}}return t.shiftKey&&r===0&&(r=i,i=0),{x:e.x-r,y:e.y-i,zoom:e.zoom}}function te(e,t){const r=I(t.deltaY,t.deltaMode,t.bounds.height),i=Math.min(R,Math.max(X,e.zoom*Math.exp(-r*T))),n=t.clientX-t.bounds.left,a=t.clientY-t.bounds.top,d=(n-e.x)/e.zoom,h=(a-e.y)/e.zoom;return{x:n-d*i,y:a-h*i,zoom:i}}function C(e){return e instanceof Element&&e.closest('[data-vgai-canvas-navigation-ignore="true"]')!==null}function G(e,t,r,i={}){let n=null,a=!1,d="";const h=()=>e.querySelector('[data-testid="world-selection-overlay-interaction"]'),f=o=>{e.dataset.canvasPanning=o?"true":"false",e.style.cursor=o?"grabbing":"";const u=h();u&&(o?(d=u.style.cursor,u.style.cursor="grabbing"):u.style.cursor=d)},b=o=>{if(!n||o.pointerId!==n.pointerId)return;const u=n.button===1?4:2;if((o.buttons&u)===0){c(o);return}const v=o.clientX-n.startClientX,y=o.clientY-n.startClientY;if(!n.moved){if(Math.hypot(v,y)<=Q)return;n.moved=!0,f(!0)}t.setPan(n.startPan.x+v,n.startPan.y+y)},c=o=>{if(!n||o.pointerId!==n.pointerId)return;const u=n.pointerId;n.button===2&&n.moved&&(a=!0),n=null,f(!1),e.hasPointerCapture?.(u)&&e.releasePointerCapture(u),window.removeEventListener("pointermove",b),window.removeEventListener("pointerup",c),window.removeEventListener("pointercancel",c)},s=o=>{const u=o.button===1,v=i.rightDragPans===!0&&o.button===2;!u&&!v||C(o.target)||(v&&(a=!1),o.preventDefault(),u&&o.stopPropagation(),n={pointerId:o.pointerId,button:o.button,startClientX:o.clientX,startClientY:o.clientY,startPan:t.get(),moved:u},e.setPointerCapture?.(o.pointerId),f(u),window.addEventListener("pointermove",b),window.addEventListener("pointerup",c),window.addEventListener("pointercancel",c))},m=o=>{o.button===1&&!C(o.target)&&o.preventDefault()},p=o=>{i.rightDragPans!==!0||!(n?.button===2&&n.moved)&&!a||(a=!1,o.preventDefault(),o.stopPropagation())},x=o=>{if(C(o.target))return;o.preventDefault(),o.stopPropagation();const u=r(t.get(),{clientX:o.clientX,clientY:o.clientY,deltaX:o.deltaX,deltaY:o.deltaY,deltaMode:o.deltaMode,ctrlKey:o.ctrlKey,metaKey:o.metaKey,shiftKey:o.shiftKey,bounds:e.getBoundingClientRect()});t.setView(u.x,u.y,u.zoom)};return e.addEventListener("pointerdown",s,!0),e.addEventListener("lostpointercapture",c,!0),e.addEventListener("mousedown",m,!0),e.addEventListener("contextmenu",p,!0),e.addEventListener("wheel",x,{capture:!0,passive:!1}),()=>{n=null,f(!1),e.removeEventListener("pointerdown",s,!0),e.removeEventListener("lostpointercapture",c,!0),e.removeEventListener("mousedown",m,!0),e.removeEventListener("contextmenu",p,!0),e.removeEventListener("wheel",x,!0),window.removeEventListener("pointermove",b),window.removeEventListener("pointerup",c),window.removeEventListener("pointercancel",c)}}function de(e,t=O){return G(e,t,ee)}function ue(e,t){return G(e,t,te,{rightDragPans:!0})}const pe="#111214";function F(e){let t=32;for(;t*e<12;)t*=2;for(;t*e>48;)t/=2;return t}function oe(e){return F(e)*e}function M(e){if(e.length===0)return null;let t=Number.POSITIVE_INFINITY,r=Number.POSITIVE_INFINITY,i=Number.NEGATIVE_INFINITY,n=Number.NEGATIVE_INFINITY;for(const a of e)t=Math.min(t,a.x),r=Math.min(r,a.y),i=Math.max(i,a.x+a.width),n=Math.max(n,a.y+a.height);return{x:t,y:r,width:i-t,height:n-r}}function j(e,t,r){if(!r||!(r.width>0)||!(r.height>0))return;const i=Math.max(1,e.clientWidth-96),n=Math.max(1,e.clientHeight-96),a=Math.min(4,Math.max(.1,Math.min(i/r.width,n/r.height)));t.setView(e.clientWidth/2-(r.x+r.width/2)*a,e.clientHeight/2-(r.y+r.height/2)*a,a)}function me({view:e}){const t=P();g.useSyncExternalStore(t.subscribe,t.getSnapshot);const r=g.useSyncExternalStore(e.subscribe,e.get,e.get);g.useSyncExternalStore(g.useCallback(d=>W(e,d),[e]),g.useCallback(()=>K(e),[e]));const i=Z(e),n=oe(r.zoom),a=n*4;return l.jsxs("div",{"data-testid":"canvas-scene-backdrop",style:{position:"absolute",inset:0,zIndex:2,overflow:"hidden",pointerEvents:"none"},children:[t.showGrid&&l.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:`${r.x}px ${r.y}px`,backgroundSize:`${n}px ${n}px, ${n}px ${n}px, ${a}px ${a}px, ${a}px ${a}px`}}),l.jsx("div",{"data-testid":"canvas-scene-origin-y",style:{position:"absolute",left:0,right:0,top:r.y,height:1,background:"rgba(238, 91, 91, .8)"}}),l.jsx("div",{"data-testid":"canvas-scene-origin-x",style:{position:"absolute",top:0,bottom:0,left:r.x,width:1,background:"rgba(87, 199, 126, .8)"}}),l.jsx("div",{style:{position:"absolute",left:r.x+6,top:r.y+6,color:"rgba(255,255,255,.68)",font:"10px ui-monospace, SFMono-Regular, Menlo, monospace"},children:"0, 0"}),i.map(d=>l.jsx("div",{"data-testid":`canvas-scene-guide-${d.axis}`,title:`${d.axis.toUpperCase()} ${Math.round(d.value*100)/100} · drag to move · right-click to remove`,onContextMenu:h=>{h.preventDefault(),U(e,d.id)},onPointerDown:h=>{h.preventDefault(),h.stopPropagation();const f=h.currentTarget.parentElement?.getBoundingClientRect();if(!f)return;const b=s=>{const m=d.axis==="x"?s.clientX-f.left:s.clientY-f.top,p=e.get();D(e,d.id,(m-(d.axis==="x"?p.x:p.y))/p.zoom)},c=()=>{window.removeEventListener("pointermove",b),window.removeEventListener("pointerup",c)};window.addEventListener("pointermove",b),window.addEventListener("pointerup",c,{once:!0})},style:{position:"absolute",pointerEvents:"auto",cursor:d.axis==="x"?"ew-resize":"ns-resize",...d.axis==="x"?{left:r.x+d.value*r.zoom-4,top:20,bottom:0,width:9,borderLeft:"1px solid rgba(74, 180, 255, .95)"}:{top:r.y+d.value*r.zoom-4,left:20,right:0,height:9,borderTop:"1px solid rgba(74, 180, 255, .95)"}}},d.id)),l.jsx(ne,{view:e})]})}function ne({view:e}){const t=g.useSyncExternalStore(e.subscribe,e.get,e.get),r=g.useRef(null),i=g.useRef(null),[n,a]=g.useState({width:0,height:0});g.useEffect(()=>{const s=()=>{const p=r.current?.clientWidth??0,x=i.current?.clientHeight??0;a(o=>o.width===p&&o.height===x?o:{width:p,height:x})};if(s(),typeof ResizeObserver>"u")return;const m=new ResizeObserver(s);return r.current&&m.observe(r.current),i.current&&m.observe(i.current),()=>m.disconnect()},[]);const d=(s,m)=>{if(!(m>0))return[];const p=s==="x"?t.x:t.y,x=F(t.zoom),o=x*t.zoom,u=20,v=Math.ceil((u-p)/o),y=Math.floor((u+m-p)/o);return Array.from({length:Math.max(0,y-v+1)},(Y,E)=>{const w=v+E;return{major:w%4===0,screen:p+w*o-u,value:w*x}})},h=d("x",n.width),f=d("y",n.height),b=(s,m)=>{m.preventDefault(),m.stopPropagation();const p=m.currentTarget.parentElement?.getBoundingClientRect();if(!p)return;const x=(y,Y)=>{const E=e.get();return((s==="x"?y-p.left:Y-p.top)-(s==="x"?E.x:E.y))/E.zoom},o=q(e,s,x(m.clientX,m.clientY)),u=y=>D(e,o,x(y.clientX,y.clientY)),v=()=>{window.removeEventListener("pointermove",u),window.removeEventListener("pointerup",v)};window.addEventListener("pointermove",u),window.addEventListener("pointerup",v,{once:!0})},c={position:"absolute",pointerEvents:"auto",backgroundColor:"rgba(24, 26, 30, .96)",border:0,borderColor:"rgba(255,255,255,.14)",boxSizing:"border-box"};return l.jsxs(l.Fragment,{children:[l.jsx("button",{ref:r,type:"button","data-testid":"canvas-scene-ruler-x","aria-label":"Horizontal ruler; drag to create a horizontal guide",onPointerDown:s=>b("y",s),style:{...c,left:20,right:0,top:0,height:20,borderBottomStyle:"solid",borderBottomWidth:1,cursor:"row-resize",padding:0,overflow:"hidden"},children:h.map(s=>l.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&&l.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))}),l.jsx("button",{ref:i,type:"button","data-testid":"canvas-scene-ruler-y","aria-label":"Vertical ruler; drag to create a vertical guide",onPointerDown:s=>b("x",s),style:{...c,top:20,bottom:0,left:0,width:20,borderRightStyle:"solid",borderRightWidth:1,cursor:"col-resize",padding:0,overflow:"hidden"},children:f.map(s=>l.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&&l.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))}),l.jsx("div",{style:{...c,left:0,top:0,width:20,height:20}})]})}function he({active:e,adapter:t,containerRef:r,view:i}){const n=P();g.useSyncExternalStore(n.subscribe,n.getSnapshot);const a=g.useSyncExternalStore(i.subscribe,i.get,i.get),d=g.useCallback(c=>{const s=r.current;if(!s)return;const m=Math.min(4,Math.max(.1,c)),p=s.clientWidth/2,x=s.clientHeight/2,o=(p-a.x)/a.zoom,u=(x-a.y)/a.zoom;i.setView(p-o*m,x-u*m,m)},[r,a,i]),h=g.useCallback(c=>{if(!t?.rects)return[];const s=[];for(const m of c){const p=t.rects.rect(m);p&&p.width>0&&p.height>0&&s.push(p)}return s},[t]),f=g.useCallback(()=>{const c=r.current;c&&j(c,i,M(h(n.selectedEntityIds)))},[r,h,n,i]),b=g.useCallback(()=>{const c=r.current;!c||!t||j(c,i,M(h(k(t))))},[t,r,h,i]);return g.useEffect(()=>{if(e)return n.onViewportAction(c=>{if(c.type==="focus-entity"){const s=r.current;if(!s)return;j(s,i,M(h([c.id])))}else c.type==="focus-selection"?f():c.type==="focus-scene"&&b()})},[e,r,b,f,h,n,i]),l.jsxs(l.Fragment,{children:[l.jsx(J,{}),l.jsx(A,{dimensions:"2d"}),l.jsxs(L,{label:"2D scene display",className:"vgai-viewport-toolbar vgai-viewport-toolbar-right","data-vgai-canvas-navigation-ignore":"true",children:[l.jsx(B,{text:`Grid: ${n.showGrid?"On":"Off"}`,children:l.jsx(S,{"aria-label":"Toggle 2D grid","aria-pressed":n.showGrid,size:"comfortable",onClick:()=>n.toggleGrid(),children:l.jsx(z,{icon:$,size:"md"})})}),l.jsx(N,{"aria-label":"Frame all",variant:"ghost",size:"comfortable",onClick:b,children:"Frame all"})]}),l.jsxs(L,{label:"2D scene navigation",className:"vgai-canvas-scene-navigation","data-vgai-canvas-navigation-ignore":"true",children:[l.jsx(S,{"aria-label":"Frame selection",title:"Frame selection",size:"comfortable",disabled:n.selectedEntityIds.size===0,onClick:f,children:l.jsx(z,{icon:_,size:"md"})}),l.jsx(S,{"aria-label":"Zoom out",title:"Zoom out",size:"comfortable",onClick:()=>d(a.zoom/1.2),children:l.jsx(z,{icon:V,size:"md"})}),l.jsxs(N,{variant:"ghost","aria-label":"Reset zoom to 100%",title:"Reset zoom to 100%",size:"comfortable",onClick:()=>d(1),children:[Math.round(a.zoom*100),"%"]}),l.jsx(S,{"aria-label":"Zoom in",title:"Zoom in",size:"comfortable",onClick:()=>d(a.zoom*1.2),children:l.jsx(z,{icon:H,size:"md"})})]})]})}export{pe as C,de as a,me as b,he as c,ue as i};
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import{J as kn,av as wn,ak as it,b2 as Nn,al as An,V as $,a as X,z as rt,w as Tn,e as En,C as at,r as pe,d as ot,bX as _n,a$ as ct,b3 as Ee,j as ee,g as xn,ap as Cn,aq as vn,x as lt,ar as Ln,bU as In,bG as Rn,bH as Mn,D as Sn,aX as dt,Q as Gn,b as ut,c as On,aB as jn,aY as ne,b6 as qn,aZ as ft,bS as Pn,M as Hn,bh as Un,b0 as Bn,b5 as zn,a2 as _e,am as ht}from"./three.module-D396a9Mn.js";class pt extends kn{constructor(K){super(K)}parse(K){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 J=new Uint8Array(A);for(;M<N;)if(y=P[C++],u=(y&127)+1,y&128){for(k=0;k<A;++k)J[k]=P[C++];for(k=0;k<u;++k)_.set(J,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,J;const ae=j.width;for(J=q;J!==C;J+=R)for(M=P;M!==v;M+=_,k++)u=A[k],h[(M+ae*J)*4+3]=255,h[(M+ae*J)*4+2]=y[u*3+0],h[(M+ae*J)*4+1]=y[u*3+1],h[(M+ae*J)*4+0]=y[u*3+2];return h}function L(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 Ie:_=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 Le:_=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:L(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,Le=1,Ie=2,ie=3;if(K.length<19)throw new Error("THREE.TGALoader: Not enough data to contain header.");let I=0;const G=new Uint8Array(K),j={id_length:G[I++],colormap_type:G[I++],image_type:G[I++],colormap_index:G[I++]|G[I++]<<8,colormap_length:G[I++]|G[I++]<<8,colormap_size:G[I++],origin:[G[I++]|G[I++]<<8,G[I++]|G[I++]<<8],width:G[I++]|G[I++]<<8,height:G[I++]|G[I++]<<8,pixel_size:G[I++],flags:G[I++]};if(se(j),j.id_length+I>K.length)throw new Error("THREE.TGALoader: No data.");I+=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,I,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(K,se,U,te){const L=this,Z=L.path===""?Nn.extractUrlBase(K):L.path,S=new An(L.manager);S.setPath(L.path),S.setRequestHeader(L.requestHeader),S.setWithCredentials(L.withCredentials),S.load(K,function(de){try{se(L.parse(de,Z))}catch(Q){te?te(Q):console.error(Q),L.manager.itemError(K)}},U,te)}parse(K,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 L(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=Le(a,m,o);j(p,e)}return e}function ye(t){return z(w.animations[t],ge)}function Le(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=Ie(f,a);return{name:i.uuid,keyframes:g}}function Ie(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 $,I=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;D.fromArray(p).transpose(),D.decompose(ie,G,I),i.push(o),r.push(ie.x,ie.y,ie.z),a.push(G.x,G.y,G.z,G.w),d.push(I.x,I.y,I.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=L(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 J(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]=L(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=Lt(i);break}}w.cameras[t.getAttribute("id")]=e}function Lt(t){for(let e=0;e<t.childNodes.length;e++){const s=t.childNodes[e];switch(s.nodeName){case"technique_common":return It(s)}}return{}}function It(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 Ln(-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=L(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 In;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=L(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(W(b,e[F],E.offset,i.array),i.stride=e[F].stride,e.skinWeights&&e.skinIndices&&(W(b,e.skinIndices,E.offset,l.array),W(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":W(b,e[F],E.offset,r.array),r.stride=e[F].stride;break;case"COLOR":W(b,e[F],E.offset,c.array),c.stride=e[F].stride;break;case"TEXCOORD":W(b,e[F],E.offset,a.array),a.stride=e[F].stride;break;case"TEXCOORD1":W(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":W(b,e[E.id],E.offset,r.array),r.stride=e[E.id].stride;break;case"COLOR":W(b,e[E.id],E.offset,c.array,!0),c.stride=e[E.id].stride;break;case"TEXCOORD":W(b,e[E.id],E.offset,a.array),a.stride=e[E.id].stride;break;case"TEXCOORD1":W(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 W(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":Kt(n,e);break}}w.kinematicsModels[t.getAttribute("id")]=e}function Vt(t){return t.build!==void 0?t.build:t}function Dt(t){return z(w.kinematicsModels[t],Vt)}function Kt(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")]=Jt(n);break;case"link":e.links.push(De(n));break}}}function Jt(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=Wt(n);break}}return e}function Wt(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=L(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 De(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(Ke(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(De(n));break;case"matrix":case"translate":case"rotate":e.transforms.push(Ke(n));break}}return e}function Ke(t){const e={type:t.nodeName},s=L(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=L(n.textContent);break;case"mass":e.mass=L(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=Dt(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;D.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":D.multiply(l.makeRotationAxis(b,pe.degToRad(o)));break;case"prismatic":D.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":D.multiply(T.obj);break;case"translate":D.multiply(l.makeTranslation(T.obj.x,T.obj.y,T.obj.z));break;case"scale":D.scale(T.obj);break;case"rotate":D.multiply(l.makeRotationAxis(T.obj,T.angle));break}}g.matrix.copy(D),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=L(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=L(i.textContent),a=new $().fromArray(r),e.push({sid:i.getAttribute("sid"),type:i.nodeName,obj:a});break;case"rotate":r=L(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 D=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(Je(n));break;case"instance_light":e.instanceLights.push(S(n.getAttribute("url")));break;case"instance_geometry":e.instanceGeometries.push(Je(n));break;case"instance_node":e.instanceNodes.push(S(n.getAttribute("url")));break;case"matrix":i=L(n.textContent),e.matrix.multiply(D.fromArray(i).transpose()),e.transforms[n.getAttribute("sid")]=n.nodeName;break;case"translate":i=L(n.textContent),oe.fromArray(i),e.matrix.multiply(D.makeTranslation(oe.x,oe.y,oe.z)),e.transforms[n.getAttribute("sid")]=n.nodeName;break;case"rotate":i=L(n.textContent);const r=pe.degToRad(i[3]);e.matrix.multiply(D.makeRotationAxis(oe.fromArray(i),r)),e.transforms[n.getAttribute("sid")]=n.nodeName;break;case"scale":i=L(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 Je(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),We(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);We(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 We(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(K.length===0)return{scene:new Tn};const $e=new DOMParser().parseFromString(K,"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",J),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 +0,0 @@
|
|
|
1
|
-
import{J as yn,K as ee,R as K,N as Q,X,Y as ne,Z as ae,k as xe,_ as Me}from"./three.module-D396a9Mn.js";import{u as te}from"./fflate.module-DPuTF8aG.js";class Bn extends yn{constructor(k){super(k),this.type=ee,this.outputFormat=K}parse(k){const de=Math.pow(2.7182818,2.2);function ke(e,n){let t=0;for(let l=0;l<65536;++l)(l==0||e[l>>3]&1<<(l&7))&&(n[t++]=l);const r=t-1;for(;t<65536;)n[t++]=0;return r}function De(e){for(let n=0;n<16384;n++)e[n]={},e[n].len=0,e[n].lit=0,e[n].p=null}const Z={l:0,c:0,lc:0};function fe(e,n,t,r,l){for(;t<e;)n=n<<8|Oe(r,l),t+=8;t-=e,Z.l=n>>t&(1<<e)-1,Z.c=n,Z.lc=t}const q=new Array(59);function Ze(e){for(let t=0;t<=58;++t)q[t]=0;for(let t=0;t<65537;++t)q[e[t]]+=1;let n=0;for(let t=58;t>0;--t){const r=n+q[t]>>1;q[t]=n,n=r}for(let t=0;t<65537;++t){const r=e[t];r>0&&(e[t]=r|q[r]++<<6)}}function Fe(e,n,t,r,l,u){const o=n;let a=0,c=0;for(;r<=l;r++){if(o.value-n.value>t)return!1;fe(6,a,c,e,o);const s=Z.l;if(a=Z.c,c=Z.lc,u[r]=s,s==63){if(o.value-n.value>t)throw new Error("Something wrong with hufUnpackEncTable");fe(8,a,c,e,o);let i=Z.l+6;if(a=Z.c,c=Z.lc,r+i>l+1)throw new Error("Something wrong with hufUnpackEncTable");for(;i--;)u[r++]=0;r--}else if(s>=59){let i=s-59+2;if(r+i>l+1)throw new Error("Something wrong with hufUnpackEncTable");for(;i--;)u[r++]=0;r--}}Ze(u)}function we(e){return e&63}function Se(e){return e>>6}function Le(e,n,t,r){for(;n<=t;n++){const l=Se(e[n]),u=we(e[n]);if(l>>u)throw new Error("Invalid table entry");if(u>14){const o=r[l>>u-14];if(o.len)throw new Error("Invalid table entry");if(o.lit++,o.p){const a=o.p;o.p=new Array(o.lit);for(let c=0;c<o.lit-1;++c)o.p[c]=a[c]}else o.p=new Array(1);o.p[o.lit-1]=n}else if(u){let o=0;for(let a=1<<14-u;a>0;a--){const c=r[(l<<14-u)+o];if(c.len||c.p)throw new Error("Invalid table entry");c.len=u,c.lit=n,o++}}}return!0}const L={c:0,lc:0};function le(e,n,t,r){e=e<<8|Oe(t,r),n+=8,L.c=e,L.lc=n}const B={c:0,lc:0};function se(e,n,t,r,l,u,o,a,c){if(e==n){r<8&&(le(t,r,l,u),t=L.c,r=L.lc),r-=8;let s=t>>r;if(s=new Uint8Array([s])[0],a.value+s>c)return!1;const i=o[a.value-1];for(;s-- >0;)o[a.value++]=i}else if(a.value<c)o[a.value++]=e;else return!1;B.c=t,B.lc=r}function ce(e){return e&65535}function me(e){const n=ce(e);return n>32767?n-65536:n}const A={a:0,b:0};function G(e,n){const t=me(e),l=me(n),u=t+(l&1)+(l>>1),o=u,a=u-l;A.a=o,A.b=a}function W(e,n){const t=ce(e),r=ce(n),l=t-(r>>1)&65535,u=r+l-32768&65535;A.a=u,A.b=l}function Be(e,n,t,r,l,u,o){const a=o<16384,c=t>l?l:t;let s=1,i,p;for(;s<=c;)s<<=1;for(s>>=1,i=s,s>>=1;s>=1;){p=0;const h=p+u*(l-i),f=u*s,m=u*i,E=r*s,S=r*i;let y,C,v,T;for(;p<=h;p+=m){let _=p;const I=p+r*(t-i);for(;_<=I;_+=S){const O=_+E,b=_+f,N=b+E;a?(G(e[_+n],e[b+n]),y=A.a,v=A.b,G(e[O+n],e[N+n]),C=A.a,T=A.b,G(y,C),e[_+n]=A.a,e[O+n]=A.b,G(v,T),e[b+n]=A.a,e[N+n]=A.b):(W(e[_+n],e[b+n]),y=A.a,v=A.b,W(e[O+n],e[N+n]),C=A.a,T=A.b,W(y,C),e[_+n]=A.a,e[O+n]=A.b,W(v,T),e[b+n]=A.a,e[N+n]=A.b)}if(t&s){const O=_+f;a?G(e[_+n],e[O+n]):W(e[_+n],e[O+n]),y=A.a,e[O+n]=A.b,e[_+n]=y}}if(l&s){let _=p;const I=p+r*(t-i);for(;_<=I;_+=S){const O=_+E;a?G(e[_+n],e[O+n]):W(e[_+n],e[O+n]),y=A.a,e[O+n]=A.b,e[_+n]=y}}i=s,s>>=1}return p}function Pe(e,n,t,r,l,u,o,a,c){let s=0,i=0;const p=o,h=Math.trunc(r.value+(l+7)/8);for(;r.value<h;)for(le(s,i,t,r),s=L.c,i=L.lc;i>=14;){const m=s>>i-14&16383,E=n[m];if(E.len)i-=E.len,se(E.lit,u,s,i,t,r,a,c,p),s=B.c,i=B.lc;else{if(!E.p)throw new Error("hufDecode issues");let S;for(S=0;S<E.lit;S++){const y=we(e[E.p[S]]);for(;i<y&&r.value<h;)le(s,i,t,r),s=L.c,i=L.lc;if(i>=y&&Se(e[E.p[S]])==(s>>i-y&(1<<y)-1)){i-=y,se(E.p[S],u,s,i,t,r,a,c,p),s=B.c,i=B.lc;break}}if(S==E.lit)throw new Error("hufDecode issues")}}const f=8-l&7;for(s>>=f,i-=f;i>0;){const m=n[s<<14-i&16383];if(m.len)i-=m.len,se(m.lit,u,s,i,t,r,a,c,p),s=B.c,i=B.lc;else throw new Error("hufDecode issues")}return!0}function ye(e,n,t,r,l,u){const o={value:0},a=t.value,c=d(n,t),s=d(n,t);t.value+=4;const i=d(n,t);if(t.value+=4,c<0||c>=65537||s<0||s>=65537)throw new Error("Something wrong with HUF_ENCSIZE");const p=new Array(65537),h=new Array(16384);De(h);const f=r-(t.value-a);if(Fe(e,t,f,c,s,p),i>8*(r-(t.value-a)))throw new Error("Something wrong with hufUncompress");Le(p,c,s,h),Pe(p,h,e,t,i,s,u,l,o)}function He(e,n,t){for(let r=0;r<t;++r)n[r]=e[n[r]]}function Ie(e){for(let n=1;n<e.length;n++){const t=e[n-1]+e[n]-128;e[n]=t}}function ge(e,n){let t=0,r=Math.floor((e.length+1)/2),l=0;const u=e.length-1;for(;!(l>u||(n[l++]=e[t++],l>u));)n[l++]=e[r++]}function Ce(e){let n=e.byteLength;const t=new Array;let r=0;const l=new DataView(e);for(;n>0;){const u=l.getInt8(r++);if(u<0){const o=-u;n-=o+1;for(let a=0;a<o;a++)t.push(l.getUint8(r++))}else{const o=u;n-=2;const a=l.getUint8(r++);for(let c=0;c<o+1;c++)t.push(a)}}return t}function ze(e,n,t,r,l,u){let o=new DataView(u.buffer);const a=t[e.idx[0]].width,c=t[e.idx[0]].height,s=3,i=Math.floor(a/8),p=Math.ceil(a/8),h=Math.ceil(c/8),f=a-(p-1)*8,m=c-(h-1)*8,E={value:0},S=new Array(s),y=new Array(s),C=new Array(s),v=new Array(s),T=new Array(s);for(let I=0;I<s;++I)T[I]=n[e.idx[I]],S[I]=I<1?0:S[I-1]+p*h,y[I]=new Float32Array(64),C[I]=new Uint16Array(64),v[I]=new Uint16Array(p*64);for(let I=0;I<h;++I){let O=8;I==h-1&&(O=m);let b=8;for(let g=0;g<p;++g){g==p-1&&(b=f);for(let U=0;U<s;++U)C[U].fill(0),C[U][0]=l[S[U]++],_e(E,r,C[U]),ve(C[U],y[U]),Ue(y[U]);Xe(y);for(let U=0;U<s;++U)Ne(y[U],v[U],g*64)}let N=0;for(let g=0;g<s;++g){const U=t[e.idx[g]].type;for(let F=8*I;F<8*I+O;++F){N=T[g][F];for(let $=0;$<i;++$){const D=$*64+(F&7)*8;o.setUint16(N+0*U,v[g][D+0],!0),o.setUint16(N+2*U,v[g][D+1],!0),o.setUint16(N+4*U,v[g][D+2],!0),o.setUint16(N+6*U,v[g][D+3],!0),o.setUint16(N+8*U,v[g][D+4],!0),o.setUint16(N+10*U,v[g][D+5],!0),o.setUint16(N+12*U,v[g][D+6],!0),o.setUint16(N+14*U,v[g][D+7],!0),N+=16*U}}if(i!=p)for(let F=8*I;F<8*I+O;++F){const $=T[g][F]+8*i*2*U,D=i*64+(F&7)*8;for(let j=0;j<b;++j)o.setUint16($+j*2*U,v[g][D+j],!0)}}}const _=new Uint16Array(a);o=new DataView(u.buffer);for(let I=0;I<s;++I){t[e.idx[I]].decoded=!0;const O=t[e.idx[I]].type;if(t[I].type==2)for(let b=0;b<c;++b){const N=T[I][b];for(let g=0;g<a;++g)_[g]=o.getUint16(N+g*2*O,!0);for(let g=0;g<a;++g)o.setFloat32(N+g*2*O,w(_[g]),!0)}}}function Ye(e,n,t,r,l,u){const o=new DataView(u.buffer),a=t[e],c=a.width,s=a.height,i=Math.ceil(c/8),p=Math.ceil(s/8),h=Math.floor(c/8),f=c-(i-1)*8,m=s-(p-1)*8,E={value:0};let S=0;const y=new Float32Array(64),C=new Uint16Array(64),v=new Uint16Array(i*64);for(let T=0;T<p;++T){let _=8;T==p-1&&(_=m);for(let I=0;I<i;++I)C.fill(0),C[0]=l[S++],_e(E,r,C),ve(C,y),Ue(y),Ne(y,v,I*64);for(let I=8*T;I<8*T+_;++I){let O=n[e][I];for(let b=0;b<h;++b){const N=b*64+(I&7)*8;for(let g=0;g<8;++g)o.setUint16(O+g*2*a.type,v[N+g],!0);O+=16*a.type}if(i!=h){const b=h*64+(I&7)*8;for(let N=0;N<f;++N)o.setUint16(O+N*2*a.type,v[b+N],!0)}}}a.decoded=!0}function _e(e,n,t){let r,l=1;for(;l<64;)r=n[e.value],r==65280?l=64:r>>8==255?l+=r&255:(t[l]=r,l++),e.value++}function ve(e,n){n[0]=w(e[0]),n[1]=w(e[1]),n[2]=w(e[5]),n[3]=w(e[6]),n[4]=w(e[14]),n[5]=w(e[15]),n[6]=w(e[27]),n[7]=w(e[28]),n[8]=w(e[2]),n[9]=w(e[4]),n[10]=w(e[7]),n[11]=w(e[13]),n[12]=w(e[16]),n[13]=w(e[26]),n[14]=w(e[29]),n[15]=w(e[42]),n[16]=w(e[3]),n[17]=w(e[8]),n[18]=w(e[12]),n[19]=w(e[17]),n[20]=w(e[25]),n[21]=w(e[30]),n[22]=w(e[41]),n[23]=w(e[43]),n[24]=w(e[9]),n[25]=w(e[11]),n[26]=w(e[18]),n[27]=w(e[24]),n[28]=w(e[31]),n[29]=w(e[40]),n[30]=w(e[44]),n[31]=w(e[53]),n[32]=w(e[10]),n[33]=w(e[19]),n[34]=w(e[23]),n[35]=w(e[32]),n[36]=w(e[39]),n[37]=w(e[45]),n[38]=w(e[52]),n[39]=w(e[54]),n[40]=w(e[20]),n[41]=w(e[22]),n[42]=w(e[33]),n[43]=w(e[38]),n[44]=w(e[46]),n[45]=w(e[51]),n[46]=w(e[55]),n[47]=w(e[60]),n[48]=w(e[21]),n[49]=w(e[34]),n[50]=w(e[37]),n[51]=w(e[47]),n[52]=w(e[50]),n[53]=w(e[56]),n[54]=w(e[59]),n[55]=w(e[61]),n[56]=w(e[35]),n[57]=w(e[36]),n[58]=w(e[48]),n[59]=w(e[49]),n[60]=w(e[57]),n[61]=w(e[58]),n[62]=w(e[62]),n[63]=w(e[63])}function Ue(e){const n=.5*Math.cos(.7853975),t=.5*Math.cos(3.14159/16),r=.5*Math.cos(3.14159/8),l=.5*Math.cos(3*3.14159/16),u=.5*Math.cos(5*3.14159/16),o=.5*Math.cos(3*3.14159/8),a=.5*Math.cos(7*3.14159/16),c=new Array(4),s=new Array(4),i=new Array(4),p=new Array(4);for(let h=0;h<8;++h){const f=h*8;c[0]=r*e[f+2],c[1]=o*e[f+2],c[2]=r*e[f+6],c[3]=o*e[f+6],s[0]=t*e[f+1]+l*e[f+3]+u*e[f+5]+a*e[f+7],s[1]=l*e[f+1]-a*e[f+3]-t*e[f+5]-u*e[f+7],s[2]=u*e[f+1]-t*e[f+3]+a*e[f+5]+l*e[f+7],s[3]=a*e[f+1]-u*e[f+3]+l*e[f+5]-t*e[f+7],i[0]=n*(e[f+0]+e[f+4]),i[3]=n*(e[f+0]-e[f+4]),i[1]=c[0]+c[3],i[2]=c[1]-c[2],p[0]=i[0]+i[1],p[1]=i[3]+i[2],p[2]=i[3]-i[2],p[3]=i[0]-i[1],e[f+0]=p[0]+s[0],e[f+1]=p[1]+s[1],e[f+2]=p[2]+s[2],e[f+3]=p[3]+s[3],e[f+4]=p[3]-s[3],e[f+5]=p[2]-s[2],e[f+6]=p[1]-s[1],e[f+7]=p[0]-s[0]}for(let h=0;h<8;++h)c[0]=r*e[16+h],c[1]=o*e[16+h],c[2]=r*e[48+h],c[3]=o*e[48+h],s[0]=t*e[8+h]+l*e[24+h]+u*e[40+h]+a*e[56+h],s[1]=l*e[8+h]-a*e[24+h]-t*e[40+h]-u*e[56+h],s[2]=u*e[8+h]-t*e[24+h]+a*e[40+h]+l*e[56+h],s[3]=a*e[8+h]-u*e[24+h]+l*e[40+h]-t*e[56+h],i[0]=n*(e[h]+e[32+h]),i[3]=n*(e[h]-e[32+h]),i[1]=c[0]+c[3],i[2]=c[1]-c[2],p[0]=i[0]+i[1],p[1]=i[3]+i[2],p[2]=i[3]-i[2],p[3]=i[0]-i[1],e[0+h]=p[0]+s[0],e[8+h]=p[1]+s[1],e[16+h]=p[2]+s[2],e[24+h]=p[3]+s[3],e[32+h]=p[3]-s[3],e[40+h]=p[2]-s[2],e[48+h]=p[1]-s[1],e[56+h]=p[0]-s[0]}function Xe(e){for(let n=0;n<64;++n){const t=e[0][n],r=e[1][n],l=e[2][n];e[0][n]=t+1.5747*l,e[1][n]=t-.1873*r-.4682*l,e[2][n]=t+1.8556*r}}function Ne(e,n,t){for(let r=0;r<64;++r)n[t+r]=Me.toHalfFloat(Ge(e[r]))}function Ge(e){return e<=1?Math.sign(e)*Math.pow(Math.abs(e),2.2):Math.sign(e)*Math.pow(de,Math.abs(e)-1)}function ie(e){return new DataView(e.array.buffer,e.offset.value,e.size)}function We(e){const n=e.viewer.buffer.slice(e.offset.value,e.offset.value+e.size),t=new Uint8Array(Ce(n)),r=new Uint8Array(t.length);return Ie(t),ge(t,r),new DataView(r.buffer)}function ue(e){const n=e.array.slice(e.offset.value,e.offset.value+e.size),t=te(n),r=new Uint8Array(t.length);return Ie(t),ge(t,r),new DataView(r.buffer)}function Ke(e){const n=e.viewer,t={value:e.offset.value},r=new Uint16Array(e.columns*e.lines*(e.inputChannels.length*e.type)),l=new Uint8Array(8192);let u=0;const o=new Array(e.inputChannels.length);for(let m=0,E=e.inputChannels.length;m<E;m++)o[m]={},o[m].start=u,o[m].end=o[m].start,o[m].nx=e.columns,o[m].ny=e.lines,o[m].size=e.type,u+=o[m].nx*o[m].ny*o[m].size;const a=J(n,t),c=J(n,t);if(c>=8192)throw new Error("Something is wrong with PIZ_COMPRESSION BITMAP_SIZE");if(a<=c)for(let m=0;m<c-a+1;m++)l[m+a]=P(n,t);const s=new Uint16Array(65536),i=ke(l,s),p=d(n,t);ye(e.array,n,t,p,r,u);for(let m=0;m<e.inputChannels.length;++m){const E=o[m];for(let S=0;S<o[m].size;++S)Be(r,E.start+S,E.nx,E.size,E.ny,E.nx*E.size,i)}He(s,r,u);let h=0;const f=new Uint8Array(r.buffer.byteLength);for(let m=0;m<e.lines;m++)for(let E=0;E<e.inputChannels.length;E++){const S=o[E],y=S.nx*S.size,C=new Uint8Array(r.buffer,S.end*2,y*2);f.set(C,h),h+=y*2,S.end+=y}return new DataView(f.buffer)}function qe(e){const n=e.array.slice(e.offset.value,e.offset.value+e.size),t=te(n),r=e.inputChannels.length*e.lines*e.columns*e.totalBytes,l=new ArrayBuffer(r),u=new DataView(l);let o=0,a=0;const c=new Array(4);for(let s=0;s<e.lines;s++)for(let i=0;i<e.inputChannels.length;i++){let p=0;switch(e.inputChannels[i].pixelType){case 1:c[0]=o,c[1]=c[0]+e.columns,o=c[1]+e.columns;for(let f=0;f<e.columns;++f){const m=t[c[0]++]<<8|t[c[1]++];p+=m,u.setUint16(a,p,!0),a+=2}break;case 2:c[0]=o,c[1]=c[0]+e.columns,c[2]=c[1]+e.columns,o=c[2]+e.columns;for(let f=0;f<e.columns;++f){const m=t[c[0]++]<<24|t[c[1]++]<<16|t[c[2]++]<<8;p+=m,u.setUint32(a,p,!0),a+=4}break}}return u}function Ae(e){const n=e.viewer,t={value:e.offset.value},r=new Uint8Array(e.columns*e.lines*(e.inputChannels.length*e.type*2)),l={version:x(n,t),unknownUncompressedSize:x(n,t),unknownCompressedSize:x(n,t),acCompressedSize:x(n,t),dcCompressedSize:x(n,t),rleCompressedSize:x(n,t),rleUncompressedSize:x(n,t),rleRawSize:x(n,t),totalAcUncompressedCount:x(n,t),totalDcUncompressedCount:x(n,t),acCompression:x(n,t)};if(l.version<2)throw new Error("EXRLoader.parse: "+Y.compression+" version "+l.version+" is unsupported");const u=new Array;let o=J(n,t)-2;for(;o>0;){const E=V(n.buffer,t),S=P(n,t),y=S>>2&3,C=(S>>4)-1,v=new Int8Array([C])[0],T=P(n,t);u.push({name:E,index:v,type:T,compression:y}),o-=E.length+3}const a=Y.channels,c=new Array(e.inputChannels.length);for(let E=0;E<e.inputChannels.length;++E){const S=c[E]={},y=a[E];S.name=y.name,S.compression=0,S.decoded=!1,S.type=y.pixelType,S.pLinear=y.pLinear,S.width=e.columns,S.height=e.lines}const s={idx:new Array(3)};for(let E=0;E<e.inputChannels.length;++E){const S=c[E];for(let y=0;y<u.length;++y){const C=u[y];S.name==C.name&&(S.compression=C.compression,C.index>=0&&(s.idx[C.index]=E),S.offset=E)}}let i,p,h;if(l.acCompressedSize>0)switch(l.acCompression){case 0:i=new Uint16Array(l.totalAcUncompressedCount),ye(e.array,n,t,l.acCompressedSize,i,l.totalAcUncompressedCount);break;case 1:const E=e.array.slice(t.value,t.value+l.totalAcUncompressedCount),S=te(E);i=new Uint16Array(S.buffer),t.value+=l.totalAcUncompressedCount;break}if(l.dcCompressedSize>0){const E={array:e.array,offset:t,size:l.dcCompressedSize};p=new Uint16Array(ue(E).buffer),t.value+=l.dcCompressedSize}if(l.rleRawSize>0){const E=e.array.slice(t.value,t.value+l.rleCompressedSize),S=te(E);h=Ce(S.buffer),t.value+=l.rleCompressedSize}let f=0;const m=new Array(c.length);for(let E=0;E<m.length;++E)m[E]=new Array;for(let E=0;E<e.lines;++E)for(let S=0;S<c.length;++S)m[S].push(f),f+=c[S].width*e.type*2;s.idx[0]!==void 0&&c[s.idx[0]]&&ze(s,m,c,i,p,r);for(let E=0;E<c.length;++E){const S=c[E];if(!S.decoded)switch(S.compression){case 2:let y=0,C=0;for(let v=0;v<e.lines;++v){let T=m[E][y];for(let _=0;_<S.width;++_){for(let I=0;I<2*S.type;++I)r[T++]=h[C+I*S.width*S.height];C++}y++}break;case 1:Ye(E,m,c,i,p,r);break;default:throw new Error("EXRLoader.parse: unsupported channel compression")}}return new DataView(r.buffer)}function V(e,n){const t=new Uint8Array(e);let r=0;for(;t[n.value+r]!=0;)r+=1;const l=new TextDecoder().decode(t.slice(n.value,n.value+r));return n.value=n.value+r+1,l}function Je(e,n,t){const r=new TextDecoder().decode(new Uint8Array(e).slice(n.value,n.value+t));return n.value=n.value+t,r}function $e(e,n){const t=M(e,n),r=d(e,n);return[t,r]}function Qe(e,n){const t=d(e,n),r=d(e,n);return[t,r]}function M(e,n){const t=e.getInt32(n.value,!0);return n.value=n.value+4,t}function d(e,n){const t=e.getUint32(n.value,!0);return n.value=n.value+4,t}function Oe(e,n){const t=e[n.value];return n.value=n.value+1,t}function P(e,n){const t=e.getUint8(n.value);return n.value=n.value+1,t}const x=function(e,n){let t;return"getBigInt64"in DataView.prototype?t=Number(e.getBigInt64(n.value,!0)):t=e.getUint32(n.value+4,!0)+Number(e.getUint32(n.value,!0)<<32),n.value+=8,t};function R(e,n){const t=e.getFloat32(n.value,!0);return n.value+=4,t}function Ve(e,n){return Me.toHalfFloat(R(e,n))}function w(e){const n=(e&31744)>>10,t=e&1023;return(e>>15?-1:1)*(n?n===31?t?NaN:1/0:Math.pow(2,n-15)*(1+t/1024):6103515625e-14*(t/1024))}function J(e,n){const t=e.getUint16(n.value,!0);return n.value+=2,t}function je(e,n){return w(J(e,n))}function en(e,n,t,r){const l=t.value,u=[];for(;t.value<l+r-1;){const o=V(n,t),a=M(e,t),c=P(e,t);t.value+=3;const s=M(e,t),i=M(e,t);u.push({name:o,pixelType:a,pLinear:c,xSampling:s,ySampling:i})}return t.value+=1,u}function nn(e,n){const t=R(e,n),r=R(e,n),l=R(e,n),u=R(e,n),o=R(e,n),a=R(e,n),c=R(e,n),s=R(e,n);return{redX:t,redY:r,greenX:l,greenY:u,blueX:o,blueY:a,whiteX:c,whiteY:s}}function tn(e,n){const t=["NO_COMPRESSION","RLE_COMPRESSION","ZIPS_COMPRESSION","ZIP_COMPRESSION","PIZ_COMPRESSION","PXR24_COMPRESSION","B44_COMPRESSION","B44A_COMPRESSION","DWAA_COMPRESSION","DWAB_COMPRESSION"],r=P(e,n);return t[r]}function on(e,n){const t=M(e,n),r=M(e,n),l=M(e,n),u=M(e,n);return{xMin:t,yMin:r,xMax:l,yMax:u}}function rn(e,n){const t=["INCREASING_Y","DECREASING_Y","RANDOM_Y"],r=P(e,n);return t[r]}function ln(e,n){const t=["ENVMAP_LATLONG","ENVMAP_CUBE"],r=P(e,n);return t[r]}function sn(e,n){const t=["ONE_LEVEL","MIPMAP_LEVELS","RIPMAP_LEVELS"],r=["ROUND_DOWN","ROUND_UP"],l=d(e,n),u=d(e,n),o=P(e,n);return{xSize:l,ySize:u,levelMode:t[o&15],roundingMode:r[o>>4]}}function cn(e,n){const t=R(e,n),r=R(e,n);return[t,r]}function un(e,n){const t=R(e,n),r=R(e,n),l=R(e,n);return[t,r,l]}function an(e,n,t,r,l){if(r==="string"||r==="stringvector"||r==="iccProfile")return Je(n,t,l);if(r==="chlist")return en(e,n,t,l);if(r==="chromaticities")return nn(e,t);if(r==="compression")return tn(e,t);if(r==="box2i")return on(e,t);if(r==="envmap")return ln(e,t);if(r==="tiledesc")return sn(e,t);if(r==="lineOrder")return rn(e,t);if(r==="float")return R(e,t);if(r==="v2f")return cn(e,t);if(r==="v3f")return un(e,t);if(r==="int")return M(e,t);if(r==="rational")return $e(e,t);if(r==="timecode")return Qe(e,t);if(r==="preview")return t.value+=l,"skipped";t.value+=l}function hn(e,n){const t=Math.log2(e);return n=="ROUND_DOWN"?Math.floor(t):Math.ceil(t)}function pn(e,n,t){let r=0;switch(e.levelMode){case"ONE_LEVEL":r=1;break;case"MIPMAP_LEVELS":r=hn(Math.max(n,t),e.roundingMode)+1;break;case"RIPMAP_LEVELS":throw new Error("THREE.EXRLoader: RIPMAP_LEVELS tiles currently unsupported.")}return r}function Te(e,n,t,r){const l=new Array(e);for(let u=0;u<e;u++){const o=1<<u;let a=n/o|0;r=="ROUND_UP"&&a*o<n&&(a+=1);const c=Math.max(a,1);l[u]=(c+t-1)/t|0}return l}function En(){const e=this,n=e.offset,t={value:0};for(let r=0;r<e.tileCount;r++){const l=M(e.viewer,n),u=M(e.viewer,n);n.value+=8,e.size=d(e.viewer,n);const o=l*e.blockWidth,a=u*e.blockHeight;e.columns=o+e.blockWidth>e.width?e.width-o:e.blockWidth,e.lines=a+e.blockHeight>e.height?e.height-a:e.blockHeight;const c=e.columns*e.totalBytes,i=e.size<e.lines*c?e.uncompress(e):ie(e);n.value+=e.size;for(let p=0;p<e.lines;p++){const h=p*e.columns*e.totalBytes;for(let f=0;f<e.inputChannels.length;f++){const m=Y.channels[f].name,E=e.channelByteOffsets[m]*e.columns,S=e.decodeChannels[m];if(S===void 0)continue;t.value=h+E;const y=(e.height-(1+a+p))*e.outLineWidth;for(let C=0;C<e.columns;C++){const v=y+(C+o)*e.outputChannels+S;e.byteArray[v]=e.getter(i,t)}}}}}function fn(){const e=this,n=e.offset,t={value:0};for(let r=0;r<e.height/e.blockHeight;r++){const l=M(e.viewer,n)-Y.dataWindow.yMin;e.size=d(e.viewer,n),e.lines=l+e.blockHeight>e.height?e.height-l:e.blockHeight;const u=e.columns*e.totalBytes,a=e.size<e.lines*u?e.uncompress(e):ie(e);n.value+=e.size;for(let c=0;c<e.blockHeight;c++){const s=r*e.blockHeight,i=c+e.scanOrder(s);if(i>=e.height)continue;const p=c*u,h=(e.height-1-i)*e.outLineWidth;for(let f=0;f<e.inputChannels.length;f++){const m=Y.channels[f].name,E=e.channelByteOffsets[m]*e.columns,S=e.decodeChannels[m];if(S!==void 0){t.value=p+E;for(let y=0;y<e.columns;y++){const C=h+y*e.outputChannels+S;e.byteArray[C]=e.getter(a,t)}}}}}}function wn(e,n,t){const r={};if(e.getUint32(0,!0)!=20000630)throw new Error("THREE.EXRLoader: Provided file doesn't appear to be in OpenEXR format.");r.version=e.getUint8(4);const l=e.getUint8(5);r.spec={singleTile:!!(l&2),longName:!!(l&4),deepFormat:!!(l&8),multiPart:!!(l&16)},t.value=8;let u=!0;for(;u;){const o=V(n,t);if(o==="")u=!1;else{const a=V(n,t),c=d(e,t),s=an(e,n,t,a,c);s===void 0?console.warn(`THREE.EXRLoader: Skipped unknown header attribute type '${a}'.`):r[o]=s}}if((l&-7)!=0)throw console.error("THREE.EXRHeader:",r),new Error("THREE.EXRLoader: Provided file is currently unsupported.");return r}function Sn(e,n,t,r,l,u){const o={size:0,viewer:n,array:t,offset:r,width:e.dataWindow.xMax-e.dataWindow.xMin+1,height:e.dataWindow.yMax-e.dataWindow.yMin+1,inputChannels:e.channels,channelByteOffsets:{},shouldExpand:!1,scanOrder:null,totalBytes:null,columns:null,lines:null,type:null,uncompress:null,getter:null,format:null,colorSpace:X};switch(e.compression){case"NO_COMPRESSION":o.blockHeight=1,o.uncompress=ie;break;case"RLE_COMPRESSION":o.blockHeight=1,o.uncompress=We;break;case"ZIPS_COMPRESSION":o.blockHeight=1,o.uncompress=ue;break;case"ZIP_COMPRESSION":o.blockHeight=16,o.uncompress=ue;break;case"PIZ_COMPRESSION":o.blockHeight=32,o.uncompress=Ke;break;case"PXR24_COMPRESSION":o.blockHeight=16,o.uncompress=qe;break;case"DWAA_COMPRESSION":o.blockHeight=32,o.uncompress=Ae;break;case"DWAB_COMPRESSION":o.blockHeight=256,o.uncompress=Ae;break;default:throw new Error("EXRLoader.parse: "+e.compression+" is unsupported")}const a={};for(const h of e.channels)switch(h.name){case"Y":case"R":case"G":case"B":case"A":a[h.name]=!0,o.type=h.pixelType}let c=!1,s=!1;if(a.R&&a.G&&a.B)o.outputChannels=4;else if(a.Y)o.outputChannels=1;else throw new Error("EXRLoader.parse: file contains unsupported data channels.");switch(o.outputChannels){case 4:u==K?(c=!a.A,o.format=K,o.colorSpace=X,o.outputChannels=4,o.decodeChannels={R:0,G:1,B:2,A:3}):u==Q?(o.format=Q,o.colorSpace=X,o.outputChannels=2,o.decodeChannels={R:0,G:1}):u==ne?(o.format=ne,o.colorSpace=X,o.outputChannels=1,o.decodeChannels={R:0}):s=!0;break;case 1:u==K?(c=!0,o.format=K,o.colorSpace=X,o.outputChannels=4,o.shouldExpand=!0,o.decodeChannels={Y:0}):u==Q?(o.format=Q,o.colorSpace=X,o.outputChannels=2,o.shouldExpand=!0,o.decodeChannels={Y:0}):u==ne?(o.format=ne,o.colorSpace=X,o.outputChannels=1,o.decodeChannels={Y:0}):s=!0;break;default:s=!0}if(s)throw new Error("EXRLoader.parse: invalid output format for specified file.");if(o.type==1)switch(l){case ae:o.getter=je;break;case ee:o.getter=J;break}else if(o.type==2)switch(l){case ae:o.getter=R;break;case ee:o.getter=Ve}else throw new Error("EXRLoader.parse: unsupported pixelType "+o.type+" for "+e.compression+".");o.columns=o.width;const i=o.width*o.height*o.outputChannels;switch(l){case ae:o.byteArray=new Float32Array(i),c&&o.byteArray.fill(1,0,i);break;case ee:o.byteArray=new Uint16Array(i),c&&o.byteArray.fill(15360,0,i);break;default:console.error("THREE.EXRLoader: unsupported type: ",l);break}let p=0;for(const h of e.channels)o.decodeChannels[h.name]!==void 0&&(o.channelByteOffsets[h.name]=p),p+=h.pixelType*2;if(o.totalBytes=p,o.outLineWidth=o.width*o.outputChannels,e.lineOrder==="INCREASING_Y"?o.scanOrder=h=>h:o.scanOrder=h=>o.height-1-h,e.spec.singleTile){o.blockHeight=e.tiles.ySize,o.blockWidth=e.tiles.xSize;const h=pn(e.tiles,o.width,o.height),f=Te(h,o.width,e.tiles.xSize,e.tiles.roundingMode),m=Te(h,o.height,e.tiles.ySize,e.tiles.roundingMode);o.tileCount=f[0]*m[0];for(let E=0;E<h;E++)for(let S=0;S<m[E];S++)for(let y=0;y<f[E];y++)x(n,r);o.decode=En.bind(o)}else{o.blockWidth=o.width;const h=Math.ceil(o.height/o.blockHeight);for(let f=0;f<h;f++)x(n,r);o.decode=fn.bind(o)}return o}const be={value:0},Re=new DataView(k),mn=new Uint8Array(k),Y=wn(Re,k,be),H=Sn(Y,Re,mn,be,this.type,this.outputFormat);if(H.decode(),H.shouldExpand){const e=H.byteArray;if(this.outputFormat==K)for(let n=0;n<e.length;n+=4)e[n+2]=e[n+1]=e[n];else if(this.outputFormat==Q)for(let n=0;n<e.length;n+=2)e[n+1]=e[n]}return{header:Y,width:H.width,height:H.height,data:H.byteArray,format:H.format,colorSpace:H.colorSpace,type:this.type}}setDataType(k){return this.type=k,this}setOutputFormat(k){return this.outputFormat=k,this}load(k,oe,he,pe){function Ee(z,re){z.colorSpace=re.colorSpace,z.minFilter=xe,z.magFilter=xe,z.generateMipmaps=!1,z.flipY=!1,oe&&oe(z,re)}return super.load(k,Ee,he,pe)}}export{Bn as EXRLoader};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{g as o,a4 as d,K as p,a3 as u,aE as g}from"./three.module-D396a9Mn.js";import{C as _}from"./CopyShader-BzTUYzf6.js";import{ShaderPass as x}from"./ShaderPass-QYRpPuFJ.js";import{X as l}from"./index-GIL7oGEO.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};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as p}from"./jsx-runtime-DPjLkJKQ.js";import{r as l}from"./index-nmcBqr7Y.js";import"./index-CtzuWnCS.js";import{aY as d,ao as v,aZ as S,a_ as x,a$ as b,aI as u}from"./index-GIL7oGEO.js";import{Object3DDocumentViewport as h}from"./StageHost-BN-IoTef.js";import"./_commonjsHelpers-D6-XlEtG.js";import"./index-D_NuPfjr.js";import"./index-CinJrH5C.js";import"./index-FUuS4qwW.js";import"./client-DNXj_opT.js";import"./three.module-D396a9Mn.js";import"./stage-invalidation-DBg3C3Ta.js";import"./live-gesture-lock-DJbrjOqf.js";import"./viewport-shading-boundary-B_-_gABg.js";import"./clip-planes-CnAI6DZn.js";import"./three-CDSueJyJ.js";import"./viewport-pick-context-DkawXbEi.js";import"./OrbitControls-CM3bPray.js";import"./LineSegments2-CsOpKSiM.js";import"./three.quarks.esm-B1C61jGo.js";import"./scene-framing-Cat0GtyJ.js";import"./source-object3d-authoring-adapter-B-L6Ha6f.js";import"./three-projection-core-BmKMZ-nf.js";import"./editor-presentation-activity-C7SNSmTd.js";import"./standard-viewport-dressing-CzjAe_0A.js";import"./viewport-surface-status-B3om4Kcf.js";function w(s){const t=new Set;return s.traverse(i=>{const e=u(i,"_animationRuntime");if(e)for(const o of e.clips.values())t.add(o);const r=u(i,"_animClips");if(r)for(const o of r.values())t.add(o);for(const o of i.animations)t.add(o)}),[...t]}function g({documentId:s,source:t,sourcePath:i,displayName:e,active:r,chromeless:o=!1,revision:n=0,modelSource:m}){const f=l.useCallback(()=>{const a=S(x(t)),c=w(t);return a.animations=[...c],{root:a,animations:c,dispose(){b(a)}}},[t,n]);return p.jsx(h,{documentId:s,sourcePath:i??e,displayName:e,build:f,active:r,chromeless:o,rendererLane:o?"inspector-preview":"own",assetType:"entity",...m?{modelSource:m}:{}})}function K({documentId:s,entityId:t,displayName:i,active:e}){const r=d(),o=l.useSyncExternalStore(r.subscribe,r.getSnapshot),n=r.objectMap.get(t);return n?p.jsx(g,{documentId:s,source:n,sourcePath:`Entity ${t}`,displayName:i,active:e,revision:o,modelSource:{kind:"entity",entityId:t}}):p.jsxs("div",{role:"alert",style:{padding:20,color:v.semantic.danger},children:["Scene entity ",t," is no longer available."]})}export{K as EntityModelDocument,g as Object3DSnapshotDocument};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as o}from"./jsx-runtime-DPjLkJKQ.js";import{b0 as M,b1 as C,b2 as D,b3 as k,ao as y,b4 as R,b5 as v}from"./index-GIL7oGEO.js";import{r as f}from"./index-nmcBqr7Y.js";import"./index-CtzuWnCS.js";import{E as P,W as z,j as A,v as I,w as F,x as H,C as L,y as O,z as T,M as E,F as j,H as S,I as B,r as G}from"./three.module-D396a9Mn.js";import{OrbitControls as $}from"./OrbitControls-CM3bPray.js";import{EXRLoader as N}from"./EXRLoader-Cdans_oJ.js";import{HDRLoader as q}from"./HDRLoader-THU88oVD.js";import{s as _}from"./asset-editor-persistence-BBaONOJt.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"./fflate.module-DPuTF8aG.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 N:new q).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 F,r=new H(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 L("#11141b");const i=e.width>0&&e.height>0?e.width/e.height:1,d=new O(i>=1?4.8:4.8*i,i>=1?4.8/i:4.8),m=new T({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 B(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 z({canvas:a,antialias:!0});c.outputColorSpace=A,c.toneMapping=I;const l=V(e),i=new $(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=G.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 pe({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{pe as EnvironmentAssetDocument};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a0 as G,V as M,cc as ue,ak as Z,b2 as he,al as fe,e as me,a2 as $,am as J,as as de,a$ as _,bX as ge,b3 as B,C as b,j as D,E as ye,a as I,aX as ee,b6 as te,bq as W,O as H,x as ve,bH as ne,r as S,bG as we,D as Te,bS as Ie,M as Fe,aZ as xe,bh as Pe,b5 as Ae,bU as Se,aB as Q,aY as V,cd as Ee,aF as De,g as Le,ce as Me,aQ as O,d as ke,Q as R,b as Ce,c as re,cf as be}from"./three.module-D396a9Mn.js";import{u as Re}from"./fflate.module-DPuTF8aG.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 Xe(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 Ue(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(Ue(s,a)*n[a]));r[s]=i.divideScalar(n[0])}return r}function ze(h,e,t,n,r){const s=Xe(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 nt extends Z{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(Qe(e))y=new Ne().parse(e);else{const r=ce(e);if(!Ye(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 He().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?$:J,n.wrapT=a===0?$: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 Ke().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 H;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 H;break;default:console.warn("THREE.FBXLoader: Unknown camera type "+r+"."),t=new H;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 H;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:Z.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:Z.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 He{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 Q;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=K(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 C=E,L=w[P];x.forEach(function(j,U,k){if(C>j){k[U]=C,C=j;const N=v[U];v[U]=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=K(m,n,f,e.normal);a.push(v[0],v[1],v[2])}e.material&&e.material.mappingType!=="AllSame"&&(g=K(m,n,f,e.material)[0],g<0&&(u.negativeMaterialIndices=!0,g=0)),e.uv&&e.uv.forEach(function(v,x){const E=K(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 Q;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 Q().setFromPoints(p)}}class Ke{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(qe),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 ke(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 Ce(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,C=new O;for(let L=0;L<1;L+=1/g)P.copy(T.clone().slerp(v.clone(),L)),s.push(x+L*E),C.setFromQuaternion(P,r),i.push(C.x),i.push(C.y),i.push(C.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],$e(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=q(s))}parseNodePropertyContinued(e){const t=this.getCurrentNode();t.a+=e,e.slice(-1)!==","&&(t.a=q(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=q(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 Qe(h){const e="Kaydara FBX Binary \0";return h.byteLength>=e.length&&e===ce(h,0,e.length)}function Ye(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 qe(h){return h/46186158e3}const Ze=[];function K(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(Ze,n.buffer,s,i)}const Y=new O,X=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(X.fromArray(h.translation));const m=z(0);if(h.preRotation){const k=h.preRotation.map(S.degToRad);k.push(m),t.makeRotationFromEuler(Y.fromArray(k))}if(h.rotation){const k=h.rotation.map(S.degToRad);k.push(h.eulerOrder||m),n.makeRotationFromEuler(Y.fromArray(k))}if(h.postRotation){const k=h.postRotation.map(S.degToRad);k.push(m),r.makeRotationFromEuler(Y.fromArray(k)),r.invert()}h.scale&&s.scale(X.fromArray(h.scale)),h.scalingOffset&&a.setPosition(X.fromArray(h.scalingOffset)),h.scalingPivot&&i.setPosition(X.fromArray(h.scalingPivot)),h.rotationOffset&&o.setPosition(X.fromArray(h.rotationOffset)),h.rotationPivot&&l.setPosition(X.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(),C=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(C);const j=new I().copyPosition(L),U=p.clone().multiply(j);return u.copyPosition(U),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 q(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 $e(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{nt as FBXLoader};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as s}from"./index-nmcBqr7Y.js";import{u as c}from"./events-156d8d12.esm-ErOhDXXB.js";import{a4 as y,K as h,k as d,af as T,Z as b}from"./three.module-D396a9Mn.js";function v(t,n,i){const a=c(r=>r.size),p=c(r=>r.viewport),e=typeof t=="number"?t:a.width*p.dpr,u=typeof n=="number"?n:a.height*p.dpr,l=(typeof t=="number"?i:t)||{},{samples:f=0,depth:m,...g}=l,F=m??l.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=f,r},[]);return s.useLayoutEffect(()=>{o.setSize(e,u),f&&(o.samples=f)},[f,o,e,u]),s.useEffect(()=>()=>o.dispose(),[]),o}const z=s.forwardRef(({children:t,width:n,height:i,...a},p)=>{const e=v(n,i,a);return s.useImperativeHandle(p,()=>e,[e]),s.createElement(s.Fragment,null,t?.(e))});export{z as F,v as u};
|