@realsee/five-webgpu 1.0.0-alpha.13 → 1.0.0-alpha.15
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 +65 -64
- package/docs/classes/index.FivePass.html +1 -1
- package/docs/classes/index.FiveRenderer.html +4 -4
- 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 -4
- 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 +1 -1
- package/docs/classes/index.PBMGaussianSplattingObject.html +1 -1
- package/docs/classes/index.PBMGaussianSplattingRenderMesh.html +1 -1
- 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 +9 -5
- package/docs/classes/index.PanoCircleMeshCustom.html +9 -5
- package/docs/classes/index.PanoCircleMeshSolid.html +9 -5
- package/docs/classes/index.Parameter.html +1 -1
- package/docs/classes/index.Scene.html +1 -1
- package/docs/classes/index.Subscribe.html +1 -1
- package/docs/classes/index.Tile3D.html +1 -1
- package/docs/classes/index.TileNode.html +1 -1
- 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.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.LooseWorkObserver.html +2 -2
- package/docs/interfaces/index.LooseWorkPanorama.html +2 -2
- 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.PanoCircleMeshInterface.html +8 -4
- package/docs/interfaces/index.PanoCircleMeshOptions.html +2 -2
- package/docs/interfaces/index.PanoCircleMeshSolidOptions.html +2 -2
- 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 +1 -1
- package/docs/interfaces/index.ParameterTilesetValue.html +1 -1
- package/docs/interfaces/index.ParameterValue.html +1 -1
- package/docs/interfaces/index.Pose.html +1 -1
- package/docs/interfaces/index.RenderEvent.html +1 -1
- package/docs/interfaces/index.ResolvedParameterValue.html +1 -1
- 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.TopviewControllerCustomInitArgs.html +1 -1
- package/docs/interfaces/index.VRPanoramaControllerCustomInitArgs.html +1 -1
- package/docs/interfaces/index.ViewLayer.html +1 -1
- 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 +3 -2
- 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/panorama.d.ts +6 -0
- package/five/core/webglBlendEquationFix.d.ts +41 -0
- package/five/index.d.ts +0 -1
- package/five/index.js +49 -626
- package/five/index.mjs +229 -32052
- package/five/meshes/panoCircleMesh.d.ts +1 -0
- package/five/meshes/panoCircleMeshCustom.d.ts +1 -0
- package/five/meshes/panoCircleMeshSolid.d.ts +1 -0
- package/five/meshes/panoSphereMesh.d.ts +1 -0
- 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/spz.d.ts +1 -2
- package/five/model/loaders/spz.worker.d.ts +37 -0
- package/five/renderer/five-renderer.d.ts +1 -1
- 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/initTexture.d.ts +8 -0
- package/five/texture/videoTextureBridge.d.ts +124 -15
- package/five/thirdparty/sha256.d.ts +149 -0
- package/five/types/panoCircleMeshInterface.d.ts +6 -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/looseWorkType.d.ts +2 -2
- package/five/work/work.d.ts +1 -8
- package/five/work/workJsonType.d.ts +2 -4
- 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.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.js +13 -4
- package/sticker/index.mjs +43 -260
- package/umd/five-gltf-loader.js +3 -3
- package/umd/five-line.js +3 -3
- package/umd/five-plugins.js +4 -4
- package/umd/five-react.js +2 -2
- package/umd/five-sticker.js +13 -4
- package/umd/five-vfx.js +2 -2
- package/umd/five.js +152 -190
- 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 -10
- package/five/certificates/hardware.d.ts +0 -1
- package/five/thirdparty/jsrsasign.d.ts +0 -753
- package/five/work/_ALLOW_HOST.d.ts +0 -2
- package/five/work/keychain.d.ts +0 -5
- package/five/work/verify.d.ts +0 -7
- package/five/work/workVerify.d.ts +0 -2
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @license
|
|
3
3
|
* @realsee/five-webgpu
|
|
4
|
-
* Generated: 2026/
|
|
5
|
-
* Version: 1.0.0-alpha.
|
|
4
|
+
* Generated: 2026/11/4
|
|
5
|
+
* Version: 1.0.0-alpha.15
|
|
6
6
|
* License:
|
|
7
7
|
* Realsee SDK License Agreement
|
|
8
8
|
|
|
@@ -335,4 +335,4 @@
|
|
|
335
335
|
* writing and signed by Realsee. You and Realsee hereto confirm that this
|
|
336
336
|
* Agreement and all related documents shall be drafted in English.
|
|
337
337
|
|
|
338
|
-
*/const
|
|
338
|
+
*/const require_runtime=require("../../_virtual/_rolldown/runtime.js"),require_index=require("../BasePlugin/index.js"),require_CSS2DRenderer=require("../thirdParty/CSS2DRenderer.js"),require_style=require("./style.css_raw.js"),require_uuid=require("../utils/uuid.js");let tslib=require("tslib"),three_webgpu=require("three/webgpu");three_webgpu=require_runtime.__toESM(three_webgpu,1);var Controller=class extends require_index.BasePlugin.Controller{updateState(state,userAction){let prevState=this.state;this.state=Object.assign(Object.assign({},this.state),state),this.hooks.emit(`stateChange`,{state:this.state,prevState,userAction})}constructor(five,params){super(five),this.scene=new three_webgpu.Scene,this.styleSheet=new CSSStyleSheet,this.camera=new three_webgpu.PerspectiveCamera,this.createCSS2DObject=({id=require_uuid.createUuid(),name,innerHTML,center,position,visible=!0,timeout})=>{let dom=document.createElement(`div`);dom.className=`five-CSS2DPlugin-X`,visible||dom.classList.add(`five-CSS2DPlugin-hidden`),timeout&&dom.style.setProperty(`--timeout`,timeout+`ms`),dom.innerHTML=innerHTML;let object=new require_CSS2DRenderer.CSS2DObject(dom);return object.userData={id,_visible:visible,_timeout:timeout,get visible(){return this._visible},set visible(value){value?dom.classList.remove(`five-CSS2DPlugin-hidden`):dom.classList.add(`five-CSS2DPlugin-hidden`),this._visible=value},get timeout(){return this._timeout},set timeout(value){dom.style.setProperty(`--timeout`,value+`ms`),this._timeout=value}},center&&object.center.copy(center),position&&object.position.copy(position),name&&(object.name=name),object},this.render=()=>{this.camera.fov=this.five.camera.fov,this.camera.aspect=this.five.camera.aspect,this.camera.position.copy(this.five.camera.position),this.camera.rotation.copy(this.five.camera.rotation),this.camera.updateProjectionMatrix(),this.renderer.render(this.scene,this.camera)},this._addEventListener=()=>{this.five.on(`render.prepare`,this.render),this.appendToFiveContainer()},this._removeEventListener=()=>{var _a;this.five.off(`render.prepare`,this.render),(_a=this.resizeObserver)==null||_a.disconnect(),this.resizeObserver=void 0},this.dispose=()=>{this.removeAll(),this._disable({userAction:!1})},this.five=five,this.renderer=new require_CSS2DRenderer.CSS2DRenderer,this.renderer.domElement.id=`five-CSS2DPlugin`,this.styleSheet.replaceSync(require_style.default),document&&document.adoptedStyleSheets.push(this.styleSheet);let defaultState={enabled:!0,visible:!0};this.state=Object.assign(defaultState,params==null?void 0:params.initialState),this.state.enabled?this._enable({userAction:!1}):this.styleSheet.disabled=!0}load(data){return(0,tslib.__awaiter)(this,void 0,void 0,function*(){})}appendToFiveContainer(){var _a;if(!this.five.renderer)return;let element=this.five.getElement();if(!(element!=null&&element.parentElement))return;let{x:width,y:height}=this.five.renderer.getSize(new three_webgpu.Vector2);element.parentElement.appendChild(this.renderer.domElement),this.renderer.setSize(width,height),(_a=this.resizeObserver)==null||_a.disconnect(),this.resizeObserver=new ResizeObserver(()=>{var _a;if(!this.five.renderer)return;let bounding=(_a=this.five.getElement())==null?void 0:_a.getBoundingClientRect();if(!bounding)return;let{x,y,width,height}=bounding;this.renderer.setSize(width,height),this.renderer.domElement.style.left=x+`px`,this.renderer.domElement.style.top=y+`px`,this.render()}),this.resizeObserver.observe(element)}add(...object){this.scene.add(...object),this.render()}remove(object){this.scene.remove(object),object.traverse(object=>{object instanceof require_CSS2DRenderer.CSS2DObject&&object.element.remove()}),this.render()}removeAll(){this.scene.remove(...this.scene.children),this.render()}fadeInObjects(...objects){for(let object of objects)object.userData.visible=!0;this.render()}fadeOutObjects(...objects){for(let object of objects)object.userData.visible=!1;this.render()}_enable(options){this.styleSheet.disabled=!1,this.updateState({enabled:!0},options.userAction),this._addEventListener(),this.render()}_disable(options){this.styleSheet.disabled=!0,this.updateState({enabled:!1},options.userAction),this._removeEventListener()}enable(options){var _a;if(this.state.enabled)return;let userAction=(_a=options==null?void 0:options.userAction)==null?!0:_a;this._enable({userAction})}disable(options){var _a;if(this.state.enabled===!1)return;let userAction=(_a=options==null?void 0:options.userAction)==null?!0:_a;this._disable({userAction})}show(options){this.renderer.domElement.style.display=`block`,this.updateState({visible:!0},!0),this.render()}hide(options){this.renderer.domElement.style.display=`none`,this.updateState({visible:!1},!0)}};exports.Controller=Controller;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @license
|
|
3
3
|
* @realsee/five-webgpu
|
|
4
|
-
* Generated: 2026/
|
|
5
|
-
* Version: 1.0.0-alpha.
|
|
4
|
+
* Generated: 2026/11/4
|
|
5
|
+
* Version: 1.0.0-alpha.15
|
|
6
6
|
* License:
|
|
7
7
|
* Realsee SDK License Agreement
|
|
8
8
|
|
|
@@ -335,4 +335,4 @@
|
|
|
335
335
|
* writing and signed by Realsee. You and Realsee hereto confirm that this
|
|
336
336
|
* Agreement and all related documents shall be drafted in English.
|
|
337
337
|
|
|
338
|
-
*/import{BasePlugin
|
|
338
|
+
*/import{BasePlugin}from"../BasePlugin/index.mjs";import{CSS2DObject,CSS2DRenderer}from"../thirdParty/CSS2DRenderer.mjs";import style_default from"./style.css_raw.mjs";import{createUuid}from"../utils/uuid.mjs";import{__awaiter}from"tslib";import*as THREE from"three/webgpu";var Controller=class extends BasePlugin.Controller{updateState(state,userAction){let prevState=this.state;this.state=Object.assign(Object.assign({},this.state),state),this.hooks.emit(`stateChange`,{state:this.state,prevState,userAction})}constructor(five,params){super(five),this.scene=new THREE.Scene,this.styleSheet=new CSSStyleSheet,this.camera=new THREE.PerspectiveCamera,this.createCSS2DObject=({id=createUuid(),name,innerHTML,center,position,visible=!0,timeout})=>{let dom=document.createElement(`div`);dom.className=`five-CSS2DPlugin-X`,visible||dom.classList.add(`five-CSS2DPlugin-hidden`),timeout&&dom.style.setProperty(`--timeout`,timeout+`ms`),dom.innerHTML=innerHTML;let object=new CSS2DObject(dom);return object.userData={id,_visible:visible,_timeout:timeout,get visible(){return this._visible},set visible(value){value?dom.classList.remove(`five-CSS2DPlugin-hidden`):dom.classList.add(`five-CSS2DPlugin-hidden`),this._visible=value},get timeout(){return this._timeout},set timeout(value){dom.style.setProperty(`--timeout`,value+`ms`),this._timeout=value}},center&&object.center.copy(center),position&&object.position.copy(position),name&&(object.name=name),object},this.render=()=>{this.camera.fov=this.five.camera.fov,this.camera.aspect=this.five.camera.aspect,this.camera.position.copy(this.five.camera.position),this.camera.rotation.copy(this.five.camera.rotation),this.camera.updateProjectionMatrix(),this.renderer.render(this.scene,this.camera)},this._addEventListener=()=>{this.five.on(`render.prepare`,this.render),this.appendToFiveContainer()},this._removeEventListener=()=>{var _a;this.five.off(`render.prepare`,this.render),(_a=this.resizeObserver)==null||_a.disconnect(),this.resizeObserver=void 0},this.dispose=()=>{this.removeAll(),this._disable({userAction:!1})},this.five=five,this.renderer=new CSS2DRenderer,this.renderer.domElement.id=`five-CSS2DPlugin`,this.styleSheet.replaceSync(style_default),document&&document.adoptedStyleSheets.push(this.styleSheet);let defaultState={enabled:!0,visible:!0};this.state=Object.assign(defaultState,params==null?void 0:params.initialState),this.state.enabled?this._enable({userAction:!1}):this.styleSheet.disabled=!0}load(data){return __awaiter(this,void 0,void 0,function*(){})}appendToFiveContainer(){var _a;if(!this.five.renderer)return;let element=this.five.getElement();if(!(element!=null&&element.parentElement))return;let{x:width,y:height}=this.five.renderer.getSize(new THREE.Vector2);element.parentElement.appendChild(this.renderer.domElement),this.renderer.setSize(width,height),(_a=this.resizeObserver)==null||_a.disconnect(),this.resizeObserver=new ResizeObserver(()=>{var _a;if(!this.five.renderer)return;let bounding=(_a=this.five.getElement())==null?void 0:_a.getBoundingClientRect();if(!bounding)return;let{x,y,width,height}=bounding;this.renderer.setSize(width,height),this.renderer.domElement.style.left=x+`px`,this.renderer.domElement.style.top=y+`px`,this.render()}),this.resizeObserver.observe(element)}add(...object){this.scene.add(...object),this.render()}remove(object){this.scene.remove(object),object.traverse(object=>{object instanceof CSS2DObject&&object.element.remove()}),this.render()}removeAll(){this.scene.remove(...this.scene.children),this.render()}fadeInObjects(...objects){for(let object of objects)object.userData.visible=!0;this.render()}fadeOutObjects(...objects){for(let object of objects)object.userData.visible=!1;this.render()}_enable(options){this.styleSheet.disabled=!1,this.updateState({enabled:!0},options.userAction),this._addEventListener(),this.render()}_disable(options){this.styleSheet.disabled=!0,this.updateState({enabled:!1},options.userAction),this._removeEventListener()}enable(options){var _a;if(this.state.enabled)return;let userAction=(_a=options==null?void 0:options.userAction)==null?!0:_a;this._enable({userAction})}disable(options){var _a;if(this.state.enabled===!1)return;let userAction=(_a=options==null?void 0:options.userAction)==null?!0:_a;this._disable({userAction})}show(options){this.renderer.domElement.style.display=`block`,this.updateState({visible:!0},!0),this.render()}hide(options){this.renderer.domElement.style.display=`none`,this.updateState({visible:!1},!0)}};export{Controller};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @license
|
|
3
3
|
* @realsee/five-webgpu
|
|
4
|
-
* Generated: 2026/
|
|
5
|
-
* Version: 1.0.0-alpha.
|
|
4
|
+
* Generated: 2026/11/4
|
|
5
|
+
* Version: 1.0.0-alpha.15
|
|
6
6
|
* License:
|
|
7
7
|
* Realsee SDK License Agreement
|
|
8
8
|
|
|
@@ -335,4 +335,4 @@
|
|
|
335
335
|
* writing and signed by Realsee. You and Realsee hereto confirm that this
|
|
336
336
|
* Agreement and all related documents shall be drafted in English.
|
|
337
337
|
|
|
338
|
-
*/const
|
|
338
|
+
*/const require_Controller=require("./Controller.js");var CSS2DPlugin=(five,params)=>new require_Controller.Controller(five,params);exports.CSS2DPlugin=CSS2DPlugin;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @license
|
|
3
3
|
* @realsee/five-webgpu
|
|
4
|
-
* Generated: 2026/
|
|
5
|
-
* Version: 1.0.0-alpha.
|
|
4
|
+
* Generated: 2026/11/4
|
|
5
|
+
* Version: 1.0.0-alpha.15
|
|
6
6
|
* License:
|
|
7
7
|
* Realsee SDK License Agreement
|
|
8
8
|
|
|
@@ -335,4 +335,4 @@
|
|
|
335
335
|
* writing and signed by Realsee. You and Realsee hereto confirm that this
|
|
336
336
|
* Agreement and all related documents shall be drafted in English.
|
|
337
337
|
|
|
338
|
-
*/import{Controller
|
|
338
|
+
*/import{Controller}from"./Controller.mjs";var CSS2DPlugin=(five,params)=>new Controller(five,params);export{CSS2DPlugin};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @license
|
|
3
3
|
* @realsee/five-webgpu
|
|
4
|
-
* Generated: 2026/
|
|
5
|
-
* Version: 1.0.0-alpha.
|
|
4
|
+
* Generated: 2026/11/4
|
|
5
|
+
* Version: 1.0.0-alpha.15
|
|
6
6
|
* License:
|
|
7
7
|
* Realsee SDK License Agreement
|
|
8
8
|
|
|
@@ -335,7 +335,7 @@
|
|
|
335
335
|
* writing and signed by Realsee. You and Realsee hereto confirm that this
|
|
336
336
|
* Agreement and all related documents shall be drafted in English.
|
|
337
337
|
|
|
338
|
-
*/var
|
|
338
|
+
*/var style_default=`#five-CSS2DPlugin {
|
|
339
339
|
position: absolute;
|
|
340
340
|
pointer-events: none;
|
|
341
341
|
user-select: none;
|
|
@@ -355,4 +355,4 @@
|
|
|
355
355
|
#five-CSS2DPlugin .five-CSS2DPlugin-hidden * {
|
|
356
356
|
pointer-events: none;
|
|
357
357
|
}
|
|
358
|
-
`;exports.default=
|
|
358
|
+
`;exports.default=style_default;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @license
|
|
3
3
|
* @realsee/five-webgpu
|
|
4
|
-
* Generated: 2026/
|
|
5
|
-
* Version: 1.0.0-alpha.
|
|
4
|
+
* Generated: 2026/11/4
|
|
5
|
+
* Version: 1.0.0-alpha.15
|
|
6
6
|
* License:
|
|
7
7
|
* Realsee SDK License Agreement
|
|
8
8
|
|
|
@@ -335,7 +335,7 @@
|
|
|
335
335
|
* writing and signed by Realsee. You and Realsee hereto confirm that this
|
|
336
336
|
* Agreement and all related documents shall be drafted in English.
|
|
337
337
|
|
|
338
|
-
*/var
|
|
338
|
+
*/var style_default=`#five-CSS2DPlugin {
|
|
339
339
|
position: absolute;
|
|
340
340
|
pointer-events: none;
|
|
341
341
|
user-select: none;
|
|
@@ -355,4 +355,4 @@
|
|
|
355
355
|
#five-CSS2DPlugin .five-CSS2DPlugin-hidden * {
|
|
356
356
|
pointer-events: none;
|
|
357
357
|
}
|
|
358
|
-
`;export{
|
|
358
|
+
`;export{style_default as default};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @license
|
|
3
3
|
* @realsee/five-webgpu
|
|
4
|
-
* Generated: 2026/
|
|
5
|
-
* Version: 1.0.0-alpha.
|
|
4
|
+
* Generated: 2026/11/4
|
|
5
|
+
* Version: 1.0.0-alpha.15
|
|
6
6
|
* License:
|
|
7
7
|
* Realsee SDK License Agreement
|
|
8
8
|
|
|
@@ -335,4 +335,4 @@
|
|
|
335
335
|
* writing and signed by Realsee. You and Realsee hereto confirm that this
|
|
336
336
|
* Agreement and all related documents shall be drafted in English.
|
|
337
337
|
|
|
338
|
-
*/const
|
|
338
|
+
*/const require_runtime=require("../../_virtual/_rolldown/runtime.js"),require_index=require("../BasePlugin/index.js"),require_uuid=require("../utils/uuid.js"),require_CSS3DRenderer=require("../thirdParty/CSS3DRenderer.js"),require_style=require("./style.css_raw.js");let tslib=require("tslib"),three_webgpu=require("three/webgpu");three_webgpu=require_runtime.__toESM(three_webgpu,1);var Controller=class extends require_index.BasePlugin.Controller{updateState(state,userAction){let prevState=this.state;this.state=Object.assign(Object.assign({},this.state),state),this.hooks.emit(`stateChange`,{state:this.state,prevState,userAction})}constructor(five,params){super(five),this.scene=new three_webgpu.Scene,this.styleSheet=new CSSStyleSheet,this.camera=new three_webgpu.PerspectiveCamera,this.cacheMap=new WeakMap,this.createCSS3DObject=({id=require_uuid.createUuid(),name,innerHTML,sprite,normal,position,scalar=.00216,visible=!0,timeout})=>{let dom=document.createElement(`div`);dom.className=`five-CSS3DPlugin-X`,visible||dom.classList.add(`five-CSS3DPlugin-hidden`),timeout&&dom.style.setProperty(`--timeout`,timeout+`ms`),dom.innerHTML=innerHTML;let object=sprite?new require_CSS3DRenderer.CSS3DSprite(dom):new require_CSS3DRenderer.CSS3DObject(dom);if(object.userData={id,_visible:visible,_timeout:timeout,get visible(){return this._visible},set visible(value){value?dom.classList.remove(`five-CSS3DPlugin-hidden`):dom.classList.add(`five-CSS3DPlugin-hidden`),this._visible=value},get timeout(){return this._timeout},set timeout(value){dom.style.setProperty(`--timeout`,value+`ms`),this._timeout=value}},normal){let defaultNormal=new three_webgpu.Vector3(0,0,1),quaternion=new three_webgpu.Quaternion().setFromUnitVectors(defaultNormal,normal.clone().normalize());object.quaternion.copy(quaternion)}return position&&object.position.copy(position),scalar&&object.scale.setScalar(scalar),name&&(object.name=name),object},this.render=()=>{this.camera.fov=this.five.camera.fov,this.camera.aspect=this.five.camera.aspect,this.camera.position.copy(this.five.camera.position),this.camera.rotation.copy(this.five.camera.rotation),this.camera.updateProjectionMatrix(),this.renderer.render(this.scene,this.camera)},this.forceRender=()=>{this.renderer.markDirty(),this.render()},this._addEventListener=()=>{this.five.on(`render.prepare`,this.render),this.appendToFiveContainer()},this._removeEventListener=()=>{var _a;this.five.off(`render.prepare`,this.render),(_a=this.resizeObserver)==null||_a.disconnect(),this.resizeObserver=void 0},this.dispose=()=>{this.removeAll(),this._disable({userAction:!1})},this.five=five,this.renderer=new require_CSS3DRenderer.CSS3DRenderer,this.renderer.domElement.id=`five-CSS3DPlugin`,this.styleSheet.replaceSync(require_style.default),/Chrome/.test(navigator.userAgent)&&!/Edge|Edg|OPR/.test(navigator.userAgent)&&this.styleSheet.insertRule(`#five-CSS3DPlugin * { transform-style: preserve-3d; }`),document&&document.adoptedStyleSheets.push(this.styleSheet);let defaultState={enabled:!0,visible:!0};this.state=Object.assign(defaultState,params==null?void 0:params.initialState),this.state.enabled?this._enable({userAction:!1}):this.styleSheet.disabled=!0}load(data){return(0,tslib.__awaiter)(this,void 0,void 0,function*(){})}appendToFiveContainer(){var _a;if(!this.five.renderer)return;let element=this.five.getElement();if(!(element!=null&&element.parentElement))return;let{x:width,y:height}=this.five.renderer.getSize(new three_webgpu.Vector2);element.parentElement.appendChild(this.renderer.domElement),this.renderer.setSize(width*2,height*2),this.renderer.domElement.style.width=width*2+`px`,this.renderer.domElement.style.height=height*2+`px`,this.renderer.domElement.style.transform=`scale(0.5)`,(_a=this.resizeObserver)==null||_a.disconnect(),this.resizeObserver=new ResizeObserver(()=>{var _a;if(!this.five.renderer)return;let bounding=(_a=this.five.getElement())==null?void 0:_a.getBoundingClientRect();if(!bounding)return;let{x,y,width,height}=bounding;this.renderer.setSize(width*2,height*2),this.renderer.domElement.style.left=x+`px`,this.renderer.domElement.style.top=y+`px`,this.renderer.domElement.style.width=width*2+`px`,this.renderer.domElement.style.height=height*2+`px`,this.render()}),this.resizeObserver.observe(element)}add(...object){this.scene.add(...object),this.renderer.updateSpriteSet(this.scene),this.forceRender()}remove(object){this.scene.remove(object),object.traverse(object=>{object instanceof require_CSS3DRenderer.CSS3DObject&&object.element.remove()}),this.renderer.updateSpriteSet(this.scene),this.forceRender()}removeAll(){this.scene.remove(...this.scene.children),this.renderer.updateSpriteSet(this.scene),this.forceRender()}fadeInObjects(...objects){for(let object of objects)object.userData.visible=!0;this.render()}fadeOutObjects(...objects){for(let object of objects)object.userData.visible=!1;this.render()}_enable(options){this.styleSheet.disabled=!1,this.updateState({enabled:!0},options.userAction),this._addEventListener(),this.render()}_disable(options){this.styleSheet.disabled=!0,this.updateState({enabled:!1},options.userAction),this._removeEventListener()}enable(options){var _a;if(this.state.enabled)return;let userAction=(_a=options==null?void 0:options.userAction)==null?!0:_a;this._enable({userAction})}disable(options){var _a;if(this.state.enabled===!1)return;let userAction=(_a=options==null?void 0:options.userAction)==null?!0:_a;this._disable({userAction})}show(options){this.renderer.domElement.style.display=`block`,this.updateState({visible:!0},!0),this.forceRender()}hide(options){this.renderer.domElement.style.display=`none`,this.updateState({visible:!1},!0)}};exports.Controller=Controller;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @license
|
|
3
3
|
* @realsee/five-webgpu
|
|
4
|
-
* Generated: 2026/
|
|
5
|
-
* Version: 1.0.0-alpha.
|
|
4
|
+
* Generated: 2026/11/4
|
|
5
|
+
* Version: 1.0.0-alpha.15
|
|
6
6
|
* License:
|
|
7
7
|
* Realsee SDK License Agreement
|
|
8
8
|
|
|
@@ -335,4 +335,4 @@
|
|
|
335
335
|
* writing and signed by Realsee. You and Realsee hereto confirm that this
|
|
336
336
|
* Agreement and all related documents shall be drafted in English.
|
|
337
337
|
|
|
338
|
-
*/import{BasePlugin
|
|
338
|
+
*/import{BasePlugin}from"../BasePlugin/index.mjs";import{createUuid}from"../utils/uuid.mjs";import{CSS3DObject,CSS3DRenderer,CSS3DSprite}from"../thirdParty/CSS3DRenderer.mjs";import style_default from"./style.css_raw.mjs";import{__awaiter}from"tslib";import*as THREE from"three/webgpu";var Controller=class extends BasePlugin.Controller{updateState(state,userAction){let prevState=this.state;this.state=Object.assign(Object.assign({},this.state),state),this.hooks.emit(`stateChange`,{state:this.state,prevState,userAction})}constructor(five,params){super(five),this.scene=new THREE.Scene,this.styleSheet=new CSSStyleSheet,this.camera=new THREE.PerspectiveCamera,this.cacheMap=new WeakMap,this.createCSS3DObject=({id=createUuid(),name,innerHTML,sprite,normal,position,scalar=.00216,visible=!0,timeout})=>{let dom=document.createElement(`div`);dom.className=`five-CSS3DPlugin-X`,visible||dom.classList.add(`five-CSS3DPlugin-hidden`),timeout&&dom.style.setProperty(`--timeout`,timeout+`ms`),dom.innerHTML=innerHTML;let object=sprite?new CSS3DSprite(dom):new CSS3DObject(dom);if(object.userData={id,_visible:visible,_timeout:timeout,get visible(){return this._visible},set visible(value){value?dom.classList.remove(`five-CSS3DPlugin-hidden`):dom.classList.add(`five-CSS3DPlugin-hidden`),this._visible=value},get timeout(){return this._timeout},set timeout(value){dom.style.setProperty(`--timeout`,value+`ms`),this._timeout=value}},normal){let defaultNormal=new THREE.Vector3(0,0,1),quaternion=new THREE.Quaternion().setFromUnitVectors(defaultNormal,normal.clone().normalize());object.quaternion.copy(quaternion)}return position&&object.position.copy(position),scalar&&object.scale.setScalar(scalar),name&&(object.name=name),object},this.render=()=>{this.camera.fov=this.five.camera.fov,this.camera.aspect=this.five.camera.aspect,this.camera.position.copy(this.five.camera.position),this.camera.rotation.copy(this.five.camera.rotation),this.camera.updateProjectionMatrix(),this.renderer.render(this.scene,this.camera)},this.forceRender=()=>{this.renderer.markDirty(),this.render()},this._addEventListener=()=>{this.five.on(`render.prepare`,this.render),this.appendToFiveContainer()},this._removeEventListener=()=>{var _a;this.five.off(`render.prepare`,this.render),(_a=this.resizeObserver)==null||_a.disconnect(),this.resizeObserver=void 0},this.dispose=()=>{this.removeAll(),this._disable({userAction:!1})},this.five=five,this.renderer=new CSS3DRenderer,this.renderer.domElement.id=`five-CSS3DPlugin`,this.styleSheet.replaceSync(style_default),/Chrome/.test(navigator.userAgent)&&!/Edge|Edg|OPR/.test(navigator.userAgent)&&this.styleSheet.insertRule(`#five-CSS3DPlugin * { transform-style: preserve-3d; }`),document&&document.adoptedStyleSheets.push(this.styleSheet);let defaultState={enabled:!0,visible:!0};this.state=Object.assign(defaultState,params==null?void 0:params.initialState),this.state.enabled?this._enable({userAction:!1}):this.styleSheet.disabled=!0}load(data){return __awaiter(this,void 0,void 0,function*(){})}appendToFiveContainer(){var _a;if(!this.five.renderer)return;let element=this.five.getElement();if(!(element!=null&&element.parentElement))return;let{x:width,y:height}=this.five.renderer.getSize(new THREE.Vector2);element.parentElement.appendChild(this.renderer.domElement),this.renderer.setSize(width*2,height*2),this.renderer.domElement.style.width=width*2+`px`,this.renderer.domElement.style.height=height*2+`px`,this.renderer.domElement.style.transform=`scale(0.5)`,(_a=this.resizeObserver)==null||_a.disconnect(),this.resizeObserver=new ResizeObserver(()=>{var _a;if(!this.five.renderer)return;let bounding=(_a=this.five.getElement())==null?void 0:_a.getBoundingClientRect();if(!bounding)return;let{x,y,width,height}=bounding;this.renderer.setSize(width*2,height*2),this.renderer.domElement.style.left=x+`px`,this.renderer.domElement.style.top=y+`px`,this.renderer.domElement.style.width=width*2+`px`,this.renderer.domElement.style.height=height*2+`px`,this.render()}),this.resizeObserver.observe(element)}add(...object){this.scene.add(...object),this.renderer.updateSpriteSet(this.scene),this.forceRender()}remove(object){this.scene.remove(object),object.traverse(object=>{object instanceof CSS3DObject&&object.element.remove()}),this.renderer.updateSpriteSet(this.scene),this.forceRender()}removeAll(){this.scene.remove(...this.scene.children),this.renderer.updateSpriteSet(this.scene),this.forceRender()}fadeInObjects(...objects){for(let object of objects)object.userData.visible=!0;this.render()}fadeOutObjects(...objects){for(let object of objects)object.userData.visible=!1;this.render()}_enable(options){this.styleSheet.disabled=!1,this.updateState({enabled:!0},options.userAction),this._addEventListener(),this.render()}_disable(options){this.styleSheet.disabled=!0,this.updateState({enabled:!1},options.userAction),this._removeEventListener()}enable(options){var _a;if(this.state.enabled)return;let userAction=(_a=options==null?void 0:options.userAction)==null?!0:_a;this._enable({userAction})}disable(options){var _a;if(this.state.enabled===!1)return;let userAction=(_a=options==null?void 0:options.userAction)==null?!0:_a;this._disable({userAction})}show(options){this.renderer.domElement.style.display=`block`,this.updateState({visible:!0},!0),this.forceRender()}hide(options){this.renderer.domElement.style.display=`none`,this.updateState({visible:!1},!0)}};export{Controller};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @license
|
|
3
3
|
* @realsee/five-webgpu
|
|
4
|
-
* Generated: 2026/
|
|
5
|
-
* Version: 1.0.0-alpha.
|
|
4
|
+
* Generated: 2026/11/4
|
|
5
|
+
* Version: 1.0.0-alpha.15
|
|
6
6
|
* License:
|
|
7
7
|
* Realsee SDK License Agreement
|
|
8
8
|
|
|
@@ -335,4 +335,4 @@
|
|
|
335
335
|
* writing and signed by Realsee. You and Realsee hereto confirm that this
|
|
336
336
|
* Agreement and all related documents shall be drafted in English.
|
|
337
337
|
|
|
338
|
-
*/const
|
|
338
|
+
*/const require_Controller=require("./Controller.js");var CSS3DPlugin=(five,params)=>new require_Controller.Controller(five,params);exports.CSS3DPlugin=CSS3DPlugin;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @license
|
|
3
3
|
* @realsee/five-webgpu
|
|
4
|
-
* Generated: 2026/
|
|
5
|
-
* Version: 1.0.0-alpha.
|
|
4
|
+
* Generated: 2026/11/4
|
|
5
|
+
* Version: 1.0.0-alpha.15
|
|
6
6
|
* License:
|
|
7
7
|
* Realsee SDK License Agreement
|
|
8
8
|
|
|
@@ -335,4 +335,4 @@
|
|
|
335
335
|
* writing and signed by Realsee. You and Realsee hereto confirm that this
|
|
336
336
|
* Agreement and all related documents shall be drafted in English.
|
|
337
337
|
|
|
338
|
-
*/import{Controller
|
|
338
|
+
*/import{Controller}from"./Controller.mjs";var CSS3DPlugin=(five,params)=>new Controller(five,params);export{CSS3DPlugin};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @license
|
|
3
3
|
* @realsee/five-webgpu
|
|
4
|
-
* Generated: 2026/
|
|
5
|
-
* Version: 1.0.0-alpha.
|
|
4
|
+
* Generated: 2026/11/4
|
|
5
|
+
* Version: 1.0.0-alpha.15
|
|
6
6
|
* License:
|
|
7
7
|
* Realsee SDK License Agreement
|
|
8
8
|
|
|
@@ -335,7 +335,7 @@
|
|
|
335
335
|
* writing and signed by Realsee. You and Realsee hereto confirm that this
|
|
336
336
|
* Agreement and all related documents shall be drafted in English.
|
|
337
337
|
|
|
338
|
-
*/var
|
|
338
|
+
*/var style_default=`#five-CSS3DPlugin {
|
|
339
339
|
position: absolute;
|
|
340
340
|
pointer-events: none;
|
|
341
341
|
user-select: none;
|
|
@@ -354,4 +354,4 @@
|
|
|
354
354
|
#five-CSS3DPlugin .five-CSS3DPlugin-hidden * {
|
|
355
355
|
pointer-events: none;
|
|
356
356
|
}
|
|
357
|
-
`;exports.default=
|
|
357
|
+
`;exports.default=style_default;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @license
|
|
3
3
|
* @realsee/five-webgpu
|
|
4
|
-
* Generated: 2026/
|
|
5
|
-
* Version: 1.0.0-alpha.
|
|
4
|
+
* Generated: 2026/11/4
|
|
5
|
+
* Version: 1.0.0-alpha.15
|
|
6
6
|
* License:
|
|
7
7
|
* Realsee SDK License Agreement
|
|
8
8
|
|
|
@@ -335,7 +335,7 @@
|
|
|
335
335
|
* writing and signed by Realsee. You and Realsee hereto confirm that this
|
|
336
336
|
* Agreement and all related documents shall be drafted in English.
|
|
337
337
|
|
|
338
|
-
*/var
|
|
338
|
+
*/var style_default=`#five-CSS3DPlugin {
|
|
339
339
|
position: absolute;
|
|
340
340
|
pointer-events: none;
|
|
341
341
|
user-select: none;
|
|
@@ -354,4 +354,4 @@
|
|
|
354
354
|
#five-CSS3DPlugin .five-CSS3DPlugin-hidden * {
|
|
355
355
|
pointer-events: none;
|
|
356
356
|
}
|
|
357
|
-
`;export{
|
|
357
|
+
`;export{style_default as default};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @license
|
|
3
3
|
* @realsee/five-webgpu
|
|
4
|
-
* Generated: 2026/
|
|
5
|
-
* Version: 1.0.0-alpha.
|
|
4
|
+
* Generated: 2026/11/4
|
|
5
|
+
* Version: 1.0.0-alpha.15
|
|
6
6
|
* License:
|
|
7
7
|
* Realsee SDK License Agreement
|
|
8
8
|
|
|
@@ -335,4 +335,4 @@
|
|
|
335
335
|
* writing and signed by Realsee. You and Realsee hereto confirm that this
|
|
336
336
|
* Agreement and all related documents shall be drafted in English.
|
|
337
337
|
|
|
338
|
-
*/const e=require("../../_virtual/_rolldown/runtime.js"),t=require("../BasePlugin/index.js"),n=require("./utils/formatData.js"),r=require("./utils/to.js"),i=require("./utils/filter.js"),a=require("./utils/correctFiveState.js"),o=require("./utils/changeModelCanvasOpacity.js"),s=require("./utils/getPxmm.js"),c=require("./utils/fiveModelLoad.js"),l=require("./utils/equal.js"),u=require("./render/index.js"),d=require("./render/style.css_raw.js");let f=require("tslib"),p=require("three/webgpu");p=e.__toESM(p,1);var m=500,h=.01;function g(e){let{latitude:t,longitude:n}=e,r=Math.abs(t-Math.PI/2)>5*Math.PI/180,i=n>Math.PI/180*5&&n<Math.PI/180*355;return r||i}function _(e){let{latitude:t,longitude:n}=e,r=Math.abs(t-Math.PI/2)<10*Math.PI/180,i=n<Math.PI/180*30||n>Math.PI/180*330;return r&&i}var v=class extends t.BasePlugin.Controller{constructor(e,t){var n,s,l;super(e),this.name=`FloorplanPlugin`,this.renderer=new u.FloorplanRenderer,this.styleSheet=new CSSStyleSheet,this.panoIndex=0,this.floorIndex=0,this.lastPanoramaLongitude=0,this.size={width:0,height:0},this.hasAddedEventListener=!1,this.isHiddenByHideFunc=!1,this.highlightData={},this.store={roomOnMouse:null},this.dispose=()=>{var e,t;this.removeEventListener(),(e=this.resizeObserver)==null||e.disconnect(),(t=this.removeExtraElement)==null||t.call(this),this.removeExtraElement=void 0,this.pendingCameraUpdateFrame!==void 0&&cancelAnimationFrame(this.pendingCameraUpdateFrame),this.pendingResizeFrame!==void 0&&cancelAnimationFrame(this.pendingResizeFrame),this.renderer.dispose(),this.wrapper=void 0,this.data=void 0,this.hooks.emit(`dispose`)},this.show=(...e)=>(0,f.__awaiter)(this,[...e],void 0,function*(e={}){var t;if(!this.state.enabled||!this.showPromise&&this.state.visible)return;let n=(t=e.userAction)==null?!0:t;return this.updateState({visible:!0},n),this._show(e)}),this.hide=(...e)=>(0,f.__awaiter)(this,[...e],void 0,function*(e={}){var t;this.state.enabled&&(this.isHiddenByHideFunc=!0,this.state.visible!==!1&&(this.updateState({visible:!1},(t=e.userAction)==null?!0:t),this._hide(e)))}),this.highlight=e=>{this.state.config.highlightEnable&&(this.highlightData=e,this.renderCurrent())},this.unhighlight=()=>{this.highlightData={},this.renderCurrent()},this.updateShowState=e=>{this.showState=Object.assign(Object.assign({},this.showState),e)},this.onRoomHover=e=>{this.store.roomOnMouse=e},this.handleClick=()=>{if(this.state.visible&&this.hooks.emit(`click`,this.store.roomOnMouse))return!1},this.onFiveModelLoaded=()=>{var e,t,n;this.state.enabled!==!1&&(this.floorIndex=(n=(t=(e=this.five.work)==null?void 0:e.observers[this.panoIndex])==null?void 0:t.floorIndex)==null?0:n,this.renderCurrent())},this.onFiveModeChange=e=>{e!==this.showState.mode&&(this.updateState({visible:!1},!1),this._hide({userAction:!1}))},this.onFiveInertiaPan=(e,t)=>{t&&(this.state.visible||this.state.config.autoShowEnable!==!1&&(this.isHiddenByHideFunc||this.five.currentMode===this.showState.mode&&_(this.getRelativePose(this.five.getCurrentState()))&&(this.updateState({visible:!0},!0),this._show({isAutoShow:!0}))))},this.onFivePanoArrived=e=>{var t,n;this.five.work&&(this.panoIndex=e,this.floorIndex=(n=(t=this.five.work.observers[e])==null?void 0:t.floorIndex)==null?this.floorIndex:n)},this.onFiveCameraUpdate=(e,t)=>{this.state.visible&&(this.showPromise||(this.scheduleCameraUpdate(),g(this.getRelativePose(this.five.getCurrentState()))&&(this.updateState({visible:!1},t),this._hide({userAction:t}))))},this.onFiveWantsPanGesture=(e,t)=>{if(this.five.currentMode===this.showState.mode&&this.state.config.autoShowEnable!==!1&&t&&this.state.visible)return this.five.updateCamera(i.omit(this.showState,[`mode`,`offset`]),0),!1},this.onFiveWantsTapGesture=()=>this.handleClick(),this.onFiveWantsChangeMode=(e,t)=>{t===`Panorama`&&e===this.showState.mode&&(this.lastPanoramaLongitude=this.five.getCurrentState().longitude)},this.onModelShownFloorChange=e=>{var t,n,r;if(this.floorIndex!==e){if(e===null){this.floorIndex=(r=(n=(t=this.five.work)==null?void 0:t.observers[this.panoIndex])==null?void 0:n.floorIndex)==null?this.floorIndex:r;return}this.floorIndex=e,this.updateSize(),this.renderCurrent()}},this._show=e=>(0,f.__awaiter)(this,void 0,void 0,function*(){var t;if(!this.state.enabled)return;if(!((t=this.five.model)!=null&&t.loaded))throw Error(`ModelNotLoaded`);if(!this.data)throw Error(`DataNotLoaded`);if(this.showPromise)return this.showPromise;let n=Object.assign({floorIndex:this.floorIndex,modelOpacity:this.state.config.modelOpacity,immediately:!1,isAutoShow:!1,userAction:!0},e),i=()=>(0,f.__awaiter)(this,void 0,void 0,function*(){var e;this.hooks.emit(`show`,{userAction:n.userAction,auto:n.isAutoShow});let t=!1,i;this.showRejection=e=>{t=!0,i=e};let[o]=yield r.default(a.correctFiveState(this.five,this.showState,n.userAction));if(o)throw o;if(t)throw Error(i||`UnknownError`);if(!this.updateSize())throw Error(`UpdateSizeError`);this.updatePosition(),this.floorIndex=n.floorIndex,(e=this.five.model)==null||e.show(this.floorIndex)});return this.isHiddenByHideFunc=!1,this.showPromise=i().then(()=>{this.showPromise=void 0,this.showRejection=void 0;let e=n.immediately?0:m;o.changeModelCanvasOpacity(this.five,n.modelOpacity,e),this.renderWithDuration(e),this.hooks.emit(`showAnimationEnded`,{auto:n.isAutoShow,userAction:n.userAction})}).catch(e=>{if(this.showPromise=void 0,this.showRejection=void 0,this.updateState({visible:!1},n.userAction),!n.isAutoShow)throw e}),this.showPromise}),this._hide=e=>{var t;(t=this.showRejection)==null||t.call(this,`BreakOffByHide`),this.showPromise=void 0;let n=Object.assign({userAction:!0,isAutoHide:!1},e);o.changeModelCanvasOpacity(this.five,1,0),this.hooks.emit(`hide`,{auto:n.isAutoHide,userAction:n.userAction}),this.renderCurrent()},this.five=e,this.styleSheet.replaceSync(d.default),typeof document<`u`&&document.adoptedStyleSheets.push(this.styleSheet),this.showState=Object.assign({mode:`Mapview`,longitude:0,latitude:Math.PI/2,fov:80},t==null?void 0:t.showState);let p={northDesc:`北`,modelOpacity:h,cameraEnable:!0,highlightEnable:!1,hoverEnable:!0,compassEnable:!0,autoShowEnable:!0,ruleLabelsEnable:!0,roomLabelsEnable:!0,roomAreaEnable:!0,roomNameEnable:!0,roomNameOtherTypeEnable:!0,roomDimensionEnable:!0,cameraImageUrl:void 0,attachedTo:3,getLabelElement:void 0,adaptiveRoomLabelVisibleEnable:!0,missingFloorConfig:{imageWidth:200,imageHeight:120,text:`暂无平面图`,textFontSize:14},i18n:e=>e,getRoomAreaText:e=>(e/1e6).toFixed(1)+`㎡`,getRoomDimensionText:(e,t)=>(e/1e3).toFixed(1)+`m × `+(t/1e3).toFixed(1)+`m`,getRuleDistanceText:e=>e.toString()},v=Object.assign(Object.assign(Object.assign({},p),t==null?void 0:t.config),{missingFloorConfig:Object.assign(Object.assign({},p.missingFloorConfig),(n=t==null?void 0:t.config)==null?void 0:n.missingFloorConfig)});this.state={enabled:!0,visible:!1,config:v},Object.assign(this.state,i.omit((s=t==null?void 0:t.initialState)==null?{}:s,[`config`])),this.panoIndex=(l=e.state.panoIndex)==null?0:l,this.initContainer(),c.waitFiveModelLoaded(e).then(this.onFiveModelLoaded),e.once(`dispose`,this.dispose),this.state.enabled?this.addEventListener():this.styleSheet.disabled=!0}load(e,t){return(0,f.__awaiter)(this,arguments,void 0,function*(e,t,r=!0){let i=`data`in e?e.data:e,a=this.data;this.data=yield n.default(i),this.hooks.emit(`dataLoaded`,this.data),this.hooks.emit(`dataChange`,this.data,a),t&&this.updateState(t,r),this.updateSize(),this.updatePosition(),this.renderCurrent()})}loadItems(e){this.data&&(this.data.floorDatas.forEach((t,n)=>{t.items=e[n]}),this.renderCurrent())}appendTo(e){this.wrapper=e,this.state.enabled&&(e.appendChild(this.renderer.rootElement),this.observeResize(e),this.registerExtraElement(),this.updateSize(),this.updatePosition(),this.renderCurrent())}enable(e={}){var t;if(this.state.enabled)return;let n=(t=e.userAction)==null?!0:t;this.updateState({enabled:!0},n),this._enable({userAction:n})}disable(e={}){var t;if(!this.state.enabled)return;let n=(t=e.userAction)==null?!0:t;this.updateState({enabled:!1},n),this._disable({userAction:n})}setState(e,t={}){var n;let r=this.state,i=(n=t.userAction)==null?!0:n;this.updateState(e,i),e.enabled!==void 0&&r.enabled!==e.enabled&&(e.enabled?this._enable({userAction:i}):this._disable({userAction:i})),e.visible!==void 0&&r.visible!==e.visible&&(e.visible?this._show({userAction:i}):this._hide({userAction:i}))}changeConfigs(e,t=!0){this.updateState({config:Object.assign(Object.assign({},this.state.config),e)},t),this.renderCurrent()}updateSize(){if(!this.data||!this.wrapper)return!1;let{min:e,max:t}=this.data.bounding,n=t.x-e.x,r=t.y-e.y,i=this.getPxmmWithRotation(),a=Math.ceil(n*i),o=Math.ceil(r*i);return this.size.width===a&&this.size.height===o?!0:(this.renderer.rootElement.style.width=a+`px`,this.renderer.rootElement.style.height=o+`px`,this.size={width:a,height:o},!0)}updatePosition(){if(!this.wrapper)return;let e=s.getAttachedY(this.five,this.floorIndex,this.state.config.attachedTo),t=this.five.modelScene.boundingBox.getCenter(new p.Vector3);t.y=e;let n=t.clone().project(this.five.camera),r=(n.x+1)/2,i=-(n.y-1)/2;this.renderer.rootElement.style.position=`absolute`,this.renderer.rootElement.style.left=r*100+`%`,this.renderer.rootElement.style.top=i*100+`%`,this.renderer.rootElement.style.transform=`translate(-50%, -50%)`}getPxmmWithRotation(){if(!this.wrapper)return 0;let e={attachedTo:this.state.config.attachedTo};return s.getPxmm(this.five,this.wrapper,this.floorIndex,e)}updateState(e,t){let n=this.state,r=e.config?Object.assign(Object.assign({},n.config),e.config):n.config;this.state=Object.assign(Object.assign(Object.assign({},this.state),e),{config:r}),!l.equal(this.state,n,{deep:!0})&&this.hooks.emit(`stateChange`,{state:this.state,prevState:n,userAction:t})}initContainer(){this.renderer.rootElement.classList.add(`floorplan-plugin`)}registerExtraElement(){var e;(e=this.removeExtraElement)==null||e.call(this),this.removeExtraElement=this.five.addExtraElement(this.renderer.rootElement)}observeResize(e){var t;(t=this.resizeObserver)==null||t.disconnect(),this.resizeObserver=new ResizeObserver(()=>{this.scheduleResizeUpdate()}),this.resizeObserver.observe(e)}scheduleResizeUpdate(){this.pendingResizeFrame===void 0&&(this.pendingResizeFrame=requestAnimationFrame(()=>{this.pendingResizeFrame=void 0,this.updateSize(),this.updatePosition(),this.data&&this.renderer.updateLabelsVisibility(this.data,this.floorIndex,this.state.config.adaptiveRoomLabelVisibleEnable)}))}renderCurrent(){this.data&&this.renderer.render({visible:this.state.visible,duration:0,panoIndex:this.panoIndex,floorIndex:this.floorIndex,floorplanData:this.data,lastPanoramaLongitude:this.lastPanoramaLongitude,config:this.state.config,highlightData:this.highlightData,store:this.store,onRoomHover:this.onRoomHover})}addEventListener(){if(!this.state.enabled||this.hasAddedEventListener)return;this.hasAddedEventListener=!0;let e=this.five;e.on(`modeChange`,this.onFiveModeChange),e.on(`interiaPan`,this.onFiveInertiaPan),e.on(`panoArrived`,this.onFivePanoArrived),e.on(`cameraUpdate`,this.onFiveCameraUpdate),e.on(`wantsPanGesture`,this.onFiveWantsPanGesture),e.on(`wantsTapGesture`,this.onFiveWantsTapGesture),e.on(`wantsChangeMode`,this.onFiveWantsChangeMode),e.on(`modelShownFloorChange`,this.onModelShownFloorChange)}removeEventListener(){this.hasAddedEventListener=!1;let e=this.five;e.off(`modeChange`,this.onFiveModeChange),e.off(`interiaPan`,this.onFiveInertiaPan),e.off(`panoArrived`,this.onFivePanoArrived),e.off(`cameraUpdate`,this.onFiveCameraUpdate),e.off(`wantsPanGesture`,this.onFiveWantsPanGesture),e.off(`wantsTapGesture`,this.onFiveWantsTapGesture),e.off(`wantsChangeMode`,this.onFiveWantsChangeMode),e.off(`modelShownFloorChange`,this.onModelShownFloorChange)}scheduleCameraUpdate(){this.pendingCameraUpdateFrame===void 0&&(this.pendingCameraUpdateFrame=requestAnimationFrame(()=>{this.pendingCameraUpdateFrame=void 0,this.updatePosition(),this.updateSize()}))}getRelativePose(e){let t=this.showState.longitude||0,n=((e.longitude-t)%(2*Math.PI)+2*Math.PI)%(2*Math.PI);return{latitude:e.latitude,longitude:n}}_enable(e){this.styleSheet.disabled=!1,this.addEventListener(),this.wrapper&&(this.wrapper.appendChild(this.renderer.rootElement),this.registerExtraElement()),this.hooks.emit(`enable`,{userAction:e.userAction}),this.state.visible&&this._show({userAction:e.userAction})}_disable(e){var t,n;this.styleSheet.disabled=!0,(t=this.showRejection)==null||t.call(this,`BreakOffByDisable`),this.showPromise=void 0,this.renderer.rootElement.remove(),(n=this.removeExtraElement)==null||n.call(this),this.removeExtraElement=void 0,this.removeEventListener(),this.hooks.emit(`disable`,{userAction:e.userAction})}renderWithDuration(e){this.data&&this.renderer.render({visible:this.state.visible,duration:e,panoIndex:this.panoIndex,floorIndex:this.floorIndex,floorplanData:this.data,lastPanoramaLongitude:this.lastPanoramaLongitude,config:this.state.config,highlightData:this.highlightData,store:this.store,onRoomHover:this.onRoomHover})}};exports.Controller=v;
|
|
338
|
+
*/const require_runtime=require("../../_virtual/_rolldown/runtime.js"),require_index=require("../BasePlugin/index.js"),require_formatData=require("./utils/formatData.js"),require_to=require("./utils/to.js"),require_filter=require("./utils/filter.js"),require_correctFiveState=require("./utils/correctFiveState.js"),require_changeModelCanvasOpacity=require("./utils/changeModelCanvasOpacity.js"),require_getPxmm=require("./utils/getPxmm.js"),require_fiveModelLoad=require("./utils/fiveModelLoad.js"),require_equal=require("./utils/equal.js"),require_index$1=require("./render/index.js"),require_style=require("./render/style.css_raw.js");let tslib=require("tslib"),three_webgpu=require("three/webgpu");three_webgpu=require_runtime.__toESM(three_webgpu,1);var SHOW_ANIME_DURATION=500,DEFAULT_SHOW_MODEL_OPACITY=.01;function shouldFloorplanHideWithPose(pose){let{latitude,longitude}=pose,latitudeHide=Math.abs(latitude-Math.PI/2)>5*Math.PI/180,longitudeHide=longitude>Math.PI/180*5&&longitude<Math.PI/180*355;return latitudeHide||longitudeHide}function shouldFloorplanShowWithPose(pose){let{latitude,longitude}=pose,latitudeVisible=Math.abs(latitude-Math.PI/2)<10*Math.PI/180,longitudeVisible=longitude<Math.PI/180*30||longitude>Math.PI/180*330;return latitudeVisible&&longitudeVisible}var Controller=class extends require_index.BasePlugin.Controller{constructor(five,params){var _a,_b,_c;super(five),this.name=`FloorplanPlugin`,this.renderer=new require_index$1.FloorplanRenderer,this.styleSheet=new CSSStyleSheet,this.panoIndex=0,this.floorIndex=0,this.lastPanoramaLongitude=0,this.size={width:0,height:0},this.hasAddedEventListener=!1,this.isHiddenByHideFunc=!1,this.highlightData={},this.store={roomOnMouse:null},this.dispose=()=>{var _a,_b;this.removeEventListener(),(_a=this.resizeObserver)==null||_a.disconnect(),(_b=this.removeExtraElement)==null||_b.call(this),this.removeExtraElement=void 0,this.pendingCameraUpdateFrame!==void 0&&cancelAnimationFrame(this.pendingCameraUpdateFrame),this.pendingResizeFrame!==void 0&&cancelAnimationFrame(this.pendingResizeFrame),this.renderer.dispose(),this.wrapper=void 0,this.data=void 0,this.hooks.emit(`dispose`)},this.show=(...args_1)=>(0,tslib.__awaiter)(this,[...args_1],void 0,function*(options={}){var _a;if(!this.state.enabled||!this.showPromise&&this.state.visible)return;let userAction=(_a=options.userAction)==null?!0:_a;return this.updateState({visible:!0},userAction),this._show(options)}),this.hide=(...args_1)=>(0,tslib.__awaiter)(this,[...args_1],void 0,function*(options={}){var _a;this.state.enabled&&(this.isHiddenByHideFunc=!0,this.state.visible!==!1&&(this.updateState({visible:!1},(_a=options.userAction)==null?!0:_a),this._hide(options)))}),this.highlight=highlightData=>{this.state.config.highlightEnable&&(this.highlightData=highlightData,this.renderCurrent())},this.unhighlight=()=>{this.highlightData={},this.renderCurrent()},this.updateShowState=showState=>{this.showState=Object.assign(Object.assign({},this.showState),showState)},this.onRoomHover=room=>{this.store.roomOnMouse=room},this.handleClick=()=>{if(this.state.visible&&this.hooks.emit(`click`,this.store.roomOnMouse))return!1},this.onFiveModelLoaded=()=>{var _a,_b,_c;this.state.enabled!==!1&&(this.floorIndex=(_c=(_b=(_a=this.five.work)==null?void 0:_a.observers[this.panoIndex])==null?void 0:_b.floorIndex)==null?0:_c,this.renderCurrent())},this.onFiveModeChange=mode=>{mode!==this.showState.mode&&(this.updateState({visible:!1},!1),this._hide({userAction:!1}))},this.onFiveInertiaPan=(_,isFinal)=>{isFinal&&(this.state.visible||this.state.config.autoShowEnable!==!1&&(this.isHiddenByHideFunc||this.five.currentMode===this.showState.mode&&shouldFloorplanShowWithPose(this.getRelativePose(this.five.getCurrentState()))&&(this.updateState({visible:!0},!0),this._show({isAutoShow:!0}))))},this.onFivePanoArrived=index=>{var _a,_b;this.five.work&&(this.panoIndex=index,this.floorIndex=(_b=(_a=this.five.work.observers[index])==null?void 0:_a.floorIndex)==null?this.floorIndex:_b)},this.onFiveCameraUpdate=(_,userAction)=>{this.state.visible&&(this.showPromise||(this.scheduleCameraUpdate(),shouldFloorplanHideWithPose(this.getRelativePose(this.five.getCurrentState()))&&(this.updateState({visible:!1},userAction),this._hide({userAction}))))},this.onFiveWantsPanGesture=(_,isFinal)=>{if(this.five.currentMode===this.showState.mode&&this.state.config.autoShowEnable!==!1&&isFinal&&this.state.visible)return this.five.updateCamera(require_filter.omit(this.showState,[`mode`,`offset`]),0),!1},this.onFiveWantsTapGesture=()=>this.handleClick(),this.onFiveWantsChangeMode=(mode,prevMode)=>{prevMode===`Panorama`&&mode===this.showState.mode&&(this.lastPanoramaLongitude=this.five.getCurrentState().longitude)},this.onModelShownFloorChange=shownFloor=>{var _a,_b,_c;if(this.floorIndex!==shownFloor){if(shownFloor===null){this.floorIndex=(_c=(_b=(_a=this.five.work)==null?void 0:_a.observers[this.panoIndex])==null?void 0:_b.floorIndex)==null?this.floorIndex:_c;return}this.floorIndex=shownFloor,this.updateSize(),this.renderCurrent()}},this._show=options=>(0,tslib.__awaiter)(this,void 0,void 0,function*(){var _a;if(!this.state.enabled)return;if(!((_a=this.five.model)!=null&&_a.loaded))throw Error(`ModelNotLoaded`);if(!this.data)throw Error(`DataNotLoaded`);if(this.showPromise)return this.showPromise;let mergedOptions=Object.assign({floorIndex:this.floorIndex,modelOpacity:this.state.config.modelOpacity,immediately:!1,isAutoShow:!1,userAction:!0},options),getShowPromise=()=>(0,tslib.__awaiter)(this,void 0,void 0,function*(){var _a;this.hooks.emit(`show`,{userAction:mergedOptions.userAction,auto:mergedOptions.isAutoShow});let hasRejected=!1,externalErrorMsg;this.showRejection=errorMsg=>{hasRejected=!0,externalErrorMsg=errorMsg};let[correctError]=yield require_to.default(require_correctFiveState.correctFiveState(this.five,this.showState,mergedOptions.userAction));if(correctError)throw correctError;if(hasRejected)throw Error(externalErrorMsg||`UnknownError`);if(!this.updateSize())throw Error(`UpdateSizeError`);this.updatePosition(),this.floorIndex=mergedOptions.floorIndex,(_a=this.five.model)==null||_a.show(this.floorIndex)});return this.isHiddenByHideFunc=!1,this.showPromise=getShowPromise().then(()=>{this.showPromise=void 0,this.showRejection=void 0;let renderDuration=mergedOptions.immediately?0:SHOW_ANIME_DURATION;require_changeModelCanvasOpacity.changeModelCanvasOpacity(this.five,mergedOptions.modelOpacity,renderDuration),this.renderWithDuration(renderDuration),this.hooks.emit(`showAnimationEnded`,{auto:mergedOptions.isAutoShow,userAction:mergedOptions.userAction})}).catch(error=>{if(this.showPromise=void 0,this.showRejection=void 0,this.updateState({visible:!1},mergedOptions.userAction),!mergedOptions.isAutoShow)throw error}),this.showPromise}),this._hide=options=>{var _a;(_a=this.showRejection)==null||_a.call(this,`BreakOffByHide`),this.showPromise=void 0;let mergedOptions=Object.assign({userAction:!0,isAutoHide:!1},options);require_changeModelCanvasOpacity.changeModelCanvasOpacity(this.five,1,0),this.hooks.emit(`hide`,{auto:mergedOptions.isAutoHide,userAction:mergedOptions.userAction}),this.renderCurrent()},this.five=five,this.styleSheet.replaceSync(require_style.default),typeof document<`u`&&document.adoptedStyleSheets.push(this.styleSheet),this.showState=Object.assign({mode:`Mapview`,longitude:0,latitude:Math.PI/2,fov:80},params==null?void 0:params.showState);let baseConfig={northDesc:`北`,modelOpacity:DEFAULT_SHOW_MODEL_OPACITY,cameraEnable:!0,highlightEnable:!1,hoverEnable:!0,compassEnable:!0,autoShowEnable:!0,ruleLabelsEnable:!0,roomLabelsEnable:!0,roomAreaEnable:!0,roomNameEnable:!0,roomNameOtherTypeEnable:!0,roomDimensionEnable:!0,cameraImageUrl:void 0,attachedTo:3,getLabelElement:void 0,adaptiveRoomLabelVisibleEnable:!0,missingFloorConfig:{imageWidth:200,imageHeight:120,text:`暂无平面图`,textFontSize:14},i18n:key=>key,getRoomAreaText:size=>(size/1e6).toFixed(1)+`㎡`,getRoomDimensionText:(width,height)=>(width/1e3).toFixed(1)+`m × `+(height/1e3).toFixed(1)+`m`,getRuleDistanceText:distance=>distance.toString()},config=Object.assign(Object.assign(Object.assign({},baseConfig),params==null?void 0:params.config),{missingFloorConfig:Object.assign(Object.assign({},baseConfig.missingFloorConfig),(_a=params==null?void 0:params.config)==null?void 0:_a.missingFloorConfig)});this.state={enabled:!0,visible:!1,config},Object.assign(this.state,require_filter.omit((_b=params==null?void 0:params.initialState)==null?{}:_b,[`config`])),this.panoIndex=(_c=five.state.panoIndex)==null?0:_c,this.initContainer(),require_fiveModelLoad.waitFiveModelLoaded(five).then(this.onFiveModelLoaded),five.once(`dispose`,this.dispose),this.state.enabled?this.addEventListener():this.styleSheet.disabled=!0}load(serverData_1,state_1){return(0,tslib.__awaiter)(this,arguments,void 0,function*(serverData,state,userAction=!0){let raw=`data`in serverData?serverData.data:serverData,prevData=this.data;this.data=yield require_formatData.default(raw),this.hooks.emit(`dataLoaded`,this.data),this.hooks.emit(`dataChange`,this.data,prevData),state&&this.updateState(state,userAction),this.updateSize(),this.updatePosition(),this.renderCurrent()})}loadItems(itemsByFloor){this.data&&(this.data.floorDatas.forEach((floorData,index)=>{floorData.items=itemsByFloor[index]}),this.renderCurrent())}appendTo(wrapper){this.wrapper=wrapper,this.state.enabled&&(wrapper.appendChild(this.renderer.rootElement),this.observeResize(wrapper),this.registerExtraElement(),this.updateSize(),this.updatePosition(),this.renderCurrent())}enable(options={}){var _a;if(this.state.enabled)return;let userAction=(_a=options.userAction)==null?!0:_a;this.updateState({enabled:!0},userAction),this._enable({userAction})}disable(options={}){var _a;if(!this.state.enabled)return;let userAction=(_a=options.userAction)==null?!0:_a;this.updateState({enabled:!1},userAction),this._disable({userAction})}setState(state,options={}){var _a;let prevState=this.state,userAction=(_a=options.userAction)==null?!0:_a;this.updateState(state,userAction),state.enabled!==void 0&&prevState.enabled!==state.enabled&&(state.enabled?this._enable({userAction}):this._disable({userAction})),state.visible!==void 0&&prevState.visible!==state.visible&&(state.visible?this._show({userAction}):this._hide({userAction}))}changeConfigs(config,userAction=!0){this.updateState({config:Object.assign(Object.assign({},this.state.config),config)},userAction),this.renderCurrent()}updateSize(){if(!this.data||!this.wrapper)return!1;let{min,max}=this.data.bounding,width=max.x-min.x,height=max.y-min.y,pxmm=this.getPxmmWithRotation(),nextWidth=Math.ceil(width*pxmm),nextHeight=Math.ceil(height*pxmm);return this.size.width===nextWidth&&this.size.height===nextHeight?!0:(this.renderer.rootElement.style.width=nextWidth+`px`,this.renderer.rootElement.style.height=nextHeight+`px`,this.size={width:nextWidth,height:nextHeight},!0)}updatePosition(){if(!this.wrapper)return;let y=require_getPxmm.getAttachedY(this.five,this.floorIndex,this.state.config.attachedTo),modelPosition=this.five.modelScene.boundingBox.getCenter(new three_webgpu.Vector3);modelPosition.y=y;let ndcPosition=modelPosition.clone().project(this.five.camera),left=(ndcPosition.x+1)/2,top=-(ndcPosition.y-1)/2;this.renderer.rootElement.style.position=`absolute`,this.renderer.rootElement.style.left=left*100+`%`,this.renderer.rootElement.style.top=top*100+`%`,this.renderer.rootElement.style.transform=`translate(-50%, -50%)`}getPxmmWithRotation(){if(!this.wrapper)return 0;let options={attachedTo:this.state.config.attachedTo};return require_getPxmm.getPxmm(this.five,this.wrapper,this.floorIndex,options)}updateState(state,userAction){let prevState=this.state,config=state.config?Object.assign(Object.assign({},prevState.config),state.config):prevState.config;this.state=Object.assign(Object.assign(Object.assign({},this.state),state),{config}),!require_equal.equal(this.state,prevState,{deep:!0})&&this.hooks.emit(`stateChange`,{state:this.state,prevState,userAction})}initContainer(){this.renderer.rootElement.classList.add(`floorplan-plugin`)}registerExtraElement(){var _a;(_a=this.removeExtraElement)==null||_a.call(this),this.removeExtraElement=this.five.addExtraElement(this.renderer.rootElement)}observeResize(wrapper){var _a;(_a=this.resizeObserver)==null||_a.disconnect(),this.resizeObserver=new ResizeObserver(()=>{this.scheduleResizeUpdate()}),this.resizeObserver.observe(wrapper)}scheduleResizeUpdate(){this.pendingResizeFrame===void 0&&(this.pendingResizeFrame=requestAnimationFrame(()=>{this.pendingResizeFrame=void 0,this.updateSize(),this.updatePosition(),this.data&&this.renderer.updateLabelsVisibility(this.data,this.floorIndex,this.state.config.adaptiveRoomLabelVisibleEnable)}))}renderCurrent(){this.data&&this.renderer.render({visible:this.state.visible,duration:0,panoIndex:this.panoIndex,floorIndex:this.floorIndex,floorplanData:this.data,lastPanoramaLongitude:this.lastPanoramaLongitude,config:this.state.config,highlightData:this.highlightData,store:this.store,onRoomHover:this.onRoomHover})}addEventListener(){if(!this.state.enabled||this.hasAddedEventListener)return;this.hasAddedEventListener=!0;let five=this.five;five.on(`modeChange`,this.onFiveModeChange),five.on(`interiaPan`,this.onFiveInertiaPan),five.on(`panoArrived`,this.onFivePanoArrived),five.on(`cameraUpdate`,this.onFiveCameraUpdate),five.on(`wantsPanGesture`,this.onFiveWantsPanGesture),five.on(`wantsTapGesture`,this.onFiveWantsTapGesture),five.on(`wantsChangeMode`,this.onFiveWantsChangeMode),five.on(`modelShownFloorChange`,this.onModelShownFloorChange)}removeEventListener(){this.hasAddedEventListener=!1;let five=this.five;five.off(`modeChange`,this.onFiveModeChange),five.off(`interiaPan`,this.onFiveInertiaPan),five.off(`panoArrived`,this.onFivePanoArrived),five.off(`cameraUpdate`,this.onFiveCameraUpdate),five.off(`wantsPanGesture`,this.onFiveWantsPanGesture),five.off(`wantsTapGesture`,this.onFiveWantsTapGesture),five.off(`wantsChangeMode`,this.onFiveWantsChangeMode),five.off(`modelShownFloorChange`,this.onModelShownFloorChange)}scheduleCameraUpdate(){this.pendingCameraUpdateFrame===void 0&&(this.pendingCameraUpdateFrame=requestAnimationFrame(()=>{this.pendingCameraUpdateFrame=void 0,this.updatePosition(),this.updateSize()}))}getRelativePose(pose){let baseLongitude=this.showState.longitude||0,normalizedLongitude=((pose.longitude-baseLongitude)%(2*Math.PI)+2*Math.PI)%(2*Math.PI);return{latitude:pose.latitude,longitude:normalizedLongitude}}_enable(options){this.styleSheet.disabled=!1,this.addEventListener(),this.wrapper&&(this.wrapper.appendChild(this.renderer.rootElement),this.registerExtraElement()),this.hooks.emit(`enable`,{userAction:options.userAction}),this.state.visible&&this._show({userAction:options.userAction})}_disable(options){var _a,_b;this.styleSheet.disabled=!0,(_a=this.showRejection)==null||_a.call(this,`BreakOffByDisable`),this.showPromise=void 0,this.renderer.rootElement.remove(),(_b=this.removeExtraElement)==null||_b.call(this),this.removeExtraElement=void 0,this.removeEventListener(),this.hooks.emit(`disable`,{userAction:options.userAction})}renderWithDuration(duration){this.data&&this.renderer.render({visible:this.state.visible,duration,panoIndex:this.panoIndex,floorIndex:this.floorIndex,floorplanData:this.data,lastPanoramaLongitude:this.lastPanoramaLongitude,config:this.state.config,highlightData:this.highlightData,store:this.store,onRoomHover:this.onRoomHover})}};exports.Controller=Controller;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @license
|
|
3
3
|
* @realsee/five-webgpu
|
|
4
|
-
* Generated: 2026/
|
|
5
|
-
* Version: 1.0.0-alpha.
|
|
4
|
+
* Generated: 2026/11/4
|
|
5
|
+
* Version: 1.0.0-alpha.15
|
|
6
6
|
* License:
|
|
7
7
|
* Realsee SDK License Agreement
|
|
8
8
|
|
|
@@ -335,4 +335,4 @@
|
|
|
335
335
|
* writing and signed by Realsee. You and Realsee hereto confirm that this
|
|
336
336
|
* Agreement and all related documents shall be drafted in English.
|
|
337
337
|
|
|
338
|
-
*/import{BasePlugin as e}from"../BasePlugin/index.mjs";import t from"./utils/formatData.mjs";import n from"./utils/to.mjs";import{omit as r}from"./utils/filter.mjs";import{correctFiveState as i}from"./utils/correctFiveState.mjs";import{changeModelCanvasOpacity as a}from"./utils/changeModelCanvasOpacity.mjs";import{getAttachedY as o,getPxmm as s}from"./utils/getPxmm.mjs";import{waitFiveModelLoaded as c}from"./utils/fiveModelLoad.mjs";import{equal as l}from"./utils/equal.mjs";import{FloorplanRenderer as u}from"./render/index.mjs";import d from"./render/style.css_raw.mjs";import{__awaiter as f}from"tslib";import*as p from"three/webgpu";var m=500,h=.01;function g(e){let{latitude:t,longitude:n}=e,r=Math.abs(t-Math.PI/2)>5*Math.PI/180,i=n>Math.PI/180*5&&n<Math.PI/180*355;return r||i}function _(e){let{latitude:t,longitude:n}=e,r=Math.abs(t-Math.PI/2)<10*Math.PI/180,i=n<Math.PI/180*30||n>Math.PI/180*330;return r&&i}var v=class extends e.Controller{constructor(e,t){var o,s,l;super(e),this.name=`FloorplanPlugin`,this.renderer=new u,this.styleSheet=new CSSStyleSheet,this.panoIndex=0,this.floorIndex=0,this.lastPanoramaLongitude=0,this.size={width:0,height:0},this.hasAddedEventListener=!1,this.isHiddenByHideFunc=!1,this.highlightData={},this.store={roomOnMouse:null},this.dispose=()=>{var e,t;this.removeEventListener(),(e=this.resizeObserver)==null||e.disconnect(),(t=this.removeExtraElement)==null||t.call(this),this.removeExtraElement=void 0,this.pendingCameraUpdateFrame!==void 0&&cancelAnimationFrame(this.pendingCameraUpdateFrame),this.pendingResizeFrame!==void 0&&cancelAnimationFrame(this.pendingResizeFrame),this.renderer.dispose(),this.wrapper=void 0,this.data=void 0,this.hooks.emit(`dispose`)},this.show=(...e)=>f(this,[...e],void 0,function*(e={}){var t;if(!this.state.enabled||!this.showPromise&&this.state.visible)return;let n=(t=e.userAction)==null?!0:t;return this.updateState({visible:!0},n),this._show(e)}),this.hide=(...e)=>f(this,[...e],void 0,function*(e={}){var t;this.state.enabled&&(this.isHiddenByHideFunc=!0,this.state.visible!==!1&&(this.updateState({visible:!1},(t=e.userAction)==null?!0:t),this._hide(e)))}),this.highlight=e=>{this.state.config.highlightEnable&&(this.highlightData=e,this.renderCurrent())},this.unhighlight=()=>{this.highlightData={},this.renderCurrent()},this.updateShowState=e=>{this.showState=Object.assign(Object.assign({},this.showState),e)},this.onRoomHover=e=>{this.store.roomOnMouse=e},this.handleClick=()=>{if(this.state.visible&&this.hooks.emit(`click`,this.store.roomOnMouse))return!1},this.onFiveModelLoaded=()=>{var e,t,n;this.state.enabled!==!1&&(this.floorIndex=(n=(t=(e=this.five.work)==null?void 0:e.observers[this.panoIndex])==null?void 0:t.floorIndex)==null?0:n,this.renderCurrent())},this.onFiveModeChange=e=>{e!==this.showState.mode&&(this.updateState({visible:!1},!1),this._hide({userAction:!1}))},this.onFiveInertiaPan=(e,t)=>{t&&(this.state.visible||this.state.config.autoShowEnable!==!1&&(this.isHiddenByHideFunc||this.five.currentMode===this.showState.mode&&_(this.getRelativePose(this.five.getCurrentState()))&&(this.updateState({visible:!0},!0),this._show({isAutoShow:!0}))))},this.onFivePanoArrived=e=>{var t,n;this.five.work&&(this.panoIndex=e,this.floorIndex=(n=(t=this.five.work.observers[e])==null?void 0:t.floorIndex)==null?this.floorIndex:n)},this.onFiveCameraUpdate=(e,t)=>{this.state.visible&&(this.showPromise||(this.scheduleCameraUpdate(),g(this.getRelativePose(this.five.getCurrentState()))&&(this.updateState({visible:!1},t),this._hide({userAction:t}))))},this.onFiveWantsPanGesture=(e,t)=>{if(this.five.currentMode===this.showState.mode&&this.state.config.autoShowEnable!==!1&&t&&this.state.visible)return this.five.updateCamera(r(this.showState,[`mode`,`offset`]),0),!1},this.onFiveWantsTapGesture=()=>this.handleClick(),this.onFiveWantsChangeMode=(e,t)=>{t===`Panorama`&&e===this.showState.mode&&(this.lastPanoramaLongitude=this.five.getCurrentState().longitude)},this.onModelShownFloorChange=e=>{var t,n,r;if(this.floorIndex!==e){if(e===null){this.floorIndex=(r=(n=(t=this.five.work)==null?void 0:t.observers[this.panoIndex])==null?void 0:n.floorIndex)==null?this.floorIndex:r;return}this.floorIndex=e,this.updateSize(),this.renderCurrent()}},this._show=e=>f(this,void 0,void 0,function*(){var t;if(!this.state.enabled)return;if(!((t=this.five.model)!=null&&t.loaded))throw Error(`ModelNotLoaded`);if(!this.data)throw Error(`DataNotLoaded`);if(this.showPromise)return this.showPromise;let r=Object.assign({floorIndex:this.floorIndex,modelOpacity:this.state.config.modelOpacity,immediately:!1,isAutoShow:!1,userAction:!0},e),o=()=>f(this,void 0,void 0,function*(){var e;this.hooks.emit(`show`,{userAction:r.userAction,auto:r.isAutoShow});let t=!1,a;this.showRejection=e=>{t=!0,a=e};let[o]=yield n(i(this.five,this.showState,r.userAction));if(o)throw o;if(t)throw Error(a||`UnknownError`);if(!this.updateSize())throw Error(`UpdateSizeError`);this.updatePosition(),this.floorIndex=r.floorIndex,(e=this.five.model)==null||e.show(this.floorIndex)});return this.isHiddenByHideFunc=!1,this.showPromise=o().then(()=>{this.showPromise=void 0,this.showRejection=void 0;let e=r.immediately?0:m;a(this.five,r.modelOpacity,e),this.renderWithDuration(e),this.hooks.emit(`showAnimationEnded`,{auto:r.isAutoShow,userAction:r.userAction})}).catch(e=>{if(this.showPromise=void 0,this.showRejection=void 0,this.updateState({visible:!1},r.userAction),!r.isAutoShow)throw e}),this.showPromise}),this._hide=e=>{var t;(t=this.showRejection)==null||t.call(this,`BreakOffByHide`),this.showPromise=void 0;let n=Object.assign({userAction:!0,isAutoHide:!1},e);a(this.five,1,0),this.hooks.emit(`hide`,{auto:n.isAutoHide,userAction:n.userAction}),this.renderCurrent()},this.five=e,this.styleSheet.replaceSync(d),typeof document<`u`&&document.adoptedStyleSheets.push(this.styleSheet),this.showState=Object.assign({mode:`Mapview`,longitude:0,latitude:Math.PI/2,fov:80},t==null?void 0:t.showState);let p={northDesc:`北`,modelOpacity:h,cameraEnable:!0,highlightEnable:!1,hoverEnable:!0,compassEnable:!0,autoShowEnable:!0,ruleLabelsEnable:!0,roomLabelsEnable:!0,roomAreaEnable:!0,roomNameEnable:!0,roomNameOtherTypeEnable:!0,roomDimensionEnable:!0,cameraImageUrl:void 0,attachedTo:3,getLabelElement:void 0,adaptiveRoomLabelVisibleEnable:!0,missingFloorConfig:{imageWidth:200,imageHeight:120,text:`暂无平面图`,textFontSize:14},i18n:e=>e,getRoomAreaText:e=>(e/1e6).toFixed(1)+`㎡`,getRoomDimensionText:(e,t)=>(e/1e3).toFixed(1)+`m × `+(t/1e3).toFixed(1)+`m`,getRuleDistanceText:e=>e.toString()},v=Object.assign(Object.assign(Object.assign({},p),t==null?void 0:t.config),{missingFloorConfig:Object.assign(Object.assign({},p.missingFloorConfig),(o=t==null?void 0:t.config)==null?void 0:o.missingFloorConfig)});this.state={enabled:!0,visible:!1,config:v},Object.assign(this.state,r((s=t==null?void 0:t.initialState)==null?{}:s,[`config`])),this.panoIndex=(l=e.state.panoIndex)==null?0:l,this.initContainer(),c(e).then(this.onFiveModelLoaded),e.once(`dispose`,this.dispose),this.state.enabled?this.addEventListener():this.styleSheet.disabled=!0}load(e,n){return f(this,arguments,void 0,function*(e,n,r=!0){let i=`data`in e?e.data:e,a=this.data;this.data=yield t(i),this.hooks.emit(`dataLoaded`,this.data),this.hooks.emit(`dataChange`,this.data,a),n&&this.updateState(n,r),this.updateSize(),this.updatePosition(),this.renderCurrent()})}loadItems(e){this.data&&(this.data.floorDatas.forEach((t,n)=>{t.items=e[n]}),this.renderCurrent())}appendTo(e){this.wrapper=e,this.state.enabled&&(e.appendChild(this.renderer.rootElement),this.observeResize(e),this.registerExtraElement(),this.updateSize(),this.updatePosition(),this.renderCurrent())}enable(e={}){var t;if(this.state.enabled)return;let n=(t=e.userAction)==null?!0:t;this.updateState({enabled:!0},n),this._enable({userAction:n})}disable(e={}){var t;if(!this.state.enabled)return;let n=(t=e.userAction)==null?!0:t;this.updateState({enabled:!1},n),this._disable({userAction:n})}setState(e,t={}){var n;let r=this.state,i=(n=t.userAction)==null?!0:n;this.updateState(e,i),e.enabled!==void 0&&r.enabled!==e.enabled&&(e.enabled?this._enable({userAction:i}):this._disable({userAction:i})),e.visible!==void 0&&r.visible!==e.visible&&(e.visible?this._show({userAction:i}):this._hide({userAction:i}))}changeConfigs(e,t=!0){this.updateState({config:Object.assign(Object.assign({},this.state.config),e)},t),this.renderCurrent()}updateSize(){if(!this.data||!this.wrapper)return!1;let{min:e,max:t}=this.data.bounding,n=t.x-e.x,r=t.y-e.y,i=this.getPxmmWithRotation(),a=Math.ceil(n*i),o=Math.ceil(r*i);return this.size.width===a&&this.size.height===o?!0:(this.renderer.rootElement.style.width=a+`px`,this.renderer.rootElement.style.height=o+`px`,this.size={width:a,height:o},!0)}updatePosition(){if(!this.wrapper)return;let e=o(this.five,this.floorIndex,this.state.config.attachedTo),t=this.five.modelScene.boundingBox.getCenter(new p.Vector3);t.y=e;let n=t.clone().project(this.five.camera),r=(n.x+1)/2,i=-(n.y-1)/2;this.renderer.rootElement.style.position=`absolute`,this.renderer.rootElement.style.left=r*100+`%`,this.renderer.rootElement.style.top=i*100+`%`,this.renderer.rootElement.style.transform=`translate(-50%, -50%)`}getPxmmWithRotation(){if(!this.wrapper)return 0;let e={attachedTo:this.state.config.attachedTo};return s(this.five,this.wrapper,this.floorIndex,e)}updateState(e,t){let n=this.state,r=e.config?Object.assign(Object.assign({},n.config),e.config):n.config;this.state=Object.assign(Object.assign(Object.assign({},this.state),e),{config:r}),!l(this.state,n,{deep:!0})&&this.hooks.emit(`stateChange`,{state:this.state,prevState:n,userAction:t})}initContainer(){this.renderer.rootElement.classList.add(`floorplan-plugin`)}registerExtraElement(){var e;(e=this.removeExtraElement)==null||e.call(this),this.removeExtraElement=this.five.addExtraElement(this.renderer.rootElement)}observeResize(e){var t;(t=this.resizeObserver)==null||t.disconnect(),this.resizeObserver=new ResizeObserver(()=>{this.scheduleResizeUpdate()}),this.resizeObserver.observe(e)}scheduleResizeUpdate(){this.pendingResizeFrame===void 0&&(this.pendingResizeFrame=requestAnimationFrame(()=>{this.pendingResizeFrame=void 0,this.updateSize(),this.updatePosition(),this.data&&this.renderer.updateLabelsVisibility(this.data,this.floorIndex,this.state.config.adaptiveRoomLabelVisibleEnable)}))}renderCurrent(){this.data&&this.renderer.render({visible:this.state.visible,duration:0,panoIndex:this.panoIndex,floorIndex:this.floorIndex,floorplanData:this.data,lastPanoramaLongitude:this.lastPanoramaLongitude,config:this.state.config,highlightData:this.highlightData,store:this.store,onRoomHover:this.onRoomHover})}addEventListener(){if(!this.state.enabled||this.hasAddedEventListener)return;this.hasAddedEventListener=!0;let e=this.five;e.on(`modeChange`,this.onFiveModeChange),e.on(`interiaPan`,this.onFiveInertiaPan),e.on(`panoArrived`,this.onFivePanoArrived),e.on(`cameraUpdate`,this.onFiveCameraUpdate),e.on(`wantsPanGesture`,this.onFiveWantsPanGesture),e.on(`wantsTapGesture`,this.onFiveWantsTapGesture),e.on(`wantsChangeMode`,this.onFiveWantsChangeMode),e.on(`modelShownFloorChange`,this.onModelShownFloorChange)}removeEventListener(){this.hasAddedEventListener=!1;let e=this.five;e.off(`modeChange`,this.onFiveModeChange),e.off(`interiaPan`,this.onFiveInertiaPan),e.off(`panoArrived`,this.onFivePanoArrived),e.off(`cameraUpdate`,this.onFiveCameraUpdate),e.off(`wantsPanGesture`,this.onFiveWantsPanGesture),e.off(`wantsTapGesture`,this.onFiveWantsTapGesture),e.off(`wantsChangeMode`,this.onFiveWantsChangeMode),e.off(`modelShownFloorChange`,this.onModelShownFloorChange)}scheduleCameraUpdate(){this.pendingCameraUpdateFrame===void 0&&(this.pendingCameraUpdateFrame=requestAnimationFrame(()=>{this.pendingCameraUpdateFrame=void 0,this.updatePosition(),this.updateSize()}))}getRelativePose(e){let t=this.showState.longitude||0,n=((e.longitude-t)%(2*Math.PI)+2*Math.PI)%(2*Math.PI);return{latitude:e.latitude,longitude:n}}_enable(e){this.styleSheet.disabled=!1,this.addEventListener(),this.wrapper&&(this.wrapper.appendChild(this.renderer.rootElement),this.registerExtraElement()),this.hooks.emit(`enable`,{userAction:e.userAction}),this.state.visible&&this._show({userAction:e.userAction})}_disable(e){var t,n;this.styleSheet.disabled=!0,(t=this.showRejection)==null||t.call(this,`BreakOffByDisable`),this.showPromise=void 0,this.renderer.rootElement.remove(),(n=this.removeExtraElement)==null||n.call(this),this.removeExtraElement=void 0,this.removeEventListener(),this.hooks.emit(`disable`,{userAction:e.userAction})}renderWithDuration(e){this.data&&this.renderer.render({visible:this.state.visible,duration:e,panoIndex:this.panoIndex,floorIndex:this.floorIndex,floorplanData:this.data,lastPanoramaLongitude:this.lastPanoramaLongitude,config:this.state.config,highlightData:this.highlightData,store:this.store,onRoomHover:this.onRoomHover})}};export{v as Controller};
|
|
338
|
+
*/import{BasePlugin}from"../BasePlugin/index.mjs";import formatData from"./utils/formatData.mjs";import to from"./utils/to.mjs";import{omit}from"./utils/filter.mjs";import{correctFiveState}from"./utils/correctFiveState.mjs";import{changeModelCanvasOpacity}from"./utils/changeModelCanvasOpacity.mjs";import{getAttachedY,getPxmm}from"./utils/getPxmm.mjs";import{waitFiveModelLoaded}from"./utils/fiveModelLoad.mjs";import{equal}from"./utils/equal.mjs";import{FloorplanRenderer}from"./render/index.mjs";import style_default from"./render/style.css_raw.mjs";import{__awaiter}from"tslib";import*as THREE from"three/webgpu";var SHOW_ANIME_DURATION=500,DEFAULT_SHOW_MODEL_OPACITY=.01;function shouldFloorplanHideWithPose(pose){let{latitude,longitude}=pose,latitudeHide=Math.abs(latitude-Math.PI/2)>5*Math.PI/180,longitudeHide=longitude>Math.PI/180*5&&longitude<Math.PI/180*355;return latitudeHide||longitudeHide}function shouldFloorplanShowWithPose(pose){let{latitude,longitude}=pose,latitudeVisible=Math.abs(latitude-Math.PI/2)<10*Math.PI/180,longitudeVisible=longitude<Math.PI/180*30||longitude>Math.PI/180*330;return latitudeVisible&&longitudeVisible}var Controller=class extends BasePlugin.Controller{constructor(five,params){var _a,_b,_c;super(five),this.name=`FloorplanPlugin`,this.renderer=new FloorplanRenderer,this.styleSheet=new CSSStyleSheet,this.panoIndex=0,this.floorIndex=0,this.lastPanoramaLongitude=0,this.size={width:0,height:0},this.hasAddedEventListener=!1,this.isHiddenByHideFunc=!1,this.highlightData={},this.store={roomOnMouse:null},this.dispose=()=>{var _a,_b;this.removeEventListener(),(_a=this.resizeObserver)==null||_a.disconnect(),(_b=this.removeExtraElement)==null||_b.call(this),this.removeExtraElement=void 0,this.pendingCameraUpdateFrame!==void 0&&cancelAnimationFrame(this.pendingCameraUpdateFrame),this.pendingResizeFrame!==void 0&&cancelAnimationFrame(this.pendingResizeFrame),this.renderer.dispose(),this.wrapper=void 0,this.data=void 0,this.hooks.emit(`dispose`)},this.show=(...args_1)=>__awaiter(this,[...args_1],void 0,function*(options={}){var _a;if(!this.state.enabled||!this.showPromise&&this.state.visible)return;let userAction=(_a=options.userAction)==null?!0:_a;return this.updateState({visible:!0},userAction),this._show(options)}),this.hide=(...args_1)=>__awaiter(this,[...args_1],void 0,function*(options={}){var _a;this.state.enabled&&(this.isHiddenByHideFunc=!0,this.state.visible!==!1&&(this.updateState({visible:!1},(_a=options.userAction)==null?!0:_a),this._hide(options)))}),this.highlight=highlightData=>{this.state.config.highlightEnable&&(this.highlightData=highlightData,this.renderCurrent())},this.unhighlight=()=>{this.highlightData={},this.renderCurrent()},this.updateShowState=showState=>{this.showState=Object.assign(Object.assign({},this.showState),showState)},this.onRoomHover=room=>{this.store.roomOnMouse=room},this.handleClick=()=>{if(this.state.visible&&this.hooks.emit(`click`,this.store.roomOnMouse))return!1},this.onFiveModelLoaded=()=>{var _a,_b,_c;this.state.enabled!==!1&&(this.floorIndex=(_c=(_b=(_a=this.five.work)==null?void 0:_a.observers[this.panoIndex])==null?void 0:_b.floorIndex)==null?0:_c,this.renderCurrent())},this.onFiveModeChange=mode=>{mode!==this.showState.mode&&(this.updateState({visible:!1},!1),this._hide({userAction:!1}))},this.onFiveInertiaPan=(_,isFinal)=>{isFinal&&(this.state.visible||this.state.config.autoShowEnable!==!1&&(this.isHiddenByHideFunc||this.five.currentMode===this.showState.mode&&shouldFloorplanShowWithPose(this.getRelativePose(this.five.getCurrentState()))&&(this.updateState({visible:!0},!0),this._show({isAutoShow:!0}))))},this.onFivePanoArrived=index=>{var _a,_b;this.five.work&&(this.panoIndex=index,this.floorIndex=(_b=(_a=this.five.work.observers[index])==null?void 0:_a.floorIndex)==null?this.floorIndex:_b)},this.onFiveCameraUpdate=(_,userAction)=>{this.state.visible&&(this.showPromise||(this.scheduleCameraUpdate(),shouldFloorplanHideWithPose(this.getRelativePose(this.five.getCurrentState()))&&(this.updateState({visible:!1},userAction),this._hide({userAction}))))},this.onFiveWantsPanGesture=(_,isFinal)=>{if(this.five.currentMode===this.showState.mode&&this.state.config.autoShowEnable!==!1&&isFinal&&this.state.visible)return this.five.updateCamera(omit(this.showState,[`mode`,`offset`]),0),!1},this.onFiveWantsTapGesture=()=>this.handleClick(),this.onFiveWantsChangeMode=(mode,prevMode)=>{prevMode===`Panorama`&&mode===this.showState.mode&&(this.lastPanoramaLongitude=this.five.getCurrentState().longitude)},this.onModelShownFloorChange=shownFloor=>{var _a,_b,_c;if(this.floorIndex!==shownFloor){if(shownFloor===null){this.floorIndex=(_c=(_b=(_a=this.five.work)==null?void 0:_a.observers[this.panoIndex])==null?void 0:_b.floorIndex)==null?this.floorIndex:_c;return}this.floorIndex=shownFloor,this.updateSize(),this.renderCurrent()}},this._show=options=>__awaiter(this,void 0,void 0,function*(){var _a;if(!this.state.enabled)return;if(!((_a=this.five.model)!=null&&_a.loaded))throw Error(`ModelNotLoaded`);if(!this.data)throw Error(`DataNotLoaded`);if(this.showPromise)return this.showPromise;let mergedOptions=Object.assign({floorIndex:this.floorIndex,modelOpacity:this.state.config.modelOpacity,immediately:!1,isAutoShow:!1,userAction:!0},options),getShowPromise=()=>__awaiter(this,void 0,void 0,function*(){var _a;this.hooks.emit(`show`,{userAction:mergedOptions.userAction,auto:mergedOptions.isAutoShow});let hasRejected=!1,externalErrorMsg;this.showRejection=errorMsg=>{hasRejected=!0,externalErrorMsg=errorMsg};let[correctError]=yield to(correctFiveState(this.five,this.showState,mergedOptions.userAction));if(correctError)throw correctError;if(hasRejected)throw Error(externalErrorMsg||`UnknownError`);if(!this.updateSize())throw Error(`UpdateSizeError`);this.updatePosition(),this.floorIndex=mergedOptions.floorIndex,(_a=this.five.model)==null||_a.show(this.floorIndex)});return this.isHiddenByHideFunc=!1,this.showPromise=getShowPromise().then(()=>{this.showPromise=void 0,this.showRejection=void 0;let renderDuration=mergedOptions.immediately?0:SHOW_ANIME_DURATION;changeModelCanvasOpacity(this.five,mergedOptions.modelOpacity,renderDuration),this.renderWithDuration(renderDuration),this.hooks.emit(`showAnimationEnded`,{auto:mergedOptions.isAutoShow,userAction:mergedOptions.userAction})}).catch(error=>{if(this.showPromise=void 0,this.showRejection=void 0,this.updateState({visible:!1},mergedOptions.userAction),!mergedOptions.isAutoShow)throw error}),this.showPromise}),this._hide=options=>{var _a;(_a=this.showRejection)==null||_a.call(this,`BreakOffByHide`),this.showPromise=void 0;let mergedOptions=Object.assign({userAction:!0,isAutoHide:!1},options);changeModelCanvasOpacity(this.five,1,0),this.hooks.emit(`hide`,{auto:mergedOptions.isAutoHide,userAction:mergedOptions.userAction}),this.renderCurrent()},this.five=five,this.styleSheet.replaceSync(style_default),typeof document<`u`&&document.adoptedStyleSheets.push(this.styleSheet),this.showState=Object.assign({mode:`Mapview`,longitude:0,latitude:Math.PI/2,fov:80},params==null?void 0:params.showState);let baseConfig={northDesc:`北`,modelOpacity:DEFAULT_SHOW_MODEL_OPACITY,cameraEnable:!0,highlightEnable:!1,hoverEnable:!0,compassEnable:!0,autoShowEnable:!0,ruleLabelsEnable:!0,roomLabelsEnable:!0,roomAreaEnable:!0,roomNameEnable:!0,roomNameOtherTypeEnable:!0,roomDimensionEnable:!0,cameraImageUrl:void 0,attachedTo:3,getLabelElement:void 0,adaptiveRoomLabelVisibleEnable:!0,missingFloorConfig:{imageWidth:200,imageHeight:120,text:`暂无平面图`,textFontSize:14},i18n:key=>key,getRoomAreaText:size=>(size/1e6).toFixed(1)+`㎡`,getRoomDimensionText:(width,height)=>(width/1e3).toFixed(1)+`m × `+(height/1e3).toFixed(1)+`m`,getRuleDistanceText:distance=>distance.toString()},config=Object.assign(Object.assign(Object.assign({},baseConfig),params==null?void 0:params.config),{missingFloorConfig:Object.assign(Object.assign({},baseConfig.missingFloorConfig),(_a=params==null?void 0:params.config)==null?void 0:_a.missingFloorConfig)});this.state={enabled:!0,visible:!1,config},Object.assign(this.state,omit((_b=params==null?void 0:params.initialState)==null?{}:_b,[`config`])),this.panoIndex=(_c=five.state.panoIndex)==null?0:_c,this.initContainer(),waitFiveModelLoaded(five).then(this.onFiveModelLoaded),five.once(`dispose`,this.dispose),this.state.enabled?this.addEventListener():this.styleSheet.disabled=!0}load(serverData_1,state_1){return __awaiter(this,arguments,void 0,function*(serverData,state,userAction=!0){let raw=`data`in serverData?serverData.data:serverData,prevData=this.data;this.data=yield formatData(raw),this.hooks.emit(`dataLoaded`,this.data),this.hooks.emit(`dataChange`,this.data,prevData),state&&this.updateState(state,userAction),this.updateSize(),this.updatePosition(),this.renderCurrent()})}loadItems(itemsByFloor){this.data&&(this.data.floorDatas.forEach((floorData,index)=>{floorData.items=itemsByFloor[index]}),this.renderCurrent())}appendTo(wrapper){this.wrapper=wrapper,this.state.enabled&&(wrapper.appendChild(this.renderer.rootElement),this.observeResize(wrapper),this.registerExtraElement(),this.updateSize(),this.updatePosition(),this.renderCurrent())}enable(options={}){var _a;if(this.state.enabled)return;let userAction=(_a=options.userAction)==null?!0:_a;this.updateState({enabled:!0},userAction),this._enable({userAction})}disable(options={}){var _a;if(!this.state.enabled)return;let userAction=(_a=options.userAction)==null?!0:_a;this.updateState({enabled:!1},userAction),this._disable({userAction})}setState(state,options={}){var _a;let prevState=this.state,userAction=(_a=options.userAction)==null?!0:_a;this.updateState(state,userAction),state.enabled!==void 0&&prevState.enabled!==state.enabled&&(state.enabled?this._enable({userAction}):this._disable({userAction})),state.visible!==void 0&&prevState.visible!==state.visible&&(state.visible?this._show({userAction}):this._hide({userAction}))}changeConfigs(config,userAction=!0){this.updateState({config:Object.assign(Object.assign({},this.state.config),config)},userAction),this.renderCurrent()}updateSize(){if(!this.data||!this.wrapper)return!1;let{min,max}=this.data.bounding,width=max.x-min.x,height=max.y-min.y,pxmm=this.getPxmmWithRotation(),nextWidth=Math.ceil(width*pxmm),nextHeight=Math.ceil(height*pxmm);return this.size.width===nextWidth&&this.size.height===nextHeight?!0:(this.renderer.rootElement.style.width=nextWidth+`px`,this.renderer.rootElement.style.height=nextHeight+`px`,this.size={width:nextWidth,height:nextHeight},!0)}updatePosition(){if(!this.wrapper)return;let y=getAttachedY(this.five,this.floorIndex,this.state.config.attachedTo),modelPosition=this.five.modelScene.boundingBox.getCenter(new THREE.Vector3);modelPosition.y=y;let ndcPosition=modelPosition.clone().project(this.five.camera),left=(ndcPosition.x+1)/2,top=-(ndcPosition.y-1)/2;this.renderer.rootElement.style.position=`absolute`,this.renderer.rootElement.style.left=left*100+`%`,this.renderer.rootElement.style.top=top*100+`%`,this.renderer.rootElement.style.transform=`translate(-50%, -50%)`}getPxmmWithRotation(){if(!this.wrapper)return 0;let options={attachedTo:this.state.config.attachedTo};return getPxmm(this.five,this.wrapper,this.floorIndex,options)}updateState(state,userAction){let prevState=this.state,config=state.config?Object.assign(Object.assign({},prevState.config),state.config):prevState.config;this.state=Object.assign(Object.assign(Object.assign({},this.state),state),{config}),!equal(this.state,prevState,{deep:!0})&&this.hooks.emit(`stateChange`,{state:this.state,prevState,userAction})}initContainer(){this.renderer.rootElement.classList.add(`floorplan-plugin`)}registerExtraElement(){var _a;(_a=this.removeExtraElement)==null||_a.call(this),this.removeExtraElement=this.five.addExtraElement(this.renderer.rootElement)}observeResize(wrapper){var _a;(_a=this.resizeObserver)==null||_a.disconnect(),this.resizeObserver=new ResizeObserver(()=>{this.scheduleResizeUpdate()}),this.resizeObserver.observe(wrapper)}scheduleResizeUpdate(){this.pendingResizeFrame===void 0&&(this.pendingResizeFrame=requestAnimationFrame(()=>{this.pendingResizeFrame=void 0,this.updateSize(),this.updatePosition(),this.data&&this.renderer.updateLabelsVisibility(this.data,this.floorIndex,this.state.config.adaptiveRoomLabelVisibleEnable)}))}renderCurrent(){this.data&&this.renderer.render({visible:this.state.visible,duration:0,panoIndex:this.panoIndex,floorIndex:this.floorIndex,floorplanData:this.data,lastPanoramaLongitude:this.lastPanoramaLongitude,config:this.state.config,highlightData:this.highlightData,store:this.store,onRoomHover:this.onRoomHover})}addEventListener(){if(!this.state.enabled||this.hasAddedEventListener)return;this.hasAddedEventListener=!0;let five=this.five;five.on(`modeChange`,this.onFiveModeChange),five.on(`interiaPan`,this.onFiveInertiaPan),five.on(`panoArrived`,this.onFivePanoArrived),five.on(`cameraUpdate`,this.onFiveCameraUpdate),five.on(`wantsPanGesture`,this.onFiveWantsPanGesture),five.on(`wantsTapGesture`,this.onFiveWantsTapGesture),five.on(`wantsChangeMode`,this.onFiveWantsChangeMode),five.on(`modelShownFloorChange`,this.onModelShownFloorChange)}removeEventListener(){this.hasAddedEventListener=!1;let five=this.five;five.off(`modeChange`,this.onFiveModeChange),five.off(`interiaPan`,this.onFiveInertiaPan),five.off(`panoArrived`,this.onFivePanoArrived),five.off(`cameraUpdate`,this.onFiveCameraUpdate),five.off(`wantsPanGesture`,this.onFiveWantsPanGesture),five.off(`wantsTapGesture`,this.onFiveWantsTapGesture),five.off(`wantsChangeMode`,this.onFiveWantsChangeMode),five.off(`modelShownFloorChange`,this.onModelShownFloorChange)}scheduleCameraUpdate(){this.pendingCameraUpdateFrame===void 0&&(this.pendingCameraUpdateFrame=requestAnimationFrame(()=>{this.pendingCameraUpdateFrame=void 0,this.updatePosition(),this.updateSize()}))}getRelativePose(pose){let baseLongitude=this.showState.longitude||0,normalizedLongitude=((pose.longitude-baseLongitude)%(2*Math.PI)+2*Math.PI)%(2*Math.PI);return{latitude:pose.latitude,longitude:normalizedLongitude}}_enable(options){this.styleSheet.disabled=!1,this.addEventListener(),this.wrapper&&(this.wrapper.appendChild(this.renderer.rootElement),this.registerExtraElement()),this.hooks.emit(`enable`,{userAction:options.userAction}),this.state.visible&&this._show({userAction:options.userAction})}_disable(options){var _a,_b;this.styleSheet.disabled=!0,(_a=this.showRejection)==null||_a.call(this,`BreakOffByDisable`),this.showPromise=void 0,this.renderer.rootElement.remove(),(_b=this.removeExtraElement)==null||_b.call(this),this.removeExtraElement=void 0,this.removeEventListener(),this.hooks.emit(`disable`,{userAction:options.userAction})}renderWithDuration(duration){this.data&&this.renderer.render({visible:this.state.visible,duration,panoIndex:this.panoIndex,floorIndex:this.floorIndex,floorplanData:this.data,lastPanoramaLongitude:this.lastPanoramaLongitude,config:this.state.config,highlightData:this.highlightData,store:this.store,onRoomHover:this.onRoomHover})}};export{Controller};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @license
|
|
3
3
|
* @realsee/five-webgpu
|
|
4
|
-
* Generated: 2026/
|
|
5
|
-
* Version: 1.0.0-alpha.
|
|
4
|
+
* Generated: 2026/11/4
|
|
5
|
+
* Version: 1.0.0-alpha.15
|
|
6
6
|
* License:
|
|
7
7
|
* Realsee SDK License Agreement
|
|
8
8
|
|
|
@@ -335,4 +335,4 @@
|
|
|
335
335
|
* writing and signed by Realsee. You and Realsee hereto confirm that this
|
|
336
336
|
* Agreement and all related documents shall be drafted in English.
|
|
337
337
|
|
|
338
|
-
*/const
|
|
338
|
+
*/const require_Controller=require("./Controller.js"),require_formatFloorplanJson=require("./utils/formatFloorplanJson.js");var FloorplanPlugin=(five,params)=>new require_Controller.Controller(five,params);exports.FloorplanPlugin=FloorplanPlugin,exports.formatFloorplanJson=require_formatFloorplanJson.default;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @license
|
|
3
3
|
* @realsee/five-webgpu
|
|
4
|
-
* Generated: 2026/
|
|
5
|
-
* Version: 1.0.0-alpha.
|
|
4
|
+
* Generated: 2026/11/4
|
|
5
|
+
* Version: 1.0.0-alpha.15
|
|
6
6
|
* License:
|
|
7
7
|
* Realsee SDK License Agreement
|
|
8
8
|
|
|
@@ -335,4 +335,4 @@
|
|
|
335
335
|
* writing and signed by Realsee. You and Realsee hereto confirm that this
|
|
336
336
|
* Agreement and all related documents shall be drafted in English.
|
|
337
337
|
|
|
338
|
-
*/import{Controller
|
|
338
|
+
*/import{Controller}from"./Controller.mjs";import formatFloorplanJson from"./utils/formatFloorplanJson.mjs";var FloorplanPlugin=(five,params)=>new Controller(five,params);export{FloorplanPlugin,formatFloorplanJson};
|