@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/umd/five-react.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
|
-
*/(function(f,S){typeof exports=="object"&&typeof module!="undefined"?S(exports,require("react"),require("three"),require("@realsee/five")):typeof define=="function"&&define.amd?define(["exports","react","three","@realsee/five"],S):(f=typeof globalThis!="undefined"?globalThis:f||self,S(f.FiveSDK_React={},f.React,f.THREE,f.FiveSDK))})(this,function(f,S,K,V){"use strict";function O(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=O(S),h=O(K);var C=function(e,n){return C=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,r){t.__proto__=r}||function(t,r){for(var a in r)Object.prototype.hasOwnProperty.call(r,a)&&(t[a]=r[a])},C(e,n)};function D(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");C(e,n);function t(){this.constructor=e}e.prototype=n===null?Object.create(n):(t.prototype=n.prototype,new t)}var g=function(){return g=Object.assign||function(n){for(var t,r=1,a=arguments.length;r<a;r++){t=arguments[r];for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(n[o]=t[o])}return n},g.apply(this,arguments)};function b(e,n,t){if(t||arguments.length===2)for(var r=0,a=n.length,o;r<a;r++)(o||!(r in n))&&(o||(o=Array.prototype.slice.call(n,0,r)),o[r]=n[r]);return e.concat(o||Array.prototype.slice.call(n))}typeof SuppressedError=="function"&&SuppressedError;var E=[],k=[];function Q(e){var n=e===void 0?{}:e,t=n.preserveDrawingBuffer,r=t===void 0?!0:t,a=n.webgl2,o=a===void 0?!1:a;if(typeof window!="undefined"){var i=null;if(o?i=E.shift():i=k.shift(),!i){if(o){var s=document.createElement("canvas"),c=s.getContext("webgl2");c?i=new h.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 h.WebGLRenderer({preserveDrawingBuffer:r,antialias:!1,alpha:!0,stencil:!0}))}else i=new h.WebGLRenderer({preserveDrawingBuffer:r,antialias:!1,alpha:!0,stencil:!0});i.outputEncoding=h.sRGBEncoding}return i.autoClear=!0,i}}function X(e){if(e){var n=e.capabilities.isWebGL2;n?k.indexOf(e)===-1&&k.push(e):E.indexOf(e)===-1&&E.push(e)}}var R=u.createContext(null);function d(){var e=u.useContext(R);if(!e)throw new Error("FiveProvider never found.");return e.five}function W(){var e=u.useContext(R);if(!e)throw new Error("FiveProvider never found.");return e.loadWork}function Y(e,n){var t=Array.isArray(e)?e:[e],r=Array.isArray(n)?n:[n];if(t.length!==r.length)return!1;for(var a=0;a<t.length;a++)if(t[a].workCode!==r[a].workCode)return!1;return!0}function Z(e){return e===void 0&&(e={}),function(n){D(t,n);function t(r){var a=n.call(this,r)||this;return a.__fiveEventDisposers=[],a.__fiveDisposeTimer=null,a.five=new V.Five(g(g({},e),{renderer:void 0})),a.loadWork=a.loadWork.bind(a),a.state={},a}return t.prototype.loadWork=function(r,a,o,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,a,o,i)},t.prototype.shouldComponentUpdate=function(r){return this.five.renderer&&this.five&&r.work&&!Y(r.work,this.five.works)&&this.five.load(r.work,r.initialState,r.initialOptions),!0},t.prototype.componentDidMount=function(){var r=this,a;clearTimeout(this.__fiveDisposeTimer),this.__fiveDisposeTimer=null;var o;if(typeof window!="undefined"){o=Q({webgl2:e==null?void 0:e.webgl2,preserveDrawingBuffer:e==null?void 0:e.preserveDrawingBuffer});var i=V.getViewportScale(),s=i===1?window.devicePixelRatio:1;o==null||o.setPixelRatio(s)}this.five.renderer=o,this.setState({renderer:o}),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(v,p){r.props.onStateChange&&r.props.onStateChange(v,p)})),this.__fiveEventDisposers.push(this.five.on("currentStateChange",function(v,p){r.props.onCurrentStateChange&&r.props.onCurrentStateChange(v,p)})),this.__fiveEventDisposers.push(this.five.on("error",function(v){r.props.onError?r.props.onError(v):console.warn(v.message)}));var c=this.props.work||this.props.initialWork;c&&this.five.load(c,this.props.initialState,this.props.initialOptions,(a=this.props.initialUserAction)!==null&&a!==void 0?a:!0)},t.prototype.componentWillUnmount=function(){var r=this,a;(a=this.five.controller)===null||a===void 0||a.destroy();var o=this.five.renderer;this.five.renderer=void 0,X(o),this.setState({renderer:void 0}),this.__fiveDisposeTimer=setTimeout(function(){r.__fiveDisposeTimer=null,r.five.dispose()},1e3)},t.prototype.render=function(){var r=this.five,a=this.loadWork,o=this.state.renderer;return u.createElement(R.Provider,{value:{renderer:o,five:r,loadWork:a}},this.props.children)},t}(u.Component)}var ee=typeof window!="undefined"?u.useLayoutEffect:u.useEffect,re={display:"inline-block",overflow:"hidden"},te=function(e){var n=e.width,t=e.height,r=d(),a=u.createRef(),o=g({width:n,height:t},re);return ee(function(){var i=a.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,a.current]),u.createElement("div",{ref:a,style:o})};function ne(){return d()}function M(e,n){var t=d(),r=[t];n!==void 0&&(r=r.concat(n)),u.useLayoutEffect(function(){return e(t.scene)},r)}var ae=M;function oe(){var e=d(),n=W(),t=u.useState(function(){return e.works}),r=t[0],a=t[1];return u.useLayoutEffect(function(){return e.on("load",function(){return a(e.works)})},[e]),[r,n]}function j(e){return g({},e.state)}function ue(){var e=d(),n=u.useState(function(){return j(e)}),t=n[0],r=n[1],a=u.useCallback(function(o,i,s){i===void 0&&(i=!1),s===void 0&&(s=!0);var c=typeof o=="function"?o(e.getCurrentState()):o;e.setState(c,i,s)},[e]);return u.useLayoutEffect(function(){return e.on("stateChange",function(){return r(j(e))})},[e]),[t,a]}function ie(){var e=d(),n=u.useState(function(){return e.getCurrentState()}),t=n[0],r=n[1],a=u.useCallback(function(o,i,s){i===void 0&&(i=!1),s===void 0&&(s=!0);var c=typeof o=="function"?o(e.getCurrentState()):o;e.setState(c,i,s)},[e]);return u.useLayoutEffect(function(){return e.on("currentStateChange",function(){return r(e.getCurrentState())})},[e]),[t,a]}function se(){var e=d(),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 ce(e,n,t){var r=d(),a=[r,e];t!==void 0&&(a=a.concat(t)),u.useLayoutEffect(function(){return r.on(e,n)},a)}function fe(){var e=d(),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]),a=u.useCallback(function(){return e.needsRender=!0},[e]),o=u.useCallback(function(i,s){return e.preloadPano(i,s)},[e]);return{updateCamera:n,getPixels:t,render:r,needsRender:a,preloadPano:o}}function le(){var e=d(),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(a,o){return e.project2d(a,o)},[e]);return r}function U(e){var n=e.camera.getWorldDirection(new h.Vector3),t=new h.Raycaster(e.camera.position,n);return t}function ve(){var e=d(),n=u.useState(function(){return U(e)}),t=n[0],r=n[1];return u.useLayoutEffect(function(){return e.on("cameraUpdate",function(){return r(U(e))})},[e]),t}function T(e){return e.camera.getWorldDirection(new h.Vector3)}function de(){var e=d(),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 pe(){var e=d(),n=u.useCallback(function(t){return e.model.intersectRaycaster(t)},[e]);return n}function N(e){return e.model.empty?"Empty":"Loaded"}function he(){var e=d(),n=u.useState(function(){return N(e)}),t=n[0],r=n[1];return u.useLayoutEffect(function(){return e.on("modelLoaded",function(){return r(N(e))})},[e]),t}function ge(){var e=d(),n=u.useState(e.model.shownFloor),t=n[0],r=n[1],a=u.useState(e.model.floorLength),o=a[0],i=a[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 v;v=c.shift();)v()}},[e]),[t,o,s]}function ye(){var e=d(),n=u.useState(e.helperVisible),t=n[0],r=n[1],a=u.useCallback(function(o){e.helperVisible=o},[e]);return u.useLayoutEffect(function(){return e.on("helpersVisibleChange",function(o){return r(o)})},[e]),[t,a]}var me="$five";function l(e,n){return n.indexOf(e)>=0}function x(e,n){for(var t=0,r=Object.keys(n);t<r.length;t++){var a=r[t];n[a]!==void 0&&(e[a]=n[a])}}function Se(e,n){var t=l("state",n),r=u.useState(Symbol()),a=r[0],o=r[1],i=u.useMemo(function(){if(t)return g({},e.state)},[e,a]);return u.useLayoutEffect(function(){if(t)return e.on("stateChange",function(){return o(Symbol())})},[e]),[i,a]}function we(e,n){var t=l("currentState",n),r=u.useState(Symbol()),a=r[0],o=r[1],i=u.useMemo(function(){if(t)return e.getCurrentState()},[e,a]);return u.useLayoutEffect(function(){if(t)return e.on("currentStateChange",function(){return o(Symbol())})},[e]),[i,a]}function be(e,n){var t=l("currentObserver",n),r=u.useState(Symbol()),a=r[0],o=r[1],i=u.useMemo(function(){if(t)return e.getCurrentState()},[e,a]);u.useLayoutEffect(function(){if(t)return e.on("currentStateChange",function(){return o(Symbol())})},[e]);var s=void 0;return i&&(s=e.works.getObserver(i)),[s,a]}function Fe(e,n){var t=l("unsafe__fiveInstance",n);return[t?e:void 0]}function Ce(e,n){var t=l("works",n),r=u.useState(Symbol()),a=r[0],o=r[1],i=u.useMemo(function(){if(t)return e.works},[e,a]);return u.useLayoutEffect(function(){if(t)return e.on("load",function(){return o(Symbol())})},[e]),[i,a]}function Ee(e,n){var t=l("model",n),r=u.useState(Symbol()),a=r[0],o=r[1],i=u.useMemo(function(){if(t)return e.model},[e,a]);return u.useLayoutEffect(function(){if(t)return e.on("modelLoaded",function(){return o(Symbol())})},[e]),[i,a]}function ke(e,n){var t=l("scene",n);return[t?e.scene:void 0]}function Re(e,n){var t=l("cameraDirection",n),r=u.useState(Symbol()),a=r[0],o=r[1],i=u.useMemo(function(){if(t)return e.camera.getWorldDirection(new h.Vector3)},[e,a]);return u.useLayoutEffect(function(){if(t)return e.on("cameraUpdate",function(){return o(Symbol())})},[e]),[i,a]}function Le(e,n){var t=l("cameraRaycaster",n),r=u.useState(Symbol()),a=r[0],o=r[1],i=u.useMemo(function(){if(t){var s=e.camera.getWorldDirection(new h.Vector3),c=new h.Raycaster(e.camera.position,s);return c}},[e,a]);return u.useLayoutEffect(function(){if(t)return e.on("cameraUpdate",function(){return o(Symbol())})},[e]),[i,a]}function _e(e,n){var t=l("modelReadyState",n),r=u.useState(Symbol()),a=r[0],o=r[1],i=u.useMemo(function(){if(t)return e.model.empty?"Empty":"Loaded"},[e,a]);return u.useLayoutEffect(function(){if(t)return e.on("modelLoaded",function(){return o(Symbol())})},[e]),[i,a]}function Pe(e,n){var t=l("shownFloor",n),r=u.useState(Symbol()),a=r[0],o=r[1],i=u.useMemo(function(){if(t)return e.model.shownFloor},[e,a]);return u.useLayoutEffect(function(){if(t)return e.on("modelShownFloorChange",function(){return o(Symbol())})},[e]),[i,a]}function Ve(e,n){var t=l("helperVisible",n),r=u.useState(Symbol()),a=r[0],o=r[1],i=u.useMemo(function(){if(t)return e.helperVisible},[e,a]);return u.useLayoutEffect(function(){if(t)return e.on("helpersVisibleChange",function(){return o(Symbol())})},[e]),[i,a]}function Oe(e,n){if(l("loadWork",n))return e}function De(e,n){if(l("setState",n))return function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return e.setState.apply(e,t)}}function We(e,n){if(l("on",n))return function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return e.on.apply(e,t)}}function Me(e,n){if(l("on",n))return function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return e.once.apply(e,t)}}function je(e,n){if(l("off",n))return function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return e.off.apply(e,t)}}function Ue(e,n){if(l("intersectRaycaster",n))return function(){for(var t,r=[],a=0;a<arguments.length;a++)r[a]=arguments[a];return(t=e.model).intersectRaycaster.apply(t,r)}}function Te(e,n){if(l("project2d",n))return function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return e.project2d.apply(e,t)}}function Ne(e,n){if(l("updateCamera",n))return function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return e.updateCamera.apply(e,t)}}function xe(e,n){if(l("getPixels",n))return e.getPixels.bind(e)}function $e(e,n){if(l("render",n))return function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return e.render.apply(e,t)}}function He(e,n){if(l("needsRender",n))return function(){e.needsRender=!0}}function Be(e,n){if(l("preloadPano",n))return function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return e.preloadPano.apply(e,t)}}function Ie(e,n){if(l("showFloor",n))return function(t){typeof t=="number"?e.model.show(t):e.model.show()}}function Ge(e,n){if(l("toggleHelperVisible",n))return function(t){e.helperVisible=t}}function qe(e){return function(n){return u.forwardRef(function(t,r){var a=d(),o=W(),i=Fe(a,e)[0],s=Se(a,e),c=s[0],v=s[1],p=we(a,e),m=p[0],y=p[1],F=be(a,e),_=F[0],P=F[1],H=Ce(a,e),Qe=H[0],Xe=H[1],B=Ee(a,e),Ye=B[0],Ze=B[1],er=ke(a,e)[0],I=Re(a,e),rr=I[0],tr=I[1],G=Le(a,e),nr=G[0],ar=G[1],q=_e(a,e),or=q[0],ur=q[1],A=Pe(a,e),ir=A[0],sr=A[1],z=Ve(a,e),cr=z[0],fr=z[1],J=u.useMemo(function(){var w={};return x(w,{setState:De(a,e),loadWork:Oe(o,e),on:We(a,e),once:Me(a,e),off:je(a,e),intersectRaycaster:Ue(a,e),project2d:Te(a,e),updateCamera:Ne(a,e),getPixels:xe(a,e),render:$e(a,e),needsRender:He(a,e),preloadPano:Be(a,e),showFloor:Ie(a,e),toggleHelperVisible:Ge(a,e)}),w},[a,o]),lr=u.useMemo(function(){var w=g({},J);return x(w,{unsafe__fiveInstance:i,state:c,currentState:m,currentObserver:_,work:Qe,model:Ye,scene:er,cameraDirection:rr,cameraRaycaster:nr,modelReadyState:or,shownFloor:ir,helperVisible:cr}),w},[a,J,v,y,P,Xe,Ze,tr,ar,ur,sr,fr]);return u.createElement(n,g({ref:r,$five:lr},t))})}}function Ae(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return e}function L(e,n){for(var t={},r=n.length,a=-1;++a<r;){var o=n[a];o in e&&(t[o]=e[o])}return t}function ze(e,n){return typeof e=="number"&&typeof n=="number"&&isNaN(e)&&isNaN(n)?!0:e===n}function Je(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 $=function(){function e(n,t){this.values=n,this.listeners=[],this.onValuesChange=t}return e.prototype.on=function(n,t){var r=this,a=[n,t];return this.listeners.push(a),function(){var o=r.listeners.indexOf(a);o>=0&&r.listeners.splice(o,1)}},e.prototype.getValues=function(n){return L(this.values,n)},e.prototype.setValues=function(n,t){var r=[];for(var a in t)n.indexOf(a)>=0&&!ze(t[a],this.values[a])&&r.push(a);if(r.length!==0){for(var o=g({},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,o);for(var v=0,p=this.listeners;v<p.length;v++){var m=p[v],y=m[0],F=m[1];if(Je(y,r)){var _=L(o,y),P=L(this.values,y);F(P,_)}}}},e}();function Ke(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 a=u.useRef(!0),o=u.useState(r.getValues(t)),i=o[0],s=o[1],c=b([r],t,!0);u.useLayoutEffect(function(){return a.current?a.current=!1:s(r.getValues(t)),r.on(t,function(p){return s(p)})},c);var v=u.useCallback(function(p){return r.setValues(t,p)},c);return[i,v]},useStoreSetter:function(t){var r=u.useContext(n);if(r===null)throw new Error("StoreProvider never found.");var a=u.useCallback(function(o){return r.setValues(t,o)},b([r],t,!0));return a},watchStore:function(t,r,a){var o=u.useContext(n);if(o===null)throw new Error("StoreProvider never found.");var i=b([o],t,!0);a!==void 0&&(i=i.concat(a)),u.useLayoutEffect(function(){return o.on(t,r)},i)},useStoreAction:function(t){var r=u.useContext(n);if(r===null)throw new Error("StoreProvider never found.");var a=u.useCallback(function(){for(var o=[],i=0;i<arguments.length;i++)o[i]=arguments[i];var s=e[t],c=s[0],v=s.slice(1),p=function(){return r.getValues(v)},m=function(y){return r.setValues(v,y)};return c.apply(void 0,b([p,m],o,!1))},[]);return a},StoreProvider:function(t){D(r,t);function r(a){var o=t.call(this,a)||this;return o.store=new $(a.initialValue,function(){for(var i,s=[],c=0;c<arguments.length;c++)s[c]=arguments[c];o.props.onValuesChange&&(i=o.props).onValuesChange.apply(i,s)}),o}return r.prototype.shouldComponentUpdate=function(a){return a.children!==this.props.children},r.prototype.render=function(){return u.createElement(n.Provider,{value:this.store},this.props.children)},r}(u.Component)}}f.FiveCanvas=te,f.INJECTION_PROPNAME=me,f.Store=$,f.createFiveFeature=Ae,f.createFiveProvider=Z,f.createStore=Ke,f.unsafe__useFiveInstance=ne,f.useFiveAction=fe,f.useFiveCameraDirection=de,f.useFiveCameraRaycaster=ve,f.useFiveCurrentObserver=se,f.useFiveCurrentState=ie,f.useFiveEventCallback=ce,f.useFiveFloor=ge,f.useFiveHelper=ye,f.useFiveModelIntersectRaycaster=pe,f.useFiveModelReadyState=he,f.useFiveProject2d=le,f.useFiveScene=ae,f.useFiveSceneEffect=M,f.useFiveState=ue,f.useFiveWork=oe,f.withFive=qe,Object.defineProperty(f,Symbol.toStringTag,{value:"Module"})});
|
|
255
|
+
*/(function(f,S){typeof exports=="object"&&typeof module!="undefined"?S(exports,require("react"),require("three"),require("@realsee/five")):typeof define=="function"&&define.amd?define(["exports","react","three","@realsee/five"],S):(f=typeof globalThis!="undefined"?globalThis:f||self,S(f.FiveSDK_React={},f.React,f.THREE,f.FiveSDK))})(this,(function(f,S,K,V){"use strict";function O(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=O(S),h=O(K);var C=function(e,n){return C=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,r){t.__proto__=r}||function(t,r){for(var a in r)Object.prototype.hasOwnProperty.call(r,a)&&(t[a]=r[a])},C(e,n)};function D(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");C(e,n);function t(){this.constructor=e}e.prototype=n===null?Object.create(n):(t.prototype=n.prototype,new t)}var g=function(){return g=Object.assign||function(n){for(var t,r=1,a=arguments.length;r<a;r++){t=arguments[r];for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(n[o]=t[o])}return n},g.apply(this,arguments)};function b(e,n,t){if(t||arguments.length===2)for(var r=0,a=n.length,o;r<a;r++)(o||!(r in n))&&(o||(o=Array.prototype.slice.call(n,0,r)),o[r]=n[r]);return e.concat(o||Array.prototype.slice.call(n))}typeof SuppressedError=="function"&&SuppressedError;var E=[],k=[];function Q(e){var n=e===void 0?{}:e,t=n.preserveDrawingBuffer,r=t===void 0?!0:t,a=n.webgl2,o=a===void 0?!1:a;if(typeof window!="undefined"){var i=null;if(o?i=E.shift():i=k.shift(),!i){if(o){var s=document.createElement("canvas"),c=s.getContext("webgl2");c?i=new h.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 h.WebGLRenderer({preserveDrawingBuffer:r,antialias:!1,alpha:!0,stencil:!0}))}else i=new h.WebGLRenderer({preserveDrawingBuffer:r,antialias:!1,alpha:!0,stencil:!0});i.outputEncoding=h.sRGBEncoding}return i.autoClear=!0,i}}function X(e){if(e){var n=e.capabilities.isWebGL2;n?k.indexOf(e)===-1&&k.push(e):E.indexOf(e)===-1&&E.push(e)}}var R=u.createContext(null);function d(){var e=u.useContext(R);if(!e)throw new Error("FiveProvider never found.");return e.five}function W(){var e=u.useContext(R);if(!e)throw new Error("FiveProvider never found.");return e.loadWork}function Y(e,n){var t=Array.isArray(e)?e:[e],r=Array.isArray(n)?n:[n];if(t.length!==r.length)return!1;for(var a=0;a<t.length;a++)if(t[a].workCode!==r[a].workCode)return!1;return!0}function Z(e){return e===void 0&&(e={}),(function(n){D(t,n);function t(r){var a=n.call(this,r)||this;return a.__fiveEventDisposers=[],a.__fiveDisposeTimer=null,a.five=new V.Five(g(g({},e),{renderer:void 0})),a.loadWork=a.loadWork.bind(a),a.state={},a}return t.prototype.loadWork=function(r,a,o,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,a,o,i)},t.prototype.shouldComponentUpdate=function(r){return this.five.renderer&&this.five&&r.work&&!Y(r.work,this.five.works)&&this.five.load(r.work,r.initialState,r.initialOptions),!0},t.prototype.componentDidMount=function(){var r=this,a;clearTimeout(this.__fiveDisposeTimer),this.__fiveDisposeTimer=null;var o;if(typeof window!="undefined"){o=Q({webgl2:e==null?void 0:e.webgl2,preserveDrawingBuffer:e==null?void 0:e.preserveDrawingBuffer});var i=V.getViewportScale(),s=i===1?window.devicePixelRatio:1;o==null||o.setPixelRatio(s)}this.five.renderer=o,this.setState({renderer:o}),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(v,p){r.props.onStateChange&&r.props.onStateChange(v,p)})),this.__fiveEventDisposers.push(this.five.on("currentStateChange",function(v,p){r.props.onCurrentStateChange&&r.props.onCurrentStateChange(v,p)})),this.__fiveEventDisposers.push(this.five.on("error",function(v){r.props.onError?r.props.onError(v):console.warn(v.message)}));var c=this.props.work||this.props.initialWork;c&&this.five.load(c,this.props.initialState,this.props.initialOptions,(a=this.props.initialUserAction)!==null&&a!==void 0?a:!0)},t.prototype.componentWillUnmount=function(){var r=this,a;(a=this.five.controller)===null||a===void 0||a.destroy();var o=this.five.renderer;this.five.renderer=void 0,X(o),this.setState({renderer:void 0}),this.__fiveDisposeTimer=setTimeout(function(){r.__fiveDisposeTimer=null,r.five.dispose()},1e3)},t.prototype.render=function(){var r=this.five,a=this.loadWork,o=this.state.renderer;return u.createElement(R.Provider,{value:{renderer:o,five:r,loadWork:a}},this.props.children)},t})(u.Component)}var ee=typeof window!="undefined"?u.useLayoutEffect:u.useEffect,re={display:"inline-block",overflow:"hidden"},te=function(e){var n=e.width,t=e.height,r=d(),a=u.createRef(),o=g({width:n,height:t},re);return ee(function(){var i=a.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,a.current]),u.createElement("div",{ref:a,style:o})};function ne(){return d()}function M(e,n){var t=d(),r=[t];n!==void 0&&(r=r.concat(n)),u.useLayoutEffect(function(){return e(t.scene)},r)}var ae=M;function oe(){var e=d(),n=W(),t=u.useState(function(){return e.works}),r=t[0],a=t[1];return u.useLayoutEffect(function(){return e.on("load",function(){return a(e.works)})},[e]),[r,n]}function j(e){return g({},e.state)}function ue(){var e=d(),n=u.useState(function(){return j(e)}),t=n[0],r=n[1],a=u.useCallback(function(o,i,s){i===void 0&&(i=!1),s===void 0&&(s=!0);var c=typeof o=="function"?o(e.getCurrentState()):o;e.setState(c,i,s)},[e]);return u.useLayoutEffect(function(){return e.on("stateChange",function(){return r(j(e))})},[e]),[t,a]}function ie(){var e=d(),n=u.useState(function(){return e.getCurrentState()}),t=n[0],r=n[1],a=u.useCallback(function(o,i,s){i===void 0&&(i=!1),s===void 0&&(s=!0);var c=typeof o=="function"?o(e.getCurrentState()):o;e.setState(c,i,s)},[e]);return u.useLayoutEffect(function(){return e.on("currentStateChange",function(){return r(e.getCurrentState())})},[e]),[t,a]}function se(){var e=d(),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 ce(e,n,t){var r=d(),a=[r,e];t!==void 0&&(a=a.concat(t)),u.useLayoutEffect(function(){return r.on(e,n)},a)}function fe(){var e=d(),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]),a=u.useCallback(function(){return e.needsRender=!0},[e]),o=u.useCallback(function(i,s){return e.preloadPano(i,s)},[e]);return{updateCamera:n,getPixels:t,render:r,needsRender:a,preloadPano:o}}function le(){var e=d(),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(a,o){return e.project2d(a,o)},[e]);return r}function U(e){var n=e.camera.getWorldDirection(new h.Vector3),t=new h.Raycaster(e.camera.position,n);return t}function ve(){var e=d(),n=u.useState(function(){return U(e)}),t=n[0],r=n[1];return u.useLayoutEffect(function(){return e.on("cameraUpdate",function(){return r(U(e))})},[e]),t}function T(e){return e.camera.getWorldDirection(new h.Vector3)}function de(){var e=d(),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 pe(){var e=d(),n=u.useCallback(function(t){return e.model.intersectRaycaster(t)},[e]);return n}function N(e){return e.model.empty?"Empty":"Loaded"}function he(){var e=d(),n=u.useState(function(){return N(e)}),t=n[0],r=n[1];return u.useLayoutEffect(function(){return e.on("modelLoaded",function(){return r(N(e))})},[e]),t}function ge(){var e=d(),n=u.useState(e.model.shownFloor),t=n[0],r=n[1],a=u.useState(e.model.floorLength),o=a[0],i=a[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 v;v=c.shift();)v()}},[e]),[t,o,s]}function ye(){var e=d(),n=u.useState(e.helperVisible),t=n[0],r=n[1],a=u.useCallback(function(o){e.helperVisible=o},[e]);return u.useLayoutEffect(function(){return e.on("helpersVisibleChange",function(o){return r(o)})},[e]),[t,a]}var me="$five";function l(e,n){return n.indexOf(e)>=0}function x(e,n){for(var t=0,r=Object.keys(n);t<r.length;t++){var a=r[t];n[a]!==void 0&&(e[a]=n[a])}}function Se(e,n){var t=l("state",n),r=u.useState(Symbol()),a=r[0],o=r[1],i=u.useMemo(function(){if(t)return g({},e.state)},[e,a]);return u.useLayoutEffect(function(){if(t)return e.on("stateChange",function(){return o(Symbol())})},[e]),[i,a]}function we(e,n){var t=l("currentState",n),r=u.useState(Symbol()),a=r[0],o=r[1],i=u.useMemo(function(){if(t)return e.getCurrentState()},[e,a]);return u.useLayoutEffect(function(){if(t)return e.on("currentStateChange",function(){return o(Symbol())})},[e]),[i,a]}function be(e,n){var t=l("currentObserver",n),r=u.useState(Symbol()),a=r[0],o=r[1],i=u.useMemo(function(){if(t)return e.getCurrentState()},[e,a]);u.useLayoutEffect(function(){if(t)return e.on("currentStateChange",function(){return o(Symbol())})},[e]);var s=void 0;return i&&(s=e.works.getObserver(i)),[s,a]}function Fe(e,n){var t=l("unsafe__fiveInstance",n);return[t?e:void 0]}function Ce(e,n){var t=l("works",n),r=u.useState(Symbol()),a=r[0],o=r[1],i=u.useMemo(function(){if(t)return e.works},[e,a]);return u.useLayoutEffect(function(){if(t)return e.on("load",function(){return o(Symbol())})},[e]),[i,a]}function Ee(e,n){var t=l("model",n),r=u.useState(Symbol()),a=r[0],o=r[1],i=u.useMemo(function(){if(t)return e.model},[e,a]);return u.useLayoutEffect(function(){if(t)return e.on("modelLoaded",function(){return o(Symbol())})},[e]),[i,a]}function ke(e,n){var t=l("scene",n);return[t?e.scene:void 0]}function Re(e,n){var t=l("cameraDirection",n),r=u.useState(Symbol()),a=r[0],o=r[1],i=u.useMemo(function(){if(t)return e.camera.getWorldDirection(new h.Vector3)},[e,a]);return u.useLayoutEffect(function(){if(t)return e.on("cameraUpdate",function(){return o(Symbol())})},[e]),[i,a]}function Le(e,n){var t=l("cameraRaycaster",n),r=u.useState(Symbol()),a=r[0],o=r[1],i=u.useMemo(function(){if(t){var s=e.camera.getWorldDirection(new h.Vector3),c=new h.Raycaster(e.camera.position,s);return c}},[e,a]);return u.useLayoutEffect(function(){if(t)return e.on("cameraUpdate",function(){return o(Symbol())})},[e]),[i,a]}function _e(e,n){var t=l("modelReadyState",n),r=u.useState(Symbol()),a=r[0],o=r[1],i=u.useMemo(function(){if(t)return e.model.empty?"Empty":"Loaded"},[e,a]);return u.useLayoutEffect(function(){if(t)return e.on("modelLoaded",function(){return o(Symbol())})},[e]),[i,a]}function Pe(e,n){var t=l("shownFloor",n),r=u.useState(Symbol()),a=r[0],o=r[1],i=u.useMemo(function(){if(t)return e.model.shownFloor},[e,a]);return u.useLayoutEffect(function(){if(t)return e.on("modelShownFloorChange",function(){return o(Symbol())})},[e]),[i,a]}function Ve(e,n){var t=l("helperVisible",n),r=u.useState(Symbol()),a=r[0],o=r[1],i=u.useMemo(function(){if(t)return e.helperVisible},[e,a]);return u.useLayoutEffect(function(){if(t)return e.on("helpersVisibleChange",function(){return o(Symbol())})},[e]),[i,a]}function Oe(e,n){if(l("loadWork",n))return e}function De(e,n){if(l("setState",n))return function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return e.setState.apply(e,t)}}function We(e,n){if(l("on",n))return function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return e.on.apply(e,t)}}function Me(e,n){if(l("on",n))return function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return e.once.apply(e,t)}}function je(e,n){if(l("off",n))return function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return e.off.apply(e,t)}}function Ue(e,n){if(l("intersectRaycaster",n))return function(){for(var t,r=[],a=0;a<arguments.length;a++)r[a]=arguments[a];return(t=e.model).intersectRaycaster.apply(t,r)}}function Te(e,n){if(l("project2d",n))return function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return e.project2d.apply(e,t)}}function Ne(e,n){if(l("updateCamera",n))return function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return e.updateCamera.apply(e,t)}}function xe(e,n){if(l("getPixels",n))return e.getPixels.bind(e)}function $e(e,n){if(l("render",n))return function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return e.render.apply(e,t)}}function He(e,n){if(l("needsRender",n))return function(){e.needsRender=!0}}function Be(e,n){if(l("preloadPano",n))return function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return e.preloadPano.apply(e,t)}}function Ie(e,n){if(l("showFloor",n))return function(t){typeof t=="number"?e.model.show(t):e.model.show()}}function Ge(e,n){if(l("toggleHelperVisible",n))return function(t){e.helperVisible=t}}function qe(e){return function(n){return u.forwardRef(function(t,r){var a=d(),o=W(),i=Fe(a,e)[0],s=Se(a,e),c=s[0],v=s[1],p=we(a,e),m=p[0],y=p[1],F=be(a,e),_=F[0],P=F[1],H=Ce(a,e),Qe=H[0],Xe=H[1],B=Ee(a,e),Ye=B[0],Ze=B[1],er=ke(a,e)[0],I=Re(a,e),rr=I[0],tr=I[1],G=Le(a,e),nr=G[0],ar=G[1],q=_e(a,e),or=q[0],ur=q[1],A=Pe(a,e),ir=A[0],sr=A[1],z=Ve(a,e),cr=z[0],fr=z[1],J=u.useMemo(function(){var w={};return x(w,{setState:De(a,e),loadWork:Oe(o,e),on:We(a,e),once:Me(a,e),off:je(a,e),intersectRaycaster:Ue(a,e),project2d:Te(a,e),updateCamera:Ne(a,e),getPixels:xe(a,e),render:$e(a,e),needsRender:He(a,e),preloadPano:Be(a,e),showFloor:Ie(a,e),toggleHelperVisible:Ge(a,e)}),w},[a,o]),lr=u.useMemo(function(){var w=g({},J);return x(w,{unsafe__fiveInstance:i,state:c,currentState:m,currentObserver:_,work:Qe,model:Ye,scene:er,cameraDirection:rr,cameraRaycaster:nr,modelReadyState:or,shownFloor:ir,helperVisible:cr}),w},[a,J,v,y,P,Xe,Ze,tr,ar,ur,sr,fr]);return u.createElement(n,g({ref:r,$five:lr},t))})}}function Ae(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return e}function L(e,n){for(var t={},r=n.length,a=-1;++a<r;){var o=n[a];o in e&&(t[o]=e[o])}return t}function ze(e,n){return typeof e=="number"&&typeof n=="number"&&isNaN(e)&&isNaN(n)?!0:e===n}function Je(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 $=(function(){function e(n,t){this.values=n,this.listeners=[],this.onValuesChange=t}return e.prototype.on=function(n,t){var r=this,a=[n,t];return this.listeners.push(a),function(){var o=r.listeners.indexOf(a);o>=0&&r.listeners.splice(o,1)}},e.prototype.getValues=function(n){return L(this.values,n)},e.prototype.setValues=function(n,t){var r=[];for(var a in t)n.indexOf(a)>=0&&!ze(t[a],this.values[a])&&r.push(a);if(r.length!==0){for(var o=g({},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,o);for(var v=0,p=this.listeners;v<p.length;v++){var m=p[v],y=m[0],F=m[1];if(Je(y,r)){var _=L(o,y),P=L(this.values,y);F(P,_)}}}},e})();function Ke(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 a=u.useRef(!0),o=u.useState(r.getValues(t)),i=o[0],s=o[1],c=b([r],t,!0);u.useLayoutEffect(function(){return a.current?a.current=!1:s(r.getValues(t)),r.on(t,function(p){return s(p)})},c);var v=u.useCallback(function(p){return r.setValues(t,p)},c);return[i,v]},useStoreSetter:function(t){var r=u.useContext(n);if(r===null)throw new Error("StoreProvider never found.");var a=u.useCallback(function(o){return r.setValues(t,o)},b([r],t,!0));return a},watchStore:function(t,r,a){var o=u.useContext(n);if(o===null)throw new Error("StoreProvider never found.");var i=b([o],t,!0);a!==void 0&&(i=i.concat(a)),u.useLayoutEffect(function(){return o.on(t,r)},i)},useStoreAction:function(t){var r=u.useContext(n);if(r===null)throw new Error("StoreProvider never found.");var a=u.useCallback(function(){for(var o=[],i=0;i<arguments.length;i++)o[i]=arguments[i];var s=e[t],c=s[0],v=s.slice(1),p=function(){return r.getValues(v)},m=function(y){return r.setValues(v,y)};return c.apply(void 0,b([p,m],o,!1))},[]);return a},StoreProvider:(function(t){D(r,t);function r(a){var o=t.call(this,a)||this;return o.store=new $(a.initialValue,function(){for(var i,s=[],c=0;c<arguments.length;c++)s[c]=arguments[c];o.props.onValuesChange&&(i=o.props).onValuesChange.apply(i,s)}),o}return r.prototype.shouldComponentUpdate=function(a){return a.children!==this.props.children},r.prototype.render=function(){return u.createElement(n.Provider,{value:this.store},this.props.children)},r})(u.Component)}}f.FiveCanvas=te,f.INJECTION_PROPNAME=me,f.Store=$,f.createFiveFeature=Ae,f.createFiveProvider=Z,f.createStore=Ke,f.unsafe__useFiveInstance=ne,f.useFiveAction=fe,f.useFiveCameraDirection=de,f.useFiveCameraRaycaster=ve,f.useFiveCurrentObserver=se,f.useFiveCurrentState=ie,f.useFiveEventCallback=ce,f.useFiveFloor=ge,f.useFiveHelper=ye,f.useFiveModelIntersectRaycaster=pe,f.useFiveModelReadyState=he,f.useFiveProject2d=le,f.useFiveScene=ae,f.useFiveSceneEffect=M,f.useFiveState=ue,f.useFiveWork=oe,f.withFive=qe,Object.defineProperty(f,Symbol.toStringTag,{value:"Module"})}));
|
package/umd/five-shader-lib.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,7 +252,7 @@
|
|
|
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
|
-
*/(function(x,P){typeof exports=="object"&&typeof module!="undefined"?P(exports,require("@realsee/five"),require("three")):typeof define=="function"&&define.amd?define(["exports","@realsee/five","three"],P):(x=typeof globalThis!="undefined"?globalThis:x||self,P(x.FiveSDK_ShaderLib={},x.FiveSDK,x.THREE))})(this,function(x,P,J){"use strict";function V(r){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(r){for(const n in r)if(n!=="default"){const o=Object.getOwnPropertyDescriptor(r,n);Object.defineProperty(e,n,o.get?o:{enumerable:!0,get:()=>r[n]})}}return e.default=r,Object.freeze(e)}const a=V(J);var F=function(r,e){return F=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var t in o)Object.prototype.hasOwnProperty.call(o,t)&&(n[t]=o[t])},F(r,e)};function S(r,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");F(r,e);function n(){this.constructor=r}r.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}function z(r,e,n){if(n||arguments.length===2)for(var o=0,t=e.length,l;o<t;o++)(l||!(o in e))&&(l||(l=Array.prototype.slice.call(e,0,o)),l[o]=e[o]);return r.concat(l||Array.prototype.slice.call(e))}typeof SuppressedError=="function"&&SuppressedError;var W=`
|
|
255
|
+
*/(function(x,P){typeof exports=="object"&&typeof module!="undefined"?P(exports,require("@realsee/five"),require("three")):typeof define=="function"&&define.amd?define(["exports","@realsee/five","three"],P):(x=typeof globalThis!="undefined"?globalThis:x||self,P(x.FiveSDK_ShaderLib={},x.FiveSDK,x.THREE))})(this,(function(x,P,J){"use strict";function V(r){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(r){for(const n in r)if(n!=="default"){const o=Object.getOwnPropertyDescriptor(r,n);Object.defineProperty(e,n,o.get?o:{enumerable:!0,get:()=>r[n]})}}return e.default=r,Object.freeze(e)}const a=V(J);var F=function(r,e){return F=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var t in o)Object.prototype.hasOwnProperty.call(o,t)&&(n[t]=o[t])},F(r,e)};function S(r,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");F(r,e);function n(){this.constructor=r}r.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}function z(r,e,n){if(n||arguments.length===2)for(var o=0,t=e.length,l;o<t;o++)(l||!(o in e))&&(l||(l=Array.prototype.slice.call(e,0,o)),l[o]=e[o]);return r.concat(l||Array.prototype.slice.call(e))}typeof SuppressedError=="function"&&SuppressedError;var W=`
|
|
256
256
|
#if defined(USE_PLANE_DISTANCE)
|
|
257
257
|
struct Plane {
|
|
258
258
|
vec3 normal;
|
|
@@ -283,7 +283,7 @@
|
|
|
283
283
|
}
|
|
284
284
|
}
|
|
285
285
|
#endif
|
|
286
|
-
`,R="",L={type:["pointcloud"],fragment:{mainBefore:W,mainStart:R,mainEnd:H},uniforms:{evennessPlaneNormal:new a.Uniform(new a.Vector3),evennessPlaneConstant:new a.Uniform(0),evennessPlanes:new a.Uniform([]),evennessPlaneDepth:new a.Uniform(0)},defines:{USE_PLANE_DISTANCE:!1}},j=function(r){S(e,r);function e(){var n=r.call(this,L)||this;return Object.defineProperties(n,{evennessPlane:{get:function(){return{depth:this.uniforms.evennessPlaneDepth.value,points:this.uniforms.evennessPoints.value}},set:function(o){var t=o.points,l=o.depth,m=!1;if(t.length!==0&&t.length%4===0){m=!0;var d=t[0],u=t[1],p=t[2],i=t[3],g=new a.Vector3().subVectors(u,d),y=new a.Vector3().subVectors(p,d),c=new a.Vector3().crossVectors(g,y).normalize(),h=-c.dot(d),s=l,f=d.clone().add(c.clone().negate().multiplyScalar(s)),v=d.clone().add(c.clone().multiplyScalar(s)),E=u.clone().add(c.clone().negate().multiplyScalar(s)),_=u.clone().add(c.clone().multiplyScalar(s)),w=p.clone().add(c.clone().negate().multiplyScalar(s)),C=p.clone().add(c.clone().multiplyScalar(s)),B=i.clone().add(c.clone().negate().multiplyScalar(s)),O=i.clone().add(c.clone().multiplyScalar(s)),T=new a.Plane().setFromCoplanarPoints(v,_,C),b=new a.Plane().setFromCoplanarPoints(w,E,f),D=new a.Plane().setFromCoplanarPoints(_,v,f),U=new a.Plane().setFromCoplanarPoints(B,O,C),I=new a.Plane().setFromCoplanarPoints(C,_,E),A=new a.Plane().setFromCoplanarPoints(f,v,O);this.uniforms.evennessPlanes.value=[{normal:T.normal,constant:T.constant},{normal:b.normal,constant:b.constant},{normal:D.normal,constant:D.constant},{normal:U.normal,constant:U.constant},{normal:I.normal,constant:I.constant},{normal:A.normal,constant:A.constant}],this.uniforms.evennessPlaneDepth.value=l,this.uniforms.evennessPlaneNormal.value=c,this.uniforms.evennessPlaneConstant.value=h}this.defines.USE_PLANE_DISTANCE=m,this.needsUpdate=!0}}}),n.evennessPlane={depth:0,points:[]},n}return e}(P.CustomShader),G=`
|
|
286
|
+
`,R="",L={type:["pointcloud"],fragment:{mainBefore:W,mainStart:R,mainEnd:H},uniforms:{evennessPlaneNormal:new a.Uniform(new a.Vector3),evennessPlaneConstant:new a.Uniform(0),evennessPlanes:new a.Uniform([]),evennessPlaneDepth:new a.Uniform(0)},defines:{USE_PLANE_DISTANCE:!1}},j=(function(r){S(e,r);function e(){var n=r.call(this,L)||this;return Object.defineProperties(n,{evennessPlane:{get:function(){return{depth:this.uniforms.evennessPlaneDepth.value,points:this.uniforms.evennessPoints.value}},set:function(o){var t=o.points,l=o.depth,m=!1;if(t.length!==0&&t.length%4===0){m=!0;var d=t[0],u=t[1],p=t[2],i=t[3],g=new a.Vector3().subVectors(u,d),y=new a.Vector3().subVectors(p,d),c=new a.Vector3().crossVectors(g,y).normalize(),h=-c.dot(d),s=l,f=d.clone().add(c.clone().negate().multiplyScalar(s)),v=d.clone().add(c.clone().multiplyScalar(s)),E=u.clone().add(c.clone().negate().multiplyScalar(s)),_=u.clone().add(c.clone().multiplyScalar(s)),w=p.clone().add(c.clone().negate().multiplyScalar(s)),C=p.clone().add(c.clone().multiplyScalar(s)),B=i.clone().add(c.clone().negate().multiplyScalar(s)),O=i.clone().add(c.clone().multiplyScalar(s)),T=new a.Plane().setFromCoplanarPoints(v,_,C),b=new a.Plane().setFromCoplanarPoints(w,E,f),D=new a.Plane().setFromCoplanarPoints(_,v,f),U=new a.Plane().setFromCoplanarPoints(B,O,C),I=new a.Plane().setFromCoplanarPoints(C,_,E),A=new a.Plane().setFromCoplanarPoints(f,v,O);this.uniforms.evennessPlanes.value=[{normal:T.normal,constant:T.constant},{normal:b.normal,constant:b.constant},{normal:D.normal,constant:D.constant},{normal:U.normal,constant:U.constant},{normal:I.normal,constant:I.constant},{normal:A.normal,constant:A.constant}],this.uniforms.evennessPlaneDepth.value=l,this.uniforms.evennessPlaneNormal.value=c,this.uniforms.evennessPlaneConstant.value=h}this.defines.USE_PLANE_DISTANCE=m,this.needsUpdate=!0}}}),n.evennessPlane={depth:0,points:[]},n}return e})(P.CustomShader),G=`
|
|
287
287
|
#if NUM_SWEEP_OBJECTS > 0
|
|
288
288
|
uniform float sweepProgress;
|
|
289
289
|
uniform float sweepRange;
|
|
@@ -329,7 +329,7 @@
|
|
|
329
329
|
}
|
|
330
330
|
#pragma unroll_loop_end
|
|
331
331
|
#endif
|
|
332
|
-
`,$="",k=function(r){S(e,r);function e(){var n=r.call(this,{type:["basic","phong","pointcloud"],fragment:{mainBefore:G,mainStart:$,mainEnd:q},uniforms:{sweepProgress:new a.Uniform(0),sweepRange:new a.Uniform(0),sweepBoxs:new a.Uniform([]),interval:new a.Uniform(.04),threshold:new a.Uniform(.002)},defines:{NUM_SWEEP_OBJECTS:0}})||this;return Object.defineProperties(n,{sweepBoxs:{get:function(){return this.uniforms.sweepBoxs.value},set:function(o){var t=o.length;t>0&&(this.defines.NUM_SWEEP_OBJECTS=t,this.needsUpdate=!0,this.uniforms.sweepBoxs.value=o)}}}),n.sweepBoxs=[],n}return e.prototype.onBeforeCompile=function(n,o){var t=String(this.sweepBoxs.length);n.vertexShader=n.vertexShader.replace(/NUM_SWEEP_OBJECTS/g,t),n.fragmentShader=n.fragmentShader.replace(/NUM_SWEEP_OBJECTS/g,t)},e}(P.CustomShader),K=`
|
|
332
|
+
`,$="",k=(function(r){S(e,r);function e(){var n=r.call(this,{type:["basic","phong","pointcloud"],fragment:{mainBefore:G,mainStart:$,mainEnd:q},uniforms:{sweepProgress:new a.Uniform(0),sweepRange:new a.Uniform(0),sweepBoxs:new a.Uniform([]),interval:new a.Uniform(.04),threshold:new a.Uniform(.002)},defines:{NUM_SWEEP_OBJECTS:0}})||this;return Object.defineProperties(n,{sweepBoxs:{get:function(){return this.uniforms.sweepBoxs.value},set:function(o){var t=o.length;t>0&&(this.defines.NUM_SWEEP_OBJECTS=t,this.needsUpdate=!0,this.uniforms.sweepBoxs.value=o)}}}),n.sweepBoxs=[],n}return e.prototype.onBeforeCompile=function(n,o){var t=String(this.sweepBoxs.length);n.vertexShader=n.vertexShader.replace(/NUM_SWEEP_OBJECTS/g,t),n.fragmentShader=n.fragmentShader.replace(/NUM_SWEEP_OBJECTS/g,t)},e})(P.CustomShader),K=`
|
|
333
333
|
uniform float pointCloudExpand_progress;
|
|
334
334
|
|
|
335
335
|
vec4 pointCloudExpand_permute(vec4 x) { return mod(((x * 34.0) + 1.0) * x, 289.0); }
|
|
@@ -416,7 +416,7 @@ float pointCloudExpand_progress2 = step(pointCloudExpand_progress, 1.0 - pointCl
|
|
|
416
416
|
pointCloudExpand_sizeBasis = mix(0.1 * step(abs(pointCloudExpand_noise), 0.5 / pointCloudExpand_boundingRadius), pointCloudExpand_sizeBasis, pointCloudExpand_progress2);
|
|
417
417
|
gl_PointSize = gl_PointSize * pointCloudExpand_sizeScale + pointCloudExpand_sizeBasis;
|
|
418
418
|
vPointSize = gl_PointSize;
|
|
419
|
-
`,Q=function(r){S(e,r);function e(){return r.call(this,{type:["pointcloud"],vertex:{mainBefore:K,mainEnd:Y},uniforms:{pointCloudExpand_progress:new a.Uniform(0)}})||this}return Object.defineProperty(e.prototype,"progress",{get:function(){return this.uniforms.pointCloudExpand_progress.value},set:function(n){this.uniforms.pointCloudExpand_progress.value=n},enumerable:!1,configurable:!0}),e}(P.CustomShader),Z=`
|
|
419
|
+
`,Q=(function(r){S(e,r);function e(){return r.call(this,{type:["pointcloud"],vertex:{mainBefore:K,mainEnd:Y},uniforms:{pointCloudExpand_progress:new a.Uniform(0)}})||this}return Object.defineProperty(e.prototype,"progress",{get:function(){return this.uniforms.pointCloudExpand_progress.value},set:function(n){this.uniforms.pointCloudExpand_progress.value=n},enumerable:!1,configurable:!0}),e})(P.CustomShader),Z=`
|
|
420
420
|
uniform sampler2D polygonTexture;
|
|
421
421
|
|
|
422
422
|
struct PolygonClipper {
|
|
@@ -500,7 +500,7 @@ vPointSize = gl_PointSize;
|
|
|
500
500
|
}
|
|
501
501
|
}
|
|
502
502
|
|
|
503
|
-
`,N=function(){function r(){this.canvasCache=new Map,this.canvas=document.createElement("canvas"),this.canvas.width=512,this.canvas.height=512,this.polygonTexture=new a.CanvasTexture(this.canvas),this.polygonCount=0}return r.prototype.setSize=function(e){this.canvas.width=e,this.canvas.height=e},r.prototype.generatePolygonCanvas=function(e){var n=JSON.stringify(e);if(this.canvasCache.has(n))return this.canvasCache.get(n);var o=document.createElement("canvas");o.width=this.canvas.width,o.height=this.canvas.height;var t=o.getContext("2d");if(!t)throw new Error("Failed to get canvas context");if(this.polygonCount>=24)throw new Error("polygon count exceed 24, please clear the canvas");t.clearRect(0,0,this.canvas.width,this.canvas.height),t.fillStyle="rgba(0,0,0,1.0)",t.beginPath();var l=e[0][0],m=e[0][0],d=e[0][1],u=e[0][1];e.forEach(function(s){var f=s[0],v=s[1];l=Math.min(l,f),m=Math.max(m,f),d=Math.min(d,v),u=Math.max(u,v)});var p=m-l,i=u-d,g=this.canvas.width,y=p>=i?g/p:g/i,c=e.map(function(s){var f=s[0]-l,v=s[1]-d;return[f,v]}),h=c.map(function(s){return[s[0]*y,s[1]*y]});return h.forEach(function(s,f){var v=s[0],E=s[1];f===0?t.moveTo(v,E):t.lineTo(v,E)}),t.closePath(),t.fill(),this.polygonCount++,this.canvasCache.set(n,o),o},r.generatePolygonGeometry=function(e,n){for(var o=new a.BufferGeometry,t=e.slice(0,-1),l=t.map(function(g){return[g[0],0,g[1]]}),m=t.map(function(g){return[g[0],n,g[1]]}),d=z(z([],l,!0),m,!0),u=t.length,p=[],i=1;i<u-1;i++)p.push(0,i,i+1);for(var i=1;i<u-1;i++)p.push(u,u+i,u+i+1);for(var i=0;i<u-1;i++)p.push(i,i+1,u+i),p.push(i+1,i+1+u,u+i);return o.setAttribute("position",new a.Float32BufferAttribute(d.flat(),3)),o.setIndex(p),o.computeVertexNormals(),o},r.prototype.generatePolygonTexture=function(e){var n=this.canvas.getContext("2d",{willReadFrequently:!0});if(!n)throw new Error("Failed to get canvas context");for(var o=n.createImageData(this.canvas.width,this.canvas.height),t=0;t<this.canvas.width;t++)for(var l=0;l<this.canvas.height;l++){for(var m=0,d=0,u=0,p=0;p<e.length;p++){var i=e[p].getContext("2d",{willReadFrequently:!0});if(!i)throw new Error("Failed to get canvas context");var g=i.getImageData(t,l,1,1).data;if(g[3]===255){var y=p%8,c=Math.floor(p/8);c===0?m=m|1<<y:c===1?d=d|1<<y:c===2&&(u=u|1<<y)}}var h=(t+l*this.canvas.width)*4;o.data[h]=m,o.data[h+1]=d,o.data[h+2]=u,o.data[h+3]=255}return n.putImageData(o,0,0),new a.CanvasTexture(this.canvas)},r}(),M=new N,nn=function(r){S(e,r);function e(){var n=r.call(this,{type:["basic","phong","pointcloud"],fragment:{mainBefore:Z,mainEnd:X},uniforms:{polygonClippers:new a.Uniform([]),polygonTexture:new a.Uniform(null)}})||this;return n._polygonClippers=[],n._radio=512,n}return Object.defineProperty(e.prototype,"polygonClippers",{get:function(){return this._polygonClippers},set:function(n){this._polygonClippers=n;var o=this.uniforms;o.polygonClippers.value=n.map(function(p){var i=new a.Matrix4().getInverse(p.polygonTransform),g=p.polygonHeight,y=p.cutOutSide,c=p.polygon,h=c[0][0],s=c[0][0],f=c[0][1],v=c[0][1];c.forEach(function(w){var C=w[0],B=w[1];h=Math.min(h,C),s=Math.max(s,C),f=Math.min(f,B),v=Math.max(v,B)});var E=new a.Vector2(h,f),_=s-h>=v-f?s-h:v-f;return{polygonTransformInverse:i,polygonHeight:g,minPos:E,polygonScale:_,cutOutSide:y}});for(var t=[],l=0;l<n.length;l++){var m=n[l].polygon,d=M.generatePolygonCanvas(m);t.push(d)}var u=M.generatePolygonTexture(t);this.uniforms.polygonTexture.value=u,this.needsUpdate=!0},enumerable:!1,configurable:!0}),e.prototype.onBeforeCompile=function(n,o){var t=String(this.polygonClippers.length);n.vertexShader=n.vertexShader.replace(/NUM_POLYGON_CLIPPER/g,t),n.fragmentShader=n.fragmentShader.replace(/NUM_POLYGON_CLIPPER/g,t)},e}(P.CustomShader),en=`
|
|
503
|
+
`,N=(function(){function r(){this.canvasCache=new Map,this.canvas=document.createElement("canvas"),this.canvas.width=512,this.canvas.height=512,this.polygonTexture=new a.CanvasTexture(this.canvas),this.polygonCount=0}return r.prototype.setSize=function(e){this.canvas.width=e,this.canvas.height=e},r.prototype.generatePolygonCanvas=function(e){var n=JSON.stringify(e);if(this.canvasCache.has(n))return this.canvasCache.get(n);var o=document.createElement("canvas");o.width=this.canvas.width,o.height=this.canvas.height;var t=o.getContext("2d");if(!t)throw new Error("Failed to get canvas context");if(this.polygonCount>=24)throw new Error("polygon count exceed 24, please clear the canvas");t.clearRect(0,0,this.canvas.width,this.canvas.height),t.fillStyle="rgba(0,0,0,1.0)",t.beginPath();var l=e[0][0],m=e[0][0],d=e[0][1],u=e[0][1];e.forEach(function(s){var f=s[0],v=s[1];l=Math.min(l,f),m=Math.max(m,f),d=Math.min(d,v),u=Math.max(u,v)});var p=m-l,i=u-d,g=this.canvas.width,y=p>=i?g/p:g/i,c=e.map(function(s){var f=s[0]-l,v=s[1]-d;return[f,v]}),h=c.map(function(s){return[s[0]*y,s[1]*y]});return h.forEach(function(s,f){var v=s[0],E=s[1];f===0?t.moveTo(v,E):t.lineTo(v,E)}),t.closePath(),t.fill(),this.polygonCount++,this.canvasCache.set(n,o),o},r.generatePolygonGeometry=function(e,n){for(var o=new a.BufferGeometry,t=e.slice(0,-1),l=t.map(function(g){return[g[0],0,g[1]]}),m=t.map(function(g){return[g[0],n,g[1]]}),d=z(z([],l,!0),m,!0),u=t.length,p=[],i=1;i<u-1;i++)p.push(0,i,i+1);for(var i=1;i<u-1;i++)p.push(u,u+i,u+i+1);for(var i=0;i<u-1;i++)p.push(i,i+1,u+i),p.push(i+1,i+1+u,u+i);return o.setAttribute("position",new a.Float32BufferAttribute(d.flat(),3)),o.setIndex(p),o.computeVertexNormals(),o},r.prototype.generatePolygonTexture=function(e){var n=this.canvas.getContext("2d",{willReadFrequently:!0});if(!n)throw new Error("Failed to get canvas context");for(var o=n.createImageData(this.canvas.width,this.canvas.height),t=0;t<this.canvas.width;t++)for(var l=0;l<this.canvas.height;l++){for(var m=0,d=0,u=0,p=0;p<e.length;p++){var i=e[p].getContext("2d",{willReadFrequently:!0});if(!i)throw new Error("Failed to get canvas context");var g=i.getImageData(t,l,1,1).data;if(g[3]===255){var y=p%8,c=Math.floor(p/8);c===0?m=m|1<<y:c===1?d=d|1<<y:c===2&&(u=u|1<<y)}}var h=(t+l*this.canvas.width)*4;o.data[h]=m,o.data[h+1]=d,o.data[h+2]=u,o.data[h+3]=255}return n.putImageData(o,0,0),new a.CanvasTexture(this.canvas)},r})(),M=new N,nn=(function(r){S(e,r);function e(){var n=r.call(this,{type:["basic","phong","pointcloud"],fragment:{mainBefore:Z,mainEnd:X},uniforms:{polygonClippers:new a.Uniform([]),polygonTexture:new a.Uniform(null)}})||this;return n._polygonClippers=[],n._radio=512,n}return Object.defineProperty(e.prototype,"polygonClippers",{get:function(){return this._polygonClippers},set:function(n){this._polygonClippers=n;var o=this.uniforms;o.polygonClippers.value=n.map(function(p){var i=new a.Matrix4().getInverse(p.polygonTransform),g=p.polygonHeight,y=p.cutOutSide,c=p.polygon,h=c[0][0],s=c[0][0],f=c[0][1],v=c[0][1];c.forEach(function(w){var C=w[0],B=w[1];h=Math.min(h,C),s=Math.max(s,C),f=Math.min(f,B),v=Math.max(v,B)});var E=new a.Vector2(h,f),_=s-h>=v-f?s-h:v-f;return{polygonTransformInverse:i,polygonHeight:g,minPos:E,polygonScale:_,cutOutSide:y}});for(var t=[],l=0;l<n.length;l++){var m=n[l].polygon,d=M.generatePolygonCanvas(m);t.push(d)}var u=M.generatePolygonTexture(t);this.uniforms.polygonTexture.value=u,this.needsUpdate=!0},enumerable:!1,configurable:!0}),e.prototype.onBeforeCompile=function(n,o){var t=String(this.polygonClippers.length);n.vertexShader=n.vertexShader.replace(/NUM_POLYGON_CLIPPER/g,t),n.fragmentShader=n.fragmentShader.replace(/NUM_POLYGON_CLIPPER/g,t)},e})(P.CustomShader),en=`
|
|
504
504
|
#if NUM_SHINE_OBJECTS > 0
|
|
505
505
|
uniform float shineProgress;
|
|
506
506
|
struct SHINE_OBJECT {
|
|
@@ -525,4 +525,4 @@ vPointSize = gl_PointSize;
|
|
|
525
525
|
}
|
|
526
526
|
#pragma unroll_loop_end
|
|
527
527
|
#endif
|
|
528
|
-
`,tn="",rn=function(r){S(e,r);function e(){var n=r.call(this,{type:["basic","phong","none"],fragment:{mainBefore:en,mainStart:tn,mainEnd:on},uniforms:{shineProgress:new a.Uniform(0),shineBoxes:new a.Uniform([])},defines:{NUM_SHINE_OBJECTS:0}})||this;return Object.defineProperties(n,{shineBoxes:{get:function(){return this.uniforms.shineBoxes.value},set:function(o){var t=o.length;t>0&&(this.defines.NUM_SHINE_OBJECTS=t,this.uniforms.shineBoxes.value=o)}}}),n.shineBoxes=[],n}return e.prototype.onBeforeCompile=function(n,o){var t=String(this.shineBoxes.length);n.vertexShader=n.vertexShader.replace(/NUM_SHINE_OBJECTS/g,t),n.fragmentShader=n.fragmentShader.replace(/NUM_SHINE_OBJECTS/g,t)},e}(P.CustomShader);x.EvenessPlaneShader=j,x.PointCloudExpandShader=Q,x.PolygonCuterShader=nn,x.PolygonGenerater=N,x.ShineModelShader=rn,x.SweepModelShader=k,Object.defineProperty(x,Symbol.toStringTag,{value:"Module"})});
|
|
528
|
+
`,tn="",rn=(function(r){S(e,r);function e(){var n=r.call(this,{type:["basic","phong","none"],fragment:{mainBefore:en,mainStart:tn,mainEnd:on},uniforms:{shineProgress:new a.Uniform(0),shineBoxes:new a.Uniform([])},defines:{NUM_SHINE_OBJECTS:0}})||this;return Object.defineProperties(n,{shineBoxes:{get:function(){return this.uniforms.shineBoxes.value},set:function(o){var t=o.length;t>0&&(this.defines.NUM_SHINE_OBJECTS=t,this.uniforms.shineBoxes.value=o)}}}),n.shineBoxes=[],n}return e.prototype.onBeforeCompile=function(n,o){var t=String(this.shineBoxes.length);n.vertexShader=n.vertexShader.replace(/NUM_SHINE_OBJECTS/g,t),n.fragmentShader=n.fragmentShader.replace(/NUM_SHINE_OBJECTS/g,t)},e})(P.CustomShader);x.EvenessPlaneShader=j,x.PointCloudExpandShader=Q,x.PolygonCuterShader=nn,x.PolygonGenerater=N,x.ShineModelShader=rn,x.SweepModelShader=k,Object.defineProperty(x,Symbol.toStringTag,{value:"Module"})}));
|
package/umd/five-sticker.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
|
-
*/(function(s,u){typeof exports=="object"&&typeof module!="undefined"?u(exports,require("three")):typeof define=="function"&&define.amd?define(["exports","three"],u):(s=typeof globalThis!="undefined"?globalThis:s||self,u(s.FiveSDK_Sticker={},s.THREE))})(this,function(s,u){"use strict";function w(t){const n=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const e in t)if(e!=="default"){const r=Object.getOwnPropertyDescriptor(t,e);Object.defineProperty(n,e,r.get?r:{enumerable:!0,get:()=>t[e]})}}return n.default=t,Object.freeze(n)}const o=w(u);var m=function(t,n){return m=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,r){e.__proto__=r}||function(e,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(e[i]=r[i])},m(t,n)};function T(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");m(t,n);function e(){this.constructor=t}t.prototype=n===null?Object.create(n):(e.prototype=n.prototype,new e)}typeof SuppressedError=="function"&&SuppressedError;var E=new Float32Array([-.5,-.5,0,.5,-.5,0,-.5,.5,0,.5,.5,0]),_=new Float32Array([0,0,1,0,0,1,1,1]),R=new Uint8Array([0,1,2,1,3,2]),c=new o.BufferGeometry;c.setAttribute("position",new o.BufferAttribute(E,3)),c.setAttribute("uv",new o.BufferAttribute(_,2)),c.setIndex(new o.BufferAttribute(R,1));var l=window,g=l.requestAnimationFrame||l.mozRequestAnimationFrame||l.webkitRequestAnimationFrame||l.msRequestAnimationFrame||function(t){return setTimeout(t,16)},S=typeof performance!="undefined"&&typeof performance.timing!="undefined"?performance.timing.navigationStart:Date.now(),v=typeof performance!="undefined"?function(){return S+performance.now()}:function(){return Date.now()};function A(t,n){t.naturalWidth>0&&g(function(){return n()});var e=function(){return n()};return t.addEventListener("load",e,!1),function(){return t.removeEventListener("load",e,!1)}}function b(t,n){var e=v(),r=!1,i=function(){r=!0,n();var f=v();f-e<3e3?g(i):r=!1},a=function(){e=v(),r===!1&&i()};return t.addEventListener("timeupdate",a,!1),function(){t.removeEventListener("timeupdate",a,!1),r=!1}}function h(t,n){var e=t.dispose;t.dispose=function(){n(),e.call(t)}}var O=function(t){T(n,t);function n(e,r,i){var a=this,f=new o.MeshBasicMaterial;if(a=t.call(this,c,f)||this,a._needsRender=!1,a.scale.set(e,r,1),typeof i=="string"){f.transparent=/\.png$/.test(i);var y=new Image;y.src=i,y.crossOrigin="",i=y}if(i instanceof HTMLImageElement){var p=f.map=new o.Texture;p.wrapS=o.ClampToEdgeWrapping,p.wrapT=o.ClampToEdgeWrapping,p.minFilter=o.LinearFilter,p.encoding=o.sRGBEncoding,h(p,A(i,function(){p.image=i,p.needsUpdate=!0,a._needsRender=!0}))}else if(i instanceof HTMLCanvasElement)f.map=new o.CanvasTexture(i);else if(i instanceof HTMLVideoElement){var d=f.map=new o.VideoTexture(i);d.wrapS=o.ClampToEdgeWrapping,d.wrapT=o.ClampToEdgeWrapping,d.minFilter=o.LinearFilter,d.encoding=o.sRGBEncoding,h(d,b(i,function(){a._needsRender=!0}))}return a}return Object.defineProperty(n,"version",{get:function(){return"6.6.0-alpha.
|
|
255
|
+
*/(function(s,u){typeof exports=="object"&&typeof module!="undefined"?u(exports,require("three")):typeof define=="function"&&define.amd?define(["exports","three"],u):(s=typeof globalThis!="undefined"?globalThis:s||self,u(s.FiveSDK_Sticker={},s.THREE))})(this,(function(s,u){"use strict";function w(t){const n=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const e in t)if(e!=="default"){const r=Object.getOwnPropertyDescriptor(t,e);Object.defineProperty(n,e,r.get?r:{enumerable:!0,get:()=>t[e]})}}return n.default=t,Object.freeze(n)}const o=w(u);var m=function(t,n){return m=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,r){e.__proto__=r}||function(e,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(e[i]=r[i])},m(t,n)};function T(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");m(t,n);function e(){this.constructor=t}t.prototype=n===null?Object.create(n):(e.prototype=n.prototype,new e)}typeof SuppressedError=="function"&&SuppressedError;var E=new Float32Array([-.5,-.5,0,.5,-.5,0,-.5,.5,0,.5,.5,0]),_=new Float32Array([0,0,1,0,0,1,1,1]),R=new Uint8Array([0,1,2,1,3,2]),c=new o.BufferGeometry;c.setAttribute("position",new o.BufferAttribute(E,3)),c.setAttribute("uv",new o.BufferAttribute(_,2)),c.setIndex(new o.BufferAttribute(R,1));var l=window,g=l.requestAnimationFrame||l.mozRequestAnimationFrame||l.webkitRequestAnimationFrame||l.msRequestAnimationFrame||(function(t){return setTimeout(t,16)}),S=typeof performance!="undefined"&&typeof performance.timing!="undefined"?performance.timing.navigationStart:Date.now(),v=typeof performance!="undefined"?(function(){return S+performance.now()}):(function(){return Date.now()});function A(t,n){t.naturalWidth>0&&g(function(){return n()});var e=function(){return n()};return t.addEventListener("load",e,!1),function(){return t.removeEventListener("load",e,!1)}}function b(t,n){var e=v(),r=!1,i=function(){r=!0,n();var f=v();f-e<3e3?g(i):r=!1},a=function(){e=v(),r===!1&&i()};return t.addEventListener("timeupdate",a,!1),function(){t.removeEventListener("timeupdate",a,!1),r=!1}}function h(t,n){var e=t.dispose;t.dispose=function(){n(),e.call(t)}}var O=(function(t){T(n,t);function n(e,r,i){var a=this,f=new o.MeshBasicMaterial;if(a=t.call(this,c,f)||this,a._needsRender=!1,a.scale.set(e,r,1),typeof i=="string"){f.transparent=/\.png$/.test(i);var y=new Image;y.src=i,y.crossOrigin="",i=y}if(i instanceof HTMLImageElement){var p=f.map=new o.Texture;p.wrapS=o.ClampToEdgeWrapping,p.wrapT=o.ClampToEdgeWrapping,p.minFilter=o.LinearFilter,p.encoding=o.sRGBEncoding,h(p,A(i,function(){p.image=i,p.needsUpdate=!0,a._needsRender=!0}))}else if(i instanceof HTMLCanvasElement)f.map=new o.CanvasTexture(i);else if(i instanceof HTMLVideoElement){var d=f.map=new o.VideoTexture(i);d.wrapS=o.ClampToEdgeWrapping,d.wrapT=o.ClampToEdgeWrapping,d.minFilter=o.LinearFilter,d.encoding=o.sRGBEncoding,h(d,b(i,function(){a._needsRender=!0}))}return a}return Object.defineProperty(n,"version",{get:function(){return"6.6.0-alpha.2"},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"needsRender",{get:function(){return this._needsRender},set:function(e){this._needsRender=e,e===!0&&this.material.map&&(this.material.map.needsUpdate=!0)},enumerable:!1,configurable:!0}),n.prototype.setSize=function(e,r){this.scale.set(e,r,1),this._needsRender=!0},n.prototype.setTransparent=function(e){this.material.transparent=e,this._needsRender=!0},n.prototype.locationWithIntersection=function(e,r){r===void 0&&(r=.005);var i=e.point,a=e.face;this.position.copy(i),a&&(this.position.add(a.normal.clone().setLength(r)),this.lookAt(i.clone().add(a.normal))),this._needsRender=!0},n.prototype.dispose=function(){var e;(e=this.material.map)===null||e===void 0||e.dispose(),this.material.dispose()},n})(o.Mesh);s.Sticker=O,Object.defineProperty(s,Symbol.toStringTag,{value:"Module"})}));
|
package/umd/five-vfx.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,7 +252,7 @@
|
|
|
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
|
-
*/(function(h,x){typeof exports=="object"&&typeof module!="undefined"?x(exports,require("three")):typeof define=="function"&&define.amd?define(["exports","three"],x):(h=typeof globalThis!="undefined"?globalThis:h||self,x(h.FiveSDK_VFX={},h.THREE))})(this,function(h,x){"use strict";function se(r){const n=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(r){for(const e in r)if(e!=="default"){const t=Object.getOwnPropertyDescriptor(r,e);Object.defineProperty(n,e,t.get?t:{enumerable:!0,get:()=>r[e]})}}return n.default=r,Object.freeze(n)}const i=se(x);var T=function(r,n){return T=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])},T(r,n)};function w(r,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");T(r,n);function e(){this.constructor=r}r.prototype=n===null?Object.create(n):(e.prototype=n.prototype,new e)}typeof SuppressedError=="function"&&SuppressedError;for(var ne=`
|
|
255
|
+
*/(function(h,x){typeof exports=="object"&&typeof module!="undefined"?x(exports,require("three")):typeof define=="function"&&define.amd?define(["exports","three"],x):(h=typeof globalThis!="undefined"?globalThis:h||self,x(h.FiveSDK_VFX={},h.THREE))})(this,(function(h,x){"use strict";function se(r){const n=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(r){for(const e in r)if(e!=="default"){const t=Object.getOwnPropertyDescriptor(r,e);Object.defineProperty(n,e,t.get?t:{enumerable:!0,get:()=>r[e]})}}return n.default=r,Object.freeze(n)}const i=se(x);var T=function(r,n){return T=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])},T(r,n)};function w(r,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");T(r,n);function e(){this.constructor=r}r.prototype=n===null?Object.create(n):(e.prototype=n.prototype,new e)}typeof SuppressedError=="function"&&SuppressedError;for(var ne=`
|
|
256
256
|
uniform vec3 uColor1;
|
|
257
257
|
uniform vec3 uColor2;
|
|
258
258
|
uniform float uOpacity;
|
|
@@ -412,7 +412,7 @@ void main() {
|
|
|
412
412
|
|
|
413
413
|
gl_Position = projectionMatrix * modelViewMatrix * vec4(vPosition, 1.0);
|
|
414
414
|
}
|
|
415
|
-
`),le=new i.SphereBufferGeometry(1,300,300),re=[],A=0;A<2;A++)re.push(new i.Vector2(Math.sin(A)/2+1,A*2-.8));var ue=new i.LatheBufferGeometry(re,300),ce=function(r){w(n,r);function n(e){var t=r.call(this)||this;t.needsRender=!0;var o;if(e instanceof i.BufferGeometry)o=e;else switch(e){case"ring":o=ue;break;case"circle":default:o=le;break}t.uniforms={uTime:{value:0},uColor1:{value:new i.Color("rgb(255, 177, 20)")},uColor2:{value:new i.Color("rgb(255, 0, 0)")},uNoise:{value:1.2},uSpeed:{value:1},uOpacity:{value:1}},t.defines={FRAGMENTATION_DEGREE:2};var s=new i.Mesh(o,new i.ShaderMaterial({uniforms:t.uniforms,defines:t.defines,vertexShader:ie,fragmentShader:ne,transparent:!0,depthWrite:!1,side:i.BackSide})),a=new i.Mesh(o,new i.ShaderMaterial({uniforms:t.uniforms,defines:t.defines,vertexShader:ie,fragmentShader:ne,transparent:!0,depthWrite:!1,side:i.FrontSide}));return s.scale.setScalar(.1),a.scale.setScalar(.1),t.add(s),t.add(a),t}return n.prototype.setTime=function(e){this.startTime===void 0&&(this.startTime=e),this.uniforms.uTime.value=(e-this.startTime)/1e3,this.needsRender=!0},Object.defineProperty(n.prototype,"color1",{get:function(){return this.uniforms.uColor1.value},set:function(e){this.uniforms.uColor1.value=e,this.needsRender=!0},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"color2",{get:function(){return this.uniforms.uColor2.value},set:function(e){this.uniforms.uColor2.value=e,this.needsRender=!0},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"speed",{get:function(){return this.uniforms.uSpeed.value},set:function(e){this.uniforms.uSpeed.value=e},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"noise",{get:function(){return this.uniforms.uSpeed.value},set:function(e){this.uniforms.uSpeed.value=e,this.needsRender=!0},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"opacity",{get:function(){return this.uniforms.opacity.value},set:function(e){this.uniforms.uOpacity.value=e,this.needsRender=!0},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"fragmentationDegree",{get:function(){return this.defines.FRAGMENTATION_DEGREE},set:function(e){this.defines.FRAGMENTATION_DEGREE=e,this.traverse(function(t){t instanceof i.Mesh&&t.material instanceof i.ShaderMaterial&&(t.material.needsUpdate=!0)}),this.needsRender=!0},enumerable:!1,configurable:!0}),n}(i.Group),de=`
|
|
415
|
+
`),le=new i.SphereBufferGeometry(1,300,300),re=[],A=0;A<2;A++)re.push(new i.Vector2(Math.sin(A)/2+1,A*2-.8));var ue=new i.LatheBufferGeometry(re,300),ce=(function(r){w(n,r);function n(e){var t=r.call(this)||this;t.needsRender=!0;var o;if(e instanceof i.BufferGeometry)o=e;else switch(e){case"ring":o=ue;break;case"circle":default:o=le;break}t.uniforms={uTime:{value:0},uColor1:{value:new i.Color("rgb(255, 177, 20)")},uColor2:{value:new i.Color("rgb(255, 0, 0)")},uNoise:{value:1.2},uSpeed:{value:1},uOpacity:{value:1}},t.defines={FRAGMENTATION_DEGREE:2};var s=new i.Mesh(o,new i.ShaderMaterial({uniforms:t.uniforms,defines:t.defines,vertexShader:ie,fragmentShader:ne,transparent:!0,depthWrite:!1,side:i.BackSide})),a=new i.Mesh(o,new i.ShaderMaterial({uniforms:t.uniforms,defines:t.defines,vertexShader:ie,fragmentShader:ne,transparent:!0,depthWrite:!1,side:i.FrontSide}));return s.scale.setScalar(.1),a.scale.setScalar(.1),t.add(s),t.add(a),t}return n.prototype.setTime=function(e){this.startTime===void 0&&(this.startTime=e),this.uniforms.uTime.value=(e-this.startTime)/1e3,this.needsRender=!0},Object.defineProperty(n.prototype,"color1",{get:function(){return this.uniforms.uColor1.value},set:function(e){this.uniforms.uColor1.value=e,this.needsRender=!0},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"color2",{get:function(){return this.uniforms.uColor2.value},set:function(e){this.uniforms.uColor2.value=e,this.needsRender=!0},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"speed",{get:function(){return this.uniforms.uSpeed.value},set:function(e){this.uniforms.uSpeed.value=e},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"noise",{get:function(){return this.uniforms.uSpeed.value},set:function(e){this.uniforms.uSpeed.value=e,this.needsRender=!0},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"opacity",{get:function(){return this.uniforms.opacity.value},set:function(e){this.uniforms.uOpacity.value=e,this.needsRender=!0},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"fragmentationDegree",{get:function(){return this.defines.FRAGMENTATION_DEGREE},set:function(e){this.defines.FRAGMENTATION_DEGREE=e,this.traverse(function(t){t instanceof i.Mesh&&t.material instanceof i.ShaderMaterial&&(t.material.needsUpdate=!0)}),this.needsRender=!0},enumerable:!1,configurable:!0}),n})(i.Group),de=`
|
|
416
416
|
uniform vec3 uLightColor;
|
|
417
417
|
uniform vec3 uSpotPosition;
|
|
418
418
|
uniform float uAttenuation;
|
|
@@ -453,7 +453,7 @@ void main(){
|
|
|
453
453
|
|
|
454
454
|
gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );
|
|
455
455
|
}
|
|
456
|
-
`),pe=function(r){w(n,r);function n(e,t,o){e===void 0&&(e=1),t===void 0&&(t=.1),o===void 0&&(o=.2);var s=r.call(this)||this;s.needsRender=!0,s.uniforms={uTime:{value:0},uAttenuation:{value:e*.9},uAnglePower:{value:2},uSpotPosition:{value:s.position},uLightColor:{value:new i.Color(16777215)}};var a=new i.CylinderBufferGeometry(t,o,e,64,20,!0);a.applyMatrix4(new i.Matrix4().makeTranslation(0,-e/2,0)),a.applyMatrix4(new i.Matrix4().makeRotationX(-Math.PI/2));var l=new i.Mesh(a,new i.ShaderMaterial({uniforms:s.uniforms,vertexShader:ve,fragmentShader:de,transparent:!0,side:i.FrontSide,depthWrite:!1}));return s.add(l),s}return n.prototype.setTime=function(e){this.startTime===void 0&&(this.startTime=e),this.uniforms.uTime.value=(e-this.startTime)/1e3,this.needsRender=!0},Object.defineProperty(n.prototype,"attenuation",{get:function(){return this.uniforms.uAttenuation.value},set:function(e){this.uniforms.uAttenuation.value=e,this.needsRender=!0},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"anglePower",{get:function(){return this.uniforms.uAnglePower.value},set:function(e){this.uniforms.uAnglePower.value=e,this.needsRender=!0},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"color",{get:function(){return this.uniforms.uLightColor.value},set:function(e){this.uniforms.uLightColor.value=e,this.needsRender=!0},enumerable:!1,configurable:!0}),n}(i.Group),oe=`
|
|
456
|
+
`),pe=(function(r){w(n,r);function n(e,t,o){e===void 0&&(e=1),t===void 0&&(t=.1),o===void 0&&(o=.2);var s=r.call(this)||this;s.needsRender=!0,s.uniforms={uTime:{value:0},uAttenuation:{value:e*.9},uAnglePower:{value:2},uSpotPosition:{value:s.position},uLightColor:{value:new i.Color(16777215)}};var a=new i.CylinderBufferGeometry(t,o,e,64,20,!0);a.applyMatrix4(new i.Matrix4().makeTranslation(0,-e/2,0)),a.applyMatrix4(new i.Matrix4().makeRotationX(-Math.PI/2));var l=new i.Mesh(a,new i.ShaderMaterial({uniforms:s.uniforms,vertexShader:ve,fragmentShader:de,transparent:!0,side:i.FrontSide,depthWrite:!1}));return s.add(l),s}return n.prototype.setTime=function(e){this.startTime===void 0&&(this.startTime=e),this.uniforms.uTime.value=(e-this.startTime)/1e3,this.needsRender=!0},Object.defineProperty(n.prototype,"attenuation",{get:function(){return this.uniforms.uAttenuation.value},set:function(e){this.uniforms.uAttenuation.value=e,this.needsRender=!0},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"anglePower",{get:function(){return this.uniforms.uAnglePower.value},set:function(e){this.uniforms.uAnglePower.value=e,this.needsRender=!0},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"color",{get:function(){return this.uniforms.uLightColor.value},set:function(e){this.uniforms.uLightColor.value=e,this.needsRender=!0},enumerable:!1,configurable:!0}),n})(i.Group),oe=`
|
|
457
457
|
uniform vec3 uColor;
|
|
458
458
|
uniform float uOpacity;
|
|
459
459
|
varying vec3 vPosition;
|
|
@@ -486,7 +486,7 @@ void main(){
|
|
|
486
486
|
|
|
487
487
|
gl_Position = projectionMatrix * modelViewMatrix * transformed;
|
|
488
488
|
}
|
|
489
|
-
`),C=new i.PlaneBufferGeometry(1,1,200,200);C.translate(0,-.5,0);var fe=function(r){w(n,r);function n(){var e=r.call(this)||this;e.needsRender=!0;var t=e.outer=new i.Mesh(C,new i.ShaderMaterial({uniforms:{uTime:{value:0},uSpeed:{value:.75},uScale:{value:2},uExpand:{value:1.2},uColor:{value:new i.Color(.5,.5,.9)},uOpacity:{value:1}},vertexShader:ae,fragmentShader:oe,transparent:!0,side:i.DoubleSide,depthWrite:!1})),o=e.inner=new i.Mesh(C,new i.ShaderMaterial({uniforms:{uTime:{value:0},uSpeed:{value:2},uScale:{value:20},uExpand:{value:1.2},uColor:{value:new i.Color(1,1,1)},uOpacity:{value:.1}},vertexShader:ae,fragmentShader:oe,transparent:!0,side:i.DoubleSide,depthWrite:!1}));return t.rotateX(-Math.PI/2),o.rotateX(-Math.PI/2),e.add(t),e.add(o),e}return n.prototype.setTime=function(e){this.startTime===void 0&&(this.startTime=e);var t=(e-this.startTime)/1e3;this.inner.material.uniforms.uTime.value=t,this.outer.material.uniforms.uTime.value=t,this.needsRender=!0},Object.defineProperty(n.prototype,"expand",{get:function(){return this.outer.material.uniforms.uExpand.value},set:function(e){this.outer.material.uniforms.uExpand.value=e,this.inner.material.uniforms.uExpand.value=e,this.needsRender=!0},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"speed",{get:function(){return this.inner.material.uniforms.speed.value},set:function(e){this.inner.material.uniforms.speed.value=e,this.needsRender=!0},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"color",{get:function(){return this.outer.material.uniforms.color.value},set:function(e){this.outer.material.uniforms.color.value=e,this.needsRender=!0},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"flowColor",{get:function(){return this.inner.material.uniforms.color.value},set:function(e){this.inner.material.uniforms.color.value=e,this.needsRender=!0},enumerable:!1,configurable:!0}),n}(i.Group);function b(r,n){return r+n*(Math.random()-.5)}function _(r,n){var e=new i.Vector3(Math.random()-.5,Math.random()-.5,Math.random()-.5);return new i.Vector3().addVectors(r,new i.Vector3().multiplyVectors(n,e))}function P(r,n,e){return r*e+n*e*e/2}function he(r,n,e){return new i.Vector3(P(r.x,n.x,e),P(r.y,n.y,e),P(r.z,n.z,e))}function z(r,n){for(var e=r.times.length,t=0;t<e&&n>r.times[t];)t++;if(t==0)return r.values[0];if(t==e)return r.values[e-1];var o=(n-r.times[t-1])/(r.times[t]-r.times[t-1]),s=r.values[t-1],a=r.values[t];return typeof r.values[0]=="number"?s+o*(a-s):s.clone().lerp(a,o)}var me=function(){function r(n,e,t,o,s,a,l,u,d,v,p,c,f,y){this.birthTime=n,this.deathAge=e,this.position=t.clone(),this.velocity=o.clone(),this.acceleration=s.clone(),this.angle=a,this.angleVelocity=l,this.angleAcceleration=u,this.color=d,this.colorTween=v,this.size=p,this.sizeTween=c,this.opacity=f,this.opacityTween=y}return r.prototype.getAlive=function(n){return this.deathAge>n-this.birthTime},r.prototype.getState=function(n){var e=this.getAlive(n),t=Math.min(this.deathAge,n-this.birthTime),o=he(this.velocity,this.acceleration,t).add(this.position),s=P(this.angleVelocity,this.angleAcceleration,t)+this.angle,a=(this.sizeTween?z(this.sizeTween,t):0)+this.size,l=(this.colorTween?z(this.colorTween,t):new i.Vector3).add(this.color),u=new i.Color().setHSL(l.x,l.y,l.z),d=(this.opacityTween?z(this.opacityTween,t):0)+this.opacity;return{alive:e,age:t,position:o,angle:s,size:a,color:u,opacity:d}},r}(),ye=`
|
|
489
|
+
`),C=new i.PlaneBufferGeometry(1,1,200,200);C.translate(0,-.5,0);var fe=(function(r){w(n,r);function n(){var e=r.call(this)||this;e.needsRender=!0;var t=e.outer=new i.Mesh(C,new i.ShaderMaterial({uniforms:{uTime:{value:0},uSpeed:{value:.75},uScale:{value:2},uExpand:{value:1.2},uColor:{value:new i.Color(.5,.5,.9)},uOpacity:{value:1}},vertexShader:ae,fragmentShader:oe,transparent:!0,side:i.DoubleSide,depthWrite:!1})),o=e.inner=new i.Mesh(C,new i.ShaderMaterial({uniforms:{uTime:{value:0},uSpeed:{value:2},uScale:{value:20},uExpand:{value:1.2},uColor:{value:new i.Color(1,1,1)},uOpacity:{value:.1}},vertexShader:ae,fragmentShader:oe,transparent:!0,side:i.DoubleSide,depthWrite:!1}));return t.rotateX(-Math.PI/2),o.rotateX(-Math.PI/2),e.add(t),e.add(o),e}return n.prototype.setTime=function(e){this.startTime===void 0&&(this.startTime=e);var t=(e-this.startTime)/1e3;this.inner.material.uniforms.uTime.value=t,this.outer.material.uniforms.uTime.value=t,this.needsRender=!0},Object.defineProperty(n.prototype,"expand",{get:function(){return this.outer.material.uniforms.uExpand.value},set:function(e){this.outer.material.uniforms.uExpand.value=e,this.inner.material.uniforms.uExpand.value=e,this.needsRender=!0},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"speed",{get:function(){return this.inner.material.uniforms.speed.value},set:function(e){this.inner.material.uniforms.speed.value=e,this.needsRender=!0},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"color",{get:function(){return this.outer.material.uniforms.color.value},set:function(e){this.outer.material.uniforms.color.value=e,this.needsRender=!0},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"flowColor",{get:function(){return this.inner.material.uniforms.color.value},set:function(e){this.inner.material.uniforms.color.value=e,this.needsRender=!0},enumerable:!1,configurable:!0}),n})(i.Group);function b(r,n){return r+n*(Math.random()-.5)}function _(r,n){var e=new i.Vector3(Math.random()-.5,Math.random()-.5,Math.random()-.5);return new i.Vector3().addVectors(r,new i.Vector3().multiplyVectors(n,e))}function P(r,n,e){return r*e+n*e*e/2}function he(r,n,e){return new i.Vector3(P(r.x,n.x,e),P(r.y,n.y,e),P(r.z,n.z,e))}function z(r,n){for(var e=r.times.length,t=0;t<e&&n>r.times[t];)t++;if(t==0)return r.values[0];if(t==e)return r.values[e-1];var o=(n-r.times[t-1])/(r.times[t]-r.times[t-1]),s=r.values[t-1],a=r.values[t];return typeof r.values[0]=="number"?s+o*(a-s):s.clone().lerp(a,o)}var me=(function(){function r(n,e,t,o,s,a,l,u,d,v,p,c,f,y){this.birthTime=n,this.deathAge=e,this.position=t.clone(),this.velocity=o.clone(),this.acceleration=s.clone(),this.angle=a,this.angleVelocity=l,this.angleAcceleration=u,this.color=d,this.colorTween=v,this.size=p,this.sizeTween=c,this.opacity=f,this.opacityTween=y}return r.prototype.getAlive=function(n){return this.deathAge>n-this.birthTime},r.prototype.getState=function(n){var e=this.getAlive(n),t=Math.min(this.deathAge,n-this.birthTime),o=he(this.velocity,this.acceleration,t).add(this.position),s=P(this.angleVelocity,this.angleAcceleration,t)+this.angle,a=(this.sizeTween?z(this.sizeTween,t):0)+this.size,l=(this.colorTween?z(this.colorTween,t):new i.Vector3).add(this.color),u=new i.Color().setHSL(l.x,l.y,l.z),d=(this.opacityTween?z(this.opacityTween,t):0)+this.opacity;return{alive:e,age:t,position:o,angle:s,size:a,color:u,opacity:d}},r})(),ye=`
|
|
490
490
|
attribute vec3 color;
|
|
491
491
|
attribute float opacity;
|
|
492
492
|
attribute float size;
|
|
@@ -536,4 +536,4 @@ void main() {
|
|
|
536
536
|
gl_FragColor = vColor * rotatedTexture;
|
|
537
537
|
#endif
|
|
538
538
|
}
|
|
539
|
-
`,be=function(r){w(n,r);function n(e){var t=this,o,s,a,l,u,d,v,p,c,f,y,S,m,B,R,N,V,O,j,F,D,U,G,I,X,H,k,L,q,W,Y,Z,$,J,Q,K,ee,te,g=new i.BufferGeometry;g.setAttribute("position",new i.BufferAttribute(new Float32Array,3)),g.setAttribute("alive",new i.BufferAttribute(new Float32Array,1)),g.setAttribute("color",new i.BufferAttribute(new Float32Array,3)),g.setAttribute("opacity",new i.BufferAttribute(new Float32Array,1)),g.setAttribute("size",new i.BufferAttribute(new Float32Array,1)),g.setAttribute("angle",new i.BufferAttribute(new Float32Array,1));var xe=new i.ShaderMaterial({uniforms:{map:{value:(o=e.texture)!==null&&o!==void 0?o:null}},defines:{USE_MAP:!!e.texture},vertexShader:ye,fragmentShader:ge,transparent:!0,blending:(s=e.blending)!==null&&s!==void 0?s:i.NormalBlending,depthWrite:!1});return t=r.call(this,g,xe)||this,t.instances=[],t.needsRender=!0,t.birthTime=Date.now()/1e3,t.disposed=!1,t.paused=!1,t.positionBase=(l=(a=e.positionBase)===null||a===void 0?void 0:a.clone())!==null&&l!==void 0?l:new i.Vector3,t.positionStyle=(u=e.positionStyle)!==null&&u!==void 0?u:"CUBE",t.positionCubeSpread=(v=(d=e.positionCubeSpread)===null||d===void 0?void 0:d.clone())!==null&&v!==void 0?v:new i.Vector3,t.positionSphereSpread=(p=e.positionSphereSpread)!==null&&p!==void 0?p:0,t.velocityStyle=(c=e.velocityStyle)!==null&&c!==void 0?c:"CUBE",t.velocityCubeBase=(y=(f=e.velocityCubeBase)===null||f===void 0?void 0:f.clone())!==null&&y!==void 0?y:new i.Vector3,t.velocityCubeSpread=(m=(S=e.velocityCubeSpread)===null||S===void 0?void 0:S.clone())!==null&&m!==void 0?m:new i.Vector3,t.velocitySphereBase=(B=e.velocitySphereBase)!==null&&B!==void 0?B:0,t.velocitySphereSpread=(R=e.velocitySphereSpread)!==null&&R!==void 0?R:0,t.accelerationBase=(V=(N=e.accelerationBase)===null||N===void 0?void 0:N.clone())!==null&&V!==void 0?V:new i.Vector3,t.accelerationSpread=(j=(O=e.accelerationSpread)===null||O===void 0?void 0:O.clone())!==null&&j!==void 0?j:new i.Vector3,t.angleBase=(F=e.angleBase)!==null&&F!==void 0?F:0,t.angleSpread=(D=e.angleSpread)!==null&&D!==void 0?D:0,t.angleVelocityBase=(U=e.angleVelocityBase)!==null&&U!==void 0?U:0,t.angleVelocitySpread=(G=e.angleVelocitySpread)!==null&&G!==void 0?G:0,t.angleAccelerationBase=(I=e.angleAccelerationBase)!==null&&I!==void 0?I:0,t.angleAccelerationSpread=(X=e.angleAccelerationSpread)!==null&&X!==void 0?X:0,t.sizeBase=(H=e.sizeBase)!==null&&H!==void 0?H:.1,t.sizeSpread=(k=e.sizeSpread)!==null&&k!==void 0?k:0,t.sizeTween=(L=e.sizeTween)!==null&&L!==void 0?L:null,t.colorBase=(W=(q=e.colorBase)===null||q===void 0?void 0:q.clone())!==null&&W!==void 0?W:new i.Vector3,t.colorSpread=(Z=(Y=e.colorSpread)===null||Y===void 0?void 0:Y.clone())!==null&&Z!==void 0?Z:new i.Vector3,t.colorTween=($=e.colorTween)!==null&&$!==void 0?$:null,t.opacityBase=((J=e.opacityBase)!==null&&J!==void 0?J:e.opacityTween)?0:1,t.opacitySpread=(Q=e.opacitySpread)!==null&&Q!==void 0?Q:0,t.opacityTween=(K=e.opacityTween)!==null&&K!==void 0?K:null,t.particlesPerSecond=(ee=e.particlesPerSecond)!==null&&ee!==void 0?ee:60,t.particleDeathAge=(te=e.particleDeathAge)!==null&&te!==void 0?te:1,t}return Object.defineProperty(n.prototype,"texture",{get:function(){return this.material.uniforms.map.value},set:function(e){this.material.uniforms.map.value=e,e===null?this.material.defines.USE_MAP!==!1&&(this.material.defines.USE_MAP=!1,this.material.needsUpdate=!0):this.material.defines.USE_MAP!==!0&&(this.material.defines.USE_MAP=!0,this.material.needsUpdate=!0)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"blending",{get:function(){return this.material.blending},set:function(e){this.material.blending=e},enumerable:!1,configurable:!0}),n.prototype.createInstance=function(e){var t=this.positionBase.clone();switch(this.positionStyle){case"CUBE":{t=_(this.positionBase,this.positionCubeSpread);break}case"SPHERE":{var o=2*Math.random()-1,s=Math.PI*2*Math.random(),a=Math.sqrt(1-o*o),l=new i.Vector3(a*Math.cos(s),a*Math.sin(s),o);t=new i.Vector3().addVectors(this.positionBase,l.multiplyScalar(this.positionSphereSpread));break}}var u=new i.Vector3;switch(this.velocityStyle){case"CUBE":{u=_(this.velocityCubeBase,this.velocityCubeSpread);break}case"SPHERE":{var d=new i.Vector3().subVectors(t,this.positionBase),v=b(this.velocitySphereBase,this.velocitySphereSpread);u=d.normalize().multiplyScalar(v);break}}var p=new me(e,this.particleDeathAge,t,u,_(this.accelerationBase,this.accelerationSpread),b(this.angleBase,this.angleSpread),b(this.angleVelocityBase,this.angleVelocitySpread),b(this.angleAccelerationBase,this.angleAccelerationSpread),_(this.colorBase,this.colorSpread),this.colorTween,b(this.sizeBase,this.sizeSpread),this.sizeTween,b(this.opacityBase,this.opacitySpread),this.opacityTween);return p},n.prototype.pause=function(){this.paused!==!0&&(this.paused=!0,this.birthTime=Date.now()/1e3)},n.prototype.play=function(){this.paused!==!1&&(this.paused=!1,this.birthTime=Date.now()/1e3)},n.prototype.setTime=function(e){if(!this.disposed){e/=1e3;var t=e-this.birthTime,o=Math.ceil(this.particlesPerSecond*this.particleDeathAge);if(this.geometry.attributes.position.count<o){var s=new Float32Array(o*3);s.set(this.geometry.attributes.position.array,0);var a=new i.BufferAttribute(s,3);a.needsUpdate=!0,this.geometry.setAttribute("position",a)}if(this.geometry.attributes.alive.count<o){var l=new Float32Array(o);l.set(this.geometry.attributes.alive.array,0);var a=new i.BufferAttribute(l,1);a.needsUpdate=!0,this.geometry.setAttribute("alive",a)}if(this.geometry.attributes.color.count<o){var u=new Float32Array(o*3);u.set(this.geometry.attributes.color.array,0);var a=new i.BufferAttribute(u,3);a.needsUpdate=!0,this.geometry.setAttribute("color",a)}if(this.geometry.attributes.opacity.count<o){var d=new Float32Array(o);d.set(this.geometry.attributes.opacity.array,0);var a=new i.BufferAttribute(d,1);a.needsUpdate=!0,this.geometry.setAttribute("opacity",a)}if(this.geometry.attributes.size.count<o){var v=new Float32Array(o);v.set(this.geometry.attributes.size.array,0);var a=new i.BufferAttribute(v,1);a.needsUpdate=!0,this.geometry.setAttribute("size",a)}if(this.geometry.attributes.angle.count<o){var p=new Float32Array(o);p.set(this.geometry.attributes.angle.array,0);var a=new i.BufferAttribute(p,1);a.needsUpdate=!0,this.geometry.setAttribute("angle",a)}this.instances.length<o&&(this.instances.length=o);for(var c=0;c<this.instances.length;c++){var f=this.instances[c];if(c<o&&this.paused===!1&&(f===void 0||f.getAlive(e)===!1)){var y=this.particleDeathAge/o*c;if(t>y){var S=e-(t-y)%this.particleDeathAge;this.instances[c]=f=this.createInstance(S)}}if(f){var m=f.getState(e),s=m.position,l=m.alive,u=m.color,d=m.opacity,v=m.size,p=m.angle;this.geometry.attributes.position.setXYZ(c,s.x,s.y,s.z),this.geometry.attributes.position.needsUpdate=!0,this.geometry.attributes.alive.setX(c,l?1:0),this.geometry.attributes.alive.needsUpdate=!0,this.geometry.attributes.color.setXYZ(c,u.r,u.g,u.b),this.geometry.attributes.color.needsUpdate=!0,this.geometry.attributes.opacity.setX(c,d),this.geometry.attributes.opacity.needsUpdate=!0,this.geometry.attributes.size.setX(c,v),this.geometry.attributes.size.needsUpdate=!0,this.geometry.attributes.angle.setX(c,p),this.geometry.attributes.angle.needsUpdate=!0}}this.geometry.computeBoundingBox(),this.geometry.boundingSphere||(this.geometry.boundingSphere=new i.Sphere),this.geometry.boundingBox.getBoundingSphere(this.geometry.boundingSphere),this.needsRender=!0}},n.prototype.dispose=function(){var e;this.disposed=!0,this.geometry.dispose(),(e=this.texture)===null||e===void 0||e.dispose(),this.material.dispose()},n}(i.Points);h.Airflow=fe,h.Flame=ce,h.Particle=be,h.SpotLight=pe,Object.defineProperty(h,Symbol.toStringTag,{value:"Module"})});
|
|
539
|
+
`,be=(function(r){w(n,r);function n(e){var t=this,o,s,a,l,u,d,v,p,c,f,y,S,m,B,R,N,V,O,j,F,D,U,G,I,X,H,k,L,q,W,Y,Z,$,J,Q,K,ee,te,g=new i.BufferGeometry;g.setAttribute("position",new i.BufferAttribute(new Float32Array,3)),g.setAttribute("alive",new i.BufferAttribute(new Float32Array,1)),g.setAttribute("color",new i.BufferAttribute(new Float32Array,3)),g.setAttribute("opacity",new i.BufferAttribute(new Float32Array,1)),g.setAttribute("size",new i.BufferAttribute(new Float32Array,1)),g.setAttribute("angle",new i.BufferAttribute(new Float32Array,1));var xe=new i.ShaderMaterial({uniforms:{map:{value:(o=e.texture)!==null&&o!==void 0?o:null}},defines:{USE_MAP:!!e.texture},vertexShader:ye,fragmentShader:ge,transparent:!0,blending:(s=e.blending)!==null&&s!==void 0?s:i.NormalBlending,depthWrite:!1});return t=r.call(this,g,xe)||this,t.instances=[],t.needsRender=!0,t.birthTime=Date.now()/1e3,t.disposed=!1,t.paused=!1,t.positionBase=(l=(a=e.positionBase)===null||a===void 0?void 0:a.clone())!==null&&l!==void 0?l:new i.Vector3,t.positionStyle=(u=e.positionStyle)!==null&&u!==void 0?u:"CUBE",t.positionCubeSpread=(v=(d=e.positionCubeSpread)===null||d===void 0?void 0:d.clone())!==null&&v!==void 0?v:new i.Vector3,t.positionSphereSpread=(p=e.positionSphereSpread)!==null&&p!==void 0?p:0,t.velocityStyle=(c=e.velocityStyle)!==null&&c!==void 0?c:"CUBE",t.velocityCubeBase=(y=(f=e.velocityCubeBase)===null||f===void 0?void 0:f.clone())!==null&&y!==void 0?y:new i.Vector3,t.velocityCubeSpread=(m=(S=e.velocityCubeSpread)===null||S===void 0?void 0:S.clone())!==null&&m!==void 0?m:new i.Vector3,t.velocitySphereBase=(B=e.velocitySphereBase)!==null&&B!==void 0?B:0,t.velocitySphereSpread=(R=e.velocitySphereSpread)!==null&&R!==void 0?R:0,t.accelerationBase=(V=(N=e.accelerationBase)===null||N===void 0?void 0:N.clone())!==null&&V!==void 0?V:new i.Vector3,t.accelerationSpread=(j=(O=e.accelerationSpread)===null||O===void 0?void 0:O.clone())!==null&&j!==void 0?j:new i.Vector3,t.angleBase=(F=e.angleBase)!==null&&F!==void 0?F:0,t.angleSpread=(D=e.angleSpread)!==null&&D!==void 0?D:0,t.angleVelocityBase=(U=e.angleVelocityBase)!==null&&U!==void 0?U:0,t.angleVelocitySpread=(G=e.angleVelocitySpread)!==null&&G!==void 0?G:0,t.angleAccelerationBase=(I=e.angleAccelerationBase)!==null&&I!==void 0?I:0,t.angleAccelerationSpread=(X=e.angleAccelerationSpread)!==null&&X!==void 0?X:0,t.sizeBase=(H=e.sizeBase)!==null&&H!==void 0?H:.1,t.sizeSpread=(k=e.sizeSpread)!==null&&k!==void 0?k:0,t.sizeTween=(L=e.sizeTween)!==null&&L!==void 0?L:null,t.colorBase=(W=(q=e.colorBase)===null||q===void 0?void 0:q.clone())!==null&&W!==void 0?W:new i.Vector3,t.colorSpread=(Z=(Y=e.colorSpread)===null||Y===void 0?void 0:Y.clone())!==null&&Z!==void 0?Z:new i.Vector3,t.colorTween=($=e.colorTween)!==null&&$!==void 0?$:null,t.opacityBase=((J=e.opacityBase)!==null&&J!==void 0?J:e.opacityTween)?0:1,t.opacitySpread=(Q=e.opacitySpread)!==null&&Q!==void 0?Q:0,t.opacityTween=(K=e.opacityTween)!==null&&K!==void 0?K:null,t.particlesPerSecond=(ee=e.particlesPerSecond)!==null&&ee!==void 0?ee:60,t.particleDeathAge=(te=e.particleDeathAge)!==null&&te!==void 0?te:1,t}return Object.defineProperty(n.prototype,"texture",{get:function(){return this.material.uniforms.map.value},set:function(e){this.material.uniforms.map.value=e,e===null?this.material.defines.USE_MAP!==!1&&(this.material.defines.USE_MAP=!1,this.material.needsUpdate=!0):this.material.defines.USE_MAP!==!0&&(this.material.defines.USE_MAP=!0,this.material.needsUpdate=!0)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"blending",{get:function(){return this.material.blending},set:function(e){this.material.blending=e},enumerable:!1,configurable:!0}),n.prototype.createInstance=function(e){var t=this.positionBase.clone();switch(this.positionStyle){case"CUBE":{t=_(this.positionBase,this.positionCubeSpread);break}case"SPHERE":{var o=2*Math.random()-1,s=Math.PI*2*Math.random(),a=Math.sqrt(1-o*o),l=new i.Vector3(a*Math.cos(s),a*Math.sin(s),o);t=new i.Vector3().addVectors(this.positionBase,l.multiplyScalar(this.positionSphereSpread));break}}var u=new i.Vector3;switch(this.velocityStyle){case"CUBE":{u=_(this.velocityCubeBase,this.velocityCubeSpread);break}case"SPHERE":{var d=new i.Vector3().subVectors(t,this.positionBase),v=b(this.velocitySphereBase,this.velocitySphereSpread);u=d.normalize().multiplyScalar(v);break}}var p=new me(e,this.particleDeathAge,t,u,_(this.accelerationBase,this.accelerationSpread),b(this.angleBase,this.angleSpread),b(this.angleVelocityBase,this.angleVelocitySpread),b(this.angleAccelerationBase,this.angleAccelerationSpread),_(this.colorBase,this.colorSpread),this.colorTween,b(this.sizeBase,this.sizeSpread),this.sizeTween,b(this.opacityBase,this.opacitySpread),this.opacityTween);return p},n.prototype.pause=function(){this.paused!==!0&&(this.paused=!0,this.birthTime=Date.now()/1e3)},n.prototype.play=function(){this.paused!==!1&&(this.paused=!1,this.birthTime=Date.now()/1e3)},n.prototype.setTime=function(e){if(!this.disposed){e/=1e3;var t=e-this.birthTime,o=Math.ceil(this.particlesPerSecond*this.particleDeathAge);if(this.geometry.attributes.position.count<o){var s=new Float32Array(o*3);s.set(this.geometry.attributes.position.array,0);var a=new i.BufferAttribute(s,3);a.needsUpdate=!0,this.geometry.setAttribute("position",a)}if(this.geometry.attributes.alive.count<o){var l=new Float32Array(o);l.set(this.geometry.attributes.alive.array,0);var a=new i.BufferAttribute(l,1);a.needsUpdate=!0,this.geometry.setAttribute("alive",a)}if(this.geometry.attributes.color.count<o){var u=new Float32Array(o*3);u.set(this.geometry.attributes.color.array,0);var a=new i.BufferAttribute(u,3);a.needsUpdate=!0,this.geometry.setAttribute("color",a)}if(this.geometry.attributes.opacity.count<o){var d=new Float32Array(o);d.set(this.geometry.attributes.opacity.array,0);var a=new i.BufferAttribute(d,1);a.needsUpdate=!0,this.geometry.setAttribute("opacity",a)}if(this.geometry.attributes.size.count<o){var v=new Float32Array(o);v.set(this.geometry.attributes.size.array,0);var a=new i.BufferAttribute(v,1);a.needsUpdate=!0,this.geometry.setAttribute("size",a)}if(this.geometry.attributes.angle.count<o){var p=new Float32Array(o);p.set(this.geometry.attributes.angle.array,0);var a=new i.BufferAttribute(p,1);a.needsUpdate=!0,this.geometry.setAttribute("angle",a)}this.instances.length<o&&(this.instances.length=o);for(var c=0;c<this.instances.length;c++){var f=this.instances[c];if(c<o&&this.paused===!1&&(f===void 0||f.getAlive(e)===!1)){var y=this.particleDeathAge/o*c;if(t>y){var S=e-(t-y)%this.particleDeathAge;this.instances[c]=f=this.createInstance(S)}}if(f){var m=f.getState(e),s=m.position,l=m.alive,u=m.color,d=m.opacity,v=m.size,p=m.angle;this.geometry.attributes.position.setXYZ(c,s.x,s.y,s.z),this.geometry.attributes.position.needsUpdate=!0,this.geometry.attributes.alive.setX(c,l?1:0),this.geometry.attributes.alive.needsUpdate=!0,this.geometry.attributes.color.setXYZ(c,u.r,u.g,u.b),this.geometry.attributes.color.needsUpdate=!0,this.geometry.attributes.opacity.setX(c,d),this.geometry.attributes.opacity.needsUpdate=!0,this.geometry.attributes.size.setX(c,v),this.geometry.attributes.size.needsUpdate=!0,this.geometry.attributes.angle.setX(c,p),this.geometry.attributes.angle.needsUpdate=!0}}this.geometry.computeBoundingBox(),this.geometry.boundingSphere||(this.geometry.boundingSphere=new i.Sphere),this.geometry.boundingBox.getBoundingSphere(this.geometry.boundingSphere),this.needsRender=!0}},n.prototype.dispose=function(){var e;this.disposed=!0,this.geometry.dispose(),(e=this.texture)===null||e===void 0||e.dispose(),this.material.dispose()},n})(i.Points);h.Airflow=fe,h.Flame=ce,h.Particle=be,h.SpotLight=pe,Object.defineProperty(h,Symbol.toStringTag,{value:"Module"})}));
|
package/umd/five-vue.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
|
-
*/(function(u,t){typeof exports=="object"&&typeof module!="undefined"?t(exports,require("vue"),require("@realsee/five"),require("three")):typeof define=="function"&&define.amd?define(["exports","vue","@realsee/five","three"],t):(u=typeof globalThis!="undefined"?globalThis:u||self,t(u.FiveSDK_Vue={},u.Vue,u.FiveSDK,u.THREE))})(this,function(u,t,p,O){"use strict";function P(e){const n=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const r in e)if(r!=="default"){const o=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(n,r,o.get?o:{enumerable:!0,get:()=>e[r]})}}return n.default=e,Object.freeze(n)}const d=P(O);var g=function(){return g=Object.assign||function(n){for(var r,o=1,a=arguments.length;o<a;o++){r=arguments[o];for(var f in r)Object.prototype.hasOwnProperty.call(r,f)&&(n[f]=r[f])}return n},g.apply(this,arguments)};typeof SuppressedError=="function"&&SuppressedError;var b=!1;function U(e){b=e}var F=Symbol();function s(){var e=t.inject(F);if(!e)throw new Error("Inject five error!");return e}var W={display:"inline-block",overflow:"hidden"},_=t.defineComponent({props:{width:{type:Number,required:!0},height:{type:Number,required:!0}},setup:function(e){var n=t.toRef(e,"width"),r=t.toRef(e,"height"),o=s(),a=t.ref(null);return t.watch([n,r,a],function(){if(o.renderer&&a.value){if(o.renderer.domElement.parentNode!==null&&o.renderer.domElement.parentNode!==a.value)throw new Error("There are more than 2 fiveCanvas in this context.");o.renderer.domElement.parentNode!==a.value&&a.value.appendChild(o.renderer.domElement),o.camera.aspect=n.value/r.value,o.camera.updateProjectionMatrix(),o.renderer.setSize(n.value,r.value),o.refresh({width:n.value,height:r.value}),o.needsRender=!0}}),function(){return t.h("div",{id:"five",style:g({width:"".concat(n.value,"px"),height:"".concat(r.value,"px")},W),ref:a})}}}),m=[],w=[];function D(e){var n=e===void 0?{}:e,r=n.backgroundColor,o=r===void 0?1579548:r,a=n.backgroundAlpha,f=a===void 0?1:a,i=n.preserveDrawingBuffer,c=i===void 0?!0:i,l=n.pixelRatio,h=l===void 0?1:l,k=n.webgl2,j=k===void 0?!1:k;if(typeof window!="undefined"){var v=null;if(j?v=m.shift():v=w.shift(),!v){if(j){var E=document.createElement("canvas"),B=E.getContext("webgl2");B?v=new d.WebGLRenderer({preserveDrawingBuffer:c,antialias:!0,alpha:!0,stencil:!0,canvas:E,context:B}):(console.error("error occurred when getting webgl2 canvas context, mybe webgl2 not support, fallback to webgl."),v=new d.WebGLRenderer({preserveDrawingBuffer:c,antialias:!1,alpha:!0,stencil:!0}))}else v=new d.WebGLRenderer({preserveDrawingBuffer:c,antialias:!1,alpha:!0,stencil:!0});v.outputEncoding=d.sRGBEncoding}return v.setPixelRatio(h),v.setClearColor(o,f),v.autoClear=!0,v}}function A(e){if(e){var n=e.capabilities.isWebGL2;n?w.indexOf(e)===-1&&w.push(e):m.indexOf(e)===-1&&m.push(e)}}function L(e,n){var r=Array.isArray(e)?e:[e],o=Array.isArray(n)?n:[n];if(r.length!==o.length)return!1;for(var a=0;a<r.length;a++)if(r[a]!==o[a])return!1;return!0}var I=t.defineComponent({props:{works:Object,initialWorks:Object,initialState:Object,initialUserAction:Boolean,onWorksChange:Function,onStateChange:Function,onCurrentStateChange:Function,onError:Function,fiveInitArgs:{type:Object,default:function(){return{}}},style:Object},setup:function(e){var n,r=t.toRefs(e).works,o=p.getViewportScale(),a=o===1?window.devicePixelRatio:1,f=D({pixelRatio:a}),i=new p.Five(g({renderer:f},e.fiveInitArgs)),c=e.works||e.initialWorks;return c&&i.load(c,e.initialState,void 0,(n=e.initialUserAction)!==null&&n!==void 0?n:!0),U(!!e.works),r&&t.watch(r,function(l,h){l&&!L(l,i.works)&&i.load(l,e.initialState)}),t.onBeforeUnmount(function(){i&&(i.dispose(),A(i.renderer))}),i.on("load",function(){e.onWorksChange&&i.works&&e.onWorksChange(i==null?void 0:i.works)}),i.on("stateChange",function(l,h){e.onStateChange&&e.onStateChange(l,h)}),i.on("currentStateChange",function(l,h){e.onCurrentStateChange&&e.onCurrentStateChange(l,h)}),i.on("error",function(l){e.onError?e.onError(l):console.warn(l.message)}),t.provide(F,i),{five:t.shallowReadonly(i)}},render:function(){return t.h("div",{style:this.$props.style},this.$slots)}});function V(){var e=s(),n=t.ref(e.works),r=t.readonly(n),o=function(f,i,c,l){if(b)throw new Error("props 'work' is set in fiveProvider, if you need modify work internal, use 'initialWork' instead.");return e.load(f,i,c,l)},a=e.on("load",function(){n.value=e.works});return t.onBeforeUnmount(function(){a()}),[r,o]}function H(){var e=s(),n=t.ref(g({},e.state)),r=e.on("stateChange",function(a){Object.assign(n.value,g({},a))});t.onBeforeUnmount(function(){r()});var o=function(a,f,i){f===void 0&&(f=!1),i===void 0&&(i=!0);var c=typeof a=="function"?a(e.getCurrentState()):a;e.setState(c,f,i)};return[n,o]}function M(){var e=s(),n=t.ref(e.getCurrentState()),r=e.on("currentStateChange",function(){Object.assign(n.value,e.getCurrentState())});t.onBeforeUnmount(function(){r()});var o=function(a,f,i){var c=typeof a=="function"?a(e.getCurrentState()):a;e.setState(c,f,i)};return[n,o]}function T(){var e=s(),n=t.reactive(e.getCurrentState()),r=t.ref(e.works.getObserver(e.pano)),o=e.on("currentStateChange",function(){Object.assign(n,e.getCurrentState()),r.value=e.works.getObserver({workCode:n.workCode,panoIndex:n.panoIndex})});return t.onBeforeUnmount(function(){o()}),r}function q(e,n){var r=s(),o=r.on(e,n);t.onBeforeUnmount(function(){o()})}function N(){var e=s(),n=function(c,l){return e.updateCamera(c,l)},r=e.getPixels.bind(e),o=function(c){return e.render(c)},a=function(){return e.needsRender=!0},f=function(c,l){return e.preloadPano(c,l)},i=function(c,l){return l===void 0&&(l=!1),e.project2d(c,l)};return{updateCamera:n,getPixels:r,render:o,needsRender:a,preloadPano:f,project2d:i}}function x(e,n){n===void 0&&(n=!1);var r=s(),o=t.ref(Symbol()),a=t.shallowRef(e?r.project2d(t.isRef(e)?e.value:e,n):null),f=r.on("cameraUpdate",function(){o.value=Symbol()});return t.onBeforeUnmount(function(){f()}),t.watch([o,e],function(){a.value=r.project2d(t.isRef(e)?e.value:e,n)}),a}function G(){return x}function C(e){var n=e.camera.getWorldDirection(new d.Vector3),r=new d.Raycaster(e.camera.position,n);return r}function K(){var e=s(),n=t.shallowRef(C(e)),r=e.on("cameraUpdate",function(){n.value=C(e)});return t.onBeforeUnmount(function(){r()}),n}function y(e){return e.camera.getWorldDirection(new d.Vector3)}function $(){var e=s(),n=t.shallowRef(y(e)),r=e.on("cameraUpdate",function(){n.value=y(e)});return t.onBeforeUnmount(function(){r()}),n}function z(e){var n=s(),r=t.shallowRef([]);return t.watch(e,function(){r.value=n.model.intersectRaycaster(t.isRef(e)?e.value:e)}),r}function J(){return z}function S(e){return e.model.empty?"Empty":"Loaded"}function Q(){var e=s(),n=t.ref(S(e)),r=e.on("modelLoaded",function(){n.value=S(e)});return t.onBeforeUnmount(function(){r()}),n}function X(){var e=s(),n=t.ref(e.model.shownFloor),r=t.ref(e.model.floorLength),o=function(f){typeof f=="number"?e.model.show(f):e.model.show()},a=[];return a.push(e.on("modelShownFloorChange",function(){n.value=e.model.shownFloor})),a.push(e.on("modelLoaded",function(){r.value=e.model.floorLength})),t.onBeforeUnmount(function(){for(var f;f=a.shift();)f()}),[n,r,o]}function Y(){var e=s(),n=t.ref(e.helperVisible),r=function(a){e.helperVisible=a},o=e.on("helpersVisibleChange",function(a){n.value=a});return t.onBeforeUnmount(function(){o()}),[n,r]}function Z(){return s()}function R(e){return e.model.bounding.clone()}function ee(){var e=s(),n=t.shallowRef(R(e)),r=e.on("modelLoaded",function(){n.value=R(e)});return t.onBeforeUnmount(function(){r()}),n}function ne(){var e=s();return e.scene}function re(){var e=s(),n=t.shallowRef(e.model),r=e.on("modelLoaded",function(){n.value=e.model});return t.onBeforeUnmount(function(){r()}),n}u.FiveCanvas=_,u.FiveProvider=I,u.unsafe__useFiveInject=Z,u.useFiveAction=N,u.useFiveCameraDirection=$,u.useFiveCameraRaycaster=K,u.useFiveCurrentObserver=T,u.useFiveCurrentState=M,u.useFiveEventCallback=q,u.useFiveFloor=X,u.useFiveHelper=Y,u.useFiveModel=re,u.useFiveModelBounding=ee,u.useFiveModelIntersectRaycaster=J,u.useFiveModelReadyState=Q,u.useFiveProject2d=G,u.useFiveScene=ne,u.useFiveState=H,u.useFiveWorks=V,Object.defineProperty(u,Symbol.toStringTag,{value:"Module"})});
|
|
255
|
+
*/(function(u,t){typeof exports=="object"&&typeof module!="undefined"?t(exports,require("vue"),require("@realsee/five"),require("three")):typeof define=="function"&&define.amd?define(["exports","vue","@realsee/five","three"],t):(u=typeof globalThis!="undefined"?globalThis:u||self,t(u.FiveSDK_Vue={},u.Vue,u.FiveSDK,u.THREE))})(this,(function(u,t,p,O){"use strict";function P(e){const n=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const r in e)if(r!=="default"){const o=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(n,r,o.get?o:{enumerable:!0,get:()=>e[r]})}}return n.default=e,Object.freeze(n)}const d=P(O);var g=function(){return g=Object.assign||function(n){for(var r,o=1,a=arguments.length;o<a;o++){r=arguments[o];for(var f in r)Object.prototype.hasOwnProperty.call(r,f)&&(n[f]=r[f])}return n},g.apply(this,arguments)};typeof SuppressedError=="function"&&SuppressedError;var b=!1;function U(e){b=e}var F=Symbol();function s(){var e=t.inject(F);if(!e)throw new Error("Inject five error!");return e}var W={display:"inline-block",overflow:"hidden"},_=t.defineComponent({props:{width:{type:Number,required:!0},height:{type:Number,required:!0}},setup:function(e){var n=t.toRef(e,"width"),r=t.toRef(e,"height"),o=s(),a=t.ref(null);return t.watch([n,r,a],function(){if(o.renderer&&a.value){if(o.renderer.domElement.parentNode!==null&&o.renderer.domElement.parentNode!==a.value)throw new Error("There are more than 2 fiveCanvas in this context.");o.renderer.domElement.parentNode!==a.value&&a.value.appendChild(o.renderer.domElement),o.camera.aspect=n.value/r.value,o.camera.updateProjectionMatrix(),o.renderer.setSize(n.value,r.value),o.refresh({width:n.value,height:r.value}),o.needsRender=!0}}),function(){return t.h("div",{id:"five",style:g({width:"".concat(n.value,"px"),height:"".concat(r.value,"px")},W),ref:a})}}}),m=[],w=[];function D(e){var n=e===void 0?{}:e,r=n.backgroundColor,o=r===void 0?1579548:r,a=n.backgroundAlpha,f=a===void 0?1:a,i=n.preserveDrawingBuffer,c=i===void 0?!0:i,l=n.pixelRatio,h=l===void 0?1:l,k=n.webgl2,j=k===void 0?!1:k;if(typeof window!="undefined"){var v=null;if(j?v=m.shift():v=w.shift(),!v){if(j){var E=document.createElement("canvas"),B=E.getContext("webgl2");B?v=new d.WebGLRenderer({preserveDrawingBuffer:c,antialias:!0,alpha:!0,stencil:!0,canvas:E,context:B}):(console.error("error occurred when getting webgl2 canvas context, mybe webgl2 not support, fallback to webgl."),v=new d.WebGLRenderer({preserveDrawingBuffer:c,antialias:!1,alpha:!0,stencil:!0}))}else v=new d.WebGLRenderer({preserveDrawingBuffer:c,antialias:!1,alpha:!0,stencil:!0});v.outputEncoding=d.sRGBEncoding}return v.setPixelRatio(h),v.setClearColor(o,f),v.autoClear=!0,v}}function A(e){if(e){var n=e.capabilities.isWebGL2;n?w.indexOf(e)===-1&&w.push(e):m.indexOf(e)===-1&&m.push(e)}}function L(e,n){var r=Array.isArray(e)?e:[e],o=Array.isArray(n)?n:[n];if(r.length!==o.length)return!1;for(var a=0;a<r.length;a++)if(r[a]!==o[a])return!1;return!0}var I=t.defineComponent({props:{works:Object,initialWorks:Object,initialState:Object,initialUserAction:Boolean,onWorksChange:Function,onStateChange:Function,onCurrentStateChange:Function,onError:Function,fiveInitArgs:{type:Object,default:function(){return{}}},style:Object},setup:function(e){var n,r=t.toRefs(e).works,o=p.getViewportScale(),a=o===1?window.devicePixelRatio:1,f=D({pixelRatio:a}),i=new p.Five(g({renderer:f},e.fiveInitArgs)),c=e.works||e.initialWorks;return c&&i.load(c,e.initialState,void 0,(n=e.initialUserAction)!==null&&n!==void 0?n:!0),U(!!e.works),r&&t.watch(r,function(l,h){l&&!L(l,i.works)&&i.load(l,e.initialState)}),t.onBeforeUnmount(function(){i&&(i.dispose(),A(i.renderer))}),i.on("load",function(){e.onWorksChange&&i.works&&e.onWorksChange(i==null?void 0:i.works)}),i.on("stateChange",function(l,h){e.onStateChange&&e.onStateChange(l,h)}),i.on("currentStateChange",function(l,h){e.onCurrentStateChange&&e.onCurrentStateChange(l,h)}),i.on("error",function(l){e.onError?e.onError(l):console.warn(l.message)}),t.provide(F,i),{five:t.shallowReadonly(i)}},render:function(){return t.h("div",{style:this.$props.style},this.$slots)}});function V(){var e=s(),n=t.ref(e.works),r=t.readonly(n),o=function(f,i,c,l){if(b)throw new Error("props 'work' is set in fiveProvider, if you need modify work internal, use 'initialWork' instead.");return e.load(f,i,c,l)},a=e.on("load",function(){n.value=e.works});return t.onBeforeUnmount(function(){a()}),[r,o]}function H(){var e=s(),n=t.ref(g({},e.state)),r=e.on("stateChange",function(a){Object.assign(n.value,g({},a))});t.onBeforeUnmount(function(){r()});var o=function(a,f,i){f===void 0&&(f=!1),i===void 0&&(i=!0);var c=typeof a=="function"?a(e.getCurrentState()):a;e.setState(c,f,i)};return[n,o]}function M(){var e=s(),n=t.ref(e.getCurrentState()),r=e.on("currentStateChange",function(){Object.assign(n.value,e.getCurrentState())});t.onBeforeUnmount(function(){r()});var o=function(a,f,i){var c=typeof a=="function"?a(e.getCurrentState()):a;e.setState(c,f,i)};return[n,o]}function T(){var e=s(),n=t.reactive(e.getCurrentState()),r=t.ref(e.works.getObserver(e.pano)),o=e.on("currentStateChange",function(){Object.assign(n,e.getCurrentState()),r.value=e.works.getObserver({workCode:n.workCode,panoIndex:n.panoIndex})});return t.onBeforeUnmount(function(){o()}),r}function q(e,n){var r=s(),o=r.on(e,n);t.onBeforeUnmount(function(){o()})}function N(){var e=s(),n=function(c,l){return e.updateCamera(c,l)},r=e.getPixels.bind(e),o=function(c){return e.render(c)},a=function(){return e.needsRender=!0},f=function(c,l){return e.preloadPano(c,l)},i=function(c,l){return l===void 0&&(l=!1),e.project2d(c,l)};return{updateCamera:n,getPixels:r,render:o,needsRender:a,preloadPano:f,project2d:i}}function x(e,n){n===void 0&&(n=!1);var r=s(),o=t.ref(Symbol()),a=t.shallowRef(e?r.project2d(t.isRef(e)?e.value:e,n):null),f=r.on("cameraUpdate",function(){o.value=Symbol()});return t.onBeforeUnmount(function(){f()}),t.watch([o,e],function(){a.value=r.project2d(t.isRef(e)?e.value:e,n)}),a}function G(){return x}function C(e){var n=e.camera.getWorldDirection(new d.Vector3),r=new d.Raycaster(e.camera.position,n);return r}function K(){var e=s(),n=t.shallowRef(C(e)),r=e.on("cameraUpdate",function(){n.value=C(e)});return t.onBeforeUnmount(function(){r()}),n}function y(e){return e.camera.getWorldDirection(new d.Vector3)}function $(){var e=s(),n=t.shallowRef(y(e)),r=e.on("cameraUpdate",function(){n.value=y(e)});return t.onBeforeUnmount(function(){r()}),n}function z(e){var n=s(),r=t.shallowRef([]);return t.watch(e,function(){r.value=n.model.intersectRaycaster(t.isRef(e)?e.value:e)}),r}function J(){return z}function S(e){return e.model.empty?"Empty":"Loaded"}function Q(){var e=s(),n=t.ref(S(e)),r=e.on("modelLoaded",function(){n.value=S(e)});return t.onBeforeUnmount(function(){r()}),n}function X(){var e=s(),n=t.ref(e.model.shownFloor),r=t.ref(e.model.floorLength),o=function(f){typeof f=="number"?e.model.show(f):e.model.show()},a=[];return a.push(e.on("modelShownFloorChange",function(){n.value=e.model.shownFloor})),a.push(e.on("modelLoaded",function(){r.value=e.model.floorLength})),t.onBeforeUnmount(function(){for(var f;f=a.shift();)f()}),[n,r,o]}function Y(){var e=s(),n=t.ref(e.helperVisible),r=function(a){e.helperVisible=a},o=e.on("helpersVisibleChange",function(a){n.value=a});return t.onBeforeUnmount(function(){o()}),[n,r]}function Z(){return s()}function R(e){return e.model.bounding.clone()}function ee(){var e=s(),n=t.shallowRef(R(e)),r=e.on("modelLoaded",function(){n.value=R(e)});return t.onBeforeUnmount(function(){r()}),n}function ne(){var e=s();return e.scene}function re(){var e=s(),n=t.shallowRef(e.model),r=e.on("modelLoaded",function(){n.value=e.model});return t.onBeforeUnmount(function(){r()}),n}u.FiveCanvas=_,u.FiveProvider=I,u.unsafe__useFiveInject=Z,u.useFiveAction=N,u.useFiveCameraDirection=$,u.useFiveCameraRaycaster=K,u.useFiveCurrentObserver=T,u.useFiveCurrentState=M,u.useFiveEventCallback=q,u.useFiveFloor=X,u.useFiveHelper=Y,u.useFiveModel=re,u.useFiveModelBounding=ee,u.useFiveModelIntersectRaycaster=J,u.useFiveModelReadyState=Q,u.useFiveProject2d=G,u.useFiveScene=ne,u.useFiveState=H,u.useFiveWorks=V,Object.defineProperty(u,Symbol.toStringTag,{value:"Module"})}));
|