@realsee/five-webgpu 1.0.0-alpha.12 → 1.0.0-alpha.14
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/_virtual/_rolldown/runtime.js +3 -3
- package/docs/assets/hierarchy.js +1 -1
- package/docs/assets/navigation.js +1 -1
- package/docs/assets/search.js +1 -1
- package/docs/classes/index.AdaptiveLuminancePass.html +1 -1
- package/docs/classes/index.BoundingMesh.html +1 -1
- package/docs/classes/index.Camera.html +1 -1
- package/docs/classes/index.EyeDomeLightingPass.html +1 -1
- package/docs/classes/index.Five.html +41 -32
- package/docs/classes/index.FivePass.html +1 -1
- package/docs/classes/index.FiveRenderer.html +7 -2
- package/docs/classes/index.FlowingFireworks3DPass.html +1 -1
- package/docs/classes/index.FlowingLight2DPass.html +1 -1
- package/docs/classes/index.FlowingLight3DPass.html +1 -1
- package/docs/classes/index.GaussianBlurPass.html +1 -1
- package/docs/classes/index.InternalWebGPURenderer.html +4 -5
- package/docs/classes/index.Model.html +1 -1
- package/docs/classes/index.ModelScene.html +1 -1
- package/docs/classes/index.NetworkSubscribe.html +1 -1
- package/docs/classes/index.PBMCustomNode.html +1 -1
- package/docs/classes/index.PBMGaussianSplattingNodeMaterial.html +9 -9
- package/docs/classes/index.PBMGaussianSplattingObject.html +49 -11
- package/docs/classes/index.PBMGaussianSplattingRenderMesh.html +71 -16
- package/docs/classes/index.PBMGroup.html +1 -1
- package/docs/classes/index.PBMMesh.html +1 -1
- package/docs/classes/index.PBMMeshBasicMaterial.html +1 -1
- package/docs/classes/index.PBMMeshBasicNodeMaterial.html +1 -1
- package/docs/classes/index.PBMMeshPanoOnlyMaterial.html +1 -1
- package/docs/classes/index.PBMMeshPanoOnlyNodeMaterial.html +1 -1
- package/docs/classes/index.PBMMeshPhongMaterial.html +1 -1
- package/docs/classes/index.PBMMeshPhongNodeMaterial.html +1 -1
- package/docs/classes/index.PBMMeshPhysicalMaterial.html +1 -1
- package/docs/classes/index.PBMMeshPhysicalNodeMaterial.html +1 -1
- package/docs/classes/index.PBMPanoFilter.html +1 -1
- package/docs/classes/index.PBMPointCloud.html +1 -1
- package/docs/classes/index.PBMPointCloudMaterial.html +1 -1
- package/docs/classes/index.PBMSkinnedMesh.html +1 -1
- package/docs/classes/index.PBMUpdateable.html +1 -1
- package/docs/classes/index.PanoCircleMesh.html +1 -1
- package/docs/classes/index.PanoCircleMeshCustom.html +1 -1
- package/docs/classes/index.PanoCircleMeshSolid.html +1 -1
- package/docs/classes/index.Parameter.html +24 -22
- package/docs/classes/index.Scene.html +1 -1
- package/docs/classes/index.Subscribe.html +1 -1
- package/docs/classes/index.Tile3D.html +22 -22
- package/docs/classes/index.TileNode.html +2 -2
- package/docs/classes/index.TrajectoryNode.html +1 -1
- package/docs/classes/index.Work.html +15 -22
- package/docs/classes/index.WorkResolvedObserver.html +22 -22
- package/docs/functions/index.createWorks.html +1 -1
- package/docs/functions/index.parseWork.html +1 -1
- package/docs/hierarchy.html +1 -1
- package/docs/interfaces/index.AddableObject.html +1 -1
- package/docs/interfaces/index.AjaxOptions.html +1 -1
- package/docs/interfaces/index.BaseEvent.html +1 -1
- package/docs/interfaces/index.Clock.html +1 -1
- package/docs/interfaces/index.DeviceProfile.html +2 -2
- package/docs/interfaces/index.EventCallback.html +3 -3
- package/docs/interfaces/index.GestureEvent.html +1 -1
- package/docs/interfaces/index.IPBMMaterial.html +1 -1
- package/docs/interfaces/index.ImageOptions.html +1 -1
- package/docs/interfaces/index.IntersectEvent.html +1 -1
- package/docs/interfaces/index.IntersectMesh.html +1 -1
- package/docs/interfaces/index.IntersectMeshInterface.html +1 -1
- package/docs/interfaces/index.Intersection.html +1 -1
- package/docs/interfaces/index.LooseWorkWithExtrinsics.html +8 -8
- package/docs/interfaces/index.ModeChangeEvent.html +1 -1
- package/docs/interfaces/index.ModelControllerCustomInitArgs.html +1 -1
- package/docs/interfaces/index.ModelEvent.html +1 -1
- package/docs/interfaces/index.ModelSceneEvent.html +1 -1
- package/docs/interfaces/index.ModelTileEvent.html +1 -1
- package/docs/interfaces/index.MovePanoOptions.html +1 -1
- package/docs/interfaces/index.NetworkAbortError.html +1 -1
- package/docs/interfaces/index.NetworkFirbiddenError.html +1 -1
- package/docs/interfaces/index.NetworkOptions.html +1 -1
- package/docs/interfaces/index.NetworkProxyError.html +1 -1
- package/docs/interfaces/index.NetworkResourceEvent.html +1 -1
- package/docs/interfaces/index.NetworkResponseError.html +1 -1
- package/docs/interfaces/index.NetworkTimeoutError.html +1 -1
- package/docs/interfaces/index.ObjectEvent.html +1 -1
- package/docs/interfaces/index.PBMGaussianSplattingNodeMaterialOptions.html +3 -3
- package/docs/interfaces/index.PanoCircleMeshInterface.html +1 -1
- package/docs/interfaces/index.PanoEvent.html +1 -1
- package/docs/interfaces/index.PanoPrepareEvent.html +1 -1
- package/docs/interfaces/index.PanoTextureEvent.html +1 -1
- package/docs/interfaces/index.PanoramaControllerCustomInitArgs.html +1 -1
- package/docs/interfaces/index.PanoramaLikeControllerCustomInitArgs.html +1 -1
- package/docs/interfaces/index.ParameterMaterialValue.html +8 -6
- package/docs/interfaces/index.ParameterTilesetValue.html +15 -15
- package/docs/interfaces/index.ParameterValue.html +21 -19
- package/docs/interfaces/index.Pose.html +1 -1
- package/docs/interfaces/index.RenderEvent.html +1 -1
- package/docs/interfaces/index.ResolvedParameterValue.html +22 -20
- package/docs/interfaces/index.SplatData.html +10 -6
- package/docs/interfaces/index.State.html +1 -1
- package/docs/interfaces/index.StateEvent.html +1 -1
- package/docs/interfaces/index.TextureOptions.html +1 -1
- package/docs/interfaces/index.Tile3DOptions.html +2 -2
- package/docs/interfaces/index.TopviewControllerCustomInitArgs.html +1 -1
- package/docs/interfaces/index.VRPanoramaControllerCustomInitArgs.html +1 -1
- package/docs/interfaces/index.ViewLayer.html +22 -22
- package/docs/interfaces/index.WorkCubeHdrGainmapImage.html +2 -2
- package/docs/interfaces/index.WorkCubeImage.html +2 -2
- package/docs/interfaces/index.WorkImage.html +5 -5
- package/docs/interfaces/index.WorkInitial.html +8 -8
- package/docs/interfaces/index.WorkInitialJson.html +2 -2
- package/docs/interfaces/index.WorkJson.html +2 -4
- package/docs/interfaces/index.WorkModel.html +8 -8
- package/docs/interfaces/index.WorkModelJson.html +2 -2
- package/docs/interfaces/index.WorkModelLayer.html +6 -6
- package/docs/interfaces/index.WorkModelLayerJson.html +2 -2
- package/docs/interfaces/index.WorkObserver.html +23 -23
- package/docs/interfaces/index.WorkObserverJson.html +2 -2
- package/docs/interfaces/index.WorkPanoramaJson.html +2 -2
- package/docs/interfaces/index.WorkPanoramasJson.html +2 -2
- package/docs/interfaces/index.WorkTile.html +5 -5
- package/docs/interfaces/index.WorkVideo.html +4 -4
- package/docs/interfaces/index.WorksEvent.html +1 -1
- package/docs/interfaces/index.XRControllerEvent.html +1 -1
- package/docs/interfaces/index.XRGestureEvent.html +2 -2
- package/docs/interfaces/index.XRPanoramaControllerCustomInitArgs.html +1 -1
- package/docs/interfaces/index.XRSessionEvent.html +1 -1
- package/docs/modules/index.html +1 -1
- package/docs/types/index.LegacyEventType.html +3 -3
- package/docs/types/index.OutputTextureDataType.html +1 -1
- package/docs/types/index.ParseOptions.html +8 -8
- package/docs/types/index.PointCloudTransparencyMode.html +2 -0
- package/docs/types/index.Works.html +1 -1
- package/docs/variables/index.loadAt3d.html +2 -0
- package/docs/variables/index.loadDome.html +2 -0
- package/docs/variables/index.loadDomez.html +2 -0
- package/docs/variables/index.loadGltf.html +2 -0
- package/docs/variables/index.loadPbm.html +2 -0
- package/docs/variables/index.loadPly.html +2 -0
- package/five/application/five.d.ts +13 -0
- package/five/chunks/at3d.js +338 -0
- package/five/chunks/at3d.mjs +338 -0
- package/five/chunks/dome.js +338 -0
- package/five/chunks/dome.mjs +338 -0
- package/five/chunks/domez.js +338 -0
- package/five/chunks/domez.mjs +338 -0
- package/five/chunks/fbx.js +338 -0
- package/five/chunks/fbx.mjs +338 -0
- package/five/chunks/fflate.js +338 -0
- package/five/chunks/fflate.mjs +338 -0
- package/five/chunks/glTF-helpers.js +804 -0
- package/five/chunks/glTF-helpers.mjs +804 -0
- package/five/chunks/gltf.js +338 -0
- package/five/chunks/gltf.mjs +338 -0
- package/five/chunks/imageBitmap.js +338 -0
- package/five/chunks/imageBitmap.mjs +338 -0
- package/five/chunks/imageSupport.js +338 -0
- package/five/chunks/imageSupport.mjs +338 -0
- package/five/chunks/lzma.js +383 -0
- package/five/chunks/lzma.mjs +383 -0
- package/five/chunks/memoryUsage.js +339 -0
- package/five/chunks/memoryUsage.mjs +339 -0
- package/five/chunks/minimal.js +338 -0
- package/five/chunks/minimal.mjs +338 -0
- package/five/chunks/pbm.js +338 -0
- package/five/chunks/pbm.mjs +338 -0
- package/five/chunks/pbmGaussianSplattingObject.js +338 -0
- package/five/chunks/pbmGaussianSplattingObject.mjs +338 -0
- package/five/chunks/pbmMeshMaterial.js +338 -0
- package/five/chunks/pbmMeshMaterial.mjs +338 -0
- package/five/chunks/pick.js +338 -0
- package/five/chunks/pick.mjs +338 -0
- package/five/chunks/ply.js +339 -0
- package/five/chunks/ply.mjs +339 -0
- package/five/chunks/spz.js +364 -0
- package/five/chunks/spz.mjs +364 -0
- package/five/controllers/xrPanorama.d.ts +13 -0
- package/five/core/internalWebGPURenderer.d.ts +0 -3
- package/five/core/panoVideo.d.ts +2 -0
- package/five/core/webglBlendEquationFix.d.ts +41 -0
- package/five/gaussian-splatting/arena/splatArena.d.ts +227 -0
- package/five/gaussian-splatting/cullConstants.d.ts +68 -0
- package/five/gaussian-splatting/hybridConstants.d.ts +60 -0
- package/five/gaussian-splatting/instancePacking.d.ts +46 -0
- package/five/gaussian-splatting/mirrors/layoutMirror.d.ts +44 -0
- package/five/gaussian-splatting/mirrors/mirrorBuffer.d.ts +72 -0
- package/five/gaussian-splatting/mirrors/mirrorSet.d.ts +17 -0
- package/five/gaussian-splatting/mirrors/objectParamsMirror.d.ts +35 -0
- package/five/gaussian-splatting/mirrors/transformMirror.d.ts +26 -0
- package/five/gaussian-splatting/pipelines/gpuSortPipeline.d.ts +5 -31
- package/five/gaussian-splatting/pipelines/pipelineMode.d.ts +1 -2
- package/five/gaussian-splatting/sh-core/codec.d.ts +13 -0
- package/five/gaussian-splatting/sh-core/constants.d.ts +29 -0
- package/five/gaussian-splatting/sh-core/index.d.ts +4 -0
- package/five/gaussian-splatting/sh-core/rebakePolicy.d.ts +20 -0
- package/five/gaussian-splatting/sh-core/texelRange.d.ts +18 -0
- package/five/gaussian-splatting/shAssembler.d.ts +14 -0
- package/five/gaussian-splatting/shBakeScheduler.d.ts +26 -0
- package/five/gaussian-splatting/shBaker.d.ts +44 -0
- package/five/gaussian-splatting/shTileResource.d.ts +22 -0
- package/five/gaussian-splatting/splatAssembler.d.ts +1 -1
- package/five/gaussian-splatting/transformStore.d.ts +2 -2
- package/five/gaussian-splatting/worker/decodeWorker.d.ts +72 -0
- package/five/index.d.ts +0 -1
- package/five/index.js +138 -640
- package/five/index.mjs +229 -29261
- package/five/model/index.d.ts +18 -6
- package/five/model/loaders/glTF-helpers/extensions/KHR_gaussian_splatting_compression_spz.d.ts +1 -1
- package/five/model/loaders/glTF-helpers/extensions/KHR_gaussian_splatting_compression_spz_2.d.ts +1 -1
- package/five/model/loaders/ply.d.ts +22 -6
- package/five/model/loaders/spz.d.ts +9 -49
- package/five/model/loaders/spz.worker.d.ts +37 -0
- package/five/model/materials/pbmGaussianSplattingNodeMaterial.d.ts +6 -12
- package/five/model/objects/pbmGaussianSplattingObject.d.ts +91 -6
- package/five/model/objects/pbmGaussianSplattingRenderMesh.d.ts +357 -15
- package/five/model/parameter.d.ts +4 -0
- package/five/renderer/compute-renderers/binned/binned-core.d.ts +45 -2
- package/five/renderer/compute-renderers/binned/binned-pipelines.d.ts +82 -1
- package/five/renderer/compute-renderers/color-space.d.ts +13 -0
- package/five/renderer/compute-renderers/composite-pipelines.d.ts +36 -0
- package/five/renderer/compute-renderers/frame-plan.d.ts +166 -0
- package/five/renderer/compute-renderers/gsplat-hybrid-renderer.d.ts +386 -0
- package/five/renderer/compute-renderers/pointcloud-compute-renderer.d.ts +101 -16
- package/five/renderer/compute-renderers/shaders/composite-blend.d.ts +2 -0
- package/five/renderer/compute-renderers/shaders/gsplatHybridIndirect.d.ts +2 -0
- package/five/renderer/compute-renderers/shaders/gsplatProjector.d.ts +2 -0
- package/five/renderer/compute-renderers/shaders/gsplatQuad.d.ts +2 -0
- package/five/renderer/compute-renderers/shaders/lib/write-additive.d.ts +2 -0
- package/five/renderer/compute-renderers/shaders/lib/write-blend.d.ts +2 -0
- package/five/renderer/compute-renderers/shaders/lib/write-opaque.d.ts +2 -0
- package/five/renderer/compute-renderers/tile-uniform-writer.d.ts +70 -0
- package/five/renderer/compute-renderers/transparency-buffers.d.ts +59 -0
- package/five/renderer/compute-renderers/transparency-math.d.ts +70 -0
- package/five/renderer/compute-renderers/transparency-settings.d.ts +24 -0
- package/five/renderer/compute-renderers/uniform-layout.d.ts +11 -2
- package/five/renderer/five-renderer.d.ts +28 -3
- package/five/renderer/index.d.ts +1 -1
- package/five/renderer/postprocessing/passes/pass.js +3 -3
- package/five/renderer/postprocessing/passes/pass.mjs +3 -3
- package/five/renderer/tools/full-screen-quad.js +3 -3
- package/five/renderer/tools/full-screen-quad.mjs +3 -3
- package/five/texture/videoTextureBridge.d.ts +152 -0
- package/five/thirdparty/sha256.d.ts +149 -0
- package/five/utils/calculateThreeMouse.js +3 -3
- package/five/utils/calculateThreeMouse.mjs +3 -3
- package/five/utils/distance.js +3 -3
- package/five/utils/distance.mjs +3 -3
- package/five/utils/isNil.js +3 -3
- package/five/utils/isNil.mjs +3 -3
- package/five/utils/memoryUsage.d.ts +1 -1
- package/five/utils/uuid.js +3 -3
- package/five/utils/uuid.mjs +3 -3
- package/five/work/work.d.ts +0 -7
- package/five/work/workJsonType.d.ts +0 -2
- package/gltf-loader/index.js +3 -3
- package/gltf-loader/index.mjs +3 -50
- package/line/index.js +3 -3
- package/line/index.mjs +3 -88
- package/package.json +1 -1
- package/plugins/BackgroundPlugin/Controller.js +4 -4
- package/plugins/BackgroundPlugin/Controller.mjs +4 -4
- package/plugins/BackgroundPlugin/index.js +3 -3
- package/plugins/BackgroundPlugin/index.mjs +3 -3
- package/plugins/BasePlugin/index.js +3 -3
- package/plugins/BasePlugin/index.mjs +3 -3
- package/plugins/CSS2DPlugin/Controller.js +3 -3
- package/plugins/CSS2DPlugin/Controller.mjs +3 -3
- package/plugins/CSS2DPlugin/index.js +3 -3
- package/plugins/CSS2DPlugin/index.mjs +3 -3
- package/plugins/CSS2DPlugin/style.css_raw.js +4 -4
- package/plugins/CSS2DPlugin/style.css_raw.mjs +4 -4
- package/plugins/CSS3DPlugin/Controller.js +3 -3
- package/plugins/CSS3DPlugin/Controller.mjs +3 -3
- package/plugins/CSS3DPlugin/index.js +3 -3
- package/plugins/CSS3DPlugin/index.mjs +3 -3
- package/plugins/CSS3DPlugin/style.css_raw.js +4 -4
- package/plugins/CSS3DPlugin/style.css_raw.mjs +4 -4
- package/plugins/FloorplanPlugin/Controller.js +3 -3
- package/plugins/FloorplanPlugin/Controller.mjs +3 -3
- package/plugins/FloorplanPlugin/index.js +3 -3
- package/plugins/FloorplanPlugin/index.mjs +3 -3
- package/plugins/FloorplanPlugin/render/assets.js +3 -3
- package/plugins/FloorplanPlugin/render/assets.mjs +3 -3
- package/plugins/FloorplanPlugin/render/index.js +3 -3
- package/plugins/FloorplanPlugin/render/index.mjs +3 -3
- package/plugins/FloorplanPlugin/render/isPointInPolygon.js +3 -3
- package/plugins/FloorplanPlugin/render/isPointInPolygon.mjs +3 -3
- package/plugins/FloorplanPlugin/render/renderFloor.js +3 -3
- package/plugins/FloorplanPlugin/render/renderFloor.mjs +3 -3
- package/plugins/FloorplanPlugin/render/roomLabelVisibility.js +3 -3
- package/plugins/FloorplanPlugin/render/roomLabelVisibility.mjs +3 -3
- package/plugins/FloorplanPlugin/render/style.css_raw.js +4 -4
- package/plugins/FloorplanPlugin/render/style.css_raw.mjs +4 -4
- package/plugins/FloorplanPlugin/utils/changeMode.js +3 -3
- package/plugins/FloorplanPlugin/utils/changeMode.mjs +3 -3
- package/plugins/FloorplanPlugin/utils/changeModelCanvasOpacity.js +3 -3
- package/plugins/FloorplanPlugin/utils/changeModelCanvasOpacity.mjs +3 -3
- package/plugins/FloorplanPlugin/utils/correctFiveState.js +3 -3
- package/plugins/FloorplanPlugin/utils/correctFiveState.mjs +3 -3
- package/plugins/FloorplanPlugin/utils/equal.js +3 -3
- package/plugins/FloorplanPlugin/utils/equal.mjs +3 -3
- package/plugins/FloorplanPlugin/utils/filter.js +3 -3
- package/plugins/FloorplanPlugin/utils/filter.mjs +3 -3
- package/plugins/FloorplanPlugin/utils/fiveModelLoad.js +3 -3
- package/plugins/FloorplanPlugin/utils/fiveModelLoad.mjs +3 -3
- package/plugins/FloorplanPlugin/utils/formatData.js +3 -3
- package/plugins/FloorplanPlugin/utils/formatData.mjs +3 -3
- package/plugins/FloorplanPlugin/utils/formatFloorplanJson.js +3 -3
- package/plugins/FloorplanPlugin/utils/formatFloorplanJson.mjs +3 -3
- package/plugins/FloorplanPlugin/utils/formatPosition.js +3 -3
- package/plugins/FloorplanPlugin/utils/formatPosition.mjs +3 -3
- package/plugins/FloorplanPlugin/utils/getDistanceFromModel.js +3 -3
- package/plugins/FloorplanPlugin/utils/getDistanceFromModel.mjs +3 -3
- package/plugins/FloorplanPlugin/utils/getPxmm.js +3 -3
- package/plugins/FloorplanPlugin/utils/getPxmm.mjs +3 -3
- package/plugins/FloorplanPlugin/utils/isTruelyObject.js +3 -3
- package/plugins/FloorplanPlugin/utils/isTruelyObject.mjs +3 -3
- package/plugins/FloorplanPlugin/utils/nearlyEqual.js +3 -3
- package/plugins/FloorplanPlugin/utils/nearlyEqual.mjs +3 -3
- package/plugins/FloorplanPlugin/utils/polylabel.js +3 -3
- package/plugins/FloorplanPlugin/utils/polylabel.mjs +3 -3
- package/plugins/FloorplanPlugin/utils/to.js +3 -3
- package/plugins/FloorplanPlugin/utils/to.mjs +3 -3
- package/plugins/GaussianSplattingEntranceAnimationPlugin/Controller.d.ts +6 -0
- package/plugins/GaussianSplattingEntranceAnimationPlugin/Controller.js +3 -3
- package/plugins/GaussianSplattingEntranceAnimationPlugin/Controller.mjs +3 -3
- package/plugins/GaussianSplattingEntranceAnimationPlugin/index.js +3 -3
- package/plugins/GaussianSplattingEntranceAnimationPlugin/index.mjs +3 -3
- package/plugins/Object3DHelperPlugin/Controller.js +3 -3
- package/plugins/Object3DHelperPlugin/Controller.mjs +3 -3
- package/plugins/Object3DHelperPlugin/Controllers/BaseController.js +3 -3
- package/plugins/Object3DHelperPlugin/Controllers/BaseController.mjs +3 -3
- package/plugins/Object3DHelperPlugin/Controllers/BoundingBoxController.js +3 -3
- package/plugins/Object3DHelperPlugin/Controllers/BoundingBoxController.mjs +3 -3
- package/plugins/Object3DHelperPlugin/Controllers/MoveController.js +3 -3
- package/plugins/Object3DHelperPlugin/Controllers/MoveController.mjs +3 -3
- package/plugins/Object3DHelperPlugin/Controllers/RotateController.js +3 -3
- package/plugins/Object3DHelperPlugin/Controllers/RotateController.mjs +3 -3
- package/plugins/Object3DHelperPlugin/FiveControllerWrapper.js +3 -3
- package/plugins/Object3DHelperPlugin/FiveControllerWrapper.mjs +3 -3
- package/plugins/Object3DHelperPlugin/Helper/BaseHelper.js +3 -3
- package/plugins/Object3DHelperPlugin/Helper/BaseHelper.mjs +3 -3
- package/plugins/Object3DHelperPlugin/Helper/BoundingBoxHelper.js +3 -3
- package/plugins/Object3DHelperPlugin/Helper/BoundingBoxHelper.mjs +3 -3
- package/plugins/Object3DHelperPlugin/Helper/MoveHelper.js +3 -3
- package/plugins/Object3DHelperPlugin/Helper/MoveHelper.mjs +3 -3
- package/plugins/Object3DHelperPlugin/Helper/RotateHelper.js +3 -3
- package/plugins/Object3DHelperPlugin/Helper/RotateHelper.mjs +3 -3
- package/plugins/Object3DHelperPlugin/constant.js +3 -3
- package/plugins/Object3DHelperPlugin/constant.mjs +3 -3
- package/plugins/Object3DHelperPlugin/index.js +3 -3
- package/plugins/Object3DHelperPlugin/index.mjs +3 -3
- package/plugins/Object3DHelperPlugin/utils/ArrowGroup.js +3 -3
- package/plugins/Object3DHelperPlugin/utils/ArrowGroup.mjs +3 -3
- package/plugins/Object3DHelperPlugin/utils/CenterHandle.js +3 -3
- package/plugins/Object3DHelperPlugin/utils/CenterHandle.mjs +3 -3
- package/plugins/Object3DHelperPlugin/utils/PlaneHandle.js +3 -3
- package/plugins/Object3DHelperPlugin/utils/PlaneHandle.mjs +3 -3
- package/plugins/Object3DHelperPlugin/utils/calculateScaleByCamera.js +3 -3
- package/plugins/Object3DHelperPlugin/utils/calculateScaleByCamera.mjs +3 -3
- package/plugins/Object3DHelperPlugin/utils/cameraHooks.js +3 -3
- package/plugins/Object3DHelperPlugin/utils/cameraHooks.mjs +3 -3
- package/plugins/Object3DHelperPlugin/utils/direction.js +3 -3
- package/plugins/Object3DHelperPlugin/utils/direction.mjs +3 -3
- package/plugins/Object3DHelperPlugin/utils/getMouseRaycaster.js +3 -3
- package/plugins/Object3DHelperPlugin/utils/getMouseRaycaster.mjs +3 -3
- package/plugins/Object3DHelperPlugin/utils/getOrthographicCameraDirection.js +3 -3
- package/plugins/Object3DHelperPlugin/utils/getOrthographicCameraDirection.mjs +3 -3
- package/plugins/Object3DHelperPlugin/utils/setObjectQuaternion.js +3 -3
- package/plugins/Object3DHelperPlugin/utils/setObjectQuaternion.mjs +3 -3
- package/plugins/Object3DHelperPlugin/utils/solidGuide.js +3 -3
- package/plugins/Object3DHelperPlugin/utils/solidGuide.mjs +3 -3
- package/plugins/Object3DHelperPlugin/utils/tipsDom.js +3 -3
- package/plugins/Object3DHelperPlugin/utils/tipsDom.mjs +3 -3
- package/plugins/PanoAnimePlugin/Controller.js +3 -3
- package/plugins/PanoAnimePlugin/Controller.mjs +3 -3
- package/plugins/PanoAnimePlugin/index.js +3 -3
- package/plugins/PanoAnimePlugin/index.mjs +3 -3
- package/plugins/WordPassPlugin/Controller.js +3 -3
- package/plugins/WordPassPlugin/Controller.mjs +3 -3
- package/plugins/WordPassPlugin/hersheyFont.js +3 -3
- package/plugins/WordPassPlugin/hersheyFont.mjs +3 -3
- package/plugins/WordPassPlugin/index.js +3 -3
- package/plugins/WordPassPlugin/index.mjs +3 -3
- package/plugins/WordPassPlugin/textToStrokeOrderStrokes.js +4 -4
- package/plugins/WordPassPlugin/textToStrokeOrderStrokes.mjs +4 -4
- package/plugins/WordPassPlugin/word-pass.js +3 -3
- package/plugins/WordPassPlugin/word-pass.mjs +3 -3
- package/plugins/index.js +3 -3
- package/plugins/index.mjs +3 -3
- package/plugins/thirdParty/CSS2DRenderer.js +3 -3
- package/plugins/thirdParty/CSS2DRenderer.mjs +3 -3
- package/plugins/thirdParty/CSS3DRenderer.js +3 -3
- package/plugins/thirdParty/CSS3DRenderer.mjs +3 -3
- package/plugins/thirdParty/doctorstrange-model.js +75 -75
- package/plugins/thirdParty/doctorstrange-model.mjs +75 -75
- package/plugins/thirdParty/domevents.js +3 -3
- package/plugins/thirdParty/domevents.mjs +3 -3
- package/plugins/utils/absoluteUrl.js +3 -3
- package/plugins/utils/absoluteUrl.mjs +3 -3
- package/plugins/utils/calculatePath.js +3 -3
- package/plugins/utils/calculatePath.mjs +3 -3
- package/plugins/utils/clamp.js +3 -3
- package/plugins/utils/clamp.mjs +3 -3
- package/plugins/utils/uuid.js +3 -3
- package/plugins/utils/uuid.mjs +3 -3
- package/react/hooks/useFiveModelReadyState.d.ts +1 -1
- package/react/index.js +3 -3
- package/react/index.mjs +3 -644
- package/sticker/index.d.ts +7 -0
- package/sticker/index.js +46 -3
- package/sticker/index.mjs +43 -103
- package/umd/five-gltf-loader.js +3 -3
- package/umd/five-line.js +3 -3
- package/umd/five-plugins.js +3 -3
- package/umd/five-react.js +2 -2
- package/umd/five-sticker.js +46 -3
- package/umd/five-vfx.js +2 -2
- package/umd/five.js +216 -179
- package/vfx/index.js +3 -3
- package/vfx/index.mjs +3 -486
- package/work-downloader/index.js +3 -3
- package/work-downloader/index.mjs +3 -315
- package/docs/functions/index.loadAt3d.html +0 -1
- package/docs/functions/index.loadDome.html +0 -1
- package/docs/functions/index.loadDomez.html +0 -1
- package/docs/functions/index.loadGltf.html +0 -1
- package/docs/functions/index.loadPbm.html +0 -1
- package/docs/functions/index.loadPly.html +0 -1
- package/five/certificates/hardware.d.ts +0 -1
- package/five/gaussian-splatting/shStore.d.ts +0 -22
- package/five/thirdparty/jsrsasign.d.ts +0 -753
- package/five/work/keychain.d.ts +0 -5
- package/five/work/verify.d.ts +0 -7
- package/five/work/workVerify.d.ts +0 -2
- /package/five/{work/_ALLOW_HOST.d.ts → renderer/compute-renderers/shaders/composite-additive.d.ts} +0 -0
|
@@ -0,0 +1,338 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* @realsee/five-webgpu
|
|
4
|
+
* Generated: 2026/11/3
|
|
5
|
+
* Version: 1.0.0-alpha.14
|
|
6
|
+
* License:
|
|
7
|
+
* Realsee SDK License Agreement
|
|
8
|
+
|
|
9
|
+
* Last updated: 2026-09-22
|
|
10
|
+
|
|
11
|
+
* THIS LICENSE AGREEMENT BETWEEN YOU AND BEIKE REALSEE TECHNOLOGY (HK) LIMITED
|
|
12
|
+
* (“Realsee”) FORMS A LEGALLY BINDING CONTRACT BETWEEN YOU AND REALSEE IN RELATION
|
|
13
|
+
* TO YOUR USE OF THE SDK. This License Agreement accompanies the Realsee Software
|
|
14
|
+
* Development Kit(s) for the software and related explanatory materials (the
|
|
15
|
+
* "SDK") and includes any upgrades, modified versions, updates, additions, and
|
|
16
|
+
* copies of the SDK licensed to You by Realsee.
|
|
17
|
+
|
|
18
|
+
* BY DOWNLOADING, INSTALLING, OR OTHERWISE ACCESSING OR USING THE SDK, YOU AGREE
|
|
19
|
+
* THAT YOU HAVE READ, UNDERSTOOD, AND AGREE TO BE BOUND BY THIS AGREEMENT. YOU ARE
|
|
20
|
+
* AGREEING ON YOUR OWN BEHALF AND/OR ON BEHALF OF YOUR COMPANY OR ORGANIZATION TO
|
|
21
|
+
* THE TERMS AND CONDITIONS STATED BELOW.
|
|
22
|
+
|
|
23
|
+
* This Agreement applies to Your use of the SDK in the country in which You
|
|
24
|
+
* legally install it (“Territory”) and is subject to the laws of such Territory
|
|
25
|
+
* and further subject to Section 12 below. Different terms, conditions, and
|
|
26
|
+
* limitations may apply to the use of the SDK in any additional countries.
|
|
27
|
+
|
|
28
|
+
* 1. DEFINITIONS.
|
|
29
|
+
|
|
30
|
+
* “Agreement” means this Realsee SDK License Agreement.
|
|
31
|
+
|
|
32
|
+
* “Developer”, “You” and “Your” means the person(s) or entity acquiring or using
|
|
33
|
+
* the SDK or otherwise exercising rights under the terms of this Agreement.
|
|
34
|
+
|
|
35
|
+
* “Documentation” means the technical or other specifications or documentation
|
|
36
|
+
* that Realsee may provide to You for use in connection with the SDK.
|
|
37
|
+
|
|
38
|
+
* “Integrated Product” means any software, website, or on-line service developed
|
|
39
|
+
* by You based on or using the SDK (collectively, the “Integrated Product”).
|
|
40
|
+
|
|
41
|
+
* “Intellectual Property” means any patents, patent rights, trademarks, service
|
|
42
|
+
* marks, registered and unregistered designs, applications for any of the
|
|
43
|
+
* foregoing, copyright, and any other similar protected rights in any country and
|
|
44
|
+
* to the extent recognised by any relevant jurisdiction as intellectual property,
|
|
45
|
+
* trade secrets, know-how and confidential information. Realsee reserves all
|
|
46
|
+
* rights not expressly granted to You.
|
|
47
|
+
|
|
48
|
+
* “Realsee” means [Beike Realsee Technology (HK) Limited, a company incorporated
|
|
49
|
+
* and validly existing under the laws of Hong Kong].
|
|
50
|
+
|
|
51
|
+
* “SDK” means the Realsee-proprietary Software Development Kits (SDK) provided
|
|
52
|
+
* hereunder, includes all development tools (including any compiler and debugger),
|
|
53
|
+
* application programming interfaces (“APIs”), libraries, binary utilities, header
|
|
54
|
+
* files, Documentation, content, data, code samples, and other materials provided
|
|
55
|
+
* to You in connection with this Agreement, whether delivered through a download,
|
|
56
|
+
* or any other media or form, and is licensed, not sold, to You by Realsee for use
|
|
57
|
+
* only under the terms of this Agreement. The terms of this Agreement will govern
|
|
58
|
+
* any updates provided by Realsee that replace and/or supplement the original SDK
|
|
59
|
+
* delivered to You, unless such update is accompanied by a separate license, in
|
|
60
|
+
* which case the terms of such license will govern.
|
|
61
|
+
|
|
62
|
+
* “Term” means the period commencing on the date You first download, install,
|
|
63
|
+
* access, or use the SDK, and continuing until this Agreement is terminated in
|
|
64
|
+
* accordance with Section 6.
|
|
65
|
+
|
|
66
|
+
* 2. LICENSED USES AND RESTRICTIONS.
|
|
67
|
+
|
|
68
|
+
* 2.1 Subject to the restrictions contained in this Section 2, Realsee grants to
|
|
69
|
+
* You during the Term, a limited, non-exclusive, revocable, non-sublicensable,
|
|
70
|
+
* non-transferable license to install, use, and integrate the SDK within the
|
|
71
|
+
* Territory only for the purpose of developing, testing, operating and supporting
|
|
72
|
+
* Integrated Products.
|
|
73
|
+
|
|
74
|
+
* 2.2 Restrictions. You acknowledge and agree that, You shall not, and shall
|
|
75
|
+
* ensure that Your affiliates, employees, agents, representatives, officers, and
|
|
76
|
+
* subcontractors do not (directly or indirectly):
|
|
77
|
+
|
|
78
|
+
* 2.2.1 decompile, reverse engineer, disassemble or attempt to derive the source
|
|
79
|
+
* code of, those components of the SDK provided in object code form, or any part
|
|
80
|
+
* thereof;
|
|
81
|
+
|
|
82
|
+
* 2.2.2 remove, alter, or obscure any copyright notice or other proprietary rights
|
|
83
|
+
* notice on any part of the SDK;
|
|
84
|
+
|
|
85
|
+
* 2.2.3 sell, assign, pledge, rent, lease, lend, upload to or host on any website
|
|
86
|
+
* or server for use by any third party except You, redistribute, or sublicense the
|
|
87
|
+
* SDK (or any part thereof), or operate the SDK (or any part thereof) in the
|
|
88
|
+
* capacity of a service bureau or other hosted services provider, in whole or in
|
|
89
|
+
* part, nor may You enable others to do so;
|
|
90
|
+
|
|
91
|
+
* 2.2.4 alter, modify, customize or improve the SDK, or any part thereof;
|
|
92
|
+
|
|
93
|
+
* 2.2.5 use the SDK (or any part thereof) for any illegal purpose, in any manner
|
|
94
|
+
* that is inconsistent with the terms of this Agreement, or to engage in any
|
|
95
|
+
* illegal activity;
|
|
96
|
+
|
|
97
|
+
* 2.2.6 use the SDK (or any part thereof) in any manner that may damage the
|
|
98
|
+
* operation of Realsee’s products or services; or
|
|
99
|
+
|
|
100
|
+
* 2.2.7 use the SDK or any non-public information provided by Realsee for the
|
|
101
|
+
* primary purpose of developing products or services that substantially replicate
|
|
102
|
+
* the core functionality of Realsee proprietary SDK offerings;
|
|
103
|
+
|
|
104
|
+
* 2.2.8 distribute, re-sell, or make available the SDK (or any part thereof) as a
|
|
105
|
+
* standalone product, library, or development toolkit to any third party.
|
|
106
|
+
|
|
107
|
+
* 2.3 Realsee has the right to impose reasonable conditions such as a reasonable
|
|
108
|
+
* fee for use of the SDK in Integrated Product in the future.
|
|
109
|
+
|
|
110
|
+
* 2.4 You may make a limited number of copies of the SDK to be used by Your
|
|
111
|
+
* employees or consultants as provided herein, and not for general business
|
|
112
|
+
* purposes, and such employees or consultants shall be subject to the obligations
|
|
113
|
+
* and restrictions in this Agreement.
|
|
114
|
+
|
|
115
|
+
* 2.5 All licenses not expressly granted in this Agreement are reserved and no
|
|
116
|
+
* other licenses, immunity, or rights, express or implied, are granted by Realsee,
|
|
117
|
+
* by implication, estoppel, or otherwise.
|
|
118
|
+
|
|
119
|
+
* 3. CONFIDENTIALITY.
|
|
120
|
+
|
|
121
|
+
* The SDK and all source code, Documentation, specifications, engineering details,
|
|
122
|
+
* and related information pertaining to the SDK, whether in oral, written,
|
|
123
|
+
* graphic, or electronic form, are and shall remain the confidential and
|
|
124
|
+
* proprietary information of Realsee or its licensors (collectively, the
|
|
125
|
+
* “Confidential Information”). You shall (i) disclose Confidential Information to
|
|
126
|
+
* only those directors and employees (collectively, “Affiliates”) whose duties
|
|
127
|
+
* justify their need to know such information and who have been clearly informed
|
|
128
|
+
* of their obligation to maintain the confidential, proprietary, and/or trade
|
|
129
|
+
* secret status of such Confidential Information; and (ii) use Confidential
|
|
130
|
+
* Information solely in accordance with the license granted hereunder. In any
|
|
131
|
+
* event, You and Your Affiliates shall treat Confidential Information as strictly
|
|
132
|
+
* confidential and shall use the same care to prevent disclosure of such
|
|
133
|
+
* information as You use with respect to Your own similar confidential and/or
|
|
134
|
+
* proprietary information, which shall not be less than the care a reasonable
|
|
135
|
+
* person would use under similar circumstances. All Confidential Information, and
|
|
136
|
+
* any copies thereof, shall be returned promptly to Realsee upon request. You
|
|
137
|
+
* shall ensure that Your Affiliates comply with the provisions of this Section 3,
|
|
138
|
+
* and You shall be liable for any breach of this Section 3 resulting from the act
|
|
139
|
+
* or omission of any of Your Affiliates. You shall not disclose Confidential
|
|
140
|
+
* Information to any third party, including, without limitation, any of Your
|
|
141
|
+
* subcontractors.
|
|
142
|
+
|
|
143
|
+
* 4. PROPRIETARY RIGHTS.
|
|
144
|
+
|
|
145
|
+
* 4.1 As between You and Realsee, Realsee and/or its licensors retain ownership of
|
|
146
|
+
* all right, title, and interest in, to, and under the SDK, including, without
|
|
147
|
+
* limitation, all patents, copyrights, trade secrets, trademarks and other
|
|
148
|
+
* intellectual property and other proprietary rights therein, and reserve all
|
|
149
|
+
* rights not expressly granted to You.
|
|
150
|
+
|
|
151
|
+
* 4.2 The items contained in the SDK are the intellectual property of Realsee and
|
|
152
|
+
* its licensors and are protected by PRC copyright and patent law, international
|
|
153
|
+
* treaty provisions and applicable laws of the country in which it is being used.
|
|
154
|
+
* You agree to protect all copyright and other ownership interests of Realsee
|
|
155
|
+
* and/or its licensors in all items in the SDK supplied under this License
|
|
156
|
+
* Agreement. You agree that all copies of the items in the SDK, reproduced for any
|
|
157
|
+
* reason by You, contain the same copyright notices, and other proprietary notices
|
|
158
|
+
* as appropriate, as appear on or in the original items delivered by Realsee in
|
|
159
|
+
* the SDK. Realsee and/or its licensors retain title and ownership of the items in
|
|
160
|
+
* the SDK, the media on which it is loaded, and all subsequent copies, regardless
|
|
161
|
+
* of the form or media in or on which the original and other copies may exist.
|
|
162
|
+
* Except as stated above, this Agreement does not grant You any rights to patents,
|
|
163
|
+
* copyrights, trade secrets, trademarks or any other rights in respect to the
|
|
164
|
+
* items in the SDK.
|
|
165
|
+
|
|
166
|
+
* 5. DATA PRIVACY AND PROTECTION
|
|
167
|
+
|
|
168
|
+
* 5.1 In connection with Your use of the SDK and any Integrated Product, You shall
|
|
169
|
+
* comply with all applicable privacy, data protection, cybersecurity, and
|
|
170
|
+
* cross-border data transfer laws and regulations. To the extent Your use of the
|
|
171
|
+
* SDK involves the collection, processing, transmission, disclosure, or storage of
|
|
172
|
+
* personal data or personal information, You shall be solely responsible for: (i)
|
|
173
|
+
* ensuring that You have a valid legal basis for such processing; (ii) providing
|
|
174
|
+
* all required notices and obtaining all necessary consents or authorisations; and
|
|
175
|
+
* (iii) implementing reasonable and appropriate technical and organisational
|
|
176
|
+
* measures to protect such data against unauthorised access, use, disclosure,
|
|
177
|
+
* alteration, or destruction.
|
|
178
|
+
|
|
179
|
+
* 5.2 You shall promptly notify Realsee of any material security incident relating
|
|
180
|
+
* to the SDK or Integrated Product that may materially affect Realsee, the SDK, or
|
|
181
|
+
* any personal data processed in connection with the SDK.
|
|
182
|
+
|
|
183
|
+
* 5.3 Developer shall be solely responsible for Developer’s compliance with
|
|
184
|
+
* applicable privacy, data protection, and cybersecurity laws in connection with
|
|
185
|
+
* the Integrated Product.
|
|
186
|
+
|
|
187
|
+
* 6. TERM AND TERMINATION.
|
|
188
|
+
|
|
189
|
+
* 6.1 This Agreement is effective until terminated. Realsee has the right to
|
|
190
|
+
* terminate this Agreement immediately, without judicial intervention, if You fail
|
|
191
|
+
* to comply with any term herein. Upon any such termination You must remove all
|
|
192
|
+
* full and partial copies of the items in the SDK from Your computer and
|
|
193
|
+
* discontinue the use of the items in the SDK.
|
|
194
|
+
|
|
195
|
+
* 6.2 Realsee may at any time, terminate the Agreement with You if: (A) You have
|
|
196
|
+
* breached any provision of the Agreement; or (B) Realsee is required to do so by
|
|
197
|
+
* law; or (C) Realsee decides to no longer provide the SDK or certain parts of the
|
|
198
|
+
* SDK to users in the country in which You are resident or from which You use the
|
|
199
|
+
* service, or the provision of the SDK or certain SDK services to You by Realsee
|
|
200
|
+
* is, in Realsee's sole discretion, no longer legally or commercially viable.
|
|
201
|
+
|
|
202
|
+
* 6.3 When the Agreement comes to an end, all of the legal rights, obligations and
|
|
203
|
+
* liabilities that You and Realsee have benefited from, been subject to (or which
|
|
204
|
+
* have accrued over time whilst the Agreement has been in force) or which are
|
|
205
|
+
* expressed to continue indefinitely, shall be unaffected by this cessation, and
|
|
206
|
+
* the provisions of Sections 3, 4, 5, 7, 8, 9, 10, and 11 shall continue to apply
|
|
207
|
+
* to such rights, obligations and liabilities indefinitely.
|
|
208
|
+
|
|
209
|
+
* 7. DISCLAIMER OF WARRANTY.
|
|
210
|
+
|
|
211
|
+
* YOU EXPRESSLY ACKNOWLEDGE AND AGREE THAT, TO THE EXTENT PERMITTED BY APPLICABLE
|
|
212
|
+
* LAW, USE OF THE SDK (OR ANY PART THEREOF) IS AT YOUR SOLE RISK AND THAT THE
|
|
213
|
+
* ENTIRE RISK AS TO SATISFACTORY QUALITY, PERFORMANCE, ACCURACY, AND EFFORT IS
|
|
214
|
+
* WITH YOU. REALSEE LICENSES THE SDK TO YOU ONLY ON AN "AS-IS" BASIS. REALSEE
|
|
215
|
+
* MAKES NO REPRESENTATION WITH RESPECT TO THE ADEQUACY OF ANY ITEMS IN THE SDK,
|
|
216
|
+
* WHETHER OR NOT USED BY YOU IN THE DEVELOPMENT OF INTEGRATED PRODUCT, FOR ANY
|
|
217
|
+
* PARTICULAR PURPOSE OR WITH RESPECT TO THEIR ADEQUACY TO PRODUCE ANY PARTICULAR
|
|
218
|
+
* RESULT. REALSEE AND ITS LICENSORS SHALL NOT BE LIABLE FOR LOSS OR DAMAGE ARISING
|
|
219
|
+
* OUT OF THIS AGREEMENT OR FROM THE DISTRIBUTION OR USE OF INTEGRATED PRODUCT
|
|
220
|
+
* CONTAINING PORTIONS OF THE SDK. REALSEE AND ITS LICENSORS DISCLAIM ALL
|
|
221
|
+
* WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO IMPLIED
|
|
222
|
+
* CONDITIONS OR WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
|
223
|
+
* OR NONINFRINGEMENT OF ANY THIRD PARTY RIGHT IN RESPECT OF THE ITEMS IN THE SDK
|
|
224
|
+
* OR ANY SERVICES RELATED TO THE SDK.
|
|
225
|
+
|
|
226
|
+
* REALSEE IS UNDER NO OBLIGATION TO PROVIDE ANY SUPPORT UNDER THIS LICENSE
|
|
227
|
+
* AGREEMENT, INCLUDING UPGRADES OR FUTURE VERSIONS OF THE SDK OR ANY PORTIONS
|
|
228
|
+
* THEREOF, TO YOU, END USER OR TO ANY OTHER PARTY.
|
|
229
|
+
|
|
230
|
+
* 8. LIMITATION OF LIABILITY.
|
|
231
|
+
|
|
232
|
+
* TO THE EXTENT NOT PROHIBITED BY APPLICABLE LAW, IN NO EVENT WILL REALSEE OR ITS
|
|
233
|
+
* LICENSORS BE LIABLE FOR ANY DIRECT, INCIDENTAL, SPECIAL, INDIRECT, OR
|
|
234
|
+
* CONSEQUENTIAL DAMAGES, INCLUDING, WITHOUT LIMITATION, DAMAGES FOR LOSS OF USE,
|
|
235
|
+
* LOSS OF BUSINESS, REVENUE, OR PROFITS, LOSS OF OPPORTUNITY (WHETHER DIRECT OR
|
|
236
|
+
* INDIRECT), CORRUPTION OR LOSS OF DATA, LOSS OF REPUTATION OR SAVINGS, DOWNTIME,
|
|
237
|
+
* OR DAMAGE TO, LOSS OF OR REPLACEMENT OF DATA OR TRANSACTIONS, COST OF
|
|
238
|
+
* PROCUREMENT OF SUBSTITUTE SERVICES, BUSINESS INTERRUPTION, OR ANY OTHER
|
|
239
|
+
* COMMERCIAL DAMAGES OR LOSSES, ARISING OUT OF OR RELATED TO YOUR USE OR INABILITY
|
|
240
|
+
* TO USE THE SDK (OR ANY PART THEREOF), ANY INTEGRATED PRODUCT, OR ANY THIRD PARTY
|
|
241
|
+
* SOFTWARE, APPLICATIONS, OR SERVICES IN CONJUNCTION WITH THE SDK (OR ANY PART
|
|
242
|
+
* THEREOF), HOWEVER CAUSED, REGARDLESS OF THE THEORY OF LIABILITY (CONTRACT, TORT,
|
|
243
|
+
* OR OTHERWISE) AND EVEN IF REALSEE HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
|
|
244
|
+
* DAMAGES. IN NO EVENT WILL REALSEE’S TOTAL LIABILITY TO YOU FOR ALL DAMAGES
|
|
245
|
+
* EXCEED ONE HUNDRED DOLLARS ($100.00). THE FOREGOING LIMITATIONS WILL APPLY EVEN
|
|
246
|
+
* IF THE ABOVE STATED REMEDY FAILS OF ITS ESSENTIAL PURPOSE. THE LIMITATIONS
|
|
247
|
+
* CONTAINED IN SECTION 7 AND THIS SECTION 8 ARE A FUNDAMENTAL PART OF THE BASIS OF
|
|
248
|
+
* REALSEE’S BARGAIN HEREUNDER, AND REALSEE WOULD NOT ENTER INTO THIS AGREEMENT OR
|
|
249
|
+
* PROVIDE YOU WITH ACCESS TO THE SDK ABSENT SUCH LIMITATIONS.
|
|
250
|
+
|
|
251
|
+
* 9. INDEMNIFICATION.
|
|
252
|
+
|
|
253
|
+
* To the extent permitted by applicable law, You agree to indemnify, defend and
|
|
254
|
+
* hold harmless Realsee, its affiliates and each of their directors, officers,
|
|
255
|
+
* employees, independent contractors, and agents (each a “Realsee Indemnified
|
|
256
|
+
* Party”) from any and all claims, losses, liabilities, damages, expenses, and
|
|
257
|
+
* costs (including without limitation attorneys’ fees and court costs) incurred by
|
|
258
|
+
* a Realsee Indemnified Party as a result of: (i) Your non-compliance with any
|
|
259
|
+
* terms of this Agreement; (ii) Your use of the SDK (or any part thereof); or
|
|
260
|
+
* (iii) Your use of any Integrated Product, including any claim that Integrated
|
|
261
|
+
* Product infringes the copyright, trademark, trade secret or other intellectual
|
|
262
|
+
* property right of a third party.
|
|
263
|
+
|
|
264
|
+
* 10. ACKNOWLEDGEMENTS.
|
|
265
|
+
|
|
266
|
+
* Portions of the SDK may utilize or include third party software and other
|
|
267
|
+
* copyrighted material. Acknowledgments, licensing terms, and disclaimers for such
|
|
268
|
+
* material are contained in Documentation for the SDK or may otherwise accompany
|
|
269
|
+
* such material, and Your use of such materials governed by their respective
|
|
270
|
+
* terms. In the event of conflict between the terms of this Agreement and an
|
|
271
|
+
* applicable open source or third party agreement, the open source or third party
|
|
272
|
+
* agreement will control solely with respect to the open source software or third
|
|
273
|
+
* party software. Moreover, You shall not subject any items (including not limited
|
|
274
|
+
* to source code, object code, and any software) included in the SDK to any open
|
|
275
|
+
* source license.
|
|
276
|
+
|
|
277
|
+
* 11. NON-BLOCKING OF REALSEE DEVELOPMENT.
|
|
278
|
+
|
|
279
|
+
* You acknowledge that Realsee is currently developing or may develop technologies
|
|
280
|
+
* and products in the future that have or may have design and/or functionality
|
|
281
|
+
* similar to Integrated Product that You may develop based on Your license herein.
|
|
282
|
+
* Nothing in this Agreement shall impair, limit or curtail Realsee's right to
|
|
283
|
+
* continue with its development, maintenance and/or distribution of Realsee's
|
|
284
|
+
* technology or products.
|
|
285
|
+
|
|
286
|
+
* 12. GENERAL.
|
|
287
|
+
|
|
288
|
+
* 12.1 Export Control. You may not use or otherwise export or re-export the SDK
|
|
289
|
+
* (or any part thereof) except as authorized by United States law and the laws of
|
|
290
|
+
* the jurisdiction(s) in which the SDK (or any part thereof) was obtained. In
|
|
291
|
+
* particular, but without limitation, the SDK may not be exported or re-exported
|
|
292
|
+
* (i) into any U.S. embargoed countries or (ii) to anyone on the U.S. Treasury
|
|
293
|
+
* Department's list of Specially Designated Nationals or the U.S. Department of
|
|
294
|
+
* Commerce Denied Person's List or Entity List. By using the SDK (or any part
|
|
295
|
+
* thereof), You represent and warrant that You are not located in any such country
|
|
296
|
+
* or on any such list.
|
|
297
|
+
|
|
298
|
+
* 12.2 Governing Law and Dispute Resolution.
|
|
299
|
+
|
|
300
|
+
* This Agreement shall be governed by the laws of the Hong Kong Special
|
|
301
|
+
* Administrative Region of the People's Republic of China, without regard to its
|
|
302
|
+
* conflict of laws principles. Any dispute arising out of or in connection with
|
|
303
|
+
* this Agreement, including its existence, validity, interpretation, performance,
|
|
304
|
+
* breach, or termination, shall first be submitted to thirty (30) days of good
|
|
305
|
+
* faith consultation, and if unresolved, to final and binding arbitration
|
|
306
|
+
* administered by the HKIAC in Hong Kong in English under the HKIAC Administered
|
|
307
|
+
* Arbitration Rules in force at the time of submission, with one (1) arbitrator
|
|
308
|
+
* unless the amount in dispute exceeds USD 1,000,000, in which case three (3)
|
|
309
|
+
* arbitrators shall be appointed. Either party may seek interim or injunctive
|
|
310
|
+
* relief from any court of competent jurisdiction notwithstanding the foregoing.
|
|
311
|
+
|
|
312
|
+
* 12.3 Severability. If any provision of this Agreement is held by a court of
|
|
313
|
+
* competent jurisdiction to be unenforceable for any reason, the remaining
|
|
314
|
+
* provisions hereof will be unaffected and remain in full force and effect.
|
|
315
|
+
|
|
316
|
+
* 12.4 Modifications. Realsee reserves the right, from time to time, with or
|
|
317
|
+
* without notice to You, to make revisions to this Agreement in our sole and
|
|
318
|
+
* absolute discretion. The most current version of this Agreement will supersede
|
|
319
|
+
* all previous versions and shall be made available on the website where the SDK
|
|
320
|
+
* is made available, or by such other means as Realsee may determine in its
|
|
321
|
+
* discretion. Any modified versions of this Agreement hereto shall take effect
|
|
322
|
+
* from the time that it is made available. You shall be responsible for regularly
|
|
323
|
+
* checking for notice of any such modifications. You agree that Your continued use
|
|
324
|
+
* of the SDK constitutes Your agreement to the modified Agreement.
|
|
325
|
+
|
|
326
|
+
* 12.5 Relationship of the Parties. This Agreement will not be construed as
|
|
327
|
+
* creating an agency, partnership, joint venture, fiduciary duty, or any other
|
|
328
|
+
* form of legal association between You and Realsee, and You will not represent to
|
|
329
|
+
* the contrary, whether expressly, by implication, appearance, or otherwise.
|
|
330
|
+
|
|
331
|
+
* 12.6 Entire Agreement; Governing Language. This Agreement constitutes the entire
|
|
332
|
+
* agreement between You and Realsee with respect to the use of the SDK licensed
|
|
333
|
+
* hereunder and supersedes all prior understandings regarding such subject matter.
|
|
334
|
+
* No amendment to or modification of this Agreement will be binding unless in
|
|
335
|
+
* writing and signed by Realsee. You and Realsee hereto confirm that this
|
|
336
|
+
* Agreement and all related documents shall be drafted in English.
|
|
337
|
+
|
|
338
|
+
*/const require_pbmGaussianSplattingObject=require("./pbmGaussianSplattingObject.js"),require_pbmMeshMaterial=require("./pbmMeshMaterial.js"),require_memoryUsage=require("./memoryUsage.js"),require_imageBitmap=require("./imageBitmap.js"),require_fflate=require("./fflate.js");let three_webgpu=require("three/webgpu");three_webgpu=require_pbmGaussianSplattingObject._(three_webgpu,1);function loadFbx(url,options={}){var _a,_b,_c;let upAxis=(_a=options.upAxis)==null?`Z`:_a,fetcher=(_b=options.fetcher)==null?require_memoryUsage.u:_b,onDownloadProgress=(_c=options.onDownloadProgress)==null?require_memoryUsage.d:_c,byteLength=0;return Promise.resolve().then(()=>fetcher.ajax(url,{responseType:`arraybuffer`},void 0,void 0,onDownloadProgress).then(response=>(byteLength=response.body.byteLength,response.body))).then(arrayBuffer=>{var _a;return parse(arrayBuffer,{light:options.light,resourcePath:url.slice(0,url.lastIndexOf(`/`)+1),search:(_a=url.split(`?`)[1])==null?``:_a,fetcher})}).then(result=>{let node=result.scene,scale=result.unitScale/100,contentTransform=new three_webgpu.Matrix4;if(contentTransform.makeScale(scale,scale,scale),result.upAxis===`X`)throw Error(`Cannot load fbx x upAxis`);return result.upAxis===`Y`&&contentTransform.premultiply(require_memoryUsage.r),upAxis===`Y`&&contentTransform.premultiply(require_memoryUsage.i),node.applyMatrix4(contentTransform),{type:`fbx`,modelUpAxis:result.upAxis,upAxis,uri:url,byteLength,memoryUsage:require_memoryUsage.n(node),scene:node,textures:result.textures,animations:result.animations,dispose:()=>result.dispose()}})}function parse(FBXBuffer,options){let fbxTree;if(isFbxFormatBinary(FBXBuffer))fbxTree=new BinaryParser().parse(FBXBuffer);else{let FBXText=convertArrayBufferToString(FBXBuffer);if(!isFbxFormatASCII(FBXText))throw Error(`THREE.FBXLoader: Unknown format.`);if(getFbxVersion(FBXText)<7e3)throw Error(`THREE.FBXLoader: FBX version not supported, FileVersion: `+getFbxVersion(FBXText));fbxTree=new TextParser().parse(FBXText)}return new FBXTreeParser(options).parse(fbxTree)}var FBXTreeParser=class{constructor(options){var _a,_b,_c;this.light=(_a=options.light)==null?!0:_a,this.resourcePath=(_b=options.resourcePath)==null?``:_b,this.search=(_c=options.search)==null?``:_c,this.fetcher=options.fetcher}parse(fbxTree){var _a,_b,_c,_d,_e,_f;let connections=this.parseConnections(fbxTree),sceneGraph=Object.assign(new three_webgpu.Group,{animations:[]}),texturePromises=[],images=this.parseImages(fbxTree),textures=this.parseTextures(fbxTree,images,connections,texturePromises),materials=this.parseMaterials(fbxTree,textures,connections),deformers=this.parseDeformers(fbxTree,connections),geometryMap=new GeometryParser().parse(fbxTree,deformers,connections);this.parseScene(fbxTree,deformers,geometryMap,materials,connections,sceneGraph);let upAxis=(_b=(_a=fbxTree.GlobalSettings.UpAxis)==null?void 0:_a.value)==null?1:_b,frontAxis=(_d=(_c=fbxTree.GlobalSettings.FrontAxis)==null?void 0:_c.value)==null?2:_d,unitScale=(_f=(_e=fbxTree.GlobalSettings.UnitScaleFactor)==null?void 0:_e.value)==null?1:_f,ambientLight;if(fbxTree.GlobalSettings.AmbientColor){let ambientColor=fbxTree.GlobalSettings.AmbientColor.value,r=ambientColor[0],g=ambientColor[1],b=ambientColor[2];if(r!==0||g!==0||b!==0){let color=new three_webgpu.Color().setRGB(r,g,b);ambientLight=new three_webgpu.AmbientLight(color,1)}}return Promise.all(texturePromises).then(textures=>{var _a;return{scene:sceneGraph,textures,ambientLight,upAxis:[`X`,`Y`,`Z`][upAxis],frontAxis:[`X`,`Y`,`Z`][frontAxis],unitScale,animations:(_a=sceneGraph.animations)==null?[]:_a,dispose:()=>{textures.forEach(texture=>texture.dispose()),materials.forEach(material=>material.dispose()),geometryMap.forEach(geometry=>geometry.dispose())}}})}parseConnections(fbxTree){let connectionMap=new Map;return`Connections`in fbxTree&&fbxTree.Connections.connections.forEach(function(rawConnection){let fromID=rawConnection[0],toID=rawConnection[1],relationship=rawConnection[2];connectionMap.has(fromID)||connectionMap.set(fromID,{parents:[],children:[]});let parentRelationship={ID:toID,relationship};connectionMap.get(fromID).parents.push(parentRelationship),connectionMap.has(toID)||connectionMap.set(toID,{parents:[],children:[]});let childRelationship={ID:fromID,relationship};connectionMap.get(toID).children.push(childRelationship)}),connectionMap}parseImages(fbxTree){let images={},blobs={};if(`Video`in fbxTree.Objects){let videoNodes=fbxTree.Objects.Video;for(let nodeID in videoNodes){let videoNode=videoNodes[nodeID],id=parseInt(nodeID);if(images[id]=videoNode.RelativeFilename||videoNode.Filename,`Content`in videoNode){let arrayBufferContent=videoNode.Content instanceof ArrayBuffer&&videoNode.Content.byteLength>0,base64Content=typeof videoNode.Content==`string`&&videoNode.Content!==``;if(arrayBufferContent||base64Content){let image=this.parseImage(videoNodes[nodeID]);blobs[videoNode.RelativeFilename||videoNode.Filename]=image}}}}for(let id in images){let filename=images[id];blobs[filename]===void 0?images[id]=images[id].split(`\\`).pop():images[id]=blobs[filename]}return images}parseImage(videoNode){let content=videoNode.Content,fileName=videoNode.RelativeFilename||videoNode.Filename,extension=fileName.slice(fileName.lastIndexOf(`.`)+1).toLowerCase(),type;switch(extension){case`bmp`:type=`image/bmp`;break;case`jpg`:case`jpeg`:type=`image/jpeg`;break;case`png`:type=`image/png`;break;case`tif`:type=`image/tiff`;break;case`tga`:type=`image/tga`;break;default:return}if(typeof content==`string`)return`data:`+type+`;base64,`+content;{let array=new Uint8Array(content);return window.URL.createObjectURL(new Blob([array],{type}))}}parseTextures(fbxTree,images,connections,texturePromises){let textureMap=new Map;if(`Texture`in fbxTree.Objects){let textureNodes=fbxTree.Objects.Texture;for(let nodeID in textureNodes){let texture=this.parseTexture(textureNodes[nodeID],images,connections,texturePromises);textureMap.set(parseInt(nodeID),texture)}}return textureMap}parseTexture(textureNode,images,connections,texturePromises){let texture=this.loadTexture(textureNode,images,connections,texturePromises);texture.ID=textureNode.id,texture.name=textureNode.attrName;let wrapModeU=textureNode.WrapModeU,wrapModeV=textureNode.WrapModeV,valueU=wrapModeU===void 0?0:wrapModeU.value,valueV=wrapModeV===void 0?0:wrapModeV.value;if(texture.wrapS=valueU===0?three_webgpu.RepeatWrapping:three_webgpu.ClampToEdgeWrapping,texture.wrapT=valueV===0?three_webgpu.RepeatWrapping:three_webgpu.ClampToEdgeWrapping,textureNode.Scaling){let values=textureNode.Scaling.value;texture.repeat.x=values[0],texture.repeat.y=values[1]}if(textureNode.Translation){let values=textureNode.Translation.value;texture.offset.x=values[0],texture.offset.y=values[1]}return texture}loadTexture(textureNode,images,connections,texturePromises){let children=connections.get(textureNode.id).children,fileName=``;children!==void 0&&children.length>0&&images[children[0].ID]!==void 0&&(fileName=images[children[0].ID]),fileName=require_imageBitmap.p(this.resourcePath,require_imageBitmap.c(fileName,this.search));let texture=Object.assign(new three_webgpu.Texture,{ID:0}),promise;promise=require_imageBitmap.t()?this.fetcher.ajax(fileName,{responseType:`blob`}).then(response=>{let blob=response.body;return require_imageBitmap.n(blob)}):this.fetcher.loadImage(fileName,{},void 0,void 0,void 0,require_imageBitmap.r()).then(response=>response.body);let texturePromise=promise.then(image=>(texture.image=image,texture.needsUpdate=!0,texture)).catch(error=>(console.warn(error),texture));return texturePromises.push(texturePromise),texture}parseMaterials(fbxTree,textureMap,connectionMap){let materialMap=new Map;if(`Material`in fbxTree.Objects){let materialNodes=fbxTree.Objects.Material;for(let nodeID in materialNodes){let material=this.parseMaterial(fbxTree,materialNodes[nodeID],textureMap,connectionMap);material!==null&&materialMap.set(parseInt(nodeID),material)}}return materialMap}parseMaterial(fbxTree,materialNode,textureMap,connections){let ID=materialNode.id,name=materialNode.attrName,type=materialNode.ShadingModel;if(typeof type==`object`&&(type=type.value),type=type.toLowerCase(),!connections.has(ID))return null;let material=require_pbmMeshMaterial.a(this.light?`phong`:`basic`);material.name=name,materialNode.BumpFactor&&(material.bumpScale=materialNode.BumpFactor.value),materialNode.Diffuse?material.color=new three_webgpu.Color().fromArray(materialNode.Diffuse.value):materialNode.DiffuseColor&&(materialNode.DiffuseColor.type===`Color`||materialNode.DiffuseColor.type===`ColorRGB`)&&(material.color=new three_webgpu.Color().fromArray(materialNode.DiffuseColor.value)),materialNode.DisplacementFactor&&(material.displacementScale=materialNode.DisplacementFactor.value),materialNode.Emissive?material.emissive=new three_webgpu.Color().fromArray(materialNode.Emissive.value):materialNode.EmissiveColor&&(materialNode.EmissiveColor.type===`Color`||materialNode.EmissiveColor.type===`ColorRGB`)&&(material.emissive=new three_webgpu.Color().fromArray(materialNode.EmissiveColor.value)),materialNode.EmissiveFactor&&(material.emissiveIntensity=parseFloat(materialNode.EmissiveFactor.value));let opacity=1-(materialNode.TransparencyFactor?parseFloat(materialNode.TransparencyFactor.value):0);(opacity===1||opacity===0)&&(opacity=materialNode.Opacity?parseFloat(materialNode.Opacity.value):null,opacity===null&&(opacity=1-(materialNode.TransparentColor?parseFloat(materialNode.TransparentColor.value[0]):0))),material.opacity=opacity,material.opacity<1&&(material.transparent=!0),materialNode.ReflectionFactor&&(material.reflectivity=materialNode.ReflectionFactor.value),materialNode.Shininess&&(material.shininess=materialNode.Shininess.value),materialNode.Specular?material.specular=new three_webgpu.Color().fromArray(materialNode.Specular.value):materialNode.SpecularColor&&materialNode.SpecularColor.type===`Color`&&(material.specular=new three_webgpu.Color().fromArray(materialNode.SpecularColor.value));let scope=this;return connections.get(ID).children.forEach(function(child){let type=child.relationship;switch(type){case`Bump`:material.bumpMap=scope.getTexture(fbxTree,textureMap,child.ID,connections);break;case`Maya|TEX_ao_map`:material.aoMap=scope.getTexture(fbxTree,textureMap,child.ID,connections);break;case`DiffuseColor`:case`Maya|TEX_color_map`:material.map=scope.getTexture(fbxTree,textureMap,child.ID,connections),material.map!==void 0&&(material.map.colorSpace=three_webgpu.SRGBColorSpace);break;case`DisplacementColor`:material.displacementMap=scope.getTexture(fbxTree,textureMap,child.ID,connections);break;case`EmissiveColor`:material.emissiveMap=scope.getTexture(fbxTree,textureMap,child.ID,connections),material.emissiveMap!==void 0&&(material.emissiveMap.colorSpace=three_webgpu.SRGBColorSpace);break;case`NormalMap`:case`Maya|TEX_normal_map`:material.normalMap=scope.getTexture(fbxTree,textureMap,child.ID,connections);break;case`ReflectionColor`:material.envMap=scope.getTexture(fbxTree,textureMap,child.ID,connections),material.envMap!==void 0&&(material.envMap.mapping=three_webgpu.EquirectangularReflectionMapping,material.envMap.colorSpace=three_webgpu.SRGBColorSpace);break;case`SpecularColor`:material.specularMap=scope.getTexture(fbxTree,textureMap,child.ID,connections),material.specularMap!==void 0&&(material.specularMap.colorSpace=three_webgpu.SRGBColorSpace);break;case`TransparentColor`:case`TransparencyFactor`:material.alphaMap=scope.getTexture(fbxTree,textureMap,child.ID,connections),material.transparent=!0;break;default:console.warn(`THREE.FBXLoader: %s map is not supported in three.js, skipping texture.`,type);break}}),material}getTexture(fbxTree,textureMap,id,connections){return fbxTree.Objects.LayeredTexture&&id in fbxTree.Objects.LayeredTexture&&(console.warn(`THREE.FBXLoader: layered textures are not supported in three.js. Discarding all but first layer.`),id=connections.get(id).children[0].ID),textureMap.get(id)}parseDeformers(fbxTree,connections){let skeletons={},morphTargets={};if(`Deformer`in fbxTree.Objects){let DeformerNodes=fbxTree.Objects.Deformer;for(let nodeID in DeformerNodes){let deformerNode=DeformerNodes[nodeID],relationships=connections.get(parseInt(nodeID));if(deformerNode.attrType===`Skin`){let skeleton=this.parseSkeleton(relationships,DeformerNodes);skeleton.ID=nodeID,relationships.parents.length>1&&console.warn(`THREE.FBXLoader: skeleton attached to more than one geometry is not supported.`),skeleton.geometryID=relationships.parents[0].ID,skeletons[nodeID]=skeleton}else if(deformerNode.attrType===`BlendShape`){let morphTarget={id:nodeID};morphTarget.rawTargets=this.parseMorphTargets(relationships,DeformerNodes,connections),morphTarget.id=nodeID,relationships.parents.length>1&&console.warn(`THREE.FBXLoader: morph target attached to more than one geometry is not supported.`),morphTargets[nodeID]=morphTarget}}}return{skeletons,morphTargets}}parseSkeleton(relationships,deformerNodes){let rawBones=[];return relationships.children.forEach(function(child){let boneNode=deformerNodes[child.ID];if(boneNode.attrType!==`Cluster`)return;let rawBone={ID:child.ID,indices:[],weights:[],transformLink:new three_webgpu.Matrix4().fromArray(boneNode.TransformLink.a)};boneNode.Indexes&&(rawBone.indices=boneNode.Indexes.a,rawBone.weights=boneNode.Weights.a),rawBones.push(rawBone)}),{ID:``,geometryID:0,rawBones,bones:[]}}parseMorphTargets(relationships,deformerNodes,connections){let rawMorphTargets=[];for(let i=0;i<relationships.children.length;i++){let child=relationships.children[i],morphTargetNode=deformerNodes[child.ID],rawMorphTarget={name:morphTargetNode.attrName,initialWeight:morphTargetNode.DeformPercent,id:morphTargetNode.id,fullWeights:morphTargetNode.FullWeights.a,geoID:0};if(morphTargetNode.attrType!==`BlendShapeChannel`)return;rawMorphTarget.geoID=connections.get(parseInt(child.ID)).children.filter(function(child){return child.relationship===void 0})[0].ID,rawMorphTargets.push(rawMorphTarget)}return rawMorphTargets}parseScene(fbxTree,deformers,geometryMap,materialMap,connections,sceneGraph){let modelMap=this.parseModels(fbxTree,deformers.skeletons,geometryMap,materialMap,connections),modelNodes=fbxTree.Objects.Model,scope=this;modelMap.forEach(function(model){let modelNode=modelNodes[model.ID];scope.setLookAtProperties(fbxTree,model,modelNode,connections,sceneGraph),connections.get(model.ID).parents.forEach(function(connection){let parent=modelMap.get(connection.ID);parent!==void 0&&parent.add(model)}),model.parent===null&&sceneGraph.add(model)}),this.bindSkeleton(fbxTree,deformers.skeletons,geometryMap,modelMap,connections),sceneGraph.traverse(function(node){if(node.userData.transformData){node.parent&&(node.userData.transformData.parentMatrix=node.parent.matrix,node.userData.transformData.parentMatrixWorld=node.parent.matrixWorld);let transform=generateTransform(node.userData.transformData);node.applyMatrix4(transform),node.updateWorldMatrix(!0,!0)}});let animations=new AnimationParser().parse(fbxTree,connections,sceneGraph);sceneGraph.children.length===1&&sceneGraph.children[0]instanceof three_webgpu.Group&&(sceneGraph=sceneGraph.children[0]),sceneGraph.animations=animations}parseModels(fbxTree,skeletons,geometryMap,materialMap,connections){let modelMap=new Map,modelNodes=fbxTree.Objects.Model;for(let nodeID in modelNodes){let id=parseInt(nodeID),node=modelNodes[nodeID],relationships=connections.get(id),model=this.buildSkeleton(relationships,skeletons,id,node.attrName);if(!model){switch(node.attrType){case`Camera`:model=this.createCamera(fbxTree,relationships);break;case`Light`:model=this.createLight(fbxTree,relationships);break;case`Mesh`:model=this.createMesh(relationships,geometryMap,materialMap);break;case`NurbsCurve`:case`LimbNode`:case`Root`:model=new three_webgpu.Bone;break;default:model=new three_webgpu.Group;break}model.name=node.attrName?three_webgpu.PropertyBinding.sanitizeNodeName(node.attrName):``,model.userData.originalName=node.attrName,model.ID=id}this.getTransformData(model,node),modelMap.set(id,model)}return modelMap}buildSkeleton(relationships,skeletons,id,name){let bone=null;return relationships.parents.forEach(function(parent){for(let ID in skeletons){let skeleton=skeletons[ID];skeleton.rawBones.forEach(function(rawBone,i){if(rawBone.ID===parent.ID){let subBone=bone;bone=new three_webgpu.Bone,bone.matrixWorld.copy(rawBone.transformLink),bone.name=name?three_webgpu.PropertyBinding.sanitizeNodeName(name):``,bone.userData.originalName=name,bone.ID=id,skeleton.bones[i]=bone,subBone!==null&&bone.add(subBone)}})}}),bone}createCamera(fbxTree,relationships){let model,cameraAttribute;if(relationships.children.forEach(function(child){let attr=fbxTree.Objects.NodeAttribute[child.ID];attr!==void 0&&(cameraAttribute=attr)}),cameraAttribute===void 0)model=new three_webgpu.Object3D;else{let type=0;cameraAttribute.CameraProjectionType!==void 0&&cameraAttribute.CameraProjectionType.value===1&&(type=1);let nearClippingPlane=1;cameraAttribute.NearPlane!==void 0&&(nearClippingPlane=cameraAttribute.NearPlane.value/1e3);let farClippingPlane=1e3;cameraAttribute.FarPlane!==void 0&&(farClippingPlane=cameraAttribute.FarPlane.value/1e3);let width=window.innerWidth,height=window.innerHeight;cameraAttribute.AspectWidth!==void 0&&cameraAttribute.AspectHeight!==void 0&&(width=cameraAttribute.AspectWidth.value,height=cameraAttribute.AspectHeight.value);let aspect=width/height,fov=45;cameraAttribute.FieldOfView!==void 0&&(fov=cameraAttribute.FieldOfView.value);let focalLength=cameraAttribute.FocalLength?cameraAttribute.FocalLength.value:null;switch(type){case 0:model=new three_webgpu.PerspectiveCamera(fov,aspect,nearClippingPlane,farClippingPlane),focalLength!==null&&model.setFocalLength(focalLength);break;case 1:console.warn(`THREE.FBXLoader: Orthographic cameras not supported yet.`),model=new three_webgpu.Object3D;break;default:console.warn(`THREE.FBXLoader: Unknown camera type `+type+`.`),model=new three_webgpu.Object3D;break}}return model}createLight(fbxTree,relationships){let model,lightAttribute;if(relationships.children.forEach(function(child){let attr=fbxTree.Objects.NodeAttribute[child.ID];attr!==void 0&&(lightAttribute=attr)}),lightAttribute===void 0)model=new three_webgpu.Object3D;else{let type;type=lightAttribute.LightType===void 0?0:lightAttribute.LightType.value;let color=new three_webgpu.Color(16777215);lightAttribute.Color!==void 0&&(color=new three_webgpu.Color().fromArray(lightAttribute.Color.value));let intensity=lightAttribute.Intensity===void 0?1:lightAttribute.Intensity.value/100;lightAttribute.CastLightOnObject!==void 0&&lightAttribute.CastLightOnObject.value===0&&(intensity=0);let distance=0;switch(lightAttribute.FarAttenuationEnd!==void 0&&(distance=lightAttribute.EnableFarAttenuation!==void 0&&lightAttribute.EnableFarAttenuation.value===0?0:lightAttribute.FarAttenuationEnd.value),type){case 0:model=new three_webgpu.PointLight(color,intensity,distance,1);break;case 1:model=new three_webgpu.DirectionalLight(color,intensity);break;case 2:let angle=Math.PI/3;lightAttribute.InnerAngle!==void 0&&(angle=three_webgpu.MathUtils.degToRad(lightAttribute.InnerAngle.value));let penumbra=0;lightAttribute.OuterAngle!==void 0&&(penumbra=three_webgpu.MathUtils.degToRad(lightAttribute.OuterAngle.value),penumbra=Math.max(penumbra,1)),model=new three_webgpu.SpotLight(color,intensity,distance,angle,penumbra,1);break;default:console.warn(`THREE.FBXLoader: Unknown light type `+lightAttribute.LightType.value+`, defaulting to a PointLight.`),model=new three_webgpu.PointLight(color,intensity);break}lightAttribute.CastShadows!==void 0&&lightAttribute.CastShadows.value===1&&(model.castShadow=!0)}return model}createMesh(relationships,geometryMap,materialMap){let model,geometry=null,materials=[];if(relationships.children.forEach(function(child){geometryMap.has(child.ID)&&(geometry=geometryMap.get(child.ID)),materialMap.has(child.ID)&&materials.push(materialMap.get(child.ID))}),materials.length===0){let material=require_pbmMeshMaterial.a(this.light?`phong`:`basic`);material.color=new three_webgpu.Color(13421772),materials.push(material)}return`color`in geometry.attributes&&materials.forEach(function(material){material.vertexColors=!0}),(!geometry.groups||geometry.groups.length===0)&&geometry.addGroup(0,geometry.index?geometry.index.count:geometry.attributes.position.count,0),geometry.FBX_Deformer?(materials.forEach(function(material){material.skinning=!0}),model=new require_pbmMeshMaterial.s(geometry,materials),model.normalizeSkinWeights()):model=new require_pbmMeshMaterial.o(geometry,materials),model}createCurve(relationships,geometryMap){let geometry=relationships.children.reduce(function(geo,child){return geometryMap.has(child.ID)&&(geo=geometryMap.get(child.ID)),geo},null),material=new three_webgpu.LineBasicMaterial({name:``,color:3342591,linewidth:1});return new three_webgpu.Line(geometry,material)}getTransformData(model,modelNode){let transformData={};modelNode.InheritType&&(transformData.inheritType=parseInt(modelNode.InheritType.value)),modelNode.RotationOrder?transformData.eulerOrder=getEulerOrder(modelNode.RotationOrder.value):transformData.eulerOrder=getEulerOrder(0),modelNode.Lcl_Translation&&(transformData.translation=modelNode.Lcl_Translation.value),modelNode.PreRotation&&(transformData.preRotation=modelNode.PreRotation.value),modelNode.Lcl_Rotation&&(transformData.rotation=modelNode.Lcl_Rotation.value),modelNode.PostRotation&&(transformData.postRotation=modelNode.PostRotation.value),modelNode.Lcl_Scaling&&(transformData.scale=modelNode.Lcl_Scaling.value),modelNode.ScalingOffset&&(transformData.scalingOffset=modelNode.ScalingOffset.value),modelNode.ScalingPivot&&(transformData.scalingPivot=modelNode.ScalingPivot.value),modelNode.RotationOffset&&(transformData.rotationOffset=modelNode.RotationOffset.value),modelNode.RotationPivot&&(transformData.rotationPivot=modelNode.RotationPivot.value),model.userData.transformData=transformData}setLookAtProperties(fbxTree,model,modelNode,connections,sceneGraph){`LookAtProperty`in modelNode&&connections.get(model.ID).children.forEach(function(child){if(child.relationship===`LookAtProperty`){let lookAtTarget=fbxTree.Objects.Model[child.ID];if(lookAtTarget.Lcl_Translation){let pos=lookAtTarget.Lcl_Translation.value;`target`in model&&model.target instanceof three_webgpu.Object3D?(model.target.position.fromArray(pos),sceneGraph.add(model.target)):model.lookAt(new three_webgpu.Vector3().fromArray(pos))}}})}bindSkeleton(fbxTree,skeletons,geometryMap,modelMap,connections){let bindMatrices=this.parsePoseNodes(fbxTree);for(let ID in skeletons){let skeleton=skeletons[ID];connections.get(parseInt(skeleton.ID)).parents.forEach(function(parent){if(geometryMap.has(parent.ID)){let geoID=parent.ID;connections.get(geoID).parents.forEach(function(geoConnParent){if(modelMap.has(geoConnParent.ID)){let model=modelMap.get(geoConnParent.ID);model instanceof three_webgpu.SkinnedMesh&&model.bind(new three_webgpu.Skeleton(skeleton.bones),bindMatrices[geoConnParent.ID])}})}})}}parsePoseNodes(fbxTree){let bindMatrices={};if(fbxTree.Objects.Pose){let BindPoseNode=fbxTree.Objects.Pose;for(let nodeID in BindPoseNode)if(BindPoseNode[nodeID].attrType===`BindPose`&&BindPoseNode[nodeID].NbPoseNodes>0){let poseNodes=BindPoseNode[nodeID].PoseNode;Array.isArray(poseNodes)?poseNodes.forEach(function(poseNode){bindMatrices[poseNode.Node]=new three_webgpu.Matrix4().fromArray(poseNode.Matrix.a)}):bindMatrices[poseNodes.Node]=new three_webgpu.Matrix4().fromArray(poseNodes.Matrix.a)}}return bindMatrices}},GeometryParser=class{constructor(){this.negativeMaterialIndices=!1}parse(fbxTree,deformers,connections){let geometryMap=new Map;if(`Geometry`in fbxTree.Objects){let geoNodes=fbxTree.Objects.Geometry;for(let nodeID in geoNodes){let relationships=connections.get(parseInt(nodeID)),geo=this.parseGeometry(fbxTree,relationships,geoNodes[nodeID],deformers);geometryMap.set(parseInt(nodeID),geo)}}return this.negativeMaterialIndices===!0&&console.warn(`THREE.FBXLoader: The FBX file contains invalid (negative) material indices. The asset might not render as expected.`),geometryMap}parseGeometry(fbxTree,relationships,geoNode,deformers){switch(geoNode.attrType){case`Mesh`:return this.parseMeshGeometry(fbxTree,relationships,geoNode,deformers);case`NurbsCurve`:return this.parseNurbsGeometry(geoNode)}}parseMeshGeometry(fbxTree,relationships,geoNode,deformers){let skeletons=deformers.skeletons,morphTargets=[],modelNodes=relationships.parents.map(function(parent){return fbxTree.Objects.Model[parent.ID]});if(modelNodes.length===0)return;let skeleton=relationships.children.reduce(function(skeleton,child){return skeletons[child.ID]!==void 0&&(skeleton=skeletons[child.ID]),skeleton},null);relationships.children.forEach(function(child){deformers.morphTargets[child.ID]!==void 0&&morphTargets.push(deformers.morphTargets[child.ID])});let modelNode=modelNodes[0],transformData={};modelNode.RotationOrder&&(transformData.eulerOrder=getEulerOrder(modelNode.RotationOrder.value)),modelNode.InheritType&&(transformData.inheritType=parseInt(modelNode.InheritType.value)),modelNode.GeometricTranslation&&(transformData.translation=modelNode.GeometricTranslation.value),modelNode.GeometricRotation&&(transformData.rotation=modelNode.GeometricRotation.value),modelNode.GeometricScaling&&(transformData.scale=modelNode.GeometricScaling.value);let transform=generateTransform(transformData);return this.genGeometry(fbxTree,geoNode,skeleton,morphTargets,transform)}genGeometry(fbxTree,geoNode,skeleton,morphTargets,preTransform){let geo=new three_webgpu.BufferGeometry;geoNode.attrName&&(geo.name=geoNode.attrName);let geoInfo=this.parseGeoNode(geoNode,skeleton),buffers=this.genBuffers(geoInfo),positionAttribute=new three_webgpu.Float32BufferAttribute(buffers.vertex,3);if(positionAttribute.applyMatrix4(preTransform),geo.setAttribute(`position`,positionAttribute),buffers.colors.length>0&&geo.setAttribute(`color`,new three_webgpu.Float32BufferAttribute(buffers.colors,3)),skeleton&&(geo.setAttribute(`skinIndex`,new three_webgpu.Uint16BufferAttribute(buffers.weightsIndices,4)),geo.setAttribute(`skinWeight`,new three_webgpu.Float32BufferAttribute(buffers.vertexWeights,4)),geo.FBX_Deformer=skeleton),buffers.normal.length>0){let normalMatrix=new three_webgpu.Matrix3().getNormalMatrix(preTransform),normalAttribute=new three_webgpu.Float32BufferAttribute(buffers.normal,3);normalAttribute.applyNormalMatrix(normalMatrix),geo.setAttribute(`normal`,normalAttribute)}if(buffers.uvs.forEach(function(uvBuffer,i){let name=i===0?`uv`:`uv${i}`;geo.setAttribute(name,new three_webgpu.Float32BufferAttribute(buffers.uvs[i],2))}),geoInfo.material&&geoInfo.material.mappingType!==`AllSame`){let prevMaterialIndex=buffers.materialIndex[0],startIndex=0;if(buffers.materialIndex.forEach(function(currentIndex,i){currentIndex!==prevMaterialIndex&&(geo.addGroup(startIndex,i-startIndex,prevMaterialIndex),prevMaterialIndex=currentIndex,startIndex=i)}),geo.groups.length>0){let lastGroup=geo.groups[geo.groups.length-1],lastIndex=lastGroup.start+lastGroup.count;lastIndex!==buffers.materialIndex.length&&geo.addGroup(lastIndex,buffers.materialIndex.length-lastIndex,prevMaterialIndex)}geo.groups.length===0&&geo.addGroup(0,buffers.materialIndex.length,buffers.materialIndex[0])}return this.addMorphTargets(fbxTree,geo,geoNode,morphTargets,preTransform),geo}parseGeoNode(geoNode,skeleton){let geoInfo={};if(geoInfo.vertexPositions=geoNode.Vertices===void 0?[]:geoNode.Vertices.a,geoInfo.vertexIndices=geoNode.PolygonVertexIndex===void 0?[]:geoNode.PolygonVertexIndex.a,geoNode.LayerElementColor&&(geoInfo.color=this.parseVertexColors(geoNode.LayerElementColor[0])),geoNode.LayerElementMaterial&&(geoInfo.material=this.parseMaterialIndices(geoNode.LayerElementMaterial[0])),geoNode.LayerElementNormal&&(geoInfo.normal=this.parseNormals(geoNode.LayerElementNormal[0])),geoNode.LayerElementUV){geoInfo.uv=[];let i=0;for(;geoNode.LayerElementUV[i];)geoNode.LayerElementUV[i].UV&&geoInfo.uv.push(this.parseUVs(geoNode.LayerElementUV[i])),i++}return geoInfo.weightTable={},skeleton!==null&&(geoInfo.skeleton=skeleton,skeleton.rawBones.forEach(function(rawBone,i){rawBone.indices.forEach(function(index,j){geoInfo.weightTable[index]===void 0&&(geoInfo.weightTable[index]=[]),geoInfo.weightTable[index].push({id:i,weight:rawBone.weights[j]})})})),geoInfo}genBuffers(geoInfo){let buffers={vertex:[],normal:[],colors:[],uvs:[],materialIndex:[],vertexWeights:[],weightsIndices:[]},polygonIndex=0,faceLength=0,displayedWeightsWarning=!1,facePositionIndexes=[],faceNormals=[],faceColors=[],faceUVs=[],faceWeights=[],faceWeightIndices=[],scope=this;return geoInfo.vertexIndices.forEach(function(vertexIndex,polygonVertexIndex){let materialIndex=0,endOfFace=!1;vertexIndex<0&&(vertexIndex^=-1,endOfFace=!0);let weightIndices=[],weights=[];if(facePositionIndexes.push(vertexIndex*3,vertexIndex*3+1,vertexIndex*3+2),geoInfo.color){let data=getData(polygonVertexIndex,polygonIndex,vertexIndex,geoInfo.color);faceColors.push(data[0],data[1],data[2])}if(geoInfo.skeleton){if(geoInfo.weightTable[vertexIndex]!==void 0&&geoInfo.weightTable[vertexIndex].forEach(function(wt){weights.push(wt.weight),weightIndices.push(wt.id)}),weights.length>4){displayedWeightsWarning||(console.warn(`THREE.FBXLoader: Vertex has more than 4 skinning weights assigned to vertex. Deleting additional weights.`),displayedWeightsWarning=!0);let wIndex=[0,0,0,0],Weight=[0,0,0,0];weights.forEach(function(weight,weightIndex){let currentWeight=weight,currentIndex=weightIndices[weightIndex];Weight.forEach(function(comparedWeight,comparedWeightIndex,comparedWeightArray){if(currentWeight>comparedWeight){comparedWeightArray[comparedWeightIndex]=currentWeight,currentWeight=comparedWeight;let tmp=wIndex[comparedWeightIndex];wIndex[comparedWeightIndex]=currentIndex,currentIndex=tmp}})}),weightIndices=wIndex,weights=Weight}for(;weights.length<4;)weights.push(0),weightIndices.push(0);for(let i=0;i<4;++i)faceWeights.push(weights[i]),faceWeightIndices.push(weightIndices[i])}if(geoInfo.normal){let data=getData(polygonVertexIndex,polygonIndex,vertexIndex,geoInfo.normal);faceNormals.push(data[0],data[1],data[2])}geoInfo.material&&geoInfo.material.mappingType!==`AllSame`&&(materialIndex=getData(polygonVertexIndex,polygonIndex,vertexIndex,geoInfo.material)[0],materialIndex<0&&(scope.negativeMaterialIndices=!0,materialIndex=0)),geoInfo.uv&&geoInfo.uv.forEach(function(uv,i){let data=getData(polygonVertexIndex,polygonIndex,vertexIndex,uv);faceUVs[i]===void 0&&(faceUVs[i]=[]),faceUVs[i].push(data[0]),faceUVs[i].push(data[1])}),faceLength++,endOfFace&&(scope.genFace(buffers,geoInfo,facePositionIndexes,materialIndex,faceNormals,faceColors,faceUVs,faceWeights,faceWeightIndices,faceLength),polygonIndex++,faceLength=0,facePositionIndexes=[],faceNormals=[],faceColors=[],faceUVs=[],faceWeights=[],faceWeightIndices=[])}),buffers}getNormalNewell(vertices){let normal=new three_webgpu.Vector3(0,0,0);for(let i=0;i<vertices.length;i++){let current=vertices[i],next=vertices[(i+1)%vertices.length];normal.x+=(current.y-next.y)*(current.z+next.z),normal.y+=(current.z-next.z)*(current.x+next.x),normal.z+=(current.x-next.x)*(current.y+next.y)}return normal.normalize(),normal}getNormalTangentAndBitangent(vertices){let normalVector=this.getNormalNewell(vertices),tangent=(Math.abs(normalVector.z)>.5?new three_webgpu.Vector3(0,1,0):new three_webgpu.Vector3(0,0,1)).cross(normalVector).normalize();return{normal:normalVector,tangent,bitangent:normalVector.clone().cross(tangent).normalize()}}flattenVertex(vertex,normalTangent,normalBitangent){return new three_webgpu.Vector2(vertex.dot(normalTangent),vertex.dot(normalBitangent))}genFace(buffers,geoInfo,facePositionIndexes,materialIndex,faceNormals,faceColors,faceUVs,faceWeights,faceWeightIndices,faceLength){let triangles;if(faceLength>3){let vertices=[],positions=geoInfo.baseVertexPositions||geoInfo.vertexPositions;for(let i=0;i<facePositionIndexes.length;i+=3)vertices.push(new three_webgpu.Vector3(positions[facePositionIndexes[i]],positions[facePositionIndexes[i+1]],positions[facePositionIndexes[i+2]]));let{tangent,bitangent}=this.getNormalTangentAndBitangent(vertices),triangulationInput=[];for(let vertex of vertices)triangulationInput.push(this.flattenVertex(vertex,tangent,bitangent));triangles=three_webgpu.ShapeUtils.triangulateShape(triangulationInput,[])}else triangles=[[0,1,2]];for(let[i0,i1,i2]of triangles)buffers.vertex.push(geoInfo.vertexPositions[facePositionIndexes[i0*3]]),buffers.vertex.push(geoInfo.vertexPositions[facePositionIndexes[i0*3+1]]),buffers.vertex.push(geoInfo.vertexPositions[facePositionIndexes[i0*3+2]]),buffers.vertex.push(geoInfo.vertexPositions[facePositionIndexes[i1*3]]),buffers.vertex.push(geoInfo.vertexPositions[facePositionIndexes[i1*3+1]]),buffers.vertex.push(geoInfo.vertexPositions[facePositionIndexes[i1*3+2]]),buffers.vertex.push(geoInfo.vertexPositions[facePositionIndexes[i2*3]]),buffers.vertex.push(geoInfo.vertexPositions[facePositionIndexes[i2*3+1]]),buffers.vertex.push(geoInfo.vertexPositions[facePositionIndexes[i2*3+2]]),geoInfo.skeleton&&(buffers.vertexWeights.push(faceWeights[i0*4]),buffers.vertexWeights.push(faceWeights[i0*4+1]),buffers.vertexWeights.push(faceWeights[i0*4+2]),buffers.vertexWeights.push(faceWeights[i0*4+3]),buffers.vertexWeights.push(faceWeights[i1*4]),buffers.vertexWeights.push(faceWeights[i1*4+1]),buffers.vertexWeights.push(faceWeights[i1*4+2]),buffers.vertexWeights.push(faceWeights[i1*4+3]),buffers.vertexWeights.push(faceWeights[i2*4]),buffers.vertexWeights.push(faceWeights[i2*4+1]),buffers.vertexWeights.push(faceWeights[i2*4+2]),buffers.vertexWeights.push(faceWeights[i2*4+3]),buffers.weightsIndices.push(faceWeightIndices[i0*4]),buffers.weightsIndices.push(faceWeightIndices[i0*4+1]),buffers.weightsIndices.push(faceWeightIndices[i0*4+2]),buffers.weightsIndices.push(faceWeightIndices[i0*4+3]),buffers.weightsIndices.push(faceWeightIndices[i1*4]),buffers.weightsIndices.push(faceWeightIndices[i1*4+1]),buffers.weightsIndices.push(faceWeightIndices[i1*4+2]),buffers.weightsIndices.push(faceWeightIndices[i1*4+3]),buffers.weightsIndices.push(faceWeightIndices[i2*4]),buffers.weightsIndices.push(faceWeightIndices[i2*4+1]),buffers.weightsIndices.push(faceWeightIndices[i2*4+2]),buffers.weightsIndices.push(faceWeightIndices[i2*4+3])),geoInfo.color&&(buffers.colors.push(faceColors[i0*3]),buffers.colors.push(faceColors[i0*3+1]),buffers.colors.push(faceColors[i0*3+2]),buffers.colors.push(faceColors[i1*3]),buffers.colors.push(faceColors[i1*3+1]),buffers.colors.push(faceColors[i1*3+2]),buffers.colors.push(faceColors[i2*3]),buffers.colors.push(faceColors[i2*3+1]),buffers.colors.push(faceColors[i2*3+2])),geoInfo.material&&geoInfo.material.mappingType!==`AllSame`&&(buffers.materialIndex.push(materialIndex),buffers.materialIndex.push(materialIndex),buffers.materialIndex.push(materialIndex)),geoInfo.normal&&(buffers.normal.push(faceNormals[i0*3]),buffers.normal.push(faceNormals[i0*3+1]),buffers.normal.push(faceNormals[i0*3+2]),buffers.normal.push(faceNormals[i1*3]),buffers.normal.push(faceNormals[i1*3+1]),buffers.normal.push(faceNormals[i1*3+2]),buffers.normal.push(faceNormals[i2*3]),buffers.normal.push(faceNormals[i2*3+1]),buffers.normal.push(faceNormals[i2*3+2])),geoInfo.uv&&geoInfo.uv.forEach(function(uv,j){buffers.uvs[j]===void 0&&(buffers.uvs[j]=[]),buffers.uvs[j].push(faceUVs[j][i0*2]),buffers.uvs[j].push(faceUVs[j][i0*2+1]),buffers.uvs[j].push(faceUVs[j][i1*2]),buffers.uvs[j].push(faceUVs[j][i1*2+1]),buffers.uvs[j].push(faceUVs[j][i2*2]),buffers.uvs[j].push(faceUVs[j][i2*2+1])})}addMorphTargets(fbxTree,parentGeo,parentGeoNode,morphTargets,preTransform){if(morphTargets.length===0)return;parentGeo.morphTargetsRelative=!0,parentGeo.morphAttributes.position=[];let scope=this;morphTargets.forEach(function(morphTarget){morphTarget.rawTargets.forEach(function(rawTarget){let morphGeoNode=fbxTree.Objects.Geometry[rawTarget.geoID];morphGeoNode!==void 0&&scope.genMorphGeometry(parentGeo,parentGeoNode,morphGeoNode,preTransform,rawTarget.name)})})}genMorphGeometry(parentGeo,parentGeoNode,morphGeoNode,preTransform,name){var _a;let basePositions=parentGeoNode.Vertices===void 0?[]:parentGeoNode.Vertices.a,baseIndices=parentGeoNode.PolygonVertexIndex===void 0?[]:parentGeoNode.PolygonVertexIndex.a,morphPositionsSparse=morphGeoNode.Vertices===void 0?[]:morphGeoNode.Vertices.a,morphIndices=morphGeoNode.Indexes?morphGeoNode.Indexes.a:[],length=parentGeo.attributes.position.count*3,morphPositions=new Float32Array(length);for(let i=0;i<morphIndices.length;i++){let morphIndex=morphIndices[i]*3;morphPositions[morphIndex]=morphPositionsSparse[i*3],morphPositions[morphIndex+1]=morphPositionsSparse[i*3+1],morphPositions[morphIndex+2]=morphPositionsSparse[i*3+2]}let morphGeoInfo={vertexIndices:baseIndices,vertexPositions:morphPositions,baseVertexPositions:basePositions},morphBuffers=this.genBuffers(morphGeoInfo),positionAttribute=new three_webgpu.Float32BufferAttribute(morphBuffers.vertex,3);positionAttribute.name=name||morphGeoNode.attrName,positionAttribute.applyMatrix4(preTransform),(_a=parentGeo.morphAttributes.position)==null||_a.push(positionAttribute)}parseNormals(normalNode){let mappingType=normalNode.MappingInformationType,referenceType=normalNode.ReferenceInformationType,buffer=normalNode.Normals.a,indexBuffer=[];return referenceType===`IndexToDirect`&&(normalNode.NormalIndex?indexBuffer=normalNode.NormalIndex.a:normalNode.NormalsIndex&&(indexBuffer=normalNode.NormalsIndex.a)),{dataSize:3,buffer,indices:indexBuffer,mappingType,referenceType}}parseUVs(uvNode){let mappingType=uvNode.MappingInformationType,referenceType=uvNode.ReferenceInformationType,buffer=uvNode.UV.a,indexBuffer=[];return referenceType===`IndexToDirect`&&(indexBuffer=uvNode.UVIndex.a),{dataSize:2,buffer,indices:indexBuffer,mappingType,referenceType}}parseVertexColors(colorNode){let mappingType=colorNode.MappingInformationType,referenceType=colorNode.ReferenceInformationType,buffer=colorNode.Colors.a,indexBuffer=[];referenceType===`IndexToDirect`&&(indexBuffer=colorNode.ColorIndex.a);for(let i=0,c=new three_webgpu.Color;i<buffer.length;i+=4)c.fromArray(buffer,i),c.toArray(buffer,i);return{dataSize:4,buffer,indices:indexBuffer,mappingType,referenceType}}parseMaterialIndices(materialNode){let mappingType=materialNode.MappingInformationType,referenceType=materialNode.ReferenceInformationType;if(mappingType===`NoMappingInformation`)return{dataSize:1,buffer:[0],indices:[0],mappingType:`AllSame`,referenceType};let materialIndexBuffer=materialNode.Materials.a,materialIndices=[];for(let i=0;i<materialIndexBuffer.length;++i)materialIndices.push(i);return{dataSize:1,buffer:materialIndexBuffer,indices:materialIndices,mappingType,referenceType}}parseNurbsGeometry(geoNode){let order=parseInt(geoNode.Order);if(isNaN(order))return console.error(`THREE.FBXLoader: Invalid Order %s given for geometry ID: %s`,geoNode.Order,geoNode.id),new three_webgpu.BufferGeometry;let degree=order-1,knots=geoNode.KnotVector.a,controlPoints=[],pointsValues=geoNode.Points.a;for(let i=0,l=pointsValues.length;i<l;i+=4)controlPoints.push(new three_webgpu.Vector4().fromArray(pointsValues,i));let startKnot,endKnot;if(geoNode.Form===`Closed`)controlPoints.push(controlPoints[0]);else if(geoNode.Form===`Periodic`){startKnot=degree,endKnot=knots.length-1-startKnot;for(let i=0;i<degree;++i)controlPoints.push(controlPoints[i])}let points=new NURBSCurve(degree,knots,controlPoints,startKnot,endKnot).getPoints(controlPoints.length*12);return new three_webgpu.BufferGeometry().setFromPoints(points)}},AnimationParser=class{parse(fbxTree,connections,sceneGraph){let animationClips=[],rawClips=this.parseClips(fbxTree,connections,sceneGraph);if(rawClips!==void 0)for(let key in rawClips){let rawClip=rawClips[key],clip=this.addClip(rawClip,sceneGraph);animationClips.push(clip)}return animationClips}parseClips(fbxTree,connections,sceneGraph){if(fbxTree.Objects.AnimationCurve===void 0)return;let curveNodesMap=this.parseAnimationCurveNodes(fbxTree);this.parseAnimationCurves(fbxTree,curveNodesMap,connections);let layersMap=this.parseAnimationLayers(fbxTree,curveNodesMap,connections,sceneGraph);return this.parseAnimStacks(fbxTree,layersMap,connections)}parseAnimationCurveNodes(fbxTree){let rawCurveNodes=fbxTree.Objects.AnimationCurveNode,curveNodesMap=new Map;for(let nodeID in rawCurveNodes){let rawCurveNode=rawCurveNodes[nodeID];if(rawCurveNode.attrName.match(/S|R|T|DeformPercent/)!==null){let curveNode={id:rawCurveNode.id,attr:rawCurveNode.attrName,curves:{}};curveNodesMap.set(curveNode.id,curveNode)}}return curveNodesMap}parseAnimationCurves(fbxTree,curveNodesMap,connections){let rawCurves=fbxTree.Objects.AnimationCurve;for(let nodeID in rawCurves){let animationCurve={id:rawCurves[nodeID].id,times:rawCurves[nodeID].KeyTime.a.map(convertFBXTimeToSeconds),values:rawCurves[nodeID].KeyValueFloat.a},relationships=connections.get(animationCurve.id);if(relationships!==void 0){let animationCurveID=relationships.parents[0].ID,animationCurveRelationship=relationships.parents[0].relationship,curveNode=curveNodesMap.get(animationCurveID);curveNode&&(animationCurveRelationship.match(/X/)?curveNode.curves.x=animationCurve:animationCurveRelationship.match(/Y/)?curveNode.curves.y=animationCurve:animationCurveRelationship.match(/Z/)?curveNode.curves.z=animationCurve:animationCurveRelationship.match(/DeformPercent/)&&curveNodesMap.has(animationCurveID)&&(curveNode.curves.morph=animationCurve))}}}parseAnimationLayers(fbxTree,curveNodesMap,connections,sceneGraph){let rawLayers=fbxTree.Objects.AnimationLayer,layersMap=new Map;for(let nodeID in rawLayers){let layerCurveNodes=[],connection=connections.get(parseInt(nodeID));connection!==void 0&&(connection.children.forEach((child,i)=>{if(curveNodesMap.has(child.ID)){let curveNode=curveNodesMap.get(child.ID);if(curveNode.curves.x!==void 0||curveNode.curves.y!==void 0||curveNode.curves.z!==void 0){if(layerCurveNodes[i]===void 0){let modelID=connections.get(child.ID).parents.filter(function(parent){return parent.relationship!==void 0})[0].ID;if(modelID!==void 0){let rawModel=fbxTree.Objects.Model[modelID.toString()];if(rawModel===void 0){console.warn(`THREE.FBXLoader: Encountered a unused curve.`,child);return}let node={modelName:rawModel.attrName?three_webgpu.PropertyBinding.sanitizeNodeName(rawModel.attrName):``,ID:rawModel.id,initialPosition:[0,0,0],initialRotation:[0,0,0],initialScale:[1,1,1],transform:new three_webgpu.Matrix4,eulerOrder:``,preRotation:[0,0,0],postRotation:[0,0,0]};sceneGraph.traverse(function(child){child.ID===rawModel.id&&(node.transform=child.matrix,child.userData.transformData&&(node.eulerOrder=child.userData.transformData.eulerOrder))}),node.transform||(node.transform=new three_webgpu.Matrix4),rawModel.PreRotation&&(node.preRotation=rawModel.PreRotation.value),rawModel.PostRotation&&(node.postRotation=rawModel.PostRotation.value),layerCurveNodes[i]=node}}layerCurveNodes[i]&&(layerCurveNodes[i][curveNode.attr]=curveNode)}else if(curveNode.curves.morph!==void 0){if(layerCurveNodes[i]===void 0){let deformerID=connections.get(child.ID).parents.filter(function(parent){return parent.relationship!==void 0})[0].ID,morpherID=connections.get(deformerID).parents[0].ID,geoID=connections.get(morpherID).parents[0].ID,modelID=connections.get(geoID).parents[0].ID,rawModel=fbxTree.Objects.Model[modelID];layerCurveNodes[i]={modelName:rawModel.attrName?three_webgpu.PropertyBinding.sanitizeNodeName(rawModel.attrName):``,morphName:fbxTree.Objects.Deformer[deformerID].attrName}}layerCurveNodes[i][curveNode.attr]=curveNode}}}),layersMap.set(parseInt(nodeID),layerCurveNodes))}return layersMap}parseAnimStacks(fbxTree,layersMap,connections){let rawStacks=fbxTree.Objects.AnimationStack,rawClips={};for(let nodeID in rawStacks){let children=connections.get(parseInt(nodeID)).children;children.length>1&&console.warn(`THREE.FBXLoader: Encountered an animation stack with multiple layers, this is currently not supported. Ignoring subsequent layers.`);let layer=layersMap.get(children[0].ID);rawClips[nodeID]={name:rawStacks[nodeID].attrName,layer}}return rawClips}addClip(rawClip,sceneGraph){let tracks=[],scope=this;return rawClip.layer.forEach(function(rawTracks){tracks=tracks.concat(scope.generateTracks(rawTracks,sceneGraph))}),new three_webgpu.AnimationClip(rawClip.name,-1,tracks)}generateTracks(rawTracks,sceneGraph){let tracks=[],initialPositionVector3=new three_webgpu.Vector3,initialScaleVector3=new three_webgpu.Vector3;rawTracks.transform&&rawTracks.transform.decompose(initialPositionVector3,new three_webgpu.Quaternion,initialScaleVector3);let initialPosition=initialPositionVector3.toArray(),initialScale=initialScaleVector3.toArray();if(rawTracks.T!==void 0&&Object.keys(rawTracks.T.curves).length>0){let positionTrack=this.generateVectorTrack(rawTracks.modelName,rawTracks.T.curves,initialPosition,`position`);positionTrack!==void 0&&tracks.push(positionTrack)}if(rawTracks.R!==void 0&&Object.keys(rawTracks.R.curves).length>0){let rotationTrack=this.generateRotationTrack(rawTracks.modelName,rawTracks.R.curves,rawTracks.preRotation,rawTracks.postRotation,rawTracks.eulerOrder);rotationTrack!==void 0&&tracks.push(rotationTrack)}if(rawTracks.S!==void 0&&Object.keys(rawTracks.S.curves).length>0){let scaleTrack=this.generateVectorTrack(rawTracks.modelName,rawTracks.S.curves,initialScale,`scale`);scaleTrack!==void 0&&tracks.push(scaleTrack)}if(rawTracks.DeformPercent!==void 0){let morphTrack=this.generateMorphTrack(rawTracks,sceneGraph);morphTrack!==void 0&&tracks.push(morphTrack)}return tracks}generateVectorTrack(modelName,curves,initialValue,type){let times=this.getTimesForAllAxes(curves),values=this.getKeyframeTrackValues(times,curves,initialValue);return new three_webgpu.VectorKeyframeTrack(modelName+`.`+type,times,values)}generateRotationTrack(modelName,curves,preRotation,postRotation,eulerOrder){let times,values;if(curves.x!==void 0&&curves.y!==void 0&&curves.z!==void 0){let result=this.interpolateRotations(curves.x,curves.y,curves.z,eulerOrder);times=result[0],values=result[1]}let defaultEulerOrder=getEulerOrder(0),preQuaternion=new three_webgpu.Quaternion,postQuaternion=new three_webgpu.Quaternion;preRotation!==void 0&&(preRotation=preRotation.map(three_webgpu.MathUtils.degToRad),preRotation.push(defaultEulerOrder),preQuaternion.setFromEuler(new three_webgpu.Euler().fromArray(preRotation))),postRotation!==void 0&&(postRotation=postRotation.map(three_webgpu.MathUtils.degToRad),postRotation.push(defaultEulerOrder),postQuaternion.setFromEuler(new three_webgpu.Euler().fromArray(postRotation)),postQuaternion.invert());let quaternion=new three_webgpu.Quaternion,euler=new three_webgpu.Euler,quaternionValues=[];if(!values||!times)return new three_webgpu.QuaternionKeyframeTrack(modelName+`.quaternion`,[0],[0]);for(let i=0;i<values.length;i+=3)euler.set(values[i],values[i+1],values[i+2],eulerOrder),quaternion.setFromEuler(euler),quaternion.premultiply(preQuaternion),quaternion.multiply(postQuaternion),i>2&&new three_webgpu.Quaternion().fromArray(quaternionValues,(i-3)/3*4).dot(quaternion)<0&&quaternion.set(-quaternion.x,-quaternion.y,-quaternion.z,-quaternion.w),quaternion.toArray(quaternionValues,i/3*4);return new three_webgpu.QuaternionKeyframeTrack(modelName+`.quaternion`,times,quaternionValues)}generateMorphTrack(rawTracks,sceneGraph){let curves=rawTracks.DeformPercent.curves.morph,values=curves.values.map(function(val){return val/100}),morphNum=sceneGraph.getObjectByName(rawTracks.modelName).morphTargetDictionary[rawTracks.morphName];return new three_webgpu.NumberKeyframeTrack(rawTracks.modelName+`.morphTargetInfluences[`+morphNum+`]`,curves.times,values)}getTimesForAllAxes(curves){let times=[];if(curves.x!==void 0&&(times=times.concat(curves.x.times)),curves.y!==void 0&&(times=times.concat(curves.y.times)),curves.z!==void 0&&(times=times.concat(curves.z.times)),times=times.sort(function(a,b){return a-b}),times.length>1){let targetIndex=1,lastValue=times[0];for(let i=1;i<times.length;i++){let currentValue=times[i];currentValue!==lastValue&&(times[targetIndex]=currentValue,lastValue=currentValue,targetIndex++)}times=times.slice(0,targetIndex)}return times}getKeyframeTrackValues(times,curves,initialValue){let prevValue=initialValue,values=[],xIndex=-1,yIndex=-1,zIndex=-1;return times.forEach(function(time){if(curves.x&&(xIndex=curves.x.times.indexOf(time)),curves.y&&(yIndex=curves.y.times.indexOf(time)),curves.z&&(zIndex=curves.z.times.indexOf(time)),xIndex!==-1){let xValue=curves.x.values[xIndex];values.push(xValue),prevValue[0]=xValue}else values.push(prevValue[0]);if(yIndex!==-1){let yValue=curves.y.values[yIndex];values.push(yValue),prevValue[1]=yValue}else values.push(prevValue[1]);if(zIndex!==-1){let zValue=curves.z.values[zIndex];values.push(zValue),prevValue[2]=zValue}else values.push(prevValue[2])}),values}interpolateRotations(curvex,curvey,curvez,eulerOrder){let times=[],values=[];times.push(curvex.times[0]),values.push(three_webgpu.MathUtils.degToRad(curvex.values[0])),values.push(three_webgpu.MathUtils.degToRad(curvey.values[0])),values.push(three_webgpu.MathUtils.degToRad(curvez.values[0]));for(let i=1;i<curvex.values.length;i++){let initialValue=[curvex.values[i-1],curvey.values[i-1],curvez.values[i-1]];if(isNaN(initialValue[0])||isNaN(initialValue[1])||isNaN(initialValue[2]))continue;let initialValueRad=initialValue.map(three_webgpu.MathUtils.degToRad),currentValue=[curvex.values[i],curvey.values[i],curvez.values[i]];if(isNaN(currentValue[0])||isNaN(currentValue[1])||isNaN(currentValue[2]))continue;currentValue.map(three_webgpu.MathUtils.degToRad);let valuesSpan=[currentValue[0]-initialValue[0],currentValue[1]-initialValue[1],currentValue[2]-initialValue[2]],absoluteSpan=[Math.abs(valuesSpan[0]),Math.abs(valuesSpan[1]),Math.abs(valuesSpan[2])];if(absoluteSpan[0]>=180||absoluteSpan[1]>=180||absoluteSpan[2]>=180){let numSubIntervals=Math.max(...absoluteSpan)/180,E1=new three_webgpu.Euler(initialValueRad[0],initialValueRad[1],initialValueRad[2],eulerOrder),E2=new three_webgpu.Euler(initialValueRad[0],initialValueRad[1],initialValueRad[2],eulerOrder),Q1=new three_webgpu.Quaternion().setFromEuler(E1),Q2=new three_webgpu.Quaternion().setFromEuler(E2);Q1.dot(Q2)&&Q2.set(-Q2.x,-Q2.y,-Q2.z,-Q2.w);let initialTime=curvex.times[i-1],timeSpan=curvex.times[i]-initialTime,Q=new three_webgpu.Quaternion,E=new three_webgpu.Euler;for(let t=0;t<1;t+=1/numSubIntervals)Q.copy(Q1.clone().slerp(Q2.clone(),t)),times.push(initialTime+t*timeSpan),E.setFromQuaternion(Q,eulerOrder),values.push(E.x),values.push(E.y),values.push(E.z)}else times.push(curvex.times[i]),values.push(three_webgpu.MathUtils.degToRad(curvex.values[i])),values.push(three_webgpu.MathUtils.degToRad(curvey.values[i])),values.push(three_webgpu.MathUtils.degToRad(curvez.values[i]))}return[times,values]}},TextParser=class{constructor(){this.allNodes=new FBXTree,this.nodeStack=[],this.currentIndent=0,this.currentPropName=``}getPrevNode(){return this.nodeStack[this.currentIndent-2]}getCurrentNode(){return this.nodeStack[this.currentIndent-1]}getCurrentProp(){return this.currentProp}pushStack(node){this.nodeStack.push(node),this.currentIndent+=1}popStack(){this.nodeStack.pop(),--this.currentIndent}setCurrentProp(val,name){this.currentProp=val,this.currentPropName=name}parse(text){this.currentIndent=0,this.allNodes=new FBXTree,this.nodeStack=[],this.currentProp=[],this.currentPropName=``;let scope=this,split=text.split(/[\r\n]+/);return split.forEach(function(line,i){let matchComment=line.match(/^[\s\t]*;/),matchEmpty=line.match(/^[\s\t]*$/);if(matchComment||matchEmpty)return;let matchBeginning=line.match(`^\\t{`+scope.currentIndent+`}(\\w+):(.*){`),matchProperty=line.match(`^\\t{`+scope.currentIndent+`}(\\w+):[\\s\\t\\r\\n](.*)`),matchEnd=line.match(`^\\t{`+(scope.currentIndent-1)+`}}`);matchBeginning?scope.parseNodeBegin(line,matchBeginning):matchProperty?scope.parseNodeProperty(line,matchProperty,split[++i]):matchEnd?scope.popStack():line.match(/^[^\s\t}]/)&&scope.parseNodePropertyContinued(line)}),this.allNodes}parseNodeBegin(line,property){let nodeName=property[1].trim().replace(/^"/,``).replace(/"$/,``),nodeAttrs=property[2].split(`,`).map(function(attr){return attr.trim().replace(/^"/,``).replace(/"$/,``)}),node={name:nodeName},attrs=this.parseNodeAttr(nodeAttrs),currentNode=this.getCurrentNode();this.currentIndent===0?this.allNodes.add(nodeName,node):nodeName in currentNode?(nodeName===`PoseNode`?currentNode.PoseNode.push(node):currentNode[nodeName].id!==void 0&&(currentNode[nodeName]={},currentNode[nodeName][currentNode[nodeName].id]=currentNode[nodeName]),attrs.id!==``&&(currentNode[nodeName][attrs.id]=node)):typeof attrs.id==`number`?(currentNode[nodeName]={},currentNode[nodeName][attrs.id]=node):nodeName!==`Properties70`&&(nodeName===`PoseNode`?currentNode[nodeName]=[node]:currentNode[nodeName]=node),typeof attrs.id==`number`&&(node.id=attrs.id),attrs.name!==``&&(node.attrName=attrs.name),attrs.type!==``&&(node.attrType=attrs.type),this.pushStack(node)}parseNodeAttr(attrs){let id=attrs[0];attrs[0]!==``&&(id=parseInt(attrs[0]),isNaN(id)&&(id=attrs[0]));let name=``,type=``;return attrs.length>1&&(name=attrs[1].replace(/^(\w+)::/,``),type=attrs[2]),{id,name,type}}parseNodeProperty(line,property,contentLine){let propName=property[1].replace(/^"/,``).replace(/"$/,``).trim(),propValue=property[2].replace(/^"/,``).replace(/"$/,``).trim();propName===`Content`&&propValue===`,`&&(propValue=contentLine.replace(/"/g,``).replace(/,$/,``).trim());let currentNode=this.getCurrentNode();if(currentNode.name===`Properties70`){this.parseNodeSpecialProperty(line,propName,propValue);return}if(propName===`C`){let connProps=propValue.split(`,`).slice(1),from=parseInt(connProps[0]),to=parseInt(connProps[1]),rest=propValue.split(`,`).slice(3);rest=rest.map(function(elem){return elem.trim().replace(/^"/,``)}),propName=`connections`,propValue=[from,to],append(propValue,rest),currentNode[propName]===void 0&&(currentNode[propName]=[])}propName===`Node`&&(currentNode.id=propValue),propName in currentNode&&Array.isArray(currentNode[propName])?currentNode[propName].push(propValue):propName===`a`?currentNode.a=propValue:currentNode[propName]=propValue,this.setCurrentProp(currentNode,propName),propName===`a`&&propValue.slice(-1)!==`,`&&(currentNode.a=parseNumberArray(propValue))}parseNodePropertyContinued(line){let currentNode=this.getCurrentNode();currentNode.a+=line,line.slice(-1)!==`,`&&(currentNode.a=parseNumberArray(currentNode.a))}parseNodeSpecialProperty(line,propName,propValue){let props=propValue.split(`",`).map(function(prop){return prop.trim().replace(/^\"/,``).replace(/\s/,`_`)}),innerPropName=props[0],innerPropType1=props[1],innerPropType2=props[2],innerPropFlag=props[3],innerPropValue=props[4];switch(innerPropType1){case`int`:case`enum`:case`bool`:case`ULongLong`:case`double`:case`Number`:case`FieldOfView`:innerPropValue=parseFloat(innerPropValue);break;case`Color`:case`ColorRGB`:case`Vector3D`:case`Lcl_Translation`:case`Lcl_Rotation`:case`Lcl_Scaling`:innerPropValue=parseNumberArray(innerPropValue);break}this.getPrevNode()[innerPropName]={type:innerPropType1,type2:innerPropType2,flag:innerPropFlag,value:innerPropValue},this.setCurrentProp(this.getPrevNode(),innerPropName)}},BinaryParser=class{parse(buffer){let reader=new BinaryReader(buffer);reader.skip(23);let version=reader.getUint32();if(version<6400)throw Error(`THREE.FBXLoader: FBX version not supported, FileVersion: `+version);let allNodes=new FBXTree;for(;!this.endOfContent(reader);){let node=this.parseNode(reader,version);node!==null&&allNodes.add(node.name,node)}return allNodes}endOfContent(reader){return reader.size()%16==0?(reader.getOffset()+160+16&-16)>=reader.size():reader.getOffset()+160+16>=reader.size()}parseNode(reader,version){let node={},endOffset=version>=7500?reader.getUint64():reader.getUint32(),numProperties=version>=7500?reader.getUint64():reader.getUint32();version>=7500?reader.getUint64():reader.getUint32();let nameLen=reader.getUint8(),name=reader.getString(nameLen);if(endOffset===0)return null;let propertyList=[];for(let i=0;i<numProperties;i++)propertyList.push(this.parseProperty(reader));let id=propertyList.length>0?propertyList[0]:``,attrName=propertyList.length>1?propertyList[1]:``,attrType=propertyList.length>2?propertyList[2]:``;for(node.singleProperty=numProperties===1&&reader.getOffset()===endOffset;endOffset>reader.getOffset();){let subNode=this.parseNode(reader,version);subNode!==null&&this.parseSubNode(name,node,subNode)}return node.propertyList=propertyList,typeof id==`number`&&(node.id=id),attrName!==``&&(node.attrName=attrName),attrType!==``&&(node.attrType=attrType),name!==``&&(node.name=name),node}parseSubNode(name,node,subNode){if(subNode.singleProperty===!0){let value=subNode.propertyList[0];Array.isArray(value)?(node[subNode.name]=subNode,subNode.a=value):node[subNode.name]=value}else if(name===`Connections`&&subNode.name===`C`){let array=[];subNode.propertyList.forEach(function(property,i){i!==0&&array.push(property)}),node.connections===void 0&&(node.connections=[]),node.connections.push(array)}else if(subNode.name===`Properties70`)Object.keys(subNode).forEach(function(key){node[key]=subNode[key]});else if(name===`Properties70`&&subNode.name===`P`){let innerPropName=subNode.propertyList[0],innerPropType1=subNode.propertyList[1],innerPropType2=subNode.propertyList[2],innerPropFlag=subNode.propertyList[3],innerPropValue;innerPropName.indexOf(`Lcl `)===0&&(innerPropName=innerPropName.replace(`Lcl `,`Lcl_`)),innerPropType1.indexOf(`Lcl `)===0&&(innerPropType1=innerPropType1.replace(`Lcl `,`Lcl_`)),innerPropValue=innerPropType1===`Color`||innerPropType1===`ColorRGB`||innerPropType1===`Vector`||innerPropType1===`Vector3D`||innerPropType1.indexOf(`Lcl_`)===0?[subNode.propertyList[4],subNode.propertyList[5],subNode.propertyList[6]]:subNode.propertyList[4],node[innerPropName]={type:innerPropType1,type2:innerPropType2,flag:innerPropFlag,value:innerPropValue}}else node[subNode.name]===void 0?typeof subNode.id==`number`?(node[subNode.name]={},node[subNode.name][subNode.id]=subNode):node[subNode.name]=subNode:subNode.name===`PoseNode`?(Array.isArray(node[subNode.name])||(node[subNode.name]=[node[subNode.name]]),node[subNode.name].push(subNode)):node[subNode.name][subNode.id]===void 0&&(node[subNode.name][subNode.id]=subNode)}parseProperty(reader){let type=reader.getString(1),length;switch(type){case`C`:return reader.getBoolean();case`D`:return reader.getFloat64();case`F`:return reader.getFloat32();case`I`:return reader.getInt32();case`L`:return reader.getInt64();case`R`:return length=reader.getUint32(),reader.getArrayBuffer(length);case`S`:return length=reader.getUint32(),reader.getString(length);case`Y`:return reader.getInt16();case`b`:case`c`:case`d`:case`f`:case`i`:case`l`:let arrayLength=reader.getUint32(),encoding=reader.getUint32(),compressedLength=reader.getUint32();if(encoding===0)switch(type){case`b`:case`c`:return reader.getBooleanArray(arrayLength);case`d`:return reader.getFloat64Array(arrayLength);case`f`:return reader.getFloat32Array(arrayLength);case`i`:return reader.getInt32Array(arrayLength);case`l`:return reader.getInt64Array(arrayLength)}let reader2=new BinaryReader(require_fflate.n(new Uint8Array(reader.getArrayBuffer(compressedLength))).buffer);switch(type){case`b`:case`c`:return reader2.getBooleanArray(arrayLength);case`d`:return reader2.getFloat64Array(arrayLength);case`f`:return reader2.getFloat32Array(arrayLength);case`i`:return reader2.getInt32Array(arrayLength);case`l`:return reader2.getInt64Array(arrayLength)}break;default:throw Error(`THREE.FBXLoader: Unknown property type `+type)}}},BinaryReader=class{constructor(buffer,littleEndian){this.dv=new DataView(buffer),this.offset=0,this.littleEndian=littleEndian===void 0?!0:littleEndian,this._textDecoder=new TextDecoder}getOffset(){return this.offset}size(){return this.dv.buffer.byteLength}skip(length){this.offset+=length}getBoolean(){return(this.getUint8()&1)==1}getBooleanArray(size){let a=[];for(let i=0;i<size;i++)a.push(this.getBoolean());return a}getUint8(){let value=this.dv.getUint8(this.offset);return this.offset+=1,value}getInt16(){let value=this.dv.getInt16(this.offset,this.littleEndian);return this.offset+=2,value}getInt32(){let value=this.dv.getInt32(this.offset,this.littleEndian);return this.offset+=4,value}getInt32Array(size){let a=[];for(let i=0;i<size;i++)a.push(this.getInt32());return a}getUint32(){let value=this.dv.getUint32(this.offset,this.littleEndian);return this.offset+=4,value}getInt64(){let low,high;return this.littleEndian?(low=this.getUint32(),high=this.getUint32()):(high=this.getUint32(),low=this.getUint32()),high&2147483648?(high=~high&4294967295,low=~low&4294967295,low===4294967295&&(high=high+1&4294967295),low=low+1&4294967295,-(high*4294967296+low)):high*4294967296+low}getInt64Array(size){let a=[];for(let i=0;i<size;i++)a.push(this.getInt64());return a}getUint64(){let low,high;return this.littleEndian?(low=this.getUint32(),high=this.getUint32()):(high=this.getUint32(),low=this.getUint32()),high*4294967296+low}getFloat32(){let value=this.dv.getFloat32(this.offset,this.littleEndian);return this.offset+=4,value}getFloat32Array(size){let a=[];for(let i=0;i<size;i++)a.push(this.getFloat32());return a}getFloat64(){let value=this.dv.getFloat64(this.offset,this.littleEndian);return this.offset+=8,value}getFloat64Array(size){let a=[];for(let i=0;i<size;i++)a.push(this.getFloat64());return a}getArrayBuffer(size){let value=this.dv.buffer.slice(this.offset,this.offset+size);return this.offset+=size,value}getString(size){let start=this.offset,a=new Uint8Array(this.dv.buffer,start,size);this.skip(size);let nullByte=a.indexOf(0);return nullByte>=0&&(a=new Uint8Array(this.dv.buffer,start,nullByte)),this._textDecoder.decode(a)}},FBXTree=class{constructor(){this.Connections={connections:[]},this.Objects={Model:{},NodeAttribute:{},Geometry:{}},this.GlobalSettings={}}add(key,val){this[key]=val}};function isFbxFormatBinary(buffer){return buffer.byteLength>=21&&convertArrayBufferToString(buffer,0,21)===`Kaydara FBX Binary \0`}function isFbxFormatASCII(text){let CORRECT=[`K`,`a`,`y`,`d`,`a`,`r`,`a`,`\\`,`F`,`B`,`X`,`\\`,`B`,`i`,`n`,`a`,`r`,`y`,`\\`,`\\`],cursor=0;function read(offset){let result=text[offset-1];return text=text.slice(cursor+offset),cursor++,result}for(let i=0;i<CORRECT.length;++i)if(read(1)===CORRECT[i])return!1;return!0}function getFbxVersion(text){let match=text.match(/FBXVersion: (\d+)/);if(match)return parseInt(match[1]);throw Error(`THREE.FBXLoader: Cannot find the version number for the file given.`)}function convertFBXTimeToSeconds(time){return time/46186158e3}var dataArray=[];function getData(polygonVertexIndex,polygonIndex,vertexIndex,infoObject){let index;switch(infoObject.mappingType){case`ByPolygonVertex`:index=polygonVertexIndex;break;case`ByPolygon`:index=polygonIndex;break;case`ByVertice`:index=vertexIndex;break;case`AllSame`:index=infoObject.indices[0];break;default:console.warn(`THREE.FBXLoader: unknown attribute mapping type `+infoObject.mappingType),index=0}infoObject.referenceType===`IndexToDirect`&&(index=infoObject.indices[index]);let from=index*infoObject.dataSize,to=from+infoObject.dataSize;return slice(dataArray,infoObject.buffer,from,to)}var tempEuler=new three_webgpu.Euler,tempVec=new three_webgpu.Vector3;function generateTransform(transformData){let lTranslationM=new three_webgpu.Matrix4,lPreRotationM=new three_webgpu.Matrix4,lRotationM=new three_webgpu.Matrix4,lPostRotationM=new three_webgpu.Matrix4,lScalingM=new three_webgpu.Matrix4,lScalingPivotM=new three_webgpu.Matrix4,lScalingOffsetM=new three_webgpu.Matrix4,lRotationOffsetM=new three_webgpu.Matrix4,lRotationPivotM=new three_webgpu.Matrix4,lParentGX=new three_webgpu.Matrix4,lParentLX=new three_webgpu.Matrix4,lGlobalT=new three_webgpu.Matrix4,inheritType=transformData.inheritType?transformData.inheritType:0;transformData.translation&&lTranslationM.setPosition(tempVec.fromArray(transformData.translation));let defaultEulerOrder=getEulerOrder(0);if(transformData.preRotation){let array=transformData.preRotation.map(three_webgpu.MathUtils.degToRad);array.push(defaultEulerOrder),lPreRotationM.makeRotationFromEuler(tempEuler.fromArray(array))}if(transformData.rotation){let array=transformData.rotation.map(three_webgpu.MathUtils.degToRad);array.push(transformData.eulerOrder||defaultEulerOrder),lRotationM.makeRotationFromEuler(tempEuler.fromArray(array))}if(transformData.postRotation){let array=transformData.postRotation.map(three_webgpu.MathUtils.degToRad);array.push(defaultEulerOrder),lPostRotationM.makeRotationFromEuler(tempEuler.fromArray(array)),lPostRotationM.copy(lPostRotationM.clone().invert())}transformData.scale&&lScalingM.scale(tempVec.fromArray(transformData.scale)),transformData.scalingOffset&&lScalingOffsetM.setPosition(tempVec.fromArray(transformData.scalingOffset)),transformData.scalingPivot&&lScalingPivotM.setPosition(tempVec.fromArray(transformData.scalingPivot)),transformData.rotationOffset&&lRotationOffsetM.setPosition(tempVec.fromArray(transformData.rotationOffset)),transformData.rotationPivot&&lRotationPivotM.setPosition(tempVec.fromArray(transformData.rotationPivot)),transformData.parentMatrixWorld&&(lParentLX.copy(transformData.parentMatrix),lParentGX.copy(transformData.parentMatrixWorld));let lLRM=lPreRotationM.clone().multiply(lRotationM).multiply(lPostRotationM),lParentGRM=new three_webgpu.Matrix4;lParentGRM.extractRotation(lParentGX);let lParentTM=new three_webgpu.Matrix4;lParentTM.copyPosition(lParentGX);let lParentGRSM=lParentTM.clone().invert().multiply(lParentGX),lParentGSM=lParentGRM.clone().invert().multiply(lParentGRSM),lLSM=lScalingM,lGlobalRS=new three_webgpu.Matrix4;if(inheritType===0)lGlobalRS.copy(lParentGRM).multiply(lLRM).multiply(lParentGSM).multiply(lLSM);else if(inheritType===1)lGlobalRS.copy(lParentGRM).multiply(lParentGSM).multiply(lLRM).multiply(lLSM);else{let lParentLSM_inv=new three_webgpu.Matrix4().scale(new three_webgpu.Vector3().setFromMatrixScale(lParentLX)).clone().invert(),lParentGSM_noLocal=lParentGSM.clone().multiply(lParentLSM_inv);lGlobalRS.copy(lParentGRM).multiply(lLRM).multiply(lParentGSM_noLocal).multiply(lLSM)}let lRotationPivotM_inv=lRotationPivotM.clone().invert(),lScalingPivotM_inv=lScalingPivotM.clone().invert(),lTransform=lTranslationM.clone().multiply(lRotationOffsetM).multiply(lRotationPivotM).multiply(lPreRotationM).multiply(lRotationM).multiply(lPostRotationM).multiply(lRotationPivotM_inv).multiply(lScalingOffsetM).multiply(lScalingPivotM).multiply(lScalingM).multiply(lScalingPivotM_inv),lLocalTWithAllPivotAndOffsetInfo=new three_webgpu.Matrix4().copyPosition(lTransform),lGlobalTranslation=lParentGX.clone().multiply(lLocalTWithAllPivotAndOffsetInfo);return lGlobalT.copyPosition(lGlobalTranslation),lTransform=lGlobalT.clone().multiply(lGlobalRS),lTransform.premultiply(lParentGX.clone().invert()),lTransform}function getEulerOrder(order){order=order||0;let enums=[`ZYX`,`YZX`,`XZY`,`ZXY`,`YXZ`,`XYZ`];return order===6?(console.warn(`THREE.FBXLoader: unsupported Euler Order: Spherical XYZ. Animations and rotations may be incorrect.`),enums[0]):enums[order]}function parseNumberArray(value){return value.split(`,`).map(function(val){return parseFloat(val)})}function convertArrayBufferToString(buffer,from,to){return from===void 0&&(from=0),to===void 0&&(to=buffer.byteLength),new TextDecoder().decode(new Uint8Array(buffer,from,to))}function append(a,b){for(let i=0,j=a.length,l=b.length;i<l;i++,j++)a[j]=b[i]}function slice(a,b,from,to){for(let i=from,j=0;i<to;i++,j++)a[j]=b[i];return a}var NURBSCurve=class extends three_webgpu.Curve{constructor(degree,knots,controlPoints,startKnot,endKnot){super();let knotsLength=knots?knots.length-1:0,pointsLength=controlPoints?controlPoints.length:0;this.degree=degree,this.knots=knots,this.controlPoints=[],this.startKnot=startKnot||0,this.endKnot=endKnot||knotsLength;for(let i=0;i<pointsLength;++i){let point=controlPoints[i];this.controlPoints[i]=new three_webgpu.Vector4(point.x,point.y,point.z,point.w)}}getPoint(t,optionalTarget=new three_webgpu.Vector3){let point=optionalTarget,u=this.knots[this.startKnot]+t*(this.knots[this.endKnot]-this.knots[this.startKnot]),hpoint=calcBSplinePoint(this.degree,this.knots,this.controlPoints,u);return hpoint.w!==1&&hpoint.divideScalar(hpoint.w),point.set(hpoint.x,hpoint.y,hpoint.z)}getTangent(t,optionalTarget=new three_webgpu.Vector3){let tangent=optionalTarget,u=this.knots[0]+t*(this.knots[this.knots.length-1]-this.knots[0]),ders=calcNURBSDerivatives(this.degree,this.knots,this.controlPoints,u,1);return tangent.copy(ders[1]).normalize(),tangent}toJSON(){let data=super.toJSON();return data.degree=this.degree,data.knots=[...this.knots],data.controlPoints=this.controlPoints.map(p=>p.toArray()),data.startKnot=this.startKnot,data.endKnot=this.endKnot,data}fromJSON(json){return super.fromJSON(json),this.degree=json.degree,this.knots=[...json.knots],this.controlPoints=json.controlPoints.map(p=>new three_webgpu.Vector4(p[0],p[1],p[2],p[3])),this.startKnot=json.startKnot,this.endKnot=json.endKnot,this}};function findSpan(p,u,U){let n=U.length-p-1;if(u>=U[n])return n-1;if(u<=U[p])return p;let low=p,high=n,mid=Math.floor((low+high)/2);for(;u<U[mid]||u>=U[mid+1];)u<U[mid]?high=mid:low=mid,mid=Math.floor((low+high)/2);return mid}function calcBasisFunctions(span,u,p,U){let N=[],left=[],right=[];N[0]=1;for(let j=1;j<=p;++j){left[j]=u-U[span+1-j],right[j]=U[span+j]-u;let saved=0;for(let r=0;r<j;++r){let rv=right[r+1],lv=left[j-r],temp=N[r]/(rv+lv);N[r]=saved+rv*temp,saved=lv*temp}N[j]=saved}return N}function calcBSplinePoint(p,U,P,u){let span=findSpan(p,u,U),N=calcBasisFunctions(span,u,p,U),C=new three_webgpu.Vector4(0,0,0,0);for(let j=0;j<=p;++j){let point=P[span-p+j],Nj=N[j],wNj=point.w*Nj;C.x+=point.x*wNj,C.y+=point.y*wNj,C.z+=point.z*wNj,C.w+=point.w*Nj}return C}function calcBasisFunctionDerivatives(span,u,p,n,U){let zeroArr=[];for(let i=0;i<=p;++i)zeroArr[i]=0;let ders=[];for(let i=0;i<=n;++i)ders[i]=zeroArr.slice(0);let ndu=[];for(let i=0;i<=p;++i)ndu[i]=zeroArr.slice(0);ndu[0][0]=1;let left=zeroArr.slice(0),right=zeroArr.slice(0);for(let j=1;j<=p;++j){left[j]=u-U[span+1-j],right[j]=U[span+j]-u;let saved=0;for(let r=0;r<j;++r){let rv=right[r+1],lv=left[j-r];ndu[j][r]=rv+lv;let temp=ndu[r][j-1]/ndu[j][r];ndu[r][j]=saved+rv*temp,saved=lv*temp}ndu[j][j]=saved}for(let j=0;j<=p;++j)ders[0][j]=ndu[j][p];for(let r=0;r<=p;++r){let s1=0,s2=1,a=[];for(let i=0;i<=p;++i)a[i]=zeroArr.slice(0);a[0][0]=1;for(let k=1;k<=n;++k){let d=0,rk=r-k,pk=p-k;r>=k&&(a[s2][0]=a[s1][0]/ndu[pk+1][rk],d=a[s2][0]*ndu[rk][pk]);let j1=rk>=-1?1:-rk,j2=r-1<=pk?k-1:p-r;for(let j=j1;j<=j2;++j)a[s2][j]=(a[s1][j]-a[s1][j-1])/ndu[pk+1][rk+j],d+=a[s2][j]*ndu[rk+j][pk];r<=pk&&(a[s2][k]=-a[s1][k-1]/ndu[pk+1][r],d+=a[s2][k]*ndu[r][pk]),ders[k][r]=d;let j=s1;s1=s2,s2=j}}let r=p;for(let k=1;k<=n;++k){for(let j=0;j<=p;++j)ders[k][j]*=r;r*=p-k}return ders}function calcBSplineDerivatives(p,U,P,u,nd){let du=nd<p?nd:p,CK=[],span=findSpan(p,u,U),nders=calcBasisFunctionDerivatives(span,u,p,du,U),Pw=[];for(let i=0;i<P.length;++i){let point=P[i].clone(),w=point.w;point.x*=w,point.y*=w,point.z*=w,Pw[i]=point}for(let k=0;k<=du;++k){let point=Pw[span-p].clone().multiplyScalar(nders[k][0]);for(let j=1;j<=p;++j)point.add(Pw[span-p+j].clone().multiplyScalar(nders[k][j]));CK[k]=point}for(let k=du+1;k<=nd+1;++k)CK[k]=new three_webgpu.Vector4(0,0,0);return CK}function calcKoverI(k,i){let nom=1;for(let j=2;j<=k;++j)nom*=j;let denom=1;for(let j=2;j<=i;++j)denom*=j;for(let j=2;j<=k-i;++j)denom*=j;return nom/denom}function calcRationalCurveDerivatives(Pders){let nd=Pders.length,Aders=[],wders=[];for(let i=0;i<nd;++i){let point=Pders[i];Aders[i]=new three_webgpu.Vector3(point.x,point.y,point.z),wders[i]=point.w}let CK=[];for(let k=0;k<nd;++k){let v=Aders[k].clone();for(let i=1;i<=k;++i)v.sub(CK[k-i].clone().multiplyScalar(calcKoverI(k,i)*wders[i]));CK[k]=v.divideScalar(wders[0])}return CK}function calcNURBSDerivatives(p,U,P,u,nd){return calcRationalCurveDerivatives(calcBSplineDerivatives(p,U,P,u,nd))}exports.loadFbx=loadFbx;
|