@realsee/five 6.0.0-alpha.1 → 6.0.0-alpha.100
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/README.md +58 -1
- package/TERMS.txt +0 -2
- package/docs/assets/highlight.css +20 -20
- package/docs/assets/main.js +59 -52
- package/docs/assets/navigation.js +1 -0
- package/docs/assets/search.js +1 -1
- package/docs/assets/style.css +805 -825
- package/docs/classes/five.AnimationFrameLoop.html +16 -15
- package/docs/classes/five.BoxBoundingVolume.html +19 -1
- package/docs/classes/five.Camera.html +38 -11
- package/docs/classes/five.CullingVolume.html +13 -1
- package/docs/classes/five.Fetcher.html +5 -0
- package/docs/classes/five.Five.html +235 -284
- package/docs/classes/five.InternalWebGLRenderer.html +2 -1
- package/docs/classes/five.IntersectMesh.html +4 -1
- package/docs/classes/five.Model.html +69 -57
- package/docs/classes/five.ModelViewLayer.html +18 -0
- package/docs/classes/five.NetworkAbortError.html +2 -0
- package/docs/classes/five.NetworkFirbiddenError.html +2 -0
- package/docs/classes/five.NetworkResponseError.html +3 -0
- package/docs/classes/five.NetworkSubscribe.html +42 -56
- package/docs/classes/five.NetworkTimeoutError.html +2 -0
- package/docs/classes/five.PBMContainer.html +12 -13
- package/docs/classes/five.PBMGroup.html +3 -3
- package/docs/classes/five.PBMMesh.html +4 -5
- package/docs/classes/five.PBMMeshMaterial.html +50 -41
- package/docs/classes/five.PanoCircleMesh.html +30 -7
- package/docs/classes/five.PanoCircleMeshCustom.html +30 -7
- package/docs/classes/five.PanoCircleMeshSolid.html +30 -7
- package/docs/classes/five.RegionBoundingVolume.html +22 -1
- package/docs/classes/five.RequestScheduler.html +13 -12
- package/docs/classes/five.Scene.html +5 -3
- package/docs/classes/five.SphereBoundingVolume.html +18 -1
- package/docs/classes/five.Subscribe.html +43 -62
- package/docs/classes/five.TextureLoader.html +5 -1
- package/docs/classes/five.Tile.html +30 -1
- package/docs/classes/five.Tile3DModel.html +45 -1
- package/docs/classes/five.TileCubeTextureTarget.html +9 -1
- package/docs/classes/five.TileNode.html +5 -1
- package/docs/classes/five.Tileset.html +33 -5
- package/docs/classes/five.TilesetCache.html +8 -1
- package/docs/classes/five.TilesetTraverser.html +19 -1
- package/docs/classes/five.Work.html +33 -28
- package/docs/classes/five.XRButton.html +3 -1
- package/docs/classes/gltf_loader.DDSLoader.html +3 -1
- package/docs/classes/gltf_loader.DRACOLoader.html +8 -1
- package/docs/classes/gltf_loader.GLTFLoader.html +18 -17
- package/docs/classes/gltf_loader.GLTFObject.html +8 -6
- package/docs/classes/gltf_loader.GLTFParser.html +6 -1
- package/docs/classes/gltf_loader.THREEGLTFLoader.html +8 -1
- package/docs/classes/line.Line.html +10 -1
- package/docs/classes/line.LineGeometry.html +14 -1
- package/docs/classes/line.LineMaterial.html +8 -1
- package/docs/classes/line.LineSegmentsGeometry.html +12 -1
- package/docs/classes/line.THREE_Line2.html +4 -1
- package/docs/classes/line.THREE_LineSegments2.html +4 -1
- package/docs/classes/plugins.BasePlugin.Controller.html +38 -0
- package/docs/classes/plugins.ItemMaskController.html +37 -0
- package/docs/classes/react.Store.html +23 -29
- package/docs/classes/sticker.Sticker.html +25 -32
- package/docs/classes/vfx.Airflow.html +8 -1
- package/docs/classes/vfx.Flame.html +10 -1
- package/docs/classes/vfx.Particle.html +79 -82
- package/docs/classes/vfx.SpotLight.html +7 -1
- package/docs/enums/five.VolumePlaneIntersect.html +4 -1
- package/docs/functions/five.defaultImageURLTransform.html +5 -0
- package/docs/functions/five.getViewportScale.html +1 -0
- package/docs/functions/five.imageSupport.html +1 -0
- package/docs/functions/five.isPanoId.html +1 -0
- package/docs/functions/five.loadAt3d.html +1 -0
- package/docs/functions/five.loadB3dm.html +1 -0
- package/docs/functions/five.loadDome.html +1 -0
- package/docs/functions/five.loadDomez.html +1 -0
- package/docs/functions/five.loadPbm.html +1 -0
- package/docs/functions/five.loadPnts.html +1 -0
- package/docs/functions/five.panoEqual.html +1 -0
- package/docs/functions/five.panoParse.html +1 -0
- package/docs/functions/five.panoStringify.html +1 -0
- package/docs/functions/five.parseWork.html +7 -0
- package/docs/functions/plugins.ItemMaskPlugin.html +1 -0
- package/docs/functions/react.FiveCanvas-1.html +6 -0
- package/docs/functions/react.createFiveFeature.html +1 -0
- package/docs/functions/react.createFiveProvider.html +9 -0
- package/docs/functions/react.createStore.html +15 -0
- package/docs/functions/react.unsafe__useFiveInstance.html +5 -0
- package/docs/functions/react.useFiveAction.html +19 -0
- package/docs/functions/react.useFiveCameraDirection.html +3 -0
- package/docs/functions/react.useFiveCameraRaycaster.html +3 -0
- package/docs/functions/react.useFiveCurrentObserver.html +5 -0
- package/docs/functions/react.useFiveCurrentState.html +5 -0
- package/docs/functions/react.useFiveEventCallback.html +5 -0
- package/docs/functions/react.useFiveFloor.html +5 -0
- package/docs/functions/react.useFiveHelper.html +5 -0
- package/docs/functions/react.useFiveModelIntersectRaycaster.html +7 -0
- package/docs/functions/react.useFiveModelReadyState.html +4 -0
- package/docs/functions/react.useFiveProject2d.html +7 -0
- package/docs/functions/react.useFiveScene.html +2 -0
- package/docs/functions/react.useFiveSceneEffect.html +5 -0
- package/docs/functions/react.useFiveState.html +1 -0
- package/docs/functions/react.useFiveWork.html +8 -0
- package/docs/functions/react.withFive.html +1 -0
- package/docs/functions/vue.unsafe__useFiveInject.html +5 -0
- package/docs/functions/vue.useFiveAction.html +25 -0
- package/docs/functions/vue.useFiveCameraDirection.html +3 -0
- package/docs/functions/vue.useFiveCameraRaycaster.html +3 -0
- package/docs/functions/vue.useFiveCurrentObserver.html +5 -0
- package/docs/functions/vue.useFiveCurrentState.html +5 -0
- package/docs/functions/vue.useFiveEventCallback.html +5 -0
- package/docs/functions/vue.useFiveFloor.html +5 -0
- package/docs/functions/vue.useFiveHelper.html +5 -0
- package/docs/functions/vue.useFiveModel.html +2 -0
- package/docs/functions/vue.useFiveModelBounding.html +2 -0
- package/docs/functions/vue.useFiveModelIntersectRaycaster.html +7 -0
- package/docs/functions/vue.useFiveModelReadyState.html +4 -0
- package/docs/functions/vue.useFiveProject2d.html +7 -0
- package/docs/functions/vue.useFiveScene.html +2 -0
- package/docs/functions/vue.useFiveState.html +5 -0
- package/docs/functions/vue.useFiveWorks.html +8 -0
- package/docs/index.html +81 -79
- package/docs/interfaces/five.AddableObject.html +9 -9
- package/docs/interfaces/five.AjaxOptions.html +11 -0
- package/docs/interfaces/five.AnimationFrame.html +5 -1
- package/docs/interfaces/five.BaseEvent.html +5 -0
- package/docs/interfaces/five.BoundingVolume.html +15 -1
- package/docs/interfaces/five.CameraPose.html +6 -1
- package/docs/interfaces/five.ClipperParameter.html +3 -1
- package/docs/interfaces/five.EventCallback.html +355 -358
- package/docs/interfaces/five.FiveInitArgs.html +80 -86
- package/docs/interfaces/five.FiveLoadOptions.html +36 -0
- package/docs/interfaces/five.FloorplanControllerCustomInitArgs.html +17 -15
- package/docs/interfaces/five.GestureEvent.html +19 -0
- package/docs/interfaces/five.ImageOptions.html +16 -18
- package/docs/interfaces/five.ImageURLMappings.html +1 -1
- package/docs/interfaces/five.ImageURLOptions.html +15 -15
- package/docs/interfaces/five.IntersectEvent.html +8 -0
- package/docs/interfaces/five.IntersectMeshInterface.html +3 -3
- package/docs/interfaces/five.Intersection.html +5 -7
- package/docs/interfaces/five.MapviewControllerCustomInitArgs.html +15 -11
- package/docs/interfaces/five.ModeChangeEvent.html +9 -0
- package/docs/interfaces/five.ModelControllerCustomInitArgs.html +18 -18
- package/docs/interfaces/five.ModelEvent.html +8 -0
- package/docs/interfaces/five.ModelsEvent.html +6 -0
- package/docs/interfaces/five.MotionKeyframe.html +4 -1
- package/docs/interfaces/five.MovePanoOptions.html +24 -33
- package/docs/interfaces/five.NetworkOptions.html +9 -9
- package/docs/interfaces/five.NetworkResourceEvent.html +9 -0
- package/docs/interfaces/five.ObjectEvent.html +6 -0
- package/docs/interfaces/five.PBMPanoPicture.html +9 -7
- package/docs/interfaces/five.PBMParameters.html +42 -39
- package/docs/interfaces/five.PanoCircleMeshCustomOptions.html +9 -1
- package/docs/interfaces/five.PanoCircleMeshInterface.html +21 -10
- package/docs/interfaces/five.PanoCircleMeshOptions.html +3 -1
- package/docs/interfaces/five.PanoCircleMeshSolidOptions.html +3 -1
- package/docs/interfaces/five.PanoEvent.html +11 -0
- package/docs/interfaces/five.PanoTextureEvent.html +9 -0
- package/docs/interfaces/five.PanoramaControllerCustomInitArgs.html +32 -32
- package/docs/interfaces/five.PanoramaLikeControllerCustomInitArgs.html +18 -18
- package/docs/interfaces/five.Pose.html +15 -32
- package/docs/interfaces/five.RenderEvent.html +7 -0
- package/docs/interfaces/five.Scissor.html +11 -12
- package/docs/interfaces/five.State.html +20 -21
- package/docs/interfaces/five.StateEvent.html +7 -0
- package/docs/interfaces/five.SubscribeMixinType.emit.html +1 -1
- package/docs/interfaces/five.SubscribeMixinType.hasListener.html +1 -1
- package/docs/interfaces/five.SubscribeMixinType.off.html +1 -1
- package/docs/interfaces/five.SubscribeMixinType.on.html +1 -1
- package/docs/interfaces/five.SubscribeMixinType.once.html +1 -1
- package/docs/interfaces/five.SubscribeMixinType.waitUnitl.html +1 -1
- package/docs/interfaces/five.TextureOptions.html +18 -20
- package/docs/interfaces/five.Tile3DModelLoaderOptions.html +12 -3
- package/docs/interfaces/five.TileCubeNode.html +7 -1
- package/docs/interfaces/five.TileCubeTree.html +2 -1
- package/docs/interfaces/five.TileHeader.html +9 -1
- package/docs/interfaces/five.TilesetHeader.html +6 -1
- package/docs/interfaces/five.TilesetOptions.html +6 -1
- package/docs/interfaces/five.TopviewControllerCustomInitArgs.html +9 -9
- package/docs/interfaces/five.VRPanoramaControllerCustomInitArgs.html +28 -28
- package/docs/interfaces/five.WebXRAxesParams.html +4 -0
- package/docs/interfaces/five.WebXRControllerParams.html +2 -1
- package/docs/interfaces/five.WorkCubeImage.html +15 -13
- package/docs/interfaces/five.WorkImage.html +20 -21
- package/docs/interfaces/five.WorkInitial.html +17 -17
- package/docs/interfaces/five.WorkModel.html +12 -13
- package/docs/interfaces/five.WorkObserver.html +40 -31
- package/docs/interfaces/five.WorkResolvedObserver.html +41 -0
- package/docs/interfaces/five.WorkTile.html +10 -1
- package/docs/interfaces/five.WorkVideo.html +8 -9
- package/docs/interfaces/five.WorksEvent.html +9 -0
- package/docs/interfaces/five.XRControllerEvent.html +8 -0
- package/docs/interfaces/five.XRGestureEvent.html +11 -0
- package/docs/interfaces/five.XRPanoramaControllerCustomInitArgs.html +28 -28
- package/docs/interfaces/five.XRSessionEvent.html +7 -0
- package/docs/interfaces/gltf_loader.DDS.html +7 -1
- package/docs/interfaces/gltf_loader.GLTF.html +10 -4
- package/docs/interfaces/gltf_loader.GLTFReference.html +3 -1
- package/docs/interfaces/gltf_loader.THREEGLTF.html +8 -1
- package/docs/interfaces/plugins.BasePlugin.BaseOptions.html +3 -0
- package/docs/interfaces/plugins.BasePlugin.Config.html +5 -0
- package/docs/interfaces/plugins.BasePlugin.State.html +8 -0
- package/docs/interfaces/plugins.ItemMaskPluginType.Config.html +2 -0
- package/docs/interfaces/plugins.ItemMaskPluginType.EventMap.html +10 -0
- package/docs/interfaces/plugins.ItemMaskPluginType.ItemType.html +13 -0
- package/docs/interfaces/plugins.ItemMaskPluginType.MaskType.html +4 -0
- package/docs/interfaces/plugins.ItemMaskPluginType.Params.html +4 -0
- package/docs/interfaces/plugins.ItemMaskPluginType.State.html +14 -0
- package/docs/interfaces/react.FiveActionReactCallbacks.html +27 -39
- package/docs/interfaces/react.FiveInjectionTypes.html +112 -143
- package/docs/interfaces/react.PropTypeOfFiveFeatures.html +2 -1
- package/docs/interfaces/sticker.IntersectionLike.html +7 -8
- package/docs/interfaces/vfx.ParticleArgs.html +67 -68
- package/docs/interfaces/vfx.ParticleTweenKeyframe.html +3 -1
- package/docs/interfaces/vue.FiveActionVueCallbacks.html +31 -42
- package/docs/modules/five.SubscribeMixinType.html +7 -1
- package/docs/modules/five.html +170 -481
- package/docs/modules/gltf_loader.html +11 -1
- package/docs/modules/line.html +8 -1
- package/docs/modules/plugins.BasePlugin.html +6 -0
- package/docs/modules/plugins.ItemMaskPluginType.html +9 -0
- package/docs/modules/plugins.html +5 -0
- package/docs/modules/react.FiveCanvas.html +8 -0
- package/docs/modules/react.html +37 -130
- package/docs/modules/sticker.html +3 -1
- package/docs/modules/vfx.html +8 -1
- package/docs/modules/vue.html +24 -115
- package/docs/types/five.AjaxResponseType.html +1 -0
- package/docs/types/five.AjaxResponseTypeMapping.html +1 -0
- package/docs/types/five.BoundingVolumeJson.html +1 -0
- package/docs/types/five.BoxBoundingVolumeJson.html +1 -0
- package/docs/types/five.ControllerCustomInitTypes.html +1 -0
- package/docs/types/five.ControllerEventTypes.html +32 -0
- package/docs/types/five.EventTypes.html +26 -0
- package/docs/types/five.FivePlugin.html +71 -0
- package/docs/types/five.FivePluginInit.html +3 -0
- package/docs/types/five.FivePluginInstance.html +3 -0
- package/docs/types/five.GestureTypes.html +1 -0
- package/docs/types/five.LegacyEventType.html +203 -0
- package/docs/types/five.LooseWork.html +1 -0
- package/docs/types/five.LooseWorkInitial.html +1 -0
- package/docs/types/five.LooseWorkModel.html +1 -0
- package/docs/types/five.LooseWorkObserver.html +1 -0
- package/docs/types/five.LooseWorkPanorama.html +1 -0
- package/docs/types/five.LooseWorkVideo.html +1 -0
- package/docs/types/five.LooseWorkWithExtrinsics.html +2 -0
- package/docs/types/five.Mirror.html +1 -0
- package/docs/types/five.Mode.html +10 -0
- package/docs/types/five.ModelMaterialValues.html +1 -0
- package/docs/types/five.Models.html +13 -0
- package/docs/types/five.MotionValue.html +1 -0
- package/docs/types/five.MovePanoEffect.html +11 -0
- package/docs/types/five.NetWorkMeta.html +1 -0
- package/docs/types/five.NetworkError.html +1 -0
- package/docs/types/five.NetworkErrorCallback.html +1 -0
- package/docs/types/five.NetworkProgressCallback.html +1 -0
- package/docs/types/five.NetworkResponse.html +1 -0
- package/docs/types/five.NetworkState.html +1 -0
- package/docs/types/five.NetworkSuccessCallback.html +1 -0
- package/docs/types/five.NetworkType.html +1 -0
- package/docs/types/five.Pano.html +1 -0
- package/docs/types/five.PanoId.html +1 -0
- package/docs/types/five.ParseWorkOptions.html +6 -0
- package/docs/types/five.ParsedResultType.html +1 -0
- package/docs/types/five.PostProcessingType.html +1 -0
- package/docs/types/five.RegionBoundingVolumeJson.html +1 -0
- package/docs/types/five.RequestResult.html +1 -0
- package/docs/types/five.SphereBoundingVolumeJson.html +1 -0
- package/docs/types/five.SubscribeEventMap.html +1 -0
- package/docs/types/five.TileContentData.html +1 -0
- package/docs/types/five.TilesetFrameState.html +1 -0
- package/docs/types/five.WebXRControllerKey.html +1 -0
- package/docs/types/five.WebXRControllerType.html +1 -0
- package/docs/types/five.Works.html +1 -0
- package/docs/types/line.LineMaterialParameters.html +1 -0
- package/docs/types/plugins.BasePlugin.EventMap.html +6 -0
- package/docs/types/plugins.ItemMaskPluginType.PluginData.html +1 -0
- package/docs/types/plugins.ItemMaskPluginType.ServerData.html +1 -0
- package/docs/types/react.FiveInjectionActionFeature.html +1 -0
- package/docs/types/react.FiveInjectionDataFeature.html +1 -0
- package/docs/types/react.FiveInjectionFeature.html +1 -0
- package/docs/types/react.FiveProviderPropTypes.html +1 -0
- package/docs/types/react.FiveProviderType.html +1 -0
- package/docs/types/react.StoreActionMapHanlder.html +1 -0
- package/docs/types/react.StoreActionMapType.html +1 -0
- package/docs/types/react.StoreProviderType.html +1 -0
- package/docs/types/react.StoreValueMapType.html +1 -0
- package/docs/types/vfx.ParticleType.html +1 -0
- package/docs/types/vue.FiveModelIntersectRaycaster.html +1 -0
- package/docs/types/vue.FiveProviderComponent.html +1 -0
- package/docs/types/vue.Project2d.html +1 -0
- package/docs/variables/five.PROXY_CONTROLLER_EVENT_NAMES.html +1 -0
- package/docs/variables/five.defaultPbmParameters.html +1 -0
- package/docs/variables/react.INJECTION_PROPNAME.html +1 -0
- package/docs/variables/vue.FiveCanvas.html +8 -0
- package/docs/variables/vue.FiveProvider.html +8 -0
- package/five/index.d.ts +1775 -1260
- package/five/index.js +1879 -218
- package/five/index.mjs +23248 -0
- package/gltf-loader/index.js +204 -203
- package/gltf-loader/index.mjs +1708 -0
- package/line/index.js +396 -202
- package/line/index.mjs +776 -0
- package/package.json +48 -12
- package/plugins/index.d.ts +253 -0
- package/plugins/index.js +350 -0
- package/plugins/index.mjs +796 -0
- package/react/index.d.ts +41 -47
- package/react/index.js +198 -203
- package/react/index.mjs +1072 -0
- package/scripts/five-staticify.js +183 -2
- package/sticker/index.js +198 -203
- package/sticker/index.mjs +399 -0
- package/umd/five-gltf-loader.js +261 -1
- package/umd/five-line.js +454 -1
- package/umd/five-plugins.js +350 -0
- package/umd/five-react.js +255 -1
- package/umd/five-sticker.js +255 -1
- package/umd/five-vfx.js +539 -1
- package/umd/five-vue.js +255 -1
- package/umd/five.js +2023 -2
- package/vfx/index.js +481 -202
- package/vfx/index.mjs +1032 -0
- package/vue/index.d.ts +5 -4
- package/vue/index.js +198 -203
- package/vue/index.mjs +574 -0
- package/docs/assets/icons.css +0 -1043
- package/docs/assets/icons.png +0 -0
- package/docs/assets/icons@2x.png +0 -0
- package/docs/assets/widgets.png +0 -0
- package/docs/assets/widgets@2x.png +0 -0
- package/docs/classes/five.BVH.html +0 -10
- package/docs/classes/five.BVHIntersect.html +0 -1
- package/docs/classes/five.BVHNode.html +0 -7
- package/docs/classes/five.BVHVector3.html +0 -1
- package/docs/classes/five.Clipper.html +0 -1
- package/docs/classes/five.PBMMaterialReferenceCache.html +0 -1
- package/docs/enums/five.PBMPointColorType.html +0 -1
- package/docs/enums/five.PBMPointShapeType.html +0 -1
- package/docs/enums/five.PBMPointSizeType.html +0 -1
- package/docs/interfaces/five.DepthPanoramaControllerCustomInitArgs.html +0 -26
- package/docs/interfaces/five.ModelLodOptions.html +0 -1
- package/docs/interfaces/five.WorkOptions.html +0 -15
- package/docs/modules.html +0 -1
- package/exporters/staticify.js +0 -210
- package/scripts/five-plugin-init.js +0 -83
- package/scripts/five-quick-start-init.js +0 -80
- package/scripts/five-react-component-init.js +0 -83
- package/templates/plugin/README.md +0 -38
- package/templates/plugin/devtools/external-five.js +0 -5
- package/templates/plugin/devtools/external-three.js +0 -5
- package/templates/plugin/devtools/tsconfig.build.json +0 -18
- package/templates/plugin/devtools/webpack.bundle.js +0 -44
- package/templates/plugin/devtools/webpack.example.js +0 -39
- package/templates/plugin/docs/.gitkeep +0 -0
- package/templates/plugin/examples/data.json +0 -507
- package/templates/plugin/examples/index.html +0 -28
- package/templates/plugin/examples/index.ts +0 -12
- package/templates/plugin/lib/index.ts +0 -30
- package/templates/plugin/package.json +0 -32
- package/templates/plugin/tsconfig.json +0 -26
- package/templates/quick-start/README.md +0 -47
- package/templates/quick-start/assets/work.json +0 -507
- package/templates/quick-start/index.html +0 -54
- package/templates/quick-start/index.tsx +0 -123
- package/templates/quick-start/package.json +0 -25
- package/templates/quick-start/tsconfig.json +0 -27
- package/templates/quick-start/webpack.config.js +0 -45
- package/templates/quick-start/webpack.production.js +0 -42
- package/templates/react-component/README.md +0 -32
- package/templates/react-component/devtools/external-five.js +0 -5
- package/templates/react-component/devtools/external-react.js +0 -5
- package/templates/react-component/devtools/external-three.js +0 -5
- package/templates/react-component/devtools/tsconfig.build.json +0 -19
- package/templates/react-component/devtools/webpack.bundle.js +0 -44
- package/templates/react-component/devtools/webpack.example.js +0 -39
- package/templates/react-component/docs/.gitkeep +0 -0
- package/templates/react-component/examples/data.json +0 -507
- package/templates/react-component/examples/index.html +0 -17
- package/templates/react-component/examples/index.tsx +0 -62
- package/templates/react-component/lib/index.tsx +0 -157
- package/templates/react-component/package.json +0 -38
- package/templates/react-component/tsconfig.json +0 -27
- package/umd/five-gltf-loader.js.LICENSE.txt +0 -14
- package/umd/five-line.js.LICENSE.txt +0 -14
- package/umd/five-react.js.LICENSE.txt +0 -14
- package/umd/five-sticker.js.LICENSE.txt +0 -14
- package/umd/five.js.LICENSE.txt +0 -100
package/five/index.d.ts
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
/// <reference types="webxr" />
|
|
2
|
+
|
|
1
3
|
import * as THREE_2 from 'three';
|
|
2
4
|
|
|
3
5
|
export declare interface AddableObject extends THREE_2.Object3D {
|
|
@@ -11,6 +13,15 @@ export declare interface AddableObject extends THREE_2.Object3D {
|
|
|
11
13
|
setTime?(time: number): void;
|
|
12
14
|
}
|
|
13
15
|
|
|
16
|
+
export declare interface AjaxOptions<T extends AjaxResponseType = AjaxResponseType> extends NetworkOptions {
|
|
17
|
+
/** 数据返回类型 */
|
|
18
|
+
responseType?: T;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export declare type AjaxResponseType = "arraybuffer" | "blob" | "text";
|
|
22
|
+
|
|
23
|
+
export declare type AjaxResponseTypeMapping<K extends AjaxResponseType> = K extends "arraybuffer" ? ArrayBuffer : K extends "blob" ? Blob : K extends "text" ? string : never;
|
|
24
|
+
|
|
14
25
|
export declare interface AnimationFrame {
|
|
15
26
|
callback: (time: number, deltaTime: number, ...args: any[]) => void;
|
|
16
27
|
once: boolean;
|
|
@@ -46,16 +57,24 @@ export declare class AnimationFrameLoop {
|
|
|
46
57
|
disponse(): void;
|
|
47
58
|
}
|
|
48
59
|
|
|
60
|
+
export declare interface BaseEvent {
|
|
61
|
+
type: string;
|
|
62
|
+
timeStamp: number;
|
|
63
|
+
preventDefault(): void;
|
|
64
|
+
defaultPrevented: boolean;
|
|
65
|
+
}
|
|
66
|
+
|
|
49
67
|
export declare interface BoundingVolume {
|
|
50
68
|
type: 'box' | 'sphere' | 'regin';
|
|
51
69
|
applyMatrix4(matrix: THREE_2.Matrix4): this;
|
|
52
70
|
getBoundingBox(target: THREE_2.Box3): THREE_2.Box3;
|
|
53
71
|
toGeometry(): THREE_2.BufferGeometry;
|
|
54
72
|
getCenter(result: THREE_2.Vector3): THREE_2.Vector3;
|
|
55
|
-
|
|
56
|
-
|
|
73
|
+
distanceSquaredToPoint(point: THREE_2.Vector3): number;
|
|
74
|
+
distanceToPoint(point: THREE_2.Vector3): number;
|
|
75
|
+
distanceToPlane(plane: THREE_2.Plane): number;
|
|
57
76
|
intersectPlane(plane: THREE_2.Plane): VolumePlaneIntersect;
|
|
58
|
-
intersectRay(ray: THREE_2.Ray): boolean;
|
|
77
|
+
intersectRay(ray: THREE_2.Ray, far?: number): boolean;
|
|
59
78
|
clone(): BoundingVolume;
|
|
60
79
|
copy(boundingVolume: this): this;
|
|
61
80
|
fromJson(json: any): this;
|
|
@@ -76,75 +95,19 @@ export declare class BoxBoundingVolume implements BoundingVolume {
|
|
|
76
95
|
clone(): BoxBoundingVolume;
|
|
77
96
|
applyMatrix4(matrix: THREE_2.Matrix4): this;
|
|
78
97
|
getCenter(result: THREE_2.Vector3): THREE_2.Vector3;
|
|
79
|
-
|
|
80
|
-
|
|
98
|
+
distanceSquaredToPoint(point: THREE_2.Vector3): number;
|
|
99
|
+
distanceToPoint(point: THREE_2.Vector3): number;
|
|
100
|
+
distanceToPlane(plane: THREE_2.Plane): number;
|
|
81
101
|
getBoundingBox(target: THREE_2.Box3): THREE_2.Box3;
|
|
82
102
|
toGeometry(): THREE_2.BufferGeometry;
|
|
83
103
|
intersectPlane(plane: THREE_2.Plane): VolumePlaneIntersect;
|
|
84
|
-
intersectRay(ray: THREE_2.Ray): boolean;
|
|
104
|
+
intersectRay(ray: THREE_2.Ray, far?: number): boolean;
|
|
85
105
|
}
|
|
86
106
|
|
|
87
107
|
export declare type BoxBoundingVolumeJson = {
|
|
88
108
|
box: number[];
|
|
89
109
|
};
|
|
90
110
|
|
|
91
|
-
export declare class BVH {
|
|
92
|
-
trianglesArray?: Float32Array;
|
|
93
|
-
offsetArray?: Uint32Array;
|
|
94
|
-
rootNode?: BVHNode;
|
|
95
|
-
create(trianglesArray: Float32Array): this;
|
|
96
|
-
splitNode(maxTrianglesPerNode: number): this;
|
|
97
|
-
/**
|
|
98
|
-
* 计算射线与三角形的碰撞
|
|
99
|
-
* @param rayOrigin - 射线的原点坐标
|
|
100
|
-
* @param rayDirection - 设想的方向向量
|
|
101
|
-
* @param backfaceCulling - 是否背面剔除
|
|
102
|
-
* @return 碰撞焦点数组
|
|
103
|
-
*/
|
|
104
|
-
intersectRay(rayOrigin: BVHVector3, rayDirection: BVHVector3, backfaceCulling: boolean): BVHIntersect[];
|
|
105
|
-
trianglesInSphere(center: BVHVector3, radius: number): Float32Array;
|
|
106
|
-
dispose(): void;
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
export declare class BVHIntersect {
|
|
110
|
-
triangle: [BVHVector3, BVHVector3, BVHVector3];
|
|
111
|
-
intersectionPoint: BVHVector3;
|
|
112
|
-
constructor(triangle: [BVHVector3, BVHVector3, BVHVector3], intersectionPoint: BVHVector3);
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
/**
|
|
116
|
-
* A node in the BVH structure
|
|
117
|
-
* @param extents - the min coords of this node's bounding box
|
|
118
|
-
* @param startIndex - an index in the bbox array, where the first element of this node is located
|
|
119
|
-
* @param endIndex - an index in the bbox array, where the last of this node is located, plus 1 (meaning that its non-inclusive).
|
|
120
|
-
* @param level - distance of this node from the root for the bvh tree. root node has level=0, its children have level=1 etc.
|
|
121
|
-
*/
|
|
122
|
-
export declare class BVHNode {
|
|
123
|
-
extents: ArrayLike<number>;
|
|
124
|
-
startIndex: number;
|
|
125
|
-
endIndex: number;
|
|
126
|
-
node0?: BVHNode;
|
|
127
|
-
node1?: BVHNode;
|
|
128
|
-
constructor(extents: ArrayLike<number>, startIndex: number, endIndex: number);
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
export declare class BVHVector3 {
|
|
132
|
-
x: number;
|
|
133
|
-
y: number;
|
|
134
|
-
z: number;
|
|
135
|
-
constructor(x: number, y: number, z: number);
|
|
136
|
-
copy(v: BVHVector3): this;
|
|
137
|
-
set(x: number, y: number, z: number): this;
|
|
138
|
-
fromArray(array: number[], firstElementPos?: number): this;
|
|
139
|
-
add(v: BVHVector3): this;
|
|
140
|
-
multiplyScalar(scalar: number): this;
|
|
141
|
-
subVectors(a: BVHVector3, b: BVHVector3): this;
|
|
142
|
-
dot(v: BVHVector3): number;
|
|
143
|
-
cross(v: BVHVector3): this;
|
|
144
|
-
crossVectors(a: BVHVector3, b: BVHVector3): this;
|
|
145
|
-
clone(): BVHVector3;
|
|
146
|
-
}
|
|
147
|
-
|
|
148
111
|
/** Five 相机 */
|
|
149
112
|
export declare class Camera extends THREE_2.Camera {
|
|
150
113
|
fov: number;
|
|
@@ -152,14 +115,17 @@ export declare class Camera extends THREE_2.Camera {
|
|
|
152
115
|
near: number;
|
|
153
116
|
far: number;
|
|
154
117
|
perspToOrtho: THREE_2.Vector2;
|
|
155
|
-
|
|
118
|
+
resolution: THREE_2.Vector2;
|
|
119
|
+
pixelRatio: number;
|
|
156
120
|
/** 相机姿态 */
|
|
157
121
|
pose: CameraPose;
|
|
158
122
|
private perspectiveCamera;
|
|
159
123
|
private orthographicCamera;
|
|
160
124
|
needsRender: boolean;
|
|
125
|
+
refineModel: boolean;
|
|
161
126
|
private lastValues;
|
|
162
|
-
constructor(fov: number, aspect?: number, near?: number, far?: number, perspToOrtho?: THREE_2.Vector2,
|
|
127
|
+
constructor(fov: number, aspect?: number, near?: number, far?: number, perspToOrtho?: THREE_2.Vector2, resolution?: THREE_2.Vector2, pixelRatio?: number);
|
|
128
|
+
get orthoDistance(): number;
|
|
163
129
|
get zoom(): number;
|
|
164
130
|
get top(): number;
|
|
165
131
|
get bottom(): number;
|
|
@@ -194,17 +160,6 @@ export declare interface CameraPose {
|
|
|
194
160
|
offset: THREE_2.Vector3;
|
|
195
161
|
}
|
|
196
162
|
|
|
197
|
-
export declare class Clipper {
|
|
198
|
-
numPlanes: number;
|
|
199
|
-
clipperPlanes: Float32Array | null;
|
|
200
|
-
clipperFloors: number[] | null;
|
|
201
|
-
private static sharedInstance?;
|
|
202
|
-
static get shared(): Clipper;
|
|
203
|
-
constructor();
|
|
204
|
-
update(clipperParameters: ClipperParameter[], camera: THREE_2.Camera): void;
|
|
205
|
-
private projectPlanes;
|
|
206
|
-
}
|
|
207
|
-
|
|
208
163
|
export declare interface ClipperParameter {
|
|
209
164
|
clippingBoxMatrix: THREE_2.Matrix4;
|
|
210
165
|
floorIndex?: number;
|
|
@@ -216,1218 +171,1456 @@ export declare type ControllerCustomInitTypes = {
|
|
|
216
171
|
Panorama: PanoramaControllerCustomInitArgs;
|
|
217
172
|
VRPanorama: VRPanoramaControllerCustomInitArgs;
|
|
218
173
|
Model: ModelControllerCustomInitArgs;
|
|
219
|
-
DepthPanorama: DepthPanoramaControllerCustomInitArgs;
|
|
220
174
|
Mapview: MapviewControllerCustomInitArgs;
|
|
221
175
|
XRPanorama: XRPanoramaControllerCustomInitArgs;
|
|
222
176
|
};
|
|
223
177
|
|
|
224
178
|
export declare type ControllerEventTypes = {
|
|
179
|
+
/** 手势 滑动屏幕 */
|
|
180
|
+
"gesture.pan"(event: GestureEvent): void;
|
|
181
|
+
/** 手势 点击屏幕 */
|
|
182
|
+
"gesture.tap"(event: GestureEvent): void;
|
|
183
|
+
/** 手势 长按屏幕 */
|
|
184
|
+
"gesture.press"(event: GestureEvent): void;
|
|
185
|
+
/** 手势 双指缩放 */
|
|
186
|
+
"gesture.pinch"(event: GestureEvent): void;
|
|
187
|
+
/** 手势 鼠标滚轮 */
|
|
188
|
+
"gesture.mousewheel"(event: GestureEvent): void;
|
|
189
|
+
/** 手势 鼠标移动 */
|
|
190
|
+
"gesture.mousemove"(event: GestureEvent): void;
|
|
191
|
+
/** 手势 惯性 */
|
|
192
|
+
"gesture.momentum"(event: GestureEvent): void;
|
|
193
|
+
/** 模态切换动画 开始 */
|
|
194
|
+
"initAnimation.start"(event: StateEvent): void;
|
|
195
|
+
/** 模态切换动画 结束 */
|
|
196
|
+
"initAnimation.end"(event: StateEvent): void;
|
|
197
|
+
/** 相机改变 */
|
|
198
|
+
"camera.update"(event: StateEvent): void;
|
|
199
|
+
"intersect.update"(event: IntersectEvent): void;
|
|
200
|
+
/** 选择 */
|
|
201
|
+
"pano.select"(event: PanoEvent): void;
|
|
202
|
+
/** 请求点位 */
|
|
203
|
+
"pano.request"(event: PanoEvent): void;
|
|
204
|
+
/** 运动去点位 */
|
|
205
|
+
"pano.moveTo"(event: PanoEvent): void;
|
|
206
|
+
/** 运动点位过程 */
|
|
207
|
+
"pano.moving"(event: PanoEvent): void;
|
|
208
|
+
/** 运动到达点位 */
|
|
209
|
+
"pano.arrived"(event: PanoEvent): void;
|
|
210
|
+
/** 取消运动点位 */
|
|
211
|
+
"pano.cancel"(event: PanoEvent): void;
|
|
212
|
+
/** 运动点位出错 */
|
|
213
|
+
"pano.error"(event: PanoEvent): void;
|
|
214
|
+
/** 加载全景材质 */
|
|
215
|
+
"pano.texture.load"(event: PanoTextureEvent): void;
|
|
216
|
+
/** 加载全景材质进度 */
|
|
217
|
+
"pano.texture.progress"(event: PanoTextureEvent): void;
|
|
218
|
+
/** 加载全景材质成功 */
|
|
219
|
+
"pano.texture.success"(event: PanoTextureEvent): void;
|
|
220
|
+
/** 加载全景材质失败 */
|
|
221
|
+
"pano.texture.error"(event: PanoTextureEvent): void;
|
|
222
|
+
/** 加载全景材质中止 */
|
|
223
|
+
"pano.texture.abort"(event: PanoTextureEvent): void;
|
|
224
|
+
/** VRPanorama 请求退出 */
|
|
225
|
+
"vr.requestExit"(event: BaseEvent): void;
|
|
226
|
+
/** XR 退出 */
|
|
227
|
+
"xr.session.end"(event: XRSessionEvent_2): void;
|
|
228
|
+
/** XR 进入 */
|
|
229
|
+
"xr.session.start"(event: XRSessionEvent_2): void;
|
|
230
|
+
/** XR 手势(按钮) */
|
|
231
|
+
"xr.gesture.tap"(event: XRGestureEvent): void;
|
|
232
|
+
/** XR 手势(按钮) */
|
|
233
|
+
"xr.gesture.press"(event: XRGestureEvent): void;
|
|
234
|
+
/** XR 手势(按钮) */
|
|
235
|
+
"xr.gesture.buttonUp"(event: XRGestureEvent): void;
|
|
236
|
+
/** XR 手势(按钮) */
|
|
237
|
+
"xr.gesture.buttonDown"(event: XRGestureEvent): void;
|
|
238
|
+
/** XR手柄更新*/
|
|
239
|
+
"xr.controller.update"(event: XRControllerEvent): void;
|
|
240
|
+
/** 抛出错误 */
|
|
241
|
+
"error"(error: Error): void;
|
|
242
|
+
};
|
|
243
|
+
|
|
244
|
+
export declare class CullingVolume {
|
|
245
|
+
static get MASK_OUTSIDE(): number;
|
|
246
|
+
static get MASK_INSIDE(): number;
|
|
247
|
+
static get MASK_INDETERMINATE(): number;
|
|
248
|
+
planes: THREE_2.Plane[];
|
|
249
|
+
constructor(planes?: THREE_2.Plane[]);
|
|
250
|
+
setFromFrustum(frustum: THREE_2.Frustum): this;
|
|
251
|
+
setFromCamera(camera: THREE_2.Camera): this;
|
|
252
|
+
applyMatrix4(matrix: THREE_2.Matrix4): void;
|
|
253
|
+
copy(cullingVolume: CullingVolume): this;
|
|
254
|
+
clone(): CullingVolume;
|
|
255
|
+
computeVisibility(boundingVolume: BoundingVolume): VolumePlaneIntersect;
|
|
256
|
+
computeVisibilityWithPlaneMask(boundingVolume: BoundingVolume, parentPlaneMask: number): number;
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
/**
|
|
260
|
+
* URL 地址的转换
|
|
261
|
+
* @param source - url 原地址
|
|
262
|
+
* @param options - url 转换参数
|
|
263
|
+
* @returns url 转换结果
|
|
264
|
+
*/
|
|
265
|
+
export declare function defaultImageURLTransform(source: string, options: ImageURLOptions): string;
|
|
266
|
+
|
|
267
|
+
export declare const defaultPbmParameters: PBMParameters;
|
|
268
|
+
|
|
269
|
+
/**
|
|
270
|
+
* Five 事件列表
|
|
271
|
+
* @description
|
|
272
|
+
* 可以通过 `five.on(METHOD_NAME, METHOD)` 调用
|
|
273
|
+
*/
|
|
274
|
+
export declare interface EventCallback extends EventTypes {
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
/**
|
|
278
|
+
* Five 事件列表
|
|
279
|
+
* @description
|
|
280
|
+
* 具体事件列表 请查看 {@link EventCallback}
|
|
281
|
+
*/
|
|
282
|
+
export declare type EventTypes = Pick<ControllerEventTypes, typeof PROXY_CONTROLLER_EVENT_NAMES[number]> & LegacyEventType & {
|
|
283
|
+
/** 请求点位 */
|
|
284
|
+
"pano.request"(event: PanoEvent): void;
|
|
285
|
+
/** 内部错误 */
|
|
286
|
+
"error"(error: Error): void;
|
|
287
|
+
/** 请求 work数据 */
|
|
288
|
+
"works.request"(event: WorksEvent): void;
|
|
289
|
+
/** 加载 work */
|
|
290
|
+
"works.load"(event: WorksEvent): void;
|
|
291
|
+
/** 加载 work 并 controller ready */
|
|
292
|
+
"works.ready"(event: WorksEvent): void;
|
|
293
|
+
/** 设置 state */
|
|
294
|
+
"state.set"(event: StateEvent): void;
|
|
295
|
+
/** 当 state 变化 */
|
|
296
|
+
"state.change"(event: StateEvent): void;
|
|
297
|
+
/** 当 state 同步完成 */
|
|
298
|
+
"state.synced"(event: StateEvent): void;
|
|
299
|
+
/** 当前 state 变化 */
|
|
300
|
+
"currentState.change"(event: StateEvent): void;
|
|
301
|
+
/** 当模型加载 */
|
|
302
|
+
"model.request"(event: ModelEvent): void;
|
|
303
|
+
/** 当模型修改楼层 */
|
|
304
|
+
"model.load"(event: ModelEvent): void;
|
|
305
|
+
/** 当模型错误 */
|
|
306
|
+
"model.error"(event: ModelEvent): void;
|
|
307
|
+
/** 当模型修改楼层 */
|
|
308
|
+
"model.changeShownFloor"(event: ModelEvent): void;
|
|
309
|
+
/** 模型加载完成 */
|
|
310
|
+
"models.load"(event: ModelsEvent): void;
|
|
311
|
+
/** 模型细化完成 */
|
|
312
|
+
"models.refined"(event: ModelsEvent): void;
|
|
313
|
+
/** 渲染前 */
|
|
314
|
+
"render.prepare"(event: RenderEvent): void;
|
|
315
|
+
/** 渲染后 */
|
|
316
|
+
"render"(event: RenderEvent): void;
|
|
317
|
+
/** 请求改变 mode */
|
|
318
|
+
"mode.change.request"(event: ModeChangeEvent): void;
|
|
319
|
+
/** 改变 mode */
|
|
320
|
+
"mode.change"(event: ModeChangeEvent): void;
|
|
321
|
+
/** 改变 helpers 元素可见 */
|
|
322
|
+
"helpers.visible"(event: ObjectEvent): void;
|
|
323
|
+
/** 网络资源 */
|
|
324
|
+
"network.resource"(event: NetworkResourceEvent): void;
|
|
325
|
+
/** 当前 fps 变化 */
|
|
326
|
+
"fps"(fps: number): void;
|
|
327
|
+
/** five 被析构。 插件中请监听用于自身析构 */
|
|
328
|
+
"dispose"(): void;
|
|
329
|
+
};
|
|
330
|
+
|
|
331
|
+
export declare class Fetcher {
|
|
332
|
+
private options;
|
|
333
|
+
constructor(options?: NetworkOptions);
|
|
334
|
+
ajax<T extends AjaxResponseType = "text">(source: string, options?: AjaxOptions<T>, onLoad?: NetworkSuccessCallback<AjaxResponseTypeMapping<T>>, onError?: NetworkErrorCallback, onProgress?: NetworkProgressCallback): Promise<NetworkResponse<AjaxResponseTypeMapping<T>>>;
|
|
335
|
+
loadImage<T extends HTMLImageElement = HTMLImageElement>(source: string, options?: NetworkOptions, onLoad?: NetworkSuccessCallback, onError?: NetworkErrorCallback, onProgress?: NetworkProgressCallback, target?: T): Promise<NetworkResponse<T>>;
|
|
336
|
+
preload(source: string, options?: NetworkOptions): Promise<void>;
|
|
337
|
+
}
|
|
338
|
+
|
|
339
|
+
/**
|
|
340
|
+
* 如视 VR Web展示器
|
|
341
|
+
*
|
|
342
|
+
* @example
|
|
343
|
+
* ```
|
|
344
|
+
* // 初始化构造函数
|
|
345
|
+
* const five = new Five();
|
|
346
|
+
* // 将绘制区域添加到页面上
|
|
347
|
+
* five.appendTo(document.body);
|
|
348
|
+
* // 加载 Work 数据
|
|
349
|
+
* five.load({...});
|
|
350
|
+
* ```
|
|
351
|
+
*/
|
|
352
|
+
export declare class Five extends Subscribe<EventTypes> {
|
|
353
|
+
static get version(): string;
|
|
354
|
+
static get dracoPath(): string;
|
|
355
|
+
static set dracoPath(path: string);
|
|
356
|
+
static get ktx2Path(): string;
|
|
357
|
+
static set ktx2Path(path: string);
|
|
225
358
|
/**
|
|
226
|
-
*
|
|
227
|
-
* @
|
|
228
|
-
*
|
|
229
|
-
*
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
*
|
|
234
|
-
*
|
|
235
|
-
*
|
|
236
|
-
* @param userAction - 是否用户触发
|
|
359
|
+
* Five 的显示模式,可以通过 `five.changeMode` `five.setState` 来切换
|
|
360
|
+
* @description
|
|
361
|
+
* ```text
|
|
362
|
+
* Panorama 全景图游走模式
|
|
363
|
+
* Model 模型游走模式
|
|
364
|
+
* Floorplan 模型查看模式
|
|
365
|
+
* Topview 户型图模式
|
|
366
|
+
* VRPanorama VR眼镜模式
|
|
367
|
+
* XRPanorama VR硬件模式
|
|
368
|
+
* ```
|
|
237
369
|
*/
|
|
238
|
-
|
|
370
|
+
static Mode: Mirror<Mode>;
|
|
239
371
|
/**
|
|
240
|
-
* 意图要变化相机的可视角度 可以通过 `return false` 阻止
|
|
241
372
|
* @deprecated
|
|
242
|
-
*
|
|
243
|
-
* @param fov - 意图要变化相机的可视角度
|
|
244
|
-
* @returns 可以通过 `return false` 阻止
|
|
373
|
+
* 请使用 `import { Line } from "@realsee/five/line"` 代替;
|
|
245
374
|
*/
|
|
246
|
-
|
|
375
|
+
static Line: any;
|
|
247
376
|
/**
|
|
248
|
-
*
|
|
249
|
-
* @
|
|
250
|
-
*
|
|
377
|
+
* 自动播放状态是否暂停
|
|
378
|
+
* @description
|
|
379
|
+
* 可以通过 `five.play` `five.pause` 方法播放或暂停
|
|
251
380
|
*/
|
|
252
|
-
|
|
381
|
+
paused: boolean;
|
|
382
|
+
/** 当前点位序号 */
|
|
383
|
+
pano: Pano;
|
|
384
|
+
/** 当前展示的模式 */
|
|
385
|
+
currentMode: Mode;
|
|
386
|
+
/** 内部使用的 `THREE.Scene` */
|
|
387
|
+
scene: Scene;
|
|
388
|
+
/** 供外部放置需要在xr场景下产生遮挡的物体们*/
|
|
389
|
+
xrCustomObjectsScene: THREE_2.Scene;
|
|
390
|
+
/** 内部使用的 `Camera` */
|
|
391
|
+
camera: Camera;
|
|
253
392
|
/**
|
|
254
|
-
*
|
|
255
|
-
* @
|
|
256
|
-
*
|
|
393
|
+
* 当前设置的 `scissor`
|
|
394
|
+
* @description
|
|
395
|
+
* 可通过初始化,或者 setScissor 方式设置
|
|
396
|
+
* `scissor` 是将屏幕中的内容渲染到 `renderer` 的指定区域。
|
|
397
|
+
* 页面整体长宽均为 `1`。通过类似 css 的 `left` `bottom` `width` `height` 来确定区域。
|
|
398
|
+
* @example
|
|
399
|
+
* ```
|
|
400
|
+
* scissor: { left: 0.75, bottom: 0, width: 0.25, height: 1 }
|
|
401
|
+
* ```
|
|
257
402
|
*/
|
|
258
|
-
|
|
403
|
+
scissor: Scissor;
|
|
259
404
|
/**
|
|
260
|
-
*
|
|
261
|
-
* @
|
|
262
|
-
*
|
|
405
|
+
* 当前使用的 THREE.WebGLRenderer。
|
|
406
|
+
* @description
|
|
407
|
+
* 如果初始化时传入了 `renderer` 则直接时该值
|
|
408
|
+
* 否则会通过 `preserveDrawingBuffer` `backgroundColor` `backgroundAlpha` `antialias` 创建一个 `THREE.WebGLRenderer`
|
|
263
409
|
*/
|
|
264
|
-
|
|
410
|
+
renderer?: THREE_2.WebGLRenderer;
|
|
411
|
+
/** 当前加载的模型 */
|
|
412
|
+
models: Models;
|
|
413
|
+
private lastModels;
|
|
414
|
+
private lastWorks?;
|
|
265
415
|
/**
|
|
266
|
-
*
|
|
267
|
-
* @
|
|
268
|
-
*
|
|
416
|
+
* 是否需要渲染
|
|
417
|
+
* @description
|
|
418
|
+
* 如果初始化设置了 `onlyRenderIfNeeds: true`, 则会激活按需渲染
|
|
419
|
+
* 可以通过设置 `five.needsRender = true` 来告知,five 会在下一帧渲染画面。
|
|
269
420
|
*/
|
|
270
|
-
|
|
421
|
+
needsRender: boolean;
|
|
271
422
|
/**
|
|
272
|
-
*
|
|
273
|
-
* @
|
|
423
|
+
* 全景图的配置参数
|
|
424
|
+
* @description
|
|
425
|
+
* 可以动态对配置在 `work` 数据中的全景图片在 runtime 做 url 调整。
|
|
426
|
+
* 平衡加载时间和图片质量
|
|
274
427
|
*/
|
|
275
|
-
|
|
428
|
+
imageOptions: ImageOptions;
|
|
276
429
|
/**
|
|
277
|
-
*
|
|
278
|
-
* @
|
|
279
|
-
*
|
|
280
|
-
*
|
|
281
|
-
* @returns 可以通过 `return false` 阻止
|
|
430
|
+
* 模型贴图的配置参数
|
|
431
|
+
* @description
|
|
432
|
+
* 可以动态对配置在 `work` 数据中的模型贴图在 runtime 做 url 调整。
|
|
433
|
+
* 平衡加载时间和图片质量
|
|
282
434
|
*/
|
|
283
|
-
|
|
435
|
+
textureOptions: TextureOptions;
|
|
284
436
|
/**
|
|
285
|
-
*
|
|
437
|
+
* 模型贴图的配置参数
|
|
286
438
|
* @description
|
|
287
|
-
*
|
|
288
|
-
*
|
|
289
|
-
* - panoWillArrive 在加载全景图资源后触发
|
|
290
|
-
* @param panoId - 移动到的点位
|
|
291
|
-
* @param userAction - 是否用户触发
|
|
439
|
+
* 可以动态对配置在 `work` 数据中的模型贴图在 runtime 做 url 调整。
|
|
440
|
+
* 平衡加载时间和图片质量
|
|
292
441
|
*/
|
|
293
|
-
|
|
442
|
+
videoTexture: THREE_2.VideoTexture;
|
|
294
443
|
/**
|
|
295
|
-
*
|
|
296
|
-
* @
|
|
444
|
+
* 当前状态
|
|
445
|
+
* @description
|
|
446
|
+
* ```text
|
|
447
|
+
* five 设置了以下状态
|
|
448
|
+
*
|
|
449
|
+
* - mode: Mode
|
|
450
|
+
* - panoIndex: number
|
|
451
|
+
* - longitude: number
|
|
452
|
+
* - latitude: number
|
|
453
|
+
* - fov: number
|
|
454
|
+
* - offset: THREE.Vector3
|
|
455
|
+
*
|
|
456
|
+
* 可以通过 five.state 和 five.setState 来获取和设置。
|
|
457
|
+
* 通过 state 设置后,five 会通过合适的动画运动来达到设置的位置。
|
|
458
|
+
* 来迎合一些通过数据驱动的场景。
|
|
459
|
+
* ```
|
|
297
460
|
*/
|
|
298
|
-
|
|
461
|
+
state: State;
|
|
462
|
+
info: null | {
|
|
463
|
+
memory: {
|
|
464
|
+
geometries: number;
|
|
465
|
+
textures: number;
|
|
466
|
+
};
|
|
467
|
+
render: {
|
|
468
|
+
calls: number;
|
|
469
|
+
frame: number;
|
|
470
|
+
lines: number;
|
|
471
|
+
points: number;
|
|
472
|
+
triangles: number;
|
|
473
|
+
};
|
|
474
|
+
};
|
|
475
|
+
/** 插件暴露的方法 */
|
|
476
|
+
plugins: {
|
|
477
|
+
[key: string]: FivePluginInstance<any>;
|
|
478
|
+
};
|
|
479
|
+
ident: string;
|
|
480
|
+
/** 包围盒子 */
|
|
481
|
+
private boundingMesh;
|
|
482
|
+
private stopAnimationLoop?;
|
|
483
|
+
private fps;
|
|
484
|
+
private modelGroup;
|
|
485
|
+
private helperGroup;
|
|
486
|
+
private modeChangeDuration;
|
|
487
|
+
private enableWheel;
|
|
488
|
+
private onlyRenderIfNeeds;
|
|
489
|
+
private poweredByRealsee;
|
|
490
|
+
private controller?;
|
|
491
|
+
private destroyed;
|
|
492
|
+
private stateSynced;
|
|
493
|
+
private controllerInits;
|
|
494
|
+
private extraElements;
|
|
495
|
+
private getPixelsRenderTarget;
|
|
496
|
+
private readyCallbacks;
|
|
497
|
+
private syncingState;
|
|
299
498
|
/**
|
|
300
|
-
*
|
|
301
|
-
*
|
|
499
|
+
* 是否开启 IOS EDR 模式
|
|
500
|
+
* 需要客户端配合
|
|
501
|
+
* 并且开启 five.enablepostProcessing = true
|
|
302
502
|
*/
|
|
303
|
-
|
|
503
|
+
private _enableIOSEDR;
|
|
504
|
+
private lastLoadWorkTask;
|
|
505
|
+
private requestProxy;
|
|
506
|
+
private networkSubscribe;
|
|
507
|
+
private screenBuffers?;
|
|
508
|
+
private analysis?;
|
|
509
|
+
private renderSwitch01;
|
|
304
510
|
/**
|
|
305
|
-
*
|
|
306
|
-
* @param error - 错误对象
|
|
307
|
-
* @param panoId - 对应的点位
|
|
511
|
+
* gpu_picking
|
|
308
512
|
*/
|
|
309
|
-
|
|
513
|
+
private gpuPickingRenderTarget;
|
|
514
|
+
private meshReplaceMaterialMap;
|
|
515
|
+
private meshOriginMaterialMap;
|
|
516
|
+
private copyEffect;
|
|
517
|
+
constructor(initArgs?: FiveInitArgs);
|
|
518
|
+
get panoIndex(): number;
|
|
310
519
|
/**
|
|
311
|
-
*
|
|
312
|
-
* @
|
|
313
|
-
*
|
|
314
|
-
* -
|
|
315
|
-
*
|
|
316
|
-
*
|
|
317
|
-
* @param panoId - 对应的点位
|
|
520
|
+
* GPU Picking 获取选中的 mesh
|
|
521
|
+
* @param x - 屏幕坐标 x
|
|
522
|
+
* @param y - 屏幕坐标 y
|
|
523
|
+
* @param colorMap - 需要选取的 mesh 的颜色与 uuid 的映射
|
|
524
|
+
* @param color - 指定的模型颜色
|
|
525
|
+
* @returns 选中 mesh 的 uuid
|
|
318
526
|
*/
|
|
319
|
-
|
|
527
|
+
getGPUPicking(x: number, y: number, colorMap: {
|
|
528
|
+
[key: string]: THREE_2.Color;
|
|
529
|
+
}, pixelRatio?: number, color?: THREE_2.Vector3): string | false;
|
|
320
530
|
/**
|
|
321
|
-
*
|
|
531
|
+
* 析构 five 对象。
|
|
322
532
|
* @description
|
|
323
|
-
*
|
|
324
|
-
*
|
|
325
|
-
* - panoWillArrive 在加载全景图资源后触发
|
|
326
|
-
* @param panoId - 移动到点位
|
|
327
|
-
* @param pose - 相机姿态
|
|
328
|
-
* @param userAction - 是否用户触发
|
|
533
|
+
* 一旦调用了析构方法,则不能再使用当前 five 对象了。
|
|
534
|
+
* 你可以新建一个新的。
|
|
329
535
|
*/
|
|
330
|
-
|
|
536
|
+
dispose(): void;
|
|
331
537
|
/**
|
|
332
|
-
*
|
|
333
|
-
* @param
|
|
334
|
-
*
|
|
335
|
-
*
|
|
538
|
+
* 设置 `scissor`
|
|
539
|
+
* @param scissor - 指定区域
|
|
540
|
+
* `scissor` 是将屏幕中的内容渲染到 `renderer` 的指定区域。
|
|
541
|
+
* 请确保在 five 初始化时传入 `renderer` 对象
|
|
542
|
+
* 页面整体长宽均为 `1`。通过类似 css 的 `left` `bottom` `width` `height` 来确定区域。
|
|
543
|
+
* @example
|
|
544
|
+
* ```
|
|
545
|
+
* five.setScissor({ left: 0.75, bottom: 0, width: 0.25, height: 1 })
|
|
546
|
+
* ```
|
|
336
547
|
*/
|
|
337
|
-
|
|
548
|
+
setScissor(scissor: Scissor): void;
|
|
338
549
|
/**
|
|
339
|
-
*
|
|
340
|
-
* @param panoId - 将要移动到的点位下标
|
|
341
|
-
* @param prevPanoId - 上一个点位下标
|
|
342
|
-
* @param progress - 整个过程经度 [0-1]
|
|
550
|
+
* 帮助元素显示/隐藏
|
|
343
551
|
*/
|
|
344
|
-
|
|
552
|
+
get helperVisible(): boolean;
|
|
553
|
+
set helperVisible(visible: boolean);
|
|
345
554
|
/**
|
|
346
|
-
*
|
|
347
|
-
*
|
|
348
|
-
*
|
|
349
|
-
* @param final - 是否手势结束
|
|
350
|
-
* @returns 可以通过 `return false` 阻止
|
|
555
|
+
* 是否开启 IOS EDR 模式
|
|
556
|
+
* 需要客户端配合
|
|
557
|
+
* 并且开启 five.enablepostProcessing = true
|
|
351
558
|
*/
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
y: number;
|
|
355
|
-
delta?: number;
|
|
356
|
-
}[], final: boolean): void | false;
|
|
559
|
+
get enableIOSEDR(): boolean;
|
|
560
|
+
set enableIOSEDR(enable: boolean);
|
|
357
561
|
/**
|
|
358
|
-
*
|
|
359
|
-
* @param type - 手势类型
|
|
360
|
-
* @param pointers - 手指位置
|
|
361
|
-
* @param final - 是否手势结束
|
|
562
|
+
* 后处理类型
|
|
362
563
|
*/
|
|
363
|
-
|
|
364
|
-
x: number;
|
|
365
|
-
y: number;
|
|
366
|
-
delta?: number;
|
|
367
|
-
}[], final: boolean): void;
|
|
564
|
+
get postProcessingType(): PostProcessingType;
|
|
368
565
|
/**
|
|
369
|
-
*
|
|
370
|
-
* @param pose - 意图的相机姿态
|
|
371
|
-
* @param final - 是否手势结束
|
|
372
|
-
* @returns 可以通过 `return false` 阻止
|
|
566
|
+
* 是否开启EDL模式
|
|
373
567
|
*/
|
|
374
|
-
|
|
568
|
+
get enableEDL(): boolean;
|
|
569
|
+
set enableEDL(enable: boolean);
|
|
570
|
+
get enableHQ(): boolean;
|
|
571
|
+
set enableHQ(enable: boolean);
|
|
375
572
|
/**
|
|
376
|
-
*
|
|
377
|
-
* @param pose - 相机姿态
|
|
378
|
-
* @param final - 是否手势结束
|
|
573
|
+
* 是否开启后处理
|
|
379
574
|
*/
|
|
380
|
-
|
|
575
|
+
get enablePostProcessing(): boolean;
|
|
576
|
+
set enablePostProcessing(enable: boolean);
|
|
577
|
+
updateConfiguration(args: Pick<FiveInitArgs, "panorama" | "model" | "floorplan" | "topview" | "mapview" | "vrPanorama" | "imageOptions" | "textureOptions">, refresh?: boolean): void;
|
|
381
578
|
/**
|
|
382
|
-
*
|
|
383
|
-
* @
|
|
384
|
-
*
|
|
385
|
-
*
|
|
579
|
+
* 将显示区域加载到页面 DOM 中
|
|
580
|
+
* @description
|
|
581
|
+
* 如果你是传入的 `renderer`. 则你需要自行来方式显示区域该方法并不生效
|
|
582
|
+
*
|
|
583
|
+
* @param element - 加载到页面的 DOM 元素
|
|
584
|
+
* @param size - 显示区域尺寸 默认铺满这个 DOM 元素
|
|
386
585
|
*/
|
|
387
|
-
|
|
586
|
+
appendTo(element: HTMLElement, size?: {
|
|
587
|
+
width?: number;
|
|
588
|
+
height?: number;
|
|
589
|
+
}): void;
|
|
388
590
|
/**
|
|
389
|
-
*
|
|
390
|
-
* @
|
|
391
|
-
*
|
|
591
|
+
* 设置显示区域尺寸
|
|
592
|
+
* @description
|
|
593
|
+
* 如果你是传入的 `renderer`. 则你需要自行来设置显示区域尺寸,该方法并不生效
|
|
594
|
+
*
|
|
595
|
+
* @param size - 显示区域尺寸 默认铺满这个 DOM 元素
|
|
596
|
+
* @param pixelRatio - 像素比 默认继承之前的设置
|
|
392
597
|
*/
|
|
393
|
-
|
|
598
|
+
refresh(size?: {
|
|
599
|
+
width?: number;
|
|
600
|
+
height?: number;
|
|
601
|
+
}, pixelRatio?: number): void;
|
|
394
602
|
/**
|
|
395
|
-
*
|
|
396
|
-
* @
|
|
397
|
-
* @param tapPosition - 点击对应的屏幕位置
|
|
398
|
-
* @param final - 是否手势结束
|
|
399
|
-
* @returns 可以通过 `return false` 阻止
|
|
603
|
+
* 绑定一个额外 DOM 区域,接受触控/鼠标事件
|
|
604
|
+
* @returns 解除该绑定
|
|
400
605
|
*/
|
|
401
|
-
|
|
606
|
+
addExtraElement(element: HTMLElement): () => void;
|
|
402
607
|
/**
|
|
403
|
-
*
|
|
404
|
-
* @param raycaster - 点击对应的三维射线
|
|
405
|
-
* @param tapPosition - 点击对应的屏幕位置
|
|
406
|
-
* @param final - 是否手势结束
|
|
608
|
+
* 解除绑定的一个额外 DOM 区域
|
|
407
609
|
*/
|
|
408
|
-
|
|
610
|
+
removeExtraElement(element: HTMLElement): void;
|
|
409
611
|
/**
|
|
410
|
-
*
|
|
411
|
-
* @param scale - 缩放数值
|
|
412
|
-
* @param nextFov - 意图的fov变更
|
|
413
|
-
* @param final - 是否手势结束
|
|
414
|
-
* @returns 可以通过 `return false` 阻止
|
|
612
|
+
* 获取当前相机姿态, 可以使用 getCurrentState 代替
|
|
415
613
|
*/
|
|
416
|
-
|
|
614
|
+
getPose(): Pose;
|
|
615
|
+
getSize(target: THREE_2.Vector2): THREE_2.Vector2;
|
|
616
|
+
getDrawingBufferSize(target: THREE_2.Vector2): THREE_2.Vector2;
|
|
417
617
|
/**
|
|
418
|
-
*
|
|
419
|
-
* @
|
|
420
|
-
*
|
|
421
|
-
*
|
|
422
|
-
* @param
|
|
423
|
-
* @
|
|
618
|
+
* 移动相机。(不触发点位移动)
|
|
619
|
+
* @description
|
|
620
|
+
* 如果动画中途被打断(用户触发行为,或者调用 setState, load, changeMode)的等
|
|
621
|
+
* 会 Promise.reject。运动完成则 Promise.resolve
|
|
622
|
+
* @param pose - 相机目标位置
|
|
623
|
+
* @param duration - 动画触发的时常
|
|
624
|
+
* @param userAction - 是否用户触发
|
|
625
|
+
* @returns Promise 是否移动成功
|
|
424
626
|
*/
|
|
425
|
-
|
|
627
|
+
updateCamera(pose: Partial<Pose>, duration: number, userAction?: boolean): Promise<void>;
|
|
426
628
|
/**
|
|
427
|
-
*
|
|
428
|
-
* @
|
|
429
|
-
*
|
|
430
|
-
*
|
|
431
|
-
* @param
|
|
629
|
+
* 通过帧动画移动相机。(不触发点位移动)
|
|
630
|
+
* @description
|
|
631
|
+
* 如果动画中途被打断(用户触发行为,或者调用 setState, load, changeMode)的等
|
|
632
|
+
* 会 Promise.reject。运动完成则 Promise.resolve
|
|
633
|
+
* @param keyframes - 动画帧
|
|
634
|
+
* @param duration - 动画触发的时常
|
|
635
|
+
* @param userAction - 是否用户触发
|
|
636
|
+
* @returns Promise 是否移动成功
|
|
432
637
|
*/
|
|
433
|
-
|
|
638
|
+
updateCameraWithKeyframes(keyframes: {
|
|
639
|
+
progress: number;
|
|
640
|
+
value: Pose;
|
|
641
|
+
key?: string;
|
|
642
|
+
}[], duration: number, userAction?: boolean): Promise<void>;
|
|
434
643
|
/**
|
|
435
|
-
*
|
|
436
|
-
* @
|
|
437
|
-
* @param nextFov - 意图的fov变更
|
|
438
|
-
* @param final - 是否手势结束
|
|
644
|
+
* 获取当前相机经纬度
|
|
645
|
+
* @deprecated 请使用使用 getPose
|
|
439
646
|
*/
|
|
440
|
-
|
|
647
|
+
getLongitudeAndLatitude(): Pick<Pose, "longitude" | "latitude">;
|
|
441
648
|
/**
|
|
442
|
-
*
|
|
443
|
-
* @
|
|
444
|
-
* @param nextFov - 意图的fov变更
|
|
445
|
-
* @param final - 是否手势结束
|
|
446
|
-
* @returns 可以通过 `return false` 阻止
|
|
649
|
+
* 获取当前相机位置
|
|
650
|
+
* @deprecated 请使用使用 getPose
|
|
447
651
|
*/
|
|
448
|
-
|
|
652
|
+
getOffset(): Pose["offset"];
|
|
449
653
|
/**
|
|
450
|
-
*
|
|
451
|
-
* @
|
|
452
|
-
* @param nextFov - 意图的fov变更
|
|
453
|
-
* @param final - 是否手势结束
|
|
654
|
+
* 获取当前相机的姿态(用于内部的 python 脚本截图)
|
|
655
|
+
* @deprecated 这是用于内部的 python 脚本截图
|
|
454
656
|
*/
|
|
455
|
-
|
|
657
|
+
getCameraLocal(): {
|
|
658
|
+
theta: number;
|
|
659
|
+
phi: number;
|
|
660
|
+
lookAtVector: THREE_2.Vector3;
|
|
661
|
+
};
|
|
662
|
+
/** 当前加载的 work 数据 */
|
|
663
|
+
get works(): Works;
|
|
664
|
+
get work(): Work | undefined;
|
|
665
|
+
get model(): Model;
|
|
456
666
|
/**
|
|
457
|
-
*
|
|
458
|
-
* @param
|
|
459
|
-
* @param
|
|
667
|
+
* 加载 Work 数据
|
|
668
|
+
* @param inputWork - Work 数据
|
|
669
|
+
* @param state - 初始化姿态
|
|
670
|
+
* - "inherit" 使用当前姿态
|
|
671
|
+
* - "initial" 使用 Work 数据中的 initial 姿态
|
|
672
|
+
* - State 自定义姿态
|
|
673
|
+
* @param options - 切换时间, 切换效果
|
|
460
674
|
*/
|
|
461
|
-
|
|
675
|
+
load(inputWork: string | Work | LooseWork | string[] | Work[] | LooseWork[] | LooseWorkWithExtrinsics[] | Promise<Work | LooseWork | Work[] | LooseWork[] | LooseWorkWithExtrinsics[]>, state?: "inherit" | "initial" | Partial<State>, options?: number | FiveLoadOptions, userAction?: boolean): Promise<void>;
|
|
676
|
+
private load_;
|
|
462
677
|
/**
|
|
463
|
-
*
|
|
464
|
-
* @param
|
|
465
|
-
* @
|
|
678
|
+
* 切换模态
|
|
679
|
+
* @param mode - 切换到的模态
|
|
680
|
+
* @param state - 切换完成时的姿态
|
|
681
|
+
* @param options - 模态切换动画用时
|
|
682
|
+
* @param userAction - 是否时用户动作触发 默认 true
|
|
683
|
+
* @param force - 必须重新初始化 controller
|
|
466
684
|
*/
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
vrWantsToExit(): void;
|
|
685
|
+
changeMode<T extends Mode>(mode: T, state?: Partial<Omit<State, "mode">>, options?: number | {
|
|
686
|
+
duration?: number;
|
|
687
|
+
effect?: MovePanoEffect;
|
|
688
|
+
}, userAction?: boolean, force?: boolean): Promise<void>;
|
|
472
689
|
/**
|
|
473
|
-
*
|
|
474
|
-
* @param
|
|
690
|
+
* 获取画面中的像素颜色
|
|
691
|
+
* @param x - 获取像素区域的起始坐标 x
|
|
692
|
+
* @param y - 获取像素区域的起始坐标 y
|
|
693
|
+
* @param width - 获取像素区域的宽度
|
|
694
|
+
* @param height - 获取像素区域的高度
|
|
695
|
+
* @param pixelRatio - 获取区域的像素比
|
|
696
|
+
* @returns rgba颜色平铺的 Uint8Array
|
|
475
697
|
*/
|
|
476
|
-
|
|
698
|
+
getPixels(x: number, y: number, width: number, height: number, pixelRatio?: number): Uint8Array;
|
|
477
699
|
/**
|
|
478
|
-
*
|
|
479
|
-
* @param progress - 加载进度 [0-1]
|
|
480
|
-
* @param panoId - 加载点位下标
|
|
700
|
+
* 获取显示用的画布(Canvas DOM节点)
|
|
481
701
|
*/
|
|
482
|
-
|
|
702
|
+
getElement(): HTMLCanvasElement | undefined;
|
|
483
703
|
/**
|
|
484
|
-
*
|
|
485
|
-
* @param panoId - 加载点位
|
|
704
|
+
* 获取观测点
|
|
486
705
|
*/
|
|
487
|
-
|
|
706
|
+
get observers(): WorkResolvedObserver[];
|
|
488
707
|
/**
|
|
489
|
-
*
|
|
490
|
-
* @
|
|
491
|
-
*
|
|
708
|
+
* 强制渲染
|
|
709
|
+
* @description
|
|
710
|
+
* 调用 `five.render()` 和设置 `five.needsRender = true` 均可在按需渲染时,使得画面渲染一次
|
|
711
|
+
* 区别在于:
|
|
712
|
+
* - `five.needsRender = true` 为在下帧渲染画面
|
|
713
|
+
* - `five.render()` 在当前帧渲染画面
|
|
714
|
+
* 推荐使用 `five.needsRender = true`, 可以更加流畅。但是如果需要截图等同步操作,可以使用 `five.render()`
|
|
715
|
+
*
|
|
716
|
+
* @param callback - 渲染完成回调
|
|
492
717
|
*/
|
|
493
|
-
|
|
718
|
+
render(callback?: () => void, updateObjectResolution?: boolean): THREE_2.WebGLRenderTarget;
|
|
719
|
+
updateTime(time: number, deltaTime: number, ...args: any[]): void;
|
|
494
720
|
/**
|
|
495
|
-
*
|
|
496
|
-
* @param panoId - 加载点位
|
|
721
|
+
* 暂停自动播放
|
|
497
722
|
*/
|
|
498
|
-
|
|
723
|
+
pause(): void;
|
|
724
|
+
play(): void;
|
|
499
725
|
/**
|
|
500
|
-
*
|
|
501
|
-
* @param
|
|
726
|
+
* 转化到 Panorama 模态,并移动到对应序号的观察点。
|
|
727
|
+
* @param panoIndex - 观察点序号
|
|
728
|
+
* @param options - 移动点位参数
|
|
729
|
+
* @param userAction - 是否用户触犯
|
|
502
730
|
*/
|
|
503
|
-
|
|
731
|
+
moveToPano(pano: Pano | PanoId | number, options?: MovePanoOptions, userAction?: boolean): Promise<void>;
|
|
504
732
|
/**
|
|
505
|
-
*
|
|
733
|
+
* 预加载点位图片资源
|
|
734
|
+
* @param pano - 观察点序号
|
|
735
|
+
* @param callback - 加载完成回调, 并传递加载用时。
|
|
736
|
+
* @returns 加载完成的 Promise 参数同 callback
|
|
506
737
|
*/
|
|
507
|
-
|
|
738
|
+
preloadPano(pano: Pano | PanoId | number, callback?: (costs: number) => void): Promise<number>;
|
|
508
739
|
/**
|
|
509
|
-
*
|
|
740
|
+
* 计算三维坐标对应到屏幕的二维坐标
|
|
741
|
+
* @description
|
|
742
|
+
* 如果三维坐标不在屏幕中,则返回 null
|
|
743
|
+
* @param vector - 三维坐标
|
|
744
|
+
* @param testModel - 是否计算模型遮挡
|
|
745
|
+
* @returns 二维坐标 或者 null
|
|
510
746
|
*/
|
|
511
|
-
|
|
747
|
+
project2d(vector: THREE_2.Vector3, testModel?: boolean): THREE_2.Vector2 | null;
|
|
512
748
|
/**
|
|
513
|
-
*
|
|
749
|
+
* 获取当前在屏幕视锥中的 mesh。
|
|
750
|
+
* @param object - 如果传入则检查这个对象中的mesh,如果不传,则检查整个 scene
|
|
514
751
|
*/
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
export declare class CullingVolume {
|
|
519
|
-
static get MASK_OUTSIDE(): number;
|
|
520
|
-
static get MASK_INSIDE(): number;
|
|
521
|
-
static get MASK_INDETERMINATE(): number;
|
|
522
|
-
planes: THREE_2.Plane[];
|
|
523
|
-
constructor(planes?: THREE_2.Plane[]);
|
|
524
|
-
setFromFrustum(frustum: THREE_2.Frustum): this;
|
|
525
|
-
computeVisibility(boundingVolume: BoundingVolume): VolumePlaneIntersect;
|
|
526
|
-
computeVisibilityWithPlaneMask(boundingVolume: BoundingVolume, parentPlaneMask: number): number;
|
|
527
|
-
}
|
|
528
|
-
|
|
529
|
-
/**
|
|
530
|
-
* URL 地址的转换
|
|
531
|
-
* @param source - url 原地址
|
|
532
|
-
* @param options - url 转换参数
|
|
533
|
-
* @returns url 转换结果
|
|
534
|
-
*/
|
|
535
|
-
export declare function defaultImageURLTransform(source: string, options: ImageURLOptions): string;
|
|
536
|
-
|
|
537
|
-
export declare interface DepthPanoramaControllerCustomInitArgs extends PanoramaLikeControllerCustomInitArgs {
|
|
538
|
-
/** 最远可移动观察点距离 */
|
|
539
|
-
maxAccessibleDistance?: number;
|
|
752
|
+
getRenderObjects(object?: THREE_2.Object3D): THREE_2.Object3D[];
|
|
753
|
+
getCurrentState(): State;
|
|
540
754
|
/**
|
|
541
|
-
*
|
|
755
|
+
* 设置 State
|
|
542
756
|
* @description
|
|
543
|
-
*
|
|
544
|
-
*
|
|
757
|
+
* ```text
|
|
758
|
+
* five 设置了以下状态
|
|
759
|
+
*
|
|
760
|
+
* - mode: Mode
|
|
761
|
+
* - panoIndex: number
|
|
762
|
+
* - longitude: number
|
|
763
|
+
* - latitude: number
|
|
764
|
+
* - fov: number
|
|
765
|
+
* - offset: THREE.Vector3
|
|
766
|
+
*
|
|
767
|
+
* 可以通过 five.state 和 five.setState 来获取和设置。
|
|
768
|
+
* 通过 state 设置后,five 会通过合适的动画运动来达到设置的位置。
|
|
769
|
+
* 来迎合一些通过数据驱动的场景。
|
|
770
|
+
* ```
|
|
771
|
+
* @param state - 目标状态
|
|
772
|
+
* @param immediately - 是否马上转换,马上转换会尽快达到目标状态,尽量减少中间状态,更少动画。
|
|
773
|
+
* @param userAction - 是否是用户触发的动作
|
|
545
774
|
*/
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
}
|
|
550
|
-
|
|
551
|
-
/**
|
|
552
|
-
* Five 事件列表
|
|
553
|
-
* @description
|
|
554
|
-
* 可以通过 `five.on(METHOD_NAME, METHOD)` 调用
|
|
555
|
-
*/
|
|
556
|
-
export declare interface EventCallback extends EventTypes {
|
|
557
|
-
}
|
|
558
|
-
|
|
559
|
-
/**
|
|
560
|
-
* Five 事件列表
|
|
561
|
-
* @description
|
|
562
|
-
* 具体事件列表 请查看 {@link EventCallback}
|
|
563
|
-
*/
|
|
564
|
-
export declare type EventTypes = Pick<ControllerEventTypes, typeof PROXY_CONTROLLER_EVENT_NAMES[number]> & {
|
|
775
|
+
setState(state: Partial<State>, immediately?: boolean, userAction?: boolean): void;
|
|
776
|
+
aroundScissor(callback: () => void): void;
|
|
777
|
+
private syncState;
|
|
565
778
|
/**
|
|
566
|
-
*
|
|
567
|
-
* @param error - 错误对象
|
|
779
|
+
* 当前页面静态
|
|
568
780
|
*/
|
|
569
|
-
|
|
781
|
+
ready(args?: {
|
|
782
|
+
tile?: boolean;
|
|
783
|
+
}): Promise<void>;
|
|
570
784
|
/**
|
|
571
|
-
*
|
|
572
|
-
* @param input - 输入的 work
|
|
573
|
-
* @param works - 归一化的标准 work
|
|
574
|
-
* @param state - 加载时的姿态
|
|
785
|
+
* 请求全屏
|
|
575
786
|
*/
|
|
576
|
-
|
|
787
|
+
requestFullscreen(): void;
|
|
577
788
|
/**
|
|
578
|
-
*
|
|
579
|
-
* @param input - 输入的 work
|
|
580
|
-
* @param works - 归一化的标准 work
|
|
581
|
-
* @param state - 加载时的姿态
|
|
789
|
+
* 退出全屏
|
|
582
790
|
*/
|
|
583
|
-
|
|
791
|
+
exitFullscreen(): void;
|
|
792
|
+
private throwError;
|
|
793
|
+
private loadModel;
|
|
794
|
+
private commonParams;
|
|
795
|
+
private applyController;
|
|
796
|
+
/** 移除事件绑定 */
|
|
797
|
+
private removeEventListeners;
|
|
798
|
+
}
|
|
799
|
+
|
|
800
|
+
/** Five 初始化参数 */
|
|
801
|
+
export declare interface FiveInitArgs {
|
|
584
802
|
/**
|
|
585
|
-
*
|
|
586
|
-
* @
|
|
587
|
-
*
|
|
803
|
+
* 外部传入的 `THREE.WebGLRenderer`。
|
|
804
|
+
* @description
|
|
805
|
+
* 如果需要使用 `scissor` 分割画布功能,则必须使用外部传入 renderer,
|
|
806
|
+
* 并且设置为 `preserveDrawingBuffer: false`。
|
|
807
|
+
* 如果设置了 `renderer`, 则 `preserveDrawingBuffer`
|
|
808
|
+
* `backgroundColor` `backgroundAlpha` `antialias`
|
|
809
|
+
* 均不再生效。
|
|
588
810
|
*/
|
|
589
|
-
|
|
811
|
+
renderer?: THREE_2.WebGLRenderer;
|
|
590
812
|
/**
|
|
591
|
-
*
|
|
592
|
-
* @
|
|
813
|
+
* 内部 `THREE.WebGLRenderer` 是否通过像素拷贝的方式绘制。
|
|
814
|
+
* @description
|
|
815
|
+
* 当你想做屏幕截图等要确定取得屏幕像素时,请设置为 `true`。
|
|
816
|
+
* 如果设置了参数 `renderer` 参数,则不生效,请对传入的 `renderer` 自行设置。
|
|
817
|
+
* @default `false`
|
|
593
818
|
*/
|
|
594
|
-
|
|
819
|
+
preserveDrawingBuffer?: boolean;
|
|
595
820
|
/**
|
|
596
|
-
*
|
|
597
|
-
* @
|
|
598
|
-
*
|
|
821
|
+
* 输出画面的背景颜色。
|
|
822
|
+
* @description
|
|
823
|
+
* 通过数字类型传入。
|
|
824
|
+
* 如果设置了参数 `renderer` 参数,则不生效,请对传入的 `renderer` 自行设置。
|
|
825
|
+
* @default `0x181A1C`
|
|
826
|
+
* @example
|
|
827
|
+
* ```
|
|
828
|
+
* backgroundColor: 0xffffff // 白色
|
|
829
|
+
* backgroundColor: 0xff0000 // 红色
|
|
830
|
+
* ```
|
|
599
831
|
*/
|
|
600
|
-
|
|
832
|
+
backgroundColor?: number;
|
|
601
833
|
/**
|
|
602
|
-
*
|
|
603
|
-
* @
|
|
834
|
+
* 输出画面的背景透明度
|
|
835
|
+
* @description
|
|
836
|
+
* 通过数字类型传入。取值范围 [0-1]
|
|
837
|
+
* 如果设置了参数 `renderer` 参数,则不生效,请对传入的 `renderer` 自行设置。
|
|
838
|
+
* @default `1`
|
|
604
839
|
*/
|
|
605
|
-
|
|
840
|
+
backgroundAlpha?: number;
|
|
606
841
|
/**
|
|
607
|
-
*
|
|
608
|
-
* @
|
|
842
|
+
* 是否开启 `THREE.WebGLRenderer` 的抗锯齿功能
|
|
843
|
+
* @description
|
|
844
|
+
* 这个抗锯齿功能是 `WEBGL` 自带的抗锯齿,并不是类似 fxaa taa 等后处理方式,比较吃性能。
|
|
845
|
+
* 如果设置了参数 `renderer` 参数,则不生效,请对传入的 `renderer` 自行设置。
|
|
846
|
+
* @default `false`
|
|
609
847
|
*/
|
|
610
|
-
|
|
848
|
+
antialias?: boolean;
|
|
611
849
|
/**
|
|
612
|
-
*
|
|
613
|
-
* @
|
|
850
|
+
* 屏幕渲染区域
|
|
851
|
+
* @description
|
|
852
|
+
* 请确保设置了 `renderer` 参数,`scissor` 参数才可生效
|
|
853
|
+
* `scissor` 是将屏幕中的内容渲染到 `renderer` 的指定区域。
|
|
854
|
+
* 页面整体长宽均为 `1`。通过类似 css 的 `left` `bottom` `width` `height` 来确定区域。
|
|
855
|
+
* @example
|
|
856
|
+
* ```
|
|
857
|
+
* scissor: { left: 0.75, bottom: 0, width: 0.25, height: 1 }
|
|
858
|
+
* ```
|
|
614
859
|
*/
|
|
615
|
-
|
|
860
|
+
scissor?: Scissor;
|
|
616
861
|
/**
|
|
617
|
-
*
|
|
618
|
-
* @
|
|
862
|
+
* 是否自动播放。
|
|
863
|
+
* @description
|
|
864
|
+
* 播放即把内存中计算的内容渲染到画面上。play则是进行每帧播放。
|
|
865
|
+
* 如果 `play: false` 则不自动播放。屏幕不显示。
|
|
866
|
+
* 你还可以通过 `five.play()` `five.pause()` 的方式来控制播放。
|
|
867
|
+
* @default `true`
|
|
619
868
|
*/
|
|
620
|
-
|
|
869
|
+
play?: boolean;
|
|
621
870
|
/**
|
|
622
|
-
*
|
|
623
|
-
* @
|
|
624
|
-
*
|
|
871
|
+
* 全景图的配置参数
|
|
872
|
+
* @description
|
|
873
|
+
* 可以动态对配置在 `work` 数据中的全景图片在 runtime 做 url 调整。
|
|
874
|
+
* 平衡加载时间和图片质量
|
|
625
875
|
*/
|
|
626
|
-
|
|
876
|
+
imageOptions?: ImageOptions;
|
|
627
877
|
/**
|
|
628
|
-
*
|
|
629
|
-
* @
|
|
630
|
-
*
|
|
878
|
+
* 模型贴图的配置参数
|
|
879
|
+
* @description
|
|
880
|
+
* 可以动态对配置在 `work` 数据中的模型贴图在 runtime 做 url 调整。
|
|
881
|
+
* 平衡加载时间和图片质量
|
|
631
882
|
*/
|
|
632
|
-
|
|
883
|
+
textureOptions?: TextureOptions;
|
|
633
884
|
/**
|
|
634
|
-
*
|
|
635
|
-
* @
|
|
885
|
+
* 是否按需渲染
|
|
886
|
+
* @description
|
|
887
|
+
* 按需渲染时,如果页面中的渲染有 `needsRender: true` 属性。或者 `five.needsRender: true` 时
|
|
888
|
+
* 才会重新渲染屏幕,降低无用渲染产生的消耗。
|
|
889
|
+
* @default `true`
|
|
636
890
|
*/
|
|
637
|
-
|
|
891
|
+
onlyRenderIfNeeds?: boolean;
|
|
638
892
|
/**
|
|
639
|
-
*
|
|
640
|
-
* @
|
|
893
|
+
* 最高 fps 限制
|
|
894
|
+
* @description
|
|
895
|
+
* 如果为 `false`, 则不限制。最好也就是屏幕刷新率,不会再高了。
|
|
896
|
+
* @default `false`
|
|
641
897
|
*/
|
|
642
|
-
|
|
898
|
+
maxFps?: number | false;
|
|
643
899
|
/**
|
|
644
|
-
*
|
|
645
|
-
* @
|
|
646
|
-
*
|
|
647
|
-
*
|
|
648
|
-
*
|
|
900
|
+
* 外挂视频对象。
|
|
901
|
+
* @description
|
|
902
|
+
* 当点位中有视频元素,则会使用。如果不传入也会外部新建,
|
|
903
|
+
* 加入传入的原因是,视频自动播放在不同浏览器或者 webview 中有不同的特性。
|
|
904
|
+
* 给予更多外部操作的空间。
|
|
649
905
|
*/
|
|
650
|
-
|
|
906
|
+
videoInstance?: HTMLVideoElement;
|
|
907
|
+
/** 全景图游走模式下的特定参数 */
|
|
908
|
+
panorama?: ControllerCustomInitTypes["Panorama"];
|
|
909
|
+
/** 模型游走模式下的特定参数 */
|
|
910
|
+
model?: ControllerCustomInitTypes["Model"];
|
|
911
|
+
/** 模型查看模式下的特定参数 */
|
|
912
|
+
floorplan?: ControllerCustomInitTypes["Floorplan"];
|
|
913
|
+
/** 户型图模式下的特定参数 */
|
|
914
|
+
topview?: ControllerCustomInitTypes["Topview"];
|
|
915
|
+
/** 地图模式下的特定参数 */
|
|
916
|
+
mapview?: ControllerCustomInitTypes["Mapview"];
|
|
917
|
+
/** VR眼镜模式下的特定参数 */
|
|
918
|
+
vrPanorama?: ControllerCustomInitTypes["VRPanorama"];
|
|
919
|
+
/** XR眼镜模式下的特定参数 */
|
|
920
|
+
xrPanorama?: ControllerCustomInitTypes["XRPanorama"];
|
|
651
921
|
/**
|
|
652
|
-
*
|
|
922
|
+
* 模式间切换时的过度动画时间
|
|
653
923
|
* @description
|
|
654
|
-
*
|
|
655
|
-
* @
|
|
656
|
-
* @param userAction - 是否用户触发
|
|
657
|
-
* @returns 可以通过 return false 阻止
|
|
924
|
+
* 单位毫秒
|
|
925
|
+
* @default `800`
|
|
658
926
|
*/
|
|
659
|
-
|
|
927
|
+
modeChangeDuration?: number;
|
|
660
928
|
/**
|
|
661
|
-
*
|
|
662
|
-
* @param mode - 意图要切换到的模态
|
|
663
|
-
* @param prevMode - 当前模态
|
|
664
|
-
* @returns 可以通过 return false 阻止
|
|
929
|
+
* 是否支持滚轮
|
|
665
930
|
*/
|
|
666
|
-
|
|
931
|
+
enableWheel?: boolean;
|
|
667
932
|
/**
|
|
668
|
-
*
|
|
669
|
-
* @
|
|
670
|
-
*
|
|
671
|
-
* @param panoIndex - 初始化动画结束后的点位下标
|
|
672
|
-
* @param toPose - 初始化动画结束后的状态
|
|
673
|
-
* @param userAction - 是否用户触发
|
|
933
|
+
* 插件定义
|
|
934
|
+
* @description
|
|
935
|
+
* 详见插件部分。
|
|
674
936
|
*/
|
|
675
|
-
|
|
937
|
+
plugins?: (FivePlugin<void> | FivePluginInit<FivePlugin<any, any>> | FivePluginInit<FivePlugin<void, any>>)[];
|
|
676
938
|
/**
|
|
677
|
-
*
|
|
678
|
-
* @param visible - 帮助元素的是否开启
|
|
939
|
+
* 是否展示 powered by 如视
|
|
679
940
|
*/
|
|
680
|
-
|
|
941
|
+
poweredByRealsee?: boolean;
|
|
681
942
|
/**
|
|
682
|
-
*
|
|
683
|
-
* @param source - 资源地址
|
|
684
|
-
* @param state - 状态
|
|
685
|
-
* @param detail - 详情
|
|
686
|
-
*/
|
|
687
|
-
network(source: string, type: NetworkType, state: NetworkState, detail: string): void;
|
|
688
|
-
/** five 被析构。 插件中请监听用于自身析构 */
|
|
689
|
-
dispose(): void;
|
|
690
|
-
};
|
|
691
|
-
|
|
692
|
-
/**
|
|
693
|
-
* 如视 VR Web展示器
|
|
694
|
-
*
|
|
695
|
-
* @example
|
|
696
|
-
* ```
|
|
697
|
-
* // 初始化构造函数
|
|
698
|
-
* const five = new Five();
|
|
699
|
-
* // 将绘制区域添加到页面上
|
|
700
|
-
* five.appendTo(document.body);
|
|
701
|
-
* // 加载 Work 数据
|
|
702
|
-
* five.load({...});
|
|
703
|
-
* ```
|
|
704
|
-
*/
|
|
705
|
-
export declare class Five extends Subscribe<EventTypes> {
|
|
706
|
-
static get version(): string;
|
|
707
|
-
static get dracoPath(): string;
|
|
708
|
-
static set dracoPath(path: string);
|
|
709
|
-
/**
|
|
710
|
-
* Five 的显示模式,可以通过 `five.changeMode` `five.setState` 来切换
|
|
711
|
-
* @description
|
|
712
|
-
* ```text
|
|
713
|
-
* Panorama 全景图游走模式
|
|
714
|
-
* Model 模型游走模式
|
|
715
|
-
* Floorplan 模型查看模式
|
|
716
|
-
* Topview 户型图模式
|
|
717
|
-
* DepthPanorama 深度图游走模式
|
|
718
|
-
* VRPanorama VR眼镜模式
|
|
719
|
-
* XRPanorama VR硬件模式
|
|
720
|
-
* ```
|
|
721
|
-
*/
|
|
722
|
-
static Mode: Mirror<Mode>;
|
|
723
|
-
/**
|
|
724
|
-
* @deprecated
|
|
725
|
-
* 请使用 `import { Line } from "@realsee/five/line"` 代替;
|
|
726
|
-
*/
|
|
727
|
-
static Line: any;
|
|
728
|
-
/**
|
|
729
|
-
* 自动播放状态是否暂停
|
|
730
|
-
* @description
|
|
731
|
-
* 可以通过 `five.play` `five.pause` 方法播放或暂停
|
|
732
|
-
*/
|
|
733
|
-
paused: boolean;
|
|
734
|
-
/** 当前点位序号 */
|
|
735
|
-
panoId: WorkPanoId;
|
|
736
|
-
/** 当前展示的模式 */
|
|
737
|
-
currentMode: Mode;
|
|
738
|
-
/** 内部使用的 `THREE.Scene` */
|
|
739
|
-
scene: Scene;
|
|
740
|
-
/** 内部使用的 `Camera` */
|
|
741
|
-
camera: Camera;
|
|
742
|
-
/**
|
|
743
|
-
* 当前设置的 `scissor`
|
|
744
|
-
* @description
|
|
745
|
-
* 可通过初始化,或者 setScissor 方式设置
|
|
746
|
-
* `scissor` 是将屏幕中的内容渲染到 `renderer` 的指定区域。
|
|
747
|
-
* 页面整体长宽均为 `1`。通过类似 css 的 `left` `bottom` `width` `height` 来确定区域。
|
|
748
|
-
* @example
|
|
749
|
-
* ```
|
|
750
|
-
* scissor: { left: 0.75, bottom: 0, width: 0.25, height: 1 }
|
|
751
|
-
* ```
|
|
752
|
-
*/
|
|
753
|
-
scissor: Scissor;
|
|
754
|
-
/**
|
|
755
|
-
* 当前使用的 THREE.WebGLRenderer。
|
|
756
|
-
* @description
|
|
757
|
-
* 如果初始化时传入了 `renderer` 则直接时该值
|
|
758
|
-
* 否则会通过 `preserveDrawingBuffer` `backgroundColor` `backgroundAlpha` `antialias` 创建一个 `THREE.WebGLRenderer`
|
|
943
|
+
* 是否使用webgl2渲染执行环境, 默认值 false
|
|
759
944
|
*/
|
|
760
|
-
|
|
761
|
-
/** 当前加载的模型 */
|
|
762
|
-
models: Models;
|
|
945
|
+
webgl2?: boolean;
|
|
763
946
|
/**
|
|
764
|
-
*
|
|
765
|
-
* @
|
|
766
|
-
*
|
|
767
|
-
* 可以通过设置 `five.needsRender = true` 来告知,five 会在下一帧渲染画面。
|
|
947
|
+
* 请求代理
|
|
948
|
+
* @param url - 发起的请求
|
|
949
|
+
* @returns 返回的请求
|
|
768
950
|
*/
|
|
769
|
-
|
|
951
|
+
requestProxy?(url: string): string | Promise<string>;
|
|
952
|
+
}
|
|
953
|
+
|
|
954
|
+
export declare interface FiveLoadOptions {
|
|
955
|
+
/** 切换运动时间 */
|
|
956
|
+
duration?: number;
|
|
957
|
+
/** 切换运动全景图效果 */
|
|
958
|
+
effect?: MovePanoEffect;
|
|
959
|
+
/** 全景图游走模式下的特定参数 */
|
|
960
|
+
panorama?: ControllerCustomInitTypes["Panorama"];
|
|
961
|
+
/** 模型游走模式下的特定参数 */
|
|
962
|
+
model?: ControllerCustomInitTypes["Model"];
|
|
963
|
+
/** 模型查看模式下的特定参数 */
|
|
964
|
+
floorplan?: ControllerCustomInitTypes["Floorplan"];
|
|
965
|
+
/** 户型图模式下的特定参数 */
|
|
966
|
+
topview?: ControllerCustomInitTypes["Topview"];
|
|
967
|
+
/** 地图模式下的特定参数 */
|
|
968
|
+
mapview?: ControllerCustomInitTypes["Mapview"];
|
|
969
|
+
/** VR眼镜模式下的特定参数 */
|
|
970
|
+
vrPanorama?: ControllerCustomInitTypes["VRPanorama"];
|
|
971
|
+
/** XR眼镜模式下的特定参数 */
|
|
972
|
+
xrPanorama?: ControllerCustomInitTypes["XRPanorama"];
|
|
770
973
|
/**
|
|
771
974
|
* 全景图的配置参数
|
|
772
975
|
* @description
|
|
773
976
|
* 可以动态对配置在 `work` 数据中的全景图片在 runtime 做 url 调整。
|
|
774
977
|
* 平衡加载时间和图片质量
|
|
775
978
|
*/
|
|
776
|
-
imageOptions
|
|
979
|
+
imageOptions?: ImageOptions;
|
|
777
980
|
/**
|
|
778
981
|
* 模型贴图的配置参数
|
|
779
982
|
* @description
|
|
780
983
|
* 可以动态对配置在 `work` 数据中的模型贴图在 runtime 做 url 调整。
|
|
781
984
|
* 平衡加载时间和图片质量
|
|
782
985
|
*/
|
|
783
|
-
textureOptions
|
|
986
|
+
textureOptions?: TextureOptions;
|
|
987
|
+
"3d-tiles"?: {
|
|
988
|
+
/** 调试模式 */
|
|
989
|
+
debug?: boolean;
|
|
990
|
+
/** 显示图层 */
|
|
991
|
+
showLayers?: boolean | string[];
|
|
992
|
+
/** 可观测区域 */
|
|
993
|
+
viewerRequestVolume?: BoundingVolume;
|
|
994
|
+
/** 模型显示最小细化层级 */
|
|
995
|
+
minLevelOfDetail?: number;
|
|
996
|
+
/** 模型显示最大细化层级 */
|
|
997
|
+
maxLevelOfDetail?: number;
|
|
998
|
+
/** 模型最大内存缓存 */
|
|
999
|
+
maxMemoryUsage?: number;
|
|
1000
|
+
/** 模型网络最大请求并发数 */
|
|
1001
|
+
maxRequests?: number;
|
|
1002
|
+
/** 模型屏幕空间误差计算最大值 */
|
|
1003
|
+
maxScreenSpaceError?: number;
|
|
1004
|
+
};
|
|
1005
|
+
}
|
|
1006
|
+
|
|
1007
|
+
/**
|
|
1008
|
+
* Five 插件
|
|
1009
|
+
* [[include:plugins.md]]
|
|
1010
|
+
* @template Parameters - 插件参数, 没有参数则为 void
|
|
1011
|
+
* @template Returns - 如果有参数则插件暴露的 api,没有参数则不传
|
|
1012
|
+
*/
|
|
1013
|
+
export declare type FivePlugin<Parameters = void, Returns = void> = Parameters extends void ? ((five: Five) => Returns) : ((five: Five, parameters: Parameters) => Returns);
|
|
1014
|
+
|
|
1015
|
+
/**
|
|
1016
|
+
* 获取插件在Five中的初始化结构
|
|
1017
|
+
* @template T - Five 插件
|
|
1018
|
+
*/
|
|
1019
|
+
export declare type FivePluginInit<T extends FivePlugin<any, any>> = Parameters<T>[1] extends undefined ? [
|
|
1020
|
+
Plugin: T,
|
|
1021
|
+
instanceName: null | string
|
|
1022
|
+
] : [
|
|
1023
|
+
Plugin: T,
|
|
1024
|
+
instanceName: null | string,
|
|
1025
|
+
parameters: Parameters<T>[1]
|
|
1026
|
+
];
|
|
1027
|
+
|
|
1028
|
+
/**
|
|
1029
|
+
* 获取插件暴露的 api
|
|
1030
|
+
* @template T - Five 插件
|
|
1031
|
+
*/
|
|
1032
|
+
export declare type FivePluginInstance<T extends FivePlugin<any, any>> = ReturnType<T>;
|
|
1033
|
+
|
|
1034
|
+
export declare interface FloorplanControllerCustomInitArgs {
|
|
1035
|
+
/** 默认水平角 */
|
|
1036
|
+
defaultLongitude?: number;
|
|
1037
|
+
/** 默认俯仰角 */
|
|
1038
|
+
defaultLatitude?: number;
|
|
1039
|
+
/** 最大俯仰角 */
|
|
1040
|
+
maxLatitude?: number;
|
|
1041
|
+
/** 最小俯仰角 */
|
|
1042
|
+
minLatitude?: number;
|
|
1043
|
+
/** 默认相机可视角度(垂直),可作为 `zoom` */
|
|
1044
|
+
defaultFov?: number;
|
|
1045
|
+
/** 最大相机可视角度 */
|
|
1046
|
+
maxFov?: number;
|
|
1047
|
+
/** 最小相机可视角度 */
|
|
1048
|
+
minFov?: number;
|
|
1049
|
+
/** 鼠标焦点环自定义创建器 */
|
|
1050
|
+
intersectMeshCreator?: () => IntersectMeshInterface;
|
|
1051
|
+
}
|
|
1052
|
+
|
|
1053
|
+
export declare interface GestureEvent extends StateEvent {
|
|
1054
|
+
target: EventTarget | null;
|
|
1055
|
+
pointerType: 'touch' | 'pen' | 'mouse' | 'kinect';
|
|
1056
|
+
srcEvent: MouseEvent | TouchEvent | PointerEvent;
|
|
1057
|
+
pointers: {
|
|
1058
|
+
x: number;
|
|
1059
|
+
y: number;
|
|
1060
|
+
delta: number;
|
|
1061
|
+
buttons: number;
|
|
1062
|
+
coords: THREE_2.Vector2;
|
|
1063
|
+
raycaster: THREE_2.Raycaster;
|
|
1064
|
+
}[];
|
|
1065
|
+
isFirst: boolean;
|
|
1066
|
+
isFinal: boolean;
|
|
1067
|
+
scale: number;
|
|
1068
|
+
center: {
|
|
1069
|
+
x: number;
|
|
1070
|
+
y: number;
|
|
1071
|
+
delta: number;
|
|
1072
|
+
buttons: number;
|
|
1073
|
+
coords: THREE_2.Vector2;
|
|
1074
|
+
raycaster: THREE_2.Raycaster;
|
|
1075
|
+
};
|
|
1076
|
+
velocityX: number;
|
|
1077
|
+
velocityY: number;
|
|
1078
|
+
overallVelocityX: number;
|
|
1079
|
+
overallVelocityY: number;
|
|
1080
|
+
}
|
|
1081
|
+
|
|
1082
|
+
export declare type GestureTypes = "pan" | "tap" | "pinch" | "press" | "mouseWheel" | "mouseMove";
|
|
1083
|
+
|
|
1084
|
+
export declare function getViewportScale(): number;
|
|
1085
|
+
|
|
1086
|
+
/**
|
|
1087
|
+
* 图片参数
|
|
1088
|
+
*/
|
|
1089
|
+
export declare interface ImageOptions {
|
|
784
1090
|
/**
|
|
785
|
-
*
|
|
786
|
-
* @
|
|
787
|
-
*
|
|
1091
|
+
* url 地址转化
|
|
1092
|
+
* @param url - 原始地址
|
|
1093
|
+
* @param options - 当前地址参数
|
|
1094
|
+
* @returns 转化后地址
|
|
788
1095
|
*/
|
|
789
|
-
|
|
1096
|
+
transform?: (url: string, options: ImageURLOptions) => string;
|
|
1097
|
+
/** 图片尺寸参数 尽量使用 2 的幂次 如 512 1024 2048 */
|
|
1098
|
+
size?: number;
|
|
1099
|
+
/** 图片质量参数(0-100) */
|
|
1100
|
+
quality?: number;
|
|
1101
|
+
/** 图片格式参数 */
|
|
1102
|
+
format?: "jpg" | "png" | "heif" | "webp" | "avif";
|
|
1103
|
+
/** 锐化参数 海外不支持 */
|
|
1104
|
+
sharpen?: number;
|
|
1105
|
+
mappings?: ImageURLMappings;
|
|
1106
|
+
}
|
|
1107
|
+
|
|
1108
|
+
export declare function imageSupport(): Promise<{
|
|
1109
|
+
webp: boolean;
|
|
1110
|
+
avif: boolean;
|
|
1111
|
+
heif: boolean;
|
|
1112
|
+
}>;
|
|
1113
|
+
|
|
1114
|
+
export declare interface ImageURLMappings {
|
|
1115
|
+
[publicDomain: string]: {
|
|
1116
|
+
"type"?: string;
|
|
1117
|
+
"pano": [string, string];
|
|
1118
|
+
"tile": [string, string];
|
|
1119
|
+
"model": [string, string];
|
|
1120
|
+
"texture": [string];
|
|
1121
|
+
"default": [string];
|
|
1122
|
+
};
|
|
1123
|
+
}
|
|
1124
|
+
|
|
1125
|
+
export declare interface ImageURLOptions {
|
|
1126
|
+
/** 图片类型标识 */
|
|
1127
|
+
key: string;
|
|
1128
|
+
/** 图片尺寸参数 尽量使用 2 的幂次 如 256 512 1024 */
|
|
1129
|
+
size?: number;
|
|
1130
|
+
/** 图片质量参数(0-100) */
|
|
1131
|
+
quality?: number;
|
|
1132
|
+
/** 图片格式参数 */
|
|
1133
|
+
format?: "jpg" | "png" | "heif" | "webp" | "avif";
|
|
1134
|
+
/** 图片裁切 */
|
|
1135
|
+
cut?: [x: number, y: number, width: number, height: number];
|
|
1136
|
+
/** 锐化参数 海外不支持 */
|
|
1137
|
+
sharpen?: number;
|
|
1138
|
+
/** url匹配规则 */
|
|
1139
|
+
mappings?: ImageURLMappings;
|
|
1140
|
+
}
|
|
1141
|
+
|
|
1142
|
+
export declare class InternalWebGLRenderer extends THREE_2.WebGLRenderer {
|
|
1143
|
+
constructor({ preserveDrawingBuffer, premultipliedAlpha, stencil, backgroundColor, backgroundAlpha, pixelRatio, antialias, webgl2, }: {
|
|
1144
|
+
preserveDrawingBuffer?: boolean;
|
|
1145
|
+
premultipliedAlpha?: boolean;
|
|
1146
|
+
stencil?: boolean;
|
|
1147
|
+
backgroundColor?: number | THREE_2.Color;
|
|
1148
|
+
backgroundAlpha?: number;
|
|
1149
|
+
pixelRatio?: number;
|
|
1150
|
+
antialias?: boolean;
|
|
1151
|
+
webgl2?: boolean;
|
|
1152
|
+
});
|
|
1153
|
+
}
|
|
1154
|
+
|
|
1155
|
+
export declare interface IntersectEvent extends BaseEvent {
|
|
1156
|
+
object: THREE_2.Object3D;
|
|
1157
|
+
raycaster: THREE_2.Raycaster;
|
|
1158
|
+
intersection: Intersection | null;
|
|
1159
|
+
}
|
|
1160
|
+
|
|
1161
|
+
export declare interface Intersection extends THREE_2.Intersection {
|
|
1162
|
+
/** 楼层 */
|
|
1163
|
+
floor: number;
|
|
1164
|
+
model?: Model;
|
|
1165
|
+
viewLayer?: ModelViewLayer;
|
|
1166
|
+
}
|
|
1167
|
+
|
|
1168
|
+
export declare class IntersectMesh extends THREE_2.Object3D implements IntersectMeshInterface {
|
|
1169
|
+
private ringMesh;
|
|
1170
|
+
constructor();
|
|
1171
|
+
dispose(): void;
|
|
1172
|
+
}
|
|
1173
|
+
|
|
1174
|
+
/**
|
|
1175
|
+
* 地面提示点位接口
|
|
1176
|
+
*/
|
|
1177
|
+
export declare interface IntersectMeshInterface extends THREE_2.Object3D {
|
|
1178
|
+
dispose(): void;
|
|
1179
|
+
}
|
|
1180
|
+
|
|
1181
|
+
export declare function isPanoId(id: any): id is PanoId;
|
|
1182
|
+
|
|
1183
|
+
/**
|
|
1184
|
+
* 过时的事件列表
|
|
1185
|
+
*/
|
|
1186
|
+
export declare type LegacyEventType = {
|
|
790
1187
|
/**
|
|
791
|
-
*
|
|
792
|
-
* @
|
|
793
|
-
*
|
|
794
|
-
*
|
|
1188
|
+
* 模态间切换动画开始
|
|
1189
|
+
* @param panoIndex - 当前点位
|
|
1190
|
+
* @param pose - 相机姿态
|
|
1191
|
+
* @param userAction - 是否用户触发
|
|
795
1192
|
*/
|
|
796
|
-
|
|
1193
|
+
initAnimationWillStart(panoIndex: number, pose: Pose, userAction: boolean): void;
|
|
797
1194
|
/**
|
|
798
|
-
*
|
|
799
|
-
* @
|
|
800
|
-
*
|
|
801
|
-
*
|
|
802
|
-
*
|
|
803
|
-
* - mode: Mode
|
|
804
|
-
* - panoIndex: number
|
|
805
|
-
* - longitude: number
|
|
806
|
-
* - latitude: number
|
|
807
|
-
* - fov: number
|
|
808
|
-
* - offset: THREE.Vector3
|
|
809
|
-
*
|
|
810
|
-
* 可以通过 five.state 和 five.setState 来获取和设置。
|
|
811
|
-
* 通过 state 设置后,five 会通过合适的动画运动来达到设置的位置。
|
|
812
|
-
* 来迎合一些通过数据驱动的场景。
|
|
813
|
-
* ```
|
|
1195
|
+
* 模态间切换动画结束
|
|
1196
|
+
* @param panoIndex - 当前点位
|
|
1197
|
+
* @param pose - 相机姿态
|
|
1198
|
+
* @param userAction - 是否用户触发
|
|
814
1199
|
*/
|
|
815
|
-
|
|
816
|
-
/** 插件暴露的方法 */
|
|
817
|
-
plugins: {
|
|
818
|
-
[key: string]: FivePluginInstance<any>;
|
|
819
|
-
};
|
|
820
|
-
ident: string;
|
|
821
|
-
/** 包围盒子 */
|
|
822
|
-
private boundingMesh;
|
|
823
|
-
private stopAnimationLoop?;
|
|
824
|
-
private fps;
|
|
825
|
-
private modelGroup;
|
|
826
|
-
private helperGroup;
|
|
827
|
-
private modeChangeDuration;
|
|
828
|
-
private onlyRenderIfNeeds;
|
|
829
|
-
private poweredByRealsee;
|
|
830
|
-
private controller?;
|
|
831
|
-
private destroyed;
|
|
832
|
-
private stateSynced;
|
|
833
|
-
private controllerInits;
|
|
834
|
-
private extraElements;
|
|
835
|
-
private getPixelsRenderTarget;
|
|
836
|
-
private readyCallbacks;
|
|
837
|
-
private modelPending;
|
|
838
|
-
private syncingState;
|
|
1200
|
+
initAnimationEnded(panoIndex: number, pose: Pose, userAction: boolean): void;
|
|
839
1201
|
/**
|
|
840
|
-
*
|
|
841
|
-
*
|
|
842
|
-
*
|
|
1202
|
+
* 意图要触发手势, 可以通过 `return false` 阻止
|
|
1203
|
+
* @param type - 手势类型
|
|
1204
|
+
* @param pointers - 手指位置
|
|
1205
|
+
* @param final - 是否手势结束
|
|
1206
|
+
* @returns 可以通过 `return false` 阻止
|
|
843
1207
|
*/
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
private analysis?;
|
|
850
|
-
private renderSwitch01;
|
|
1208
|
+
wantsGesture(type: GestureTypes, pointers: {
|
|
1209
|
+
x: number;
|
|
1210
|
+
y: number;
|
|
1211
|
+
delta?: number;
|
|
1212
|
+
}[], final: boolean): void | false;
|
|
851
1213
|
/**
|
|
852
|
-
*
|
|
1214
|
+
* 手势 触发
|
|
1215
|
+
* @param type - 手势类型
|
|
1216
|
+
* @param pointers - 手指位置
|
|
1217
|
+
* @param final - 是否手势结束
|
|
853
1218
|
*/
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
get panoIndex(): number;
|
|
1219
|
+
gesture(type: GestureTypes, pointers: {
|
|
1220
|
+
x: number;
|
|
1221
|
+
y: number;
|
|
1222
|
+
delta?: number;
|
|
1223
|
+
}[], final: boolean): void;
|
|
860
1224
|
/**
|
|
861
|
-
*
|
|
862
|
-
* @param
|
|
863
|
-
* @param
|
|
864
|
-
* @
|
|
865
|
-
* @param color - 指定的模型颜色
|
|
866
|
-
* @returns 选中 mesh 的 uuid
|
|
1225
|
+
* 意图要触发 pan 手势(滑动屏幕), 可以通过 `return false` 阻止
|
|
1226
|
+
* @param pose - 意图的相机姿态
|
|
1227
|
+
* @param final - 是否手势结束
|
|
1228
|
+
* @returns 可以通过 `return false` 阻止
|
|
867
1229
|
*/
|
|
868
|
-
|
|
869
|
-
[key: string]: THREE_2.Color;
|
|
870
|
-
}, pixelRatio?: number, color?: THREE_2.Vector3): string | false;
|
|
1230
|
+
wantsPanGesture(pose: Pose, final: boolean): void | false;
|
|
871
1231
|
/**
|
|
872
|
-
*
|
|
873
|
-
* @
|
|
874
|
-
*
|
|
875
|
-
* 你可以新建一个新的。
|
|
1232
|
+
* pan 手势(滑动屏幕) 被触发
|
|
1233
|
+
* @param pose - 相机姿态
|
|
1234
|
+
* @param final - 是否手势结束
|
|
876
1235
|
*/
|
|
877
|
-
|
|
1236
|
+
panGesture(pose: Pose, final: boolean): void;
|
|
878
1237
|
/**
|
|
879
|
-
*
|
|
880
|
-
* @param
|
|
881
|
-
*
|
|
882
|
-
*
|
|
883
|
-
*
|
|
884
|
-
* @example
|
|
885
|
-
* ```
|
|
886
|
-
* five.setScissor({ left: 0.75, bottom: 0, width: 0.25, height: 1 })
|
|
887
|
-
* ```
|
|
1238
|
+
* 意图要触发 tap 手势(点击屏幕), 可以通过 `return false` 阻止
|
|
1239
|
+
* @param raycaster - 点击对应的三维射线
|
|
1240
|
+
* @param tapPosition - 点击对应的屏幕位置
|
|
1241
|
+
* @param final - 是否手势结束
|
|
1242
|
+
* @returns 可以通过 `return false` 阻止
|
|
888
1243
|
*/
|
|
889
|
-
|
|
1244
|
+
wantsTapGesture(raycaster: THREE_2.Raycaster, tapPosition: THREE_2.Vector2, final: boolean): void | false;
|
|
890
1245
|
/**
|
|
891
|
-
*
|
|
1246
|
+
* tap 手势(点击屏幕) 被触发
|
|
1247
|
+
* @param raycaster - 点击对应的三维射线
|
|
1248
|
+
* @param tapPosition - 点击对应的屏幕位置
|
|
1249
|
+
* @param final - 是否手势结束
|
|
892
1250
|
*/
|
|
893
|
-
|
|
894
|
-
set helperVisible(visible: boolean);
|
|
1251
|
+
tapGesture(raycaster: THREE_2.Raycaster, tapPosition: THREE_2.Vector2, final: boolean): void;
|
|
895
1252
|
/**
|
|
896
|
-
*
|
|
897
|
-
*
|
|
898
|
-
*
|
|
1253
|
+
* 意图要触发 pinch 手势(双指缩放),可以通过 `return false` 阻止
|
|
1254
|
+
* @param scale - 缩放数值
|
|
1255
|
+
* @param nextFov - 意图的fov变更
|
|
1256
|
+
* @param final - 是否手势结束
|
|
1257
|
+
* @returns 可以通过 `return false` 阻止
|
|
899
1258
|
*/
|
|
900
|
-
|
|
901
|
-
|
|
1259
|
+
wantsPinchGesture(scale: number, nextFov: number, final: boolean): void | false;
|
|
1260
|
+
/**
|
|
1261
|
+
* 意图要触发 press 手势(长按屏幕), 可以通过 `return false` 阻止
|
|
1262
|
+
* @param raycaster - 长按对应的三维射线
|
|
1263
|
+
* @param tapPosition - 长按对应的屏幕位置
|
|
1264
|
+
* @param duration - 长按持续时间
|
|
1265
|
+
* @param final - 是否手势结束
|
|
1266
|
+
* @returns 可以通过 `return false` 阻止
|
|
1267
|
+
*/
|
|
1268
|
+
wantsPressGesture(raycaster: THREE_2.Raycaster, tapPosition: THREE_2.Vector2, duration: number, isFinal: boolean): void | false;
|
|
1269
|
+
/**
|
|
1270
|
+
* tap 手势(点击屏幕) 被触发
|
|
1271
|
+
* @param raycaster - 点击对应的三维射线
|
|
1272
|
+
* @param tapPosition - 点击对应的屏幕位置
|
|
1273
|
+
* @param duration - 长按持续时间
|
|
1274
|
+
* @param final - 是否手势结束
|
|
1275
|
+
*/
|
|
1276
|
+
pressGesture(raycaster: THREE_2.Raycaster, tapPosition: THREE_2.Vector2, duration: number, isFinal: boolean): void;
|
|
1277
|
+
/**
|
|
1278
|
+
* pinch 手势(双指缩放) 被触发
|
|
1279
|
+
* @param scale - 缩放数值
|
|
1280
|
+
* @param nextFov - 意图的fov变更
|
|
1281
|
+
* @param final - 是否手势结束
|
|
1282
|
+
*/
|
|
1283
|
+
pinchGesture(scale: number, fov: number, final: boolean): void;
|
|
902
1284
|
/**
|
|
903
|
-
*
|
|
1285
|
+
* 意图要触发 鼠标滚轮 可以通过 `return false` 阻止
|
|
1286
|
+
* @param delta - 滚轮数值
|
|
1287
|
+
* @param nextFov - 意图的fov变更
|
|
1288
|
+
* @param final - 是否手势结束
|
|
1289
|
+
* @returns 可以通过 `return false` 阻止
|
|
904
1290
|
*/
|
|
905
|
-
|
|
906
|
-
set enableEDL(enable: boolean);
|
|
1291
|
+
wantsMouseWheel(delta: number, nextFov: number, final: boolean): void | false;
|
|
907
1292
|
/**
|
|
908
|
-
*
|
|
1293
|
+
* 鼠标滚轮被触发
|
|
1294
|
+
* @param delta - 滚轮数值
|
|
1295
|
+
* @param nextFov - 意图的fov变更
|
|
1296
|
+
* @param final - 是否手势结束
|
|
909
1297
|
*/
|
|
910
|
-
|
|
911
|
-
set enablePostProcessing(enable: boolean);
|
|
912
|
-
updateConfiguration(args: Pick<FiveInitArgs, "panorama" | "model" | "floorplan" | "topview" | "mapview" | "depthPanorama" | "vrPanorama" | "imageOptions" | "textureOptions">): void;
|
|
1298
|
+
mouseWheel(delta: number, fov: number, final: boolean): void;
|
|
913
1299
|
/**
|
|
914
|
-
*
|
|
915
|
-
* @
|
|
916
|
-
*
|
|
917
|
-
*
|
|
918
|
-
* @param element - 加载到页面的 DOM 元素
|
|
919
|
-
* @param size - 显示区域尺寸 默认铺满这个 DOM 元素
|
|
1300
|
+
* 意图要触发 pan 手势(滑动屏幕) 的惯性运动, 可以通过 `return false` 阻止
|
|
1301
|
+
* @param pose - 意图的相机姿态
|
|
1302
|
+
* @param final - 是否手势结束
|
|
1303
|
+
* @returns 可以通过 `return false` 阻止
|
|
920
1304
|
*/
|
|
921
|
-
|
|
922
|
-
width?: number;
|
|
923
|
-
height?: number;
|
|
924
|
-
}): void;
|
|
1305
|
+
wantsInteriaPan(pose: Pose): void | false;
|
|
925
1306
|
/**
|
|
926
|
-
*
|
|
927
|
-
* @
|
|
928
|
-
*
|
|
929
|
-
*
|
|
930
|
-
* @param size - 显示区域尺寸 默认铺满这个 DOM 元素
|
|
931
|
-
* @param pixelRatio - 像素比 默认继承之前的设置
|
|
1307
|
+
* pan 手势(滑动屏幕) 的惯性运动
|
|
1308
|
+
* @param pose - 意图的相机姿态
|
|
1309
|
+
* @param final - 是否手势结束
|
|
932
1310
|
*/
|
|
933
|
-
|
|
934
|
-
width?: number;
|
|
935
|
-
height?: number;
|
|
936
|
-
}, pixelRatio?: number): void;
|
|
1311
|
+
interiaPan(pose: Pose, final: boolean): void;
|
|
937
1312
|
/**
|
|
938
|
-
*
|
|
939
|
-
* @
|
|
1313
|
+
* 意图要变化相机的可视角度 可以通过 `return false` 阻止
|
|
1314
|
+
* @deprecated
|
|
1315
|
+
* 建议通过 初始化设置的 `defaultFov`, `maxFov`, `minFov` 来限制
|
|
1316
|
+
* @param fov - 意图要变化相机的可视角度
|
|
1317
|
+
* @returns 可以通过 `return false` 阻止
|
|
940
1318
|
*/
|
|
941
|
-
|
|
1319
|
+
wantsChangeCameraFov(fov: number): void | false;
|
|
942
1320
|
/**
|
|
943
|
-
*
|
|
1321
|
+
* 相机姿态变化
|
|
1322
|
+
* @param pose - 相机姿态
|
|
1323
|
+
* @param userAction - 是否用户触发
|
|
944
1324
|
*/
|
|
945
|
-
|
|
1325
|
+
cameraUpdate(pose: Pose, userAction: boolean): void;
|
|
946
1326
|
/**
|
|
947
|
-
*
|
|
1327
|
+
* 相机姿态中可视角度变化
|
|
1328
|
+
* @param fov - 相机的可视角度
|
|
1329
|
+
* @param userAction - 是否用户触发
|
|
948
1330
|
*/
|
|
949
|
-
|
|
950
|
-
getSize(target: THREE_2.Vector2): THREE_2.Vector2;
|
|
951
|
-
getDrawingBufferSize(target: THREE_2.Vector2): THREE_2.Vector2;
|
|
1331
|
+
cameraFovUpdate(fov: Pose["fov"], userAction: boolean): void;
|
|
952
1332
|
/**
|
|
953
|
-
*
|
|
954
|
-
* @
|
|
955
|
-
* 如果动画中途被打断(用户触发行为,或者调用 setState, load, changeMode)的等
|
|
956
|
-
* 会 Promise.reject。运动完成则 Promise.resolve
|
|
957
|
-
* @param pose - 相机目标位置
|
|
958
|
-
* @param duration - 动画触发的时常
|
|
1333
|
+
* 相机姿态中相机位置变化
|
|
1334
|
+
* @param offset - 相机位置
|
|
959
1335
|
* @param userAction - 是否用户触发
|
|
960
|
-
* @returns Promise 是否移动成功
|
|
961
1336
|
*/
|
|
962
|
-
|
|
1337
|
+
cameraPositionUpdate(offset: Pose["offset"], userAction: boolean): void;
|
|
963
1338
|
/**
|
|
964
|
-
*
|
|
965
|
-
* @
|
|
966
|
-
* 如果动画中途被打断(用户触发行为,或者调用 setState, load, changeMode)的等
|
|
967
|
-
* 会 Promise.reject。运动完成则 Promise.resolve
|
|
968
|
-
* @param keyframes - 动画帧
|
|
969
|
-
* @param duration - 动画触发的时常
|
|
1339
|
+
* 相机姿态中相机方向变化
|
|
1340
|
+
* @param coordinates - 相机姿态的俯仰角和偏航角
|
|
970
1341
|
* @param userAction - 是否用户触发
|
|
971
|
-
* @returns Promise 是否移动成功
|
|
972
1342
|
*/
|
|
973
|
-
|
|
1343
|
+
cameraDirectionUpdate(coordinates: Pick<Pose, "longitude" | "latitude">, userAction: boolean): void;
|
|
974
1344
|
/**
|
|
975
|
-
*
|
|
976
|
-
* @
|
|
1345
|
+
* 鼠标焦点环位置被重新计算
|
|
1346
|
+
* @param intersection - 焦点碰撞结果
|
|
1347
|
+
* @param mesh - 焦点环 mesh
|
|
977
1348
|
*/
|
|
978
|
-
|
|
1349
|
+
intersectionOnModelUpdate(intersection: Intersection, mesh: THREE_2.Object3D): void;
|
|
979
1350
|
/**
|
|
980
|
-
*
|
|
981
|
-
* @
|
|
1351
|
+
* 意图要展示鼠标焦点环,可以通过 `return false` 阻止
|
|
1352
|
+
* @param intersection - 焦点碰撞结果
|
|
1353
|
+
* @returns 可以通过 `return false` 阻止
|
|
982
1354
|
*/
|
|
983
|
-
|
|
1355
|
+
wantsShowIntersectionOnModel(raycaster: THREE_2.Raycaster): void | false;
|
|
1356
|
+
/** 鼠标焦点环被隐藏 */
|
|
1357
|
+
intersectionHidden(): void;
|
|
984
1358
|
/**
|
|
985
|
-
*
|
|
986
|
-
* @
|
|
1359
|
+
* 意图要移动到某个点时, 可以通过 return false 阻止
|
|
1360
|
+
* @param panoIndex - 意图要移动到点位
|
|
1361
|
+
* @param options - 移动参数
|
|
1362
|
+
* @param userAction - 是否用户触发
|
|
1363
|
+
* @returns 可以通过 return false 阻止
|
|
987
1364
|
*/
|
|
988
|
-
|
|
989
|
-
theta: number;
|
|
990
|
-
phi: number;
|
|
991
|
-
lookAtVector: THREE_2.Vector3;
|
|
992
|
-
};
|
|
993
|
-
/** 当前加载的 work 数据 */
|
|
994
|
-
get works(): Works;
|
|
995
|
-
get work(): Work | undefined;
|
|
996
|
-
get model(): Model;
|
|
1365
|
+
wantsMoveToPano(panoIndex: number, options: MovePanoOptions, userAction: boolean): void | false;
|
|
997
1366
|
/**
|
|
998
|
-
*
|
|
999
|
-
* @
|
|
1000
|
-
* @param
|
|
1001
|
-
*
|
|
1002
|
-
*
|
|
1003
|
-
*
|
|
1004
|
-
* @param duration - 切换时间
|
|
1367
|
+
* 同 wantsMoveToPano
|
|
1368
|
+
* @description
|
|
1369
|
+
* @param panoIndex - 意图要移动到点位
|
|
1370
|
+
* @param options - 移动参数
|
|
1371
|
+
* @param userAction - 是否用户触发
|
|
1372
|
+
* @returns 可以通过 return false 阻止
|
|
1005
1373
|
*/
|
|
1006
|
-
|
|
1007
|
-
private load_;
|
|
1374
|
+
wantsToMoveToPano(panoIndex: number, options: MovePanoOptions, userAction: boolean): void;
|
|
1008
1375
|
/**
|
|
1009
|
-
*
|
|
1010
|
-
* @param
|
|
1011
|
-
* @param state - 切换完成时的姿态
|
|
1012
|
-
* @param duration - 模态切换动画用时
|
|
1013
|
-
* @param userAction - 是否时用户动作触发 默认 true
|
|
1014
|
-
* @param force - 必须重新初始化 controller
|
|
1376
|
+
* 观察点位被选择
|
|
1377
|
+
* @param panoIndex - 选择的点位
|
|
1015
1378
|
*/
|
|
1016
|
-
|
|
1379
|
+
panoSelected(panoIndex: number | null): void;
|
|
1017
1380
|
/**
|
|
1018
|
-
*
|
|
1019
|
-
* @
|
|
1020
|
-
*
|
|
1021
|
-
*
|
|
1022
|
-
*
|
|
1023
|
-
* @param
|
|
1024
|
-
* @
|
|
1381
|
+
* 开始加载并移动到某个观察点位
|
|
1382
|
+
* @description
|
|
1383
|
+
* 可 panoWillArrive 相比
|
|
1384
|
+
* - moveToPano 在加载全景图资源前触发
|
|
1385
|
+
* - panoWillArrive 在加载全景图资源后触发
|
|
1386
|
+
* @param panoIndex - 移动到的点位
|
|
1387
|
+
* @param userAction - 是否用户触发
|
|
1025
1388
|
*/
|
|
1026
|
-
|
|
1389
|
+
moveToPano(panoIndex: number, userAction: boolean): void;
|
|
1027
1390
|
/**
|
|
1028
|
-
*
|
|
1391
|
+
* 移动中, 会告知移动状态(耗时百分比)
|
|
1392
|
+
* @param panoIndex - 将要移动到的点位下标
|
|
1393
|
+
* @param prevPanoIndex - 上一个点位下标
|
|
1394
|
+
* @param progress - 整个过程经度 [0-1]
|
|
1029
1395
|
*/
|
|
1030
|
-
|
|
1396
|
+
movingToPano(panoIndex: number, prevPanoIndex: number, progress: number): void;
|
|
1031
1397
|
/**
|
|
1032
|
-
*
|
|
1398
|
+
* 开始加载某个观察点的全景资源
|
|
1399
|
+
* @param pano - 移动到的点位
|
|
1033
1400
|
*/
|
|
1034
|
-
|
|
1401
|
+
panoWillLoad(panoIndex: number): void;
|
|
1035
1402
|
/**
|
|
1036
|
-
*
|
|
1037
|
-
* @
|
|
1038
|
-
* 调用 `five.render()` 和设置 `five.needsRender = true` 均可在按需渲染时,使得画面渲染一次
|
|
1039
|
-
* 区别在于:
|
|
1040
|
-
* - `five.needsRender = true` 为在下帧渲染画面
|
|
1041
|
-
* - `five.render()` 在当前帧渲染画面
|
|
1042
|
-
* 推荐使用 `five.needsRender = true`, 可以更加流畅。但是如果需要截图等同步操作,可以使用 `five.render()`
|
|
1043
|
-
*
|
|
1044
|
-
* @param callback - 渲染完成回调
|
|
1403
|
+
* 某个观察点的全景资源加载完成
|
|
1404
|
+
* @param panoIndex - 对应的点位
|
|
1045
1405
|
*/
|
|
1046
|
-
|
|
1047
|
-
updateTime(time: number, deltaTime: number, ...args: any[]): void;
|
|
1406
|
+
panoLoaded(panoIndex: number): void;
|
|
1048
1407
|
/**
|
|
1049
|
-
*
|
|
1408
|
+
* 开始移动到某个观察点位
|
|
1409
|
+
* @description
|
|
1410
|
+
* 和 moveToPano 相比
|
|
1411
|
+
* - moveToPano 在加载全景图资源前触发
|
|
1412
|
+
* - panoWillArrive 在加载全景图资源后触发
|
|
1413
|
+
* @param panoIndex - 移动到点位
|
|
1414
|
+
* @param pose - 相机姿态
|
|
1415
|
+
* @param userAction - 是否用户触发
|
|
1050
1416
|
*/
|
|
1051
|
-
|
|
1052
|
-
play(): void;
|
|
1417
|
+
panoWillArrive(panoIndex: number, pose: Pose, userAction: boolean): void;
|
|
1053
1418
|
/**
|
|
1054
|
-
*
|
|
1055
|
-
* @param panoIndex -
|
|
1056
|
-
* @param
|
|
1057
|
-
* @param userAction -
|
|
1419
|
+
* 移动到某个观察点位
|
|
1420
|
+
* @param panoIndex - 移动到点位
|
|
1421
|
+
* @param pose - 相机姿态
|
|
1422
|
+
* @param userAction - 是否用户触发
|
|
1058
1423
|
*/
|
|
1059
|
-
|
|
1060
|
-
moveToPano(panoIndex: number, options?: MovePanoOptions, userAction?: boolean): Promise<void>;
|
|
1424
|
+
panoArrived(panoIndex: number, pose: Pose, userAction: boolean): void;
|
|
1061
1425
|
/**
|
|
1062
|
-
*
|
|
1063
|
-
* @param
|
|
1064
|
-
* @param
|
|
1065
|
-
* @returns 加载完成的 Promise 参数同 callback
|
|
1426
|
+
* 某个观察点的全景资源加载失败
|
|
1427
|
+
* @param error - 错误对象
|
|
1428
|
+
* @param panoIndex - 对应的点位
|
|
1066
1429
|
*/
|
|
1067
|
-
|
|
1068
|
-
preloadPano(panoIndex: number, callback?: (costs: number) => void): Promise<number>;
|
|
1430
|
+
panoLoadError(error: Error, panoIndex: number): void;
|
|
1069
1431
|
/**
|
|
1070
|
-
*
|
|
1432
|
+
* 移动到某个观察点位被取消
|
|
1071
1433
|
* @description
|
|
1072
|
-
*
|
|
1073
|
-
*
|
|
1074
|
-
*
|
|
1075
|
-
*
|
|
1434
|
+
* 这个有一些情况会导致
|
|
1435
|
+
* - 移动过程中切换模态
|
|
1436
|
+
* - 移动过程中 five 被析构
|
|
1437
|
+
* - 移动过程点击切换到另一个点位
|
|
1438
|
+
* @param panoIndex - 对应的点位
|
|
1076
1439
|
*/
|
|
1077
|
-
|
|
1440
|
+
moveToPanoCanceled(panoIndex: number): void;
|
|
1078
1441
|
/**
|
|
1079
|
-
*
|
|
1080
|
-
* @param
|
|
1442
|
+
* 观察点的全景资源开始加载
|
|
1443
|
+
* @param panoIndex - 加载点位
|
|
1081
1444
|
*/
|
|
1082
|
-
|
|
1083
|
-
getCurrentState(): State;
|
|
1445
|
+
textureStartLoad(panoIndex: number): void;
|
|
1084
1446
|
/**
|
|
1085
|
-
*
|
|
1086
|
-
* @
|
|
1087
|
-
*
|
|
1088
|
-
* five 设置了以下状态
|
|
1089
|
-
*
|
|
1090
|
-
* - mode: Mode
|
|
1091
|
-
* - panoIndex: number
|
|
1092
|
-
* - longitude: number
|
|
1093
|
-
* - latitude: number
|
|
1094
|
-
* - fov: number
|
|
1095
|
-
* - offset: THREE.Vector3
|
|
1096
|
-
*
|
|
1097
|
-
* 可以通过 five.state 和 five.setState 来获取和设置。
|
|
1098
|
-
* 通过 state 设置后,five 会通过合适的动画运动来达到设置的位置。
|
|
1099
|
-
* 来迎合一些通过数据驱动的场景。
|
|
1100
|
-
* ```
|
|
1101
|
-
* @param state - 目标状态
|
|
1102
|
-
* @param immediately - 是否马上转换,马上转换会尽快达到目标状态,尽量减少中间状态,更少动画。
|
|
1103
|
-
* @param userAction - 是否是用户触发的动作
|
|
1447
|
+
* 观察点的全景资源加载中,可获取到进度
|
|
1448
|
+
* @param progress - 加载进度 [0-1]
|
|
1449
|
+
* @param panoIndex - 加载点位下标
|
|
1104
1450
|
*/
|
|
1105
|
-
|
|
1106
|
-
aroundScissor(callback: () => void): void;
|
|
1107
|
-
private syncState;
|
|
1451
|
+
textureLoading(progress: number, panoIndex: number): void;
|
|
1108
1452
|
/**
|
|
1109
|
-
*
|
|
1453
|
+
* 观察点的全景资源加载被中止
|
|
1454
|
+
* @param panoIndex - 加载点位
|
|
1110
1455
|
*/
|
|
1111
|
-
|
|
1112
|
-
tile?: boolean;
|
|
1113
|
-
}): Promise<void>;
|
|
1456
|
+
textureAbort(panoIndex: number): void;
|
|
1114
1457
|
/**
|
|
1115
|
-
*
|
|
1458
|
+
* 观察点的全景资源加载失败
|
|
1459
|
+
* @param error - 错误对象
|
|
1460
|
+
* @param panoIndex - 加载点位
|
|
1116
1461
|
*/
|
|
1117
|
-
|
|
1462
|
+
textureError(error: Error, panoIndex: number): void;
|
|
1118
1463
|
/**
|
|
1119
|
-
*
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
private loadModel;
|
|
1124
|
-
private commonParams;
|
|
1125
|
-
private applyController;
|
|
1126
|
-
/** 移除事件绑定 */
|
|
1127
|
-
private removeEventListeners;
|
|
1128
|
-
/** 销毁GPU Picking 所用的材质 */
|
|
1129
|
-
private diposeGPUPickingMaterial;
|
|
1130
|
-
}
|
|
1131
|
-
|
|
1132
|
-
/** Five 初始化参数 */
|
|
1133
|
-
export declare interface FiveInitArgs {
|
|
1464
|
+
* 观察点的全景资源加载完成
|
|
1465
|
+
* @param panoIndex - 加载点位
|
|
1466
|
+
*/
|
|
1467
|
+
textureLoaded(panoIndex: number, meta: (NetWorkMeta | null)[]): void;
|
|
1134
1468
|
/**
|
|
1135
|
-
*
|
|
1136
|
-
* @description
|
|
1137
|
-
* 如果需要使用 `scissor` 分割画布功能,则必须使用外部传入 renderer,
|
|
1138
|
-
* 并且设置为 `preserveDrawingBuffer: false`。
|
|
1139
|
-
* 如果设置了 `renderer`, 则 `preserveDrawingBuffer`
|
|
1140
|
-
* `backgroundColor` `backgroundAlpha` `antialias`
|
|
1141
|
-
* 均不再生效。
|
|
1469
|
+
* webXR模式开始,webxr session完成坐标系矫正
|
|
1142
1470
|
*/
|
|
1143
|
-
|
|
1471
|
+
webXRSessionStart(): void;
|
|
1144
1472
|
/**
|
|
1145
|
-
*
|
|
1146
|
-
* @description
|
|
1147
|
-
* 当你想做屏幕截图等要确定取得屏幕像素时,请设置为 `true`。
|
|
1148
|
-
* 如果设置了参数 `renderer` 参数,则不生效,请对传入的 `renderer` 自行设置。
|
|
1149
|
-
* @default `false`
|
|
1473
|
+
* webXR模式结束,webxr session销毁
|
|
1150
1474
|
*/
|
|
1151
|
-
|
|
1475
|
+
webXRSessionEnd(): void;
|
|
1152
1476
|
/**
|
|
1153
|
-
*
|
|
1154
|
-
* @description
|
|
1155
|
-
* 通过数字类型传入。
|
|
1156
|
-
* 如果设置了参数 `renderer` 参数,则不生效,请对传入的 `renderer` 自行设置。
|
|
1157
|
-
* @default `0x181A1C`
|
|
1158
|
-
* @example
|
|
1159
|
-
* ```
|
|
1160
|
-
* backgroundColor: 0xffffff // 白色
|
|
1161
|
-
* backgroundColor: 0xff0000 // 红色
|
|
1162
|
-
* ```
|
|
1477
|
+
* axes代表控制杆,axes数组的0-1元素分别代表左控制器的左(-1)右(1),左控制器的上(-1)下(1),axes数组的2-3元素同理
|
|
1163
1478
|
*/
|
|
1164
|
-
|
|
1479
|
+
webXRControllerEvent(type: WebXRControllerType, key: WebXRControllerKey, params: WebXRControllerParams): void;
|
|
1165
1480
|
/**
|
|
1166
|
-
*
|
|
1167
|
-
* @description
|
|
1168
|
-
* 通过数字类型传入。取值范围 [0-1]
|
|
1169
|
-
* 如果设置了参数 `renderer` 参数,则不生效,请对传入的 `renderer` 自行设置。
|
|
1170
|
-
* @default `1`
|
|
1481
|
+
* xr控制器的Axes原始实时数据状态
|
|
1171
1482
|
*/
|
|
1172
|
-
|
|
1483
|
+
webXRAxesUpdate(type: 'left' | 'right', param: WebXRAxesParams): void;
|
|
1173
1484
|
/**
|
|
1174
|
-
*
|
|
1175
|
-
* @description
|
|
1176
|
-
* 这个抗锯齿功能是 `WEBGL` 自带的抗锯齿,并不是类似 fxaa taa 等后处理方式,比较吃性能。
|
|
1177
|
-
* 如果设置了参数 `renderer` 参数,则不生效,请对传入的 `renderer` 自行设置。
|
|
1178
|
-
* @default `false`
|
|
1485
|
+
* xr控制器的控制器射线更新
|
|
1179
1486
|
*/
|
|
1180
|
-
|
|
1487
|
+
webXRControllerRayUpdate(raycaster: {
|
|
1488
|
+
leftRay?: THREE_2.Raycaster;
|
|
1489
|
+
rightRay?: THREE_2.Raycaster;
|
|
1490
|
+
}): void;
|
|
1181
1491
|
/**
|
|
1182
|
-
*
|
|
1183
|
-
* @
|
|
1184
|
-
*
|
|
1185
|
-
*
|
|
1186
|
-
* 页面整体长宽均为 `1`。通过类似 css 的 `left` `bottom` `width` `height` 来确定区域。
|
|
1187
|
-
* @example
|
|
1188
|
-
* ```
|
|
1189
|
-
* scissor: { left: 0.75, bottom: 0, width: 0.25, height: 1 }
|
|
1190
|
-
* ```
|
|
1492
|
+
* 准备加载 Work 数据
|
|
1493
|
+
* @param input - 输入的 work
|
|
1494
|
+
* @param work - 归一化的标准 work
|
|
1495
|
+
* @param state - 加载时的姿态
|
|
1191
1496
|
*/
|
|
1192
|
-
|
|
1497
|
+
willLoad(input: any, work: Work, state: Partial<State>): void;
|
|
1193
1498
|
/**
|
|
1194
|
-
*
|
|
1195
|
-
* @
|
|
1196
|
-
*
|
|
1197
|
-
*
|
|
1198
|
-
* 你还可以通过 `five.play()` `five.pause()` 的方式来控制播放。
|
|
1199
|
-
* @default `true`
|
|
1499
|
+
* 开始加载 Work 数据
|
|
1500
|
+
* @param input - 输入的 work
|
|
1501
|
+
* @param work - 归一化的标准 work
|
|
1502
|
+
* @param state - 加载时的姿态
|
|
1200
1503
|
*/
|
|
1201
|
-
|
|
1504
|
+
load(input: any, work: Work, state: Partial<State>): void;
|
|
1202
1505
|
/**
|
|
1203
|
-
*
|
|
1204
|
-
* @
|
|
1205
|
-
*
|
|
1206
|
-
* 平衡加载时间和图片质量
|
|
1506
|
+
* 加载完 Work 数据
|
|
1507
|
+
* @param input - 输入的 work
|
|
1508
|
+
* @param work - 归一化的标准 work
|
|
1207
1509
|
*/
|
|
1208
|
-
|
|
1510
|
+
loaded(input: any, work: Work): void;
|
|
1209
1511
|
/**
|
|
1210
|
-
*
|
|
1211
|
-
* @
|
|
1212
|
-
*
|
|
1213
|
-
* 平衡加载时间和图片质量
|
|
1512
|
+
* 当目标 state 变化时
|
|
1513
|
+
* @param state - 当前姿态状态
|
|
1514
|
+
* @param userAction - 是否用户触发
|
|
1214
1515
|
*/
|
|
1215
|
-
|
|
1516
|
+
stateChange(state: State, userAction: boolean): void;
|
|
1216
1517
|
/**
|
|
1217
|
-
*
|
|
1218
|
-
* @
|
|
1219
|
-
*
|
|
1220
|
-
* 才会重新渲染屏幕,降低无用渲染产生的消耗。
|
|
1221
|
-
* @default `true`
|
|
1518
|
+
* 当前实时 state 变化时
|
|
1519
|
+
* @param state - 当前姿态状态
|
|
1520
|
+
* @param userAction - 是否用户触发
|
|
1222
1521
|
*/
|
|
1223
|
-
|
|
1522
|
+
currentStateChange(state: State, userAction: boolean): void;
|
|
1224
1523
|
/**
|
|
1225
|
-
*
|
|
1226
|
-
* @
|
|
1227
|
-
* 如果为 `false`, 则不限制。最好也就是屏幕刷新率,不会再高了。
|
|
1228
|
-
* @default `false`
|
|
1524
|
+
* 当 setState 方法被调用
|
|
1525
|
+
* @param state - 当前姿态状态
|
|
1229
1526
|
*/
|
|
1230
|
-
|
|
1527
|
+
setState(state: State): void;
|
|
1231
1528
|
/**
|
|
1232
|
-
*
|
|
1233
|
-
* @
|
|
1234
|
-
* 当点位中有视频元素,则会使用。如果不传入也会外部新建,
|
|
1235
|
-
* 加入传入的原因是,视频自动播放在不同浏览器或者 webview 中有不同的特性。
|
|
1236
|
-
* 给予更多外部操作的空间。
|
|
1529
|
+
* 当 state 被同步完成时
|
|
1530
|
+
* @param state - 当前姿态状态
|
|
1237
1531
|
*/
|
|
1238
|
-
|
|
1239
|
-
/** 全景图游走模式下的特定参数 */
|
|
1240
|
-
panorama?: ControllerCustomInitTypes["Panorama"];
|
|
1241
|
-
/** 模型游走模式下的特定参数 */
|
|
1242
|
-
model?: ControllerCustomInitTypes["Model"];
|
|
1243
|
-
/** 模型查看模式下的特定参数 */
|
|
1244
|
-
floorplan?: ControllerCustomInitTypes["Floorplan"];
|
|
1245
|
-
/** 户型图模式下的特定参数 */
|
|
1246
|
-
topview?: ControllerCustomInitTypes["Topview"];
|
|
1247
|
-
/** 地图模式下的特定参数 */
|
|
1248
|
-
mapview?: ControllerCustomInitTypes["Mapview"];
|
|
1249
|
-
/** 深度图游走模式下的特定参数 */
|
|
1250
|
-
depthPanorama?: ControllerCustomInitTypes["DepthPanorama"];
|
|
1251
|
-
/** VR眼镜模式下的特定参数 */
|
|
1252
|
-
vrPanorama?: ControllerCustomInitTypes["VRPanorama"];
|
|
1253
|
-
/** XR眼镜模式下的特定参数 */
|
|
1254
|
-
xrPanorama?: ControllerCustomInitTypes["XRPanorama"];
|
|
1532
|
+
stateSynced(state: State): void;
|
|
1255
1533
|
/**
|
|
1256
|
-
*
|
|
1257
|
-
* @
|
|
1258
|
-
* 单位毫秒
|
|
1259
|
-
* @default `800`
|
|
1534
|
+
* 模型开始加载
|
|
1535
|
+
* @param workModel - 归一化的标准 work 中的 model 值
|
|
1260
1536
|
*/
|
|
1261
|
-
|
|
1537
|
+
modelWillLoad(workModel: WorkModel): void;
|
|
1262
1538
|
/**
|
|
1263
|
-
*
|
|
1264
|
-
* @
|
|
1265
|
-
*
|
|
1539
|
+
* 模型加载错误
|
|
1540
|
+
* @param error - 错误对象
|
|
1541
|
+
* @param model - 加载完的 model
|
|
1266
1542
|
*/
|
|
1267
|
-
|
|
1543
|
+
modelLoadError(error: Error, model: Model): void;
|
|
1268
1544
|
/**
|
|
1269
|
-
*
|
|
1545
|
+
* 模型加载完成
|
|
1546
|
+
* @param models - 加载完的 model
|
|
1270
1547
|
*/
|
|
1271
|
-
|
|
1548
|
+
modelLoaded(model: Model): void;
|
|
1272
1549
|
/**
|
|
1273
|
-
*
|
|
1550
|
+
* 模型楼层切换
|
|
1551
|
+
* @param shownFloor - 模型楼层
|
|
1274
1552
|
*/
|
|
1275
|
-
|
|
1553
|
+
modelShownFloorChange(shownFloor: number | null, floorLength: number): void;
|
|
1276
1554
|
/**
|
|
1277
|
-
*
|
|
1555
|
+
* 渲染循环
|
|
1556
|
+
* @param rendered - 是否渲染了
|
|
1278
1557
|
*/
|
|
1279
|
-
|
|
1558
|
+
renderFrame(rendered: boolean): void;
|
|
1280
1559
|
/**
|
|
1281
|
-
*
|
|
1282
|
-
* @param
|
|
1283
|
-
* @
|
|
1560
|
+
* 意图要切换到某个模态, 可以通过 return false 阻止
|
|
1561
|
+
* @param mode - 意图要切换到的模态
|
|
1562
|
+
* @param prevMode - 当前模态
|
|
1563
|
+
* @returns 可以通过 return false 阻止
|
|
1284
1564
|
*/
|
|
1285
|
-
|
|
1565
|
+
wantsChangeMode(mode: Mode, prevMode: Mode): void | false;
|
|
1286
1566
|
/**
|
|
1287
|
-
*
|
|
1567
|
+
* 模态切换完成
|
|
1568
|
+
* @param mode - 切换到的模态
|
|
1569
|
+
* @param prevMode - 上本质是一个模态
|
|
1570
|
+
* @param panoIndex - 初始化动画结束后的点位下标
|
|
1571
|
+
* @param toPose - 初始化动画结束后的状态
|
|
1572
|
+
* @param userAction - 是否用户触发
|
|
1288
1573
|
*/
|
|
1289
|
-
|
|
1290
|
-
maxDepth?: number;
|
|
1291
|
-
};
|
|
1292
|
-
}
|
|
1293
|
-
|
|
1294
|
-
/**
|
|
1295
|
-
* Five 插件
|
|
1296
|
-
* [[include:plugins.md]]
|
|
1297
|
-
* @template Parameters - 插件参数, 没有参数则为 void
|
|
1298
|
-
* @template Returns - 如果有参数则插件暴露的 api,没有参数则不传
|
|
1299
|
-
*/
|
|
1300
|
-
export declare type FivePlugin<Parameters = void, Returns = void> = Parameters extends void ? ((five: Five) => Returns) : ((five: Five, parameters: Parameters) => Returns);
|
|
1301
|
-
|
|
1302
|
-
/**
|
|
1303
|
-
* 获取插件在Five中的初始化结构
|
|
1304
|
-
* @template T - Five 插件
|
|
1305
|
-
*/
|
|
1306
|
-
export declare type FivePluginInit<T extends FivePlugin<any, any>> = Parameters<T>[1] extends undefined ? [
|
|
1307
|
-
Plugin: T,
|
|
1308
|
-
instanceName: null | string
|
|
1309
|
-
] : [
|
|
1310
|
-
Plugin: T,
|
|
1311
|
-
instanceName: null | string,
|
|
1312
|
-
parameters: Parameters<T>[1]
|
|
1313
|
-
];
|
|
1314
|
-
|
|
1315
|
-
/**
|
|
1316
|
-
* 获取插件暴露的 api
|
|
1317
|
-
* @template T - Five 插件
|
|
1318
|
-
*/
|
|
1319
|
-
export declare type FivePluginInstance<T extends FivePlugin<any, any>> = ReturnType<T>;
|
|
1320
|
-
|
|
1321
|
-
export declare interface FloorplanControllerCustomInitArgs {
|
|
1322
|
-
/** 默认俯仰角 */
|
|
1323
|
-
defaultLatitude?: number;
|
|
1324
|
-
/** 最大俯仰角 */
|
|
1325
|
-
maxLatitude?: number;
|
|
1326
|
-
/** 最小俯仰角 */
|
|
1327
|
-
minLatitude?: number;
|
|
1328
|
-
/** 默认相机可视角度(垂直),可作为 `zoom` */
|
|
1329
|
-
defaultFov?: number;
|
|
1330
|
-
/** 最大相机可视角度 */
|
|
1331
|
-
maxFov?: number;
|
|
1332
|
-
/** 最小相机可视角度 */
|
|
1333
|
-
minFov?: number;
|
|
1334
|
-
/** 鼠标焦点环自定义创建器 */
|
|
1335
|
-
intersectMeshCreator?: () => IntersectMeshInterface;
|
|
1336
|
-
}
|
|
1337
|
-
|
|
1338
|
-
export declare type GestureTypes = "pan" | "tap" | "pinch" | "press" | "mouseWheel";
|
|
1339
|
-
|
|
1340
|
-
export declare function getViewportScale(): number;
|
|
1341
|
-
|
|
1342
|
-
/**
|
|
1343
|
-
* 图片参数
|
|
1344
|
-
*/
|
|
1345
|
-
export declare interface ImageOptions {
|
|
1574
|
+
modeChange(mode: Mode, prevMode: Mode, panoIndex: number, toPose: Pose, userAction: boolean): void;
|
|
1346
1575
|
/**
|
|
1347
|
-
*
|
|
1348
|
-
* @param
|
|
1349
|
-
* @param options - 当前地址参数
|
|
1350
|
-
* @returns 转化后地址
|
|
1576
|
+
* 帮助元素显应的变换
|
|
1577
|
+
* @param visible - 帮助元素的是否开启
|
|
1351
1578
|
*/
|
|
1352
|
-
|
|
1353
|
-
/**
|
|
1354
|
-
|
|
1355
|
-
|
|
1356
|
-
|
|
1357
|
-
|
|
1358
|
-
|
|
1359
|
-
|
|
1360
|
-
|
|
1361
|
-
mappings?: ImageURLMappings;
|
|
1362
|
-
}
|
|
1363
|
-
|
|
1364
|
-
export declare function imageSupport(): Promise<{
|
|
1365
|
-
avif: boolean;
|
|
1366
|
-
webp: boolean;
|
|
1367
|
-
}>;
|
|
1368
|
-
|
|
1369
|
-
export declare interface ImageURLMappings {
|
|
1370
|
-
[publicDomain: string]: {
|
|
1371
|
-
"type"?: string;
|
|
1372
|
-
"pano": [string, string];
|
|
1373
|
-
"tile": [string, string];
|
|
1374
|
-
"model": [string, string];
|
|
1375
|
-
"texture": [string];
|
|
1376
|
-
"default": [string];
|
|
1377
|
-
};
|
|
1378
|
-
}
|
|
1579
|
+
helpersVisibleChange(visible: boolean): void;
|
|
1580
|
+
/**
|
|
1581
|
+
* 网络资源分析
|
|
1582
|
+
* @param source - 资源地址
|
|
1583
|
+
* @param state - 状态
|
|
1584
|
+
* @param detail - 详情
|
|
1585
|
+
*/
|
|
1586
|
+
network(source: string, type: NetworkType, state: NetworkState, detail: string): void;
|
|
1587
|
+
};
|
|
1379
1588
|
|
|
1380
|
-
export declare
|
|
1381
|
-
|
|
1382
|
-
|
|
1383
|
-
|
|
1384
|
-
|
|
1385
|
-
|
|
1386
|
-
quality?: number;
|
|
1387
|
-
/** 图片格式参数 */
|
|
1388
|
-
format?: "jpg" | "png" | "heif" | "webp" | "avif";
|
|
1389
|
-
/** 图片裁切 */
|
|
1390
|
-
cut?: [x: number, y: number, width: number, height: number];
|
|
1391
|
-
/** 锐化参数 海外不支持 */
|
|
1392
|
-
sharpen?: number;
|
|
1393
|
-
/** url匹配规则 */
|
|
1394
|
-
mappings?: ImageURLMappings;
|
|
1395
|
-
}
|
|
1589
|
+
export declare function loadAt3d(url: string, options: {
|
|
1590
|
+
textureOptions?: TextureOptions;
|
|
1591
|
+
textureBaseUri?: string;
|
|
1592
|
+
textureArray?: string[];
|
|
1593
|
+
fetcher: Fetcher;
|
|
1594
|
+
}): Promise<ParsedResultType>;
|
|
1396
1595
|
|
|
1397
|
-
export declare
|
|
1398
|
-
|
|
1399
|
-
|
|
1400
|
-
|
|
1401
|
-
backgroundAlpha?: number;
|
|
1402
|
-
pixelRatio?: number;
|
|
1403
|
-
antialias?: boolean;
|
|
1404
|
-
webgl2?: boolean;
|
|
1405
|
-
});
|
|
1406
|
-
}
|
|
1596
|
+
export declare function loadB3dm(url: string, options: {
|
|
1597
|
+
upAxis: 'X' | 'Y' | 'Z';
|
|
1598
|
+
fetcher: Fetcher;
|
|
1599
|
+
}): Promise<ParsedResultType>;
|
|
1407
1600
|
|
|
1408
|
-
export declare
|
|
1409
|
-
|
|
1410
|
-
|
|
1411
|
-
|
|
1412
|
-
|
|
1413
|
-
normal: THREE.Vector3;
|
|
1414
|
-
} | null;
|
|
1415
|
-
/** 焦点距离 */
|
|
1416
|
-
distance: number;
|
|
1417
|
-
}
|
|
1601
|
+
export declare function loadDome(url: string, options: {
|
|
1602
|
+
textureOptions: TextureOptions;
|
|
1603
|
+
textureBaseUri?: string;
|
|
1604
|
+
fetcher: Fetcher;
|
|
1605
|
+
}): Promise<ParsedResultType>;
|
|
1418
1606
|
|
|
1419
|
-
export declare
|
|
1420
|
-
|
|
1421
|
-
|
|
1422
|
-
|
|
1423
|
-
}
|
|
1607
|
+
export declare function loadDomez(url: string, options: {
|
|
1608
|
+
textureOptions: TextureOptions;
|
|
1609
|
+
textureBaseUri?: string;
|
|
1610
|
+
fetcher: Fetcher;
|
|
1611
|
+
}): Promise<ParsedResultType>;
|
|
1424
1612
|
|
|
1425
|
-
|
|
1426
|
-
|
|
1427
|
-
|
|
1428
|
-
|
|
1429
|
-
|
|
1430
|
-
}
|
|
1613
|
+
export declare function loadPbm(url: string, options: {
|
|
1614
|
+
textureOptions?: TextureOptions;
|
|
1615
|
+
textureBaseUri?: string;
|
|
1616
|
+
textureArray?: string[];
|
|
1617
|
+
fetcher: Fetcher;
|
|
1618
|
+
}): Promise<ParsedResultType>;
|
|
1619
|
+
|
|
1620
|
+
export declare function loadPnts(url: string, options: {
|
|
1621
|
+
fetcher: Fetcher;
|
|
1622
|
+
computeBoundingBox?: boolean;
|
|
1623
|
+
}): Promise<ParsedResultType>;
|
|
1431
1624
|
|
|
1432
1625
|
export declare type LooseWork = {
|
|
1433
1626
|
work_code?: string;
|
|
@@ -1511,6 +1704,7 @@ export declare type LooseWorkPanorama = {
|
|
|
1511
1704
|
back: string;
|
|
1512
1705
|
};
|
|
1513
1706
|
tiles?: number[];
|
|
1707
|
+
tile_size?: number[];
|
|
1514
1708
|
};
|
|
1515
1709
|
|
|
1516
1710
|
export declare type LooseWorkVideo = {
|
|
@@ -1519,24 +1713,14 @@ export declare type LooseWorkVideo = {
|
|
|
1519
1713
|
size: number[];
|
|
1520
1714
|
};
|
|
1521
1715
|
|
|
1522
|
-
export declare type LooseWorkWithExtrinsics = {
|
|
1716
|
+
export declare type LooseWorkWithExtrinsics = ParseWorkOptions & {
|
|
1717
|
+
/** work 数据 */
|
|
1523
1718
|
work: LooseWork;
|
|
1524
|
-
debug?: boolean;
|
|
1525
|
-
/** 位姿 */
|
|
1526
|
-
transform?: number[];
|
|
1527
|
-
/** 可视区域 */
|
|
1528
|
-
viewerRequestVolume?: BoundingVolumeJson;
|
|
1529
|
-
/** 模型显示最大细化层级 */
|
|
1530
|
-
modelMaxLevelOfDetail?: number;
|
|
1531
|
-
/** 模型最大内存缓存 */
|
|
1532
|
-
modelMaxMemoryUsage?: number;
|
|
1533
|
-
/** 模型网络最大请求并发数 */
|
|
1534
|
-
modelMaxRequests?: number;
|
|
1535
|
-
/** 模型屏幕空间误差计算最大值 */
|
|
1536
|
-
modelMaxScreenSpaceError?: number;
|
|
1537
1719
|
};
|
|
1538
1720
|
|
|
1539
1721
|
export declare interface MapviewControllerCustomInitArgs {
|
|
1722
|
+
/** 默认水平角 */
|
|
1723
|
+
defaultLongitude?: number;
|
|
1540
1724
|
/** 默认俯仰角 */
|
|
1541
1725
|
defaultLatitude?: number;
|
|
1542
1726
|
/** 默认相机距离 */
|
|
@@ -1545,6 +1729,8 @@ export declare interface MapviewControllerCustomInitArgs {
|
|
|
1545
1729
|
maxLatitude?: number;
|
|
1546
1730
|
/** 最小俯仰角 */
|
|
1547
1731
|
minLatitude?: number;
|
|
1732
|
+
/** cameraType */
|
|
1733
|
+
cameraType?: "perspective" | "orthographic" | "auto";
|
|
1548
1734
|
/** 鼠标焦点环自定义创建器 */
|
|
1549
1735
|
intersectMeshCreator?: () => IntersectMeshInterface;
|
|
1550
1736
|
}
|
|
@@ -1558,7 +1744,6 @@ export declare type Mirror<T extends string> = Record<T, T>;
|
|
|
1558
1744
|
* - **Floorplan**: 模型查看模式
|
|
1559
1745
|
* - **Topview**: 户型图模式
|
|
1560
1746
|
* - **Mapview**: 地图模式
|
|
1561
|
-
* - **DepthPanorama**: 深度图游走模式
|
|
1562
1747
|
* - **VRPanorama**: VR眼镜模式
|
|
1563
1748
|
*/
|
|
1564
1749
|
export declare type Mode =
|
|
@@ -1574,11 +1759,14 @@ export declare type Mode =
|
|
|
1574
1759
|
"VRPanorama" |
|
|
1575
1760
|
/** 模型游走模式 */
|
|
1576
1761
|
"Model" |
|
|
1577
|
-
/** 深度图游走模式 */
|
|
1578
|
-
"DepthPanorama" |
|
|
1579
1762
|
/** XR眼镜模式*/
|
|
1580
1763
|
"XRPanorama";
|
|
1581
1764
|
|
|
1765
|
+
export declare interface ModeChangeEvent extends StateEvent {
|
|
1766
|
+
prevMode: Mode;
|
|
1767
|
+
mode: Mode;
|
|
1768
|
+
}
|
|
1769
|
+
|
|
1582
1770
|
/**
|
|
1583
1771
|
* Five 模型
|
|
1584
1772
|
* @description
|
|
@@ -1591,56 +1779,51 @@ export declare class Model extends THREE_2.Object3D {
|
|
|
1591
1779
|
/** work */
|
|
1592
1780
|
work: Work | null;
|
|
1593
1781
|
/** 模型的不同图层 */
|
|
1594
|
-
viewLayers:
|
|
1595
|
-
name: string;
|
|
1596
|
-
type: string;
|
|
1597
|
-
upAxis: string;
|
|
1598
|
-
coordinates: string;
|
|
1599
|
-
scene: Tile3DModel;
|
|
1600
|
-
}[];
|
|
1782
|
+
viewLayers: ModelViewLayer[];
|
|
1601
1783
|
onError: (error: Error) => void;
|
|
1602
1784
|
onShownFloorChange: (floorIndex: number | null) => void;
|
|
1785
|
+
onLoad: () => void;
|
|
1603
1786
|
/** 外接盒子的大小 */
|
|
1604
1787
|
bounding: THREE_2.Box3;
|
|
1605
|
-
/**
|
|
1606
|
-
shownFloor: number | null;
|
|
1607
|
-
/** 楼层的数量 */
|
|
1788
|
+
/** 所有楼层 */
|
|
1608
1789
|
floorLength: number;
|
|
1609
1790
|
/** 材质贴图参数 */
|
|
1610
1791
|
textureOptions: TextureOptions;
|
|
1792
|
+
autoRefine: boolean;
|
|
1611
1793
|
/** 模型是否已经细化 */
|
|
1612
1794
|
refined: boolean;
|
|
1795
|
+
/** 模型细化进度 */
|
|
1796
|
+
refineProgress: [number, number];
|
|
1613
1797
|
/** 模型已经加载 */
|
|
1614
1798
|
loaded: boolean;
|
|
1615
|
-
/**
|
|
1616
|
-
materialVersion: string;
|
|
1617
|
-
private _materialValues;
|
|
1618
|
-
private _materialVersionMap;
|
|
1619
|
-
private _floorIndex;
|
|
1620
|
-
private _clippers;
|
|
1621
|
-
/** 样式缓存 */
|
|
1622
|
-
private cache;
|
|
1799
|
+
/** 是否更新 */
|
|
1623
1800
|
needsRender: boolean;
|
|
1801
|
+
/** 缓存相机 */
|
|
1802
|
+
cacheCameras: (THREE_2.PerspectiveCamera | Camera)[];
|
|
1803
|
+
/** 当前样式参数 */
|
|
1804
|
+
materialVersion: number;
|
|
1805
|
+
private materialParameters;
|
|
1624
1806
|
private disposed;
|
|
1625
1807
|
constructor(options?: {
|
|
1626
1808
|
onError?: (error: Error) => void;
|
|
1627
1809
|
onShownFloorChange?: (floorIndex: number | null) => void;
|
|
1810
|
+
onLoad?: () => void;
|
|
1628
1811
|
});
|
|
1629
1812
|
get empty(): boolean;
|
|
1630
1813
|
/** 获取材质参数 */
|
|
1631
|
-
getMaterial():
|
|
1814
|
+
getMaterial(): PBMParameters;
|
|
1632
1815
|
/** 设置材质参数 */
|
|
1633
|
-
setMaterial(values: Partial<
|
|
1816
|
+
setMaterial(values: Partial<PBMParameters>): void;
|
|
1634
1817
|
/**
|
|
1635
1818
|
* 当前显示的楼层
|
|
1636
1819
|
*/
|
|
1637
|
-
get
|
|
1638
|
-
set
|
|
1820
|
+
get shownFloorIndex(): PBMParameters['shownFloorIndex'];
|
|
1821
|
+
set shownFloorIndex(floorIndex: PBMParameters['shownFloorIndex']);
|
|
1639
1822
|
/**
|
|
1640
|
-
*
|
|
1823
|
+
* 当前显示的楼层
|
|
1641
1824
|
*/
|
|
1642
|
-
get
|
|
1643
|
-
set
|
|
1825
|
+
get shownFloor(): number | null;
|
|
1826
|
+
set shownFloor(floor: number | null);
|
|
1644
1827
|
/**
|
|
1645
1828
|
* 显示某楼层
|
|
1646
1829
|
* @example
|
|
@@ -1649,7 +1832,12 @@ export declare class Model extends THREE_2.Object3D {
|
|
|
1649
1832
|
* model.show(1) //显示第一楼层
|
|
1650
1833
|
* ```
|
|
1651
1834
|
*/
|
|
1652
|
-
show(
|
|
1835
|
+
show(floor?: number | null): void;
|
|
1836
|
+
/**
|
|
1837
|
+
* 裁切
|
|
1838
|
+
*/
|
|
1839
|
+
get clippers(): PBMParameters['clippers'];
|
|
1840
|
+
set clippers(clippers: PBMParameters['clippers']);
|
|
1653
1841
|
/**
|
|
1654
1842
|
* 获取模型边界线
|
|
1655
1843
|
* @param sphere - 获取区域
|
|
@@ -1663,16 +1851,32 @@ export declare class Model extends THREE_2.Object3D {
|
|
|
1663
1851
|
* @param floors - 和某一楼层做碰撞检测, 不传为和所有楼层做碰撞检测
|
|
1664
1852
|
* @returns 返回碰撞
|
|
1665
1853
|
*/
|
|
1666
|
-
intersectRaycaster(raycaster: THREE_2.Raycaster): Intersection[];
|
|
1854
|
+
intersectRaycaster(raycaster: THREE_2.Raycaster, floor?: undefined | null | number, sortByDistance?: boolean): Intersection[];
|
|
1667
1855
|
/**
|
|
1668
1856
|
* 加载模型
|
|
1669
1857
|
* @param work - work 的
|
|
1670
1858
|
* @param imageOptions - 图片参数
|
|
1671
1859
|
*/
|
|
1672
1860
|
load(work: Work, options?: {
|
|
1673
|
-
networkSubscribe?: NetworkSubscribe;
|
|
1674
|
-
requestProxy?: (url: string) => string | Promise<string>;
|
|
1675
1861
|
textureOptions?: TextureOptions;
|
|
1862
|
+
"3d-tiles"?: {
|
|
1863
|
+
/** 调试模式 */
|
|
1864
|
+
debug?: boolean;
|
|
1865
|
+
/** 显示图层 */
|
|
1866
|
+
showLayers?: boolean | string[];
|
|
1867
|
+
/** 可观测区域 */
|
|
1868
|
+
viewerRequestVolume?: BoundingVolume;
|
|
1869
|
+
/** 模型显示最小细化层级 */
|
|
1870
|
+
minLevelOfDetail?: number;
|
|
1871
|
+
/** 模型显示最大细化层级 */
|
|
1872
|
+
maxLevelOfDetail?: number;
|
|
1873
|
+
/** 模型最大内存缓存 */
|
|
1874
|
+
maxMemoryUsage?: number;
|
|
1875
|
+
/** 模型网络最大请求并发数 */
|
|
1876
|
+
maxRequests?: number;
|
|
1877
|
+
/** 模型屏幕空间误差计算最大值 */
|
|
1878
|
+
maxScreenSpaceError?: number;
|
|
1879
|
+
};
|
|
1676
1880
|
}): Promise<void>;
|
|
1677
1881
|
update(renderer: THREE_2.WebGLRenderer, camera: Camera, mode: Mode): void;
|
|
1678
1882
|
/**
|
|
@@ -1686,23 +1890,88 @@ export declare class Model extends THREE_2.Object3D {
|
|
|
1686
1890
|
export declare interface ModelControllerCustomInitArgs extends PanoramaLikeControllerCustomInitArgs {
|
|
1687
1891
|
}
|
|
1688
1892
|
|
|
1689
|
-
export declare interface
|
|
1690
|
-
|
|
1893
|
+
export declare interface ModelEvent extends BaseEvent {
|
|
1894
|
+
model: Model;
|
|
1895
|
+
work: Work;
|
|
1896
|
+
error: Error | null;
|
|
1691
1897
|
}
|
|
1692
1898
|
|
|
1693
|
-
export declare type ModelMaterialValues =
|
|
1899
|
+
export declare type ModelMaterialValues = Omit<PBMParameters, 'clippers' | 'shownFloorIndex'>;
|
|
1694
1900
|
|
|
1695
1901
|
export declare type Models = Model[] & {
|
|
1696
1902
|
needsRender: boolean;
|
|
1903
|
+
/** 包围盒 */
|
|
1697
1904
|
bounding: THREE_2.Box3;
|
|
1905
|
+
/** 是否家在完成 */
|
|
1698
1906
|
loaded: boolean;
|
|
1907
|
+
/** 是否细化完成 */
|
|
1699
1908
|
refined: boolean;
|
|
1909
|
+
/** 细化成都 */
|
|
1910
|
+
refineProgress: [number, number];
|
|
1911
|
+
materialVersion: number;
|
|
1912
|
+
/** 缓存相机 */
|
|
1913
|
+
cacheCameras: (THREE_2.PerspectiveCamera | Camera)[];
|
|
1914
|
+
/** 是否自动更新模型 */
|
|
1915
|
+
autoUpdate: boolean;
|
|
1916
|
+
/**
|
|
1917
|
+
* 计算模型射线碰撞检测
|
|
1918
|
+
* @param raycaster - THREE 射线对象
|
|
1919
|
+
* @param floors - 和某一楼层做碰撞检测, 不传为和所有楼层做碰撞检测
|
|
1920
|
+
* @returns 返回碰撞
|
|
1921
|
+
*/
|
|
1700
1922
|
intersectRaycaster(raycaster: THREE_2.Raycaster): Intersection[];
|
|
1923
|
+
/** 设置材质参数 */
|
|
1701
1924
|
setMaterial(values: Partial<ModelMaterialValues>): void;
|
|
1925
|
+
/** 获取材质参数 */
|
|
1702
1926
|
getMaterial(): ModelMaterialValues;
|
|
1927
|
+
/** 更新模型 */
|
|
1703
1928
|
update(renderer: THREE_2.WebGLRenderer, camera: Camera, mode: Mode): void;
|
|
1704
1929
|
};
|
|
1705
1930
|
|
|
1931
|
+
export declare interface ModelsEvent extends BaseEvent {
|
|
1932
|
+
models: Models;
|
|
1933
|
+
}
|
|
1934
|
+
|
|
1935
|
+
export declare class ModelViewLayer {
|
|
1936
|
+
readonly scene: Tile3DModel;
|
|
1937
|
+
readonly error: Error | null;
|
|
1938
|
+
constructor(scene: Tile3DModel, error: Error | null);
|
|
1939
|
+
get tileset(): Tileset;
|
|
1940
|
+
get name(): string;
|
|
1941
|
+
get type(): "point_cloud" | "mesh";
|
|
1942
|
+
get upAxis(): string;
|
|
1943
|
+
get groundHeight(): number;
|
|
1944
|
+
get model(): Model;
|
|
1945
|
+
/**
|
|
1946
|
+
* @deprecated
|
|
1947
|
+
* 使用 modelViewLayer.scene.localToLla(new THREE.Vector()) 替代
|
|
1948
|
+
*/
|
|
1949
|
+
get coordinates(): string;
|
|
1950
|
+
/**
|
|
1951
|
+
* @deprecated
|
|
1952
|
+
* 使用 modelViewLayer.scene.coordinateTransform 替代
|
|
1953
|
+
*/
|
|
1954
|
+
getTransformMatrix4(target?: THREE_2.Matrix4): THREE_2.Matrix4;
|
|
1955
|
+
/**
|
|
1956
|
+
* @deprecated
|
|
1957
|
+
* 使用 modelViewLayer.scene.llaToWorld 替代
|
|
1958
|
+
*/
|
|
1959
|
+
coordinatesToWorldPoint(coordinates: {
|
|
1960
|
+
longitude: number;
|
|
1961
|
+
latitude: number;
|
|
1962
|
+
altitude: number;
|
|
1963
|
+
}): THREE_2.Vector3;
|
|
1964
|
+
/**
|
|
1965
|
+
* @deprecated
|
|
1966
|
+
* 使用 modelViewLayer.scene.llaToWorld 替代
|
|
1967
|
+
*/
|
|
1968
|
+
worldPointToCoordinates(point: THREE_2.Vector3): {
|
|
1969
|
+
longitude: number;
|
|
1970
|
+
latitude: number;
|
|
1971
|
+
altitude: number;
|
|
1972
|
+
};
|
|
1973
|
+
}
|
|
1974
|
+
|
|
1706
1975
|
export declare interface MotionKeyframe<K extends string> {
|
|
1707
1976
|
progress: number;
|
|
1708
1977
|
value: MotionValue<K>;
|
|
@@ -1711,21 +1980,27 @@ export declare interface MotionKeyframe<K extends string> {
|
|
|
1711
1980
|
|
|
1712
1981
|
export declare type MotionValue<K extends string> = Record<K, number>;
|
|
1713
1982
|
|
|
1983
|
+
/**
|
|
1984
|
+
* 动画模式
|
|
1985
|
+
* @description
|
|
1986
|
+
* - `fly` 通过相机移动方式变化
|
|
1987
|
+
* - `instant` 直接变化
|
|
1988
|
+
* - `fade` 通过渐变方式变化
|
|
1989
|
+
* - `montage` 通过渐变穿插到黑屏方式变化
|
|
1990
|
+
* - `spread` 通过扩散方式变化
|
|
1991
|
+
* - `zoomin` 通过放大变化
|
|
1992
|
+
* - `zoomout` 通过缩小变化
|
|
1993
|
+
*/
|
|
1994
|
+
export declare type MovePanoEffect = "fly" | "instant" | "fade" | "montage" | "spread" | "zoomin" | "zoomout";
|
|
1995
|
+
|
|
1714
1996
|
/**
|
|
1715
1997
|
* 点位移动参数
|
|
1716
1998
|
*/
|
|
1717
|
-
export declare interface MovePanoOptions extends Partial<Omit<
|
|
1718
|
-
/** 是否通过初始化参数限制 fov, latitude */
|
|
1719
|
-
limit?: boolean;
|
|
1999
|
+
export declare interface MovePanoOptions extends Partial<Omit<State, "offset" | 'distance' | 'mode'>> {
|
|
1720
2000
|
/**
|
|
1721
2001
|
* 动画模式
|
|
1722
|
-
* @description
|
|
1723
|
-
* - `fly` 通过相机移动方式变化
|
|
1724
|
-
* - `fade` 通过渐变方式变化
|
|
1725
|
-
* - `montage` 通过渐变穿插到黑屏方式变化
|
|
1726
|
-
* - `instant` 通过插入黑屏方式变化
|
|
1727
2002
|
*/
|
|
1728
|
-
effect?:
|
|
2003
|
+
effect?: MovePanoEffect;
|
|
1729
2004
|
/**
|
|
1730
2005
|
* 运动耗时
|
|
1731
2006
|
* @description
|
|
@@ -1734,12 +2009,10 @@ export declare interface MovePanoOptions extends Partial<Omit<Pose, "offset">> {
|
|
|
1734
2009
|
* - `不传或者null` 通过距离和速度(速度为five初始化设置)
|
|
1735
2010
|
*/
|
|
1736
2011
|
duration?: number | ((distance: number, speed: number) => number) | string | null;
|
|
1737
|
-
/** 运动曲线函数 */
|
|
1738
|
-
easing?: (k: number) => number;
|
|
1739
2012
|
/** 运动开始回调 */
|
|
1740
|
-
moveStartCallback?: (
|
|
2013
|
+
moveStartCallback?: (toState: State) => void;
|
|
1741
2014
|
/** 运动结束回调 */
|
|
1742
|
-
moveEndCallback?: (
|
|
2015
|
+
moveEndCallback?: (state: State) => void;
|
|
1743
2016
|
/**
|
|
1744
2017
|
* 运动被取消回调
|
|
1745
2018
|
* @description
|
|
@@ -1751,6 +2024,18 @@ export declare interface MovePanoOptions extends Partial<Omit<Pose, "offset">> {
|
|
|
1751
2024
|
moveCancelCallback?: () => void;
|
|
1752
2025
|
}
|
|
1753
2026
|
|
|
2027
|
+
export declare class NetworkAbortError extends Error {
|
|
2028
|
+
constructor(source: string, type: NetworkType);
|
|
2029
|
+
}
|
|
2030
|
+
|
|
2031
|
+
export declare type NetworkError = NetworkResponseError | NetworkAbortError | NetworkTimeoutError | NetworkFirbiddenError;
|
|
2032
|
+
|
|
2033
|
+
export declare type NetworkErrorCallback = (error: NetworkError) => void;
|
|
2034
|
+
|
|
2035
|
+
export declare class NetworkFirbiddenError extends Error {
|
|
2036
|
+
constructor(source: string, type: NetworkType, reason: string);
|
|
2037
|
+
}
|
|
2038
|
+
|
|
1754
2039
|
export declare type NetWorkMeta = {
|
|
1755
2040
|
origin: string;
|
|
1756
2041
|
source: string;
|
|
@@ -1774,11 +2059,25 @@ export declare interface NetworkOptions {
|
|
|
1774
2059
|
allowHosts?: string[];
|
|
1775
2060
|
}
|
|
1776
2061
|
|
|
2062
|
+
export declare type NetworkProgressCallback = (percent: number) => void;
|
|
2063
|
+
|
|
2064
|
+
export declare interface NetworkResourceEvent extends BaseEvent {
|
|
2065
|
+
source: string;
|
|
2066
|
+
requestType: NetworkType;
|
|
2067
|
+
requestState: NetworkState;
|
|
2068
|
+
detail: string;
|
|
2069
|
+
}
|
|
2070
|
+
|
|
1777
2071
|
export declare type NetworkResponse<T = any, E extends NetWorkMeta | NetWorkMeta[] = NetWorkMeta> = {
|
|
1778
2072
|
body: T;
|
|
1779
2073
|
meta: E;
|
|
1780
2074
|
};
|
|
1781
2075
|
|
|
2076
|
+
export declare class NetworkResponseError extends Error {
|
|
2077
|
+
httpStatus: number;
|
|
2078
|
+
constructor(source: string, type: NetworkType, status: number);
|
|
2079
|
+
}
|
|
2080
|
+
|
|
1782
2081
|
export declare type NetworkState = "ok" | "preload" | "error" | "proxy-error" | "timeout" | "forbidden";
|
|
1783
2082
|
|
|
1784
2083
|
export declare class NetworkSubscribe extends Subscribe<{
|
|
@@ -1786,8 +2085,23 @@ export declare class NetworkSubscribe extends Subscribe<{
|
|
|
1786
2085
|
}> {
|
|
1787
2086
|
}
|
|
1788
2087
|
|
|
2088
|
+
export declare type NetworkSuccessCallback<T = any> = (response: NetworkResponse<T>) => void;
|
|
2089
|
+
|
|
2090
|
+
export declare class NetworkTimeoutError extends Error {
|
|
2091
|
+
constructor(source: string, type: NetworkType, timeout: number);
|
|
2092
|
+
}
|
|
2093
|
+
|
|
1789
2094
|
export declare type NetworkType = "XMLHttpRequest" | "Script" | "Image" | "Link";
|
|
1790
2095
|
|
|
2096
|
+
export declare interface ObjectEvent extends BaseEvent {
|
|
2097
|
+
object: THREE_2.Object3D;
|
|
2098
|
+
}
|
|
2099
|
+
|
|
2100
|
+
export declare type Pano = {
|
|
2101
|
+
workCode: string;
|
|
2102
|
+
panoIndex: number;
|
|
2103
|
+
};
|
|
2104
|
+
|
|
1791
2105
|
export declare class PanoCircleMesh extends THREE_2.Object3D implements PanoCircleMeshInterface {
|
|
1792
2106
|
needsRender: boolean;
|
|
1793
2107
|
private currentStartTime;
|
|
@@ -1924,6 +2238,19 @@ export declare interface PanoCircleMeshSolidOptions {
|
|
|
1924
2238
|
color?: number;
|
|
1925
2239
|
}
|
|
1926
2240
|
|
|
2241
|
+
export declare function panoEqual(a: Pano, b: Pano): boolean;
|
|
2242
|
+
|
|
2243
|
+
export declare interface PanoEvent extends StateEvent {
|
|
2244
|
+
prevPano: Pano;
|
|
2245
|
+
progress: number;
|
|
2246
|
+
options: MovePanoOptions;
|
|
2247
|
+
error: Error | null;
|
|
2248
|
+
}
|
|
2249
|
+
|
|
2250
|
+
export declare type PanoId = `${Pano['workCode']}[${number}]`;
|
|
2251
|
+
|
|
2252
|
+
export declare function panoParse(panoId: PanoId): Pano;
|
|
2253
|
+
|
|
1927
2254
|
export declare interface PanoramaControllerCustomInitArgs extends PanoramaLikeControllerCustomInitArgs {
|
|
1928
2255
|
/** 最远可移动观察点距离 */
|
|
1929
2256
|
maxAccessibleDistance?: number;
|
|
@@ -1935,7 +2262,7 @@ export declare interface PanoramaControllerCustomInitArgs extends PanoramaLikeCo
|
|
|
1935
2262
|
*/
|
|
1936
2263
|
panoTapTriggerRadius?: number;
|
|
1937
2264
|
/** 地面观察点标识自定义创建器 */
|
|
1938
|
-
panoCircleMeshCreator?: (
|
|
2265
|
+
panoCircleMeshCreator?: (pano: Pano) => PanoCircleMeshInterface;
|
|
1939
2266
|
/**
|
|
1940
2267
|
* 全景瓦片登记
|
|
1941
2268
|
* @param fov - 当前 fov
|
|
@@ -1970,6 +2297,23 @@ export declare interface PanoramaLikeControllerCustomInitArgs {
|
|
|
1970
2297
|
intersectMeshCreator?: () => IntersectMeshInterface;
|
|
1971
2298
|
}
|
|
1972
2299
|
|
|
2300
|
+
export declare function panoStringify(pano: Pano): PanoId;
|
|
2301
|
+
|
|
2302
|
+
export declare interface PanoTextureEvent extends BaseEvent {
|
|
2303
|
+
pano: Pano;
|
|
2304
|
+
progress: number;
|
|
2305
|
+
meta: NetWorkMeta[] | null;
|
|
2306
|
+
error: Error | null;
|
|
2307
|
+
}
|
|
2308
|
+
|
|
2309
|
+
export declare type ParsedResultType = {
|
|
2310
|
+
type: 'b3dm' | 'pnts' | 'at3d' | 'pbm' | 'dome' | 'domez' | 'glb';
|
|
2311
|
+
byteLength: number;
|
|
2312
|
+
uri: string;
|
|
2313
|
+
object: THREE_2.Object3D;
|
|
2314
|
+
dispose: () => void;
|
|
2315
|
+
};
|
|
2316
|
+
|
|
1973
2317
|
/**
|
|
1974
2318
|
* 解析 Work 数据
|
|
1975
2319
|
* @param obj - work 数据,从如数开发者平台获取
|
|
@@ -1979,26 +2323,22 @@ export declare interface PanoramaLikeControllerCustomInitArgs {
|
|
|
1979
2323
|
export declare function parseWork(obj: Work | LooseWork | string | any, options?: ParseWorkOptions): Work;
|
|
1980
2324
|
|
|
1981
2325
|
export declare type ParseWorkOptions = {
|
|
2326
|
+
/** 位姿 */
|
|
2327
|
+
transform?: THREE_2.Matrix4 | number[];
|
|
2328
|
+
/** 重置 WorkCode */
|
|
2329
|
+
workCode?: string | ((input: any) => string);
|
|
1982
2330
|
/** 重写资源前缀 */
|
|
1983
2331
|
baseURL?: string;
|
|
1984
2332
|
/** 资源地址使用短地址 */
|
|
1985
2333
|
shortPath?: boolean;
|
|
1986
2334
|
/** 资源使用 jsonp 方式发布 */
|
|
1987
2335
|
jsonp?: boolean;
|
|
1988
|
-
|
|
1989
|
-
|
|
1990
|
-
|
|
1991
|
-
|
|
1992
|
-
|
|
1993
|
-
|
|
1994
|
-
/** 模型显示最大细化层级 */
|
|
1995
|
-
modelMaxLevelOfDetail?: number;
|
|
1996
|
-
/** 模型最大内存缓存 */
|
|
1997
|
-
modelMaxMemoryUsage?: number;
|
|
1998
|
-
/** 模型网络最大请求并发数 */
|
|
1999
|
-
modelMaxRequests?: number;
|
|
2000
|
-
/** 模型屏幕空间误差计算最大值 */
|
|
2001
|
-
modelMaxScreenSpaceError?: number;
|
|
2336
|
+
traverseResource?: (resource: {
|
|
2337
|
+
origin: string;
|
|
2338
|
+
absolute: string;
|
|
2339
|
+
relative: string;
|
|
2340
|
+
type: "panorama" | "texture" | "model";
|
|
2341
|
+
}) => void;
|
|
2002
2342
|
};
|
|
2003
2343
|
|
|
2004
2344
|
/** PBM 模型组 */
|
|
@@ -2008,83 +2348,73 @@ export declare class PBMContainer extends THREE_2.Group {
|
|
|
2008
2348
|
needsRender: boolean;
|
|
2009
2349
|
/** 当前样式参数 */
|
|
2010
2350
|
materialParameters: PBMParameters;
|
|
2011
|
-
cache: PBMMaterialReferenceCache;
|
|
2012
2351
|
constructor();
|
|
2013
2352
|
/** 获取材质参数 */
|
|
2014
2353
|
getMaterial(): PBMParameters;
|
|
2015
2354
|
/** 设置材质参数 */
|
|
2016
2355
|
setMaterial(parameters: Partial<PBMParameters>): void;
|
|
2017
|
-
update(renderer: THREE_2.WebGLRenderer, camera: Camera): void;
|
|
2018
|
-
/** 析构材质 */
|
|
2019
|
-
dispose(): void;
|
|
2020
2356
|
}
|
|
2021
2357
|
|
|
2022
2358
|
/** PBM 模型组 */
|
|
2023
2359
|
export declare class PBMGroup extends THREE_2.Group {
|
|
2024
|
-
needsRender: boolean;
|
|
2025
|
-
}
|
|
2026
|
-
|
|
2027
|
-
export declare class PBMMaterialReferenceCache {
|
|
2028
|
-
cache: Record<string, {
|
|
2029
|
-
count: number;
|
|
2030
|
-
value: any;
|
|
2031
|
-
dispose: () => void;
|
|
2032
|
-
}>;
|
|
2033
|
-
clear(): void;
|
|
2034
|
-
get<T>(key: string, create: () => {
|
|
2035
|
-
value: T;
|
|
2036
|
-
dispose: () => void;
|
|
2037
|
-
}): T;
|
|
2038
2360
|
}
|
|
2039
2361
|
|
|
2040
2362
|
/** PBM 对象 */
|
|
2041
2363
|
export declare class PBMMesh extends THREE_2.Mesh<THREE_2.BufferGeometry, PBMMeshMaterial[]> {
|
|
2042
|
-
|
|
2043
|
-
|
|
2364
|
+
model?: Model;
|
|
2365
|
+
constructor(geometry: THREE_2.BufferGeometry, materials: PBMMeshMaterial[]);
|
|
2044
2366
|
}
|
|
2045
2367
|
|
|
2046
2368
|
/** PBM 材质 */
|
|
2047
2369
|
export declare class PBMMeshMaterial extends THREE_2.ShaderMaterial implements PBMParameters {
|
|
2048
2370
|
/** 更新版本 */
|
|
2049
|
-
|
|
2371
|
+
syncModelVersion?: string;
|
|
2050
2372
|
/** 起始点 */
|
|
2051
|
-
pano0:
|
|
2373
|
+
pano0: PBMParameters['pano0'];
|
|
2052
2374
|
/** 结束点 */
|
|
2053
|
-
pano1:
|
|
2375
|
+
pano1: PBMParameters['pano1'];
|
|
2054
2376
|
/** 模型贴图和全景图的混合程度 [0-1] */
|
|
2055
|
-
modelAlpha:
|
|
2377
|
+
modelAlpha: PBMParameters['modelAlpha'];
|
|
2056
2378
|
/** 全景图混合程度 [0-1] */
|
|
2057
|
-
progress:
|
|
2058
|
-
/**
|
|
2059
|
-
|
|
2379
|
+
progress: PBMParameters['progress'];
|
|
2380
|
+
/** 全景图过度混合 */
|
|
2381
|
+
transition: PBMParameters['transition'];
|
|
2060
2382
|
/** 模型透明度 */
|
|
2061
|
-
opacity:
|
|
2383
|
+
opacity: PBMParameters['opacity'];
|
|
2062
2384
|
/** 模型颜色*/
|
|
2063
|
-
constantColor:
|
|
2385
|
+
constantColor: PBMParameters['constantColor'];
|
|
2064
2386
|
/** 楼层参数*/
|
|
2065
|
-
|
|
2387
|
+
shownFloorIndex: PBMParameters['shownFloorIndex'];
|
|
2066
2388
|
/** 对外模型裁切参数*/
|
|
2067
|
-
clippers:
|
|
2389
|
+
clippers: PBMParameters['clippers'];
|
|
2068
2390
|
/** edl*/
|
|
2069
|
-
useEDL:
|
|
2391
|
+
useEDL: PBMParameters['useEDL'];
|
|
2392
|
+
/** hq*/
|
|
2393
|
+
useHQWeight: PBMParameters['useHQWeight'];
|
|
2394
|
+
/** HQDepthMask*/
|
|
2395
|
+
useHQDepth: PBMParameters['useHQDepth'];
|
|
2070
2396
|
/** 点云着色方式*/
|
|
2071
|
-
|
|
2397
|
+
pointColor: PBMParameters['pointColor'];
|
|
2072
2398
|
/** 点云大小绘制方式*/
|
|
2073
|
-
|
|
2399
|
+
pointSize: PBMParameters['pointSize'];
|
|
2074
2400
|
/** 点云形状*/
|
|
2075
|
-
pointShape:
|
|
2401
|
+
pointShape: PBMParameters['pointShape'];
|
|
2076
2402
|
/** 点云基础大小*/
|
|
2077
|
-
|
|
2078
|
-
/**
|
|
2079
|
-
|
|
2080
|
-
/**
|
|
2081
|
-
|
|
2082
|
-
/**
|
|
2083
|
-
|
|
2403
|
+
pointScale: PBMParameters['pointScale'];
|
|
2404
|
+
/** 点云背面绘制方式*/
|
|
2405
|
+
pointBack: PBMParameters['pointBack'];
|
|
2406
|
+
/** 点云像素最小值*/
|
|
2407
|
+
pointMinPixel: PBMParameters['pointMinPixel'];
|
|
2408
|
+
/** 点云像素最大值*/
|
|
2409
|
+
pointMaxPixel: PBMParameters['pointMaxPixel'];
|
|
2084
2410
|
/** 高程彩色图*/
|
|
2085
|
-
gradientTexture:
|
|
2411
|
+
gradientTexture: PBMParameters['gradientTexture'];
|
|
2412
|
+
/** 所属楼层*/
|
|
2413
|
+
floor: number;
|
|
2086
2414
|
constructor(parameters?: Partial<PBMParameters>);
|
|
2087
|
-
|
|
2415
|
+
onBeforeCompile(shader: THREE_2.Shader, renderer: THREE_2.WebGLRenderer): void;
|
|
2416
|
+
update(renderer: THREE_2.WebGLRenderer, camera: THREE_2.Camera): void;
|
|
2417
|
+
syncModel(model: Model): void;
|
|
2088
2418
|
}
|
|
2089
2419
|
|
|
2090
2420
|
export declare interface PBMPanoPicture {
|
|
@@ -2094,6 +2424,8 @@ export declare interface PBMPanoPicture {
|
|
|
2094
2424
|
luminanceMap: null | THREE_2.CubeTexture | TileCubeTextureTarget;
|
|
2095
2425
|
/** 起始点全景图变换矩阵 4x4 */
|
|
2096
2426
|
matrix: THREE_2.Matrix4;
|
|
2427
|
+
/** 缩放 */
|
|
2428
|
+
zoom: number;
|
|
2097
2429
|
}
|
|
2098
2430
|
|
|
2099
2431
|
/** PBM 材质参数 */
|
|
@@ -2106,51 +2438,40 @@ export declare interface PBMParameters {
|
|
|
2106
2438
|
modelAlpha: number;
|
|
2107
2439
|
/** 全景图混合程度 [0-1] */
|
|
2108
2440
|
progress: number;
|
|
2109
|
-
/**
|
|
2110
|
-
|
|
2441
|
+
/** 全景图过度混合 */
|
|
2442
|
+
transition: 'BLACK' | 'SPREAD' | 'FADE';
|
|
2111
2443
|
/** 模型透明度 */
|
|
2112
2444
|
opacity: number;
|
|
2113
2445
|
/** 楼层参数*/
|
|
2114
|
-
|
|
2446
|
+
shownFloorIndex: number;
|
|
2115
2447
|
/** 模型裁切参数(工程侧调用)*/
|
|
2116
2448
|
clippers: ClipperParameter[] | null;
|
|
2117
2449
|
/** 模型颜色*/
|
|
2118
2450
|
constantColor: THREE_2.Vector3 | null;
|
|
2119
2451
|
/** 是否使用EDL*/
|
|
2120
2452
|
useEDL: boolean;
|
|
2453
|
+
/** 是否使用HQ*/
|
|
2454
|
+
useHQWeight: boolean;
|
|
2455
|
+
/** 是否使用HQ_DEPTH_MASK*/
|
|
2456
|
+
useHQDepth: boolean;
|
|
2121
2457
|
/** 点云形状*/
|
|
2122
|
-
pointShape:
|
|
2458
|
+
pointShape: 'SQUARE' | 'CIRCLE';
|
|
2123
2459
|
/** 点云着色方式*/
|
|
2124
|
-
|
|
2460
|
+
pointColor: 'RGB' | 'ALTITUDE';
|
|
2125
2461
|
/** 点云大小绘制方式*/
|
|
2126
|
-
|
|
2462
|
+
pointSize: 'FIXED' | 'ATTENUATION' | 'GEOMETRIC';
|
|
2463
|
+
/** 点云背面绘制方式*/
|
|
2464
|
+
pointBack: 'VISIBLE' | 'HIDDEN' | 'DARK';
|
|
2127
2465
|
/** 点云基础大小*/
|
|
2128
|
-
|
|
2466
|
+
pointScale: number;
|
|
2129
2467
|
/** 点云最大尺寸*/
|
|
2130
|
-
|
|
2468
|
+
pointMinPixel: number;
|
|
2131
2469
|
/** 点云最小尺寸*/
|
|
2132
|
-
|
|
2133
|
-
/** 自适应点云尺寸因子*/
|
|
2134
|
-
pointSizeAdaptiveScale: number;
|
|
2470
|
+
pointMaxPixel: number;
|
|
2135
2471
|
/** 高程彩色图*/
|
|
2136
2472
|
gradientTexture: THREE_2.Texture | null;
|
|
2137
2473
|
}
|
|
2138
2474
|
|
|
2139
|
-
export declare enum PBMPointColorType {
|
|
2140
|
-
RGB = "rgb",
|
|
2141
|
-
ALTITUDE = "altitude"
|
|
2142
|
-
}
|
|
2143
|
-
|
|
2144
|
-
export declare enum PBMPointShapeType {
|
|
2145
|
-
SQUARE = "square",
|
|
2146
|
-
CIRCLE = "circle"
|
|
2147
|
-
}
|
|
2148
|
-
|
|
2149
|
-
export declare enum PBMPointSizeType {
|
|
2150
|
-
FIXED = "fixed",
|
|
2151
|
-
ADAPTIVE = "adaptive"
|
|
2152
|
-
}
|
|
2153
|
-
|
|
2154
2475
|
/**
|
|
2155
2476
|
* 相机位姿
|
|
2156
2477
|
* [[include: coordinate.md]]
|
|
@@ -2168,7 +2489,9 @@ export declare interface Pose {
|
|
|
2168
2489
|
distance: number;
|
|
2169
2490
|
}
|
|
2170
2491
|
|
|
2171
|
-
export declare
|
|
2492
|
+
export declare type PostProcessingType = 'edl' | 'hq' | 'luminance' | null;
|
|
2493
|
+
|
|
2494
|
+
export declare const PROXY_CONTROLLER_EVENT_NAMES: readonly ["gesture.pan", "gesture.tap", "gesture.press", "gesture.pinch", "gesture.mousewheel", "gesture.mousemove", "gesture.momentum", "initAnimation.start", "initAnimation.end", "camera.update", "intersect.update", "pano.select", "pano.moveTo", "pano.moving", "pano.arrived", "pano.cancel", "pano.error", "pano.texture.load", "pano.texture.progress", "pano.texture.success", "pano.texture.error", "pano.texture.abort", "xr.session.start", "xr.session.end", "xr.gesture.tap", "xr.gesture.press", "xr.gesture.buttonUp", "xr.gesture.buttonDown", "xr.controller.update"];
|
|
2172
2495
|
|
|
2173
2496
|
export declare class RegionBoundingVolume implements BoundingVolume {
|
|
2174
2497
|
type: "regin";
|
|
@@ -2187,8 +2510,9 @@ export declare class RegionBoundingVolume implements BoundingVolume {
|
|
|
2187
2510
|
toGeometry(): THREE_2.BufferGeometry;
|
|
2188
2511
|
applyMatrix4(matrix: THREE_2.Matrix4): this;
|
|
2189
2512
|
getCenter(result: THREE_2.Vector3): THREE_2.Vector3;
|
|
2190
|
-
|
|
2191
|
-
|
|
2513
|
+
distanceToPoint(point: THREE_2.Vector3): number;
|
|
2514
|
+
distanceSquaredToPoint(point: THREE_2.Vector3): number;
|
|
2515
|
+
distanceToPlane(plane: THREE_2.Plane): number;
|
|
2192
2516
|
intersectPlane(plane: THREE_2.Plane): VolumePlaneIntersect;
|
|
2193
2517
|
intersectRay(ray: THREE_2.Ray): boolean;
|
|
2194
2518
|
}
|
|
@@ -2197,6 +2521,23 @@ export declare type RegionBoundingVolumeJson = {
|
|
|
2197
2521
|
region: number[];
|
|
2198
2522
|
};
|
|
2199
2523
|
|
|
2524
|
+
export declare interface RenderEvent extends BaseEvent {
|
|
2525
|
+
needsRender: boolean;
|
|
2526
|
+
info: null | {
|
|
2527
|
+
memory: {
|
|
2528
|
+
geometries: number;
|
|
2529
|
+
textures: number;
|
|
2530
|
+
};
|
|
2531
|
+
render: {
|
|
2532
|
+
calls: number;
|
|
2533
|
+
frame: number;
|
|
2534
|
+
lines: number;
|
|
2535
|
+
points: number;
|
|
2536
|
+
triangles: number;
|
|
2537
|
+
};
|
|
2538
|
+
};
|
|
2539
|
+
}
|
|
2540
|
+
|
|
2200
2541
|
export declare type RequestResult = null | {
|
|
2201
2542
|
done: () => void;
|
|
2202
2543
|
};
|
|
@@ -2275,10 +2616,11 @@ export declare class SphereBoundingVolume implements BoundingVolume {
|
|
|
2275
2616
|
toGeometry(): THREE_2.BufferGeometry;
|
|
2276
2617
|
applyMatrix4(matrix: THREE_2.Matrix4): this;
|
|
2277
2618
|
getCenter(result: THREE_2.Vector3): THREE_2.Vector3;
|
|
2278
|
-
|
|
2279
|
-
|
|
2619
|
+
distanceSquaredToPoint(point: THREE_2.Vector3): number;
|
|
2620
|
+
distanceToPoint(point: THREE_2.Vector3): number;
|
|
2621
|
+
distanceToPlane(plane: THREE_2.Plane): number;
|
|
2280
2622
|
intersectPlane(plane: THREE_2.Plane): VolumePlaneIntersect;
|
|
2281
|
-
intersectRay(ray: THREE_2.Ray): boolean;
|
|
2623
|
+
intersectRay(ray: THREE_2.Ray, far?: number): boolean;
|
|
2282
2624
|
}
|
|
2283
2625
|
|
|
2284
2626
|
export declare type SphereBoundingVolumeJson = {
|
|
@@ -2297,10 +2639,15 @@ export declare type SphereBoundingVolumeJson = {
|
|
|
2297
2639
|
export declare interface State extends Pose {
|
|
2298
2640
|
/** 模态 */
|
|
2299
2641
|
mode: Mode;
|
|
2642
|
+
/** workCode */
|
|
2643
|
+
workCode: string;
|
|
2300
2644
|
/** 观察点序号 */
|
|
2301
2645
|
panoIndex: number;
|
|
2302
|
-
|
|
2303
|
-
|
|
2646
|
+
}
|
|
2647
|
+
|
|
2648
|
+
export declare interface StateEvent extends BaseEvent {
|
|
2649
|
+
state: State;
|
|
2650
|
+
userAction: boolean;
|
|
2304
2651
|
}
|
|
2305
2652
|
|
|
2306
2653
|
/**
|
|
@@ -2392,7 +2739,7 @@ export declare namespace SubscribeMixinType {
|
|
|
2392
2739
|
}
|
|
2393
2740
|
|
|
2394
2741
|
export declare class TextureLoader {
|
|
2395
|
-
loadTexture(source: string, options
|
|
2742
|
+
loadTexture(source: string, options: {
|
|
2396
2743
|
imageURL?: {
|
|
2397
2744
|
transform?: (source: string, options: ImageURLOptions) => string;
|
|
2398
2745
|
options?: ImageURLOptions;
|
|
@@ -2401,11 +2748,14 @@ export declare class TextureLoader {
|
|
|
2401
2748
|
format?: THREE_2.PixelFormat;
|
|
2402
2749
|
minFilter?: THREE_2.TextureFilter;
|
|
2403
2750
|
magFilter?: THREE_2.TextureFilter;
|
|
2751
|
+
generateMipmaps?: boolean;
|
|
2404
2752
|
wrapS?: THREE_2.Wrapping;
|
|
2405
2753
|
wrapT?: THREE_2.Wrapping;
|
|
2406
2754
|
maxSize?: THREE_2.Vector2;
|
|
2407
2755
|
viaAjax?: boolean;
|
|
2408
|
-
|
|
2756
|
+
timeout?: number;
|
|
2757
|
+
fetcher: Fetcher;
|
|
2758
|
+
}, onLoad?: (response: NetworkResponse<THREE_2.Texture>) => void, onError?: (error: Error) => void, onProgress?: (percent: number) => void, renderer?: THREE_2.WebGLRenderer): Promise<NetworkResponse<THREE_2.Texture>>;
|
|
2409
2759
|
loadCubeTexture(sources: WorkCubeImage, options: {
|
|
2410
2760
|
imageURL?: {
|
|
2411
2761
|
transform?: (source: string, options: ImageURLOptions) => string;
|
|
@@ -2414,12 +2764,14 @@ export declare class TextureLoader {
|
|
|
2414
2764
|
format?: THREE_2.PixelFormat;
|
|
2415
2765
|
minFilter?: THREE_2.TextureFilter;
|
|
2416
2766
|
magFilter?: THREE_2.TextureFilter;
|
|
2767
|
+
generateMipmaps?: boolean;
|
|
2417
2768
|
wrapS?: THREE_2.Wrapping;
|
|
2418
2769
|
wrapT?: THREE_2.Wrapping;
|
|
2419
2770
|
viaAjax?: boolean;
|
|
2420
|
-
|
|
2771
|
+
timeout?: number;
|
|
2772
|
+
fetcher: Fetcher;
|
|
2773
|
+
}, onLoad: (response: NetworkResponse<THREE_2.CubeTexture, NetWorkMeta[]>) => void, onError: (error: Error) => void, onProgress: (percent: number) => void, renderer: THREE_2.WebGLRenderer): Promise<NetworkResponse<THREE_2.CubeTexture, NetWorkMeta[]>>;
|
|
2421
2774
|
loadTiledCubeTexture(sources: WorkCubeImage, tileSources: WorkTile[], options: {
|
|
2422
|
-
tileImageSize?: number;
|
|
2423
2775
|
tileMaxLevel?: number;
|
|
2424
2776
|
imageURL?: {
|
|
2425
2777
|
transform?: (source: string, options: ImageURLOptions) => string;
|
|
@@ -2428,10 +2780,13 @@ export declare class TextureLoader {
|
|
|
2428
2780
|
format?: THREE_2.PixelFormat;
|
|
2429
2781
|
minFilter?: THREE_2.TextureFilter;
|
|
2430
2782
|
magFilter?: THREE_2.TextureFilter;
|
|
2783
|
+
generateMipmaps?: boolean;
|
|
2431
2784
|
wrapS?: THREE_2.Wrapping;
|
|
2432
2785
|
wrapT?: THREE_2.Wrapping;
|
|
2433
2786
|
viaAjax?: boolean;
|
|
2434
|
-
|
|
2787
|
+
timeout?: number;
|
|
2788
|
+
fetcher: Fetcher;
|
|
2789
|
+
}, onLoad: (response: NetworkResponse<TileCubeTextureTarget, NetWorkMeta[]>) => void, onError: (error: Error) => void, onProgress: (percent: number) => void, renderer: THREE_2.WebGLRenderer): Promise<NetworkResponse<TileCubeTextureTarget, NetWorkMeta[]>>;
|
|
2435
2790
|
}
|
|
2436
2791
|
|
|
2437
2792
|
/**
|
|
@@ -2485,7 +2840,6 @@ export declare class Tile {
|
|
|
2485
2840
|
requestedFrameNumber: number;
|
|
2486
2841
|
touchedFrameNumber: number;
|
|
2487
2842
|
selectionDepth: number;
|
|
2488
|
-
centerZDepth: number;
|
|
2489
2843
|
shouldRefine: boolean;
|
|
2490
2844
|
distanceToCamera: number;
|
|
2491
2845
|
screenSpaceError: number;
|
|
@@ -2511,57 +2865,95 @@ export declare class Tile {
|
|
|
2511
2865
|
}
|
|
2512
2866
|
|
|
2513
2867
|
export declare class Tile3DModel extends THREE_2.Object3D {
|
|
2868
|
+
static DEFAULT_MIN_LEVEL_OF_DETAIL: number;
|
|
2514
2869
|
static DEFAULT_MAX_LEVEL_OF_DETAIL: number;
|
|
2515
2870
|
static DEFAULT_MAX_MEMORY_USAGE: number;
|
|
2516
2871
|
static DEFAULT_MAX_SCREEN_SPACE_ERROR: number;
|
|
2517
2872
|
static DEFAULT_MAX_REQUESTS: number;
|
|
2518
|
-
|
|
2873
|
+
type: 'point_cloud' | 'mesh';
|
|
2874
|
+
upAxis: string;
|
|
2875
|
+
model: Model;
|
|
2876
|
+
viewLayer?: ModelViewLayer;
|
|
2877
|
+
search: string;
|
|
2878
|
+
groundHeight: number | null;
|
|
2879
|
+
coordinateTransform: {
|
|
2880
|
+
localToEnuMatrix: THREE_2.Matrix4;
|
|
2881
|
+
enuToLocalMatrix: THREE_2.Matrix4;
|
|
2882
|
+
enuToEcefMatrix: THREE_2.Matrix4;
|
|
2883
|
+
ecefToEnuMatrix: THREE_2.Matrix4;
|
|
2884
|
+
viewToEcefMatrix: THREE_2.Matrix4;
|
|
2885
|
+
ecefToViewMatrix: THREE_2.Matrix4;
|
|
2886
|
+
};
|
|
2519
2887
|
tileset: Tileset;
|
|
2888
|
+
idle: boolean;
|
|
2889
|
+
minLevelOfDetail: number;
|
|
2520
2890
|
maxLevelOfDetail: number;
|
|
2521
2891
|
boundingBox: THREE_2.Box3;
|
|
2522
2892
|
needsRefined: boolean;
|
|
2523
2893
|
refined: boolean;
|
|
2894
|
+
refineProgress: [number, number];
|
|
2524
2895
|
loaded: boolean;
|
|
2525
|
-
disposed: boolean;
|
|
2526
2896
|
needsRender: boolean;
|
|
2527
|
-
|
|
2897
|
+
cacheCameras: (THREE_2.PerspectiveCamera | Camera)[];
|
|
2898
|
+
private lastRefineTime;
|
|
2899
|
+
private disposed;
|
|
2528
2900
|
private nodeGroup;
|
|
2529
2901
|
private debugBoundingGroup;
|
|
2530
2902
|
private nodes;
|
|
2531
2903
|
private debugBoundings;
|
|
2532
2904
|
private unloadTileQueue;
|
|
2533
|
-
constructor(
|
|
2905
|
+
constructor(model: Model, tilesetHeader: TilesetHeader, options: Tile3DModelLoaderOptions);
|
|
2534
2906
|
get debug(): boolean;
|
|
2535
2907
|
set debug(value: boolean);
|
|
2536
2908
|
get maxMemoryUsage(): number;
|
|
2537
2909
|
set maxMemoryUsage(value: number);
|
|
2538
|
-
get viewDistanceScale(): number;
|
|
2539
|
-
set viewDistanceScale(value: number);
|
|
2540
2910
|
get maxRequests(): number;
|
|
2541
2911
|
set maxRequests(value: number);
|
|
2542
2912
|
get maxScreenSpaceError(): number;
|
|
2543
2913
|
set maxScreenSpaceError(value: number);
|
|
2914
|
+
localToEnu(vector: THREE_2.Vector3): THREE_2.Vector3;
|
|
2915
|
+
enuToLocal(vector: THREE_2.Vector3): THREE_2.Vector3;
|
|
2916
|
+
localToEcef(vector: THREE_2.Vector3): THREE_2.Vector3;
|
|
2917
|
+
ecefToLocal(vector: THREE_2.Vector3): THREE_2.Vector3;
|
|
2918
|
+
localToLla(vector: THREE_2.Vector3): THREE_2.Vector3;
|
|
2919
|
+
llaToLocal(vector: THREE_2.Vector3): THREE_2.Vector3;
|
|
2920
|
+
worldToEnu(vector: THREE_2.Vector3): THREE_2.Vector3;
|
|
2921
|
+
enuToWorld(vector: THREE_2.Vector3): THREE_2.Vector3;
|
|
2922
|
+
worldToEcef(vector: THREE_2.Vector3): THREE_2.Vector3;
|
|
2923
|
+
ecefToWorld(vector: THREE_2.Vector3): THREE_2.Vector3;
|
|
2924
|
+
worldToLla(vector: THREE_2.Vector3): THREE_2.Vector3;
|
|
2925
|
+
llaToWorld(vector: THREE_2.Vector3): THREE_2.Vector3;
|
|
2544
2926
|
loadContent(tile: Tile, options: {
|
|
2545
|
-
|
|
2546
|
-
requestProxy?: (url: string) => string | Promise<string>;
|
|
2547
|
-
networkSubscribe?: NetworkSubscribe;
|
|
2927
|
+
fetcher: Fetcher;
|
|
2548
2928
|
}): Promise<boolean>;
|
|
2549
|
-
intersectRaycaster(raycaster: THREE_2.Raycaster): Intersection[];
|
|
2929
|
+
intersectRaycaster(raycaster: THREE_2.Raycaster, sortByDistance?: boolean, target?: Intersection[]): Intersection[];
|
|
2550
2930
|
update(renderer: THREE_2.WebGLRenderer, camera: Camera): void;
|
|
2551
2931
|
dispose(): void;
|
|
2552
2932
|
}
|
|
2553
2933
|
|
|
2554
2934
|
/** Advanced loader options */
|
|
2555
2935
|
export declare interface Tile3DModelLoaderOptions {
|
|
2936
|
+
name: string;
|
|
2937
|
+
type: 'point_cloud' | 'mesh';
|
|
2938
|
+
upAxis: string;
|
|
2939
|
+
referer: string;
|
|
2940
|
+
fetcher: Fetcher;
|
|
2556
2941
|
resourcePath: string;
|
|
2557
|
-
|
|
2558
|
-
|
|
2559
|
-
|
|
2942
|
+
groundHeight: number | null;
|
|
2943
|
+
coordinateTransform: {
|
|
2944
|
+
localToEnuMatrix: THREE_2.Matrix4;
|
|
2945
|
+
enuToLocalMatrix: THREE_2.Matrix4;
|
|
2946
|
+
enuToEcefMatrix: THREE_2.Matrix4;
|
|
2947
|
+
ecefToEnuMatrix: THREE_2.Matrix4;
|
|
2948
|
+
viewToEcefMatrix: THREE_2.Matrix4;
|
|
2949
|
+
ecefToViewMatrix: THREE_2.Matrix4;
|
|
2950
|
+
};
|
|
2951
|
+
search?: string;
|
|
2560
2952
|
onError?: (error: Error) => void;
|
|
2561
2953
|
}
|
|
2562
2954
|
|
|
2563
2955
|
export declare type TileContentData = {
|
|
2564
|
-
type: 'b3dm' | 'pnts' | 'at3d' | 'pbm';
|
|
2956
|
+
type: 'b3dm' | 'pnts' | 'at3d' | 'pbm' | 'dome' | 'domez' | 'glb';
|
|
2565
2957
|
byteLength: number;
|
|
2566
2958
|
uri: string;
|
|
2567
2959
|
object: TileNode;
|
|
@@ -2591,7 +2983,6 @@ export declare class TileCubeTextureTarget {
|
|
|
2591
2983
|
private textures;
|
|
2592
2984
|
constructor(baseCubeTexture: THREE_2.CubeTexture, tileTree: TileCubeTree, tileSources: WorkTile[], options: {
|
|
2593
2985
|
textureSize: number;
|
|
2594
|
-
tileImageSize: number;
|
|
2595
2986
|
textureLoader: TextureLoader;
|
|
2596
2987
|
imageURL?: {
|
|
2597
2988
|
transform?: (source: string, options: ImageURLOptions) => string;
|
|
@@ -2600,9 +2991,12 @@ export declare class TileCubeTextureTarget {
|
|
|
2600
2991
|
format?: THREE_2.PixelFormat;
|
|
2601
2992
|
minFilter?: THREE_2.TextureFilter;
|
|
2602
2993
|
magFilter?: THREE_2.TextureFilter;
|
|
2994
|
+
generateMipmaps?: boolean;
|
|
2603
2995
|
wrapS?: THREE_2.Wrapping;
|
|
2604
2996
|
wrapT?: THREE_2.Wrapping;
|
|
2605
|
-
|
|
2997
|
+
timeout?: number;
|
|
2998
|
+
fetcher: Fetcher;
|
|
2999
|
+
}, renderer: THREE_2.WebGLRenderer);
|
|
2606
3000
|
get cubeRenderTarget(): THREE_2.WebGLCubeRenderTarget | null;
|
|
2607
3001
|
set cubeRenderTarget(cubeRenderTarget: THREE_2.WebGLCubeRenderTarget | null);
|
|
2608
3002
|
private requestTile;
|
|
@@ -2632,11 +3026,10 @@ export declare interface TileHeader {
|
|
|
2632
3026
|
}
|
|
2633
3027
|
|
|
2634
3028
|
export declare class TileNode extends THREE_2.Group {
|
|
2635
|
-
|
|
2636
|
-
|
|
2637
|
-
|
|
2638
|
-
|
|
2639
|
-
intersectRaycaster(raycaster: THREE_2.Raycaster): Intersection[];
|
|
3029
|
+
private disposers;
|
|
3030
|
+
constructor(obj: THREE_2.Object3D, objDisposer: () => void);
|
|
3031
|
+
generateBvhTree(): Promise<void>;
|
|
3032
|
+
intersectRaycaster(raycaster: THREE_2.Raycaster, sortByDistance?: boolean, target?: Intersection[]): Intersection[];
|
|
2640
3033
|
dispose(): void;
|
|
2641
3034
|
}
|
|
2642
3035
|
|
|
@@ -2648,26 +3041,50 @@ export declare class Tileset {
|
|
|
2648
3041
|
asset: {
|
|
2649
3042
|
version: string;
|
|
2650
3043
|
tilesetVersion: string;
|
|
2651
|
-
gltfUpAxis: "
|
|
3044
|
+
gltfUpAxis: "Y" | "Z";
|
|
3045
|
+
overview?: {
|
|
3046
|
+
imageFile: string;
|
|
3047
|
+
worldFile: string;
|
|
3048
|
+
imageWidth: number;
|
|
3049
|
+
imageHeight: number;
|
|
3050
|
+
};
|
|
3051
|
+
[key: string]: any;
|
|
2652
3052
|
};
|
|
2653
3053
|
id: string;
|
|
3054
|
+
referer: string;
|
|
2654
3055
|
frameNumber: number;
|
|
2655
3056
|
properties: Record<string, any>;
|
|
2656
3057
|
options: TilesetOptions;
|
|
2657
3058
|
root: Tile;
|
|
2658
|
-
|
|
3059
|
+
rootMeta: {
|
|
3060
|
+
creationTime?: string;
|
|
3061
|
+
upAxis?: string;
|
|
3062
|
+
coordinate?: {
|
|
3063
|
+
base_keyframe: number;
|
|
3064
|
+
base_trajectory: number;
|
|
3065
|
+
coordinate_system: string;
|
|
3066
|
+
ground_height: number;
|
|
3067
|
+
lon_lat_alt: [number, number, number];
|
|
3068
|
+
pose_ecef_to_enu: number[];
|
|
3069
|
+
pose_enu_to_ecef: number[];
|
|
3070
|
+
version: number;
|
|
3071
|
+
};
|
|
3072
|
+
};
|
|
3073
|
+
transform: THREE_2.Matrix4;
|
|
3074
|
+
transformIsIdentity: boolean;
|
|
2659
3075
|
geometricError: number;
|
|
2660
|
-
traverser
|
|
3076
|
+
private traverser;
|
|
2661
3077
|
cache: TilesetCache;
|
|
2662
3078
|
requestScheduler: RequestScheduler<string>;
|
|
2663
3079
|
private memoryUsageInBytes;
|
|
2664
3080
|
maxMemoryUsage: number;
|
|
2665
|
-
viewDistanceScale: number;
|
|
2666
3081
|
tiles: Map<string, Tile>;
|
|
2667
3082
|
private pendingCount;
|
|
2668
3083
|
constructor(id: string, header: TilesetHeader, options: TilesetOptions);
|
|
2669
3084
|
get maxRequests(): number;
|
|
2670
3085
|
set maxRequests(value: number);
|
|
3086
|
+
get skipLevelOfDetail(): boolean;
|
|
3087
|
+
set skipLevelOfDetail(value: boolean);
|
|
2671
3088
|
get maxScreenSpaceError(): number;
|
|
2672
3089
|
set maxScreenSpaceError(value: number);
|
|
2673
3090
|
get selectedTiles(): Map<string, Tile>;
|
|
@@ -2676,11 +3093,7 @@ export declare class Tileset {
|
|
|
2676
3093
|
reset(): void;
|
|
2677
3094
|
/** Is the tileset loaded (update needs to have been called at least once) */
|
|
2678
3095
|
isLoaded(): boolean;
|
|
2679
|
-
|
|
2680
|
-
* The callback to post-process tiles after traversal procedure
|
|
2681
|
-
* @param frameState - frame state for tile culling
|
|
2682
|
-
*/
|
|
2683
|
-
private onTraversalEnd;
|
|
3096
|
+
traverse(frameState: TilesetFrameState, cacheFrameStates?: TilesetFrameState[]): void;
|
|
2684
3097
|
loadTile(tile: Tile): void;
|
|
2685
3098
|
unloadTile(tile: Tile): void;
|
|
2686
3099
|
}
|
|
@@ -2700,14 +3113,19 @@ export declare class TilesetCache {
|
|
|
2700
3113
|
|
|
2701
3114
|
export declare type TilesetFrameState = {
|
|
2702
3115
|
camera: {
|
|
3116
|
+
type: "PerspectiveCamera" | "OrthographicCamera";
|
|
2703
3117
|
position: THREE.Vector3;
|
|
2704
3118
|
direction: THREE.Vector3;
|
|
2705
3119
|
up: THREE.Vector3;
|
|
3120
|
+
visible: boolean;
|
|
3121
|
+
refine: boolean;
|
|
2706
3122
|
};
|
|
2707
3123
|
height: number;
|
|
3124
|
+
pixelRatio: number;
|
|
2708
3125
|
cullingVolume: CullingVolume;
|
|
2709
3126
|
frameNumber: number;
|
|
2710
3127
|
sseDenominator: number;
|
|
3128
|
+
minLevelOfDetail: number;
|
|
2711
3129
|
maxLevelOfDetail: number;
|
|
2712
3130
|
};
|
|
2713
3131
|
|
|
@@ -2715,21 +3133,40 @@ export declare interface TilesetHeader {
|
|
|
2715
3133
|
asset: {
|
|
2716
3134
|
version: string;
|
|
2717
3135
|
tilesetVersion?: string;
|
|
2718
|
-
gltfUpAxis?: "
|
|
3136
|
+
gltfUpAxis?: "Y" | "Z";
|
|
3137
|
+
overview?: {
|
|
3138
|
+
imageFile: string;
|
|
3139
|
+
worldFile: string;
|
|
3140
|
+
imageWidth: number;
|
|
3141
|
+
imageHeight: number;
|
|
3142
|
+
};
|
|
3143
|
+
[key: string]: any;
|
|
2719
3144
|
};
|
|
2720
3145
|
properties?: Record<string, any>;
|
|
2721
3146
|
geometricError: number;
|
|
2722
3147
|
root: TileHeader;
|
|
3148
|
+
rootMeta?: {
|
|
3149
|
+
creationTime?: string;
|
|
3150
|
+
upAxis?: string;
|
|
3151
|
+
coordinate?: {
|
|
3152
|
+
base_keyframe: number;
|
|
3153
|
+
base_trajectory: number;
|
|
3154
|
+
coordinate_system: string;
|
|
3155
|
+
ground_height: number;
|
|
3156
|
+
lon_lat_alt: [number, number, number];
|
|
3157
|
+
pose_ecef_to_enu: number[];
|
|
3158
|
+
pose_enu_to_ecef: number[];
|
|
3159
|
+
version: number;
|
|
3160
|
+
};
|
|
3161
|
+
};
|
|
2723
3162
|
}
|
|
2724
3163
|
|
|
2725
3164
|
export declare interface TilesetOptions {
|
|
3165
|
+
referer?: string;
|
|
3166
|
+
contentLoader: (tile: Tile) => Promise<boolean>;
|
|
2726
3167
|
onTileLoad: (tile: Tile) => any;
|
|
2727
3168
|
onTileUnload: (tile: Tile) => any;
|
|
2728
3169
|
onTileError: (tile: Tile, error: Error) => any;
|
|
2729
|
-
contentLoader: (tile: Tile) => Promise<boolean>;
|
|
2730
|
-
allowHosts?: string[];
|
|
2731
|
-
requestProxy?: (url: string) => string | Promise<string>;
|
|
2732
|
-
networkSubscribe?: NetworkSubscribe;
|
|
2733
3170
|
}
|
|
2734
3171
|
|
|
2735
3172
|
export declare class TilesetTraverser {
|
|
@@ -2740,15 +3177,15 @@ export declare class TilesetTraverser {
|
|
|
2740
3177
|
loadSiblings: boolean;
|
|
2741
3178
|
skipLevelOfDetail: boolean;
|
|
2742
3179
|
maxScreenSpaceError: number;
|
|
2743
|
-
onTraversalEnd: (frameState: TilesetFrameState) => any;
|
|
2744
3180
|
requestedTiles: Map<string, Tile>;
|
|
2745
3181
|
selectedTiles: Map<string, Tile>;
|
|
2746
3182
|
needsRefinedTiles: Map<string, Tile>;
|
|
2747
3183
|
emptyTiles: Map<string, Tile>;
|
|
3184
|
+
private _canSelectTile;
|
|
2748
3185
|
private _traversalStack;
|
|
2749
3186
|
private _emptyTraversalStack;
|
|
2750
|
-
constructor(
|
|
2751
|
-
traverse(root: Tile, frameState: TilesetFrameState): void;
|
|
3187
|
+
constructor();
|
|
3188
|
+
traverse(root: Tile, frameState: TilesetFrameState, cacheFrameStates?: TilesetFrameState[]): void;
|
|
2752
3189
|
reset(): void;
|
|
2753
3190
|
private executeTraversal;
|
|
2754
3191
|
private updateChildTiles;
|
|
@@ -2779,26 +3216,36 @@ export declare enum VolumePlaneIntersect {
|
|
|
2779
3216
|
export declare interface VRPanoramaControllerCustomInitArgs extends Omit<PanoramaControllerCustomInitArgs, "maxLatitude" | "minLatitude"> {
|
|
2780
3217
|
}
|
|
2781
3218
|
|
|
2782
|
-
export declare
|
|
3219
|
+
export declare interface WebXRAxesParams {
|
|
3220
|
+
raycaster: {
|
|
3221
|
+
leftRay?: THREE_2.Raycaster;
|
|
3222
|
+
rightRay?: THREE_2.Raycaster;
|
|
3223
|
+
};
|
|
3224
|
+
axesState: {
|
|
3225
|
+
up: number;
|
|
3226
|
+
down: number;
|
|
3227
|
+
left: number;
|
|
3228
|
+
right: number;
|
|
3229
|
+
};
|
|
3230
|
+
deltaTime: number;
|
|
3231
|
+
}
|
|
3232
|
+
|
|
3233
|
+
export declare type WebXRControllerKey = XRGestureEvent['buttons'];
|
|
2783
3234
|
|
|
2784
3235
|
export declare interface WebXRControllerParams {
|
|
2785
|
-
raycaster:
|
|
3236
|
+
raycaster: {
|
|
3237
|
+
leftRay: THREE_2.Raycaster;
|
|
3238
|
+
rightRay: THREE_2.Raycaster;
|
|
3239
|
+
};
|
|
2786
3240
|
}
|
|
2787
3241
|
|
|
2788
|
-
export declare type WebXRControllerType = 'tap' | 'press' | 'axes';
|
|
2789
|
-
|
|
2790
|
-
export declare type WebXREventTypes = {
|
|
2791
|
-
/** WebXR模式开始,session完成坐标系设置*/
|
|
2792
|
-
webXRSessionStart(): void;
|
|
2793
|
-
/** WebXR模式结束,销毁session*/
|
|
2794
|
-
webXRSessionEnd(): void;
|
|
2795
|
-
};
|
|
3242
|
+
export declare type WebXRControllerType = 'tap' | 'press' | 'axes' | 'buttonUp' | 'buttonDown';
|
|
2796
3243
|
|
|
2797
3244
|
export declare class Work {
|
|
2798
3245
|
/** 名称 */
|
|
2799
3246
|
name: string;
|
|
2800
3247
|
/** 编号 */
|
|
2801
|
-
workCode:
|
|
3248
|
+
workCode: string;
|
|
2802
3249
|
/** 允许访问的安全域名 */
|
|
2803
3250
|
allowHosts: string[];
|
|
2804
3251
|
/** 过期时间 */
|
|
@@ -2811,8 +3258,19 @@ export declare class Work {
|
|
|
2811
3258
|
observers: WorkObserver[];
|
|
2812
3259
|
/** 数据签发人 */
|
|
2813
3260
|
issuer: string;
|
|
2814
|
-
/**
|
|
2815
|
-
|
|
3261
|
+
/** 位姿修正 */
|
|
3262
|
+
transform: THREE_2.Matrix4;
|
|
3263
|
+
/**
|
|
3264
|
+
* 控制参数
|
|
3265
|
+
* @deprecated 通过 work.transform 替换
|
|
3266
|
+
*/
|
|
3267
|
+
options: {
|
|
3268
|
+
/**
|
|
3269
|
+
* 位姿修正
|
|
3270
|
+
* @deprecated 通过 work.transform 替换
|
|
3271
|
+
*/
|
|
3272
|
+
transform: THREE_2.Matrix4;
|
|
3273
|
+
};
|
|
2816
3274
|
/** 原始数据 */
|
|
2817
3275
|
raw: {
|
|
2818
3276
|
works: string[];
|
|
@@ -2829,8 +3287,6 @@ export declare class Work {
|
|
|
2829
3287
|
toJSON(): any;
|
|
2830
3288
|
}
|
|
2831
3289
|
|
|
2832
|
-
export declare type WorkCode = string;
|
|
2833
|
-
|
|
2834
3290
|
export declare interface WorkCubeImage {
|
|
2835
3291
|
/** 全景图 up */
|
|
2836
3292
|
up: string;
|
|
@@ -2844,24 +3300,27 @@ export declare interface WorkCubeImage {
|
|
|
2844
3300
|
front: string;
|
|
2845
3301
|
/** 全景图 back */
|
|
2846
3302
|
back: string;
|
|
3303
|
+
/** 分辨率表 */
|
|
3304
|
+
sizeList?: number[];
|
|
2847
3305
|
}
|
|
2848
3306
|
|
|
2849
3307
|
/** 全景图 */
|
|
2850
3308
|
export declare interface WorkImage extends WorkCubeImage {
|
|
2851
|
-
/** 深度图 */
|
|
2852
|
-
depth?: string;
|
|
2853
3309
|
/** 光照强度图 */
|
|
2854
|
-
luminance?: WorkCubeImage
|
|
3310
|
+
luminance?: WorkCubeImage & {
|
|
3311
|
+
tiles?: WorkTile[];
|
|
3312
|
+
};
|
|
2855
3313
|
/** 瓦片信息 */
|
|
2856
3314
|
tiles?: WorkTile[];
|
|
2857
3315
|
}
|
|
2858
3316
|
|
|
2859
3317
|
/** 初始化位姿参数 */
|
|
2860
3318
|
export declare interface WorkInitial {
|
|
3319
|
+
work: Work;
|
|
2861
3320
|
/** 模态 */
|
|
2862
3321
|
mode?: Mode;
|
|
2863
3322
|
/** 点位序号 */
|
|
2864
|
-
|
|
3323
|
+
panoIndex?: number;
|
|
2865
3324
|
/** 相机水平角 */
|
|
2866
3325
|
longitude?: number;
|
|
2867
3326
|
/** 相机俯仰角 */
|
|
@@ -2899,12 +3358,18 @@ export declare interface WorkObserver {
|
|
|
2899
3358
|
work: Work;
|
|
2900
3359
|
/** 序号 */
|
|
2901
3360
|
index: number;
|
|
3361
|
+
/** 序号 */
|
|
3362
|
+
panoIndex: number;
|
|
2902
3363
|
/** 点位序号 */
|
|
2903
|
-
panoId:
|
|
3364
|
+
panoId: PanoId;
|
|
3365
|
+
/** 点位序号 */
|
|
3366
|
+
pano: Pano;
|
|
2904
3367
|
/** 点位所在楼层 */
|
|
2905
3368
|
floorIndex: number;
|
|
2906
3369
|
/** 点位 derived_id */
|
|
2907
3370
|
derivedId?: number;
|
|
3371
|
+
/** 点位 derived_id_str */
|
|
3372
|
+
derivedIdStr?: string;
|
|
2908
3373
|
/** 点位是否激活可用 */
|
|
2909
3374
|
active: boolean;
|
|
2910
3375
|
/** 点位是否可加载 */
|
|
@@ -2914,9 +3379,13 @@ export declare interface WorkObserver {
|
|
|
2914
3379
|
/** 点位视频 */
|
|
2915
3380
|
video?: WorkVideo;
|
|
2916
3381
|
/** 可以看到的相关点位序号 */
|
|
2917
|
-
|
|
3382
|
+
visibleNodes: number[];
|
|
3383
|
+
/** 可以看到的相关点位序号 */
|
|
3384
|
+
visibleIds: PanoId[];
|
|
2918
3385
|
/** 可以连通的相关点位序号 */
|
|
2919
|
-
|
|
3386
|
+
accessibleNodes: number[];
|
|
3387
|
+
/** 可以看到的相关点位序号 */
|
|
3388
|
+
accessibleIds: PanoId[];
|
|
2920
3389
|
/** 点位和模型的地面坐标 */
|
|
2921
3390
|
standingPosition: THREE_2.Vector3;
|
|
2922
3391
|
/** 点位和模型的观察点坐标 */
|
|
@@ -2925,36 +3394,29 @@ export declare interface WorkObserver {
|
|
|
2925
3394
|
quaternion: THREE_2.Quaternion;
|
|
2926
3395
|
}
|
|
2927
3396
|
|
|
2928
|
-
export declare interface
|
|
2929
|
-
|
|
2930
|
-
debug?: boolean;
|
|
2931
|
-
/** 位姿修正 */
|
|
2932
|
-
transform: THREE_2.Matrix4;
|
|
2933
|
-
/** 可观测区域 */
|
|
2934
|
-
viewerRequestVolume?: BoundingVolume;
|
|
2935
|
-
/** 模型显示最大细化层级 */
|
|
2936
|
-
modelMaxLevelOfDetail?: number;
|
|
2937
|
-
/** 模型最大内存缓存 */
|
|
2938
|
-
modelMaxMemoryUsage?: number;
|
|
2939
|
-
/** 模型网络最大请求并发数 */
|
|
2940
|
-
modelMaxRequests?: number;
|
|
2941
|
-
/** 模型屏幕空间误差计算最大值 */
|
|
2942
|
-
modelMaxScreenSpaceError?: number;
|
|
3397
|
+
export declare interface WorkResolvedObserver extends WorkObserver {
|
|
3398
|
+
isResolved: true;
|
|
2943
3399
|
}
|
|
2944
3400
|
|
|
2945
|
-
export declare type WorkPanoId = string;
|
|
2946
|
-
|
|
2947
3401
|
export declare type Works = ReadonlyArray<Work> & {
|
|
2948
|
-
resolvedObservers:
|
|
3402
|
+
resolvedObservers: WorkResolvedObserver[];
|
|
2949
3403
|
initial: WorkInitial;
|
|
2950
|
-
getWork(workCode:
|
|
2951
|
-
getResolvedObserver(
|
|
3404
|
+
getWork(workCode: string): Work | undefined;
|
|
3405
|
+
getResolvedObserver(pano: PanoId | Pano | number): WorkResolvedObserver | undefined;
|
|
2952
3406
|
update(): void;
|
|
2953
3407
|
};
|
|
2954
3408
|
|
|
3409
|
+
export declare interface WorksEvent extends BaseEvent {
|
|
3410
|
+
input: any;
|
|
3411
|
+
works: Works;
|
|
3412
|
+
state: Partial<State>;
|
|
3413
|
+
userAction: boolean;
|
|
3414
|
+
}
|
|
3415
|
+
|
|
2955
3416
|
export declare interface WorkTile {
|
|
2956
3417
|
level: number;
|
|
2957
3418
|
size: number;
|
|
3419
|
+
scale: number;
|
|
2958
3420
|
up: string;
|
|
2959
3421
|
down: string;
|
|
2960
3422
|
right: string;
|
|
@@ -2977,7 +3439,60 @@ export declare class XRButton {
|
|
|
2977
3439
|
static createButton(onClickHook: () => void): HTMLAnchorElement | HTMLButtonElement;
|
|
2978
3440
|
}
|
|
2979
3441
|
|
|
3442
|
+
export declare interface XRControllerEvent extends BaseEvent {
|
|
3443
|
+
left: {
|
|
3444
|
+
axes: {
|
|
3445
|
+
up: number;
|
|
3446
|
+
down: number;
|
|
3447
|
+
left: number;
|
|
3448
|
+
right: number;
|
|
3449
|
+
};
|
|
3450
|
+
raycaster: THREE_2.Raycaster;
|
|
3451
|
+
deltaTime: number;
|
|
3452
|
+
};
|
|
3453
|
+
right: {
|
|
3454
|
+
axes: {
|
|
3455
|
+
up: number;
|
|
3456
|
+
down: number;
|
|
3457
|
+
left: number;
|
|
3458
|
+
right: number;
|
|
3459
|
+
};
|
|
3460
|
+
raycaster: THREE_2.Raycaster;
|
|
3461
|
+
deltaTime: number;
|
|
3462
|
+
};
|
|
3463
|
+
buttons: {
|
|
3464
|
+
X: boolean;
|
|
3465
|
+
Y: boolean;
|
|
3466
|
+
LeftTrigger: boolean;
|
|
3467
|
+
LeftPinch: boolean;
|
|
3468
|
+
A: boolean;
|
|
3469
|
+
B: boolean;
|
|
3470
|
+
RightTrigger: boolean;
|
|
3471
|
+
RightPinch: boolean;
|
|
3472
|
+
};
|
|
3473
|
+
}
|
|
3474
|
+
|
|
3475
|
+
export declare interface XRGestureEvent extends BaseEvent {
|
|
3476
|
+
session: XRSession | null;
|
|
3477
|
+
buttons: 'A' | 'B' | 'X' | 'Y' | 'RightTrigger' | 'RightPinch' | 'LeftTrigger' | 'LeftPinch' | 'LeftAxesLeft' | 'LeftAxesRight' | 'LeftAxesUp' | 'LeftAxesDown' | 'RightAxesLeft' | 'RightAxesRight' | 'RightAxesUp' | 'RightAxesDown';
|
|
3478
|
+
machineType: 'Pico' | 'Oculus';
|
|
3479
|
+
isFirst: boolean;
|
|
3480
|
+
isFinal: boolean;
|
|
3481
|
+
controllers: {
|
|
3482
|
+
raycaster: {
|
|
3483
|
+
leftRay: THREE_2.Raycaster;
|
|
3484
|
+
rightRay: THREE_2.Raycaster;
|
|
3485
|
+
};
|
|
3486
|
+
};
|
|
3487
|
+
}
|
|
3488
|
+
|
|
2980
3489
|
export declare interface XRPanoramaControllerCustomInitArgs extends Omit<PanoramaControllerCustomInitArgs, "maxLatitude" | "minLatitude"> {
|
|
2981
3490
|
}
|
|
2982
3491
|
|
|
3492
|
+
declare interface XRSessionEvent_2 extends BaseEvent {
|
|
3493
|
+
session: XRSession | null;
|
|
3494
|
+
machineType: 'Pico' | 'Oculus';
|
|
3495
|
+
}
|
|
3496
|
+
export { XRSessionEvent_2 as XRSessionEvent }
|
|
3497
|
+
|
|
2983
3498
|
export { }
|