@realsee/five 6.6.0-alpha.1 → 6.6.0-alpha.2
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/docs/assets/hierarchy.js +1 -0
- package/docs/assets/icons.js +1 -1
- package/docs/assets/icons.svg +1 -1
- package/docs/assets/main.js +5 -5
- package/docs/assets/navigation.js +1 -1
- package/docs/assets/search.js +1 -1
- package/docs/assets/style.css +1440 -1255
- package/docs/classes/five.AnimationFrameLoop.html +16 -16
- package/docs/classes/five.Camera.html +41 -41
- package/docs/classes/five.Fetcher.html +5 -5
- package/docs/classes/five.Five.html +211 -211
- package/docs/classes/five.InternalWebGLRenderer.html +2 -2
- package/docs/classes/five.Model.html +72 -72
- package/docs/classes/five.ModelScene.html +34 -34
- package/docs/classes/five.Motion.html +17 -17
- package/docs/classes/five.NetworkSubscribe.html +35 -35
- package/docs/classes/five.PBMContainer.html +17 -17
- package/docs/classes/five.PBMCustomShader.html +11 -11
- package/docs/classes/five.PBMGroup.html +4 -4
- package/docs/classes/five.PBMMesh.html +2 -2
- package/docs/classes/five.PBMMeshMaterial.html +84 -84
- package/docs/classes/five.PBMPointCloud.html +3 -3
- package/docs/classes/five.PBMPointCloudMaterial.html +40 -40
- package/docs/classes/five.PBMSkinnedMesh.html +4 -4
- package/docs/classes/five.PanoCircleMesh.html +20 -20
- package/docs/classes/five.PanoCircleMeshCustom.html +20 -20
- package/docs/classes/five.PanoCircleMeshSolid.html +20 -20
- package/docs/classes/five.Parameter.html +114 -114
- package/docs/classes/five.Scene.html +9 -9
- package/docs/classes/five.Subscribe.html +37 -37
- package/docs/classes/five.TextureLoader.html +4 -4
- package/docs/classes/five.Tile.html +34 -34
- package/docs/classes/five.Tile3DModel.html +91 -91
- package/docs/classes/five.TileCache.html +8 -8
- package/docs/classes/five.TileNode.html +9 -9
- package/docs/classes/five.TileRequestScheduler.html +4 -4
- package/docs/classes/five.Tileset.html +37 -37
- package/docs/classes/five.Trajectory.html +8 -8
- package/docs/classes/five.TrajectoryNode.html +7 -7
- package/docs/classes/five.Work.html +42 -42
- package/docs/classes/five.WorkResolvedObserver.html +40 -40
- package/docs/classes/five.XRButton.html +3 -3
- package/docs/classes/gltf-loader.DDSLoader.html +3 -0
- package/docs/classes/gltf-loader.DRACOLoader.html +8 -0
- package/docs/classes/gltf-loader.GLTFLoader.html +19 -0
- package/docs/classes/gltf-loader.GLTFObject.html +9 -0
- package/docs/classes/gltf-loader.GLTFParser.html +6 -0
- package/docs/classes/gltf-loader.THREEGLTFLoader.html +8 -0
- package/docs/classes/line.Line.html +10 -10
- package/docs/classes/line.LineGeometry.html +17 -17
- package/docs/classes/line.LineMaterial.html +8 -8
- package/docs/classes/line.LineSegmentsGeometry.html +15 -15
- package/docs/classes/line.THREE_Line2.html +4 -4
- package/docs/classes/line.THREE_LineSegments2.html +4 -4
- package/docs/classes/plugins.BasePlugin.Controller.html +39 -0
- package/docs/classes/plugins.CSS3DRenderer.html +6 -0
- package/docs/classes/plugins.OrbitControls.html +41 -0
- package/docs/classes/plugins.RoundedBoxGeometry.html +3 -0
- package/docs/classes/react.Store.html +20 -20
- package/docs/classes/sticker.Sticker.html +17 -17
- package/docs/classes/vfx.Airflow.html +8 -8
- package/docs/classes/vfx.Flame.html +10 -10
- package/docs/classes/vfx.Particle.html +78 -78
- package/docs/classes/vfx.SpotLight.html +7 -7
- package/docs/documents/coordinate.html +4 -4
- package/docs/documents/five.FivePlugin.plugins.html +15 -15
- package/docs/documents/five.Pose.coordinate.html +4 -4
- package/docs/documents/plugins.html +15 -15
- package/docs/documents/react-component.html +32 -0
- package/docs/enums/five.VolumePlaneIntersect.html +4 -4
- package/docs/enums/plugins.BackgroundPluginType.WarningCodeType.html +2 -0
- package/docs/functions/five.coordinatesToVector.html +2 -0
- package/docs/functions/five.createDebugBoundingMesh.html +1 -1
- package/docs/functions/five.createWorks.html +1 -1
- package/docs/functions/five.defaultImageURLTransform.html +2 -2
- package/docs/functions/five.getViewportScale.html +1 -1
- package/docs/functions/five.headingToLongitude.html +4 -0
- package/docs/functions/five.imageSupport.html +1 -1
- package/docs/functions/five.isBoundingVolume.html +1 -1
- package/docs/functions/five.isPanoId.html +1 -1
- package/docs/functions/five.loadAt3d.html +1 -1
- package/docs/functions/five.loadB3dm.html +1 -1
- package/docs/functions/five.loadDome.html +1 -1
- package/docs/functions/five.loadDomez.html +1 -1
- package/docs/functions/five.loadFbx.html +1 -1
- package/docs/functions/five.loadGltf.html +1 -1
- package/docs/functions/five.loadPbm.html +1 -1
- package/docs/functions/five.loadPly.html +1 -1
- package/docs/functions/five.loadPnts.html +1 -1
- package/docs/functions/five.loadX3p.html +1 -1
- package/docs/functions/five.longitudeToHeading.html +4 -0
- package/docs/functions/five.makeBoundingVolume.html +1 -1
- package/docs/functions/five.panoEqual.html +1 -1
- package/docs/functions/five.panoParse.html +1 -1
- package/docs/functions/five.panoStringify.html +1 -1
- package/docs/functions/five.parseWork.html +2 -2
- package/docs/functions/five.vectorToCoordinates.html +2 -0
- package/docs/functions/five.workToJson.html +1 -1
- package/docs/functions/plugins.BackgroundPlugin.html +1 -0
- package/docs/functions/plugins.ItemMaskPlugin.html +1 -0
- package/docs/functions/plugins.OrientationPlugin.html +1 -0
- package/docs/functions/plugins.PanoAnimePlugin.html +1 -0
- package/docs/functions/plugins.TrajectoryPlugin.html +1 -0
- package/docs/functions/react.createFiveFeature.html +1 -1
- package/docs/functions/react.createFiveProvider.html +5 -5
- package/docs/functions/react.createStore.html +12 -12
- package/docs/functions/react.unsafe__useFiveInstance.html +4 -4
- package/docs/functions/react.useFiveAction.html +8 -8
- package/docs/functions/react.useFiveCameraDirection.html +3 -3
- package/docs/functions/react.useFiveCameraRaycaster.html +3 -3
- package/docs/functions/react.useFiveCurrentObserver.html +4 -4
- package/docs/functions/react.useFiveCurrentState.html +4 -4
- package/docs/functions/react.useFiveEventCallback.html +3 -3
- package/docs/functions/react.useFiveFloor.html +4 -4
- package/docs/functions/react.useFiveHelper.html +4 -4
- package/docs/functions/react.useFiveModelIntersectRaycaster.html +4 -4
- package/docs/functions/react.useFiveModelReadyState.html +3 -3
- package/docs/functions/react.useFiveProject2d.html +4 -4
- package/docs/functions/react.useFiveSceneEffect.html +4 -4
- package/docs/functions/react.useFiveState.html +1 -1
- package/docs/functions/react.useFiveWork.html +5 -5
- package/docs/functions/react.withFive.html +1 -1
- package/docs/functions/vue.unsafe__useFiveInject.html +4 -4
- package/docs/functions/vue.useFiveAction.html +10 -10
- package/docs/functions/vue.useFiveCameraDirection.html +3 -3
- package/docs/functions/vue.useFiveCameraRaycaster.html +3 -3
- package/docs/functions/vue.useFiveCurrentObserver.html +4 -4
- package/docs/functions/vue.useFiveCurrentState.html +4 -4
- package/docs/functions/vue.useFiveEventCallback.html +3 -3
- package/docs/functions/vue.useFiveFloor.html +4 -4
- package/docs/functions/vue.useFiveHelper.html +4 -4
- package/docs/functions/vue.useFiveModel.html +2 -2
- package/docs/functions/vue.useFiveModelBounding.html +2 -2
- package/docs/functions/vue.useFiveModelIntersectRaycaster.html +4 -4
- package/docs/functions/vue.useFiveModelReadyState.html +3 -3
- package/docs/functions/vue.useFiveProject2d.html +4 -4
- package/docs/functions/vue.useFiveScene.html +2 -2
- package/docs/functions/vue.useFiveState.html +4 -4
- package/docs/functions/vue.useFiveWorks.html +5 -5
- package/docs/hierarchy.html +1 -1
- package/docs/index.html +17 -17
- package/docs/interfaces/five.AddableObject.html +9 -9
- package/docs/interfaces/five.AjaxOptions.html +9 -9
- package/docs/interfaces/five.AnimationFrame.html +5 -5
- package/docs/interfaces/five.AnimationFrameContext.html +3 -3
- package/docs/interfaces/five.BaseEvent.html +5 -5
- package/docs/interfaces/five.BoundingVolume.html +15 -15
- package/docs/interfaces/five.BoxBoundingVolume.html +18 -0
- package/docs/interfaces/five.CameraPose.html +6 -6
- package/docs/interfaces/five.CullingVolume.html +9 -0
- package/docs/interfaces/five.Draco.html +12 -0
- package/docs/interfaces/five.EventCallback.html +255 -255
- package/docs/interfaces/five.FiveInitArgs.html +85 -85
- package/docs/interfaces/five.FiveLoadOptions.html +13 -13
- package/docs/interfaces/five.FloorplanControllerCustomInitArgs.html +17 -17
- package/docs/interfaces/five.GestureEvent.html +19 -19
- package/docs/interfaces/five.ImageOptions.html +14 -14
- package/docs/interfaces/five.ImageURLMappings.html +1 -1
- package/docs/interfaces/five.ImageURLOptions.html +15 -15
- package/docs/interfaces/five.IntersectEvent.html +8 -8
- package/docs/interfaces/five.IntersectMesh.html +2 -0
- package/docs/interfaces/five.IntersectMeshInterface.html +3 -3
- package/docs/interfaces/five.Intersection.html +5 -5
- package/docs/interfaces/five.KTX2.html +9 -0
- package/docs/interfaces/five.LoosePanoWork.html +10 -10
- package/docs/interfaces/five.LooseWork.html +15 -15
- package/docs/interfaces/five.LooseWorkInitial.html +11 -11
- package/docs/interfaces/five.LooseWorkModel.html +6 -6
- package/docs/interfaces/five.LooseWorkObserver.html +16 -16
- package/docs/interfaces/five.LooseWorkPanorama.html +13 -13
- package/docs/interfaces/five.LooseWorkVideo.html +4 -4
- package/docs/interfaces/five.LooseWorkWithExtrinsics.html +13 -13
- package/docs/interfaces/five.MapviewControllerCustomInitArgs.html +17 -17
- package/docs/interfaces/five.ModeChangeEvent.html +9 -9
- package/docs/interfaces/five.ModelControllerCustomInitArgs.html +18 -18
- package/docs/interfaces/five.ModelEvent.html +8 -8
- package/docs/interfaces/five.ModelLike.html +3 -3
- package/docs/interfaces/five.ModelSceneEvent.html +6 -6
- package/docs/interfaces/five.MotionKeyframe.html +4 -4
- package/docs/interfaces/five.MovePanoOptions.html +24 -24
- package/docs/interfaces/five.NetworkAbortError.html +1 -0
- package/docs/interfaces/five.NetworkFirbiddenError.html +1 -0
- package/docs/interfaces/five.NetworkOptions.html +7 -7
- package/docs/interfaces/five.NetworkProxyError.html +1 -0
- package/docs/interfaces/five.NetworkResourceEvent.html +9 -9
- package/docs/interfaces/five.NetworkResponseError.html +2 -0
- package/docs/interfaces/five.NetworkTimeoutError.html +1 -0
- package/docs/interfaces/five.ObjectEvent.html +6 -6
- package/docs/interfaces/five.PBMClipperParameter.html +3 -3
- package/docs/interfaces/five.PBMCustomShaderInitArgs.html +6 -6
- package/docs/interfaces/five.PBMCustomShaderSlots.html +3 -3
- package/docs/interfaces/five.PBMMaterial.html +1 -0
- package/docs/interfaces/five.PBMMeshMaterialParameters.html +28 -28
- package/docs/interfaces/five.PBMPanoDepth.html +9 -9
- package/docs/interfaces/five.PBMPanoPicture.html +11 -11
- package/docs/interfaces/five.PBMPointCloudMaterialParameters.html +28 -28
- package/docs/interfaces/five.PBMRefinedScreen.html +6 -6
- package/docs/interfaces/five.PanoCircleMeshCustomOptions.html +9 -9
- package/docs/interfaces/five.PanoCircleMeshInterface.html +20 -20
- package/docs/interfaces/five.PanoCircleMeshOptions.html +3 -3
- package/docs/interfaces/five.PanoCircleMeshSolidOptions.html +3 -3
- package/docs/interfaces/five.PanoEvent.html +11 -11
- package/docs/interfaces/five.PanoTextureEvent.html +9 -9
- package/docs/interfaces/five.PanoramaControllerCustomInitArgs.html +38 -38
- package/docs/interfaces/five.PanoramaLikeControllerCustomInitArgs.html +18 -18
- package/docs/interfaces/five.ParameterMaterialValue.html +73 -73
- package/docs/interfaces/five.ParameterTilesetValue.html +31 -31
- package/docs/interfaces/five.ParameterValue.html +103 -103
- package/docs/interfaces/five.Pose.html +13 -13
- package/docs/interfaces/five.RegionBoundingVolume.html +21 -0
- package/docs/interfaces/five.RenderEvent.html +6 -6
- package/docs/interfaces/five.ResolvedParameterValue.html +105 -105
- package/docs/interfaces/five.SphereBoundingVolume.html +17 -0
- package/docs/interfaces/five.State.html +19 -19
- package/docs/interfaces/five.StateEvent.html +7 -7
- package/docs/interfaces/five.TextureOptions.html +16 -16
- package/docs/interfaces/five.Tile3DModelLoaderOptions.html +12 -12
- package/docs/interfaces/five.TileHeader.html +9 -9
- package/docs/interfaces/five.TilesetHeader.html +20 -20
- package/docs/interfaces/five.TilesetOptions.html +12 -12
- package/docs/interfaces/five.TopviewControllerCustomInitArgs.html +9 -9
- package/docs/interfaces/five.TrajectoryHeader.html +5 -5
- package/docs/interfaces/five.VRPanoramaControllerCustomInitArgs.html +34 -34
- package/docs/interfaces/five.ViewLayer.html +90 -90
- package/docs/interfaces/five.Viewport.html +11 -11
- package/docs/interfaces/five.WebXRAxesParams.html +4 -4
- package/docs/interfaces/five.WebXRControllerParams.html +2 -2
- package/docs/interfaces/five.WorkCubeImage.html +8 -8
- package/docs/interfaces/five.WorkImage.html +13 -13
- package/docs/interfaces/five.WorkInitial.html +17 -17
- package/docs/interfaces/five.WorkInitialJson.html +8 -8
- package/docs/interfaces/five.WorkJson.html +12 -12
- package/docs/interfaces/five.WorkModel.html +12 -12
- package/docs/interfaces/five.WorkModelJson.html +5 -5
- package/docs/interfaces/five.WorkModelLayer.html +6 -6
- package/docs/interfaces/five.WorkModelLayerJson.html +5 -5
- package/docs/interfaces/five.WorkObserver.html +34 -34
- package/docs/interfaces/five.WorkObserverJson.html +8 -8
- package/docs/interfaces/five.WorkPanoramaJson.html +14 -14
- package/docs/interfaces/five.WorkPanoramasJson.html +3 -3
- package/docs/interfaces/five.WorkTile.html +14 -14
- package/docs/interfaces/five.WorkVideo.html +9 -9
- package/docs/interfaces/five.WorksEvent.html +9 -9
- package/docs/interfaces/five.XRControllerEvent.html +8 -8
- package/docs/interfaces/five.XRGestureEvent.html +11 -11
- package/docs/interfaces/five.XRPanoramaControllerCustomInitArgs.html +34 -34
- package/docs/interfaces/five.XRSessionEvent.html +7 -7
- package/docs/interfaces/gltf-loader.DDS.html +7 -0
- package/docs/interfaces/gltf-loader.GLTF.html +13 -0
- package/docs/interfaces/gltf-loader.GLTFReference.html +3 -0
- package/docs/interfaces/gltf-loader.THREEGLTF.html +8 -0
- package/docs/interfaces/plugins.BackgroundPluginController.html +37 -0
- package/docs/interfaces/plugins.BackgroundPluginType.Config.html +1 -0
- package/docs/interfaces/plugins.BackgroundPluginType.EventMap.html +20 -0
- package/docs/interfaces/plugins.BackgroundPluginType.Params.html +3 -0
- package/docs/interfaces/plugins.BackgroundPluginType.PluginDataItem.html +1 -0
- 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.BasePlugin.StateChangeParams.html +7 -0
- package/docs/interfaces/plugins.ItemMaskController.html +35 -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/plugins.Keyframe.html +3 -0
- package/docs/interfaces/plugins.OrientationPluginController.html +46 -0
- package/docs/interfaces/plugins.OrientationPluginType.Config.html +4 -0
- package/docs/interfaces/plugins.OrientationPluginType.EventMap.html +10 -0
- package/docs/interfaces/plugins.OrientationPluginType.Params.html +4 -0
- package/docs/interfaces/plugins.OrientationPluginType.State.html +10 -0
- package/docs/interfaces/plugins.PanoAnimeController.html +32 -0
- package/docs/interfaces/plugins.PanoAnimePluginType.Config.html +2 -0
- package/docs/interfaces/plugins.PanoAnimePluginType.EventMap.html +11 -0
- package/docs/interfaces/plugins.PanoAnimePluginType.Params.html +4 -0
- package/docs/interfaces/plugins.PanoAnimePluginType.State.html +8 -0
- package/docs/interfaces/plugins.PlayingState.html +3 -0
- package/docs/interfaces/plugins.PluginTemplateType.Config.html +3 -0
- package/docs/interfaces/plugins.PluginTemplateType.EventMap.html +10 -0
- package/docs/interfaces/plugins.PluginTemplateType.Params.html +4 -0
- package/docs/interfaces/plugins.PluginTemplateType.State.html +8 -0
- package/docs/interfaces/plugins.TrajectoryController.html +50 -0
- package/docs/interfaces/react.FiveActionReactCallbacks.html +27 -27
- package/docs/interfaces/react.FiveCanvasProps.html +5 -5
- package/docs/interfaces/react.FiveInjectionTypes.html +152 -144
- package/docs/interfaces/react.PropTypeOfFiveFeatures.html +2 -2
- package/docs/interfaces/sticker.IntersectionLike.html +7 -7
- package/docs/interfaces/vfx.ParticleArgs.html +67 -67
- package/docs/interfaces/vfx.ParticleTweenKeyframe.html +3 -3
- package/docs/interfaces/vue.FiveActionVueCallbacks.html +30 -30
- package/docs/modules/five.html +1 -232
- package/docs/modules/gltf-loader.html +1 -0
- package/docs/modules/line.html +1 -8
- package/docs/modules/plugins.BackgroundPluginType.html +1 -0
- package/docs/modules/plugins.BasePlugin.html +1 -0
- package/docs/modules/plugins.ItemMaskPluginType.html +1 -0
- package/docs/modules/plugins.OrientationPluginType.html +1 -0
- package/docs/modules/plugins.PanoAnimePluginType.html +1 -0
- package/docs/modules/plugins.PluginTemplateType.html +1 -0
- package/docs/modules/plugins.html +1 -0
- package/docs/modules/react.html +1 -37
- package/docs/modules/sticker.html +1 -3
- package/docs/modules/vfx.html +1 -8
- package/docs/modules/vue.html +1 -24
- package/docs/modules.html +1 -0
- package/docs/types/five.AjaxResponseType.html +1 -1
- package/docs/types/five.AjaxResponseTypeMapping.html +1 -1
- package/docs/types/five.AnimationFrameLoopType.html +1 -1
- package/docs/types/five.BoundingVolumeJson.html +1 -1
- package/docs/types/five.BoxBoundingVolumeJson.html +2 -1
- package/docs/types/five.ControllerCustomInitTypes.html +8 -1
- package/docs/types/five.ControllerEventTypes.html +66 -33
- package/docs/types/five.CubeFace.html +1 -1
- package/docs/types/five.EventTypes.html +26 -26
- package/docs/types/five.FivePlugin.html +4 -4
- package/docs/types/five.FivePluginInit.html +3 -3
- package/docs/types/five.FivePluginInstance.html +3 -3
- package/docs/types/five.GestureTypes.html +1 -1
- package/docs/types/five.LegacyEventType.html +149 -86
- package/docs/types/five.LoadResultType.html +12 -1
- package/docs/types/five.Mode.html +9 -9
- package/docs/types/five.Models.html +11 -11
- package/docs/types/five.MotionCircle.html +2 -2
- package/docs/types/five.MotionConfig.html +1 -1
- package/docs/types/five.MotionInitalValue.html +1 -1
- package/docs/types/five.MotionValue.html +1 -1
- package/docs/types/five.MovePanoEffect.html +3 -3
- package/docs/types/five.NetWorkMeta.html +8 -1
- package/docs/types/five.NetworkError.html +1 -1
- package/docs/types/five.NetworkErrorCallback.html +1 -1
- package/docs/types/five.NetworkProgressCallback.html +1 -1
- package/docs/types/five.NetworkResponse.html +3 -1
- package/docs/types/five.NetworkState.html +1 -1
- package/docs/types/five.NetworkSuccessCallback.html +1 -1
- package/docs/types/five.NetworkType.html +1 -1
- package/docs/types/five.PBMAlphaMode.html +1 -1
- package/docs/types/five.PBMColorStyle.html +1 -1
- package/docs/types/five.PBMFloorStyle.html +1 -1
- package/docs/types/five.PBMMeshShaderType.html +1 -1
- package/docs/types/five.PBMPointBack.html +1 -1
- package/docs/types/five.PBMPointCloudShaderType.html +1 -1
- package/docs/types/five.PBMPointShape.html +1 -1
- package/docs/types/five.PBMPointSize.html +1 -1
- package/docs/types/five.PBMTransition.html +1 -1
- package/docs/types/five.Pano.html +3 -1
- package/docs/types/five.PanoId.html +1 -1
- package/docs/types/five.ParseOptions.html +11 -6
- package/docs/types/five.PostProcessingType.html +1 -1
- package/docs/types/five.RegionBoundingVolumeJson.html +2 -1
- package/docs/types/five.Scissor.html +2 -2
- package/docs/types/five.SphereBoundingVolumeJson.html +2 -1
- package/docs/types/five.SubscribeEventMap.html +1 -1
- package/docs/types/five.Tile3dOptions.html +1 -1
- package/docs/types/five.TileCacheOptions.html +3 -1
- package/docs/types/five.TileContentData.html +6 -1
- package/docs/types/five.TileRequestOrder.html +1 -1
- package/docs/types/five.TileRequestSchedulerOptions.html +4 -1
- package/docs/types/five.TilesetFrameState.html +22 -1
- package/docs/types/five.TrajectoryContentData.html +7 -1
- package/docs/types/five.WebXRControllerKey.html +1 -1
- package/docs/types/five.WebXRControllerType.html +1 -1
- package/docs/types/five.Works.html +1 -1
- package/docs/types/line.LineMaterialParameters.html +8 -1
- package/docs/types/plugins.BackgroundPluginType.Mirror.html +1 -0
- package/docs/types/plugins.BackgroundPluginType.Mode.html +1 -0
- package/docs/types/plugins.BackgroundPluginType.PluginData.html +1 -0
- package/docs/types/plugins.BackgroundPluginType.State.html +2 -0
- package/docs/types/plugins.BasePlugin.EventMap.html +10 -0
- package/docs/types/plugins.ItemMaskPluginType.PluginData.html +3 -0
- package/docs/types/plugins.ItemMaskPluginType.ServerData.html +3 -0
- package/docs/types/plugins.OrientationPluginType.PluginData.html +1 -0
- package/docs/types/plugins.OrientationPluginType.ServerData.html +1 -0
- package/docs/types/plugins.PanoAnimePluginType.PluginData.html +1 -0
- package/docs/types/plugins.PanoAnimePluginType.ServerData.html +1 -0
- package/docs/types/plugins.PluginTemplateType.PluginData.html +1 -0
- package/docs/types/plugins.PluginTemplateType.ServerData.html +2 -0
- package/docs/types/react.FiveInjectionActionFeature.html +1 -1
- package/docs/types/react.FiveInjectionDataFeature.html +1 -1
- package/docs/types/react.FiveInjectionFeature.html +1 -1
- package/docs/types/react.FiveProviderPropTypes.html +11 -1
- package/docs/types/react.FiveProviderType.html +1 -1
- package/docs/types/react.StoreActionMapHanlder.html +1 -1
- package/docs/types/react.StoreActionMapType.html +1 -1
- package/docs/types/react.StoreProviderType.html +1 -1
- package/docs/types/react.StoreValueMapType.html +1 -1
- package/docs/types/vfx.ParticleType.html +1 -1
- package/docs/types/vue.FiveModelIntersectRaycaster.html +1 -1
- package/docs/types/vue.FiveProviderComponent.html +1 -1
- package/docs/types/vue.Project2d.html +1 -1
- package/docs/variables/five.PROXY_CONTROLLER_EVENT_NAMES.html +1 -1
- package/docs/variables/five.controllersDefaultInitArgs.html +1 -1
- package/docs/variables/five.draco.html +1 -0
- package/docs/variables/five.ktx2.html +1 -0
- package/docs/variables/react.FiveCanvas.html +6 -0
- package/docs/variables/react.INJECTION_PROPNAME.html +1 -1
- package/docs/variables/react.useFiveScene.html +7 -0
- package/docs/variables/vue.FiveCanvas.html +7 -7
- package/docs/variables/vue.FiveProvider.html +5 -5
- package/five/index.d.ts +33 -1
- package/five/index.js +93 -91
- package/five/index.mjs +4247 -4193
- package/gltf-loader/index.js +5 -5
- package/gltf-loader/index.mjs +160 -172
- package/line/index.js +4 -4
- package/line/index.mjs +15 -15
- package/package.json +4 -7
- package/plugins/index.js +10 -10
- package/plugins/index.mjs +42 -42
- package/react/index.d.ts +46 -37
- package/react/index.js +3 -3
- package/react/index.mjs +8 -8
- package/shader-lib/index.js +7 -7
- package/shader-lib/index.mjs +14 -14
- package/sticker/index.js +3 -3
- package/sticker/index.mjs +9 -9
- package/umd/five-gltf-loader.js +5 -5
- package/umd/five-line.js +4 -4
- package/umd/five-plugins.js +10 -10
- package/umd/five-react.js +3 -3
- package/umd/five-shader-lib.js +8 -8
- package/umd/five-sticker.js +3 -3
- package/umd/five-vfx.js +7 -7
- package/umd/five-vue.js +3 -3
- package/umd/five.js +94 -92
- package/vfx/index.js +6 -6
- package/vfx/index.mjs +12 -12
- package/vue/index.js +2 -2
- package/vue/index.mjs +2 -2
- package/work-downloader/index.js +3 -3
- package/work-downloader/index.mjs +4 -4
- package/docs/classes/five.BoxBoundingVolume.html +0 -19
- package/docs/classes/five.CullingVolume.html +0 -13
- package/docs/classes/five.Draco.html +0 -13
- package/docs/classes/five.IntersectMesh.html +0 -4
- package/docs/classes/five.KTX2.html +0 -10
- package/docs/classes/five.NetworkAbortError.html +0 -2
- package/docs/classes/five.NetworkFirbiddenError.html +0 -2
- package/docs/classes/five.NetworkProxyError.html +0 -2
- package/docs/classes/five.NetworkResponseError.html +0 -3
- package/docs/classes/five.NetworkTimeoutError.html +0 -2
- package/docs/classes/five.PBMMaterial.html +0 -2
- package/docs/classes/five.RegionBoundingVolume.html +0 -22
- package/docs/classes/five.SphereBoundingVolume.html +0 -18
- package/docs/classes/gltf_loader.DDSLoader.html +0 -3
- package/docs/classes/gltf_loader.DRACOLoader.html +0 -8
- package/docs/classes/gltf_loader.GLTFLoader.html +0 -19
- package/docs/classes/gltf_loader.GLTFObject.html +0 -9
- package/docs/classes/gltf_loader.GLTFParser.html +0 -6
- package/docs/classes/gltf_loader.THREEGLTFLoader.html +0 -8
- package/docs/classes/plugins-1.BackgroundPluginController.html +0 -38
- package/docs/classes/plugins-1.BasePlugin.Controller.html +0 -39
- package/docs/classes/plugins-1.CSS3DRenderer.html +0 -6
- package/docs/classes/plugins-1.ItemMaskController.html +0 -36
- package/docs/classes/plugins-1.OrbitControls.html +0 -41
- package/docs/classes/plugins-1.OrientationPluginController.html +0 -47
- package/docs/classes/plugins-1.PanoAnimeController.html +0 -33
- package/docs/classes/plugins-1.RoundedBoxGeometry.html +0 -3
- package/docs/classes/plugins-1.TrajectoryController.html +0 -51
- package/docs/documents/react_component.html +0 -32
- package/docs/enums/plugins-1.BackgroundPluginType.WarningCodeType.html +0 -2
- package/docs/functions/plugins-1.BackgroundPlugin.html +0 -1
- package/docs/functions/plugins-1.ItemMaskPlugin.html +0 -1
- package/docs/functions/plugins-1.OrientationPlugin.html +0 -1
- package/docs/functions/plugins-1.PanoAnimePlugin.html +0 -1
- package/docs/functions/plugins-1.TrajectoryPlugin.html +0 -1
- package/docs/functions/react.FiveCanvas.html +0 -6
- package/docs/functions/react.useFiveScene.html +0 -7
- package/docs/interfaces/gltf_loader.DDS.html +0 -7
- package/docs/interfaces/gltf_loader.GLTF.html +0 -13
- package/docs/interfaces/gltf_loader.GLTFReference.html +0 -3
- package/docs/interfaces/gltf_loader.THREEGLTF.html +0 -8
- package/docs/interfaces/plugins-1.BackgroundPluginType.Config.html +0 -1
- package/docs/interfaces/plugins-1.BackgroundPluginType.EventMap.html +0 -20
- package/docs/interfaces/plugins-1.BackgroundPluginType.Params.html +0 -3
- package/docs/interfaces/plugins-1.BackgroundPluginType.PluginDataItem.html +0 -1
- package/docs/interfaces/plugins-1.BasePlugin.BaseOptions.html +0 -3
- package/docs/interfaces/plugins-1.BasePlugin.Config.html +0 -5
- package/docs/interfaces/plugins-1.BasePlugin.State.html +0 -8
- package/docs/interfaces/plugins-1.BasePlugin.StateChangeParams.html +0 -7
- package/docs/interfaces/plugins-1.ItemMaskPluginType.Config.html +0 -2
- package/docs/interfaces/plugins-1.ItemMaskPluginType.EventMap.html +0 -10
- package/docs/interfaces/plugins-1.ItemMaskPluginType.ItemType.html +0 -13
- package/docs/interfaces/plugins-1.ItemMaskPluginType.MaskType.html +0 -4
- package/docs/interfaces/plugins-1.ItemMaskPluginType.Params.html +0 -4
- package/docs/interfaces/plugins-1.ItemMaskPluginType.State.html +0 -14
- package/docs/interfaces/plugins-1.Keyframe.html +0 -3
- package/docs/interfaces/plugins-1.OrientationPluginType.Config.html +0 -4
- package/docs/interfaces/plugins-1.OrientationPluginType.EventMap.html +0 -10
- package/docs/interfaces/plugins-1.OrientationPluginType.Params.html +0 -4
- package/docs/interfaces/plugins-1.OrientationPluginType.State.html +0 -10
- package/docs/interfaces/plugins-1.PanoAnimePluginType.Config.html +0 -2
- package/docs/interfaces/plugins-1.PanoAnimePluginType.EventMap.html +0 -11
- package/docs/interfaces/plugins-1.PanoAnimePluginType.Params.html +0 -4
- package/docs/interfaces/plugins-1.PanoAnimePluginType.State.html +0 -8
- package/docs/interfaces/plugins-1.PlayingState.html +0 -3
- package/docs/interfaces/plugins-1.PluginTemplateType.Config.html +0 -3
- package/docs/interfaces/plugins-1.PluginTemplateType.EventMap.html +0 -10
- package/docs/interfaces/plugins-1.PluginTemplateType.Params.html +0 -4
- package/docs/interfaces/plugins-1.PluginTemplateType.State.html +0 -8
- package/docs/modules/gltf_loader.html +0 -11
- package/docs/modules/plugins-1.BackgroundPluginType.html +0 -10
- package/docs/modules/plugins-1.BasePlugin.html +0 -7
- package/docs/modules/plugins-1.ItemMaskPluginType.html +0 -9
- package/docs/modules/plugins-1.OrientationPluginType.html +0 -7
- package/docs/modules/plugins-1.PanoAnimePluginType.html +0 -7
- package/docs/modules/plugins-1.PluginTemplateType.html +0 -7
- package/docs/modules/plugins-1.html +0 -22
- package/docs/types/plugins-1.BackgroundPluginType.Mirror.html +0 -1
- package/docs/types/plugins-1.BackgroundPluginType.Mode.html +0 -1
- package/docs/types/plugins-1.BackgroundPluginType.PluginData.html +0 -1
- package/docs/types/plugins-1.BackgroundPluginType.State.html +0 -1
- package/docs/types/plugins-1.BasePlugin.EventMap.html +0 -6
- package/docs/types/plugins-1.ItemMaskPluginType.PluginData.html +0 -1
- package/docs/types/plugins-1.ItemMaskPluginType.ServerData.html +0 -1
- package/docs/types/plugins-1.OrientationPluginType.PluginData.html +0 -1
- package/docs/types/plugins-1.OrientationPluginType.ServerData.html +0 -1
- package/docs/types/plugins-1.PanoAnimePluginType.PluginData.html +0 -1
- package/docs/types/plugins-1.PanoAnimePluginType.ServerData.html +0 -1
- package/docs/types/plugins-1.PluginTemplateType.PluginData.html +0 -1
- package/docs/types/plugins-1.PluginTemplateType.ServerData.html +0 -1
- package/docs/variables/five.draco-1.html +0 -1
- package/docs/variables/five.ktx2-1.html +0 -1
package/plugins/index.mjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @license
|
|
3
3
|
* @realsee/five
|
|
4
|
-
* Generated: 8/
|
|
5
|
-
* Version: 6.6.0-alpha.
|
|
4
|
+
* Generated: 2025/8/15
|
|
5
|
+
* Version: 6.6.0-alpha.2
|
|
6
6
|
* Terms:
|
|
7
7
|
* Realsee SDK License Agreement
|
|
8
8
|
* Update: July 28, 2021
|
|
@@ -254,7 +254,7 @@
|
|
|
254
254
|
* Agreement and all related documents shall be drafted in English.
|
|
255
255
|
*/import { Subscribe as yn, AnimationFrameLoop as Ct, Camera as bn, PanoCircleMesh as Tn } from "@realsee/five";
|
|
256
256
|
import * as w from "three";
|
|
257
|
-
import { EventDispatcher as qt, Vector3 as ve, MOUSE as Ae, TOUCH as Me,
|
|
257
|
+
import { EventDispatcher as qt, Vector3 as ve, MOUSE as Ae, TOUCH as Me, Spherical as jt, Quaternion as Ht, Vector2 as Te, Object3D as Kt, Matrix4 as wn } from "three";
|
|
258
258
|
import { BasePlugin as Zt } from "@realsee/five/plugins";
|
|
259
259
|
function En(f) {
|
|
260
260
|
return /^https?:\/\/|^\/\//.test(f) || /^data:/.test(f);
|
|
@@ -266,7 +266,7 @@ var We;
|
|
|
266
266
|
(function(f) {
|
|
267
267
|
var o = (
|
|
268
268
|
/** @class */
|
|
269
|
-
function() {
|
|
269
|
+
(function() {
|
|
270
270
|
function e(a, t) {
|
|
271
271
|
this.hooks = new yn(), this.staticPrefix = "//vr-image-4.realsee-cdn.cn", this.five = a, t != null && t.staticPrefix && (this.staticPrefix = t.staticPrefix);
|
|
272
272
|
}
|
|
@@ -275,7 +275,7 @@ var We;
|
|
|
275
275
|
}, e.prototype.absoluteUrl = function(a) {
|
|
276
276
|
return xn(this.staticPrefix, a);
|
|
277
277
|
}, e;
|
|
278
|
-
}()
|
|
278
|
+
})()
|
|
279
279
|
);
|
|
280
280
|
f.Controller = o;
|
|
281
281
|
})(We || (We = {}));
|
|
@@ -408,11 +408,11 @@ function Pn(f) {
|
|
|
408
408
|
}, a.crossOrigin = "", a.src = f;
|
|
409
409
|
});
|
|
410
410
|
}
|
|
411
|
-
var An = typeof performance != "undefined" && typeof performance.timing != "undefined" ? performance.timing.navigationStart : Date.now(), Tt = typeof performance != "undefined" ? function() {
|
|
411
|
+
var An = typeof performance != "undefined" && typeof performance.timing != "undefined" ? performance.timing.navigationStart : Date.now(), Tt = typeof performance != "undefined" ? (function() {
|
|
412
412
|
return An + performance.now();
|
|
413
|
-
} : function() {
|
|
413
|
+
}) : (function() {
|
|
414
414
|
return Date.now();
|
|
415
|
-
};
|
|
415
|
+
});
|
|
416
416
|
function st(f, o, e) {
|
|
417
417
|
return f + (o - f) * e;
|
|
418
418
|
}
|
|
@@ -437,7 +437,7 @@ function On(f, o, e, a) {
|
|
|
437
437
|
}
|
|
438
438
|
var Gt = (
|
|
439
439
|
/** @class */
|
|
440
|
-
function() {
|
|
440
|
+
(function() {
|
|
441
441
|
function f(o) {
|
|
442
442
|
this.config = {}, this.progress = 1, this.ended = !0, this.value = {}, this.startTime = Tt(), this.startVelocity = 0, this.duration = 0, this.keyframes = [];
|
|
443
443
|
for (var e in o) {
|
|
@@ -496,7 +496,7 @@ var Gt = (
|
|
|
496
496
|
}, f.prototype.dispose = function() {
|
|
497
497
|
this.callbacks && (this.callbacks[1](new Error("motion dispose.")), this.callbacks = void 0);
|
|
498
498
|
}, f;
|
|
499
|
-
}()
|
|
499
|
+
})()
|
|
500
500
|
), Sn = [
|
|
501
501
|
{ progress: 0, value: { scale: 0, opacity: 0, shadow: 2 } },
|
|
502
502
|
{ progress: 0.2, value: { scale: 0.5, opacity: 1, shadow: 1 } },
|
|
@@ -561,11 +561,11 @@ void main() {
|
|
|
561
561
|
}
|
|
562
562
|
`, Ln = (
|
|
563
563
|
/** @class */
|
|
564
|
-
function(f) {
|
|
564
|
+
(function(f) {
|
|
565
565
|
Fe(o, f);
|
|
566
566
|
function o(e, a) {
|
|
567
567
|
var t = f.call(this, e) || this;
|
|
568
|
-
t.canvas = document.createElement("canvas"), t.group = new w.Group(), t.wrapper = document.createElement("div"), t.style = document.createElement("style"), t.itemMaskMesh = function() {
|
|
568
|
+
t.canvas = document.createElement("canvas"), t.group = new w.Group(), t.wrapper = document.createElement("div"), t.style = document.createElement("style"), t.itemMaskMesh = (function() {
|
|
569
569
|
var l = new w.Mesh(new w.SphereBufferGeometry(1, 60, 40), new w.ShaderMaterial({
|
|
570
570
|
vertexShader: Nn,
|
|
571
571
|
fragmentShader: kn,
|
|
@@ -582,7 +582,7 @@ void main() {
|
|
|
582
582
|
transparent: !0
|
|
583
583
|
}));
|
|
584
584
|
return l.renderOrder = -3, l.geometry.rotateY(-Math.PI / 2), l.geometry.scale(-1, 1, 1), l;
|
|
585
|
-
}(), t.onFivePanoArrived = function(l) {
|
|
585
|
+
})(), t.onFivePanoArrived = function(l) {
|
|
586
586
|
t.state.mode === "mask" && t.loadPanoMask(l);
|
|
587
587
|
}, t.onFiveWantsMoveToPano = function(l) {
|
|
588
588
|
t.state.mode === "box" && t.select();
|
|
@@ -780,7 +780,7 @@ void main() {
|
|
|
780
780
|
this.updateState({ enabled: !1 }, t), this._disable({ userAction: t });
|
|
781
781
|
}
|
|
782
782
|
}, o;
|
|
783
|
-
}(We.Controller)
|
|
783
|
+
})(We.Controller)
|
|
784
784
|
), qn = function(f, o) {
|
|
785
785
|
return new Ln(f, o);
|
|
786
786
|
};
|
|
@@ -789,7 +789,7 @@ void main() {
|
|
|
789
789
|
*
|
|
790
790
|
* Copyright (c) 2016 Jorik Tangelder;
|
|
791
791
|
* Licensed under the MIT license */
|
|
792
|
-
var wt = function(f, o, e, a) {
|
|
792
|
+
var wt = (function(f, o, e, a) {
|
|
793
793
|
var t = ["", "webkit", "Moz", "MS", "ms", "o"], s = o.createElement ? o.createElement("div") : a, c = "function", l = Math.round, g = Math.abs, d = Date.now;
|
|
794
794
|
function v(n, r, i) {
|
|
795
795
|
return setTimeout(y(n, i), r);
|
|
@@ -1955,7 +1955,7 @@ var wt = function(f, o, e, a) {
|
|
|
1955
1955
|
bindFn: y,
|
|
1956
1956
|
prefixed: re
|
|
1957
1957
|
}), Le;
|
|
1958
|
-
}(typeof window != "undefined" ? window : {}, typeof document != "undefined" ? document : {}), qe = function(f, o) {
|
|
1958
|
+
})(typeof window != "undefined" ? window : {}, typeof document != "undefined" ? document : {}), qe = function(f, o) {
|
|
1959
1959
|
o === void 0 && console.warn('THREE.OrbitControls: The second parameter "domElement" is now mandatory.'), o === document && console.error('THREE.OrbitControls: "document" should not be used as the target "domElement". Please use "renderer.domElement" instead.'), this.object = f, this.domElement = o, this.enabled = !0, this.target = new ve(), this.minDistance = 0, this.maxDistance = 1 / 0, this.minZoom = 0, this.maxZoom = 1 / 0, this.minPolarAngle = 0, this.maxPolarAngle = Math.PI, this.minAzimuthAngle = -1 / 0, this.maxAzimuthAngle = 1 / 0, this.enableDamping = !1, this.dampingFactor = 0.05, this.enableZoom = !0, this.zoomSpeed = 1, this.enableRotate = !0, this.rotateSpeed = 1, this.enablePan = !0, this.panSpeed = 1, this.screenSpacePanning = !1, this.keyPanSpeed = 7, this.autoRotate = !1, this.autoRotateSpeed = 2, this.enableKeys = !0, this.keys = { LEFT: 37, UP: 38, RIGHT: 39, BOTTOM: 40 }, this.mouseButtons = { LEFT: Ae.ROTATE, MIDDLE: Ae.DOLLY, RIGHT: Ae.PAN }, this.touches = { ONE: Me.ROTATE, TWO: Me.DOLLY_PAN }, this.target0 = this.target.clone(), this.position0 = this.object.position.clone(), this.zoom0 = this.object.zoom, this.getPolarAngle = function() {
|
|
1960
1960
|
return d.phi;
|
|
1961
1961
|
}, this.getAzimuthalAngle = function() {
|
|
@@ -1964,13 +1964,13 @@ var wt = function(f, o, e, a) {
|
|
|
1964
1964
|
e.target0.copy(e.target), e.position0.copy(e.object.position), e.zoom0 = e.object.zoom;
|
|
1965
1965
|
}, this.reset = function() {
|
|
1966
1966
|
e.target.copy(e.target0), e.object.position.copy(e.position0), e.object.zoom = e.zoom0, e.object.updateProjectionMatrix(), e.dispatchEvent(a), e.update(), l = c.NONE;
|
|
1967
|
-
}, this.update = function() {
|
|
1968
|
-
var u = new ve(), D = new
|
|
1967
|
+
}, this.update = (function() {
|
|
1968
|
+
var u = new ve(), D = new Ht().setFromUnitVectors(f.up, new ve(0, 1, 0)), X = D.clone().inverse(), K = new ve(), fe = new Ht();
|
|
1969
1969
|
return function() {
|
|
1970
1970
|
var ge = e.object.position;
|
|
1971
1971
|
return u.copy(ge).sub(e.target), u.applyQuaternion(D), d.setFromVector3(u), e.autoRotate && l === c.NONE && te(ee()), e.enableDamping ? (d.theta += v.theta * e.dampingFactor, d.phi += v.phi * e.dampingFactor) : (d.theta += v.theta, d.phi += v.phi), d.theta = Math.max(e.minAzimuthAngle, Math.min(e.maxAzimuthAngle, d.theta)), d.phi = Math.max(e.minPolarAngle, Math.min(e.maxPolarAngle, d.phi)), d.makeSafe(), d.radius *= T, d.radius = Math.max(e.minDistance, Math.min(e.maxDistance, d.radius)), e.enableDamping === !0 ? e.target.addScaledVector(A, e.dampingFactor) : e.target.add(A), u.setFromSpherical(d), u.applyQuaternion(X), ge.copy(e.target).add(u), e.object.lookAt(e.target), e.enableDamping === !0 ? (v.theta *= 1 - e.dampingFactor, v.phi *= 1 - e.dampingFactor, A.multiplyScalar(1 - e.dampingFactor)) : (v.set(0, 0, 0), A.set(0, 0, 0)), T = 1, x || K.distanceToSquared(e.object.position) > g || 8 * (1 - fe.dot(e.object.quaternion)) > g ? (e.dispatchEvent(a), K.copy(e.object.position), fe.copy(e.object.quaternion), x = !1, !0) : !1;
|
|
1972
1972
|
};
|
|
1973
|
-
}(), this.dispose = function() {
|
|
1973
|
+
})(), this.dispose = function() {
|
|
1974
1974
|
e.domElement.removeEventListener("contextmenu", Ze, !1), e.domElement.removeEventListener("mousedown", xe, !1), e.domElement.removeEventListener("wheel", Ue, !1), e.domElement.removeEventListener("touchstart", Ie, !1), e.domElement.removeEventListener("touchend", Ke, !1), e.domElement.removeEventListener("touchmove", ae, !1), document.removeEventListener("mousemove", oe, !1), document.removeEventListener("mouseup", ue, !1), e.domElement.removeEventListener("keydown", Be, !1);
|
|
1975
1975
|
};
|
|
1976
1976
|
var e = this, a = { type: "change" }, t = { type: "start" }, s = { type: "end" }, c = {
|
|
@@ -1982,7 +1982,7 @@ var wt = function(f, o, e, a) {
|
|
|
1982
1982
|
TOUCH_PAN: 4,
|
|
1983
1983
|
TOUCH_DOLLY_PAN: 5,
|
|
1984
1984
|
TOUCH_DOLLY_ROTATE: 6
|
|
1985
|
-
}, l = c.NONE, g = 1e-6, d = new
|
|
1985
|
+
}, l = c.NONE, g = 1e-6, d = new jt(), v = new jt(), T = 1, A = new ve(), x = !1, _ = new Te(), C = new Te(), L = new Te(), b = new Te(), y = new Te(), P = new Te(), p = new Te(), S = new Te(), M = new Te();
|
|
1986
1986
|
function ee() {
|
|
1987
1987
|
return 2 * Math.PI / 60 / 60 * e.autoRotateSpeed;
|
|
1988
1988
|
}
|
|
@@ -1995,17 +1995,17 @@ var wt = function(f, o, e, a) {
|
|
|
1995
1995
|
function le(u) {
|
|
1996
1996
|
v.phi -= u;
|
|
1997
1997
|
}
|
|
1998
|
-
var me = function() {
|
|
1998
|
+
var me = (function() {
|
|
1999
1999
|
var u = new ve();
|
|
2000
2000
|
return function(X, K) {
|
|
2001
2001
|
u.setFromMatrixColumn(K, 0), u.multiplyScalar(-X), A.add(u);
|
|
2002
2002
|
};
|
|
2003
|
-
}(), Ce = function() {
|
|
2003
|
+
})(), Ce = (function() {
|
|
2004
2004
|
var u = new ve();
|
|
2005
2005
|
return function(X, K) {
|
|
2006
2006
|
e.screenSpacePanning === !0 ? u.setFromMatrixColumn(K, 1) : (u.setFromMatrixColumn(K, 0), u.crossVectors(e.object.up, u)), u.multiplyScalar(X), A.add(u);
|
|
2007
2007
|
};
|
|
2008
|
-
}(), re = function() {
|
|
2008
|
+
})(), re = (function() {
|
|
2009
2009
|
var u = new ve();
|
|
2010
2010
|
return function(X, K) {
|
|
2011
2011
|
var fe = e.domElement;
|
|
@@ -2016,7 +2016,7 @@ var wt = function(f, o, e, a) {
|
|
|
2016
2016
|
ge *= Math.tan(e.object.fov / 2 * Math.PI / 180), me(2 * X * ge / fe.clientHeight, e.object.matrix), Ce(2 * K * ge / fe.clientHeight, e.object.matrix);
|
|
2017
2017
|
} else e.object.isOrthographicCamera ? (me(X * (e.object.right - e.object.left) / e.object.zoom / fe.clientWidth, e.object.matrix), Ce(K * (e.object.top - e.object.bottom) / e.object.zoom / fe.clientHeight, e.object.matrix)) : (console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."), e.enablePan = !1);
|
|
2018
2018
|
};
|
|
2019
|
-
}();
|
|
2019
|
+
})();
|
|
2020
2020
|
function ie(u) {
|
|
2021
2021
|
e.object.isPerspectiveCamera ? T /= u : e.object.isOrthographicCamera ? (e.object.zoom = Math.max(e.minZoom, Math.min(e.maxZoom, e.object.zoom * u)), e.object.updateProjectionMatrix(), x = !0) : (console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."), e.enableZoom = !1);
|
|
2022
2022
|
}
|
|
@@ -2325,12 +2325,12 @@ var Dn = function() {
|
|
|
2325
2325
|
for (var te = 0, le = b.children.length; te < le; te++)
|
|
2326
2326
|
x(b.children[te], y, P, p);
|
|
2327
2327
|
}
|
|
2328
|
-
var _ = function() {
|
|
2328
|
+
var _ = (function() {
|
|
2329
2329
|
var b = new ve(), y = new ve();
|
|
2330
2330
|
return function(P, p) {
|
|
2331
2331
|
return b.setFromMatrixPosition(P.matrixWorld), y.setFromMatrixPosition(p.matrixWorld), b.distanceToSquared(y);
|
|
2332
2332
|
};
|
|
2333
|
-
}();
|
|
2333
|
+
})();
|
|
2334
2334
|
function C(b) {
|
|
2335
2335
|
var y = [];
|
|
2336
2336
|
return b.traverse(function(P) {
|
|
@@ -2358,7 +2358,7 @@ function Xt(f, o, e) {
|
|
|
2358
2358
|
}
|
|
2359
2359
|
var Rn = (
|
|
2360
2360
|
/** @class */
|
|
2361
|
-
function(f) {
|
|
2361
|
+
(function(f) {
|
|
2362
2362
|
Fe(o, f);
|
|
2363
2363
|
function o(e, a, t, s, c) {
|
|
2364
2364
|
var l = f.call(this) || this;
|
|
@@ -2466,7 +2466,7 @@ var Rn = (
|
|
|
2466
2466
|
return l.setIndex(new w.BufferAttribute(new Uint16Array(p), 1)), l.setAttribute("position", x), l.setAttribute("normal", _), l;
|
|
2467
2467
|
}
|
|
2468
2468
|
return o;
|
|
2469
|
-
}(w.BufferGeometry)
|
|
2469
|
+
})(w.BufferGeometry)
|
|
2470
2470
|
);
|
|
2471
2471
|
function ze(f, o) {
|
|
2472
2472
|
return typeof f != "number" || typeof o != "number" ? !1 : Math.abs(f - o) < 1e-3;
|
|
@@ -2498,7 +2498,7 @@ var Xe = function(f) {
|
|
|
2498
2498
|
return s.name = f, s.scale.set(0.3, 0.3, 0.3), t.style.color = "#ffffff", t.style.opacity = "0.5", t.style.pointerEvents = "none", t.style.backfaceVisibility = "hidden", a.rotateX(-J), a.add(s), a;
|
|
2499
2499
|
}, Un = (
|
|
2500
2500
|
/** @class */
|
|
2501
|
-
function(f) {
|
|
2501
|
+
(function(f) {
|
|
2502
2502
|
Fe(o, f);
|
|
2503
2503
|
function o(e, a) {
|
|
2504
2504
|
var t = f.call(this, e) || this;
|
|
@@ -2869,12 +2869,12 @@ var Xe = function(f) {
|
|
|
2869
2869
|
this.updateState({ enabled: !1 }, t), this._disable({ userAction: t }), document.head.removeChild(this.style);
|
|
2870
2870
|
}
|
|
2871
2871
|
}, o;
|
|
2872
|
-
}(We.Controller)
|
|
2872
|
+
})(We.Controller)
|
|
2873
2873
|
), Kn = function(f, o) {
|
|
2874
2874
|
return new Un(f, o);
|
|
2875
2875
|
}, Bn = (
|
|
2876
2876
|
/** @class */
|
|
2877
|
-
function(f) {
|
|
2877
|
+
(function(f) {
|
|
2878
2878
|
Fe(o, f);
|
|
2879
2879
|
function o(e, a) {
|
|
2880
2880
|
var t = f.call(this, e) || this;
|
|
@@ -2935,7 +2935,7 @@ var Xe = function(f) {
|
|
|
2935
2935
|
`, t.enable()), t;
|
|
2936
2936
|
}
|
|
2937
2937
|
return o;
|
|
2938
|
-
}(Zt.Controller)
|
|
2938
|
+
})(Zt.Controller)
|
|
2939
2939
|
), Zn = function(f, o) {
|
|
2940
2940
|
return new Bn(f, o);
|
|
2941
2941
|
};
|
|
@@ -2959,7 +2959,7 @@ new w.Matrix4().fromArray([
|
|
|
2959
2959
|
]);
|
|
2960
2960
|
var Et = (
|
|
2961
2961
|
/** @class */
|
|
2962
|
-
function() {
|
|
2962
|
+
(function() {
|
|
2963
2963
|
function f(o, e, a, t, s) {
|
|
2964
2964
|
this.R = o, this.Q = e, this.A = a, this.B = t, this.C = s, this.cov = NaN, this.x = NaN;
|
|
2965
2965
|
}
|
|
@@ -2972,10 +2972,10 @@ var Et = (
|
|
|
2972
2972
|
}
|
|
2973
2973
|
return this.x;
|
|
2974
2974
|
}, f;
|
|
2975
|
-
}()
|
|
2975
|
+
})()
|
|
2976
2976
|
), Vn = (
|
|
2977
2977
|
/** @class */
|
|
2978
|
-
function(f) {
|
|
2978
|
+
(function(f) {
|
|
2979
2979
|
Fe(o, f);
|
|
2980
2980
|
function o(e, a) {
|
|
2981
2981
|
var t = f.call(this, e) || this;
|
|
@@ -3103,7 +3103,7 @@ var Et = (
|
|
|
3103
3103
|
this.updateState({ enabled: !1 }, t), this._disable({ userAction: t });
|
|
3104
3104
|
}
|
|
3105
3105
|
}, o;
|
|
3106
|
-
}(We.Controller)
|
|
3106
|
+
})(We.Controller)
|
|
3107
3107
|
), Qn = function(f, o) {
|
|
3108
3108
|
return new Vn(f, o);
|
|
3109
3109
|
};
|
|
@@ -3145,11 +3145,11 @@ void main() {
|
|
|
3145
3145
|
`
|
|
3146
3146
|
), Hn = [1, 5, 2, 6, 3, 7, 4, 8, 9, 13, 10, 14, 11, 15, 12, 16], xt = 512, Pt = 512, ot = 128, zn = (
|
|
3147
3147
|
/** @class */
|
|
3148
|
-
function(f) {
|
|
3148
|
+
(function(f) {
|
|
3149
3149
|
Fe(o, f);
|
|
3150
3150
|
function o(e, a) {
|
|
3151
3151
|
var t = f.call(this, e) || this;
|
|
3152
|
-
t.group = new w.Group(), t.mesh = function() {
|
|
3152
|
+
t.group = new w.Group(), t.mesh = (function() {
|
|
3153
3153
|
var l = new w.CylinderGeometry(0.12, 0.12, 1, 32, 1, !0);
|
|
3154
3154
|
l.translate(0, 0.5, 0);
|
|
3155
3155
|
var g = new w.ShaderMaterial({
|
|
@@ -3164,13 +3164,13 @@ void main() {
|
|
|
3164
3164
|
depthTest: !1
|
|
3165
3165
|
}), d = new w.Mesh(l, g);
|
|
3166
3166
|
return d;
|
|
3167
|
-
}(), t.panoMesh = new Tn({ scale: 1.5 }), t.stop = function() {
|
|
3167
|
+
})(), t.panoMesh = new Tn({ scale: 1.5 }), t.stop = function() {
|
|
3168
3168
|
}, t.drawLine = function(l, g) {
|
|
3169
3169
|
if (t.ctx) {
|
|
3170
|
-
var d = function() {
|
|
3170
|
+
var d = (function() {
|
|
3171
3171
|
var A, x = xt / 16 | 0;
|
|
3172
3172
|
return x * ((A = Hn[l]) !== null && A !== void 0 ? A : 0);
|
|
3173
|
-
}(), v = (1 - (g + l * 150) % 1200 / 1200) * (Pt + ot), T = t.ctx.createLinearGradient(0, v - ot, 0, v);
|
|
3173
|
+
})(), v = (1 - (g + l * 150) % 1200 / 1200) * (Pt + ot), T = t.ctx.createLinearGradient(0, v - ot, 0, v);
|
|
3174
3174
|
T.addColorStop(0, "rgba(255,255,255,0)"), T.addColorStop(0.5, "rgba(255,255,255,1)"), T.addColorStop(1, "rgba(255,255,255,0)"), t.ctx.fillStyle = T, t.ctx.fillRect(d, v - ot, 3, ot);
|
|
3175
3175
|
}
|
|
3176
3176
|
}, t.anime = function(l) {
|
|
@@ -3239,7 +3239,7 @@ void main() {
|
|
|
3239
3239
|
e.enabled ? this._enable(c) : this._disable(c);
|
|
3240
3240
|
}
|
|
3241
3241
|
}, o;
|
|
3242
|
-
}(Zt.Controller)
|
|
3242
|
+
})(Zt.Controller)
|
|
3243
3243
|
), Jn = function(f, o) {
|
|
3244
3244
|
return new zn(f, o);
|
|
3245
3245
|
};
|
package/react/index.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { EventCallback } from '@realsee/five';
|
|
2
|
+
import { EventTypes } from '@realsee/five';
|
|
2
3
|
import { Five } from '@realsee/five';
|
|
3
4
|
import { FiveInitArgs } from '@realsee/five';
|
|
4
5
|
import { FiveLoadOptions } from '@realsee/five';
|
|
@@ -10,6 +11,7 @@ import { Pose } from '@realsee/five';
|
|
|
10
11
|
import * as React_2 from 'react';
|
|
11
12
|
import { Scene } from '@realsee/five';
|
|
12
13
|
import { State } from '@realsee/five';
|
|
14
|
+
import { Subscribe } from '@realsee/five';
|
|
13
15
|
import * as THREE_2 from 'three';
|
|
14
16
|
import { Vector2 } from 'three';
|
|
15
17
|
import { Work } from '@realsee/five';
|
|
@@ -292,13 +294,13 @@ export declare interface FiveCanvasProps {
|
|
|
292
294
|
height: number;
|
|
293
295
|
}
|
|
294
296
|
|
|
295
|
-
export declare type FiveInjectionActionFeature = "loadWork" | "setState" | "on" | "off" | "intersectRaycaster" | "project2d" | "updateCamera" | "
|
|
297
|
+
export declare type FiveInjectionActionFeature = "loadWork" | "setState" | "on" | "off" | "intersectRaycaster" | "project2d" | "updateCamera" | "getPixels" | "render" | "needsRender" | "preloadPano" | "showFloor" | "toggleHelperVisible";
|
|
296
298
|
|
|
297
|
-
export declare type FiveInjectionDataFeature = "unsafe__fiveInstance" | "currentState" | "currentObserver" | "state" | "works" | "model" | "scene" | "cameraDirection" | "cameraRaycaster" | "modelReadyState" | "shownFloor" | "
|
|
299
|
+
export declare type FiveInjectionDataFeature = "unsafe__fiveInstance" | "currentState" | "currentObserver" | "state" | "works" | "model" | "scene" | "cameraDirection" | "cameraRaycaster" | "modelReadyState" | "shownFloor" | "helperVisible";
|
|
298
300
|
|
|
299
301
|
export declare type FiveInjectionFeature = FiveInjectionDataFeature | FiveInjectionActionFeature;
|
|
300
302
|
|
|
301
|
-
export declare interface FiveInjectionTypes extends
|
|
303
|
+
export declare interface FiveInjectionTypes extends Subscribe<EventTypes> {
|
|
302
304
|
/**
|
|
303
305
|
* Five React Inject: 获取 five 实例
|
|
304
306
|
* @description 不到万不得已,并不推荐直接使用。
|
|
@@ -345,10 +347,50 @@ export declare interface FiveInjectionTypes extends Record<FiveInjectionFeature,
|
|
|
345
347
|
* ```
|
|
346
348
|
*/
|
|
347
349
|
currentState: State;
|
|
350
|
+
/**
|
|
351
|
+
* Five React Inject: Five currentState
|
|
352
|
+
*/
|
|
353
|
+
currentObserver: WorkObserver;
|
|
354
|
+
/**
|
|
355
|
+
* Five React Inject: Five cameraDirection
|
|
356
|
+
*/
|
|
357
|
+
cameraDirection: THREE_2.Vector3;
|
|
358
|
+
/**
|
|
359
|
+
* Five React Inject: Five cameraRaycaster
|
|
360
|
+
*/
|
|
361
|
+
cameraRaycaster: THREE_2.Raycaster;
|
|
362
|
+
/**
|
|
363
|
+
* Five React Inject: Five Work
|
|
364
|
+
*/
|
|
365
|
+
work: Five['work'];
|
|
348
366
|
/**
|
|
349
367
|
* Five React Inject: Five Work
|
|
350
368
|
*/
|
|
351
|
-
works:
|
|
369
|
+
works: Five['works'];
|
|
370
|
+
/**
|
|
371
|
+
* Five React Inject: Five model
|
|
372
|
+
*/
|
|
373
|
+
model: Five['model'];
|
|
374
|
+
/**
|
|
375
|
+
* Five React Inject: Five models
|
|
376
|
+
*/
|
|
377
|
+
models: Five['models'];
|
|
378
|
+
/**
|
|
379
|
+
* Five React Inject: Five models
|
|
380
|
+
*/
|
|
381
|
+
scene: Five['scene'];
|
|
382
|
+
/**
|
|
383
|
+
* Five React Inject: Five modelReadyState
|
|
384
|
+
*/
|
|
385
|
+
modelReadyState: "Empty" | "Loaded" | undefined;
|
|
386
|
+
/**
|
|
387
|
+
* Five React Inject: Five shownFloor
|
|
388
|
+
*/
|
|
389
|
+
shownFloor: number | null | undefined;
|
|
390
|
+
/**
|
|
391
|
+
* Five React Inject: Five helperVisible
|
|
392
|
+
*/
|
|
393
|
+
helperVisible: boolean | undefined;
|
|
352
394
|
/**
|
|
353
395
|
* 设置 State
|
|
354
396
|
* @description
|
|
@@ -381,39 +423,6 @@ export declare interface FiveInjectionTypes extends Record<FiveInjectionFeature,
|
|
|
381
423
|
* @param duration - 切换时间
|
|
382
424
|
*/
|
|
383
425
|
loadWork: Five["load"];
|
|
384
|
-
/**
|
|
385
|
-
* 监听事件
|
|
386
|
-
* @param name - 事件名 具体事件列表 请查看 Five.EventCallback
|
|
387
|
-
* @param callback - 回调函数
|
|
388
|
-
* @param once - 是否一次触发
|
|
389
|
-
* @returns 解除事件绑定
|
|
390
|
-
* @example
|
|
391
|
-
* ```
|
|
392
|
-
* $five.on("panoArrived", () => {});
|
|
393
|
-
* ```
|
|
394
|
-
*/
|
|
395
|
-
on: Five["on"];
|
|
396
|
-
/**
|
|
397
|
-
* 监听事件一次触发
|
|
398
|
-
* @param name - 事件名 具体事件列表 请查看 Five.EventCallback
|
|
399
|
-
* @param callback - 回调函数
|
|
400
|
-
* @returns 解除事件绑定
|
|
401
|
-
* @example
|
|
402
|
-
* ```
|
|
403
|
-
* $five.once("panoArrived", () => {});
|
|
404
|
-
* ```
|
|
405
|
-
*/
|
|
406
|
-
once: Five["once"];
|
|
407
|
-
/**
|
|
408
|
-
* 解除事件绑定
|
|
409
|
-
* @param name - 事件名 具体事件列表 请查看 Five.EventCallback
|
|
410
|
-
* @param callback - 回调函数
|
|
411
|
-
* @example
|
|
412
|
-
* ```
|
|
413
|
-
* $five.off("panoArrived", () => {});
|
|
414
|
-
* ```
|
|
415
|
-
*/
|
|
416
|
-
off: Five["off"];
|
|
417
426
|
/**
|
|
418
427
|
* 计算模型射线碰撞检测
|
|
419
428
|
* @param raycaster - THREE 射线对象
|
package/react/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @license
|
|
3
3
|
* @realsee/five
|
|
4
|
-
* Generated: 8/
|
|
5
|
-
* Version: 6.6.0-alpha.
|
|
4
|
+
* Generated: 2025/8/15
|
|
5
|
+
* Version: 6.6.0-alpha.2
|
|
6
6
|
* Terms:
|
|
7
7
|
* Realsee SDK License Agreement
|
|
8
8
|
* Update: July 28, 2021
|
|
@@ -252,4 +252,4 @@
|
|
|
252
252
|
* No amendment to or modification of this Agreement will be binding unless in
|
|
253
253
|
* writing and signed by Realsee. You and Realsee hereto confirm that this
|
|
254
254
|
* Agreement and all related documents shall be drafted in English.
|
|
255
|
-
*/"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const ce=require("react"),fe=require("three"),j=require("@realsee/five");function B(e){const n=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const t in e)if(t!=="default"){const r=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(n,t,r.get?r:{enumerable:!0,get:()=>e[t]})}}return n.default=e,Object.freeze(n)}const u=B(ce),p=B(fe);var E=function(e,n){return E=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,r){t.__proto__=r}||function(t,r){for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(t[o]=r[o])},E(e,n)};function I(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");E(e,n);function t(){this.constructor=e}e.prototype=n===null?Object.create(n):(t.prototype=n.prototype,new t)}var h=function(){return h=Object.assign||function(n){for(var t,r=1,o=arguments.length;r<o;r++){t=arguments[r];for(var a in t)Object.prototype.hasOwnProperty.call(t,a)&&(n[a]=t[a])}return n},h.apply(this,arguments)};function w(e,n,t){if(t||arguments.length===2)for(var r=0,o=n.length,a;r<o;r++)(a||!(r in n))&&(a||(a=Array.prototype.slice.call(n,0,r)),a[r]=n[r]);return e.concat(a||Array.prototype.slice.call(n))}var k=[],R=[];function le(e){var n=e===void 0?{}:e,t=n.preserveDrawingBuffer,r=t===void 0?!0:t,o=n.webgl2,a=o===void 0?!1:o;if(typeof window!="undefined"){var i=null;if(a?i=k.shift():i=R.shift(),!i){if(a){var s=document.createElement("canvas"),c=s.getContext("webgl2");c?i=new p.WebGLRenderer({preserveDrawingBuffer:r,antialias:!0,alpha:!0,stencil:!0,canvas:s,context:c}):(console.error("error occurred when getting webgl2 canvas context, mybe webgl2 not support, fallback to webgl."),i=new p.WebGLRenderer({preserveDrawingBuffer:r,antialias:!1,alpha:!0,stencil:!0}))}else i=new p.WebGLRenderer({preserveDrawingBuffer:r,antialias:!1,alpha:!0,stencil:!0});i.outputEncoding=p.sRGBEncoding}return i.autoClear=!0,i}}function ve(e){if(e){var n=e.capabilities.isWebGL2;n?R.indexOf(e)===-1&&R.push(e):k.indexOf(e)===-1&&k.push(e)}}var L=u.createContext(null);function v(){var e=u.useContext(L);if(!e)throw new Error("FiveProvider never found.");return e.five}function G(){var e=u.useContext(L);if(!e)throw new Error("FiveProvider never found.");return e.loadWork}function de(e,n){var t=Array.isArray(e)?e:[e],r=Array.isArray(n)?n:[n];if(t.length!==r.length)return!1;for(var o=0;o<t.length;o++)if(t[o].workCode!==r[o].workCode)return!1;return!0}function pe(e){return e===void 0&&(e={}),function(n){I(t,n);function t(r){var o=n.call(this,r)||this;return o.__fiveEventDisposers=[],o.__fiveDisposeTimer=null,o.five=new j.Five(h(h({},e),{renderer:void 0})),o.loadWork=o.loadWork.bind(o),o.state={},o}return t.prototype.loadWork=function(r,o,a,i){if(i===void 0&&(i=!0),this.props.work)throw new Error("props 'works' is set in fiveProvider, if you need modify work internal, use 'initialWork' instead.");return this.five.load(r,o,a,i)},t.prototype.shouldComponentUpdate=function(r){return this.five.renderer&&this.five&&r.work&&!de(r.work,this.five.works)&&this.five.load(r.work,r.initialState,r.initialOptions),!0},t.prototype.componentDidMount=function(){var r=this,o;clearTimeout(this.__fiveDisposeTimer),this.__fiveDisposeTimer=null;var a;if(typeof window!="undefined"){a=le({webgl2:e==null?void 0:e.webgl2,preserveDrawingBuffer:e==null?void 0:e.preserveDrawingBuffer});var i=j.getViewportScale(),s=i===1?window.devicePixelRatio:1;a==null||a.setPixelRatio(s)}this.five.renderer=a,this.setState({renderer:a}),this.__fiveEventDisposers.push(this.five.on("load",function(){r.props.onWorksChange&&r.props.onWorksChange(r.five.works)})),this.__fiveEventDisposers.push(this.five.on("stateChange",function(l,d){r.props.onStateChange&&r.props.onStateChange(l,d)})),this.__fiveEventDisposers.push(this.five.on("currentStateChange",function(l,d){r.props.onCurrentStateChange&&r.props.onCurrentStateChange(l,d)})),this.__fiveEventDisposers.push(this.five.on("error",function(l){r.props.onError?r.props.onError(l):console.warn(l.message)}));var c=this.props.work||this.props.initialWork;c&&this.five.load(c,this.props.initialState,this.props.initialOptions,(o=this.props.initialUserAction)!==null&&o!==void 0?o:!0)},t.prototype.componentWillUnmount=function(){var r=this,o;(o=this.five.controller)===null||o===void 0||o.destroy();var a=this.five.renderer;this.five.renderer=void 0,ve(a),this.setState({renderer:void 0}),this.__fiveDisposeTimer=setTimeout(function(){r.__fiveDisposeTimer=null,r.five.dispose()},1e3)},t.prototype.render=function(){var r=this.five,o=this.loadWork,a=this.state.renderer;return u.createElement(L.Provider,{value:{renderer:a,five:r,loadWork:o}},this.props.children)},t}(u.Component)}var he=typeof window!="undefined"?u.useLayoutEffect:u.useEffect,ge={display:"inline-block",overflow:"hidden"},ye=function(e){var n=e.width,t=e.height,r=v(),o=u.createRef(),a=h({width:n,height:t},ge);return he(function(){var i=o.current;if(i&&r.renderer){var s=r.renderer.domElement;if(s.parentNode!==null&&s.parentNode!==i)throw new Error("There are more than 2 fiveCanvas in this context.");return s.parentNode!==i&&i.appendChild(s),r.camera.aspect=n/t,r.camera.updateProjectionMatrix(),r.renderer.setSize(n,t),r.refresh({width:n,height:t}),r.needsRender=!0,function(){s.parentNode===i&&i.removeChild(s)}}},[r,r.renderer,n,t,o.current]),u.createElement("div",{ref:o,style:a})};function me(){return v()}function q(e,n){var t=v(),r=[t];n!==void 0&&(r=r.concat(n)),u.useLayoutEffect(function(){return e(t.scene)},r)}var Se=q;function we(){var e=v(),n=G(),t=u.useState(function(){return e.works}),r=t[0],o=t[1];return u.useLayoutEffect(function(){return e.on("load",function(){return o(e.works)})},[e]),[r,n]}function U(e){return h({},e.state)}function be(){var e=v(),n=u.useState(function(){return U(e)}),t=n[0],r=n[1],o=u.useCallback(function(a,i,s){i===void 0&&(i=!1),s===void 0&&(s=!0);var c=typeof a=="function"?a(e.getCurrentState()):a;e.setState(c,i,s)},[e]);return u.useLayoutEffect(function(){return e.on("stateChange",function(){return r(U(e))})},[e]),[t,o]}function Ce(){var e=v(),n=u.useState(function(){return e.getCurrentState()}),t=n[0],r=n[1],o=u.useCallback(function(a,i,s){i===void 0&&(i=!1),s===void 0&&(s=!0);var c=typeof a=="function"?a(e.getCurrentState()):a;e.setState(c,i,s)},[e]);return u.useLayoutEffect(function(){return e.on("currentStateChange",function(){return r(e.getCurrentState())})},[e]),[t,o]}function Fe(){var e=v(),n=u.useState(function(){return e.getCurrentState()}),t=n[0],r=n[1];return u.useLayoutEffect(function(){return e.on("currentStateChange",function(){return r(e.getCurrentState())})},[e]),e.works.getObserver(t)}function Ee(e,n,t){var r=v(),o=[r,e];t!==void 0&&(o=o.concat(t)),u.useLayoutEffect(function(){return r.on(e,n)},o)}function ke(){var e=v(),n=u.useCallback(function(i,s){return e.updateCamera(i,s)},[e]),t=u.useCallback(e.getPixels.bind(e),[e]),r=u.useCallback(function(i){return e.render(i)},[e]),o=u.useCallback(function(){return e.needsRender=!0},[e]),a=u.useCallback(function(i,s){return e.preloadPano(i,s)},[e]);return{updateCamera:n,getPixels:t,render:r,needsRender:o,preloadPano:a}}function Re(){var e=v(),n=u.useState(function(){return Symbol()});n[0];var t=n[1];u.useLayoutEffect(function(){return e.on("cameraUpdate",function(){return t(Symbol())})},[e]);var r=u.useCallback(function(o,a){return e.project2d(o,a)},[e]);return r}function T(e){var n=e.camera.getWorldDirection(new p.Vector3),t=new p.Raycaster(e.camera.position,n);return t}function Le(){var e=v(),n=u.useState(function(){return T(e)}),t=n[0],r=n[1];return u.useLayoutEffect(function(){return e.on("cameraUpdate",function(){return r(T(e))})},[e]),t}function N(e){return e.camera.getWorldDirection(new p.Vector3)}function _e(){var e=v(),n=u.useState(function(){return N(e)}),t=n[0],r=n[1];return u.useLayoutEffect(function(){return e.on("cameraUpdate",function(){return r(N(e))})},[e]),t}function Pe(){var e=v(),n=u.useCallback(function(t){return e.model.intersectRaycaster(t)},[e]);return n}function $(e){return e.model.empty?"Empty":"Loaded"}function Ve(){var e=v(),n=u.useState(function(){return $(e)}),t=n[0],r=n[1];return u.useLayoutEffect(function(){return e.on("modelLoaded",function(){return r($(e))})},[e]),t}function Oe(){var e=v(),n=u.useState(e.model.shownFloor),t=n[0],r=n[1],o=u.useState(e.model.floorLength),a=o[0],i=o[1],s=u.useCallback(function(c){typeof c=="number"?e.model.show(c):e.model.show()},[e]);return u.useLayoutEffect(function(){var c=[];return c.push(e.on("modelShownFloorChange",function(){return r(e.model.shownFloor)})),c.push(e.on("modelLoaded",function(){return i(e.model.floorLength)})),function(){for(var l;l=c.shift();)l()}},[e]),[t,a,s]}function De(){var e=v(),n=u.useState(e.helperVisible),t=n[0],r=n[1],o=u.useCallback(function(a){e.helperVisible=a},[e]);return u.useLayoutEffect(function(){return e.on("helpersVisibleChange",function(a){return r(a)})},[e]),[t,o]}var xe="$five";function f(e,n){return n.indexOf(e)>=0}function H(e,n){for(var t=0,r=Object.keys(n);t<r.length;t++){var o=r[t];n[o]!==void 0&&(e[o]=n[o])}}function We(e,n){var t=f("state",n),r=u.useState(Symbol()),o=r[0],a=r[1],i=u.useMemo(function(){if(t)return h({},e.state)},[e,o]);return u.useLayoutEffect(function(){if(t)return e.on("stateChange",function(){return a(Symbol())})},[e]),[i,o]}function Me(e,n){var t=f("currentState",n),r=u.useState(Symbol()),o=r[0],a=r[1],i=u.useMemo(function(){if(t)return e.getCurrentState()},[e,o]);return u.useLayoutEffect(function(){if(t)return e.on("currentStateChange",function(){return a(Symbol())})},[e]),[i,o]}function je(e,n){var t=f("currentObserver",n),r=u.useState(Symbol()),o=r[0],a=r[1],i=u.useMemo(function(){if(t)return e.getCurrentState()},[e,o]);u.useLayoutEffect(function(){if(t)return e.on("currentStateChange",function(){return a(Symbol())})},[e]);var s=void 0;return i&&(s=e.works.getObserver(i)),[s,o]}function Ue(e,n){var t=f("unsafe__fiveInstance",n);return[t?e:void 0]}function Te(e,n){var t=f("works",n),r=u.useState(Symbol()),o=r[0],a=r[1],i=u.useMemo(function(){if(t)return e.works},[e,o]);return u.useLayoutEffect(function(){if(t)return e.on("load",function(){return a(Symbol())})},[e]),[i,o]}function Ne(e,n){var t=f("model",n),r=u.useState(Symbol()),o=r[0],a=r[1],i=u.useMemo(function(){if(t)return e.model},[e,o]);return u.useLayoutEffect(function(){if(t)return e.on("modelLoaded",function(){return a(Symbol())})},[e]),[i,o]}function $e(e,n){var t=f("scene",n);return[t?e.scene:void 0]}function He(e,n){var t=f("cameraDirection",n),r=u.useState(Symbol()),o=r[0],a=r[1],i=u.useMemo(function(){if(t)return e.camera.getWorldDirection(new p.Vector3)},[e,o]);return u.useLayoutEffect(function(){if(t)return e.on("cameraUpdate",function(){return a(Symbol())})},[e]),[i,o]}function Be(e,n){var t=f("cameraRaycaster",n),r=u.useState(Symbol()),o=r[0],a=r[1],i=u.useMemo(function(){if(t){var s=e.camera.getWorldDirection(new p.Vector3),c=new p.Raycaster(e.camera.position,s);return c}},[e,o]);return u.useLayoutEffect(function(){if(t)return e.on("cameraUpdate",function(){return a(Symbol())})},[e]),[i,o]}function Ie(e,n){var t=f("modelReadyState",n),r=u.useState(Symbol()),o=r[0],a=r[1],i=u.useMemo(function(){if(t)return e.model.empty?"Empty":"Loaded"},[e,o]);return u.useLayoutEffect(function(){if(t)return e.on("modelLoaded",function(){return a(Symbol())})},[e]),[i,o]}function Ge(e,n){var t=f("shownFloor",n),r=u.useState(Symbol()),o=r[0],a=r[1],i=u.useMemo(function(){if(t)return e.model.shownFloor},[e,o]);return u.useLayoutEffect(function(){if(t)return e.on("modelShownFloorChange",function(){return a(Symbol())})},[e]),[i,o]}function qe(e,n){var t=f("helperVisible",n),r=u.useState(Symbol()),o=r[0],a=r[1],i=u.useMemo(function(){if(t)return e.helperVisible},[e,o]);return u.useLayoutEffect(function(){if(t)return e.on("helpersVisibleChange",function(){return a(Symbol())})},[e]),[i,o]}function Ae(e,n){if(f("loadWork",n))return e}function ze(e,n){if(f("setState",n))return function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return e.setState.apply(e,t)}}function Je(e,n){if(f("on",n))return function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return e.on.apply(e,t)}}function Ke(e,n){if(f("on",n))return function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return e.once.apply(e,t)}}function Qe(e,n){if(f("off",n))return function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return e.off.apply(e,t)}}function Xe(e,n){if(f("intersectRaycaster",n))return function(){for(var t,r=[],o=0;o<arguments.length;o++)r[o]=arguments[o];return(t=e.model).intersectRaycaster.apply(t,r)}}function Ye(e,n){if(f("project2d",n))return function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return e.project2d.apply(e,t)}}function Ze(e,n){if(f("updateCamera",n))return function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return e.updateCamera.apply(e,t)}}function er(e,n){if(f("getPixels",n))return e.getPixels.bind(e)}function rr(e,n){if(f("render",n))return function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return e.render.apply(e,t)}}function tr(e,n){if(f("needsRender",n))return function(){e.needsRender=!0}}function nr(e,n){if(f("preloadPano",n))return function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return e.preloadPano.apply(e,t)}}function or(e,n){if(f("showFloor",n))return function(t){typeof t=="number"?e.model.show(t):e.model.show()}}function ar(e,n){if(f("toggleHelperVisible",n))return function(t){e.helperVisible=t}}function ur(e){return function(n){return u.forwardRef(function(t,r){var o=v(),a=G(),i=Ue(o,e)[0],s=We(o,e),c=s[0],l=s[1],d=Me(o,e),y=d[0],g=d[1],S=je(o,e),b=S[0],C=S[1],_=Te(o,e),z=_[0],J=_[1],P=Ne(o,e),K=P[0],Q=P[1],X=$e(o,e)[0],V=He(o,e),Y=V[0],Z=V[1],O=Be(o,e),ee=O[0],re=O[1],D=Ie(o,e),te=D[0],ne=D[1],x=Ge(o,e),oe=x[0],ae=x[1],W=qe(o,e),ue=W[0],ie=W[1],M=u.useMemo(function(){var m={};return H(m,{setState:ze(o,e),loadWork:Ae(a,e),on:Je(o,e),once:Ke(o,e),off:Qe(o,e),intersectRaycaster:Xe(o,e),project2d:Ye(o,e),updateCamera:Ze(o,e),getPixels:er(o,e),render:rr(o,e),needsRender:tr(o,e),preloadPano:nr(o,e),showFloor:or(o,e),toggleHelperVisible:ar(o,e)}),m},[o,a]),se=u.useMemo(function(){var m=h({},M);return H(m,{unsafe__fiveInstance:i,state:c,currentState:y,currentObserver:b,work:z,model:K,scene:X,cameraDirection:Y,cameraRaycaster:ee,modelReadyState:te,shownFloor:oe,helperVisible:ue}),m},[o,M,l,g,C,J,Q,Z,re,ne,ae,ie]);return u.createElement(n,h({ref:r,$five:se},t))})}}function ir(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return e}function F(e,n){for(var t={},r=n.length,o=-1;++o<r;){var a=n[o];a in e&&(t[a]=e[a])}return t}function sr(e,n){return typeof e=="number"&&typeof n=="number"&&isNaN(e)&&isNaN(n)?!0:e===n}function cr(e,n){for(var t=0;t<e.length;t++)for(var r=0;r<n.length;r++)if(e[t]===n[r])return!0;return!1}var A=function(){function e(n,t){this.values=n,this.listeners=[],this.onValuesChange=t}return e.prototype.on=function(n,t){var r=this,o=[n,t];return this.listeners.push(o),function(){var a=r.listeners.indexOf(o);a>=0&&r.listeners.splice(a,1)}},e.prototype.getValues=function(n){return F(this.values,n)},e.prototype.setValues=function(n,t){var r=[];for(var o in t)n.indexOf(o)>=0&&!sr(t[o],this.values[o])&&r.push(o);if(r.length!==0){for(var a=h({},this.values),i=0,s=r;i<s.length;i++){var c=s[i];this.values[c]=t[c]}this.onValuesChange&&this.onValuesChange(this.values,a);for(var l=0,d=this.listeners;l<d.length;l++){var y=d[l],g=y[0],S=y[1];if(cr(g,r)){var b=F(a,g),C=F(this.values,g);S(C,b)}}}},e}();function fr(e){var n=u.createContext(null);return{useStore:function(t){var r=u.useContext(n);if(r===null)throw new Error("StoreProvider never found.");var o=u.useRef(!0),a=u.useState(r.getValues(t)),i=a[0],s=a[1],c=w([r],t,!0);u.useLayoutEffect(function(){return o.current?o.current=!1:s(r.getValues(t)),r.on(t,function(d){return s(d)})},c);var l=u.useCallback(function(d){return r.setValues(t,d)},c);return[i,l]},useStoreSetter:function(t){var r=u.useContext(n);if(r===null)throw new Error("StoreProvider never found.");var o=u.useCallback(function(a){return r.setValues(t,a)},w([r],t,!0));return o},watchStore:function(t,r,o){var a=u.useContext(n);if(a===null)throw new Error("StoreProvider never found.");var i=w([a],t,!0);o!==void 0&&(i=i.concat(o)),u.useLayoutEffect(function(){return a.on(t,r)},i)},useStoreAction:function(t){var r=u.useContext(n);if(r===null)throw new Error("StoreProvider never found.");var o=u.useCallback(function(){for(var a=[],i=0;i<arguments.length;i++)a[i]=arguments[i];var s=e[t],c=s[0],l=s.slice(1),d=function(){return r.getValues(l)},y=function(g){return r.setValues(l,g)};return c.apply(void 0,w([d,y],a,!1))},[]);return o},StoreProvider:function(t){I(r,t);function r(o){var a=t.call(this,o)||this;return a.store=new A(o.initialValue,function(){for(var i,s=[],c=0;c<arguments.length;c++)s[c]=arguments[c];a.props.onValuesChange&&(i=a.props).onValuesChange.apply(i,s)}),a}return r.prototype.shouldComponentUpdate=function(o){return o.children!==this.props.children},r.prototype.render=function(){return u.createElement(n.Provider,{value:this.store},this.props.children)},r}(u.Component)}}exports.FiveCanvas=ye;exports.INJECTION_PROPNAME=xe;exports.Store=A;exports.createFiveFeature=ir;exports.createFiveProvider=pe;exports.createStore=fr;exports.unsafe__useFiveInstance=me;exports.useFiveAction=ke;exports.useFiveCameraDirection=_e;exports.useFiveCameraRaycaster=Le;exports.useFiveCurrentObserver=Fe;exports.useFiveCurrentState=Ce;exports.useFiveEventCallback=Ee;exports.useFiveFloor=Oe;exports.useFiveHelper=De;exports.useFiveModelIntersectRaycaster=Pe;exports.useFiveModelReadyState=Ve;exports.useFiveProject2d=Re;exports.useFiveScene=Se;exports.useFiveSceneEffect=q;exports.useFiveState=be;exports.useFiveWork=we;exports.withFive=ur;
|
|
255
|
+
*/"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const ce=require("react"),fe=require("three"),j=require("@realsee/five");function B(e){const n=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const t in e)if(t!=="default"){const r=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(n,t,r.get?r:{enumerable:!0,get:()=>e[t]})}}return n.default=e,Object.freeze(n)}const u=B(ce),p=B(fe);var E=function(e,n){return E=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,r){t.__proto__=r}||function(t,r){for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(t[o]=r[o])},E(e,n)};function I(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");E(e,n);function t(){this.constructor=e}e.prototype=n===null?Object.create(n):(t.prototype=n.prototype,new t)}var h=function(){return h=Object.assign||function(n){for(var t,r=1,o=arguments.length;r<o;r++){t=arguments[r];for(var a in t)Object.prototype.hasOwnProperty.call(t,a)&&(n[a]=t[a])}return n},h.apply(this,arguments)};function w(e,n,t){if(t||arguments.length===2)for(var r=0,o=n.length,a;r<o;r++)(a||!(r in n))&&(a||(a=Array.prototype.slice.call(n,0,r)),a[r]=n[r]);return e.concat(a||Array.prototype.slice.call(n))}var k=[],R=[];function le(e){var n=e===void 0?{}:e,t=n.preserveDrawingBuffer,r=t===void 0?!0:t,o=n.webgl2,a=o===void 0?!1:o;if(typeof window!="undefined"){var i=null;if(a?i=k.shift():i=R.shift(),!i){if(a){var s=document.createElement("canvas"),c=s.getContext("webgl2");c?i=new p.WebGLRenderer({preserveDrawingBuffer:r,antialias:!0,alpha:!0,stencil:!0,canvas:s,context:c}):(console.error("error occurred when getting webgl2 canvas context, mybe webgl2 not support, fallback to webgl."),i=new p.WebGLRenderer({preserveDrawingBuffer:r,antialias:!1,alpha:!0,stencil:!0}))}else i=new p.WebGLRenderer({preserveDrawingBuffer:r,antialias:!1,alpha:!0,stencil:!0});i.outputEncoding=p.sRGBEncoding}return i.autoClear=!0,i}}function ve(e){if(e){var n=e.capabilities.isWebGL2;n?R.indexOf(e)===-1&&R.push(e):k.indexOf(e)===-1&&k.push(e)}}var L=u.createContext(null);function v(){var e=u.useContext(L);if(!e)throw new Error("FiveProvider never found.");return e.five}function G(){var e=u.useContext(L);if(!e)throw new Error("FiveProvider never found.");return e.loadWork}function de(e,n){var t=Array.isArray(e)?e:[e],r=Array.isArray(n)?n:[n];if(t.length!==r.length)return!1;for(var o=0;o<t.length;o++)if(t[o].workCode!==r[o].workCode)return!1;return!0}function pe(e){return e===void 0&&(e={}),(function(n){I(t,n);function t(r){var o=n.call(this,r)||this;return o.__fiveEventDisposers=[],o.__fiveDisposeTimer=null,o.five=new j.Five(h(h({},e),{renderer:void 0})),o.loadWork=o.loadWork.bind(o),o.state={},o}return t.prototype.loadWork=function(r,o,a,i){if(i===void 0&&(i=!0),this.props.work)throw new Error("props 'works' is set in fiveProvider, if you need modify work internal, use 'initialWork' instead.");return this.five.load(r,o,a,i)},t.prototype.shouldComponentUpdate=function(r){return this.five.renderer&&this.five&&r.work&&!de(r.work,this.five.works)&&this.five.load(r.work,r.initialState,r.initialOptions),!0},t.prototype.componentDidMount=function(){var r=this,o;clearTimeout(this.__fiveDisposeTimer),this.__fiveDisposeTimer=null;var a;if(typeof window!="undefined"){a=le({webgl2:e==null?void 0:e.webgl2,preserveDrawingBuffer:e==null?void 0:e.preserveDrawingBuffer});var i=j.getViewportScale(),s=i===1?window.devicePixelRatio:1;a==null||a.setPixelRatio(s)}this.five.renderer=a,this.setState({renderer:a}),this.__fiveEventDisposers.push(this.five.on("load",function(){r.props.onWorksChange&&r.props.onWorksChange(r.five.works)})),this.__fiveEventDisposers.push(this.five.on("stateChange",function(l,d){r.props.onStateChange&&r.props.onStateChange(l,d)})),this.__fiveEventDisposers.push(this.five.on("currentStateChange",function(l,d){r.props.onCurrentStateChange&&r.props.onCurrentStateChange(l,d)})),this.__fiveEventDisposers.push(this.five.on("error",function(l){r.props.onError?r.props.onError(l):console.warn(l.message)}));var c=this.props.work||this.props.initialWork;c&&this.five.load(c,this.props.initialState,this.props.initialOptions,(o=this.props.initialUserAction)!==null&&o!==void 0?o:!0)},t.prototype.componentWillUnmount=function(){var r=this,o;(o=this.five.controller)===null||o===void 0||o.destroy();var a=this.five.renderer;this.five.renderer=void 0,ve(a),this.setState({renderer:void 0}),this.__fiveDisposeTimer=setTimeout(function(){r.__fiveDisposeTimer=null,r.five.dispose()},1e3)},t.prototype.render=function(){var r=this.five,o=this.loadWork,a=this.state.renderer;return u.createElement(L.Provider,{value:{renderer:a,five:r,loadWork:o}},this.props.children)},t})(u.Component)}var he=typeof window!="undefined"?u.useLayoutEffect:u.useEffect,ge={display:"inline-block",overflow:"hidden"},ye=function(e){var n=e.width,t=e.height,r=v(),o=u.createRef(),a=h({width:n,height:t},ge);return he(function(){var i=o.current;if(i&&r.renderer){var s=r.renderer.domElement;if(s.parentNode!==null&&s.parentNode!==i)throw new Error("There are more than 2 fiveCanvas in this context.");return s.parentNode!==i&&i.appendChild(s),r.camera.aspect=n/t,r.camera.updateProjectionMatrix(),r.renderer.setSize(n,t),r.refresh({width:n,height:t}),r.needsRender=!0,function(){s.parentNode===i&&i.removeChild(s)}}},[r,r.renderer,n,t,o.current]),u.createElement("div",{ref:o,style:a})};function me(){return v()}function q(e,n){var t=v(),r=[t];n!==void 0&&(r=r.concat(n)),u.useLayoutEffect(function(){return e(t.scene)},r)}var Se=q;function we(){var e=v(),n=G(),t=u.useState(function(){return e.works}),r=t[0],o=t[1];return u.useLayoutEffect(function(){return e.on("load",function(){return o(e.works)})},[e]),[r,n]}function U(e){return h({},e.state)}function be(){var e=v(),n=u.useState(function(){return U(e)}),t=n[0],r=n[1],o=u.useCallback(function(a,i,s){i===void 0&&(i=!1),s===void 0&&(s=!0);var c=typeof a=="function"?a(e.getCurrentState()):a;e.setState(c,i,s)},[e]);return u.useLayoutEffect(function(){return e.on("stateChange",function(){return r(U(e))})},[e]),[t,o]}function Ce(){var e=v(),n=u.useState(function(){return e.getCurrentState()}),t=n[0],r=n[1],o=u.useCallback(function(a,i,s){i===void 0&&(i=!1),s===void 0&&(s=!0);var c=typeof a=="function"?a(e.getCurrentState()):a;e.setState(c,i,s)},[e]);return u.useLayoutEffect(function(){return e.on("currentStateChange",function(){return r(e.getCurrentState())})},[e]),[t,o]}function Fe(){var e=v(),n=u.useState(function(){return e.getCurrentState()}),t=n[0],r=n[1];return u.useLayoutEffect(function(){return e.on("currentStateChange",function(){return r(e.getCurrentState())})},[e]),e.works.getObserver(t)}function Ee(e,n,t){var r=v(),o=[r,e];t!==void 0&&(o=o.concat(t)),u.useLayoutEffect(function(){return r.on(e,n)},o)}function ke(){var e=v(),n=u.useCallback(function(i,s){return e.updateCamera(i,s)},[e]),t=u.useCallback(e.getPixels.bind(e),[e]),r=u.useCallback(function(i){return e.render(i)},[e]),o=u.useCallback(function(){return e.needsRender=!0},[e]),a=u.useCallback(function(i,s){return e.preloadPano(i,s)},[e]);return{updateCamera:n,getPixels:t,render:r,needsRender:o,preloadPano:a}}function Re(){var e=v(),n=u.useState(function(){return Symbol()});n[0];var t=n[1];u.useLayoutEffect(function(){return e.on("cameraUpdate",function(){return t(Symbol())})},[e]);var r=u.useCallback(function(o,a){return e.project2d(o,a)},[e]);return r}function T(e){var n=e.camera.getWorldDirection(new p.Vector3),t=new p.Raycaster(e.camera.position,n);return t}function Le(){var e=v(),n=u.useState(function(){return T(e)}),t=n[0],r=n[1];return u.useLayoutEffect(function(){return e.on("cameraUpdate",function(){return r(T(e))})},[e]),t}function N(e){return e.camera.getWorldDirection(new p.Vector3)}function _e(){var e=v(),n=u.useState(function(){return N(e)}),t=n[0],r=n[1];return u.useLayoutEffect(function(){return e.on("cameraUpdate",function(){return r(N(e))})},[e]),t}function Pe(){var e=v(),n=u.useCallback(function(t){return e.model.intersectRaycaster(t)},[e]);return n}function $(e){return e.model.empty?"Empty":"Loaded"}function Ve(){var e=v(),n=u.useState(function(){return $(e)}),t=n[0],r=n[1];return u.useLayoutEffect(function(){return e.on("modelLoaded",function(){return r($(e))})},[e]),t}function Oe(){var e=v(),n=u.useState(e.model.shownFloor),t=n[0],r=n[1],o=u.useState(e.model.floorLength),a=o[0],i=o[1],s=u.useCallback(function(c){typeof c=="number"?e.model.show(c):e.model.show()},[e]);return u.useLayoutEffect(function(){var c=[];return c.push(e.on("modelShownFloorChange",function(){return r(e.model.shownFloor)})),c.push(e.on("modelLoaded",function(){return i(e.model.floorLength)})),function(){for(var l;l=c.shift();)l()}},[e]),[t,a,s]}function De(){var e=v(),n=u.useState(e.helperVisible),t=n[0],r=n[1],o=u.useCallback(function(a){e.helperVisible=a},[e]);return u.useLayoutEffect(function(){return e.on("helpersVisibleChange",function(a){return r(a)})},[e]),[t,o]}var xe="$five";function f(e,n){return n.indexOf(e)>=0}function H(e,n){for(var t=0,r=Object.keys(n);t<r.length;t++){var o=r[t];n[o]!==void 0&&(e[o]=n[o])}}function We(e,n){var t=f("state",n),r=u.useState(Symbol()),o=r[0],a=r[1],i=u.useMemo(function(){if(t)return h({},e.state)},[e,o]);return u.useLayoutEffect(function(){if(t)return e.on("stateChange",function(){return a(Symbol())})},[e]),[i,o]}function Me(e,n){var t=f("currentState",n),r=u.useState(Symbol()),o=r[0],a=r[1],i=u.useMemo(function(){if(t)return e.getCurrentState()},[e,o]);return u.useLayoutEffect(function(){if(t)return e.on("currentStateChange",function(){return a(Symbol())})},[e]),[i,o]}function je(e,n){var t=f("currentObserver",n),r=u.useState(Symbol()),o=r[0],a=r[1],i=u.useMemo(function(){if(t)return e.getCurrentState()},[e,o]);u.useLayoutEffect(function(){if(t)return e.on("currentStateChange",function(){return a(Symbol())})},[e]);var s=void 0;return i&&(s=e.works.getObserver(i)),[s,o]}function Ue(e,n){var t=f("unsafe__fiveInstance",n);return[t?e:void 0]}function Te(e,n){var t=f("works",n),r=u.useState(Symbol()),o=r[0],a=r[1],i=u.useMemo(function(){if(t)return e.works},[e,o]);return u.useLayoutEffect(function(){if(t)return e.on("load",function(){return a(Symbol())})},[e]),[i,o]}function Ne(e,n){var t=f("model",n),r=u.useState(Symbol()),o=r[0],a=r[1],i=u.useMemo(function(){if(t)return e.model},[e,o]);return u.useLayoutEffect(function(){if(t)return e.on("modelLoaded",function(){return a(Symbol())})},[e]),[i,o]}function $e(e,n){var t=f("scene",n);return[t?e.scene:void 0]}function He(e,n){var t=f("cameraDirection",n),r=u.useState(Symbol()),o=r[0],a=r[1],i=u.useMemo(function(){if(t)return e.camera.getWorldDirection(new p.Vector3)},[e,o]);return u.useLayoutEffect(function(){if(t)return e.on("cameraUpdate",function(){return a(Symbol())})},[e]),[i,o]}function Be(e,n){var t=f("cameraRaycaster",n),r=u.useState(Symbol()),o=r[0],a=r[1],i=u.useMemo(function(){if(t){var s=e.camera.getWorldDirection(new p.Vector3),c=new p.Raycaster(e.camera.position,s);return c}},[e,o]);return u.useLayoutEffect(function(){if(t)return e.on("cameraUpdate",function(){return a(Symbol())})},[e]),[i,o]}function Ie(e,n){var t=f("modelReadyState",n),r=u.useState(Symbol()),o=r[0],a=r[1],i=u.useMemo(function(){if(t)return e.model.empty?"Empty":"Loaded"},[e,o]);return u.useLayoutEffect(function(){if(t)return e.on("modelLoaded",function(){return a(Symbol())})},[e]),[i,o]}function Ge(e,n){var t=f("shownFloor",n),r=u.useState(Symbol()),o=r[0],a=r[1],i=u.useMemo(function(){if(t)return e.model.shownFloor},[e,o]);return u.useLayoutEffect(function(){if(t)return e.on("modelShownFloorChange",function(){return a(Symbol())})},[e]),[i,o]}function qe(e,n){var t=f("helperVisible",n),r=u.useState(Symbol()),o=r[0],a=r[1],i=u.useMemo(function(){if(t)return e.helperVisible},[e,o]);return u.useLayoutEffect(function(){if(t)return e.on("helpersVisibleChange",function(){return a(Symbol())})},[e]),[i,o]}function Ae(e,n){if(f("loadWork",n))return e}function ze(e,n){if(f("setState",n))return function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return e.setState.apply(e,t)}}function Je(e,n){if(f("on",n))return function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return e.on.apply(e,t)}}function Ke(e,n){if(f("on",n))return function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return e.once.apply(e,t)}}function Qe(e,n){if(f("off",n))return function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return e.off.apply(e,t)}}function Xe(e,n){if(f("intersectRaycaster",n))return function(){for(var t,r=[],o=0;o<arguments.length;o++)r[o]=arguments[o];return(t=e.model).intersectRaycaster.apply(t,r)}}function Ye(e,n){if(f("project2d",n))return function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return e.project2d.apply(e,t)}}function Ze(e,n){if(f("updateCamera",n))return function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return e.updateCamera.apply(e,t)}}function er(e,n){if(f("getPixels",n))return e.getPixels.bind(e)}function rr(e,n){if(f("render",n))return function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return e.render.apply(e,t)}}function tr(e,n){if(f("needsRender",n))return function(){e.needsRender=!0}}function nr(e,n){if(f("preloadPano",n))return function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return e.preloadPano.apply(e,t)}}function or(e,n){if(f("showFloor",n))return function(t){typeof t=="number"?e.model.show(t):e.model.show()}}function ar(e,n){if(f("toggleHelperVisible",n))return function(t){e.helperVisible=t}}function ur(e){return function(n){return u.forwardRef(function(t,r){var o=v(),a=G(),i=Ue(o,e)[0],s=We(o,e),c=s[0],l=s[1],d=Me(o,e),y=d[0],g=d[1],S=je(o,e),b=S[0],C=S[1],_=Te(o,e),z=_[0],J=_[1],P=Ne(o,e),K=P[0],Q=P[1],X=$e(o,e)[0],V=He(o,e),Y=V[0],Z=V[1],O=Be(o,e),ee=O[0],re=O[1],D=Ie(o,e),te=D[0],ne=D[1],x=Ge(o,e),oe=x[0],ae=x[1],W=qe(o,e),ue=W[0],ie=W[1],M=u.useMemo(function(){var m={};return H(m,{setState:ze(o,e),loadWork:Ae(a,e),on:Je(o,e),once:Ke(o,e),off:Qe(o,e),intersectRaycaster:Xe(o,e),project2d:Ye(o,e),updateCamera:Ze(o,e),getPixels:er(o,e),render:rr(o,e),needsRender:tr(o,e),preloadPano:nr(o,e),showFloor:or(o,e),toggleHelperVisible:ar(o,e)}),m},[o,a]),se=u.useMemo(function(){var m=h({},M);return H(m,{unsafe__fiveInstance:i,state:c,currentState:y,currentObserver:b,work:z,model:K,scene:X,cameraDirection:Y,cameraRaycaster:ee,modelReadyState:te,shownFloor:oe,helperVisible:ue}),m},[o,M,l,g,C,J,Q,Z,re,ne,ae,ie]);return u.createElement(n,h({ref:r,$five:se},t))})}}function ir(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return e}function F(e,n){for(var t={},r=n.length,o=-1;++o<r;){var a=n[o];a in e&&(t[a]=e[a])}return t}function sr(e,n){return typeof e=="number"&&typeof n=="number"&&isNaN(e)&&isNaN(n)?!0:e===n}function cr(e,n){for(var t=0;t<e.length;t++)for(var r=0;r<n.length;r++)if(e[t]===n[r])return!0;return!1}var A=(function(){function e(n,t){this.values=n,this.listeners=[],this.onValuesChange=t}return e.prototype.on=function(n,t){var r=this,o=[n,t];return this.listeners.push(o),function(){var a=r.listeners.indexOf(o);a>=0&&r.listeners.splice(a,1)}},e.prototype.getValues=function(n){return F(this.values,n)},e.prototype.setValues=function(n,t){var r=[];for(var o in t)n.indexOf(o)>=0&&!sr(t[o],this.values[o])&&r.push(o);if(r.length!==0){for(var a=h({},this.values),i=0,s=r;i<s.length;i++){var c=s[i];this.values[c]=t[c]}this.onValuesChange&&this.onValuesChange(this.values,a);for(var l=0,d=this.listeners;l<d.length;l++){var y=d[l],g=y[0],S=y[1];if(cr(g,r)){var b=F(a,g),C=F(this.values,g);S(C,b)}}}},e})();function fr(e){var n=u.createContext(null);return{useStore:function(t){var r=u.useContext(n);if(r===null)throw new Error("StoreProvider never found.");var o=u.useRef(!0),a=u.useState(r.getValues(t)),i=a[0],s=a[1],c=w([r],t,!0);u.useLayoutEffect(function(){return o.current?o.current=!1:s(r.getValues(t)),r.on(t,function(d){return s(d)})},c);var l=u.useCallback(function(d){return r.setValues(t,d)},c);return[i,l]},useStoreSetter:function(t){var r=u.useContext(n);if(r===null)throw new Error("StoreProvider never found.");var o=u.useCallback(function(a){return r.setValues(t,a)},w([r],t,!0));return o},watchStore:function(t,r,o){var a=u.useContext(n);if(a===null)throw new Error("StoreProvider never found.");var i=w([a],t,!0);o!==void 0&&(i=i.concat(o)),u.useLayoutEffect(function(){return a.on(t,r)},i)},useStoreAction:function(t){var r=u.useContext(n);if(r===null)throw new Error("StoreProvider never found.");var o=u.useCallback(function(){for(var a=[],i=0;i<arguments.length;i++)a[i]=arguments[i];var s=e[t],c=s[0],l=s.slice(1),d=function(){return r.getValues(l)},y=function(g){return r.setValues(l,g)};return c.apply(void 0,w([d,y],a,!1))},[]);return o},StoreProvider:(function(t){I(r,t);function r(o){var a=t.call(this,o)||this;return a.store=new A(o.initialValue,function(){for(var i,s=[],c=0;c<arguments.length;c++)s[c]=arguments[c];a.props.onValuesChange&&(i=a.props).onValuesChange.apply(i,s)}),a}return r.prototype.shouldComponentUpdate=function(o){return o.children!==this.props.children},r.prototype.render=function(){return u.createElement(n.Provider,{value:this.store},this.props.children)},r})(u.Component)}}exports.FiveCanvas=ye;exports.INJECTION_PROPNAME=xe;exports.Store=A;exports.createFiveFeature=ir;exports.createFiveProvider=pe;exports.createStore=fr;exports.unsafe__useFiveInstance=me;exports.useFiveAction=ke;exports.useFiveCameraDirection=_e;exports.useFiveCameraRaycaster=Le;exports.useFiveCurrentObserver=Fe;exports.useFiveCurrentState=Ce;exports.useFiveEventCallback=Ee;exports.useFiveFloor=Oe;exports.useFiveHelper=De;exports.useFiveModelIntersectRaycaster=Pe;exports.useFiveModelReadyState=Ve;exports.useFiveProject2d=Re;exports.useFiveScene=Se;exports.useFiveSceneEffect=q;exports.useFiveState=be;exports.useFiveWork=we;exports.withFive=ur;
|
package/react/index.mjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @license
|
|
3
3
|
* @realsee/five
|
|
4
|
-
* Generated: 8/
|
|
5
|
-
* Version: 6.6.0-alpha.
|
|
4
|
+
* Generated: 2025/8/15
|
|
5
|
+
* Version: 6.6.0-alpha.2
|
|
6
6
|
* Terms:
|
|
7
7
|
* Realsee SDK License Agreement
|
|
8
8
|
* Update: July 28, 2021
|
|
@@ -331,7 +331,7 @@ function ce(e, n) {
|
|
|
331
331
|
}
|
|
332
332
|
function Ge(e) {
|
|
333
333
|
return e === void 0 && (e = {}), /** @class */
|
|
334
|
-
function(n) {
|
|
334
|
+
(function(n) {
|
|
335
335
|
B(t, n);
|
|
336
336
|
function t(r) {
|
|
337
337
|
var o = n.call(this, r) || this;
|
|
@@ -379,7 +379,7 @@ function Ge(e) {
|
|
|
379
379
|
value: { renderer: a, five: r, loadWork: o }
|
|
380
380
|
}, this.props.children);
|
|
381
381
|
}, t;
|
|
382
|
-
}(u.Component);
|
|
382
|
+
})(u.Component);
|
|
383
383
|
}
|
|
384
384
|
var fe = typeof window != "undefined" ? u.useLayoutEffect : u.useEffect, le = {
|
|
385
385
|
display: "inline-block",
|
|
@@ -884,7 +884,7 @@ function $e(e, n) {
|
|
|
884
884
|
}
|
|
885
885
|
var Be = (
|
|
886
886
|
/** @class */
|
|
887
|
-
function() {
|
|
887
|
+
(function() {
|
|
888
888
|
function e(n, t) {
|
|
889
889
|
this.values = n, this.listeners = [], this.onValuesChange = t;
|
|
890
890
|
}
|
|
@@ -915,7 +915,7 @@ var Be = (
|
|
|
915
915
|
}
|
|
916
916
|
}
|
|
917
917
|
}, e;
|
|
918
|
-
}()
|
|
918
|
+
})()
|
|
919
919
|
);
|
|
920
920
|
function cr(e) {
|
|
921
921
|
var n = u.createContext(null);
|
|
@@ -991,7 +991,7 @@ function cr(e) {
|
|
|
991
991
|
*/
|
|
992
992
|
StoreProvider: (
|
|
993
993
|
/** @class */
|
|
994
|
-
function(t) {
|
|
994
|
+
(function(t) {
|
|
995
995
|
B(r, t);
|
|
996
996
|
function r(o) {
|
|
997
997
|
var a = t.call(this, o) || this;
|
|
@@ -1006,7 +1006,7 @@ function cr(e) {
|
|
|
1006
1006
|
}, r.prototype.render = function() {
|
|
1007
1007
|
return u.createElement(n.Provider, { value: this.store }, this.props.children);
|
|
1008
1008
|
}, r;
|
|
1009
|
-
}(u.Component)
|
|
1009
|
+
})(u.Component)
|
|
1010
1010
|
)
|
|
1011
1011
|
};
|
|
1012
1012
|
}
|