@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,804 @@
|
|
|
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
|
+
*/import{i as PBMMeshPhysicalMaterial,o as PBMMesh,s as PBMSkinnedMesh,t as PBMMeshBasicMaterial}from"./pbmMeshMaterial.mjs";import{d as noop,g as encodeNormalsToInt8Array,i as ROTATE_X_MATRIX_INVERSE,m as PBMPointCloud,u as internalFetcher}from"./memoryUsage.mjs";import{c as appendSearch,n as createImageBitmapLike,p as pathJoin,r as createImageBitmapLikeImage,t as canUseNativeImageBitmap}from"./imageBitmap.mjs";import{t as imageSupport}from"./imageSupport.mjs";import*as THREE from"three/webgpu";import{__awaiter}from"tslib";var WorkerPool=class{constructor(workerCreator,pool){this.disposed=!1,this.pool=pool,this.workerCreator=workerCreator,this.queue=[],this.workers=[],this.workerResolvers=[],this.workerStatus=0}setWorkerCreator(workerCreator){this.workerCreator=workerCreator}initWorker(workerId){if(!this.workerCreator)throw Error(`workerCreator is not defined`);if(!this.workers[workerId]){let worker=this.workerCreator(workerId);worker.addEventListener(`message`,this.onMessage.bind(this,workerId)),this.workers[workerId]=worker}}getIdleWorker(){for(let i=0;i<this.pool;i++)if(!(this.workerStatus&1<<i))return i;return-1}onMessage(workerId,event){let resolver=this.workerResolvers[workerId];if(event.data&&`$$error`in event.data?resolver==null||resolver.reject(event.data.$$error):resolver==null||resolver.resolve(event.data),this.workerResolvers[workerId]=void 0,this.queue.length){let{resolve,reject,input,transfer}=this.queue.shift();this.workerResolvers[workerId]={resolve,reject},this.workers[workerId].postMessage(input,transfer)}else this.workerStatus^=1<<workerId}postMessage(input,transfer=[]){return new Promise((resolve,reject)=>{if(this.disposed){reject(Error(`disposed`));return}let workerId=this.getIdleWorker();workerId===-1?this.queue.push({resolve,reject,input,transfer}):(this.initWorker(workerId),this.workerStatus|=1<<workerId,this.workerResolvers[workerId]={resolve,reject},this.workers[workerId].postMessage(input,transfer))})}dispose(){this.disposed=!0,this.workers.forEach(worker=>{worker.terminate()}),this.workers.length=0,this.workerResolvers.forEach(resolver=>{resolver==null||resolver.reject(Error(`disposed`))}),this.workerResolvers.length=0,this.queue.forEach(resolver=>{resolver.reject(Error(`disposed`))}),this.queue.length=0,this.workerStatus=0}};function decodeText(array){if(typeof TextDecoder<`u`)return new TextDecoder().decode(array);let s=``;for(let i=0,il=array.length;i<il;i++)s+=String.fromCharCode(array[i]);try{return decodeURIComponent(escape(s))}catch(e){return s}}var WEBGL_CONSTANTS={FLOAT:5126,FLOAT_MAT3:35675,FLOAT_MAT4:35676,FLOAT_VEC2:35664,FLOAT_VEC3:35665,FLOAT_VEC4:35666,LINEAR:9729,REPEAT:10497,SAMPLER_2D:35678,POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6,UNSIGNED_BYTE:5121,UNSIGNED_SHORT:5123},WEBGL_COMPONENT_TYPES={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array},WEBGL_FILTERS={9728:THREE.NearestFilter,9729:THREE.LinearFilter,9984:THREE.NearestMipmapNearestFilter,9985:THREE.LinearMipmapNearestFilter,9986:THREE.NearestMipmapLinearFilter,9987:THREE.LinearMipmapLinearFilter},WEBGL_WRAPPINGS={33071:THREE.ClampToEdgeWrapping,33648:THREE.MirroredRepeatWrapping,10497:THREE.RepeatWrapping},WEBGL_TYPE_SIZES={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},ATTRIBUTES={POSITION:`position`,NORMAL:`normal`,TANGENT:`tangent`,TEXCOORD_0:`uv`,TEXCOORD_1:`uv1`,TEXCOORD_2:`uv2`,TEXCOORD_3:`uv3`,COLOR_0:`color`,WEIGHTS_0:`skinWeight`,JOINTS_0:`skinIndex`},PATH_PROPERTIES={scale:`scale`,translation:`position`,rotation:`quaternion`,weights:`morphTargetInfluences`},INTERPOLATION={CUBICSPLINE:void 0,LINEAR:THREE.InterpolateLinear,STEP:THREE.InterpolateDiscrete},ALPHA_MODES={OPAQUE:`OPAQUE`,MASK:`MASK`,BLEND:`BLEND`};function values(object){let values=[];for(let key in object)values.push(object[key]);return values}function srgbToLinear(channel){return channel<=.04045?channel/12.92:Math.pow((channel+.055)/1.055,2.4)}function decodeSrgbChannel(value,normalized,maxValue){let encoded=normalized||value>1?value/maxValue:value;return srgbToLinear(Math.min(Math.max(encoded,0),1))}function composeDsiposeSet(disposeSet){let disposers=Array.from(disposeSet);return()=>{for(let disposer of disposers)typeof disposer.dispose==`function`&&disposer.dispose(),typeof disposer.close==`function`&&disposer.close()}}var Parser=class{constructor(json,extensions,options){if(this.json=json,this.json.materials){let nameScene=new Set;for(let materialDef of this.json.materials){if(typeof materialDef.name!=`string`)continue;let count=0;for(;materialDef.name;){let name=materialDef.name+(count>0?`__${count}`:``);if(!nameScene.has(name)){nameScene.add(name),materialDef.name=name;break}console.warn(`glTF: material name "${materialDef.name}" duplicated.`),count++}}nameScene.clear()}if(this.json.nodes){let nameScene=new Set;for(let nodeDef of this.json.nodes){if(typeof nodeDef.name!=`string`)continue;let count=0;for(;nodeDef.name;){let name=nodeDef.name+(count>0?`__${count}`:``);if(!nameScene.has(name)){nameScene.add(name),nodeDef.name=name;break}console.warn(`glTF: node name "${nodeDef.name}" duplicated.`),count++}}nameScene.clear()}this.extensions=extensions,this.options=options,this.cache=new Map,this.disposeSet=new Set,this.textureSet=new Set,this.nodeNamesUsed={}}dispose(){this.cache.clear(),this.disposeSet.forEach(disposer=>{typeof disposer.dispose==`function`&&disposer.dispose(),typeof disposer.close==`function`&&disposer.close()}),this.disposeSet.clear(),this.textureSet.clear(),this.extensions={},this.json={asset:{version:`unknown`}}}markDefs(){let nodeDefs=this.json.nodes||[],skinDefs=this.json.skins||[],meshDefs=this.json.meshes||[];for(let skinIndex=0,skinLength=skinDefs.length;skinIndex<skinLength;skinIndex++){let joints=skinDefs[skinIndex].joints;for(let i=0,il=joints.length;i<il;i++)nodeDefs[joints[i]].isBone=!0}for(let nodeIndex=0,nodeLength=nodeDefs.length;nodeIndex<nodeLength;nodeIndex++){let nodeDef=nodeDefs[nodeIndex];nodeDef.mesh!==void 0&&nodeDef.skin!==void 0&&(meshDefs[nodeDef.mesh].isSkinnedMesh=!0)}}parse(){let json=this.json,extensions=this.extensions;this.markDefs();for(let extension of values(extensions))extension.markDefs(this);return Promise.all(values(extensions).map(extension=>extension.prepare(this))).then(()=>{var _a,_b,_c;return Promise.all([Promise.all(((_a=json.scenes)==null?[]:_a).map((_,index)=>this.loadScene(index))),Promise.all(((_b=json.cameras)==null?[]:_b).map((_,index)=>this.loadCamera(index))),Promise.all(((_c=json.animations)==null?[]:_c).map((_,index)=>this.loadAnimation(index)))])}).then(([scenes,cameras,animations])=>({json,scene:scenes[json.scene||0],scenes,animations,cameras,textures:[],dispose:noop})).then(result=>Promise.all(values(extensions).map(extension=>extension.emitResult(result,this))).then(()=>result)).then(result=>{let textures=Array.from(this.textureSet),dispose=composeDsiposeSet(this.disposeSet);return Object.assign(result,{textures,dispose}),this.textureSet.clear(),this.disposeSet.clear(),this.dispose(),result})}loadCamera(index){let cacheKey=`camera:`+index,dependency=this.cache.get(cacheKey);if(dependency)return dependency;let promise=null;for(let extension of values(this.extensions))if(promise=extension.loadCamera(index,this),promise)break;if(!promise){let camera,cameraDef=this.json.cameras[index],params=cameraDef[cameraDef.type];params?cameraDef.type===`perspective`?camera=new THREE.PerspectiveCamera(THREE.MathUtils.radToDeg(params.yfov),params.aspectRatio||1,params.znear||1,params.zfar||2e6):cameraDef.type===`orthographic`?camera=new THREE.OrthographicCamera(-params.xmag,params.xmag,params.ymag,-params.ymag,params.znear,params.zfar):(console.warn(`glTF: Invalid camera type ${cameraDef.type}.`),camera=new THREE.Camera):(console.warn(`glTF: Missing camera parameters.`),camera=new THREE.Camera),cameraDef.name&&(camera.name=cameraDef.name),promise=Promise.resolve(camera)}return this.cache.set(cacheKey,promise),promise}loadSkin(index){let cacheKey=`skin:`+index,dependency=this.cache.get(cacheKey);if(dependency)return dependency;let promise,skinDef=this.json.skins[index],skinEntry={joints:skinDef.joints};return promise=skinDef.inverseBindMatrices===void 0?Promise.resolve(skinEntry):this.loadAccessor(skinDef.inverseBindMatrices).then(attribute=>(attribute&&(skinEntry.inverseBindMatrices=attribute),skinEntry)),this.cache.set(cacheKey,promise),promise}loadAnimation(index){var _a;let cacheKey=`animation:`+index,dependency=this.cache.get(cacheKey);if(dependency)return dependency;let promise=null;for(let extension of values(this.extensions))if(promise=extension.loadAnimation(index,this),promise)break;if(!promise){let animationDef=this.json.animations[index],animationName=animationDef.name?animationDef.name:`animation_`+index,pendingNodes=[],pendingInputAccessors=[],pendingOutputAccessors=[],pendingSamplers=[],pendingTargets=[];for(let i=0,il=animationDef.channels.length;i<il;i++){let channel=animationDef.channels[i],sampler=animationDef.samplers[channel.sampler],target=channel.target,name=target.node===void 0?target.id:target.node,input=animationDef.parameters===void 0?sampler.input:animationDef.parameters[sampler.input],output=animationDef.parameters===void 0?sampler.output:animationDef.parameters[sampler.output],extensions=(_a=target.extensions)==null?{}:_a;if(target.path===`pointer`&&extensions.KHR_animation_pointer&&extensions.KHR_animation_pointer.pointer&&/^\/nodes\/\d+\//.test(extensions.KHR_animation_pointer.pointer)){let tokens=extensions.KHR_animation_pointer.pointer.slice(1).split(`/`),name=Number(tokens[1]);pendingNodes.push(this.loadNode(name))}else name===void 0?pendingNodes.push(Promise.resolve(null)):pendingNodes.push(this.loadNode(name));pendingInputAccessors.push(this.loadAccessor(input)),pendingOutputAccessors.push(this.loadAccessor(output)),pendingSamplers.push(sampler),pendingTargets.push(target)}promise=Promise.all([Promise.all(pendingNodes),Promise.all(pendingInputAccessors),Promise.all(pendingOutputAccessors),Promise.all(pendingSamplers),Promise.all(pendingTargets)]).then(([nodes,inputAccessors,outputAccessors,samplers,targets])=>{var _a;let tracks=[];for(let i=0,il=nodes.length;i<il;i++){let node=nodes[i],inputAccessor=inputAccessors[i],outputAccessor=outputAccessors[i],sampler=samplers[i],target=targets[i];node&&(node.updateMatrix(),node.matrixAutoUpdate=!0);let outputArray=outputAccessor.array;if(outputAccessor.normalized){let scale=getNormalizedComponentScale(outputArray.constructor),scaled=new Float32Array(outputArray.length);for(let j=0,jl=outputArray.length;j<jl;j++)scaled[j]=outputArray[j]*scale;outputArray=scaled}let interpolation=sampler.interpolation===void 0?THREE.InterpolateLinear:INTERPOLATION[sampler.interpolation],extensions=(_a=target.extensions)==null?{}:_a;if(extensions.KHR_animation_pointer&&target.path&&target.path===`pointer`){let pointer=extensions.KHR_animation_pointer.pointer;if(pointer.indexOf(`/nodes/`)===0){let matched=pointer.match(/^\/nodes\/(\d+)\/(.+)/);if(!matched)continue;Number(matched[1]);let property=matched[2],TypedKeyframeTrack;switch(property){case`weights`:property=`morphTargetInfluences`,TypedKeyframeTrack=THREE.NumberKeyframeTrack;break;case`rotation`:property=`quaternion`,TypedKeyframeTrack=THREE.QuaternionKeyframeTrack;break;case`translation`:property=`position`,TypedKeyframeTrack=THREE.VectorKeyframeTrack;break;case`scale`:property=`scale`,TypedKeyframeTrack=THREE.VectorKeyframeTrack;break;case`extensions/KHR_node_visibility/visible`:property=`visible`,TypedKeyframeTrack=THREE.BooleanKeyframeTrack;break;default:break}if(!TypedKeyframeTrack)continue;let targetNames=[];if(node){let targetName=node.name?node.name:node.uuid;property===`morphTargetInfluences`?node.traverse(object=>{object.morphTargetInfluences&&targetNames.push(object.name?object.name:object.uuid)}):targetNames.push(targetName)}for(let j=0,jl=targetNames.length;j<jl;j++){let track=new TypedKeyframeTrack(`.nodes.${targetNames[j]}.${property}`,inputAccessor.array,TypedKeyframeTrack===THREE.BooleanKeyframeTrack?Array.from(outputArray).map(num=>num>0):outputArray,interpolation);tracks.push(track)}}else if(pointer.indexOf(`/materials/`)===0){let matched=pointer.match(/^\/materials\/(\d+)\/(.+)/);if(!matched)continue;let name=Number(matched[1]),property=matched[2],materialName=this.json.materials[name].name,TypedKeyframeTrack;switch(property){case`pbrMetallicRoughness/baseColorFactor`:property=`color`,TypedKeyframeTrack=THREE.ColorKeyframeTrack;break;case`pbrMetallicRoughness/roughnessFactor`:property=`roughness`,TypedKeyframeTrack=THREE.NumberKeyframeTrack;break;case`pbrMetallicRoughness/metallicFactor`:property=`metalness`,TypedKeyframeTrack=THREE.NumberKeyframeTrack;break;case`emissiveFactor`:property=`emissive`,TypedKeyframeTrack=THREE.NumberKeyframeTrack;break;case`alphaCutoff`:property=`alphaTest`,TypedKeyframeTrack=THREE.NumberKeyframeTrack;break;case`occlusionTexture/strength`:property=`aoMapIntensity`,TypedKeyframeTrack=THREE.NumberKeyframeTrack;break;case`normalTexture/scale`:property=`normalScale`,TypedKeyframeTrack=THREE.VectorKeyframeTrack;break;case`pbrMetallicRoughness/baseColorTexture/extensions/KHR_texture_transform/scale`:property=`map.repeat`,TypedKeyframeTrack=THREE.VectorKeyframeTrack;break;case`pbrMetallicRoughness/baseColorTexture/extensions/KHR_texture_transform/offset`:property=`map.offset`,TypedKeyframeTrack=THREE.VectorKeyframeTrack;break;case`pbrMetallicRoughness/baseColorTexture/extensions/KHR_texture_transform/rotation`:property=`map.rotation`,TypedKeyframeTrack=THREE.NumberKeyframeTrack;break;case`normalTexture/extensions/KHR_texture_transform/scale`:property=`normalMap.repeat`,TypedKeyframeTrack=THREE.VectorKeyframeTrack;break;case`normalTexture/extensions/KHR_texture_transform/offset`:property=`normalMap.offset`,TypedKeyframeTrack=THREE.VectorKeyframeTrack;break;case`normalTexture/extensions/KHR_texture_transform/rotation`:property=`normalMap.rotation`,TypedKeyframeTrack=THREE.NumberKeyframeTrack;break;case`emissiveTexture/extensions/KHR_texture_transform/scale`:property=`emissiveMap.repeat`,TypedKeyframeTrack=THREE.VectorKeyframeTrack;break;case`emissiveTexture/extensions/KHR_texture_transform/offset`:property=`emissiveMap.offset`,TypedKeyframeTrack=THREE.VectorKeyframeTrack;break;case`emissiveTexture/extensions/KHR_texture_transform/rotation`:property=`emissiveMap.rotation`,TypedKeyframeTrack=THREE.NumberKeyframeTrack;break;case`occlusionTexture/extensions/KHR_texture_transform/scale`:property=`aoMap.repeat`,TypedKeyframeTrack=THREE.VectorKeyframeTrack;break;case`occlusionTexture/extensions/KHR_texture_transform/offset`:property=`aoMap.offset`,TypedKeyframeTrack=THREE.VectorKeyframeTrack;break;case`occlusionTexture/extensions/KHR_texture_transform/rotation`:property=`aoMap.rotation`,TypedKeyframeTrack=THREE.NumberKeyframeTrack;break;case`extensions/KHR_materials_clearcoat/clearcoatNormalTexture/extensions/KHR_texture_transform/scale`:property=`clearcoatNormalMap.scale`,TypedKeyframeTrack=THREE.NumberKeyframeTrack;break;case`extensions/KHR_materials_clearcoat/clearcoatNormalTexture/extensions/KHR_texture_transform/offset`:property=`clearcoatNormalMap.offset`,TypedKeyframeTrack=THREE.VectorKeyframeTrack;break;case`extensions/KHR_materials_clearcoat/clearcoatNormalTexture/extensions/KHR_texture_transform/rotation`:property=`clearcoatNormalMap.rotation`,TypedKeyframeTrack=THREE.NumberKeyframeTrack;break;default:break}if(!TypedKeyframeTrack)continue;let track=new TypedKeyframeTrack(`.materials.${materialName}.${property}`,inputAccessor.array,outputArray,interpolation);if(tracks.push(track),property===`color`&&outputAccessor.itemSize===4){let opacityArray=new Float32Array(outputArray.length/4);for(let j=0,jl=outputArray.length/4;j<jl;j+=1)opacityArray[j]=outputArray[j*4+3];let opacityTrack=new THREE.NumberKeyframeTrack(`.materials.${materialName}.opacity`,inputAccessor.array,opacityArray,interpolation);tracks.push(opacityTrack)}}else if(pointer.indexOf(`/cameras/`)===0){let matched=pointer.match(/^\/cameras\/(\d+)\/(.+)/);if(!matched)continue;let name=Number(matched[1]),property=matched[2],cameraName=this.json.cameras[name].name,TypedKeyframeTrack;switch(property){case`perspective/yfov`:property=`fov`,TypedKeyframeTrack=THREE.NumberKeyframeTrack;break;case`perspective/znear`:case`orthographic/znear`:property=`near`,TypedKeyframeTrack=THREE.NumberKeyframeTrack;break;case`perspective/zfar`:case`orthographic/zfar`:property=`far`,TypedKeyframeTrack=THREE.NumberKeyframeTrack;break;case`perspective/aspect`:property=`aspect`,TypedKeyframeTrack=THREE.NumberKeyframeTrack;break;default:break}if(!TypedKeyframeTrack)continue;let track=new TypedKeyframeTrack(`.cameras.${cameraName}.${property}`,inputAccessor.array,outputArray,interpolation);tracks.push(track)}}else{let TypedKeyframeTrack;switch(PATH_PROPERTIES[target.path]){case PATH_PROPERTIES.weights:TypedKeyframeTrack=THREE.NumberKeyframeTrack;break;case PATH_PROPERTIES.rotation:TypedKeyframeTrack=THREE.QuaternionKeyframeTrack;break;case PATH_PROPERTIES.position:case PATH_PROPERTIES.scale:default:TypedKeyframeTrack=THREE.VectorKeyframeTrack;break}let targetNames=[];if(node){let targetName=node.name?node.name:node.uuid;PATH_PROPERTIES[target.path]===PATH_PROPERTIES.weights?node.traverse(object=>{object.morphTargetInfluences&&targetNames.push(object.name?object.name:object.uuid)}):targetNames.push(targetName)}let outputArray=outputAccessor.array;if(outputAccessor.normalized){let scale=getNormalizedComponentScale(outputArray.constructor),scaled=new Float32Array(outputArray.length);for(let j=0,jl=outputArray.length;j<jl;j++)scaled[j]=outputArray[j]*scale;outputArray=scaled}for(let j=0,jl=targetNames.length;j<jl;j++){let track=new TypedKeyframeTrack(targetNames[j]+`.`+PATH_PROPERTIES[target.path],inputAccessor.array,outputArray,interpolation);tracks.push(track)}}}return new THREE.AnimationClip(animationName,void 0,tracks)})}return this.cache.set(cacheKey,promise),promise}loadBuffer(index){let bufferDef=this.json.buffers[index];if(bufferDef.type&&bufferDef.type!==`arraybuffer`)throw Error(`glTF: `+bufferDef.type+` buffer type is not supported.`);let cacheKey=`buffer:`+index,dependency=this.cache.get(cacheKey);if(dependency)return dependency;let promise=null;for(let extension of values(this.extensions))if(promise=extension.loadBuffer(index,this),promise)break;if(!promise){let bufferDef=this.json.buffers[index];promise=this.options.fetcher.ajax(this.resolveResouce(bufferDef.uri),{responseType:`arraybuffer`}).then(response=>response.body)}return this.cache.set(cacheKey,promise),promise}loadBufferView(index){let cacheKey=`bufferView:`+index,dependency=this.cache.get(cacheKey);if(dependency)return dependency;let promise=null;for(let extension of values(this.extensions))if(promise=extension.loadBufferView(index,this),promise)break;if(!promise){let bufferViewDef=this.json.bufferViews[index];promise=this.loadBuffer(bufferViewDef.buffer).then(buffer=>{let byteLength=bufferViewDef.byteLength||0,byteOffset=bufferViewDef.byteOffset||0;return buffer.slice(byteOffset,byteOffset+byteLength)})}return this.cache.set(cacheKey,promise),promise}loadAccessor(index){let cacheKey=`accessor:`+index,dependency=this.cache.get(cacheKey);if(dependency)return dependency;let promise=null;if(!promise){let accessorDef=this.json.accessors[index];if(accessorDef.bufferView===void 0&&accessorDef.sparse===void 0)promise=Promise.resolve(null);else{let pendingBufferViews=[];accessorDef.bufferView===void 0?pendingBufferViews.push(Promise.resolve(null)):pendingBufferViews.push(this.loadBufferView(accessorDef.bufferView)),accessorDef.sparse!==void 0&&(pendingBufferViews.push(this.loadBufferView(accessorDef.sparse.indices.bufferView)),pendingBufferViews.push(this.loadBufferView(accessorDef.sparse.values.bufferView))),promise=Promise.all(pendingBufferViews).then(bufferViews=>{let bufferView=bufferViews[0],itemSize=WEBGL_TYPE_SIZES[accessorDef.type],TypedArray=WEBGL_COMPONENT_TYPES[accessorDef.componentType],elementBytes=TypedArray.BYTES_PER_ELEMENT,itemBytes=elementBytes*itemSize,byteOffset=accessorDef.byteOffset||0,byteStride=accessorDef.bufferView===void 0?void 0:this.json.bufferViews[accessorDef.bufferView].byteStride,normalized=accessorDef.normalized===!0,array,bufferAttribute;if(byteStride&&byteStride!==itemBytes){let ibSlice=Math.floor(byteOffset/byteStride),ibCacheKey=`InterleavedBuffer:`+accessorDef.bufferView+`:`+accessorDef.componentType+`:`+ibSlice+`:`+accessorDef.count,ib=this.cache.get(ibCacheKey);ib||(array=new TypedArray(bufferView,ibSlice*byteStride,accessorDef.count*byteStride/elementBytes),ib=new THREE.InterleavedBuffer(array,byteStride/elementBytes),this.cache.set(ibCacheKey,ib)),bufferAttribute=new THREE.InterleavedBufferAttribute(ib,itemSize,byteOffset%byteStride/elementBytes,normalized)}else array=bufferView===null?new TypedArray(accessorDef.count*itemSize):new TypedArray(bufferView,byteOffset,accessorDef.count*itemSize),bufferAttribute=new THREE.BufferAttribute(array,itemSize,normalized);if(accessorDef.sparse!==void 0){let itemSizeIndices=WEBGL_TYPE_SIZES.SCALAR,TypedArrayIndices=WEBGL_COMPONENT_TYPES[accessorDef.sparse.indices.componentType],byteOffsetIndices=accessorDef.sparse.indices.byteOffset||0,byteOffsetValues=accessorDef.sparse.values.byteOffset||0,sparseIndices=new TypedArrayIndices(bufferViews[1],byteOffsetIndices,accessorDef.sparse.count*itemSizeIndices),sparseValues=new TypedArray(bufferViews[2],byteOffsetValues,accessorDef.sparse.count*itemSize);bufferView!==null&&(bufferAttribute=new THREE.BufferAttribute(bufferAttribute.array.slice(),bufferAttribute.itemSize,bufferAttribute.normalized));for(let i=0,il=sparseIndices.length;i<il;i++){let index=sparseIndices[i];if(bufferAttribute.setX(index,sparseValues[i*itemSize]),itemSize>=2&&bufferAttribute.setY(index,sparseValues[i*itemSize+1]),itemSize>=3&&bufferAttribute.setZ(index,sparseValues[i*itemSize+2]),itemSize>=4&&bufferAttribute.setW(index,sparseValues[i*itemSize+3]),itemSize>=5)throw Error(`THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.`)}}return bufferAttribute})}}return this.cache.set(cacheKey,promise),promise}createPrimitiveKey(primitiveDef){for(let extension of values(this.extensions)){let key=extension.createPrimitiveKey(primitiveDef,this);if(key)return key}let attributesKey=``,keys=Object.keys(primitiveDef.attributes).sort();for(let i=0,il=keys.length;i<il;i++)attributesKey+=keys[i]+`:`+primitiveDef.attributes[keys[i]]+`;`;return primitiveDef.indices+`:`+attributesKey+`:`+primitiveDef.mode}loadGeometry(primitiveDef){let promise=null;for(let extension of values(this.extensions))if(promise=extension.loadGeometry(primitiveDef,this),promise)break;return promise||(promise=this.addGeometryPrimitiveAttributes(new THREE.BufferGeometry,primitiveDef)),promise=promise.then(geometry=>(this.disposeSet.add(geometry),geometry)),promise}loadImage(index){let promise=null;for(let extension of values(this.extensions))if(promise=extension.loadImage(index,this),promise)break;if(!promise){let imageDef=this.json.images[index];if(imageDef.bufferView!==void 0){let bufferViewDef=this.json.bufferViews[imageDef.bufferView];promise=this.loadBuffer(bufferViewDef.buffer).then(buffer=>{let byteOffset=bufferViewDef.byteOffset||0,byteLength=bufferViewDef.byteLength||0,data=new Uint8Array(buffer,byteOffset,byteLength);return createImageBitmapLike(new Blob([data],{type:imageDef.mimeType}))})}else if(imageDef.uri){let source=this.resolveResouce(imageDef.uri);promise=canUseNativeImageBitmap()?this.options.fetcher.ajax(source,{responseType:`blob`}).then(response=>{let blob=response.body;return createImageBitmapLike(blob)}):this.options.fetcher.loadImage(source,{},void 0,void 0,void 0,createImageBitmapLikeImage()).then(response=>response.body)}else throw Error(`glTF: Invalid image defs.`)}return promise=promise.then(image=>(this.disposeSet.add(image),image)),promise}loadMeshPrimitive(meshDef,primitiveDef){let promise=null;for(let extension of values(this.extensions))if(promise=extension.loadMeshPrimitive(meshDef,primitiveDef,this),promise)break;if(!promise){let geometriyPromise=this.loadGeometry(primitiveDef),materialPromise=this.loadMaterial(primitiveDef);promise=Promise.all([geometriyPromise,materialPromise]).then(([geometry,material])=>{var _a,_b,_c,_d,_e,_f,_g,_h,_j,_k,_l,_m,_o,_p,_q;let mode=(_a=primitiveDef.mode)==null?WEBGL_CONSTANTS.TRIANGLES:_a,mesh;if(mode===WEBGL_CONSTANTS.TRIANGLES||mode===WEBGL_CONSTANTS.TRIANGLE_STRIP||mode===WEBGL_CONSTANTS.TRIANGLE_FAN)if(mode===WEBGL_CONSTANTS.TRIANGLE_STRIP?geometry=this.toGeometryTrianglesDrawMode(geometry,THREE.TriangleStripDrawMode):mode===WEBGL_CONSTANTS.TRIANGLE_FAN&&(geometry=this.toGeometryTrianglesDrawMode(geometry,THREE.TriangleFanDrawMode)),geometry.clearGroups(),geometry.addGroup(0,geometry.index?geometry.index.count:geometry.attributes.position.count,0),this.disposeSet.add(geometry),meshDef.isSkinnedMesh){let skinnedMesh=new PBMSkinnedMesh(geometry,[material]);this.normalizeSkinWeights(skinnedMesh),mesh=skinnedMesh}else mesh=new PBMMesh(geometry,[material]);else if(mode===WEBGL_CONSTANTS.LINES)mesh=new THREE.LineSegments(geometry,material);else if(mode===WEBGL_CONSTANTS.LINE_STRIP)mesh=new THREE.Line(geometry,material);else if(mode===WEBGL_CONSTANTS.LINE_LOOP)mesh=new THREE.LineLoop(geometry,material);else if(mode===WEBGL_CONSTANTS.POINTS){let positionAttr=geometry.getAttribute(`position`),colorAttr=geometry.getAttribute(`color`),numPoints=(_b=positionAttr==null?void 0:positionAttr.count)==null?0:_b,positions=new Float32Array;if(positionAttr&&positionAttr.array instanceof Float32Array&&positionAttr.itemSize===3)positions=positionAttr.array;else if(positionAttr){positions=new Float32Array(numPoints*3);let source=positionAttr.array,itemSize=Math.max(1,positionAttr.itemSize);for(let i=0;i<numPoints;i++){let srcBase=i*itemSize,dstBase=i*3;positions[dstBase]=(_c=source[srcBase])==null?0:_c,positions[dstBase+1]=(_d=source[srcBase+1])==null?0:_d,positions[dstBase+2]=(_e=source[srcBase+2])==null?0:_e}}let colors=new Float32Array(numPoints*3);if(colorAttr&&colorAttr.array instanceof Float32Array&&colorAttr.itemSize===3&&colorAttr.normalized!==!0)colors=colorAttr.array;else if(colorAttr){let source=colorAttr.array,itemSize=Math.max(1,colorAttr.itemSize);if(colorAttr.normalized&&source.length>0){let typedSource=colorAttr.array,bytesPerElement=`BYTES_PER_ELEMENT`in typedSource?typedSource.BYTES_PER_ELEMENT:1,maxValue=Math.pow(2,bytesPerElement*8)-1;for(let i=0;i<numPoints;i++){let srcBase=i*itemSize,dstBase=i*3;colors[dstBase]=decodeSrgbChannel((_f=source[srcBase])==null?0:_f,!0,maxValue),colors[dstBase+1]=decodeSrgbChannel((_h=(_g=source[srcBase+1])==null?source[srcBase]:_g)==null?0:_h,!0,maxValue),colors[dstBase+2]=decodeSrgbChannel((_k=(_j=source[srcBase+2])==null?source[srcBase]:_j)==null?0:_k,!0,maxValue)}}else{let typedSource=colorAttr.array,bytesPerElement=`BYTES_PER_ELEMENT`in typedSource?typedSource.BYTES_PER_ELEMENT:1,maxValue=Math.pow(2,bytesPerElement*8)-1;for(let i=0;i<numPoints;i++){let srcBase=i*itemSize,dstBase=i*3;colors[dstBase]=decodeSrgbChannel((_l=source[srcBase])==null?0:_l,!1,maxValue),colors[dstBase+1]=decodeSrgbChannel((_o=(_m=source[srcBase+1])==null?source[srcBase]:_m)==null?0:_o,!1,maxValue),colors[dstBase+2]=decodeSrgbChannel((_q=(_p=source[srcBase+2])==null?source[srcBase]:_p)==null?0:_q,!1,maxValue)}}}let normalAttr=geometry.getAttribute(`normal`),normals=normalAttr?encodeNormalsToInt8Array({array:normalAttr.array,itemSize:normalAttr.itemSize,normalized:normalAttr.normalized},numPoints):null;mesh=new PBMPointCloud({numPoints,positions,colors,normals})}else throw Error(`glTF: Primitive mode unsupported: `+mode);if(!(mesh instanceof PBMPointCloud)&&Object.keys(geometry.morphAttributes).length>0){if(meshDef.weights!==void 0)for(let i=0,il=meshDef.weights.length;i<il;i++)mesh.morphTargetInfluences[i]=meshDef.weights[i];if(meshDef.extras&&Array.isArray(meshDef.extras.targetNames)){let targetNames=meshDef.extras.targetNames;if(mesh.morphTargetInfluences.length===targetNames.length){mesh.morphTargetDictionary={};for(let i=0,il=targetNames.length;i<il;i++)mesh.morphTargetDictionary[targetNames[i]]=i}else console.warn(`glTF: Invalid extras.targetNames length. Ignoring names.`)}}return mesh})}return promise}loadMesh(index){let promise=null;for(let extension of values(this.extensions))if(promise=extension.loadMesh(index,this),promise)break;if(!promise){let meshDef=this.json.meshes[index],primitives=meshDef.primitives;promise=Promise.all(primitives.map(primitiveDef=>this.loadMeshPrimitive(meshDef,primitiveDef))).then(meshes=>{for(let primitiveIndex=0;primitiveIndex<primitives.length;primitiveIndex++){let mesh=meshes[primitiveIndex];mesh.name=meshDef.name||`mesh_`+index,mesh instanceof PBMPointCloud||this.assignFinalMaterial(mesh),meshes.push(mesh)}if(meshes.length===1)return meshes[0];let group=new THREE.Group;group.name=meshDef.name;for(let mesh of meshes)group.add(mesh);return group})}return promise}loadMaterial(primitiveDef){var _a;let mode=(_a=primitiveDef.mode)==null?WEBGL_CONSTANTS.TRIANGLES:_a,cacheKey=`material:`+this.createPrimitiveKey(primitiveDef),dependency=this.cache.get(cacheKey);if(dependency)return dependency;let promise=null;for(let extension of values(this.extensions))if(promise=extension.loadMaterial(primitiveDef,this),promise)break;if(!promise){if(mode===WEBGL_CONSTANTS.TRIANGLES||mode===WEBGL_CONSTANTS.TRIANGLE_STRIP||mode===WEBGL_CONSTANTS.TRIANGLE_FAN)promise=this.loadMaterialAsPBMMeshMaterial(primitiveDef);else if(mode===WEBGL_CONSTANTS.LINES||mode===WEBGL_CONSTANTS.LINE_STRIP||mode===WEBGL_CONSTANTS.LINE_LOOP)promise=this.loadMaterialAsLineBasicMaterial(primitiveDef);else if(mode===WEBGL_CONSTANTS.POINTS)promise=this.loadMaterialAsPointsMaterial(primitiveDef);else throw Error(`glTF: Primitive mode unsupported: `+mode);promise=promise.then(material=>Promise.all(values(this.extensions).map(extension=>extension.extendMaterial(material,primitiveDef,this))).then(()=>material))}return promise}loadMaterialAsPointsMaterial(_primitiveDef){let material=new THREE.ShaderMaterial;return this.disposeSet.add(material),Promise.resolve(material)}loadMaterialAsPBMMeshMaterial(primitiveDef){let pending=[],materialDef=primitiveDef.material===void 0?void 0:this.json.materials[primitiveDef.material],material=materialDef!=null&&materialDef.extensions&&materialDef.extensions.KHR_materials_unlit?new PBMMeshBasicMaterial:new PBMMeshPhysicalMaterial;if(material.color=new THREE.Color(1,1,1),material.opacity=1,material.colorAlpha=1,materialDef){materialDef.name&&(material.name=materialDef.name);let metallicRoughness=materialDef.pbrMetallicRoughness||{};if(Array.isArray(metallicRoughness.baseColorFactor)){let array=metallicRoughness.baseColorFactor;material.color=new THREE.Color().fromArray(array),material.colorAlpha=array[3],material.opacity=array[3]}metallicRoughness.baseColorTexture!==void 0&&pending.push(this.createMaterialTexture(metallicRoughness.baseColorTexture).then(texture=>{texture.colorSpace=THREE.SRGBColorSpace,material.map=texture,materialDef.alphaMode===ALPHA_MODES.MASK&&!(texture instanceof THREE.CompressedTexture)&&texture.minFilter!==THREE.LinearMipmapLinearFilter&&(texture.minFilter=THREE.LinearMipmapLinearFilter,texture.generateMipmaps=!0),this.disposeSet.add(texture)})),material instanceof PBMMeshPhysicalMaterial&&(material.metalness=metallicRoughness.metallicFactor===void 0?1:metallicRoughness.metallicFactor,material.roughness=metallicRoughness.roughnessFactor===void 0?1:metallicRoughness.roughnessFactor,metallicRoughness.metallicRoughnessTexture!==void 0&&pending.push(this.createMaterialTexture(metallicRoughness.metallicRoughnessTexture).then(texture=>{material.roughnessMap=texture,material.metalnessMap=texture,this.disposeSet.add(texture)}))),materialDef.doubleSided===!0&&(material.side=THREE.DoubleSide);let alphaMode=materialDef.alphaMode||ALPHA_MODES.OPAQUE;if(material.alphaMode=`OPAQUE`,alphaMode===ALPHA_MODES.BLEND?(material.alphaMode=`BLEND`,material.transparent=!0,material.depthWrite=!1):(material.transparent=!1,alphaMode===ALPHA_MODES.MASK&&(material.alphaMode=`MASK`,material.alphaTest=materialDef.alphaCutoff===void 0?.5:materialDef.alphaCutoff)),material instanceof PBMMeshPhysicalMaterial){if(materialDef.normalTexture!==void 0&&(pending.push(this.createMaterialTexture(materialDef.normalTexture).then(texture=>{this.disposeSet.add(texture),material.normalMap=texture})),material.normalScale=new THREE.Vector2(1,1),materialDef.normalTexture.scale!==void 0)){let scale=materialDef.normalTexture.scale;material.normalScale.set(scale,scale)}materialDef.occlusionTexture!==void 0&&(pending.push(this.createMaterialTexture(materialDef.occlusionTexture).then(texture=>{material.aoMap=texture,this.disposeSet.add(texture)})),materialDef.occlusionTexture.strength!==void 0&&(material.aoMapIntensity=materialDef.occlusionTexture.strength)),materialDef.emissiveFactor!==void 0&&(material.emissive=new THREE.Color().fromArray(materialDef.emissiveFactor)),materialDef.emissiveTexture!==void 0&&pending.push(this.createMaterialTexture(materialDef.emissiveTexture).then(texture=>{texture.colorSpace=THREE.SRGBColorSpace,material.emissiveMap=texture,this.disposeSet.add(texture)}))}}return this.disposeSet.add(material),Promise.all(pending).then(()=>material)}loadMaterialAsLineBasicMaterial(primitiveDef){let pending=[],material=new THREE.LineBasicMaterial;if(material.color=new THREE.Color(1,1,1),material.opacity=1,primitiveDef.material!==void 0){let materialDef=this.json.materials[primitiveDef.material];materialDef.name&&(material.name=materialDef.name);let metallicRoughness=materialDef.pbrMetallicRoughness||{};if(Array.isArray(metallicRoughness.baseColorFactor)){let array=metallicRoughness.baseColorFactor;material.color.fromArray(array),material.opacity=array[3]}materialDef.doubleSided===!0&&(material.side=THREE.DoubleSide);let alphaMode=materialDef.alphaMode||ALPHA_MODES.OPAQUE;alphaMode===ALPHA_MODES.BLEND?(material.transparent=!0,material.depthWrite=!1):(material.transparent=!1,alphaMode===ALPHA_MODES.MASK&&(material.alphaTest=materialDef.alphaCutoff===void 0?.5:materialDef.alphaCutoff))}return this.disposeSet.add(material),Promise.all(pending).then(()=>material)}loadTexture(index){let cacheKey=`texture:`+index,dependency=this.cache.get(cacheKey);if(dependency)return dependency;let promise=null;for(let extension of values(this.extensions))if(promise=extension.loadTexture(index,this),promise)break;if(!promise){let textureDef=this.json.textures[index];promise=this.loadImage(textureDef.source).then(image=>{let texture=new THREE.Texture(image);texture.needsUpdate=!0,texture.flipY=!1,textureDef.name&&(texture.name=textureDef.name);let sampler=(this.json.samplers||{})[textureDef.sampler]||{};return texture.magFilter=WEBGL_FILTERS[sampler.magFilter]||THREE.LinearFilter,texture.minFilter=WEBGL_FILTERS[sampler.minFilter]||THREE.LinearMipmapLinearFilter,texture.wrapS=WEBGL_WRAPPINGS[sampler.wrapS]||THREE.RepeatWrapping,texture.wrapT=WEBGL_WRAPPINGS[sampler.wrapT]||THREE.RepeatWrapping,texture.onUpdate=function(){image.close()},texture})}return promise=promise.then(texture=>(this.disposeSet.add(texture),texture)),this.cache.set(cacheKey,promise),promise}normalizeSkinWeights(skinnedMesh){let geometry=skinnedMesh.geometry,skinWeight=geometry.attributes.skinWeight,totalWeights=1;if(skinWeight.array instanceof Uint8Array?totalWeights=255:skinWeight.array instanceof Uint16Array?totalWeights=65535:skinWeight.array instanceof Uint32Array&&(totalWeights=4294967295),totalWeights>1){let count=skinWeight.count,itemSize=skinWeight.itemSize,normalized=skinWeight.normalized,floatSkinWeight=new THREE.BufferAttribute(new Float32Array(count*itemSize),itemSize,normalized);for(let i=0;i<count;i++)floatSkinWeight.setX(i,skinWeight.getX(i)/totalWeights),floatSkinWeight.setY(i,skinWeight.getY(i)/totalWeights),floatSkinWeight.setZ(i,skinWeight.getZ(i)/totalWeights),floatSkinWeight.setW(i,skinWeight.getW(i)/totalWeights);geometry.attributes.skinWeight=floatSkinWeight}skinWeight.normalized||skinnedMesh.normalizeSkinWeights()}assignFinalMaterial(mesh){let geometry=mesh.geometry,materials=[].concat(mesh.material),useVertexTangents=geometry.attributes.tangent!==void 0,useVertexColors=geometry.attributes.color!==void 0,useFlatShading=geometry.attributes.normal===void 0;materials=materials.map(material=>{if(useVertexTangents||useVertexColors||useFlatShading){let cacheKey=`cloned-material:`+material.uuid+`:`;useVertexTangents&&(cacheKey+=`vertex-tangents:`),useVertexColors&&(cacheKey+=`vertex-colors:`),useFlatShading&&(cacheKey+=`flat-shading:`);let cachedMaterial=this.cache.get(cacheKey);cachedMaterial||(cachedMaterial=material.clone(),useVertexColors&&(cachedMaterial.vertexColors=!0),useFlatShading&&`flatShading`in cachedMaterial&&(cachedMaterial.flatShading=!0),useVertexTangents&&(cachedMaterial.normalScale&&(cachedMaterial.normalScale.y*=-1),cachedMaterial.clearcoatNormalScale&&(cachedMaterial.clearcoatNormalScale.y*=-1)),this.cache.set(cacheKey,cachedMaterial)),material=cachedMaterial}return material}),Array.isArray(mesh.material)?mesh.material=materials:mesh.material=materials[0]}loadNodeAttachments(index){let promises=[];for(let extension of values(this.extensions)){let promise=extension.loadNodeAttachments(index,this);promise&&promises.push(promise)}return promises}loadNode(index){let cacheKey=`node:`+index,dependency=this.cache.get(cacheKey);if(dependency)return dependency;let nodeDef=this.json.nodes[index],objectPending=[];nodeDef.mesh!==void 0&&objectPending.push(this.loadMesh(nodeDef.mesh).then(object=>{if(nodeDef.weights!==void 0){let weights=nodeDef.weights;object.traverse(o=>{if(o instanceof THREE.Mesh||o instanceof THREE.Line||o instanceof THREE.Points)for(let i=0,il=weights.length;i<il;i++)o.morphTargetInfluences[i]=weights[i]})}return object})),nodeDef.camera!==void 0&&objectPending.push(this.loadCamera(nodeDef.camera));let attachmentsPromises=this.loadNodeAttachments(index);for(let promise of attachmentsPromises)objectPending.push(promise);let promise=Promise.all(objectPending).then(objects=>{let node;if(node=nodeDef.isBone===!0?new THREE.Bone:objects.length>1?new THREE.Group:objects.length===1?objects[0]:new THREE.Object3D,node!==objects[0])for(let i=0,il=objects.length;i<il;i++)node.add(objects[i]);if(nodeDef.name&&(node.userData.name=nodeDef.name,node.name=THREE.PropertyBinding.sanitizeNodeName(nodeDef.name)),nodeDef.matrix!==void 0){let matrix=new THREE.Matrix4;matrix.fromArray(nodeDef.matrix),node.applyMatrix4(matrix)}else nodeDef.translation!==void 0&&node.position.fromArray(nodeDef.translation),nodeDef.rotation!==void 0&&node.quaternion.fromArray(nodeDef.rotation),nodeDef.scale!==void 0&&node.scale.fromArray(nodeDef.scale);return promise=promise.then(node=>Promise.all(values(this.extensions).map(extension=>extension.extendNode(node,nodeDef,this))).then(()=>node)),node});return this.cache.set(cacheKey,promise),promise}loadScene(index){let sceneDef=this.json.scenes[index],scene=new THREE.Group;sceneDef.name&&(scene.name=sceneDef.name);let nodeIds=sceneDef.nodes||[],pending=[];for(let i=0,il=nodeIds.length;i<il;i++)pending.push(this.buildNodeHierarchy(nodeIds[i],scene));return Promise.all(pending).then(()=>scene)}createMaterialTexture(mapDef){return this.loadTexture(mapDef.index).then(texture=>{texture instanceof THREE.CompressedTexture||(texture.minFilter=THREE.LinearFilter,texture.magFilter=THREE.LinearFilter,texture.generateMipmaps=!1),mapDef.texCoord!==void 0&&mapDef.texCoord>0&&(texture.channel=mapDef.texCoord);for(let extension of values(this.extensions)){let result=extension.extendTexture(texture,mapDef,this);result&&(texture=result)}return this.textureSet.add(texture),this.disposeSet.add(texture),texture})}addGeometryPrimitiveAttributes(geometry,primitiveDef){let attributes=primitiveDef.attributes,pending=[];for(let gltfAttributeName in attributes){let threeAttributeName=ATTRIBUTES[gltfAttributeName]||gltfAttributeName.toLowerCase();threeAttributeName in geometry.attributes||pending.push(this.loadAccessor(attributes[gltfAttributeName]).then(attribute=>{attribute&&geometry.setAttribute(threeAttributeName,attribute)}))}primitiveDef.indices!==void 0&&!geometry.index&&pending.push(this.loadAccessor(primitiveDef.indices).then(attribute=>{attribute&&geometry.setIndex(attribute)}));let box=new THREE.Box3;if(attributes.POSITION!==void 0){let accessor=this.json.accessors[attributes.POSITION],min=accessor.min,max=accessor.max;if(min!==void 0&&max!==void 0){if(box.set(new THREE.Vector3(min[0],min[1],min[2]),new THREE.Vector3(max[0],max[1],max[2])),accessor.normalized){let boxScale=getNormalizedComponentScale(WEBGL_COMPONENT_TYPES[accessor.componentType]);box.min.multiplyScalar(boxScale),box.max.multiplyScalar(boxScale)}}else console.warn(`glTF: Missing min/max properties for accessor POSITION.`)}let targets=primitiveDef.targets;if(targets!==void 0){let maxDisplacement=new THREE.Vector3,vector=new THREE.Vector3;for(let i=0,il=targets.length;i<il;i++){let target=targets[i];if(target.POSITION!==void 0){let accessor=this.json.accessors[target.POSITION],min=accessor.min,max=accessor.max;if(min!==void 0&&max!==void 0){if(vector.setX(Math.max(Math.abs(min[0]),Math.abs(max[0]))),vector.setY(Math.max(Math.abs(min[1]),Math.abs(max[1]))),vector.setZ(Math.max(Math.abs(min[2]),Math.abs(max[2]))),accessor.normalized){let boxScale=getNormalizedComponentScale(WEBGL_COMPONENT_TYPES[accessor.componentType]);vector.multiplyScalar(boxScale)}maxDisplacement.max(vector)}else console.warn(`glTF: Missing min/max properties for accessor POSITION.`)}}box.expandByVector(maxDisplacement)}geometry.boundingBox=box;let sphere=new THREE.Sphere;return box.getCenter(sphere.center),sphere.radius=box.min.distanceTo(box.max)/2,geometry.boundingSphere=sphere,Promise.all(pending).then(()=>{var _a;let needsUv1=!1;if(primitiveDef.material!==void 0){let materialDef=this.json.materials[primitiveDef.material];materialDef.occlusionTexture&&((_a=materialDef.occlusionTexture.texCoord)==null?0:_a)>0&&(needsUv1=!0)}if((needsUv1||this.options.copyUV2)&&geometry.attributes.uv&&!geometry.attributes.uv1&&geometry.setAttribute(`uv1`,geometry.attributes.uv),primitiveDef.targets){let hasMorphPosition=!1,hasMorphNormal=!1;for(let i=0,il=primitiveDef.targets.length;i<il;i++){let target=primitiveDef.targets[i];if(target.POSITION!==void 0&&(hasMorphPosition=!0),target.NORMAL!==void 0&&(hasMorphNormal=!0),hasMorphPosition&&hasMorphNormal)break}if(!hasMorphPosition&&!hasMorphNormal)return geometry;let pending=[];geometry.morphTargetsRelative=!0;for(let i=0,il=primitiveDef.targets.length;i<il;i++){let target=primitiveDef.targets[i];hasMorphPosition?pending.push(this.loadAccessor(target.POSITION).then(attribute=>{attribute&&(geometry.morphAttributes.position=geometry.morphAttributes.position||[],geometry.morphAttributes.position[i]=attribute)})):geometry.attributes.position&&(geometry.morphAttributes.position=geometry.morphAttributes.position||[],geometry.morphAttributes.position[i]=geometry.attributes.position),hasMorphNormal?pending.push(this.loadAccessor(target.NORMAL).then(attribute=>{attribute&&(geometry.morphAttributes.normal=geometry.morphAttributes.normal||[],geometry.morphAttributes.normal[i]=attribute)})):geometry.attributes.normal&&(geometry.morphAttributes.normal=geometry.morphAttributes.normal||[],geometry.morphAttributes.normal[i]=geometry.attributes.normal)}return Promise.all(pending).then(()=>geometry)}else return geometry})}buildNodeHierarchy(nodeId,parentObject){let nodeDef=this.json.nodes[nodeId];return this.loadNode(nodeId).then(node=>{if(nodeDef.skin===void 0)return node;let skinEntry;return this.loadSkin(nodeDef.skin).then(skin=>{skinEntry=skin;let pendingJoints=[];for(let i=0,il=skinEntry.joints.length;i<il;i++)pendingJoints.push(this.loadNode(skinEntry.joints[i]));return Promise.all(pendingJoints)}).then(jointNodes=>(node.traverse(mesh=>{if(!(mesh instanceof THREE.SkinnedMesh))return;let bones=[],boneInverses=[];for(let j=0,jl=jointNodes.length;j<jl;j++){let jointNode=jointNodes[j];if(jointNode instanceof THREE.Bone){bones.push(jointNode);let mat=new THREE.Matrix4;skinEntry.inverseBindMatrices!==void 0&&mat.fromArray(skinEntry.inverseBindMatrices.array,j*16),boneInverses.push(mat)}else console.warn(`glTF: Joint "%s" could not be found.`,skinEntry.joints[j])}let skeleton=new THREE.Skeleton(bones,boneInverses);mesh.bind(skeleton,mesh.matrixWorld)}),node))}).then(node=>{parentObject.add(node);let pending=[];if(nodeDef.children){let children=nodeDef.children;for(let i=0,il=children.length;i<il;i++){let child=children[i];pending.push(this.buildNodeHierarchy(child,node))}}return Promise.all(pending).then(()=>node)})}resolveResouce(uri){return/^[a-z]{0,8}\:/i.test(uri)?uri:pathJoin(this.options.resourcePath,appendSearch(uri,this.options.search))}toGeometryTrianglesDrawMode(geometry,drawMode){let index=geometry.getIndex();if(index===null){let indices=[],position=geometry.getAttribute(`position`);if(position!==void 0){for(let i=0;i<position.count;i++)indices.push(i);geometry.setIndex(indices),index=geometry.getIndex()}}if(index===null)return console.error(`glTF: Undefined position attribute. Processing not possible.`),geometry;let numberOfTriangles=index.count-2,newIndices=[];if(drawMode===THREE.TriangleFanDrawMode)for(let i=1;i<=numberOfTriangles;i++)newIndices.push(index.getX(0)),newIndices.push(index.getX(i)),newIndices.push(index.getX(i+1));else for(let i=0;i<numberOfTriangles;i++)i%2==0?(newIndices.push(index.getX(i)),newIndices.push(index.getX(i+1)),newIndices.push(index.getX(i+2))):(newIndices.push(index.getX(i+2)),newIndices.push(index.getX(i+1)),newIndices.push(index.getX(i)));newIndices.length/3!==numberOfTriangles&&console.error(`glTF: Unable to generate correct amount of triangles.`);let newGeometry=geometry.clone();return newGeometry.setIndex(newIndices),this.disposeSet.add(newGeometry),newGeometry}};function getNormalizedComponentScale(constructor){switch(constructor){case Int8Array:return 1/127;case Uint8Array:return 1/255;case Int16Array:return 1/32767;case Uint16Array:return 1/65535;default:throw Error(`glTF: Unsupported normalized accessor component type.`)}}var _havePatchedPropertyBindings=!1,findNodeFn=null;function _ensurePropertyBindingPatch(){if(_havePatchedPropertyBindings)return;_havePatchedPropertyBindings=!0;let findNode=findNodeFn||(findNodeFn=THREE.PropertyBinding.findNode);THREE.PropertyBinding.findNode=function(rawNode,rawPath){let node=rawNode,path=rawPath;if(!path||typeof path!=`string`)return findNode(rawNode,rawPath);if(path.startsWith(`.materials.`)){let remainingPath=path.substring(11).substring(path.indexOf(`.`)),nextIndex=remainingPath.indexOf(`.`),uuid=nextIndex<0?remainingPath:remainingPath.substring(0,nextIndex),property=nextIndex<0?null:remainingPath.slice(nextIndex+1),res=null;return node.traverse(x=>{if(res!==null||x.type!==`Mesh`&&x.type!==`SkinnedMesh`)return;let materials=[].concat(x.material);for(let material of materials)material&&(material.uuid===uuid||material.name===uuid)&&(res=material,res!==null&&property&&(res=res[property]))}),res}else if(path.startsWith(`.nodes.`)||path.startsWith(`.lights.`)||path.startsWith(`.cameras.`)){let sections=path.split(`.`),currentTarget;for(let i=1;i<sections.length;i++){let val=sections[i];if(val.length==36)currentTarget=node.getObjectByProperty(`uuid`,val);else if(currentTarget&¤tTarget[val]){let index=Number.parseInt(val),key=val;index>=0&&(key=index),currentTarget=currentTarget[key]}else{let foundNode=node.getObjectByName(val);foundNode&&(currentTarget=foundNode)}}if(!currentTarget){let originalFindResult=findNode(rawNode,sections[2]);return originalFindResult||console.warn(`KHR_animation_pointer: Property binding not found`,path,node,node.name,sections),originalFindResult}return currentTarget}let currentTarget=findNode(rawNode,rawPath);if(!currentTarget){console.error(`THREE.PropertyBinding: Trying to update node for track: `+path+` but it wasn't found.`);let placeholder=new THREE.Object3D;placeholder.name=path,placeholder.visible=!1,node.add(placeholder),currentTarget=placeholder}return currentTarget=findNode(rawNode,rawPath),currentTarget}}_ensurePropertyBindingPatch();var BaseExtension=class{markDefs(parser){}prepare(parser){}emitResult(result,parser){}createPrimitiveKey(primitiveDef,parser){}extendTexture(texture,mapDef,parser){return null}loadBuffer(index,parser){return null}loadBufferView(index,parser){return null}loadImage(index,parser){return null}loadTexture(index,parser){return null}loadGeometry(primitiveDef,parser){return null}loadMaterial(primitiveDef,parser){return null}loadMeshPrimitive(meshDef,primitiveDef,parser){return null}extendMaterial(material,primitiveDef,parser){return Promise.resolve()}loadMesh(index,parser){return null}extendNode(node,nodeDef,parser){return Promise.resolve()}loadNodeAttachments(index,parser){return null}loadCamera(index,parser){return null}loadAnimation(index,parser){return null}},EXTENSION_NAME$13=`KHR_binary_glTF`,KHR_binary_glTF=class KHR_binary_glTF extends BaseExtension{static getMagic(data){return decodeText(new Uint8Array(data.slice(0,4)))}constructor(){super(),this.header={magic:``,version:0,length:0},this.content=``,this.body=null}loadGlbBinary(data){let headerView=new DataView(data,0,KHR_binary_glTF.HEADER_LENGTH);if(this.header={magic:KHR_binary_glTF.getMagic(data),version:headerView.getUint32(4,!0),length:headerView.getUint32(8,!0)},this.header.magic!==KHR_binary_glTF.HEADER_MAGIC)throw Error(`glTF:KHR_binary_glTF: Unsupported.`);if(this.header.version<2)throw Error(`glTF:KHR_binary_glTF: Legacy binary file detected.`);let chunkView=new DataView(data,KHR_binary_glTF.HEADER_LENGTH),chunkIndex=0,content=null,body=null;for(;chunkIndex<chunkView.byteLength;){let chunkLength=chunkView.getUint32(chunkIndex,!0);if(chunkIndex+=4,chunkLength===0)continue;let chunkType=chunkView.getUint32(chunkIndex,!0);if(chunkIndex+=4,chunkType===KHR_binary_glTF.CHUNK_TYPES.JSON)content=decodeText(new Uint8Array(data,KHR_binary_glTF.HEADER_LENGTH+chunkIndex,chunkLength));else if(chunkType===KHR_binary_glTF.CHUNK_TYPES.BIN){let byteOffset=KHR_binary_glTF.HEADER_LENGTH+chunkIndex;body=data.slice(byteOffset,byteOffset+chunkLength)}chunkIndex+=chunkLength}if(content===null)throw Error(`glTF:${EXTENSION_NAME$13}: JSON content not found.`);this.content=content,this.body=body}loadBuffer(index,parser){return parser.json.buffers[index].uri===void 0&&index===0&&this.body?Promise.resolve(this.body):null}clear(){this.body=null,this.content=``}};KHR_binary_glTF.HEADER_MAGIC=`glTF`,KHR_binary_glTF.HEADER_LENGTH=12,KHR_binary_glTF.CHUNK_TYPES={JSON:1313821514,BIN:5130562};var defaultDecoderPath=`https://vr-public.realsee-cdn.cn/release/static/image/release/five/resource/draco/1.5.6/`,defaultAttributeIDs={position:`POSITION`,normal:`NORMAL`,color:`COLOR`,uv:`TEX_COORD`},defaultAttributeTypes={position:`Float32Array`,normal:`Float32Array`,color:`Float32Array`,uv:`Float32Array`},draco=new class{constructor(){this.decoderPath=defaultDecoderPath,this.decoderConfig={},this.decoderPending=null,this.workerLimit=4,this.workerPool=[],this.workerNextTaskID=1,this.workerSourceURL=``}setDecoderPath(decoderPath){this.decoderPath=decoderPath}setDecoderConfig(config){return this.decoderConfig=config,this}setWorkerLimit(workerLimit){return this.workerLimit=workerLimit,this}decodeDracoFile(buffer,callback,attributeIDs,attributeTypes){let taskConfig={attributeIDs:attributeIDs||defaultAttributeIDs,attributeTypes:attributeTypes||defaultAttributeTypes,useUniqueIDs:!!attributeIDs};this.decodeGeometry(buffer,taskConfig).then(callback)}decodeGeometry(buffer,taskConfig={attributeIDs:defaultAttributeIDs,attributeTypes:defaultAttributeTypes,useUniqueIDs:!1}){for(let attribute in taskConfig.attributeTypes){let type=taskConfig.attributeTypes[attribute];type.BYTES_PER_ELEMENT!==void 0&&(taskConfig.attributeTypes[attribute]=type.name)}let worker,taskID=this.workerNextTaskID++,taskCost=buffer.byteLength,geometryPending=this._getWorker(taskID,taskCost).then(_worker=>(worker=_worker,new Promise((resolve,reject)=>{worker._callbacks[taskID]={resolve,reject},worker.postMessage({type:`decode`,id:taskID,taskConfig,buffer},[buffer])}))).then(message=>this._createGeometry(message.geometry));return geometryPending.catch(()=>!0).then(()=>{worker&&taskID&&this._releaseTask(worker,taskID)}),geometryPending}_createGeometry(geometryData){let geometry=new THREE.BufferGeometry;geometryData.index&&geometry.setIndex(new THREE.BufferAttribute(geometryData.index.array,1));for(let i=0;i<geometryData.attributes.length;i++){let attribute=geometryData.attributes[i],name=attribute.name,array=attribute.array,itemSize=attribute.itemSize,normalized=!(array instanceof Float32Array||array instanceof Float64Array);geometry.setAttribute(name,new THREE.BufferAttribute(array,itemSize,normalized))}return geometry}_initDecoder(){if(this.decoderPending)return this.decoderPending;if(typeof WebAssembly!=`object`||this.decoderConfig.type===`js`){let jsPromise=internalFetcher.ajax(this.decoderPath+`draco_decoder.js`,{responseType:`text`}).then(response=>response.body);this.decoderPending=jsPromise.then(jsContent=>{let body=[`/* draco decoder */`,jsContent,``,`/* worker */`,DRACOWorker].join(`
|
|
339
|
+
`);this.workerSourceURL=URL.createObjectURL(new Blob([body]))})}else{let jsPromise=internalFetcher.ajax(this.decoderPath+`draco_wasm_wrapper.js`,{responseType:`text`}).then(response=>response.body),bufferPromise=internalFetcher.ajax(this.decoderPath+`draco_decoder.wasm`,{responseType:`arraybuffer`}).then(response=>response.body);this.decoderPending=Promise.all([jsPromise,bufferPromise]).then(([jsContent,wasmBinary])=>{this.decoderConfig.wasmBinary=wasmBinary;let body=[`/* draco decoder */`,jsContent,``,`/* worker */`,DRACOWorker].join(`
|
|
340
|
+
`);this.workerSourceURL=URL.createObjectURL(new Blob([body]))})}return this.decoderPending}_getWorker(taskID,taskCost){return this._initDecoder().then(()=>{if(this.workerPool.length<this.workerLimit){let worker=new Worker(this.workerSourceURL);worker._callbacks={},worker._taskCosts={},worker._taskLoad=0,worker.postMessage({type:`init`,decoderConfig:this.decoderConfig}),worker.onmessage=e=>{let message=e.data;switch(message.type){case`decode`:worker._callbacks[message.id].resolve(message);break;case`error`:worker._callbacks[message.id].reject(message);break;default:console.error(`DRACO: Unexpected message, "`+message.type+`"`)}},this.workerPool.push(worker)}else this.workerPool.sort((a,b)=>a._taskLoad>b._taskLoad?-1:1);let worker=this.workerPool[this.workerPool.length-1];return worker._taskCosts[taskID]=taskCost,worker._taskLoad+=taskCost,worker})}_releaseTask(worker,taskID){worker._taskLoad-=worker._taskCosts[taskID],delete worker._callbacks[taskID],delete worker._taskCosts[taskID]}dispose(){for(let i=0;i<this.workerPool.length;++i)this.workerPool[i].terminate();return this.workerPool.length=0,this}},DRACOWorker=`
|
|
341
|
+
let decoderConfig;
|
|
342
|
+
let decoderPending;
|
|
343
|
+
|
|
344
|
+
onmessage = function ( e ) {
|
|
345
|
+
|
|
346
|
+
const message = e.data;
|
|
347
|
+
|
|
348
|
+
switch ( message.type ) {
|
|
349
|
+
|
|
350
|
+
case 'init':
|
|
351
|
+
decoderConfig = message.decoderConfig;
|
|
352
|
+
decoderPending = new Promise( function ( resolve/*, reject*/ ) {
|
|
353
|
+
|
|
354
|
+
decoderConfig.onModuleLoaded = function ( draco ) {
|
|
355
|
+
|
|
356
|
+
// Module is Promise-like. Wrap before resolving to avoid loop.
|
|
357
|
+
resolve( { draco: draco } );
|
|
358
|
+
|
|
359
|
+
};
|
|
360
|
+
|
|
361
|
+
DracoDecoderModule( decoderConfig ); // eslint-disable-line no-undef
|
|
362
|
+
|
|
363
|
+
} );
|
|
364
|
+
break;
|
|
365
|
+
|
|
366
|
+
case 'decode':
|
|
367
|
+
const buffer = message.buffer;
|
|
368
|
+
const taskConfig = message.taskConfig;
|
|
369
|
+
decoderPending.then( ( module ) => {
|
|
370
|
+
|
|
371
|
+
const draco = module.draco;
|
|
372
|
+
const decoder = new draco.Decoder();
|
|
373
|
+
const decoderBuffer = new draco.DecoderBuffer();
|
|
374
|
+
decoderBuffer.Init( new Int8Array( buffer ), buffer.byteLength );
|
|
375
|
+
|
|
376
|
+
try {
|
|
377
|
+
|
|
378
|
+
const geometry = decodeGeometry( draco, decoder, decoderBuffer, taskConfig );
|
|
379
|
+
|
|
380
|
+
const buffers = geometry.attributes.map( ( attr ) => attr.array.buffer );
|
|
381
|
+
|
|
382
|
+
if ( geometry.index ) buffers.push( geometry.index.array.buffer );
|
|
383
|
+
|
|
384
|
+
self.postMessage( { type: 'decode', id: message.id, geometry }, buffers );
|
|
385
|
+
|
|
386
|
+
} catch ( error ) {
|
|
387
|
+
|
|
388
|
+
console.error( error );
|
|
389
|
+
|
|
390
|
+
self.postMessage( { type: 'error', id: message.id, error: error.message } );
|
|
391
|
+
|
|
392
|
+
} finally {
|
|
393
|
+
|
|
394
|
+
draco.destroy( decoderBuffer );
|
|
395
|
+
draco.destroy( decoder );
|
|
396
|
+
|
|
397
|
+
}
|
|
398
|
+
|
|
399
|
+
} );
|
|
400
|
+
break;
|
|
401
|
+
|
|
402
|
+
}
|
|
403
|
+
|
|
404
|
+
};
|
|
405
|
+
|
|
406
|
+
function decodeGeometry( draco, decoder, decoderBuffer, taskConfig ) {
|
|
407
|
+
|
|
408
|
+
const attributeIDs = taskConfig.attributeIDs;
|
|
409
|
+
const attributeTypes = taskConfig.attributeTypes;
|
|
410
|
+
|
|
411
|
+
let dracoGeometry;
|
|
412
|
+
let decodingStatus;
|
|
413
|
+
|
|
414
|
+
const geometryType = decoder.GetEncodedGeometryType( decoderBuffer );
|
|
415
|
+
|
|
416
|
+
if ( geometryType === draco.TRIANGULAR_MESH ) {
|
|
417
|
+
|
|
418
|
+
dracoGeometry = new draco.Mesh();
|
|
419
|
+
decodingStatus = decoder.DecodeBufferToMesh( decoderBuffer, dracoGeometry );
|
|
420
|
+
|
|
421
|
+
} else if ( geometryType === draco.POINT_CLOUD ) {
|
|
422
|
+
|
|
423
|
+
dracoGeometry = new draco.PointCloud();
|
|
424
|
+
decodingStatus = decoder.DecodeBufferToPointCloud( decoderBuffer, dracoGeometry );
|
|
425
|
+
|
|
426
|
+
} else {
|
|
427
|
+
|
|
428
|
+
throw new Error( 'THREE.DRACOLoader: Unexpected geometry type.' );
|
|
429
|
+
|
|
430
|
+
}
|
|
431
|
+
|
|
432
|
+
if ( ! decodingStatus.ok() || dracoGeometry.ptr === 0 ) {
|
|
433
|
+
|
|
434
|
+
throw new Error( 'THREE.DRACOLoader: Decoding failed: ' + decodingStatus.error_msg() );
|
|
435
|
+
|
|
436
|
+
}
|
|
437
|
+
|
|
438
|
+
const geometry = { index: null, attributes: [] };
|
|
439
|
+
|
|
440
|
+
// Gather all vertex attributes.
|
|
441
|
+
for ( const attributeName in attributeIDs ) {
|
|
442
|
+
|
|
443
|
+
const attributeType = self[ attributeTypes[ attributeName ] ];
|
|
444
|
+
|
|
445
|
+
let attribute;
|
|
446
|
+
let attributeID;
|
|
447
|
+
|
|
448
|
+
// A Draco file may be created with default vertex attributes, whose attribute IDs
|
|
449
|
+
// are mapped 1:1 from their semantic name (POSITION, NORMAL, ...). Alternatively,
|
|
450
|
+
// a Draco file may contain a custom set of attributes, identified by known unique
|
|
451
|
+
// IDs. glTF files always do the latter, and .drc files typically do the former.
|
|
452
|
+
if ( taskConfig.useUniqueIDs ) {
|
|
453
|
+
|
|
454
|
+
attributeID = attributeIDs[ attributeName ];
|
|
455
|
+
attribute = decoder.GetAttributeByUniqueId( dracoGeometry, attributeID );
|
|
456
|
+
|
|
457
|
+
} else {
|
|
458
|
+
|
|
459
|
+
attributeID = decoder.GetAttributeId( dracoGeometry, draco[ attributeIDs[ attributeName ] ] );
|
|
460
|
+
|
|
461
|
+
if ( attributeID === - 1 ) continue;
|
|
462
|
+
|
|
463
|
+
attribute = decoder.GetAttribute( dracoGeometry, attributeID );
|
|
464
|
+
|
|
465
|
+
}
|
|
466
|
+
|
|
467
|
+
geometry.attributes.push( decodeAttribute( draco, decoder, dracoGeometry, attributeName, attributeType, attribute ) );
|
|
468
|
+
|
|
469
|
+
}
|
|
470
|
+
|
|
471
|
+
// Add index.
|
|
472
|
+
if ( geometryType === draco.TRIANGULAR_MESH ) {
|
|
473
|
+
|
|
474
|
+
geometry.index = decodeIndex( draco, decoder, dracoGeometry );
|
|
475
|
+
|
|
476
|
+
}
|
|
477
|
+
|
|
478
|
+
draco.destroy( dracoGeometry );
|
|
479
|
+
|
|
480
|
+
return geometry;
|
|
481
|
+
|
|
482
|
+
}
|
|
483
|
+
|
|
484
|
+
function decodeIndex( draco, decoder, dracoGeometry ) {
|
|
485
|
+
|
|
486
|
+
const numFaces = dracoGeometry.num_faces();
|
|
487
|
+
const numIndices = numFaces * 3;
|
|
488
|
+
const byteLength = numIndices * 4;
|
|
489
|
+
|
|
490
|
+
const ptr = draco._malloc( byteLength );
|
|
491
|
+
decoder.GetTrianglesUInt32Array( dracoGeometry, byteLength, ptr );
|
|
492
|
+
const index = new Uint32Array( draco.HEAPF32.buffer, ptr, numIndices ).slice();
|
|
493
|
+
draco._free( ptr );
|
|
494
|
+
|
|
495
|
+
return { array: index, itemSize: 1 };
|
|
496
|
+
|
|
497
|
+
}
|
|
498
|
+
|
|
499
|
+
function decodeAttribute( draco, decoder, dracoGeometry, attributeName, attributeType, attribute ) {
|
|
500
|
+
|
|
501
|
+
const numComponents = attribute.num_components();
|
|
502
|
+
const numPoints = dracoGeometry.num_points();
|
|
503
|
+
const numValues = numPoints * numComponents;
|
|
504
|
+
const byteLength = numValues * attributeType.BYTES_PER_ELEMENT;
|
|
505
|
+
const dataType = getDracoDataType( draco, attributeType );
|
|
506
|
+
|
|
507
|
+
const ptr = draco._malloc( byteLength );
|
|
508
|
+
decoder.GetAttributeDataArrayForAllPoints( dracoGeometry, attribute, dataType, byteLength, ptr );
|
|
509
|
+
const array = new attributeType( draco.HEAPF32.buffer, ptr, numValues ).slice();
|
|
510
|
+
draco._free( ptr );
|
|
511
|
+
|
|
512
|
+
return {
|
|
513
|
+
name: attributeName,
|
|
514
|
+
array: array,
|
|
515
|
+
itemSize: numComponents
|
|
516
|
+
};
|
|
517
|
+
|
|
518
|
+
}
|
|
519
|
+
|
|
520
|
+
function getDracoDataType( draco, attributeType ) {
|
|
521
|
+
|
|
522
|
+
switch ( attributeType ) {
|
|
523
|
+
|
|
524
|
+
case Float32Array: return draco.DT_FLOAT32;
|
|
525
|
+
case Int8Array: return draco.DT_INT8;
|
|
526
|
+
case Int16Array: return draco.DT_INT16;
|
|
527
|
+
case Int32Array: return draco.DT_INT32;
|
|
528
|
+
case Uint8Array: return draco.DT_UINT8;
|
|
529
|
+
case Uint16Array: return draco.DT_UINT16;
|
|
530
|
+
case Uint32Array: return draco.DT_UINT32;
|
|
531
|
+
|
|
532
|
+
}
|
|
533
|
+
|
|
534
|
+
}
|
|
535
|
+
`,EXTENSION_NAME$12=`KHR_draco_mesh_compression`,KHR_draco_mesh_compression=class extends BaseExtension{loadGeometry(primitiveDef,parser){return primitiveDef.extensions&&primitiveDef.extensions[EXTENSION_NAME$12]?this.decodePrimitive(primitiveDef,parser).then(geometry=>parser.addGeometryPrimitiveAttributes(geometry,primitiveDef)):null}decodePrimitive(primitiveDef,parser){let json=parser.json,bufferViewIndex=primitiveDef.extensions[EXTENSION_NAME$12].bufferView,gltfAttributeMap=primitiveDef.extensions[EXTENSION_NAME$12].attributes,threeAttributeMap={},attributeNormalizedMap={},attributeTypeMap={};for(let attributeName in gltfAttributeMap){let threeAttributeName=ATTRIBUTES[attributeName]||attributeName.toLowerCase();threeAttributeMap[threeAttributeName]=gltfAttributeMap[attributeName]}for(let attributeName in primitiveDef.attributes){let threeAttributeName=ATTRIBUTES[attributeName]||attributeName.toLowerCase();if(gltfAttributeMap[attributeName]!==void 0){let accessorDef=json.accessors[primitiveDef.attributes[attributeName]];attributeTypeMap[threeAttributeName]=WEBGL_COMPONENT_TYPES[accessorDef.componentType],attributeNormalizedMap[threeAttributeName]=accessorDef.normalized===!0}}return parser.loadBufferView(bufferViewIndex).then(bufferView=>new Promise(resolve=>{draco.decodeDracoFile(bufferView,geometry=>{for(let attributeName in geometry.attributes){let attribute=geometry.attributes[attributeName],normalized=attributeNormalizedMap[attributeName];normalized!==void 0&&(attribute.normalized=normalized)}resolve(geometry)},threeAttributeMap,attributeTypeMap)}))}},defaultTranscoderPath=`https://vr-public.realsee-cdn.cn/release/static/image/release/five/resource/basis/1.16/`,KTX2TransferSRGB=2,KTX2_ALPHA_PREMULTIPLIED=1,ktx2=new class{constructor(){this.transcoderPath=defaultTranscoderPath,this.transcoderBinary=null,this.transcoderPending=null,this.workerPool=new WorkerPool(null,4),this.workerSourceURL=``,this.workerConfig=null}setTranscoderPath(transcoderPath){this.transcoderPath=transcoderPath}detectSupport(renderer){var _a,_b;let r=renderer;if(r.isWebGPURenderer===!0&&(_a=r.backend)!=null&&_a.device)this.workerConfig={astcSupported:r.hasFeature(`texture-compression-astc`),etc1Supported:r.hasFeature(`texture-compression-etc2`),etc2Supported:r.hasFeature(`texture-compression-etc2`),dxtSupported:r.hasFeature(`texture-compression-bc`),bptcSupported:r.hasFeature(`texture-compression-bc`),pvrtcSupported:!1};else if(r.isWebGPURenderer===!0&&(_b=r.backend)!=null&&_b.gl){let gl=r.backend.gl,has=name=>gl.getExtension(name)!=null;this.workerConfig={astcSupported:has(`WEBGL_compressed_texture_astc`),etc1Supported:has(`WEBGL_compressed_texture_etc1`),etc2Supported:has(`WEBGL_compressed_texture_etc`),dxtSupported:has(`WEBGL_compressed_texture_s3tc`),bptcSupported:has(`EXT_texture_compression_bptc`),pvrtcSupported:has(`WEBGL_compressed_texture_pvrtc`)||has(`WEBKIT_WEBGL_compressed_texture_pvrtc`)}}else r.extensions?this.workerConfig={astcSupported:!!r.extensions.get(`WEBGL_compressed_texture_astc`),etc1Supported:!!r.extensions.get(`WEBGL_compressed_texture_etc1`),etc2Supported:!!r.extensions.get(`WEBGL_compressed_texture_etc`),dxtSupported:!!r.extensions.get(`WEBGL_compressed_texture_s3tc`),bptcSupported:!!r.extensions.get(`EXT_texture_compression_bptc`),pvrtcSupported:!!r.extensions.get(`WEBGL_compressed_texture_pvrtc`)||!!r.extensions.get(`WEBKIT_WEBGL_compressed_texture_pvrtc`)}:this.workerConfig||(this.workerConfig={astcSupported:!1,etc1Supported:!1,etc2Supported:!1,dxtSupported:!1,bptcSupported:!1,pvrtcSupported:!1});return this}init(){if(!this.transcoderPending){let jsContent=internalFetcher.ajax(this.transcoderPath+`basis_transcoder.js`,{responseType:`text`}).then(response=>response.body),binaryContent=internalFetcher.ajax(this.transcoderPath+`basis_transcoder.wasm`,{responseType:`arraybuffer`}).then(response=>response.body);this.transcoderPending=Promise.all([jsContent,binaryContent]).then(([jsContent,binaryContent])=>{let body=[`/* constants */`,`let _EngineFormat = `+JSON.stringify(EngineFormat),`let _TranscoderFormat = `+JSON.stringify(TranscoderFormat),`let _BasisFormat = `+JSON.stringify(BasisFormat),`/* basis_transcoder.js */`,jsContent,`/* worker */`,BasisWorker].join(`
|
|
536
|
+
`);this.workerSourceURL=URL.createObjectURL(new Blob([body])),this.transcoderBinary=binaryContent,this.workerPool.setWorkerCreator(()=>{let worker=new Worker(this.workerSourceURL),transcoderBinary=this.transcoderBinary.slice(0);return worker.postMessage({type:`init`,config:this.workerConfig,transcoderBinary},[transcoderBinary]),worker})})}return this.transcoderPending}parse(buffer){return this._createTexture([buffer])}_createTextureFrom(transcodeResult){let{mipmaps,width,height,format,type,error,dfdTransferFn,dfdFlags}=transcodeResult;if(type===`error`)return Promise.reject(error);let texture;return format===THREE.RGBAFormat?(texture=new THREE.DataTexture(mipmaps[0].data,width,height,THREE.RGBAFormat,THREE.UnsignedByteType),texture.mipmaps=mipmaps):texture=new THREE.CompressedTexture(mipmaps,width,height,format,THREE.UnsignedByteType),texture.minFilter=mipmaps.length===1?THREE.LinearFilter:THREE.LinearMipmapLinearFilter,texture.magFilter=THREE.LinearFilter,texture.generateMipmaps=!1,texture.needsUpdate=!0,texture.colorSpace=dfdTransferFn===KTX2TransferSRGB?THREE.SRGBColorSpace:THREE.LinearSRGBColorSpace,texture.premultiplyAlpha=!!(dfdFlags&KTX2_ALPHA_PREMULTIPLIED),Promise.resolve(texture)}_createTexture(buffers){return this.init().then(()=>this.workerPool.postMessage({type:`transcode`,buffers},buffers)).then(data=>this._createTextureFrom(data))}dispose(){return URL.revokeObjectURL(this.workerSourceURL),this.workerPool.dispose(),this}},BasisFormat={ETC1S:0,UASTC_4x4:1},TranscoderFormat={ETC1:0,ETC2:1,BC1:2,BC3:3,BC4:4,BC5:5,BC7_M6_OPAQUE_ONLY:6,BC7_M5:7,PVRTC1_4_RGB:8,PVRTC1_4_RGBA:9,ASTC_4x4:10,ATC_RGB:11,ATC_RGBA_INTERPOLATED_ALPHA:12,RGBA32:13,RGB565:14,BGR565:15,RGBA4444:16},EngineFormat={RGBAFormat:THREE.RGBAFormat,RGBA_ASTC_4x4_Format:THREE.RGBA_ASTC_4x4_Format,RGBA_BPTC_Format:THREE.RGBA_BPTC_Format,RGBA_ETC2_EAC_Format:THREE.RGBA_ETC2_EAC_Format,RGBA_PVRTC_4BPPV1_Format:THREE.RGBA_PVRTC_4BPPV1_Format,RGBA_S3TC_DXT5_Format:THREE.RGBA_S3TC_DXT5_Format,RGB_ETC1_Format:THREE.RGB_ETC1_Format,RGB_ETC2_Format:THREE.RGB_ETC2_Format,RGB_PVRTC_4BPPV1_Format:THREE.RGB_PVRTC_4BPPV1_Format,RGB_S3TC_DXT1_Format:THREE.RGB_S3TC_DXT1_Format},BasisWorker=`
|
|
537
|
+
|
|
538
|
+
let config;
|
|
539
|
+
let transcoderPending;
|
|
540
|
+
let BasisModule;
|
|
541
|
+
|
|
542
|
+
const EngineFormat = _EngineFormat; // eslint-disable-line no-undef
|
|
543
|
+
const TranscoderFormat = _TranscoderFormat; // eslint-disable-line no-undef
|
|
544
|
+
const BasisFormat = _BasisFormat; // eslint-disable-line no-undef
|
|
545
|
+
|
|
546
|
+
self.addEventListener( 'message', function ( e ) {
|
|
547
|
+
|
|
548
|
+
const message = e.data;
|
|
549
|
+
|
|
550
|
+
switch ( message.type ) {
|
|
551
|
+
|
|
552
|
+
case 'init':
|
|
553
|
+
config = message.config;
|
|
554
|
+
init( message.transcoderBinary );
|
|
555
|
+
break;
|
|
556
|
+
|
|
557
|
+
case 'transcode':
|
|
558
|
+
transcoderPending.then( () => {
|
|
559
|
+
|
|
560
|
+
try {
|
|
561
|
+
|
|
562
|
+
const { width, height, hasAlpha, mipmaps, format, dfdTransferFn, dfdFlags } = transcode( message.buffers[ 0 ] );
|
|
563
|
+
|
|
564
|
+
const buffers = [];
|
|
565
|
+
|
|
566
|
+
for ( let i = 0; i < mipmaps.length; ++ i ) {
|
|
567
|
+
|
|
568
|
+
buffers.push( mipmaps[ i ].data.buffer );
|
|
569
|
+
|
|
570
|
+
}
|
|
571
|
+
|
|
572
|
+
self.postMessage( { type: 'transcode', id: message.id, width, height, hasAlpha, mipmaps, format, dfdTransferFn, dfdFlags }, buffers );
|
|
573
|
+
|
|
574
|
+
} catch ( error ) {
|
|
575
|
+
|
|
576
|
+
console.error( error );
|
|
577
|
+
|
|
578
|
+
self.postMessage( { type: 'error', id: message.id, error: error.message } );
|
|
579
|
+
|
|
580
|
+
}
|
|
581
|
+
|
|
582
|
+
} );
|
|
583
|
+
break;
|
|
584
|
+
|
|
585
|
+
}
|
|
586
|
+
|
|
587
|
+
} );
|
|
588
|
+
|
|
589
|
+
function init( wasmBinary ) {
|
|
590
|
+
|
|
591
|
+
transcoderPending = new Promise( ( resolve ) => {
|
|
592
|
+
|
|
593
|
+
BasisModule = { wasmBinary, onRuntimeInitialized: resolve };
|
|
594
|
+
BASIS( BasisModule ); // eslint-disable-line no-undef
|
|
595
|
+
|
|
596
|
+
} ).then( () => {
|
|
597
|
+
|
|
598
|
+
BasisModule.initializeBasis();
|
|
599
|
+
|
|
600
|
+
if ( BasisModule.KTX2File === undefined ) {
|
|
601
|
+
|
|
602
|
+
console.warn( 'THREE.KTX2Loader: Please update Basis Universal transcoder.' );
|
|
603
|
+
|
|
604
|
+
}
|
|
605
|
+
|
|
606
|
+
} );
|
|
607
|
+
|
|
608
|
+
}
|
|
609
|
+
|
|
610
|
+
function transcode( buffer ) {
|
|
611
|
+
|
|
612
|
+
const ktx2File = new BasisModule.KTX2File( new Uint8Array( buffer ) );
|
|
613
|
+
|
|
614
|
+
function cleanup() {
|
|
615
|
+
|
|
616
|
+
ktx2File.close();
|
|
617
|
+
ktx2File.delete();
|
|
618
|
+
|
|
619
|
+
}
|
|
620
|
+
|
|
621
|
+
if ( ! ktx2File.isValid() ) {
|
|
622
|
+
|
|
623
|
+
cleanup();
|
|
624
|
+
throw new Error( 'THREE.KTX2Loader: Invalid or unsupported .ktx2 file' );
|
|
625
|
+
|
|
626
|
+
}
|
|
627
|
+
|
|
628
|
+
const basisFormat = ktx2File.isUASTC() ? BasisFormat.UASTC_4x4 : BasisFormat.ETC1S;
|
|
629
|
+
const width = ktx2File.getWidth();
|
|
630
|
+
const height = ktx2File.getHeight();
|
|
631
|
+
const levels = ktx2File.getLevels();
|
|
632
|
+
const hasAlpha = ktx2File.getHasAlpha();
|
|
633
|
+
const dfdTransferFn = ktx2File.getDFDTransferFunc();
|
|
634
|
+
const dfdFlags = ktx2File.getDFDFlags();
|
|
635
|
+
|
|
636
|
+
const { transcoderFormat, engineFormat } = getTranscoderFormat( basisFormat, width, height, hasAlpha );
|
|
637
|
+
|
|
638
|
+
if ( ! width || ! height || ! levels ) {
|
|
639
|
+
|
|
640
|
+
cleanup();
|
|
641
|
+
throw new Error( 'THREE.KTX2Loader: Invalid texture' );
|
|
642
|
+
|
|
643
|
+
}
|
|
644
|
+
|
|
645
|
+
if ( ! ktx2File.startTranscoding() ) {
|
|
646
|
+
|
|
647
|
+
cleanup();
|
|
648
|
+
throw new Error( 'THREE.KTX2Loader: .startTranscoding failed' );
|
|
649
|
+
|
|
650
|
+
}
|
|
651
|
+
|
|
652
|
+
const mipmaps = [];
|
|
653
|
+
|
|
654
|
+
for ( let mip = 0; mip < levels; mip ++ ) {
|
|
655
|
+
|
|
656
|
+
const levelInfo = ktx2File.getImageLevelInfo( mip, 0, 0 );
|
|
657
|
+
const mipWidth = levelInfo.origWidth;
|
|
658
|
+
const mipHeight = levelInfo.origHeight;
|
|
659
|
+
const dst = new Uint8Array( ktx2File.getImageTranscodedSizeInBytes( mip, 0, 0, transcoderFormat ) );
|
|
660
|
+
|
|
661
|
+
const status = ktx2File.transcodeImage(
|
|
662
|
+
dst,
|
|
663
|
+
mip,
|
|
664
|
+
0,
|
|
665
|
+
0,
|
|
666
|
+
transcoderFormat,
|
|
667
|
+
0,
|
|
668
|
+
- 1,
|
|
669
|
+
- 1,
|
|
670
|
+
);
|
|
671
|
+
|
|
672
|
+
if ( ! status ) {
|
|
673
|
+
|
|
674
|
+
cleanup();
|
|
675
|
+
throw new Error( 'THREE.KTX2Loader: .transcodeImage failed.' );
|
|
676
|
+
|
|
677
|
+
}
|
|
678
|
+
|
|
679
|
+
mipmaps.push( { data: dst, width: mipWidth, height: mipHeight } );
|
|
680
|
+
|
|
681
|
+
}
|
|
682
|
+
|
|
683
|
+
cleanup();
|
|
684
|
+
|
|
685
|
+
return { width, height, hasAlpha, mipmaps, format: engineFormat, dfdTransferFn, dfdFlags };
|
|
686
|
+
|
|
687
|
+
}
|
|
688
|
+
|
|
689
|
+
//
|
|
690
|
+
|
|
691
|
+
// Optimal choice of a transcoder target format depends on the Basis format (ETC1S or UASTC),
|
|
692
|
+
// device capabilities, and texture dimensions. The list below ranks the formats separately
|
|
693
|
+
// for ETC1S and UASTC.
|
|
694
|
+
//
|
|
695
|
+
// In some cases, transcoding UASTC to RGBA32 might be preferred for higher quality (at
|
|
696
|
+
// significant memory cost) compared to ETC1/2, BC1/3, and PVRTC. The transcoder currently
|
|
697
|
+
// chooses RGBA32 only as a last resort and does not expose that option to the caller.
|
|
698
|
+
const FORMAT_OPTIONS = [
|
|
699
|
+
{
|
|
700
|
+
if: 'astcSupported',
|
|
701
|
+
basisFormat: [ BasisFormat.UASTC_4x4 ],
|
|
702
|
+
transcoderFormat: [ TranscoderFormat.ASTC_4x4, TranscoderFormat.ASTC_4x4 ],
|
|
703
|
+
engineFormat: [ EngineFormat.RGBA_ASTC_4x4_Format, EngineFormat.RGBA_ASTC_4x4_Format ],
|
|
704
|
+
priorityETC1S: Infinity,
|
|
705
|
+
priorityUASTC: 1,
|
|
706
|
+
needsPowerOfTwo: false,
|
|
707
|
+
},
|
|
708
|
+
{
|
|
709
|
+
if: 'bptcSupported',
|
|
710
|
+
basisFormat: [ BasisFormat.ETC1S, BasisFormat.UASTC_4x4 ],
|
|
711
|
+
transcoderFormat: [ TranscoderFormat.BC7_M5, TranscoderFormat.BC7_M5 ],
|
|
712
|
+
engineFormat: [ EngineFormat.RGBA_BPTC_Format, EngineFormat.RGBA_BPTC_Format ],
|
|
713
|
+
priorityETC1S: 3,
|
|
714
|
+
priorityUASTC: 2,
|
|
715
|
+
needsPowerOfTwo: false,
|
|
716
|
+
},
|
|
717
|
+
{
|
|
718
|
+
if: 'dxtSupported',
|
|
719
|
+
basisFormat: [ BasisFormat.ETC1S, BasisFormat.UASTC_4x4 ],
|
|
720
|
+
transcoderFormat: [ TranscoderFormat.BC1, TranscoderFormat.BC3 ],
|
|
721
|
+
engineFormat: [ EngineFormat.RGB_S3TC_DXT1_Format, EngineFormat.RGBA_S3TC_DXT5_Format ],
|
|
722
|
+
priorityETC1S: 4,
|
|
723
|
+
priorityUASTC: 5,
|
|
724
|
+
needsPowerOfTwo: false,
|
|
725
|
+
},
|
|
726
|
+
{
|
|
727
|
+
if: 'etc2Supported',
|
|
728
|
+
basisFormat: [ BasisFormat.ETC1S, BasisFormat.UASTC_4x4 ],
|
|
729
|
+
transcoderFormat: [ TranscoderFormat.ETC1, TranscoderFormat.ETC2 ],
|
|
730
|
+
engineFormat: [ EngineFormat.RGB_ETC2_Format, EngineFormat.RGBA_ETC2_EAC_Format ],
|
|
731
|
+
priorityETC1S: 1,
|
|
732
|
+
priorityUASTC: 3,
|
|
733
|
+
needsPowerOfTwo: false,
|
|
734
|
+
},
|
|
735
|
+
{
|
|
736
|
+
if: 'etc1Supported',
|
|
737
|
+
basisFormat: [ BasisFormat.ETC1S, BasisFormat.UASTC_4x4 ],
|
|
738
|
+
transcoderFormat: [ TranscoderFormat.ETC1, TranscoderFormat.ETC1 ],
|
|
739
|
+
engineFormat: [ EngineFormat.RGB_ETC1_Format, EngineFormat.RGB_ETC1_Format ],
|
|
740
|
+
priorityETC1S: 2,
|
|
741
|
+
priorityUASTC: 4,
|
|
742
|
+
needsPowerOfTwo: false,
|
|
743
|
+
},
|
|
744
|
+
{
|
|
745
|
+
if: 'pvrtcSupported',
|
|
746
|
+
basisFormat: [ BasisFormat.ETC1S, BasisFormat.UASTC_4x4 ],
|
|
747
|
+
transcoderFormat: [ TranscoderFormat.PVRTC1_4_RGB, TranscoderFormat.PVRTC1_4_RGBA ],
|
|
748
|
+
engineFormat: [ EngineFormat.RGB_PVRTC_4BPPV1_Format, EngineFormat.RGBA_PVRTC_4BPPV1_Format ],
|
|
749
|
+
priorityETC1S: 5,
|
|
750
|
+
priorityUASTC: 6,
|
|
751
|
+
needsPowerOfTwo: true,
|
|
752
|
+
},
|
|
753
|
+
];
|
|
754
|
+
|
|
755
|
+
const ETC1S_OPTIONS = FORMAT_OPTIONS.sort( function ( a, b ) {
|
|
756
|
+
|
|
757
|
+
return a.priorityETC1S - b.priorityETC1S;
|
|
758
|
+
|
|
759
|
+
} );
|
|
760
|
+
const UASTC_OPTIONS = FORMAT_OPTIONS.sort( function ( a, b ) {
|
|
761
|
+
|
|
762
|
+
return a.priorityUASTC - b.priorityUASTC;
|
|
763
|
+
|
|
764
|
+
} );
|
|
765
|
+
|
|
766
|
+
function getTranscoderFormat( basisFormat, width, height, hasAlpha ) {
|
|
767
|
+
|
|
768
|
+
let transcoderFormat;
|
|
769
|
+
let engineFormat;
|
|
770
|
+
|
|
771
|
+
const options = basisFormat === BasisFormat.ETC1S ? ETC1S_OPTIONS : UASTC_OPTIONS;
|
|
772
|
+
|
|
773
|
+
for ( let i = 0; i < options.length; i ++ ) {
|
|
774
|
+
|
|
775
|
+
const opt = options[ i ];
|
|
776
|
+
|
|
777
|
+
if ( ! config[ opt.if ] ) continue;
|
|
778
|
+
if ( ! opt.basisFormat.includes( basisFormat ) ) continue;
|
|
779
|
+
if ( opt.needsPowerOfTwo && ! ( isPowerOfTwo( width ) && isPowerOfTwo( height ) ) ) continue;
|
|
780
|
+
|
|
781
|
+
transcoderFormat = opt.transcoderFormat[ hasAlpha ? 1 : 0 ];
|
|
782
|
+
engineFormat = opt.engineFormat[ hasAlpha ? 1 : 0 ];
|
|
783
|
+
|
|
784
|
+
return { transcoderFormat, engineFormat };
|
|
785
|
+
|
|
786
|
+
}
|
|
787
|
+
|
|
788
|
+
console.warn( 'KTX2: No suitable compressed texture format found. Decoding to RGBA32.' );
|
|
789
|
+
|
|
790
|
+
transcoderFormat = TranscoderFormat.RGBA32;
|
|
791
|
+
engineFormat = EngineFormat.RGBAFormat;
|
|
792
|
+
|
|
793
|
+
return { transcoderFormat, engineFormat };
|
|
794
|
+
|
|
795
|
+
}
|
|
796
|
+
|
|
797
|
+
function isPowerOfTwo( value ) {
|
|
798
|
+
|
|
799
|
+
if ( value <= 2 ) return true;
|
|
800
|
+
|
|
801
|
+
return ( value & ( value - 1 ) ) === 0 && value !== 0;
|
|
802
|
+
|
|
803
|
+
}
|
|
804
|
+
`,EXTENSION_NAME$11=`KHR_texture_basisu`,KHR_texture_basisu=class extends BaseExtension{loadTexture(index,parser){let textureDef=parser.json.textures[index];if(!textureDef.extensions||!textureDef.extensions[EXTENSION_NAME$11])return null;let extension=textureDef.extensions[EXTENSION_NAME$11],imageDef=parser.json.images[extension.source],promise=null;if(imageDef.bufferView!==void 0)promise=parser.loadBufferView(imageDef.bufferView).then(buffer=>ktx2.parse(buffer));else if(imageDef.uri)promise=parser.options.fetcher.ajax(parser.resolveResouce(imageDef.uri),{responseType:`arraybuffer`}).then(response=>ktx2.parse(response.body));else throw Error(`glTF: Invalid image defs.`);let sampler=(parser.json.samplers||{})[textureDef.sampler]||{};return promise=promise.then(texture=>(texture.magFilter=THREE.LinearFilter,texture.minFilter=THREE.LinearFilter,texture.wrapS=WEBGL_WRAPPINGS[sampler.wrapS]||THREE.RepeatWrapping,texture.wrapT=WEBGL_WRAPPINGS[sampler.wrapT]||THREE.RepeatWrapping,texture)),promise}},EXTENSION_NAME$10=`KHR_texture_transform`,KHR_texture_transform=class extends BaseExtension{extendTexture(texture,mapDef,parser){let transform=mapDef.extensions===void 0?void 0:mapDef.extensions[EXTENSION_NAME$10];return transform?(transform.texCoord!==void 0&&console.warn(`glTF: Custom UV sets in "KHR_texture_transform" extension not yet supported.`),transform.offset===void 0&&transform.rotation===void 0&&transform.scale===void 0?texture:(texture=texture.clone(),texture.needsUpdate=!0,transform.offset!==void 0&&texture.offset.fromArray(transform.offset),transform.rotation!==void 0&&(texture.rotation=transform.rotation),transform.scale!==void 0&&texture.repeat.fromArray(transform.scale),texture)):null}},KHR_mesh_quantization=class extends BaseExtension{},KHR_materials_unlit=class extends BaseExtension{},EXTENSION_NAME$9=`KHR_node_visibility`,KHR_node_visibility=class extends BaseExtension{extendNode(node,nodeDef,parser){var _a;let pending=[],extensions=(_a=nodeDef.extensions)==null?{}:_a;if(extensions[EXTENSION_NAME$9]){let extension=extensions[EXTENSION_NAME$9];typeof extension.visible==`boolean`&&(node.visible=extension.visible)}return Promise.all(pending).then(noop)}},KHR_animation_pointer=class extends BaseExtension{},EXTENSION_NAME$8=`KHR_materials_clearcoat`,KHR_materials_clearcoat=class extends BaseExtension{extendMaterial(material,primitiveDef,parser){var _a;let pending=[];if(primitiveDef.material!==void 0&&(material instanceof PBMMeshPhysicalMaterial||material instanceof THREE.MeshPhysicalMaterial||material instanceof THREE.MeshPhysicalNodeMaterial)){let extensions=(_a=parser.json.materials[primitiveDef.material].extensions)==null?{}:_a;if(extensions[EXTENSION_NAME$8]){let extension=extensions[EXTENSION_NAME$8];if(extension.clearcoatFactor!==void 0&&(material.clearcoat=extension.clearcoatFactor),extension.clearcoatTexture!==void 0&&pending.push(parser.createMaterialTexture(extension.clearcoatTexture).then(texture=>{material.clearcoatMap=texture,parser.disposeSet.add(texture)})),extension.clearcoatRoughnessFactor!==void 0&&(material.clearcoatRoughness=extension.clearcoatRoughnessFactor),extension.clearcoatRoughnessTexture!==void 0&&pending.push(parser.createMaterialTexture(extension.clearcoatRoughnessTexture).then(texture=>{material.clearcoatRoughnessMap=texture,parser.disposeSet.add(texture)})),extension.clearcoatNormalTexture!==void 0&&(pending.push(parser.createMaterialTexture(extension.clearcoatNormalTexture).then(texture=>{material.clearcoatNormalMap=texture,parser.disposeSet.add(texture)})),extension.clearcoatNormalTexture.scale!==void 0)){let scale=extension.clearcoatNormalTexture.scale;material.clearcoatNormalScale=new THREE.Vector2(scale,scale)}}}return Promise.all(pending).then(noop)}},EXTENSION_NAME$7=`KHR_materials_sheen`,KHR_materials_sheen=class extends BaseExtension{extendMaterial(material,primitiveDef,parser){var _a;let pending=[];if(primitiveDef.material!==void 0&&(material instanceof PBMMeshPhysicalMaterial||material instanceof THREE.MeshPhysicalMaterial||material instanceof THREE.MeshPhysicalNodeMaterial)){let extensions=(_a=parser.json.materials[primitiveDef.material].extensions)==null?{}:_a;if(extensions[EXTENSION_NAME$7]){let extension=extensions[EXTENSION_NAME$7];if(material.sheen=1,extension.sheenColorFactor!==void 0){let colorFactor=extension.sheenColorFactor;material.sheenColor=new THREE.Color().setRGB(colorFactor[0],colorFactor[1],colorFactor[2])}extension.sheenRoughnessFactor!==void 0&&(material.sheenRoughness=extension.sheenRoughnessFactor),extension.sheenColorTexture!==void 0&&pending.push(parser.createMaterialTexture(extension.sheenColorTexture).then(texture=>{texture.colorSpace=THREE.SRGBColorSpace,material.sheenColorMap=texture,parser.disposeSet.add(texture)})),extension.sheenRoughnessTexture!==void 0&&pending.push(parser.createMaterialTexture(extension.sheenRoughnessTexture).then(texture=>{material.sheenRoughnessMap=texture,parser.disposeSet.add(texture)}))}}return Promise.all(pending).then(noop)}},EXTENSION_NAME$6=`KHR_materials_transmission`,KHR_materials_transmission=class extends BaseExtension{extendMaterial(material,primitiveDef,parser){var _a;let pending=[];if(primitiveDef.material!==void 0&&(material instanceof PBMMeshPhysicalMaterial||material instanceof THREE.MeshPhysicalMaterial||material instanceof THREE.MeshPhysicalNodeMaterial)){let extensions=(_a=parser.json.materials[primitiveDef.material].extensions)==null?{}:_a;if(extensions[EXTENSION_NAME$6]){let extension=extensions[EXTENSION_NAME$6];extension.transmissionFactor!==void 0&&(material.transmission=extension.transmissionFactor,material.transmission>0&&(material.transparent=!0)),extension.transmissionTexture!==void 0&&pending.push(parser.createMaterialTexture(extension.transmissionTexture).then(texture=>{material.transmissionMap=texture,parser.disposeSet.add(texture)}))}}return Promise.all(pending).then(noop)}},EXTENSION_NAME$5=`KHR_materials_emissive_strength`,KHR_materials_emissive_strength=class extends BaseExtension{extendMaterial(material,primitiveDef,parser){var _a;let pending=[];if(primitiveDef.material!==void 0&&(material instanceof PBMMeshPhysicalMaterial||material instanceof THREE.MeshStandardMaterial||material instanceof THREE.MeshStandardNodeMaterial)){let extensions=(_a=parser.json.materials[primitiveDef.material].extensions)==null?{}:_a;if(extensions[EXTENSION_NAME$5]){let extension=extensions[EXTENSION_NAME$5];extension.emissiveStrength!==void 0&&(material.emissiveIntensity=extension.emissiveStrength)}}return Promise.all(pending).then(noop)}},meshoptDecoder=(function(){var wasm_base=`b9H79Tebbbe8Fv9Gbb9Gvuuuuueu9Giuuub9Geueu9Giuuueuikqbeeedddillviebeoweuec:q;iekr;leDo9TW9T9VV95dbH9F9F939H79T9F9J9H229F9Jt9VV7bb8A9TW79O9V9Wt9F9KW9J9V9KW9wWVtW949c919M9MWVbeY9TW79O9V9Wt9F9KW9J9V9KW69U9KW949c919M9MWVbdE9TW79O9V9Wt9F9KW9J9V9KW69U9KW949tWG91W9U9JWbiL9TW79O9V9Wt9F9KW9J9V9KWS9P2tWV9p9JtblK9TW79O9V9Wt9F9KW9J9V9KWS9P2tWV9r919HtbvL9TW79O9V9Wt9F9KW9J9V9KWS9P2tWVT949Wbol79IV9Rbrq:78Yqdbk:qzezu8Jjjjjbcj;eb9Rgv8Kjjjjbc9:hodnadcefal0mbcuhoaiRbbc:Ge9hmbavaialfgrad9Radz1jjjbhwcj;abad9UhlaicefhodnadTmbalc;WFbGglcjdalcjd6EhDcbhqinaqae9pmeaDaeaq9RaqaDfae6Egkcsfglcl4cifcd4hxdndndndnalc9WGgmTmbcbhPcehsawcjdfhzaohHinaraH9Rax6midnaraHaxfgo9RcK6mbczhlinalgic9Wfglawcj;cbffhOdndndndndnaHalco4fRbbalci4coG4ciGPlbedibkaO9cb83ibaOcwf9cb83ibxikaOaoRblaoRbbgAco4glalciSgCE86bbawcj;cbfaifglcGfaoclfaCfgORbbaAcl4ciGgCaCciSgCE86bbalcVfaOaCfgORbbaAcd4ciGgCaCciSgCE86bbalc7faOaCfgORbbaAciGgAaAciSgAE86bbalctfaOaAfgARbbaoRbegOco4gCaCciSgCE86bbalc91faAaCfgARbbaOcl4ciGgCaCciSgCE86bbalc4faAaCfgARbbaOcd4ciGgCaCciSgCE86bbalc93faAaCfgARbbaOciGgOaOciSgOE86bbalc94faAaOfgARbbaoRbdgOco4gCaCciSgCE86bbalc95faAaCfgARbbaOcl4ciGgCaCciSgCE86bbalc96faAaCfgARbbaOcd4ciGgCaCciSgCE86bbalc97faAaCfgARbbaOciGgOaOciSgOE86bbalc98faAaOfgORbbaoRbigoco4gAaAciSgAE86bbalc99faOaAfgORbbaocl4ciGgAaAciSgAE86bbalc9:faOaAfgORbbaocd4ciGgAaAciSgAE86bbalcufaOaAfglRbbaociGgoaociSgoE86bbalaofhoxdkaOaoRbwaoRbbgAcl4glalcsSgCE86bbawcj;cbfaifglcGfaocwfaCfgORbbaAcsGgAaAcsSgAE86bbalcVfaOaAfgORbbaoRbegAcl4gCaCcsSgCE86bbalc7faOaCfgORbbaAcsGgAaAcsSgAE86bbalctfaOaAfgORbbaoRbdgAcl4gCaCcsSgCE86bbalc91faOaCfgORbbaAcsGgAaAcsSgAE86bbalc4faOaAfgORbbaoRbigAcl4gCaCcsSgCE86bbalc93faOaCfgORbbaAcsGgAaAcsSgAE86bbalc94faOaAfgORbbaoRblgAcl4gCaCcsSgCE86bbalc95faOaCfgORbbaAcsGgAaAcsSgAE86bbalc96faOaAfgORbbaoRbvgAcl4gCaCcsSgCE86bbalc97faOaCfgORbbaAcsGgAaAcsSgAE86bbalc98faOaAfgORbbaoRbogAcl4gCaCcsSgCE86bbalc99faOaCfgORbbaAcsGgAaAcsSgAE86bbalc9:faOaAfgORbbaoRbrgocl4gAaAcsSgAE86bbalcufaOaAfglRbbaocsGgoaocsSgoE86bbalaofhoxekaOao8Pbb83bbaOcwfaocwf8Pbb83bbaoczfhokdnaiam9pmbaiczfhlarao9RcL0mekkaiam6miaoTmidnakTmbawaPfRbbhOawcj;cbfhlazhiakhHinaialRbbgAce4cbaAceG9R7aOfgO86bbaiadfhialcefhlaHcufgHmbkkazcefhzaPcefgPad6hsaohHaPad9hmexvkkcbhoasceGmdxikaoaxad2fhPdnakTmbcbhmcehsawcjdfhCinarao9Rax6miaoTmdaoaxfhoawamfRbbhOawcj;cbfhlaChiakhHinaialRbbgAce4cbaAceG9R7aOfgO86bbaiadfhialcefhlaHcufgHmbkaCcefhCamcefgmad6hsamad9hmbkaPhoxikcbhlcehsinarao9Rax6mdaoTmeaoaxfhoalcefglad6hsadal9hmbkaPhoxdkcbhoasceGTmekc9:hoxikabaqad2fawcjdfakad2z1jjjb8Aawawcjdfakcufad2fadz1jjjb8Aakaqfhqaombkc9:hoxekcbc99arao9Radcaadca0ESEhokavcj;ebf8Kjjjjbaok;xzeHu8Jjjjjbc;ae9Rgv8Kjjjjbc9:hodnaeci9UgrcHfal0mbcuhoaiRbbgwc;WeGc;Ge9hmbawcsGgDce0mbavc;abfcFecjez:jjjjb8AavcUf9cu83ibavc8Wf9cu83ibavcyf9cu83ibavcaf9cu83ibavcKf9cu83ibavczf9cu83ibav9cu83iwav9cu83ibaialfc9WfhqaicefgwarfhodnaeTmbcmcsaDceSEhkcbhxcbhmcbhrcbhicbhlindnaoaq9nmbc9:hoxikdndnawRbbgDc;Ve0mbavc;abfalaDcu7gPcl4fcsGcitfgsydlhzasydbhHdnaDcsGgDak9pmbavaiaPfcsGcdtfydbaxaDEhsaDThDdndnadcd9hmbabarcetfgPaH87ebaPcdfaz87ebaPclfas87ebxekabarcdtfgPaHBdbaPclfazBdbaPcwfasBdbkaxaDfhxavc;abfalcitfgPasBdbaPazBdlavaicdtfasBdbavc;abfalcefcsGglcitfgPaHBdbaPasBdlaiaDfhialcefhlxdkdndnaDcsSmbamaDfaDc987fcefhmxekaocefhDao8SbbgscFeGhPdndnascu9mmbaDhoxekaocvfhoaPcFbGhPcrhsdninaD8SbbgOcFbGastaPVhPaOcu9kmeaDcefhDascrfgsc8J9hmbxdkkaDcefhokaPce4cbaPceG9R7amfhmkdndnadcd9hmbabarcetfgDaH87ebaDcdfaz87ebaDclfam87ebxekabarcdtfgDaHBdbaDclfazBdbaDcwfamBdbkavc;abfalcitfgDamBdbaDazBdlavaicdtfamBdbavc;abfalcefcsGglcitfgDaHBdbaDamBdlaicefhialcefhlxekdnaDcpe0mbaxcefgOavaiaqaDcsGfRbbgscl49RcsGcdtfydbascz6gPEhDavaias9RcsGcdtfydbaOaPfgzascsGgOEhsaOThOdndnadcd9hmbabarcetfgHax87ebaHcdfaD87ebaHclfas87ebxekabarcdtfgHaxBdbaHclfaDBdbaHcwfasBdbkavaicdtfaxBdbavc;abfalcitfgHaDBdbaHaxBdlavaicefgicsGcdtfaDBdbavc;abfalcefcsGcitfgHasBdbaHaDBdlavaiaPfcsGgicdtfasBdbavc;abfalcdfcsGglcitfgDaxBdbaDasBdlalcefhlaiaOfhiazaOfhxxekaxcbaoRbbgHEgAaDc;:eSgDfhzaHcsGhCaHcl4hXdndnaHcs0mbazcefhOxekazhOavaiaX9RcsGcdtfydbhzkdndnaCmbaOcefhxxekaOhxavaiaH9RcsGcdtfydbhOkdndnaDTmbaocefhDxekaocdfhDao8SbegPcFeGhsdnaPcu9kmbaocofhAascFbGhscrhodninaD8SbbgPcFbGaotasVhsaPcu9kmeaDcefhDaocrfgoc8J9hmbkaAhDxekaDcefhDkasce4cbasceG9R7amfgmhAkdndnaXcsSmbaDhsxekaDcefhsaD8SbbgocFeGhPdnaocu9kmbaDcvfhzaPcFbGhPcrhodninas8SbbgDcFbGaotaPVhPaDcu9kmeascefhsaocrfgoc8J9hmbkazhsxekascefhskaPce4cbaPceG9R7amfgmhzkdndnaCcsSmbashoxekascefhoas8SbbgDcFeGhPdnaDcu9kmbascvfhOaPcFbGhPcrhDdninao8SbbgscFbGaDtaPVhPascu9kmeaocefhoaDcrfgDc8J9hmbkaOhoxekaocefhokaPce4cbaPceG9R7amfgmhOkdndnadcd9hmbabarcetfgDaA87ebaDcdfaz87ebaDclfaO87ebxekabarcdtfgDaABdbaDclfazBdbaDcwfaOBdbkavc;abfalcitfgDazBdbaDaABdlavaicdtfaABdbavc;abfalcefcsGcitfgDaOBdbaDazBdlavaicefgicsGcdtfazBdbavc;abfalcdfcsGcitfgDaABdbaDaOBdlavaiaHcz6aXcsSVfgicsGcdtfaOBdbaiaCTaCcsSVfhialcifhlkawcefhwalcsGhlaicsGhiarcifgrae6mbkkcbc99aoaqSEhokavc;aef8Kjjjjbaok:flevu8Jjjjjbcz9Rhvc9:hodnaecvfal0mbcuhoaiRbbc;:eGc;qe9hmbav9cb83iwaicefhraialfc98fhwdnaeTmbdnadcdSmbcbhDindnaraw6mbc9:skarcefhoar8SbbglcFeGhidndnalcu9mmbaohrxekarcvfhraicFbGhicrhldninao8SbbgdcFbGaltaiVhiadcu9kmeaocefhoalcrfglc8J9hmbxdkkaocefhrkabaDcdtfaic8Etc8F91aicd47avcwfaiceGcdtVgoydbfglBdbaoalBdbaDcefgDae9hmbxdkkcbhDindnaraw6mbc9:skarcefhoar8SbbglcFeGhidndnalcu9mmbaohrxekarcvfhraicFbGhicrhldninao8SbbgdcFbGaltaiVhiadcu9kmeaocefhoalcrfglc8J9hmbxdkkaocefhrkabaDcetfaic8Etc8F91aicd47avcwfaiceGcdtVgoydbfgl87ebaoalBdbaDcefgDae9hmbkkcbc99arawSEhokaok:Lvoeue99dud99eud99dndnadcl9hmbaeTmeindndnabcdfgd8Sbb:Yab8Sbbgi:Ygl:l:tabcefgv8Sbbgo:Ygr:l:tgwJbb;:9cawawNJbbbbawawJbbbb9GgDEgq:mgkaqaicb9iEalMgwawNakaqaocb9iEarMgqaqNMM:r:vglNJbbbZJbbb:;aDEMgr:lJbbb9p9DTmbar:Ohixekcjjjj94hikadai86bbdndnaqalNJbbbZJbbb:;aqJbbbb9GEMgq:lJbbb9p9DTmbaq:Ohdxekcjjjj94hdkavad86bbdndnawalNJbbbZJbbb:;awJbbbb9GEMgw:lJbbb9p9DTmbaw:Ohdxekcjjjj94hdkabad86bbabclfhbaecufgembxdkkaeTmbindndnabclfgd8Ueb:Yab8Uebgi:Ygl:l:tabcdfgv8Uebgo:Ygr:l:tgwJb;:FSawawNJbbbbawawJbbbb9GgDEgq:mgkaqaicb9iEalMgwawNakaqaocb9iEarMgqaqNMM:r:vglNJbbbZJbbb:;aDEMgr:lJbbb9p9DTmbar:Ohixekcjjjj94hikadai87ebdndnaqalNJbbbZJbbb:;aqJbbbb9GEMgq:lJbbb9p9DTmbaq:Ohdxekcjjjj94hdkavad87ebdndnawalNJbbbZJbbb:;awJbbbb9GEMgw:lJbbb9p9DTmbaw:Ohdxekcjjjj94hdkabad87ebabcwfhbaecufgembkkk;siliui99iue99dnaeTmbcbhiabhlindndnJ;Zl81Zalcof8UebgvciV:Y:vgoal8Ueb:YNgrJb;:FSNJbbbZJbbb:;arJbbbb9GEMgw:lJbbb9p9DTmbaw:OhDxekcjjjj94hDkalclf8Uebhqalcdf8UebhkabavcefciGaiVcetfaD87ebdndnaoak:YNgwJb;:FSNJbbbZJbbb:;awJbbbb9GEMgx:lJbbb9p9DTmbax:Ohkxekcjjjj94hkkabavcdfciGaiVcetfak87ebdndnaoaq:YNgoJb;:FSNJbbbZJbbb:;aoJbbbb9GEMgx:lJbbb9p9DTmbax:Ohqxekcjjjj94hqkabavcufciGaiVcetfaq87ebdndnJbbjZararN:tawawN:taoaoN:tgrJbbbbarJbbbb9GE:rJb;:FSNJbbbZMgr:lJbbb9p9DTmbar:Ohqxekcjjjj94hqkabavciGaiVcetfaq87ebalcwfhlaiclfhiaecufgembkkk9mbdnadcd4ae2gdTmbinababydbgecwtcw91:Yaece91cjjj;8ifcjjj98G::NUdbabclfhbadcufgdmbkkk9teiucbcbydj1jjbgeabcifc98GfgbBdj1jjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaik;LeeeudndnaeabVciGTmbabhixekdndnadcz9pmbabhixekabhiinaiaeydbBdbaiclfaeclfydbBdbaicwfaecwfydbBdbaicxfaecxfydbBdbaeczfheaiczfhiadc9Wfgdcs0mbkkadcl6mbinaiaeydbBdbaeclfheaiclfhiadc98fgdci0mbkkdnadTmbinaiaeRbb86bbaicefhiaecefheadcufgdmbkkabk;aeedudndnabciGTmbabhixekaecFeGc:b:c:ew2hldndnadcz9pmbabhixekabhiinaialBdbaicxfalBdbaicwfalBdbaiclfalBdbaiczfhiadc9Wfgdcs0mbkkadcl6mbinaialBdbaiclfhiadc98fgdci0mbkkdnadTmbinaiae86bbaicefhiadcufgdmbkkabkkkebcjwklz9Kbb`,wasm_simd=`b9H79TebbbeKl9Gbb9Gvuuuuueu9Giuuub9Geueuikqbbebeedddilve9Weeeviebeoweuec:q;Aekr;leDo9TW9T9VV95dbH9F9F939H79T9F9J9H229F9Jt9VV7bb8A9TW79O9V9Wt9F9KW9J9V9KW9wWVtW949c919M9MWVbdY9TW79O9V9Wt9F9KW9J9V9KW69U9KW949c919M9MWVblE9TW79O9V9Wt9F9KW9J9V9KW69U9KW949tWG91W9U9JWbvL9TW79O9V9Wt9F9KW9J9V9KWS9P2tWV9p9JtboK9TW79O9V9Wt9F9KW9J9V9KWS9P2tWV9r919HtbrL9TW79O9V9Wt9F9KW9J9V9KWS9P2tWVT949Wbwl79IV9RbDq;a9tqlbzik9:evu8Jjjjjbcz9Rhbcbheincbhdcbhiinabcwfadfaicjuaead4ceGglE86bbaialfhiadcefgdcw9hmbkaec:q:yjjbfai86bbaecitc:q1jjbfab8Piw83ibaecefgecjd9hmbkk;d8JlHud97euo978Jjjjjbcj;kb9Rgv8Kjjjjbc9:hodnadcefal0mbcuhoaiRbbc:Ge9hmbavaialfgrad9Rad;8qbbcj;abad9UhoaicefhldnadTmbaoc;WFbGgocjdaocjd6EhwcbhDinaDae9pmeawaeaD9RaDawfae6Egqcsfgoc9WGgkci2hxakcethmaocl4cifcd4hPabaDad2fhscbhzdnincehHalhOcbhAdninaraO9RaP6miavcj;cbfaAak2fhCaOaPfhlcbhidnakc;ab6mbaral9Rc;Gb6mbcbhoinaCaofhidndndndndnaOaoco4fRbbgXciGPlbedibkaipxbbbbbbbbbbbbbbbbpklbxikaialpbblalpbbbgQclp:meaQpmbzeHdOiAlCvXoQrLgQcdp:meaQpmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9ogLpxiiiiiiiiiiiiiiiip8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklbalclfaYpQbfaKc:q:yjjbfRbbfhlxdkaialpbbwalpbbbgQclp:meaQpmbzeHdOiAlCvXoQrLpxssssssssssssssssp9ogLpxssssssssssssssssp8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklbalcwfaYpQbfaKc:q:yjjbfRbbfhlxekaialpbbbpklbalczfhlkdndndndndnaXcd4ciGPlbedibkaipxbbbbbbbbbbbbbbbbpklzxikaialpbblalpbbbgQclp:meaQpmbzeHdOiAlCvXoQrLgQcdp:meaQpmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9ogLpxiiiiiiiiiiiiiiiip8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklzalclfaYpQbfaKc:q:yjjbfRbbfhlxdkaialpbbwalpbbbgQclp:meaQpmbzeHdOiAlCvXoQrLpxssssssssssssssssp9ogLpxssssssssssssssssp8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklzalcwfaYpQbfaKc:q:yjjbfRbbfhlxekaialpbbbpklzalczfhlkdndndndndnaXcl4ciGPlbedibkaipxbbbbbbbbbbbbbbbbpklaxikaialpbblalpbbbgQclp:meaQpmbzeHdOiAlCvXoQrLgQcdp:meaQpmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9ogLpxiiiiiiiiiiiiiiiip8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklaalclfaYpQbfaKc:q:yjjbfRbbfhlxdkaialpbbwalpbbbgQclp:meaQpmbzeHdOiAlCvXoQrLpxssssssssssssssssp9ogLpxssssssssssssssssp8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklaalcwfaYpQbfaKc:q:yjjbfRbbfhlxekaialpbbbpklaalczfhlkdndndndndnaXco4Plbedibkaipxbbbbbbbbbbbbbbbbpkl8WxikaialpbblalpbbbgQclp:meaQpmbzeHdOiAlCvXoQrLgQcdp:meaQpmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9ogLpxiiiiiiiiiiiiiiiip8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgXcitc:q1jjbfpbibaXc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgXcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spkl8WalclfaYpQbfaXc:q:yjjbfRbbfhlxdkaialpbbwalpbbbgQclp:meaQpmbzeHdOiAlCvXoQrLpxssssssssssssssssp9ogLpxssssssssssssssssp8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgXcitc:q1jjbfpbibaXc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgXcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spkl8WalcwfaYpQbfaXc:q:yjjbfRbbfhlxekaialpbbbpkl8Walczfhlkaoc;abfhiaocjefak0meaihoaral9Rc;Fb0mbkkdndnaiak9pmbaici4hoinaral9RcK6mdaCaifhXdndndndndnaOaico4fRbbaocoG4ciGPlbedibkaXpxbbbbbbbbbbbbbbbbpklbxikaXalpbblalpbbbgQclp:meaQpmbzeHdOiAlCvXoQrLgQcdp:meaQpmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9ogLpxiiiiiiiiiiiiiiiip8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklbalclfaYpQbfaKc:q:yjjbfRbbfhlxdkaXalpbbwalpbbbgQclp:meaQpmbzeHdOiAlCvXoQrLpxssssssssssssssssp9ogLpxssssssssssssssssp8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklbalcwfaYpQbfaKc:q:yjjbfRbbfhlxekaXalpbbbpklbalczfhlkaocdfhoaiczfgiak6mbkkalTmbaAci6hHalhOaAcefgAclSmdxekkcbhlaHceGmdkdnakTmbavcjdfazfhiavazfpbdbhYcbhXinaiavcj;cbfaXfgopblbgLcep9TaLpxeeeeeeeeeeeeeeeegQp9op9Hp9rgLaoakfpblbg8Acep9Ta8AaQp9op9Hp9rg8ApmbzeHdOiAlCvXoQrLgEaoamfpblbg3cep9Ta3aQp9op9Hp9rg3aoaxfpblbg5cep9Ta5aQp9op9Hp9rg5pmbzeHdOiAlCvXoQrLg8EpmbezHdiOAlvCXorQLgQaQpmbedibedibedibediaYp9UgYp9AdbbaiadfgoaYaQaQpmlvorlvorlvorlvorp9UgYp9AdbbaoadfgoaYaQaQpmwDqkwDqkwDqkwDqkp9UgYp9AdbbaoadfgoaYaQaQpmxmPsxmPsxmPsxmPsp9UgYp9AdbbaoadfgoaYaEa8EpmwDKYqk8AExm35Ps8E8FgQaQpmbedibedibedibedip9UgYp9AdbbaoadfgoaYaQaQpmlvorlvorlvorlvorp9UgYp9AdbbaoadfgoaYaQaQpmwDqkwDqkwDqkwDqkp9UgYp9AdbbaoadfgoaYaQaQpmxmPsxmPsxmPsxmPsp9UgYp9AdbbaoadfgoaYaLa8ApmwKDYq8AkEx3m5P8Es8FgLa3a5pmwKDYq8AkEx3m5P8Es8Fg8ApmbezHdiOAlvCXorQLgQaQpmbedibedibedibedip9UgYp9AdbbaoadfgoaYaQaQpmlvorlvorlvorlvorp9UgYp9AdbbaoadfgoaYaQaQpmwDqkwDqkwDqkwDqkp9UgYp9AdbbaoadfgoaYaQaQpmxmPsxmPsxmPsxmPsp9UgYp9AdbbaoadfgoaYaLa8ApmwDKYqk8AExm35Ps8E8FgQaQpmbedibedibedibedip9UgYp9AdbbaoadfgoaYaQaQpmlvorlvorlvorlvorp9UgYp9AdbbaoadfgoaYaQaQpmwDqkwDqkwDqkwDqkp9UgYp9AdbbaoadfgoaYaQaQpmxmPsxmPsxmPsxmPsp9UgYp9AdbbaoadfhiaXczfgXak6mbkkazclfgzad6mbkasavcjdfaqad2;8qbbavavcjdfaqcufad2fad;8qbbaqaDfhDc9:hoalmexikkc9:hoxekcbc99aral9Radcaadca0ESEhokavcj;kbf8Kjjjjbaokwbz:bjjjbk;tzeHu8Jjjjjbc;ae9Rgv8Kjjjjbc9:hodnaeci9UgrcHfal0mbcuhoaiRbbgwc;WeGc;Ge9hmbawcsGgDce0mbavc;abfcFecje;8kbavcUf9cu83ibavc8Wf9cu83ibavcyf9cu83ibavcaf9cu83ibavcKf9cu83ibavczf9cu83ibav9cu83iwav9cu83ibaialfc9WfhqaicefgwarfhodnaeTmbcmcsaDceSEhkcbhxcbhmcbhrcbhicbhlindnaoaq9nmbc9:hoxikdndnawRbbgDc;Ve0mbavc;abfalaDcu7gPcl4fcsGcitfgsydlhzasydbhHdnaDcsGgDak9pmbavaiaPfcsGcdtfydbaxaDEhsaDThDdndnadcd9hmbabarcetfgPaH87ebaPcdfaz87ebaPclfas87ebxekabarcdtfgPaHBdbaPclfazBdbaPcwfasBdbkaxaDfhxavc;abfalcitfgPasBdbaPazBdlavaicdtfasBdbavc;abfalcefcsGglcitfgPaHBdbaPasBdlaiaDfhialcefhlxdkdndnaDcsSmbamaDfaDc987fcefhmxekaocefhDao8SbbgscFeGhPdndnascu9mmbaDhoxekaocvfhoaPcFbGhPcrhsdninaD8SbbgOcFbGastaPVhPaOcu9kmeaDcefhDascrfgsc8J9hmbxdkkaDcefhokaPce4cbaPceG9R7amfhmkdndnadcd9hmbabarcetfgDaH87ebaDcdfaz87ebaDclfam87ebxekabarcdtfgDaHBdbaDclfazBdbaDcwfamBdbkavc;abfalcitfgDamBdbaDazBdlavaicdtfamBdbavc;abfalcefcsGglcitfgDaHBdbaDamBdlaicefhialcefhlxekdnaDcpe0mbaxcefgOavaiaqaDcsGfRbbgscl49RcsGcdtfydbascz6gPEhDavaias9RcsGcdtfydbaOaPfgzascsGgOEhsaOThOdndnadcd9hmbabarcetfgHax87ebaHcdfaD87ebaHclfas87ebxekabarcdtfgHaxBdbaHclfaDBdbaHcwfasBdbkavaicdtfaxBdbavc;abfalcitfgHaDBdbaHaxBdlavaicefgicsGcdtfaDBdbavc;abfalcefcsGcitfgHasBdbaHaDBdlavaiaPfcsGgicdtfasBdbavc;abfalcdfcsGglcitfgDaxBdbaDasBdlalcefhlaiaOfhiazaOfhxxekaxcbaoRbbgHEgAaDc;:eSgDfhzaHcsGhCaHcl4hXdndnaHcs0mbazcefhOxekazhOavaiaX9RcsGcdtfydbhzkdndnaCmbaOcefhxxekaOhxavaiaH9RcsGcdtfydbhOkdndnaDTmbaocefhDxekaocdfhDao8SbegPcFeGhsdnaPcu9kmbaocofhAascFbGhscrhodninaD8SbbgPcFbGaotasVhsaPcu9kmeaDcefhDaocrfgoc8J9hmbkaAhDxekaDcefhDkasce4cbasceG9R7amfgmhAkdndnaXcsSmbaDhsxekaDcefhsaD8SbbgocFeGhPdnaocu9kmbaDcvfhzaPcFbGhPcrhodninas8SbbgDcFbGaotaPVhPaDcu9kmeascefhsaocrfgoc8J9hmbkazhsxekascefhskaPce4cbaPceG9R7amfgmhzkdndnaCcsSmbashoxekascefhoas8SbbgDcFeGhPdnaDcu9kmbascvfhOaPcFbGhPcrhDdninao8SbbgscFbGaDtaPVhPascu9kmeaocefhoaDcrfgDc8J9hmbkaOhoxekaocefhokaPce4cbaPceG9R7amfgmhOkdndnadcd9hmbabarcetfgDaA87ebaDcdfaz87ebaDclfaO87ebxekabarcdtfgDaABdbaDclfazBdbaDcwfaOBdbkavc;abfalcitfgDazBdbaDaABdlavaicdtfaABdbavc;abfalcefcsGcitfgDaOBdbaDazBdlavaicefgicsGcdtfazBdbavc;abfalcdfcsGcitfgDaABdbaDaOBdlavaiaHcz6aXcsSVfgicsGcdtfaOBdbaiaCTaCcsSVfhialcifhlkawcefhwalcsGhlaicsGhiarcifgrae6mbkkcbc99aoaqSEhokavc;aef8Kjjjjbaok:flevu8Jjjjjbcz9Rhvc9:hodnaecvfal0mbcuhoaiRbbc;:eGc;qe9hmbav9cb83iwaicefhraialfc98fhwdnaeTmbdnadcdSmbcbhDindnaraw6mbc9:skarcefhoar8SbbglcFeGhidndnalcu9mmbaohrxekarcvfhraicFbGhicrhldninao8SbbgdcFbGaltaiVhiadcu9kmeaocefhoalcrfglc8J9hmbxdkkaocefhrkabaDcdtfaic8Etc8F91aicd47avcwfaiceGcdtVgoydbfglBdbaoalBdbaDcefgDae9hmbxdkkcbhDindnaraw6mbc9:skarcefhoar8SbbglcFeGhidndnalcu9mmbaohrxekarcvfhraicFbGhicrhldninao8SbbgdcFbGaltaiVhiadcu9kmeaocefhoalcrfglc8J9hmbxdkkaocefhrkabaDcetfaic8Etc8F91aicd47avcwfaiceGcdtVgoydbfgl87ebaoalBdbaDcefgDae9hmbkkcbc99arawSEhokaok:wPliuo97eue978Jjjjjbca9Rhiaec98Ghldndnadcl9hmbdnalTmbcbhvabhdinadadpbbbgocKp:RecKp:Sep;6egraocwp:RecKp:Sep;6earp;Geaoczp:RecKp:Sep;6egwp;Gep;Kep;LegDpxbbbbbbbbbbbbbbbbp:2egqarpxbbbjbbbjbbbjbbbjgkp9op9rp;Kegrpxbb;:9cbb;:9cbb;:9cbb;:9cararp;MeaDaDp;Meawaqawakp9op9rp;Kegrarp;Mep;Kep;Kep;Jep;Negwp;Mepxbbn0bbn0bbn0bbn0gqp;KepxFbbbFbbbFbbbFbbbp9oaopxbbbFbbbFbbbFbbbFp9op9qarawp;Meaqp;Kecwp:RepxbFbbbFbbbFbbbFbbp9op9qaDawp;Meaqp;Keczp:RepxbbFbbbFbbbFbbbFbp9op9qpkbbadczfhdavclfgval6mbkkalae9pmeaipxbbbbbbbbbbbbbbbbgqpklbaiabalcdtfgdaeciGglcdtgv;8qbbdnalTmbaiaipblbgocKp:RecKp:Sep;6egraocwp:RecKp:Sep;6earp;Geaoczp:RecKp:Sep;6egwp;Gep;Kep;LegDaqp:2egqarpxbbbjbbbjbbbjbbbjgkp9op9rp;Kegrpxbb;:9cbb;:9cbb;:9cbb;:9cararp;MeaDaDp;Meawaqawakp9op9rp;Kegrarp;Mep;Kep;Kep;Jep;Negwp;Mepxbbn0bbn0bbn0bbn0gqp;KepxFbbbFbbbFbbbFbbbp9oaopxbbbFbbbFbbbFbbbFp9op9qarawp;Meaqp;Kecwp:RepxbFbbbFbbbFbbbFbbp9op9qaDawp;Meaqp;Keczp:RepxbbFbbbFbbbFbbbFbp9op9qpklbkadaiav;8qbbskdnalTmbcbhvabhdinadczfgxaxpbbbgopxbbbbbbFFbbbbbbFFgkp9oadpbbbgDaopmlvorxmPsCXQL358E8FpxFubbFubbFubbFubbp9op;6eaDaopmbediwDqkzHOAKY8AEgoczp:Sep;6egrp;Geaoczp:Reczp:Sep;6egwp;Gep;Kep;Legopxb;:FSb;:FSb;:FSb;:FSawaopxbbbbbbbbbbbbbbbbp:2egqawpxbbbjbbbjbbbjbbbjgmp9op9rp;Kegwawp;Meaoaop;Mearaqaramp9op9rp;Kegoaop;Mep;Kep;Kep;Jep;Negrp;Mepxbbn0bbn0bbn0bbn0gqp;Keczp:Reawarp;Meaqp;KepxFFbbFFbbFFbbFFbbp9op9qgwaoarp;Meaqp;KepxFFbbFFbbFFbbFFbbp9ogopmwDKYqk8AExm35Ps8E8Fp9qpkbbadaDakp9oawaopmbezHdiOAlvCXorQLp9qpkbbadcafhdavclfgval6mbkkalae9pmbaiaeciGgvcitgdfcbcaad9R;8kbaiabalcitfglad;8qbbdnavTmbaiaipblzgopxbbbbbbFFbbbbbbFFgkp9oaipblbgDaopmlvorxmPsCXQL358E8FpxFubbFubbFubbFubbp9op;6eaDaopmbediwDqkzHOAKY8AEgoczp:Sep;6egrp;Geaoczp:Reczp:Sep;6egwp;Gep;Kep;Legopxb;:FSb;:FSb;:FSb;:FSawaopxbbbbbbbbbbbbbbbbp:2egqawpxbbbjbbbjbbbjbbbjgmp9op9rp;Kegwawp;Meaoaop;Mearaqaramp9op9rp;Kegoaop;Mep;Kep;Kep;Jep;Negrp;Mepxbbn0bbn0bbn0bbn0gqp;Keczp:Reawarp;Meaqp;KepxFFbbFFbbFFbbFFbbp9op9qgwaoarp;Meaqp;KepxFFbbFFbbFFbbFFbbp9ogopmwDKYqk8AExm35Ps8E8Fp9qpklzaiaDakp9oawaopmbezHdiOAlvCXorQLp9qpklbkalaiad;8qbbkk;4wllue97euv978Jjjjjbc8W9Rhidnaec98GglTmbcbhvabhoinaiaopbbbgraoczfgwpbbbgDpmlvorxmPsCXQL358E8Fgqczp:Segkclp:RepklbaopxbbjZbbjZbbjZbbjZpx;Zl81Z;Zl81Z;Zl81Z;Zl81Zakpxibbbibbbibbbibbbp9qp;6ep;NegkaraDpmbediwDqkzHOAKY8AEgrczp:Reczp:Sep;6ep;MegDaDp;Meakarczp:Sep;6ep;Megxaxp;Meakaqczp:Reczp:Sep;6ep;Megqaqp;Mep;Kep;Kep;Lepxbbbbbbbbbbbbbbbbp:4ep;Jepxb;:FSb;:FSb;:FSb;:FSgkp;Mepxbbn0bbn0bbn0bbn0grp;KepxFFbbFFbbFFbbFFbbgmp9oaxakp;Mearp;Keczp:Rep9qgxaqakp;Mearp;Keczp:ReaDakp;Mearp;Keamp9op9qgkpmbezHdiOAlvCXorQLgrp5baipblbpEb:T:j83ibaocwfarp5eaipblbpEe:T:j83ibawaxakpmwDKYqk8AExm35Ps8E8Fgkp5baipblbpEd:T:j83ibaocKfakp5eaipblbpEi:T:j83ibaocafhoavclfgval6mbkkdnalae9pmbaiaeciGgvcitgofcbcaao9R;8kbaiabalcitfgwao;8qbbdnavTmbaiaipblbgraipblzgDpmlvorxmPsCXQL358E8Fgqczp:Segkclp:RepklaaipxbbjZbbjZbbjZbbjZpx;Zl81Z;Zl81Z;Zl81Z;Zl81Zakpxibbbibbbibbbibbbp9qp;6ep;NegkaraDpmbediwDqkzHOAKY8AEgrczp:Reczp:Sep;6ep;MegDaDp;Meakarczp:Sep;6ep;Megxaxp;Meakaqczp:Reczp:Sep;6ep;Megqaqp;Mep;Kep;Kep;Lepxbbbbbbbbbbbbbbbbp:4ep;Jepxb;:FSb;:FSb;:FSb;:FSgkp;Mepxbbn0bbn0bbn0bbn0grp;KepxFFbbFFbbFFbbFFbbgmp9oaxakp;Mearp;Keczp:Rep9qgxaqakp;Mearp;Keczp:ReaDakp;Mearp;Keamp9op9qgkpmbezHdiOAlvCXorQLgrp5baipblapEb:T:j83ibaiarp5eaipblapEe:T:j83iwaiaxakpmwDKYqk8AExm35Ps8E8Fgkp5baipblapEd:T:j83izaiakp5eaipblapEi:T:j83iKkawaiao;8qbbkk:Pddiue978Jjjjjbc;ab9Rhidnadcd4ae2glc98GgvTmbcbheabhdinadadpbbbgocwp:Recwp:Sep;6eaocep:SepxbbjZbbjZbbjZbbjZp:UepxbbjFbbjFbbjFbbjFp9op;Mepkbbadczfhdaeclfgeav6mbkkdnaval9pmbaialciGgecdtgdVcbc;abad9R;8kbaiabavcdtfgvad;8qbbdnaeTmbaiaipblbgocwp:Recwp:Sep;6eaocep:SepxbbjZbbjZbbjZbbjZp:UepxbbjFbbjFbbjFbbjFp9op;Mepklbkavaiad;8qbbkk9teiucbcbydj1jjbgeabcifc98GfgbBdj1jjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaikkkebcjwklz9Tbb`,detector=new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,3,2,0,0,5,3,1,0,1,12,1,0,10,22,2,12,0,65,0,65,0,65,0,252,10,0,0,11,7,0,65,0,253,15,26,11]),wasmpack=new Uint8Array([32,0,65,2,1,106,34,33,3,128,11,4,13,64,6,253,10,7,15,116,127,5,8,12,40,16,19,54,20,9,27,255,113,17,42,67,24,23,146,148,18,14,22,45,70,69,56,114,101,21,25,63,75,136,108,28,118,29,73,115]);if(typeof WebAssembly!=`object`)return{supported:!1};var wasm=WebAssembly.validate(detector)?wasm_simd:wasm_base,instance,ready=WebAssembly.instantiate(unpack(wasm),{}).then(function(result){instance=result.instance,instance.exports.__wasm_call_ctors()});function unpack(data){for(var result=new Uint8Array(data.length),i=0;i<data.length;++i){var ch=data.charCodeAt(i);result[i]=ch>96?ch-97:ch>64?ch-39:ch+4}for(var write=0,i=0;i<data.length;++i)result[write++]=result[i]<60?wasmpack[result[i]]:(result[i]-60)*64+result[++i];return result.buffer.slice(0,write)}function decode(fun,target,count,size,source,filter){var sbrk=instance.exports.sbrk,count4=count+3&-4,tp=sbrk(count4*size),sp=sbrk(source.length),heap=new Uint8Array(instance.exports.memory.buffer);heap.set(source,sp);var res=fun(tp,count,size,sp,source.length);if(res==0&&filter&&filter(tp,count4,size),target.set(heap.subarray(tp,tp+count*size)),sbrk(tp-sbrk(0)),res!=0)throw Error(`Malformed buffer data: `+res)}var filters={NONE:``,OCTAHEDRAL:`meshopt_decodeFilterOct`,QUATERNION:`meshopt_decodeFilterQuat`,EXPONENTIAL:`meshopt_decodeFilterExp`},decoders={ATTRIBUTES:`meshopt_decodeVertexBuffer`,TRIANGLES:`meshopt_decodeIndexBuffer`,INDICES:`meshopt_decodeIndexSequence`},workers=[],requestId=0;function createWorker(url){var worker={object:new Worker(url),pending:0,requests:{}};return worker.object.onmessage=function(event){var data=event.data;worker.pending-=data.count,worker.requests[data.id][data.action](data.value),delete worker.requests[data.id]},worker}function initWorkers(count){for(var source=`var instance; var ready = WebAssembly.instantiate(new Uint8Array([`+new Uint8Array(unpack(wasm))+`]), {}).then(function(result) { instance = result.instance; instance.exports.__wasm_call_ctors(); });self.onmessage = workerProcess;`+decode.toString()+workerProcess.toString(),blob=new Blob([source],{type:`text/javascript`}),url=URL.createObjectURL(blob),i=0;i<count;++i)workers[i]=createWorker(url);URL.revokeObjectURL(url)}function decodeWorker(count,size,source,mode,filter){for(var worker=workers[0],i=1;i<workers.length;++i)workers[i].pending<worker.pending&&(worker=workers[i]);return new Promise(function(resolve,reject){var data=new Uint8Array(source),id=requestId++;worker.pending+=count,worker.requests[id]={resolve,reject},worker.object.postMessage({id,count,size,source:data,mode,filter},[data.buffer])})}function workerProcess(event){ready.then(function(){var data=event.data;try{var target=new Uint8Array(data.count*data.size);decode(instance.exports[data.mode],target,data.count,data.size,data.source,instance.exports[data.filter]),self.postMessage({id:data.id,count:data.count,action:`resolve`,value:target},[target.buffer])}catch(error){self.postMessage({id:data.id,count:data.count,action:`reject`,value:error})}})}return{ready,supported:!0,useWorkers:function(count){initWorkers(count)},decodeVertexBuffer:function(target,count,size,source,filter){decode(instance.exports.meshopt_decodeVertexBuffer,target,count,size,source,instance.exports[filters[filter]])},decodeIndexBuffer:function(target,count,size,source){decode(instance.exports.meshopt_decodeIndexBuffer,target,count,size,source)},decodeIndexSequence:function(target,count,size,source){decode(instance.exports.meshopt_decodeIndexSequence,target,count,size,source)},decodeGltfBuffer:function(target,count,size,source,mode,filter){decode(instance.exports[decoders[mode]],target,count,size,source,instance.exports[filters[filter]])},decodeGltfBufferAsync:function(count,size,source,mode,filter){return workers.length>0?decodeWorker(count,size,source,decoders[mode],filters[filter]):ready.then(function(){var target=new Uint8Array(count*size);return decode(instance.exports[decoders[mode]],target,count,size,source,instance.exports[filters[filter]]),target})}}})(),EXTENSION_NAME$4=`EXT_meshopt_compression`,EXT_meshopt_compression=class extends BaseExtension{loadBufferView(index,parser){let json=parser.json,bufferView=json.bufferViews[index];if(bufferView.extensions&&bufferView.extensions[EXTENSION_NAME$4]){let extensionDef=bufferView.extensions[EXTENSION_NAME$4],buffer=parser.loadBuffer(extensionDef.buffer);if(!meshoptDecoder.supported){if(json.extensionsRequired&&json.extensionsRequired.indexOf(EXTENSION_NAME$4)>=0)throw Error(`THREE.GLTFLoader: setMeshoptDecoder must be called before loading compressed files`);return null}return Promise.all([buffer,meshoptDecoder.ready]).then(([buffer])=>{let byteOffset=extensionDef.byteOffset||0,byteLength=extensionDef.byteLength||0,count=extensionDef.count,stride=extensionDef.byteStride,result=new ArrayBuffer(count*stride),source=new Uint8Array(buffer,byteOffset,byteLength);return meshoptDecoder.decodeGltfBuffer(new Uint8Array(result),count,stride,source,extensionDef.mode,extensionDef.filter),result})}else return null}},EXTENSION_NAME$3=`EXT_texture_webp`,EXT_texture_webp=class extends BaseExtension{constructor(){super(...arguments),this.supportsWep=!1}prepare(parser){return imageSupport().then(result=>{this.supportsWep=result.webp})}loadTexture(index,parser){let textureDef=parser.json.textures[index];if(!textureDef.extensions||!textureDef.extensions[EXTENSION_NAME$3]||!this.supportsWep)return null;let extension=textureDef.extensions[EXTENSION_NAME$3];return parser.loadImage(extension.source).then(image=>{let texture=new THREE.Texture(image);texture.needsUpdate=!0,texture.flipY=!1,textureDef.name&&(texture.name=textureDef.name);let sampler=(parser.json.samplers||{})[textureDef.sampler]||{};return texture.magFilter=WEBGL_FILTERS[sampler.magFilter]||THREE.LinearFilter,texture.minFilter=WEBGL_FILTERS[sampler.minFilter]||THREE.LinearMipmapLinearFilter,texture.wrapS=WEBGL_WRAPPINGS[sampler.wrapS]||THREE.RepeatWrapping,texture.wrapT=WEBGL_WRAPPINGS[sampler.wrapT]||THREE.RepeatWrapping,texture.onUpdate=function(){image.close()},texture})}},EXTENSION_NAME$2=`CESIUM_RTC`,CESIUM_RTC=class extends BaseExtension{emitResult(result,parser){if(parser.json.extensions[EXTENSION_NAME$2]&&parser.json.extensions[EXTENSION_NAME$2].center){let center=parser.json.extensions[EXTENSION_NAME$2].center;result.CESIUM_RTC={center:new THREE.Vector3().fromArray(center)}}}},EXTENSION_NAME$1=`REALSEE_materials_lightmap`,REALSEE_materials_lightmap=class extends BaseExtension{extendMaterial(material,primitiveDef,parser){var _a;let pending=[];if(parser.json.materials&&primitiveDef.material!==void 0){let extension=(_a=parser.json.materials[primitiveDef.material].extensions)==null?void 0:_a[EXTENSION_NAME$1];extension&&(extension.lightMapTexture!==void 0&&pending.push(parser.createMaterialTexture(extension.lightMapTexture).then(texture=>{material.lightMap=texture})),extension.lightMapIntensity!==void 0&&(material.lightMapIntensity=extension.lightMapIntensity))}return Promise.all(pending).then(()=>{})}},EXTENSION_NAME=`KHR_gaussian_splatting`,EXTENSIONS={KHR_binary_glTF,KHR_draco_mesh_compression,KHR_texture_basisu,KHR_texture_transform,KHR_mesh_quantization,KHR_materials_unlit,KHR_node_visibility,KHR_animation_pointer,KHR_materials_clearcoat,KHR_materials_sheen,KHR_materials_transmission,KHR_materials_emissive_strength,EXT_meshopt_compression,EXT_texture_webp,CESIUM_RTC,REALSEE_materials_lightmap,KHR_gaussian_splatting:class extends BaseExtension{loadMeshPrimitive(meshDef,primitiveDef,parser){var _a;let extension=(_a=primitiveDef.extensions)==null?void 0:_a[EXTENSION_NAME];return extension?this.loadGaussianSplating(extension,parser):null}loadGaussianSplating(gaussianSplatingExtension,parser){return __awaiter(this,void 0,void 0,function*(){if(`extensions`in gaussianSplatingExtension&&gaussianSplatingExtension.extensions.KHR_gaussian_splatting_compression_spz_2){let ext=parser.extensions.KHR_gaussian_splatting_compression_spz_2;if(ext)return ext.load(gaussianSplatingExtension.extensions.KHR_gaussian_splatting_compression_spz_2,parser)}if(`compression`in gaussianSplatingExtension&&gaussianSplatingExtension.compression.extension===`KHR_gaussian_splatting_compression_spz`){let ext=parser.extensions.KHR_gaussian_splatting_compression_spz;if(ext)return ext.load({bufferView:gaussianSplatingExtension.bufferView},parser)}return Promise.resolve(new THREE.Points)})}},KHR_gaussian_splatting_compression_spz:class extends BaseExtension{load(gaussianSplattingExtension,parser){return __awaiter(this,void 0,void 0,function*(){let{bufferView}=gaussianSplattingExtension;return parser.loadBufferView(bufferView).then(buffer=>this.loadSpz(new Uint8Array(buffer)))})}loadSpz(buffer){return __awaiter(this,void 0,void 0,function*(){return Promise.resolve().then(()=>import(`./spz.mjs`)).then(({parseSpz})=>parseSpz(buffer)).then(pbmGSObject=>(pbmGSObject.applyMatrix4(ROTATE_X_MATRIX_INVERSE),pbmGSObject.updateMatrix(),pbmGSObject.updateMatrixWorld(!0),pbmGSObject.transformChanged=!0,pbmGSObject))})}},KHR_gaussian_splatting_compression_spz_2:class extends BaseExtension{constructor(){super()}load(gaussianSplattingExtension,parser){return __awaiter(this,void 0,void 0,function*(){let{bufferView}=gaussianSplattingExtension;return parser.loadBufferView(bufferView).then(buffer=>this.loadSpz(new Uint8Array(buffer)))})}loadSpz(buffer){return __awaiter(this,void 0,void 0,function*(){return Promise.resolve().then(()=>import(`./spz.mjs`)).then(({parseSpz})=>parseSpz(buffer)).then(pbmGSObject=>(pbmGSObject.applyMatrix4(ROTATE_X_MATRIX_INVERSE),pbmGSObject.updateMatrix(),pbmGSObject.updateMatrixWorld(!0),pbmGSObject.transformChanged=!0,pbmGSObject))})}}};function parseGltf(data,options){var _a,_b,_c;let extensions={},binaryExtension,content;if(typeof data==`string`)content=data;else if(EXTENSIONS.KHR_binary_glTF.getMagic(data)===EXTENSIONS.KHR_binary_glTF.HEADER_MAGIC){binaryExtension=new EXTENSIONS.KHR_binary_glTF;try{binaryExtension.loadGlbBinary(data)}catch(error){return Promise.reject(error)}extensions.KHR_binary_glTF=binaryExtension,content=binaryExtension.content}else content=decodeText(new Uint8Array(data));let json=JSON.parse(content);if(options.jsonModify&&(json=options.jsonModify(json)),json.asset===void 0||Number(json.asset.version[0])<2)return Promise.reject(Error(`glTF: Unsupported asset. glTF versions >=2.0 are supported.`));if(json.extensionsUsed){let extensionsRequired=json.extensionsRequired||[];for(let i=0;i<json.extensionsUsed.length;i++){let extensionName=json.extensionsUsed[i];extensions[extensionName]||(EXTENSIONS[extensionName]?extensions[extensionName]=new EXTENSIONS[extensionName]:extensionsRequired.indexOf(extensionName)>=0&&console.warn(`glTF: Unknown extension "`+extensionName+`".`))}}return new Parser(json,extensions,{copyUV2:(_a=options.copyUV2)==null?!1:_a,resourcePath:(_b=options.resourcePath)==null?``:_b,search:(_c=options.search)==null?``:_c,fetcher:options.fetcher}).parse().then(result=>(binaryExtension&&binaryExtension.clear(),result))}export{WorkerPool as a,decodeText as i,ktx2 as n,draco as r,parseGltf as t};
|