@realsee/five 6.8.0-alpha.2 → 6.8.0-alpha.21
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/AGENTS_READ_ME.md +4 -0
- package/AI_CONTEXT.md +4 -0
- package/README.md +9 -6
- package/{guides → ai_guides}/README.md +12 -2
- package/ai_guides/ai-doc-guidelines.md +102 -0
- package/{guides → ai_guides}/api.md +24 -1
- package/ai_guides/features/3dtile.md +172 -0
- package/{guides → ai_guides}/features/camera-animation.md +24 -3
- package/{guides → ai_guides}/features/clipper.md +2 -0
- package/{guides/features/coordnate-system.md → ai_guides/features/coordinate-system.md} +2 -0
- package/{guides → ai_guides}/features/event.md +2 -0
- package/{guides → ai_guides}/features/five.md +4 -0
- package/ai_guides/features/flowing-light-2d-pass.md +438 -0
- package/ai_guides/features/flowing-light-3d-pass.md +420 -0
- package/ai_guides/features/gaussian-blur-pass.md +202 -0
- package/{guides → ai_guides}/features/gesture.md +3 -0
- package/{guides → ai_guides}/features/get-screen-pixels.md +2 -0
- package/{guides → ai_guides}/features/image-options.md +3 -0
- package/{guides → ai_guides}/features/load-external-model.md +21 -0
- package/ai_guides/features/load-progress.md +140 -0
- package/ai_guides/features/material.md +153 -0
- package/{guides → ai_guides}/features/mode.md +4 -0
- package/{guides → ai_guides}/features/model.md +4 -1
- package/{guides → ai_guides}/features/move-pano-effect.md +2 -0
- package/{guides → ai_guides}/features/multi-work.md +2 -0
- package/ai_guides/features/pano-filter.md +148 -0
- package/{guides → ai_guides}/features/pano-tile.md +7 -14
- package/ai_guides/features/pano-uv.md +131 -0
- package/ai_guides/features/parameter.md +153 -0
- package/ai_guides/features/plugin.md +210 -0
- package/{guides → ai_guides}/features/postprocessing.md +39 -4
- package/{guides → ai_guides}/features/raycast.md +11 -0
- package/{guides → ai_guides}/features/request-proxy.md +2 -0
- package/{guides → ai_guides}/features/screen-project.md +2 -0
- package/{guides → ai_guides}/features/state.md +2 -0
- package/ai_guides/features/view-layer.md +187 -0
- package/{guides → ai_guides}/features/work.md +63 -2
- package/{guides → ai_guides}/glossary.md +26 -5
- package/{guides → ai_guides}/intro.md +1 -1
- package/{guides → ai_guides}/quick-start.md +1 -0
- package/ai_guides/release_notes/6.8.md +208 -0
- package/{guides → ai_guides}/template.md +17 -3
- package/docs/00_FOR_AI_AGENTS.md +11 -0
- package/docs/README.md +4 -7
- package/docs/assets/hierarchy.js +1 -1
- package/docs/assets/navigation.js +1 -1
- package/docs/assets/search.js +1 -1
- package/docs/classes/five.AdaptiveLuminancePass.html +7 -6
- package/docs/classes/five.BoundingMesh.html +2 -2
- package/docs/classes/five.Camera.html +1 -1
- package/docs/classes/five.EyeDomeLightingPass.html +1 -1
- package/docs/classes/five.Five.html +73 -72
- package/docs/classes/five.FivePass.html +1 -1
- package/docs/classes/five.Histogram.html +19 -0
- package/docs/classes/five.InternalWebGLRenderer.html +1 -1
- package/docs/classes/five.Model.html +31 -31
- package/docs/classes/five.ModelScene.html +1 -1
- package/docs/classes/five.NetworkSubscribe.html +1 -1
- package/docs/classes/five.PBMContainer.html +1 -1
- package/docs/classes/five.PBMCustomShader.html +42 -3
- package/docs/classes/five.PBMGSObject.html +5 -3
- package/docs/classes/five.PBMGroup.html +1 -1
- package/docs/classes/five.PBMMesh.html +1 -1
- package/docs/classes/five.PBMMeshMaterial.html +16 -7
- package/docs/classes/five.PBMPanoFilter.html +61 -0
- package/docs/classes/five.PBMPointCloud.html +1 -1
- package/docs/classes/five.PBMPointCloudMaterial.html +5 -6
- package/docs/classes/five.PBMSkinnedMesh.html +1 -1
- package/docs/classes/five.PBMUpdateable.html +41 -0
- package/docs/classes/five.PanoCircleMesh.html +1 -1
- package/docs/classes/five.PanoCircleMeshCustom.html +1 -1
- package/docs/classes/five.PanoCircleMeshSolid.html +1 -1
- package/docs/classes/five.Parameter.html +57 -53
- package/docs/classes/five.Scene.html +1 -1
- package/docs/classes/five.Subscribe.html +1 -1
- package/docs/classes/five.Tile.html +1 -1
- package/docs/classes/five.Tile3D.html +30 -26
- package/docs/classes/five.TileNode.html +1 -1
- package/docs/classes/five.Trajectory.html +1 -1
- package/docs/classes/five.TrajectoryNode.html +1 -1
- package/docs/classes/five.Work.html +16 -16
- package/docs/classes/five.WorkResolvedObserver.html +27 -2
- package/docs/classes/gltf-loader.DDSLoader.html +1 -1
- package/docs/classes/gltf-loader.DRACOLoader.html +1 -1
- package/docs/classes/gltf-loader.GLTFLoader.html +1 -1
- package/docs/classes/gltf-loader.GLTFObject.html +1 -1
- package/docs/classes/gltf-loader.GLTFParser.html +1 -1
- package/docs/classes/gltf-loader.THREEGLTFLoader.html +1 -1
- package/docs/classes/line.Line.html +1 -1
- package/docs/classes/line.LineGeometry.html +1 -1
- package/docs/classes/line.LineMaterial.html +1 -1
- package/docs/classes/line.LineSegmentsGeometry.html +1 -1
- package/docs/classes/line.THREE_Line2.html +1 -1
- package/docs/classes/line.THREE_LineSegments2.html +1 -1
- package/docs/classes/plugins.BasePlugin.Controller.html +1 -1
- package/docs/classes/plugins.RoundedBoxGeometry.html +1 -1
- package/docs/classes/sticker.Sticker.html +1 -1
- package/docs/classes/vfx.Airflow.html +1 -1
- package/docs/classes/vfx.Flame.html +1 -1
- package/docs/classes/vfx.Particle.html +1 -1
- package/docs/classes/vfx.ParticleGPU.html +1 -1
- package/docs/classes/vfx.SpotLight.html +1 -1
- package/docs/documents/README.html +11 -2
- package/docs/documents/ai-doc-guidelines.html +60 -15
- package/docs/documents/api.html +40 -15
- package/docs/documents/features_3dtile.html +142 -45
- package/docs/documents/features_camera-animation.html +62 -5
- package/docs/documents/features_clipper.html +3 -0
- package/docs/documents/{features_coordnate-system.html → features_coordinate-system.html} +4 -1
- package/docs/documents/features_event.html +3 -0
- package/docs/documents/features_five.html +4 -0
- package/docs/documents/features_flowing-light-2d-pass.html +356 -0
- package/docs/documents/features_flowing-light-3d-pass.html +351 -0
- package/docs/documents/features_gaussian-blur-pass.html +182 -0
- package/docs/documents/features_gesture.html +4 -0
- package/docs/documents/features_get-screen-pixels.html +3 -0
- package/docs/documents/features_image-options.html +3 -0
- package/docs/documents/features_load-external-model.html +25 -2
- package/docs/documents/features_load-progress.html +110 -0
- package/docs/documents/features_material.html +341 -0
- package/docs/documents/features_mode.html +5 -0
- package/docs/documents/features_model.html +5 -1
- package/docs/documents/features_move-pano-effect.html +3 -0
- package/docs/documents/features_multi-work.html +3 -0
- package/docs/documents/features_pano-filter.html +122 -0
- package/docs/documents/features_pano-tile.html +34 -19
- package/docs/documents/features_pano-uv.html +82 -0
- package/docs/documents/features_parameter.html +76 -56
- package/docs/documents/features_plugin.html +105 -0
- package/docs/documents/features_postprocessing.html +22 -5
- package/docs/documents/features_raycast.html +4 -1
- package/docs/documents/features_request-proxy.html +3 -0
- package/docs/documents/features_screen-project.html +3 -0
- package/docs/documents/features_state.html +3 -0
- package/docs/documents/features_view-layer.html +158 -0
- package/docs/documents/features_work.html +63 -2
- package/docs/documents/glossary.html +31 -6
- package/docs/documents/intro.html +1 -1
- package/docs/documents/quick-start.html +1 -0
- package/docs/documents/release_notes_6.8.html +189 -0
- package/docs/documents/template.html +45 -4
- 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.loadSplat.html +1 -1
- package/docs/functions/five.loadSpz.html +1 -1
- package/docs/functions/five.loadX3p.html +1 -1
- package/docs/functions/five.parseWork.html +1 -1
- package/docs/functions/vue.useFiveWorks.html +2 -2
- package/docs/hierarchy.html +1 -1
- package/docs/index.html +11 -2
- package/docs/interfaces/five.AddableObject.html +1 -1
- package/docs/interfaces/five.AjaxOptions.html +1 -1
- package/docs/interfaces/five.BaseEvent.html +2 -2
- package/docs/interfaces/five.EventCallback.html +53 -47
- package/docs/interfaces/five.FloorplanControllerCustomInitArgs.html +9 -9
- package/docs/interfaces/five.GestureEvent.html +2 -2
- package/docs/interfaces/five.ImageOptions.html +1 -1
- package/docs/interfaces/five.IntersectEvent.html +2 -2
- package/docs/interfaces/five.IntersectMesh.html +1 -1
- package/docs/interfaces/five.IntersectMeshInterface.html +1 -1
- package/docs/interfaces/five.Intersection.html +4 -3
- package/docs/interfaces/five.LooseWorkWithExtrinsics.html +6 -6
- package/docs/interfaces/five.MapviewControllerCustomInitArgs.html +9 -9
- package/docs/interfaces/five.ModeChangeEvent.html +2 -2
- package/docs/interfaces/five.ModelControllerCustomInitArgs.html +1 -1
- package/docs/interfaces/five.ModelEvent.html +2 -2
- package/docs/interfaces/five.ModelSceneEvent.html +2 -2
- package/docs/interfaces/five.ModelTileEvent.html +8 -0
- package/docs/interfaces/five.MovePanoOptions.html +7 -7
- package/docs/interfaces/five.NetworkAbortError.html +1 -1
- package/docs/interfaces/five.NetworkFirbiddenError.html +1 -1
- package/docs/interfaces/five.NetworkOptions.html +1 -1
- package/docs/interfaces/five.NetworkProxyError.html +1 -1
- package/docs/interfaces/five.NetworkResourceEvent.html +2 -2
- package/docs/interfaces/five.NetworkResponseError.html +1 -1
- package/docs/interfaces/five.NetworkTimeoutError.html +1 -1
- package/docs/interfaces/five.ObjectEvent.html +2 -2
- package/docs/interfaces/five.PBMClipperParameter.html +2 -2
- package/docs/interfaces/five.PBMCustomShaderInitArgs.html +2 -2
- package/docs/interfaces/five.PBMCustomShaderSlots.html +2 -2
- package/docs/interfaces/five.PBMMaterial.html +1 -1
- package/docs/interfaces/five.PBMMeshMaterialParameters.html +5 -3
- package/docs/interfaces/five.PBMPanoDepth.html +5 -5
- package/docs/interfaces/five.PBMPanoFilterValue.html +6 -0
- package/docs/interfaces/five.PBMPanoPicture.html +8 -6
- package/docs/interfaces/five.PBMPointCloudMaterialParameters.html +2 -3
- package/docs/interfaces/five.PBMRefinedScreen.html +2 -2
- package/docs/interfaces/five.PanoCircleMeshInterface.html +1 -1
- package/docs/interfaces/five.PanoEvent.html +2 -2
- package/docs/interfaces/five.PanoTextureEvent.html +2 -2
- package/docs/interfaces/five.PanoramaControllerCustomInitArgs.html +1 -1
- package/docs/interfaces/five.PanoramaLikeControllerCustomInitArgs.html +1 -1
- package/docs/interfaces/five.ParameterMaterialValue.html +42 -38
- package/docs/interfaces/five.ParameterTilesetValue.html +15 -15
- package/docs/interfaces/five.ParameterValue.html +56 -52
- package/docs/interfaces/five.Pose.html +1 -1
- package/docs/interfaces/five.RenderEvent.html +2 -2
- package/docs/interfaces/five.ResolvedParameterValue.html +56 -52
- package/docs/interfaces/five.RgbaData.html +7 -0
- package/docs/interfaces/five.SplatData.html +2 -2
- package/docs/interfaces/five.State.html +1 -1
- package/docs/interfaces/five.StateEvent.html +2 -2
- package/docs/interfaces/five.TextureOptions.html +1 -1
- package/docs/interfaces/five.Tile3DOptions.html +2 -2
- package/docs/interfaces/five.TopviewControllerCustomInitArgs.html +7 -7
- package/docs/interfaces/five.VRPanoramaControllerCustomInitArgs.html +1 -1
- package/docs/interfaces/five.ViewLayer.html +30 -26
- package/docs/interfaces/five.WorkCubeImage.html +1 -1
- package/docs/interfaces/five.WorkImage.html +1 -1
- package/docs/interfaces/five.WorkModel.html +8 -8
- package/docs/interfaces/five.WorkModelLayer.html +6 -6
- package/docs/interfaces/five.WorkObserver.html +27 -2
- package/docs/interfaces/five.WorkTile.html +1 -1
- package/docs/interfaces/five.WorksEvent.html +2 -2
- package/docs/interfaces/five.XRControllerEvent.html +2 -2
- package/docs/interfaces/five.XRGestureEvent.html +2 -2
- package/docs/interfaces/five.XRPanoramaControllerCustomInitArgs.html +1 -1
- package/docs/interfaces/five.XRSessionEvent.html +2 -2
- package/docs/interfaces/plugins.BackgroundPluginController.html +1 -1
- package/docs/interfaces/plugins.BackgroundPluginType.EventMap.html +1 -1
- package/docs/interfaces/plugins.BasePlugin.State.html +1 -1
- package/docs/interfaces/plugins.DynamicPathLinePluginController.html +1 -1
- package/docs/interfaces/plugins.DynamicPathLinePluginType.EventMap.html +1 -1
- package/docs/interfaces/plugins.DynamicPathLinePluginType.State.html +1 -1
- package/docs/interfaces/plugins.ItemMaskController.html +1 -1
- package/docs/interfaces/plugins.ItemMaskPluginType.EventMap.html +1 -1
- package/docs/interfaces/plugins.ItemMaskPluginType.State.html +1 -1
- package/docs/interfaces/plugins.OrientationPluginController.html +1 -1
- package/docs/interfaces/plugins.OrientationPluginType.EventMap.html +1 -1
- package/docs/interfaces/plugins.OrientationPluginType.State.html +1 -1
- package/docs/interfaces/plugins.PanoAnimeController.html +1 -1
- package/docs/interfaces/plugins.PanoAnimePluginType.EventMap.html +1 -1
- package/docs/interfaces/plugins.PanoAnimePluginType.State.html +1 -1
- package/docs/interfaces/plugins.PluginTemplateType.EventMap.html +1 -1
- package/docs/interfaces/plugins.PluginTemplateType.State.html +1 -1
- package/docs/interfaces/plugins.TrajectoryController.html +1 -1
- package/docs/interfaces/react.FiveInjectionTypes.html +13 -13
- package/docs/modules/five.html +1 -1
- package/docs/modules.html +1 -1
- package/docs/types/five.ControllerEventTypes.html +27 -25
- package/docs/types/five.EasingFunction.html +1 -0
- package/docs/types/five.EventTypes.html +27 -25
- package/docs/types/five.FivePlugin.html +1 -1
- package/docs/types/five.FivePluginInit.html +1 -1
- package/docs/types/five.FivePluginInstance.html +1 -1
- package/docs/types/five.NetworkProgressCallback.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.ParseOptions.html +6 -6
- package/docs/types/plugins.BasePlugin.EventMap.html +1 -1
- package/docs/variables/five.PROXY_CONTROLLER_EVENT_NAMES.html +1 -1
- package/five/application/analysis.d.ts +40 -0
- package/five/application/controllers.d.ts +41 -0
- package/five/application/events-legacy.d.ts +454 -0
- package/five/application/events.d.ts +69 -0
- package/five/application/five.d.ts +519 -0
- package/five/application/fiveInitArgs.d.ts +176 -0
- package/five/application/fiveLoadOptions.d.ts +21 -0
- package/five/application/generateDefaultVideoElement.d.ts +2 -0
- package/five/application/getViewportScale.d.ts +2 -0
- package/five/application/initLights.d.ts +3 -0
- package/five/application/mode.d.ts +28 -0
- package/five/application/renderPoweredByRealsee.d.ts +3 -0
- package/five/assets/cardboard-png-data-url.d.ts +2 -0
- package/five/assets/gradient-png-data-url.d.ts +2 -0
- package/five/assets/loading-png-data-url.d.ts +2 -0
- package/five/assets/phone-png-data-url.d.ts +2 -0
- package/five/assets/realsee-png-data-url.d.ts +2 -0
- package/five/bvh/bvhMath.d.ts +33 -0
- package/five/bvh/bvhMesh.d.ts +7 -0
- package/five/bvh/bvhNode.d.ts +29 -0
- package/five/bvh/bvhObject.d.ts +18 -0
- package/five/bvh/bvhPoints.d.ts +6 -0
- package/five/bvh/index.d.ts +10 -0
- package/five/bvh/worker.d.ts +35 -0
- package/five/cardboard/helper.d.ts +2 -0
- package/five/cardboard/index.d.ts +13 -0
- package/five/cardboard/sensor.d.ts +158 -0
- package/five/certificates/hardware.d.ts +1 -0
- package/five/controllers/base.d.ts +167 -0
- package/five/controllers/events.d.ts +71 -0
- package/five/controllers/floorplan.d.ts +119 -0
- package/five/controllers/mapview.d.ts +139 -0
- package/five/controllers/model.d.ts +57 -0
- package/five/controllers/panorama.d.ts +143 -0
- package/five/controllers/panoramaLike.d.ts +87 -0
- package/five/controllers/topview.d.ts +42 -0
- package/five/controllers/vrPanorama.d.ts +56 -0
- package/five/controllers/xrPanorama.d.ts +81 -0
- package/five/core/camera.d.ts +65 -0
- package/five/core/internalWebGLRenderer.d.ts +14 -0
- package/five/core/panoVideo.d.ts +18 -0
- package/five/core/scene.d.ts +10 -0
- package/five/core/tiling.d.ts +43 -0
- package/five/declare.d.ts +2 -1
- package/five/gaussian-splatting/util/renderData.d.ts +52 -0
- package/five/gaussian-splatting/wasm/data.d.ts +20 -0
- package/five/gaussian-splatting/wasm/sort.d.ts +18 -0
- package/five/gaussian-splatting/worker/dataWorker.d.ts +1 -0
- package/five/gaussian-splatting/worker/sortWorker.d.ts +1 -0
- package/five/index.d.ts +60 -4637
- package/five/index.js +193 -341
- package/five/index.mjs +26455 -31011
- package/five/meshes/boundingMesh.d.ts +12 -0
- package/five/meshes/intersectMesh.d.ts +8 -0
- package/five/meshes/panoCircleMesh.d.ts +35 -0
- package/five/meshes/panoCircleMeshCustom.d.ts +40 -0
- package/five/meshes/panoCircleMeshSolid.d.ts +34 -0
- package/five/meshes/panoSphereMesh.d.ts +27 -0
- package/five/model/helpers/coordinate-transform.d.ts +3 -0
- package/five/model/helpers/ellipsoid-coordinates.d.ts +14 -0
- package/five/model/helpers/get-edges-by-sphere.d.ts +8 -0
- package/five/model/helpers/get-recommend-tile3d-parameters.d.ts +8 -0
- package/five/model/index.d.ts +70 -0
- package/five/model/intersection.d.ts +18 -0
- package/five/model/loaders/at3d.d.ts +12 -0
- package/five/model/loaders/b3dm.d.ts +9 -0
- package/five/model/loaders/dome.d.ts +22 -0
- package/five/model/loaders/domez.d.ts +11 -0
- package/five/model/loaders/fbx.d.ts +8 -0
- package/five/model/loaders/glTF-helpers/extensions/CESIUM_RTC.d.ts +9 -0
- package/five/model/loaders/glTF-helpers/extensions/EXT_meshopt_compression.d.ts +8 -0
- package/five/model/loaders/glTF-helpers/extensions/EXT_texture_webp.d.ts +11 -0
- package/five/model/loaders/glTF-helpers/extensions/KHR_animation_pointer.d.ts +6 -0
- package/five/model/loaders/glTF-helpers/extensions/KHR_binary_glTF.d.ts +25 -0
- package/five/model/loaders/glTF-helpers/extensions/KHR_draco_mesh_compression.d.ts +11 -0
- package/five/model/loaders/glTF-helpers/extensions/KHR_gaussian_splatting_compression_spz.d.ts +9 -0
- package/five/model/loaders/glTF-helpers/extensions/KHR_materials_clearcoat.d.ts +10 -0
- package/five/model/loaders/glTF-helpers/extensions/KHR_materials_emissive_strength.d.ts +10 -0
- package/five/model/loaders/glTF-helpers/extensions/KHR_materials_sheen.d.ts +10 -0
- package/five/model/loaders/glTF-helpers/extensions/KHR_materials_transmission.d.ts +10 -0
- package/five/model/loaders/glTF-helpers/extensions/KHR_materials_unlit.d.ts +10 -0
- package/five/model/loaders/glTF-helpers/extensions/KHR_mesh_quantization.d.ts +6 -0
- package/five/model/loaders/glTF-helpers/extensions/KHR_node_visibility.d.ts +10 -0
- package/five/model/loaders/glTF-helpers/extensions/KHR_texture_basisu.d.ts +9 -0
- package/five/model/loaders/glTF-helpers/extensions/KHR_texture_transform.d.ts +10 -0
- package/five/model/loaders/glTF-helpers/extensions/REALSEE_materials_lightmap.d.ts +7 -0
- package/five/model/loaders/glTF-helpers/extensions/base.d.ts +24 -0
- package/five/model/loaders/glTF-helpers/glTF.d.ts +713 -0
- package/five/model/loaders/glTF-helpers/index.d.ts +47 -0
- package/five/model/loaders/glTF-helpers/parser.d.ts +114 -0
- package/five/model/loaders/glTF-helpers/type.d.ts +14 -0
- package/five/model/loaders/gltf.d.ts +10 -0
- package/five/model/loaders/obj.d.ts +9 -0
- package/five/model/loaders/pbm.d.ts +26 -0
- package/five/model/loaders/ply.d.ts +24 -0
- package/five/model/loaders/pnts.d.ts +8 -0
- package/five/model/loaders/protobuf/dome.d.ts +540 -0
- package/five/model/loaders/protobuf/pbm.d.ts +203 -0
- package/five/model/loaders/shared.d.ts +16 -0
- package/five/model/loaders/splat.d.ts +8 -0
- package/five/model/loaders/spz.d.ts +14 -0
- package/five/model/loaders/tile3d-helpers/feature-table.d.ts +15 -0
- package/five/model/loaders/tile3d-helpers/gl-type.d.ts +20 -0
- package/five/model/loaders/tile3d-helpers/parse-gltf-array-buffer.d.ts +2 -0
- package/five/model/loaders/tile3d-helpers/parse-header.d.ts +2 -0
- package/five/model/loaders/tile3d-helpers/parse-point-cloud-attributes.d.ts +2 -0
- package/five/model/loaders/tile3d-helpers/parse-point-cloud-attributes.worker.d.ts +6 -0
- package/five/model/loaders/tile3d-helpers/parse-table.d.ts +3 -0
- package/five/model/loaders/tile3d-helpers/tile3d-type.d.ts +35 -0
- package/five/model/loaders/x3p.d.ts +22 -0
- package/five/model/materials/pbmMaterial.d.ts +137 -0
- package/five/model/materials/pbmMeshMaterial.d.ts +126 -0
- package/five/model/materials/pbmPointCloudMaterial.d.ts +70 -0
- package/five/model/model-scene.d.ts +172 -0
- package/five/model/model.d.ts +209 -0
- package/five/model/objects/pbmContainer.d.ts +28 -0
- package/five/model/objects/pbmGaussianSplattingObject.d.ts +43 -0
- package/five/model/objects/pbmGaussianSplattingRenderMesh.d.ts +55 -0
- package/five/model/objects/pbmGaussianSplattingTestMesh.d.ts +7 -0
- package/five/model/objects/pbmGroup.d.ts +8 -0
- package/five/model/objects/pbmMesh.d.ts +10 -0
- package/five/model/objects/pbmPointCloud.d.ts +7 -0
- package/five/model/parameter.d.ts +140 -0
- package/five/model/shaders/pbm_gaussian_splatting/fragment.d.ts +2 -0
- package/five/model/shaders/pbm_gaussian_splatting/vertex.d.ts +2 -0
- package/five/model/shaders/pbm_mesh_basic/fragment.d.ts +2 -0
- package/five/model/shaders/pbm_mesh_basic/vertex.d.ts +2 -0
- package/five/model/shaders/pbm_mesh_none/fragment.d.ts +2 -0
- package/five/model/shaders/pbm_mesh_none/vertex.d.ts +2 -0
- package/five/model/shaders/pbm_mesh_phong/fragment.d.ts +2 -0
- package/five/model/shaders/pbm_mesh_phong/vertex.d.ts +2 -0
- package/five/model/shaders/pbm_mesh_standard/fragment.d.ts +2 -0
- package/five/model/shaders/pbm_mesh_standard/vertex.d.ts +2 -0
- package/five/model/shaders/pbm_pointcloud/fragment.d.ts +2 -0
- package/five/model/shaders/pbm_pointcloud/vertex.d.ts +2 -0
- package/five/model/tile3d/header.d.ts +88 -0
- package/five/model/tile3d/index.d.ts +214 -0
- package/five/model/tile3d/tile-cache.d.ts +18 -0
- package/five/model/tile3d/tile-content.d.ts +10 -0
- package/five/model/tile3d/tile-node.d.ts +24 -0
- package/five/model/tile3d/tile-request-scheduler.d.ts +17 -0
- package/five/model/tile3d/tile.d.ts +79 -0
- package/five/model/tile3d/tileset-base-traverser.d.ts +59 -0
- package/five/model/tile3d/tileset-most-detail-traverser.d.ts +14 -0
- package/five/model/tile3d/tileset-normal-traverser.d.ts +15 -0
- package/five/model/tile3d/tileset-skip-traverser.d.ts +60 -0
- package/five/model/tile3d/tileset.d.ts +69 -0
- package/five/model/tile3d/trajectory-content.d.ts +9 -0
- package/five/model/tile3d/trajectory-node.d.ts +15 -0
- package/five/model/tile3d/trajectory.d.ts +30 -0
- package/five/model/tile3d/types.d.ts +33 -0
- package/five/model/view-layer.d.ts +20 -0
- package/five/renderer/five-renderer.d.ts +17 -0
- package/five/renderer/index.d.ts +3 -0
- package/five/renderer/postprocessing/composer.d.ts +37 -0
- package/five/renderer/postprocessing/index.d.ts +7 -0
- package/five/renderer/postprocessing/passes/adaptive-luminance-pass.d.ts +17 -0
- package/five/renderer/postprocessing/passes/eye-dome-lighting-pass.d.ts +14 -0
- package/five/renderer/postprocessing/passes/flowing-light-2d-pass.d.ts +36 -0
- package/five/renderer/postprocessing/passes/flowing-light-3d-pass.d.ts +36 -0
- package/five/renderer/postprocessing/passes/gaussian-blur-pass.d.ts +12 -0
- package/five/renderer/postprocessing/passes/pass.d.ts +38 -0
- package/five/renderer/scene-renderers/point-cloud-high-quality-scene-renderer.d.ts +11 -0
- package/five/renderer/scene-renderers/scene-renderer.d.ts +9 -0
- package/five/renderer/scene-renderers/ssaa-scene-renderer.d.ts +15 -0
- package/five/renderer/tools/full-screen-quad.d.ts +15 -0
- package/five/renderer/tools/render-cube-to-equirectangular.d.ts +7 -0
- package/five/renderer/tools/render-full-screen-depth.d.ts +2 -0
- package/five/renderer/tools/render-full-screen.d.ts +2 -0
- package/five/texture/histogram.d.ts +54 -0
- package/five/texture/imageBitmap.d.ts +13 -0
- package/five/texture/initTexture.d.ts +3 -0
- package/five/texture/loader.d.ts +39 -0
- package/five/texture/textureData.d.ts +11 -0
- package/five/thirdparty/fflate.d.ts +1407 -0
- package/five/thirdparty/hammer.d.ts +375 -0
- package/five/thirdparty/jsrsasign.d.ts +753 -0
- package/five/thirdparty/meshopt_decoder.d.ts +15 -0
- package/five/three-version-check.d.ts +1 -0
- package/five/types/addableObject.d.ts +12 -0
- package/five/types/cube.d.ts +1 -0
- package/five/types/gestureInput.d.ts +24 -0
- package/five/types/imageOptions.d.ts +20 -0
- package/five/types/intersectMeshInterface.d.ts +8 -0
- package/five/types/movePanoEffect.d.ts +13 -0
- package/five/types/movePanoOptions.d.ts +36 -0
- package/five/types/panoCircleMeshInterface.d.ts +34 -0
- package/five/types/plugin.d.ts +25 -0
- package/five/types/pose.d.ts +17 -0
- package/five/types/state.d.ts +20 -0
- package/five/types/viewport.d.ts +22 -0
- package/five/utils/ajax.d.ts +66 -0
- package/five/utils/animationFrameLoop.d.ts +45 -0
- package/five/utils/array.d.ts +31 -0
- package/five/utils/asyncTaskQueue.d.ts +8 -0
- package/five/utils/bufferGeometry.d.ts +33 -0
- package/five/utils/calculateProgress.d.ts +39 -0
- package/five/utils/calculateThreeMouse.d.ts +13 -0
- package/five/utils/canplayVideo.d.ts +2 -0
- package/five/utils/clamp.d.ts +2 -0
- package/five/utils/clock.d.ts +17 -0
- package/five/utils/createSymbol.d.ts +5 -0
- package/five/utils/decodeText.d.ts +2 -0
- package/five/utils/deepEqual.d.ts +2 -0
- package/five/utils/deepFreeze.d.ts +2 -0
- package/five/utils/defineProperty.d.ts +9 -0
- package/five/utils/detector.d.ts +14 -0
- package/five/utils/distance.d.ts +10 -0
- package/five/utils/draco.d.ts +26 -0
- package/five/utils/easing.d.ts +63 -0
- package/five/utils/event.d.ts +159 -0
- package/five/utils/formatRad.d.ts +7 -0
- package/five/utils/imageSupport.d.ts +6 -0
- package/five/utils/imageURL.d.ts +42 -0
- package/five/utils/isEmptyObject.d.ts +2 -0
- package/five/utils/isNil.d.ts +6 -0
- package/five/utils/isNumber.d.ts +2 -0
- package/five/utils/isPowerOfTwo.d.ts +2 -0
- package/five/utils/isPromise.d.ts +2 -0
- package/five/utils/isSimilar.d.ts +6 -0
- package/five/utils/json.d.ts +7 -0
- package/five/utils/ktx2.d.ts +30 -0
- package/five/utils/lzma/index.d.ts +2 -0
- package/five/utils/lzma/lzma.d.ts +3 -0
- package/five/utils/lzma/lzmaWASM.d.ts +2 -0
- package/five/utils/lzma/lzmaWorker.d.ts +14 -0
- package/five/utils/memoryUsage.d.ts +29 -0
- package/five/utils/motion.d.ts +38 -0
- package/five/utils/noop.d.ts +6 -0
- package/five/utils/now.d.ts +7 -0
- package/five/utils/pano.d.ts +9 -0
- package/five/utils/pick.d.ts +3 -0
- package/five/utils/poseUtils.d.ts +5 -0
- package/five/utils/renderCubeTextureToCubeRenderTarget.d.ts +3 -0
- package/five/utils/renderDepth.d.ts +2 -0
- package/five/utils/renderTexturesToCubeRenderTarget.d.ts +10 -0
- package/five/utils/requestPermission.d.ts +3 -0
- package/five/utils/shaderContentFix.d.ts +7 -0
- package/five/utils/shaderMaterial.d.ts +20 -0
- package/five/utils/stateUtils.d.ts +5 -0
- package/five/utils/string-pattern.d.ts +8 -0
- package/five/utils/subscribe.d.ts +67 -0
- package/five/utils/tileCube.d.ts +19 -0
- package/five/utils/toFastProperties.d.ts +1 -0
- package/five/utils/typedCache.d.ts +10 -0
- package/five/utils/uniform.d.ts +15 -0
- package/five/utils/url.d.ts +35 -0
- package/five/utils/uuid.d.ts +5 -0
- package/five/utils/values.d.ts +2 -0
- package/five/utils/vectorCoordinates.d.ts +29 -0
- package/five/utils/volume.d.ts +111 -0
- package/five/utils/webglError.d.ts +7 -0
- package/five/utils/worker.d.ts +26 -0
- package/five/webxr/XRControllerModelFactory.d.ts +28 -0
- package/five/webxr/motionHelper.d.ts +68 -0
- package/five/webxr/xrButton.d.ts +4 -0
- package/five/webxr/xrController.d.ts +24 -0
- package/five/webxr/xrManager.d.ts +84 -0
- package/five/work/_ALLOW_HOST.d.ts +2 -0
- package/five/work/index.d.ts +6 -0
- package/five/work/keychain.d.ts +5 -0
- package/five/work/looseWorkType.d.ts +121 -0
- package/five/work/verify.d.ts +7 -0
- package/five/work/work.d.ts +236 -0
- package/five/work/workFetcher.d.ts +4 -0
- package/five/work/workJson.d.ts +3 -0
- package/five/work/workJsonType.d.ts +73 -0
- package/five/work/workObserverUtils.d.ts +36 -0
- package/five/work/workParser.d.ts +6 -0
- package/five/work/workResolvedObserver.d.ts +12 -0
- package/five/work/workVerify.d.ts +2 -0
- package/five/work/works.d.ts +10 -0
- package/gltf-loader/gltf-object.d.ts +17 -0
- package/gltf-loader/index.d.ts +60 -160
- package/gltf-loader/index.js +9 -9
- package/gltf-loader/index.mjs +1351 -1451
- package/gltf-loader/thirdparty/DDSLoader.d.ts +23 -0
- package/gltf-loader/thirdparty/DRACOLoader.d.ts +18 -0
- package/gltf-loader/thirdparty/GLTFLoader.d.ts +59 -0
- package/line/circle_png.d.ts +1 -0
- package/line/index.d.ts +19 -69
- package/line/index.js +4 -4
- package/line/index.mjs +334 -513
- package/line/utils/Line2.d.ts +7 -0
- package/line/utils/LineGeometry.d.ts +10 -0
- package/line/utils/LineMaterial.d.ts +20 -0
- package/line/utils/LineSegments2.d.ts +11 -0
- package/line/utils/LineSegmentsGeometry.d.ts +15 -0
- package/llms.txt +43 -31
- package/package.json +11 -2
- package/plugins/BackgroundPlugin/Controller.d.ts +20 -0
- package/plugins/BackgroundPlugin/index.d.ts +5 -0
- package/plugins/BackgroundPlugin/typings.d.ts +44 -0
- package/plugins/BasePlugin/index.d.ts +119 -0
- package/plugins/DynamicPathLinePlugin/Controller.d.ts +167 -0
- package/plugins/DynamicPathLinePlugin/index.d.ts +5 -0
- package/plugins/DynamicPathLinePlugin/line2/Line2.d.ts +7 -0
- package/plugins/DynamicPathLinePlugin/line2/LineGeometry.d.ts +10 -0
- package/plugins/DynamicPathLinePlugin/line2/LineMaterial.d.ts +17 -0
- package/plugins/DynamicPathLinePlugin/line2/LineSegments2.d.ts +11 -0
- package/plugins/DynamicPathLinePlugin/line2/LineSegmentsGeometry.d.ts +15 -0
- package/plugins/DynamicPathLinePlugin/typing.d.ts +129 -0
- package/plugins/DynamicPathLinePlugin/typings.d.ts +72 -0
- package/plugins/ItemMaskPlugin/Controller.d.ts +48 -0
- package/plugins/ItemMaskPlugin/index.d.ts +5 -0
- package/plugins/ItemMaskPlugin/typing.d.ts +58 -0
- package/plugins/OrientationPlugin/Controller.d.ts +82 -0
- package/plugins/OrientationPlugin/RoundedBoxGeometry.d.ts +11 -0
- package/plugins/OrientationPlugin/index.d.ts +6 -0
- package/plugins/OrientationPlugin/typing.d.ts +25 -0
- package/plugins/PanoAnimePlugin/Controller.d.ts +46 -0
- package/plugins/PanoAnimePlugin/index.d.ts +5 -0
- package/plugins/PanoAnimePlugin/typing.d.ts +37 -0
- package/plugins/PluginTemplate/Controller.d.ts +27 -0
- package/plugins/PluginTemplate/index.d.ts +5 -0
- package/plugins/PluginTemplate/typing.d.ts +21 -0
- package/plugins/TrajectoryPlugin/Controller.d.ts +85 -0
- package/plugins/TrajectoryPlugin/index.d.ts +6 -0
- package/plugins/TrajectoryPlugin/typing.d.ts +25 -0
- package/plugins/index.d.ts +9 -1102
- package/plugins/index.js +17 -21
- package/plugins/index.mjs +3342 -4245
- package/plugins/thirdParty/CSS3DRenderer.d.ts +32 -0
- package/plugins/thirdParty/OrbitControls.d.ts +78 -0
- package/plugins/utils/absoluteUrl.d.ts +5 -0
- package/plugins/utils/clamp.d.ts +2 -0
- package/plugins/utils/loadImage.d.ts +1 -0
- package/plugins/utils/motion.d.ts +38 -0
- package/plugins/utils/now.d.ts +6 -0
- package/plugins/utils/uuid.d.ts +5 -0
- package/react/canvas.d.ts +19 -0
- package/react/context.d.ts +11 -0
- package/react/createProvider.d.ts +95 -0
- package/react/createStore.d.ts +144 -0
- package/react/hooks/unsafe__useFiveInstance.d.ts +9 -0
- package/react/hooks/useFiveAction.d.ts +147 -0
- package/react/hooks/useFiveCameraDirection.d.ts +7 -0
- package/react/hooks/useFiveCameraRaycaster.d.ts +7 -0
- package/react/hooks/useFiveCurrentObserver.d.ts +11 -0
- package/react/hooks/useFiveCurrentState.d.ts +15 -0
- package/react/hooks/useFiveEventCallback.d.ts +12 -0
- package/react/hooks/useFiveFloor.d.ts +15 -0
- package/react/hooks/useFiveHelper.d.ts +14 -0
- package/react/hooks/useFiveModelBounding.d.ts +5 -0
- package/react/hooks/useFiveModelEffect.d.ts +14 -0
- package/react/hooks/useFiveModelIntersectRaycaster.d.ts +22 -0
- package/react/hooks/useFiveModelReadyState.d.ts +8 -0
- package/react/hooks/useFiveProject2d.d.ts +20 -0
- package/react/hooks/useFiveSceneEffect.d.ts +21 -0
- package/react/hooks/useFiveState.d.ts +6 -0
- package/react/hooks/useFiveWork.d.ts +29 -0
- package/react/index.d.ts +24 -830
- package/react/index.js +3 -3
- package/react/index.mjs +572 -783
- package/react/rendererPool.d.ts +7 -0
- package/react/withFive.d.ts +213 -0
- package/shader-lib/EvenessPlane/index.d.ts +10 -0
- package/shader-lib/PointCloudExpand/index.d.ts +59 -0
- package/shader-lib/PolygonCuter/index.d.ts +52 -0
- package/shader-lib/PolygonCuter/worker.d.ts +14 -0
- package/shader-lib/ShineModel/index.d.ts +7 -0
- package/shader-lib/SweepModel/index.d.ts +7 -0
- package/shader-lib/index.d.ts +5 -86
- package/shader-lib/index.js +13 -14
- package/shader-lib/index.mjs +424 -824
- package/sticker/geometry.d.ts +3 -0
- package/sticker/index.d.ts +68 -71
- package/sticker/index.js +3 -3
- package/sticker/index.mjs +102 -142
- package/umd/five-gltf-loader.js +9 -9
- package/umd/five-line.js +4 -4
- package/umd/five-plugins.js +17 -21
- package/umd/five-react.js +3 -3
- package/umd/five-shader-lib.js +13 -14
- package/umd/five-sticker.js +3 -3
- package/umd/five-vfx.js +21 -21
- package/umd/five-vue.js +3 -3
- package/umd/five.js +188 -336
- package/vfx/airflow/airflow.d.ts +18 -0
- package/vfx/airflow/fragment-shader.d.ts +2 -0
- package/vfx/airflow/vertex-shader.d.ts +2 -0
- package/vfx/common/scale-shader.d.ts +2 -0
- package/vfx/common/simplex-noise-shader.d.ts +2 -0
- package/vfx/frame/fragment-shader.d.ts +2 -0
- package/vfx/frame/frame.d.ts +22 -0
- package/vfx/frame/vertex-shader.d.ts +2 -0
- package/vfx/index.d.ts +7 -363
- package/vfx/index.js +21 -21
- package/vfx/index.mjs +454 -910
- package/vfx/particle/fragment-shader.d.ts +2 -0
- package/vfx/particle/instance.d.ts +36 -0
- package/vfx/particle/particle.d.ts +205 -0
- package/vfx/particle/utils.d.ts +11 -0
- package/vfx/particle/vertex-shader.d.ts +2 -0
- package/vfx/particle-gpu/fragment-shader.d.ts +2 -0
- package/vfx/particle-gpu/instance.d.ts +36 -0
- package/vfx/particle-gpu/particle.d.ts +95 -0
- package/vfx/particle-gpu/utils.d.ts +11 -0
- package/vfx/particle-gpu/vertex-shader.d.ts +2 -0
- package/vfx/spotLight/fragment-shader.d.ts +2 -0
- package/vfx/spotLight/spotLight.d.ts +15 -0
- package/vfx/spotLight/vertex-shader.d.ts +2 -0
- package/vue/context.d.ts +7 -0
- package/vue/hooks/FiveCanvas.d.ts +36 -0
- package/vue/hooks/FiveProvider.d.ts +35 -0
- package/vue/hooks/unsafe__useFiveInject.d.ts +9 -0
- package/vue/hooks/useFiveAction.d.ts +178 -0
- package/vue/hooks/useFiveCameraDirection.d.ts +8 -0
- package/vue/hooks/useFiveCameraRaycaster.d.ts +8 -0
- package/vue/hooks/useFiveCurrentObserver.d.ts +12 -0
- package/vue/hooks/useFiveCurrentState.d.ts +16 -0
- package/vue/hooks/useFiveEventCallback.d.ts +11 -0
- package/vue/hooks/useFiveFloor.d.ts +16 -0
- package/vue/hooks/useFiveHelper.d.ts +15 -0
- package/vue/hooks/useFiveModel.d.ts +7 -0
- package/vue/hooks/useFiveModelBounding.d.ts +7 -0
- package/vue/hooks/useFiveModelIntersectRaycaster.d.ts +23 -0
- package/vue/hooks/useFiveModelReadyState.d.ts +9 -0
- package/vue/hooks/useFiveProject2d.d.ts +26 -0
- package/vue/hooks/useFiveScene.d.ts +6 -0
- package/vue/hooks/useFiveState.d.ts +16 -0
- package/vue/hooks/useFiveWork.d.ts +30 -0
- package/vue/index.d.ts +23 -467
- package/vue/index.js +3 -3
- package/vue/index.mjs +309 -301
- package/vue/rendererPool.d.ts +10 -0
- package/work-downloader/components/model-3d-tile.d.ts +2 -0
- package/work-downloader/components/model.d.ts +3 -0
- package/work-downloader/components/observer.d.ts +7 -0
- package/work-downloader/download.d.ts +16 -0
- package/work-downloader/index.d.ts +2 -33
- package/work-downloader/index.js +3 -3
- package/work-downloader/index.mjs +317 -556
- package/work-downloader/type.d.ts +28 -0
- package/work-downloader/utils/download-to-file.d.ts +1 -0
- package/work-downloader/utils/image-processing.d.ts +7 -0
- package/work-downloader/utils/join-url.d.ts +2 -0
- package/work-downloader/utils/log.d.ts +1 -0
- package/work-downloader/utils/relative-url.d.ts +1 -0
- package/docs/documents/five.FivePlugin.plugin.html +0 -60
- package/docs/documents/plugin.html +0 -60
- package/docs/media/five.ts +0 -2881
- package/docs/media/pass.ts +0 -64
- package/guides/ai-doc-guidelines.md +0 -72
- package/guides/features/3dtile.md +0 -264
- package/guides/features/parameter.md +0 -178
- package/guides/plugin.md +0 -206
- /package/{guides → ai_guides}/release_notes/6.6.md +0 -0
- /package/{guides → ai_guides}/release_notes/6.7.md +0 -0
- /package/{guides → ai_guides}/support.md +0 -0
package/react/index.mjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @license
|
|
3
3
|
* @realsee/five
|
|
4
|
-
* Generated:
|
|
5
|
-
* Version: 6.8.0-alpha.
|
|
4
|
+
* Generated: 3/19/2026
|
|
5
|
+
* Version: 6.8.0-alpha.21
|
|
6
6
|
* Terms:
|
|
7
7
|
* Realsee SDK License Agreement
|
|
8
8
|
* Update: July 28, 2021
|
|
@@ -252,786 +252,575 @@
|
|
|
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
|
-
*/import * as
|
|
256
|
-
import * as
|
|
257
|
-
import {
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
255
|
+
*/import * as e from "react";
|
|
256
|
+
import * as t from "three";
|
|
257
|
+
import { Five as n, getViewportScale as r } from "@realsee/five";
|
|
258
|
+
//#region build/react/rendererPool.js
|
|
259
|
+
var i = [], a = [];
|
|
260
|
+
function o({ preserveDrawingBuffer: e = !0, webgl2: n = !1 } = {}) {
|
|
261
|
+
if (typeof window > "u") return;
|
|
262
|
+
let r = null;
|
|
263
|
+
if (r = n ? i.shift() : a.shift(), !r) {
|
|
264
|
+
if (n) {
|
|
265
|
+
let n = document.createElement("canvas"), i = n.getContext("webgl2");
|
|
266
|
+
i ? r = new t.WebGLRenderer({
|
|
267
|
+
preserveDrawingBuffer: e,
|
|
268
|
+
antialias: !0,
|
|
269
|
+
alpha: !0,
|
|
270
|
+
stencil: !0,
|
|
271
|
+
canvas: n,
|
|
272
|
+
context: i
|
|
273
|
+
}) : (console.error("error occurred when getting webgl2 canvas context, mybe webgl2 not support, fallback to webgl."), r = new t.WebGLRenderer({
|
|
274
|
+
preserveDrawingBuffer: e,
|
|
275
|
+
antialias: !1,
|
|
276
|
+
alpha: !0,
|
|
277
|
+
stencil: !0
|
|
278
|
+
}));
|
|
279
|
+
} else r = new t.WebGLRenderer({
|
|
280
|
+
preserveDrawingBuffer: e,
|
|
281
|
+
antialias: !1,
|
|
282
|
+
alpha: !0,
|
|
283
|
+
stencil: !0
|
|
284
|
+
});
|
|
285
|
+
r.outputEncoding = t.sRGBEncoding;
|
|
286
|
+
}
|
|
287
|
+
return r.autoClear = !0, r;
|
|
288
|
+
}
|
|
289
|
+
function s(e) {
|
|
290
|
+
e && (e.capabilities.isWebGL2 ? a.indexOf(e) === -1 && a.push(e) : i.indexOf(e) === -1 && i.push(e));
|
|
291
|
+
}
|
|
292
|
+
//#endregion
|
|
293
|
+
//#region build/react/context.js
|
|
294
|
+
var c = e.createContext(null);
|
|
295
|
+
function l() {
|
|
296
|
+
let t = e.useContext(c);
|
|
297
|
+
if (!t) throw Error("FiveProvider never found.");
|
|
298
|
+
return t.five;
|
|
299
|
+
}
|
|
300
|
+
function u() {
|
|
301
|
+
let t = e.useContext(c);
|
|
302
|
+
if (!t) throw Error("FiveProvider never found.");
|
|
303
|
+
return t.loadWork;
|
|
304
|
+
}
|
|
305
|
+
//#endregion
|
|
306
|
+
//#region build/react/createProvider.js
|
|
307
|
+
function d(e, t) {
|
|
308
|
+
let n = Array.isArray(e) ? e : [e], r = Array.isArray(t) ? t : [t];
|
|
309
|
+
if (n.length !== r.length) return !1;
|
|
310
|
+
for (let e = 0; e < n.length; e++) if (n[e].workCode !== r[e].workCode) return !1;
|
|
311
|
+
return !0;
|
|
312
|
+
}
|
|
313
|
+
function f(t = {}) {
|
|
314
|
+
return class extends e.Component {
|
|
315
|
+
constructor(e) {
|
|
316
|
+
super(e), this.__fiveEventDisposers = [], this.__fiveDisposeTimer = null, this.five = new n(Object.assign(Object.assign({}, t), { renderer: void 0 })), this.loadWork = this.loadWork.bind(this), this.state = {};
|
|
317
|
+
}
|
|
318
|
+
loadWork(e, t, n, r = !0) {
|
|
319
|
+
if (this.props.work) throw Error("props 'works' is set in fiveProvider, if you need modify work internal, use 'initialWork' instead.");
|
|
320
|
+
return this.five.load(e, t, n, r);
|
|
321
|
+
}
|
|
322
|
+
shouldComponentUpdate(e) {
|
|
323
|
+
return this.five.renderer && this.five && e.work && !d(e.work, this.five.works) && this.five.load(e.work, e.initialState, e.initialOptions), !0;
|
|
324
|
+
}
|
|
325
|
+
componentDidMount() {
|
|
326
|
+
var e;
|
|
327
|
+
clearTimeout(this.__fiveDisposeTimer), this.__fiveDisposeTimer = null;
|
|
328
|
+
let n;
|
|
329
|
+
if (typeof window < "u") {
|
|
330
|
+
n = o({
|
|
331
|
+
webgl2: t == null ? void 0 : t.webgl2,
|
|
332
|
+
preserveDrawingBuffer: t == null ? void 0 : t.preserveDrawingBuffer
|
|
333
|
+
});
|
|
334
|
+
let e = r() === 1 ? window.devicePixelRatio : 1;
|
|
335
|
+
n == null || n.setPixelRatio(e);
|
|
336
|
+
}
|
|
337
|
+
this.five.renderer = n, this.setState({ renderer: n }), this.__fiveEventDisposers.push(this.five.on("load", () => {
|
|
338
|
+
this.props.onWorksChange && this.props.onWorksChange(this.five.works);
|
|
339
|
+
})), this.__fiveEventDisposers.push(this.five.on("stateChange", (e, t) => {
|
|
340
|
+
this.props.onStateChange && this.props.onStateChange(e, t);
|
|
341
|
+
})), this.__fiveEventDisposers.push(this.five.on("currentStateChange", (e, t) => {
|
|
342
|
+
this.props.onCurrentStateChange && this.props.onCurrentStateChange(e, t);
|
|
343
|
+
})), this.__fiveEventDisposers.push(this.five.on("error", (e) => {
|
|
344
|
+
this.props.onError ? this.props.onError(e) : console.warn(e.message);
|
|
345
|
+
}));
|
|
346
|
+
let i = this.props.work || this.props.initialWork;
|
|
347
|
+
i && this.five.load(i, this.props.initialState, this.props.initialOptions, (e = this.props.initialUserAction) == null ? !0 : e);
|
|
348
|
+
}
|
|
349
|
+
componentWillUnmount() {
|
|
350
|
+
var e;
|
|
351
|
+
(e = this.five.controller) == null || e.destroy();
|
|
352
|
+
let t = this.five.renderer;
|
|
353
|
+
this.five.renderer = void 0, s(t), this.setState({ renderer: void 0 }), this.__fiveDisposeTimer = setTimeout(() => {
|
|
354
|
+
this.__fiveDisposeTimer = null, this.five.dispose();
|
|
355
|
+
}, 1e3);
|
|
356
|
+
}
|
|
357
|
+
render() {
|
|
358
|
+
let t = this.five, n = this.loadWork, r = this.state.renderer;
|
|
359
|
+
return e.createElement(c.Provider, { value: {
|
|
360
|
+
renderer: r,
|
|
361
|
+
five: t,
|
|
362
|
+
loadWork: n
|
|
363
|
+
} }, this.props.children);
|
|
364
|
+
}
|
|
365
|
+
};
|
|
366
|
+
}
|
|
367
|
+
//#endregion
|
|
368
|
+
//#region build/react/canvas.js
|
|
369
|
+
var p = typeof window < "u" ? e.useLayoutEffect : e.useEffect, m = {
|
|
370
|
+
display: "inline-block",
|
|
371
|
+
overflow: "hidden"
|
|
372
|
+
}, h = ({ width: t, height: n }) => {
|
|
373
|
+
let r = l(), i = e.createRef(), a = Object.assign({
|
|
374
|
+
width: t,
|
|
375
|
+
height: n
|
|
376
|
+
}, m);
|
|
377
|
+
return p(() => {
|
|
378
|
+
let e = i.current;
|
|
379
|
+
if (!e || !r.renderer) return;
|
|
380
|
+
let a = r.renderer.domElement;
|
|
381
|
+
if (a.parentNode !== null && a.parentNode !== e) throw Error("There are more than 2 fiveCanvas in this context.");
|
|
382
|
+
return a.parentNode !== e && e.appendChild(a), r.camera.aspect = t / n, r.camera.updateProjectionMatrix(), r.renderer.setSize(t, n), r.refresh({
|
|
383
|
+
width: t,
|
|
384
|
+
height: n
|
|
385
|
+
}), r.needsRender = !0, () => {
|
|
386
|
+
a.parentNode === e && e.removeChild(a);
|
|
387
|
+
};
|
|
388
|
+
}, [
|
|
389
|
+
r,
|
|
390
|
+
r.renderer,
|
|
391
|
+
t,
|
|
392
|
+
n,
|
|
393
|
+
i.current
|
|
394
|
+
]), e.createElement("div", {
|
|
395
|
+
ref: i,
|
|
396
|
+
style: a
|
|
397
|
+
});
|
|
264
398
|
};
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
}
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
}
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
}
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
}
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
}
|
|
410
|
-
|
|
411
|
-
function
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
}
|
|
500
|
-
function
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
}
|
|
529
|
-
function
|
|
530
|
-
|
|
531
|
-
}
|
|
532
|
-
function
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
}
|
|
542
|
-
function
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
}
|
|
616
|
-
function ge(e,
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
}
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
}
|
|
648
|
-
function we(e, n) {
|
|
649
|
-
var t = f("cameraDirection", n), r = u.useState(Symbol()), o = r[0], a = r[1], i = u.useMemo(function() {
|
|
650
|
-
if (t)
|
|
651
|
-
return e.camera.getWorldDirection(new p.Vector3());
|
|
652
|
-
}, [e, o]);
|
|
653
|
-
return u.useLayoutEffect(function() {
|
|
654
|
-
if (t)
|
|
655
|
-
return e.on("cameraUpdate", function() {
|
|
656
|
-
return a(Symbol());
|
|
657
|
-
});
|
|
658
|
-
}, [e]), [i, o];
|
|
659
|
-
}
|
|
660
|
-
function be(e, n) {
|
|
661
|
-
var t = f("cameraRaycaster", n), r = u.useState(Symbol()), o = r[0], a = r[1], i = u.useMemo(function() {
|
|
662
|
-
if (t) {
|
|
663
|
-
var s = e.camera.getWorldDirection(new p.Vector3()), c = new p.Raycaster(e.camera.position, s);
|
|
664
|
-
return c;
|
|
665
|
-
}
|
|
666
|
-
}, [e, o]);
|
|
667
|
-
return u.useLayoutEffect(function() {
|
|
668
|
-
if (t)
|
|
669
|
-
return e.on("cameraUpdate", function() {
|
|
670
|
-
return a(Symbol());
|
|
671
|
-
});
|
|
672
|
-
}, [e]), [i, o];
|
|
673
|
-
}
|
|
674
|
-
function Ce(e, n) {
|
|
675
|
-
var t = f("modelReadyState", n), r = u.useState(Symbol()), o = r[0], a = r[1], i = u.useMemo(function() {
|
|
676
|
-
if (t)
|
|
677
|
-
return e.model.empty ? "Empty" : "Loaded";
|
|
678
|
-
}, [e, o]);
|
|
679
|
-
return u.useLayoutEffect(function() {
|
|
680
|
-
if (t)
|
|
681
|
-
return e.on("modelLoaded", function() {
|
|
682
|
-
return a(Symbol());
|
|
683
|
-
});
|
|
684
|
-
}, [e]), [i, o];
|
|
685
|
-
}
|
|
686
|
-
function Fe(e, n) {
|
|
687
|
-
var t = f("shownFloor", n), r = u.useState(Symbol()), o = r[0], a = r[1], i = u.useMemo(function() {
|
|
688
|
-
if (t)
|
|
689
|
-
return e.model.shownFloor;
|
|
690
|
-
}, [e, o]);
|
|
691
|
-
return u.useLayoutEffect(function() {
|
|
692
|
-
if (t)
|
|
693
|
-
return e.on("modelShownFloorChange", function() {
|
|
694
|
-
return a(Symbol());
|
|
695
|
-
});
|
|
696
|
-
}, [e]), [i, o];
|
|
697
|
-
}
|
|
698
|
-
function Ee(e, n) {
|
|
699
|
-
var t = f("helperVisible", n), r = u.useState(Symbol()), o = r[0], a = r[1], i = u.useMemo(function() {
|
|
700
|
-
if (t)
|
|
701
|
-
return e.helperVisible;
|
|
702
|
-
}, [e, o]);
|
|
703
|
-
return u.useLayoutEffect(function() {
|
|
704
|
-
if (t)
|
|
705
|
-
return e.on("helpersVisibleChange", function() {
|
|
706
|
-
return a(Symbol());
|
|
707
|
-
});
|
|
708
|
-
}, [e]), [i, o];
|
|
709
|
-
}
|
|
710
|
-
function ke(e, n) {
|
|
711
|
-
if (f("loadWork", n))
|
|
712
|
-
return e;
|
|
713
|
-
}
|
|
714
|
-
function Re(e, n) {
|
|
715
|
-
if (f("setState", n))
|
|
716
|
-
return function() {
|
|
717
|
-
for (var t = [], r = 0; r < arguments.length; r++)
|
|
718
|
-
t[r] = arguments[r];
|
|
719
|
-
return e.setState.apply(e, t);
|
|
720
|
-
};
|
|
721
|
-
}
|
|
722
|
-
function Le(e, n) {
|
|
723
|
-
if (f("on", n))
|
|
724
|
-
return function() {
|
|
725
|
-
for (var t = [], r = 0; r < arguments.length; r++)
|
|
726
|
-
t[r] = arguments[r];
|
|
727
|
-
return e.on.apply(e, t);
|
|
728
|
-
};
|
|
729
|
-
}
|
|
730
|
-
function Ve(e, n) {
|
|
731
|
-
if (f("on", n))
|
|
732
|
-
return function() {
|
|
733
|
-
for (var t = [], r = 0; r < arguments.length; r++)
|
|
734
|
-
t[r] = arguments[r];
|
|
735
|
-
return e.once.apply(e, t);
|
|
736
|
-
};
|
|
737
|
-
}
|
|
738
|
-
function Pe(e, n) {
|
|
739
|
-
if (f("off", n))
|
|
740
|
-
return function() {
|
|
741
|
-
for (var t = [], r = 0; r < arguments.length; r++)
|
|
742
|
-
t[r] = arguments[r];
|
|
743
|
-
return e.off.apply(e, t);
|
|
744
|
-
};
|
|
745
|
-
}
|
|
746
|
-
function _e(e, n) {
|
|
747
|
-
if (f("intersectRaycaster", n))
|
|
748
|
-
return function() {
|
|
749
|
-
for (var t, r = [], o = 0; o < arguments.length; o++)
|
|
750
|
-
r[o] = arguments[o];
|
|
751
|
-
return (t = e.model).intersectRaycaster.apply(t, r);
|
|
752
|
-
};
|
|
753
|
-
}
|
|
754
|
-
function xe(e, n) {
|
|
755
|
-
if (f("project2d", n))
|
|
756
|
-
return function() {
|
|
757
|
-
for (var t = [], r = 0; r < arguments.length; r++)
|
|
758
|
-
t[r] = arguments[r];
|
|
759
|
-
return e.project2d.apply(e, t);
|
|
760
|
-
};
|
|
761
|
-
}
|
|
762
|
-
function De(e, n) {
|
|
763
|
-
if (f("updateCamera", n))
|
|
764
|
-
return function() {
|
|
765
|
-
for (var t = [], r = 0; r < arguments.length; r++)
|
|
766
|
-
t[r] = arguments[r];
|
|
767
|
-
return e.updateCamera.apply(e, t);
|
|
768
|
-
};
|
|
769
|
-
}
|
|
770
|
-
function We(e, n) {
|
|
771
|
-
if (f("getPixels", n))
|
|
772
|
-
return e.getPixels.bind(e);
|
|
773
|
-
}
|
|
774
|
-
function Oe(e, n) {
|
|
775
|
-
if (f("render", n))
|
|
776
|
-
return function() {
|
|
777
|
-
for (var t = [], r = 0; r < arguments.length; r++)
|
|
778
|
-
t[r] = arguments[r];
|
|
779
|
-
return e.render.apply(e, t);
|
|
780
|
-
};
|
|
781
|
-
}
|
|
782
|
-
function Me(e, n) {
|
|
783
|
-
if (f("needsRender", n))
|
|
784
|
-
return function() {
|
|
785
|
-
e.needsRender = !0;
|
|
786
|
-
};
|
|
787
|
-
}
|
|
788
|
-
function Ue(e, n) {
|
|
789
|
-
if (f("preloadPano", n))
|
|
790
|
-
return function() {
|
|
791
|
-
for (var t = [], r = 0; r < arguments.length; r++)
|
|
792
|
-
t[r] = arguments[r];
|
|
793
|
-
return e.preloadPano.apply(e, t);
|
|
794
|
-
};
|
|
795
|
-
}
|
|
796
|
-
function je(e, n) {
|
|
797
|
-
if (f("showFloor", n))
|
|
798
|
-
return function(t) {
|
|
799
|
-
typeof t == "number" ? e.model.show(t) : e.model.show();
|
|
800
|
-
};
|
|
801
|
-
}
|
|
802
|
-
function Te(e, n) {
|
|
803
|
-
if (f("toggleHelperVisible", n))
|
|
804
|
-
return function(t) {
|
|
805
|
-
e.helperVisible = t;
|
|
806
|
-
};
|
|
807
|
-
}
|
|
808
|
-
function ir(e) {
|
|
809
|
-
return function(n) {
|
|
810
|
-
return u.forwardRef(function(t, r) {
|
|
811
|
-
var o = v(), a = H(), i = ge(o, e)[0], s = de(o, e), c = s[0], l = s[1], d = pe(o, e), m = d[0], g = d[1], S = he(o, e), b = S[0], C = S[1], V = me(o, e), G = V[0], I = V[1], P = ye(o, e), q = P[0], z = P[1], A = Se(o, e)[0], _ = we(o, e), J = _[0], K = _[1], x = be(o, e), Q = x[0], X = x[1], D = Ce(o, e), Y = D[0], Z = D[1], W = Fe(o, e), ee = W[0], re = W[1], O = Ee(o, e), te = O[0], ne = O[1], M = u.useMemo(function() {
|
|
812
|
-
var y = {};
|
|
813
|
-
return $(y, {
|
|
814
|
-
setState: Re(o, e),
|
|
815
|
-
loadWork: ke(a, e),
|
|
816
|
-
on: Le(o, e),
|
|
817
|
-
once: Ve(o, e),
|
|
818
|
-
off: Pe(o, e),
|
|
819
|
-
intersectRaycaster: _e(o, e),
|
|
820
|
-
project2d: xe(o, e),
|
|
821
|
-
updateCamera: De(o, e),
|
|
822
|
-
getPixels: We(o, e),
|
|
823
|
-
render: Oe(o, e),
|
|
824
|
-
needsRender: Me(o, e),
|
|
825
|
-
preloadPano: Ue(o, e),
|
|
826
|
-
showFloor: je(o, e),
|
|
827
|
-
toggleHelperVisible: Te(o, e)
|
|
828
|
-
}), y;
|
|
829
|
-
}, [o, a]), oe = u.useMemo(function() {
|
|
830
|
-
var y = h({}, M);
|
|
831
|
-
return $(y, {
|
|
832
|
-
unsafe__fiveInstance: i,
|
|
833
|
-
state: c,
|
|
834
|
-
currentState: m,
|
|
835
|
-
currentObserver: b,
|
|
836
|
-
work: G,
|
|
837
|
-
model: q,
|
|
838
|
-
scene: A,
|
|
839
|
-
cameraDirection: J,
|
|
840
|
-
cameraRaycaster: Q,
|
|
841
|
-
modelReadyState: Y,
|
|
842
|
-
shownFloor: ee,
|
|
843
|
-
helperVisible: te
|
|
844
|
-
}), y;
|
|
845
|
-
}, [
|
|
846
|
-
o,
|
|
847
|
-
M,
|
|
848
|
-
l,
|
|
849
|
-
g,
|
|
850
|
-
C,
|
|
851
|
-
I,
|
|
852
|
-
z,
|
|
853
|
-
K,
|
|
854
|
-
X,
|
|
855
|
-
Z,
|
|
856
|
-
re,
|
|
857
|
-
ne
|
|
858
|
-
]);
|
|
859
|
-
return u.createElement(n, h({ ref: r, $five: oe }, t));
|
|
860
|
-
});
|
|
861
|
-
};
|
|
862
|
-
}
|
|
863
|
-
function sr() {
|
|
864
|
-
for (var e = [], n = 0; n < arguments.length; n++)
|
|
865
|
-
e[n] = arguments[n];
|
|
866
|
-
return e;
|
|
867
|
-
}
|
|
868
|
-
function F(e, n) {
|
|
869
|
-
for (var t = {}, r = n.length, o = -1; ++o < r; ) {
|
|
870
|
-
var a = n[o];
|
|
871
|
-
a in e && (t[a] = e[a]);
|
|
872
|
-
}
|
|
873
|
-
return t;
|
|
874
|
-
}
|
|
875
|
-
function Ne(e, n) {
|
|
876
|
-
return typeof e == "number" && typeof n == "number" && isNaN(e) && isNaN(n) ? !0 : e === n;
|
|
877
|
-
}
|
|
878
|
-
function $e(e, n) {
|
|
879
|
-
for (var t = 0; t < e.length; t++)
|
|
880
|
-
for (var r = 0; r < n.length; r++)
|
|
881
|
-
if (e[t] === n[r])
|
|
882
|
-
return !0;
|
|
883
|
-
return !1;
|
|
884
|
-
}
|
|
885
|
-
var Be = (
|
|
886
|
-
/** @class */
|
|
887
|
-
(function() {
|
|
888
|
-
function e(n, t) {
|
|
889
|
-
this.values = n, this.listeners = [], this.onValuesChange = t;
|
|
890
|
-
}
|
|
891
|
-
return e.prototype.on = function(n, t) {
|
|
892
|
-
var r = this, o = [n, t];
|
|
893
|
-
return this.listeners.push(o), function() {
|
|
894
|
-
var a = r.listeners.indexOf(o);
|
|
895
|
-
a >= 0 && r.listeners.splice(a, 1);
|
|
896
|
-
};
|
|
897
|
-
}, e.prototype.getValues = function(n) {
|
|
898
|
-
return F(this.values, n);
|
|
899
|
-
}, e.prototype.setValues = function(n, t) {
|
|
900
|
-
var r = [];
|
|
901
|
-
for (var o in t)
|
|
902
|
-
n.indexOf(o) >= 0 && !Ne(t[o], this.values[o]) && r.push(o);
|
|
903
|
-
if (r.length !== 0) {
|
|
904
|
-
for (var a = h({}, this.values), i = 0, s = r; i < s.length; i++) {
|
|
905
|
-
var c = s[i];
|
|
906
|
-
this.values[c] = t[c];
|
|
907
|
-
}
|
|
908
|
-
this.onValuesChange && this.onValuesChange(this.values, a);
|
|
909
|
-
for (var l = 0, d = this.listeners; l < d.length; l++) {
|
|
910
|
-
var m = d[l], g = m[0], S = m[1];
|
|
911
|
-
if ($e(g, r)) {
|
|
912
|
-
var b = F(a, g), C = F(this.values, g);
|
|
913
|
-
S(C, b);
|
|
914
|
-
}
|
|
915
|
-
}
|
|
916
|
-
}
|
|
917
|
-
}, e;
|
|
918
|
-
})()
|
|
919
|
-
);
|
|
920
|
-
function cr(e) {
|
|
921
|
-
var n = u.createContext(null);
|
|
922
|
-
return {
|
|
923
|
-
/**
|
|
924
|
-
* 使用 Store
|
|
925
|
-
* @param names - 获取的 Store 字段
|
|
926
|
-
* @returns [值, 修改值方法]
|
|
927
|
-
*/
|
|
928
|
-
useStore: function(t) {
|
|
929
|
-
var r = u.useContext(n);
|
|
930
|
-
if (r === null)
|
|
931
|
-
throw new Error("StoreProvider never found.");
|
|
932
|
-
var o = u.useRef(!0), a = u.useState(r.getValues(t)), i = a[0], s = a[1], c = w([r], t, !0);
|
|
933
|
-
u.useLayoutEffect(function() {
|
|
934
|
-
return o.current ? o.current = !1 : s(r.getValues(t)), r.on(t, function(d) {
|
|
935
|
-
return s(d);
|
|
936
|
-
});
|
|
937
|
-
}, c);
|
|
938
|
-
var l = u.useCallback(function(d) {
|
|
939
|
-
return r.setValues(t, d);
|
|
940
|
-
}, c);
|
|
941
|
-
return [i, l];
|
|
942
|
-
},
|
|
943
|
-
/**
|
|
944
|
-
* 使用 Store (仅设置值)
|
|
945
|
-
* @param names - 获取的 Store 字段
|
|
946
|
-
* @returns 修改值方法
|
|
947
|
-
*/
|
|
948
|
-
useStoreSetter: function(t) {
|
|
949
|
-
var r = u.useContext(n);
|
|
950
|
-
if (r === null)
|
|
951
|
-
throw new Error("StoreProvider never found.");
|
|
952
|
-
var o = u.useCallback(function(a) {
|
|
953
|
-
return r.setValues(t, a);
|
|
954
|
-
}, w([r], t, !0));
|
|
955
|
-
return o;
|
|
956
|
-
},
|
|
957
|
-
/**
|
|
958
|
-
* 监听 Store 变化
|
|
959
|
-
* @param names - Store 字段
|
|
960
|
-
* @param callback - 监听变化的回调函数
|
|
961
|
-
* @param deps - 依赖对象
|
|
962
|
-
*/
|
|
963
|
-
watchStore: function(t, r, o) {
|
|
964
|
-
var a = u.useContext(n);
|
|
965
|
-
if (a === null)
|
|
966
|
-
throw new Error("StoreProvider never found.");
|
|
967
|
-
var i = w([a], t, !0);
|
|
968
|
-
o !== void 0 && (i = i.concat(o)), u.useLayoutEffect(function() {
|
|
969
|
-
return a.on(t, r);
|
|
970
|
-
}, i);
|
|
971
|
-
},
|
|
972
|
-
useStoreAction: function(t) {
|
|
973
|
-
var r = u.useContext(n);
|
|
974
|
-
if (r === null)
|
|
975
|
-
throw new Error("StoreProvider never found.");
|
|
976
|
-
var o = u.useCallback(function() {
|
|
977
|
-
for (var a = [], i = 0; i < arguments.length; i++)
|
|
978
|
-
a[i] = arguments[i];
|
|
979
|
-
var s = e[t], c = s[0], l = s.slice(1), d = function() {
|
|
980
|
-
return r.getValues(l);
|
|
981
|
-
}, m = function(g) {
|
|
982
|
-
return r.setValues(l, g);
|
|
983
|
-
};
|
|
984
|
-
return c.apply(void 0, w([d, m], a, !1));
|
|
985
|
-
}, []);
|
|
986
|
-
return o;
|
|
987
|
-
},
|
|
988
|
-
/**
|
|
989
|
-
* Store Provider.
|
|
990
|
-
* 内部组件均可和 store 交互
|
|
991
|
-
*/
|
|
992
|
-
StoreProvider: (
|
|
993
|
-
/** @class */
|
|
994
|
-
(function(t) {
|
|
995
|
-
B(r, t);
|
|
996
|
-
function r(o) {
|
|
997
|
-
var a = t.call(this, o) || this;
|
|
998
|
-
return a.store = new Be(o.initialValue, function() {
|
|
999
|
-
for (var i, s = [], c = 0; c < arguments.length; c++)
|
|
1000
|
-
s[c] = arguments[c];
|
|
1001
|
-
a.props.onValuesChange && (i = a.props).onValuesChange.apply(i, s);
|
|
1002
|
-
}), a;
|
|
1003
|
-
}
|
|
1004
|
-
return r.prototype.shouldComponentUpdate = function(o) {
|
|
1005
|
-
return o.children !== this.props.children;
|
|
1006
|
-
}, r.prototype.render = function() {
|
|
1007
|
-
return u.createElement(n.Provider, { value: this.store }, this.props.children);
|
|
1008
|
-
}, r;
|
|
1009
|
-
})(u.Component)
|
|
1010
|
-
)
|
|
1011
|
-
};
|
|
1012
|
-
}
|
|
1013
|
-
export {
|
|
1014
|
-
Ie as FiveCanvas,
|
|
1015
|
-
ur as INJECTION_PROPNAME,
|
|
1016
|
-
Be as Store,
|
|
1017
|
-
sr as createFiveFeature,
|
|
1018
|
-
Ge as createFiveProvider,
|
|
1019
|
-
cr as createStore,
|
|
1020
|
-
qe as unsafe__useFiveInstance,
|
|
1021
|
-
Ye as useFiveAction,
|
|
1022
|
-
rr as useFiveCameraDirection,
|
|
1023
|
-
er as useFiveCameraRaycaster,
|
|
1024
|
-
Qe as useFiveCurrentObserver,
|
|
1025
|
-
Ke as useFiveCurrentState,
|
|
1026
|
-
Xe as useFiveEventCallback,
|
|
1027
|
-
or as useFiveFloor,
|
|
1028
|
-
ar as useFiveHelper,
|
|
1029
|
-
tr as useFiveModelIntersectRaycaster,
|
|
1030
|
-
nr as useFiveModelReadyState,
|
|
1031
|
-
Ze as useFiveProject2d,
|
|
1032
|
-
ze as useFiveScene,
|
|
1033
|
-
ve as useFiveSceneEffect,
|
|
1034
|
-
Je as useFiveState,
|
|
1035
|
-
Ae as useFiveWork,
|
|
1036
|
-
ir as withFive
|
|
399
|
+
//#endregion
|
|
400
|
+
//#region build/react/hooks/unsafe__useFiveInstance.js
|
|
401
|
+
function g() {
|
|
402
|
+
return l();
|
|
403
|
+
}
|
|
404
|
+
//#endregion
|
|
405
|
+
//#region build/react/hooks/useFiveSceneEffect.js
|
|
406
|
+
function _(t, n) {
|
|
407
|
+
let r = l(), i = [r];
|
|
408
|
+
n !== void 0 && (i = i.concat(n)), e.useLayoutEffect(() => t(r.scene), i);
|
|
409
|
+
}
|
|
410
|
+
var v = _;
|
|
411
|
+
//#endregion
|
|
412
|
+
//#region build/react/hooks/useFiveWork.js
|
|
413
|
+
function y() {
|
|
414
|
+
let t = l(), n = u(), [r, i] = e.useState(() => t.works);
|
|
415
|
+
return e.useLayoutEffect(() => t.on("load", () => i(t.works)), [t]), [r, n];
|
|
416
|
+
}
|
|
417
|
+
//#endregion
|
|
418
|
+
//#region build/react/hooks/useFiveState.js
|
|
419
|
+
function b(e) {
|
|
420
|
+
return Object.assign({}, e.state);
|
|
421
|
+
}
|
|
422
|
+
function x() {
|
|
423
|
+
let t = l(), [n, r] = e.useState(() => b(t)), i = e.useCallback((e, n = !1, r = !0) => {
|
|
424
|
+
let i = typeof e == "function" ? e(t.getCurrentState()) : e;
|
|
425
|
+
t.setState(i, n, r);
|
|
426
|
+
}, [t]);
|
|
427
|
+
return e.useLayoutEffect(() => t.on("stateChange", () => r(b(t))), [t]), [n, i];
|
|
428
|
+
}
|
|
429
|
+
//#endregion
|
|
430
|
+
//#region build/react/hooks/useFiveCurrentState.js
|
|
431
|
+
function S() {
|
|
432
|
+
let t = l(), [n, r] = e.useState(() => t.getCurrentState()), i = e.useCallback((e, n = !1, r = !0) => {
|
|
433
|
+
let i = typeof e == "function" ? e(t.getCurrentState()) : e;
|
|
434
|
+
t.setState(i, n, r);
|
|
435
|
+
}, [t]);
|
|
436
|
+
return e.useLayoutEffect(() => t.on("currentStateChange", () => r(t.getCurrentState())), [t]), [n, i];
|
|
437
|
+
}
|
|
438
|
+
//#endregion
|
|
439
|
+
//#region build/react/hooks/useFiveCurrentObserver.js
|
|
440
|
+
function C() {
|
|
441
|
+
let t = l(), [n, r] = e.useState(() => t.getCurrentState());
|
|
442
|
+
return e.useLayoutEffect(() => t.on("currentStateChange", () => r(t.getCurrentState())), [t]), t.works.getObserver(n);
|
|
443
|
+
}
|
|
444
|
+
//#endregion
|
|
445
|
+
//#region build/react/hooks/useFiveEventCallback.js
|
|
446
|
+
function w(t, n, r) {
|
|
447
|
+
let i = l(), a = [i, t];
|
|
448
|
+
r !== void 0 && (a = a.concat(r)), e.useLayoutEffect(() => i.on(t, n), a);
|
|
449
|
+
}
|
|
450
|
+
//#endregion
|
|
451
|
+
//#region build/react/hooks/useFiveAction.js
|
|
452
|
+
function T() {
|
|
453
|
+
let t = l();
|
|
454
|
+
return {
|
|
455
|
+
updateCamera: e.useCallback((e, n) => t.updateCamera(e, n), [t]),
|
|
456
|
+
getPixels: e.useCallback(t.getPixels.bind(t), [t]),
|
|
457
|
+
render: e.useCallback((e) => t.render(e), [t]),
|
|
458
|
+
needsRender: e.useCallback(() => t.needsRender = !0, [t]),
|
|
459
|
+
preloadPano: e.useCallback((e, n) => t.preloadPano(e, n), [t])
|
|
460
|
+
};
|
|
461
|
+
}
|
|
462
|
+
//#endregion
|
|
463
|
+
//#region build/react/hooks/useFiveProject2d.js
|
|
464
|
+
function E() {
|
|
465
|
+
let t = l(), [n, r] = e.useState(() => Symbol());
|
|
466
|
+
return e.useLayoutEffect(() => t.on("cameraUpdate", () => r(Symbol())), [t]), e.useCallback((e, n) => t.project2d(e, n), [t]);
|
|
467
|
+
}
|
|
468
|
+
//#endregion
|
|
469
|
+
//#region build/react/hooks/useFiveCameraRaycaster.js
|
|
470
|
+
function D(e) {
|
|
471
|
+
let n = e.camera.getWorldDirection(new t.Vector3());
|
|
472
|
+
return new t.Raycaster(e.camera.position, n);
|
|
473
|
+
}
|
|
474
|
+
function O() {
|
|
475
|
+
let t = l(), [n, r] = e.useState(() => D(t));
|
|
476
|
+
return e.useLayoutEffect(() => t.on("cameraUpdate", () => r(D(t))), [t]), n;
|
|
477
|
+
}
|
|
478
|
+
//#endregion
|
|
479
|
+
//#region build/react/hooks/useFiveCameraDirection.js
|
|
480
|
+
function k(e) {
|
|
481
|
+
return e.camera.getWorldDirection(new t.Vector3());
|
|
482
|
+
}
|
|
483
|
+
function A() {
|
|
484
|
+
let t = l(), [n, r] = e.useState(() => k(t));
|
|
485
|
+
return e.useLayoutEffect(() => t.on("cameraUpdate", () => r(k(t))), [t]), n;
|
|
486
|
+
}
|
|
487
|
+
//#endregion
|
|
488
|
+
//#region build/react/hooks/useFiveModelIntersectRaycaster.js
|
|
489
|
+
function j() {
|
|
490
|
+
let t = l();
|
|
491
|
+
return e.useCallback((e) => t.model.intersectRaycaster(e), [t]);
|
|
492
|
+
}
|
|
493
|
+
//#endregion
|
|
494
|
+
//#region build/react/hooks/useFiveModelReadyState.js
|
|
495
|
+
function M(e) {
|
|
496
|
+
return e.model.empty ? "Empty" : "Loaded";
|
|
497
|
+
}
|
|
498
|
+
function ee() {
|
|
499
|
+
let t = l(), [n, r] = e.useState(() => M(t));
|
|
500
|
+
return e.useLayoutEffect(() => t.on("modelLoaded", () => r(M(t))), [t]), n;
|
|
501
|
+
}
|
|
502
|
+
//#endregion
|
|
503
|
+
//#region build/react/hooks/useFiveFloor.js
|
|
504
|
+
function N() {
|
|
505
|
+
let t = l(), [n, r] = e.useState(t.model.shownFloor), [i, a] = e.useState(t.model.floorLength), o = e.useCallback((e) => {
|
|
506
|
+
typeof e == "number" ? t.model.show(e) : t.model.show();
|
|
507
|
+
}, [t]);
|
|
508
|
+
return e.useLayoutEffect(() => {
|
|
509
|
+
let e = [];
|
|
510
|
+
return e.push(t.on("modelShownFloorChange", () => r(t.model.shownFloor))), e.push(t.on("modelLoaded", () => a(t.model.floorLength))), () => {
|
|
511
|
+
let t;
|
|
512
|
+
for (; t = e.shift();) t();
|
|
513
|
+
};
|
|
514
|
+
}, [t]), [
|
|
515
|
+
n,
|
|
516
|
+
i,
|
|
517
|
+
o
|
|
518
|
+
];
|
|
519
|
+
}
|
|
520
|
+
//#endregion
|
|
521
|
+
//#region build/react/hooks/useFiveHelper.js
|
|
522
|
+
function te() {
|
|
523
|
+
let t = l(), [n, r] = e.useState(t.helperVisible), i = e.useCallback((e) => {
|
|
524
|
+
t.helperVisible = e;
|
|
525
|
+
}, [t]);
|
|
526
|
+
return e.useLayoutEffect(() => t.on("helpersVisibleChange", (e) => r(e)), [t]), [n, i];
|
|
527
|
+
}
|
|
528
|
+
//#endregion
|
|
529
|
+
//#region build/react/withFive.js
|
|
530
|
+
var ne = "$five";
|
|
531
|
+
function P(e, t) {
|
|
532
|
+
return t.indexOf(e) >= 0;
|
|
533
|
+
}
|
|
534
|
+
function F(e, t) {
|
|
535
|
+
for (let n of Object.keys(t)) t[n] !== void 0 && (e[n] = t[n]);
|
|
536
|
+
}
|
|
537
|
+
function I(t, n) {
|
|
538
|
+
let r = P("state", n), [i, a] = e.useState(Symbol()), o = e.useMemo(() => {
|
|
539
|
+
if (r) return Object.assign({}, t.state);
|
|
540
|
+
}, [t, i]);
|
|
541
|
+
return e.useLayoutEffect(() => {
|
|
542
|
+
if (r) return t.on("stateChange", () => a(Symbol()));
|
|
543
|
+
}, [t]), [o, i];
|
|
544
|
+
}
|
|
545
|
+
function L(t, n) {
|
|
546
|
+
let r = P("currentState", n), [i, a] = e.useState(Symbol()), o = e.useMemo(() => {
|
|
547
|
+
if (r) return t.getCurrentState();
|
|
548
|
+
}, [t, i]);
|
|
549
|
+
return e.useLayoutEffect(() => {
|
|
550
|
+
if (r) return t.on("currentStateChange", () => a(Symbol()));
|
|
551
|
+
}, [t]), [o, i];
|
|
552
|
+
}
|
|
553
|
+
function R(t, n) {
|
|
554
|
+
let r = P("currentObserver", n), [i, a] = e.useState(Symbol()), o = e.useMemo(() => {
|
|
555
|
+
if (r) return t.getCurrentState();
|
|
556
|
+
}, [t, i]);
|
|
557
|
+
e.useLayoutEffect(() => {
|
|
558
|
+
if (r) return t.on("currentStateChange", () => a(Symbol()));
|
|
559
|
+
}, [t]);
|
|
560
|
+
let s;
|
|
561
|
+
return o && (s = t.works.getObserver(o)), [s, i];
|
|
562
|
+
}
|
|
563
|
+
function z(e, t) {
|
|
564
|
+
return [P("unsafe__fiveInstance", t) ? e : void 0];
|
|
565
|
+
}
|
|
566
|
+
function B(t, n) {
|
|
567
|
+
let r = P("works", n), [i, a] = e.useState(Symbol()), o = e.useMemo(() => {
|
|
568
|
+
if (r) return t.works;
|
|
569
|
+
}, [t, i]);
|
|
570
|
+
return e.useLayoutEffect(() => {
|
|
571
|
+
if (r) return t.on("load", () => a(Symbol()));
|
|
572
|
+
}, [t]), [o, i];
|
|
573
|
+
}
|
|
574
|
+
function V(t, n) {
|
|
575
|
+
let r = P("model", n), [i, a] = e.useState(Symbol()), o = e.useMemo(() => {
|
|
576
|
+
if (r) return t.model;
|
|
577
|
+
}, [t, i]);
|
|
578
|
+
return e.useLayoutEffect(() => {
|
|
579
|
+
if (r) return t.on("modelLoaded", () => a(Symbol()));
|
|
580
|
+
}, [t]), [o, i];
|
|
581
|
+
}
|
|
582
|
+
function H(e, t) {
|
|
583
|
+
return [P("scene", t) ? e.scene : void 0];
|
|
584
|
+
}
|
|
585
|
+
function U(n, r) {
|
|
586
|
+
let i = P("cameraDirection", r), [a, o] = e.useState(Symbol()), s = e.useMemo(() => {
|
|
587
|
+
if (i) return n.camera.getWorldDirection(new t.Vector3());
|
|
588
|
+
}, [n, a]);
|
|
589
|
+
return e.useLayoutEffect(() => {
|
|
590
|
+
if (i) return n.on("cameraUpdate", () => o(Symbol()));
|
|
591
|
+
}, [n]), [s, a];
|
|
592
|
+
}
|
|
593
|
+
function W(n, r) {
|
|
594
|
+
let i = P("cameraRaycaster", r), [a, o] = e.useState(Symbol()), s = e.useMemo(() => {
|
|
595
|
+
if (i) {
|
|
596
|
+
let e = n.camera.getWorldDirection(new t.Vector3());
|
|
597
|
+
return new t.Raycaster(n.camera.position, e);
|
|
598
|
+
}
|
|
599
|
+
}, [n, a]);
|
|
600
|
+
return e.useLayoutEffect(() => {
|
|
601
|
+
if (i) return n.on("cameraUpdate", () => o(Symbol()));
|
|
602
|
+
}, [n]), [s, a];
|
|
603
|
+
}
|
|
604
|
+
function G(t, n) {
|
|
605
|
+
let r = P("modelReadyState", n), [i, a] = e.useState(Symbol()), o = e.useMemo(() => {
|
|
606
|
+
if (r) return t.model.empty ? "Empty" : "Loaded";
|
|
607
|
+
}, [t, i]);
|
|
608
|
+
return e.useLayoutEffect(() => {
|
|
609
|
+
if (r) return t.on("modelLoaded", () => a(Symbol()));
|
|
610
|
+
}, [t]), [o, i];
|
|
611
|
+
}
|
|
612
|
+
function K(t, n) {
|
|
613
|
+
let r = P("shownFloor", n), [i, a] = e.useState(Symbol()), o = e.useMemo(() => {
|
|
614
|
+
if (r) return t.model.shownFloor;
|
|
615
|
+
}, [t, i]);
|
|
616
|
+
return e.useLayoutEffect(() => {
|
|
617
|
+
if (r) return t.on("modelShownFloorChange", () => a(Symbol()));
|
|
618
|
+
}, [t]), [o, i];
|
|
619
|
+
}
|
|
620
|
+
function q(t, n) {
|
|
621
|
+
let r = P("helperVisible", n), [i, a] = e.useState(Symbol()), o = e.useMemo(() => {
|
|
622
|
+
if (r) return t.helperVisible;
|
|
623
|
+
}, [t, i]);
|
|
624
|
+
return e.useLayoutEffect(() => {
|
|
625
|
+
if (r) return t.on("helpersVisibleChange", () => a(Symbol()));
|
|
626
|
+
}, [t]), [o, i];
|
|
627
|
+
}
|
|
628
|
+
function J(e, t) {
|
|
629
|
+
if (P("loadWork", t)) return e;
|
|
630
|
+
}
|
|
631
|
+
function Y(e, t) {
|
|
632
|
+
if (P("setState", t)) return (...t) => e.setState(...t);
|
|
633
|
+
}
|
|
634
|
+
function X(e, t) {
|
|
635
|
+
if (P("on", t)) return (...t) => e.on(...t);
|
|
636
|
+
}
|
|
637
|
+
function re(e, t) {
|
|
638
|
+
if (P("on", t)) return (...t) => e.once(...t);
|
|
639
|
+
}
|
|
640
|
+
function ie(e, t) {
|
|
641
|
+
if (P("off", t)) return (...t) => e.off(...t);
|
|
642
|
+
}
|
|
643
|
+
function ae(e, t) {
|
|
644
|
+
if (P("intersectRaycaster", t)) return (...t) => e.model.intersectRaycaster(...t);
|
|
645
|
+
}
|
|
646
|
+
function oe(e, t) {
|
|
647
|
+
if (P("project2d", t)) return (...t) => e.project2d(...t);
|
|
648
|
+
}
|
|
649
|
+
function se(e, t) {
|
|
650
|
+
if (P("updateCamera", t)) return (...t) => e.updateCamera(...t);
|
|
651
|
+
}
|
|
652
|
+
function ce(e, t) {
|
|
653
|
+
if (P("getPixels", t)) return e.getPixels.bind(e);
|
|
654
|
+
}
|
|
655
|
+
function le(e, t) {
|
|
656
|
+
if (P("render", t)) return (...t) => e.render(...t);
|
|
657
|
+
}
|
|
658
|
+
function Z(e, t) {
|
|
659
|
+
if (P("needsRender", t)) return () => {
|
|
660
|
+
e.needsRender = !0;
|
|
661
|
+
};
|
|
662
|
+
}
|
|
663
|
+
function ue(e, t) {
|
|
664
|
+
if (P("preloadPano", t)) return (...t) => e.preloadPano(...t);
|
|
665
|
+
}
|
|
666
|
+
function de(e, t) {
|
|
667
|
+
if (P("showFloor", t)) return (t) => {
|
|
668
|
+
typeof t == "number" ? e.model.show(t) : e.model.show();
|
|
669
|
+
};
|
|
670
|
+
}
|
|
671
|
+
function fe(e, t) {
|
|
672
|
+
if (P("toggleHelperVisible", t)) return (t) => {
|
|
673
|
+
e.helperVisible = t;
|
|
674
|
+
};
|
|
675
|
+
}
|
|
676
|
+
function pe(t) {
|
|
677
|
+
return function(n) {
|
|
678
|
+
return e.forwardRef((r, i) => {
|
|
679
|
+
let a = l(), o = u(), [s] = z(a, t), [c, d] = I(a, t), [f, p] = L(a, t), [m, h] = R(a, t), [g, _] = B(a, t), [v, y] = V(a, t), [b] = H(a, t), [x, S] = U(a, t), [C, w] = W(a, t), [T, E] = G(a, t), [D, O] = K(a, t), [k, A] = q(a, t), j = e.useMemo(() => {
|
|
680
|
+
let e = {};
|
|
681
|
+
return F(e, {
|
|
682
|
+
setState: Y(a, t),
|
|
683
|
+
loadWork: J(o, t),
|
|
684
|
+
on: X(a, t),
|
|
685
|
+
once: re(a, t),
|
|
686
|
+
off: ie(a, t),
|
|
687
|
+
intersectRaycaster: ae(a, t),
|
|
688
|
+
project2d: oe(a, t),
|
|
689
|
+
updateCamera: se(a, t),
|
|
690
|
+
getPixels: ce(a, t),
|
|
691
|
+
render: le(a, t),
|
|
692
|
+
needsRender: Z(a, t),
|
|
693
|
+
preloadPano: ue(a, t),
|
|
694
|
+
showFloor: de(a, t),
|
|
695
|
+
toggleHelperVisible: fe(a, t)
|
|
696
|
+
}), e;
|
|
697
|
+
}, [a, o]), M = e.useMemo(() => {
|
|
698
|
+
let e = Object.assign({}, j);
|
|
699
|
+
return F(e, {
|
|
700
|
+
unsafe__fiveInstance: s,
|
|
701
|
+
state: c,
|
|
702
|
+
currentState: f,
|
|
703
|
+
currentObserver: m,
|
|
704
|
+
work: g,
|
|
705
|
+
model: v,
|
|
706
|
+
scene: b,
|
|
707
|
+
cameraDirection: x,
|
|
708
|
+
cameraRaycaster: C,
|
|
709
|
+
modelReadyState: T,
|
|
710
|
+
shownFloor: D,
|
|
711
|
+
helperVisible: k
|
|
712
|
+
}), e;
|
|
713
|
+
}, [
|
|
714
|
+
a,
|
|
715
|
+
j,
|
|
716
|
+
d,
|
|
717
|
+
p,
|
|
718
|
+
h,
|
|
719
|
+
_,
|
|
720
|
+
y,
|
|
721
|
+
S,
|
|
722
|
+
w,
|
|
723
|
+
E,
|
|
724
|
+
O,
|
|
725
|
+
A
|
|
726
|
+
]);
|
|
727
|
+
return e.createElement(n, Object.assign({
|
|
728
|
+
ref: i,
|
|
729
|
+
$five: M
|
|
730
|
+
}, r));
|
|
731
|
+
});
|
|
732
|
+
};
|
|
733
|
+
}
|
|
734
|
+
function me(...e) {
|
|
735
|
+
return e;
|
|
736
|
+
}
|
|
737
|
+
//#endregion
|
|
738
|
+
//#region build/react/createStore.js
|
|
739
|
+
function Q(e, t) {
|
|
740
|
+
let n = {}, r = t.length, i = -1;
|
|
741
|
+
for (; ++i < r;) {
|
|
742
|
+
let r = t[i];
|
|
743
|
+
r in e && (n[r] = e[r]);
|
|
744
|
+
}
|
|
745
|
+
return n;
|
|
746
|
+
}
|
|
747
|
+
function he(e, t) {
|
|
748
|
+
return typeof e == "number" && typeof t == "number" && isNaN(e) && isNaN(t) ? !0 : e === t;
|
|
749
|
+
}
|
|
750
|
+
function ge(e, t) {
|
|
751
|
+
for (let n = 0; n < e.length; n++) for (let r = 0; r < t.length; r++) if (e[n] === t[r]) return !0;
|
|
752
|
+
return !1;
|
|
753
|
+
}
|
|
754
|
+
var $ = class {
|
|
755
|
+
constructor(e, t) {
|
|
756
|
+
this.values = e, this.listeners = [], this.onValuesChange = t;
|
|
757
|
+
}
|
|
758
|
+
on(e, t) {
|
|
759
|
+
let n = [e, t];
|
|
760
|
+
return this.listeners.push(n), () => {
|
|
761
|
+
let e = this.listeners.indexOf(n);
|
|
762
|
+
e >= 0 && this.listeners.splice(e, 1);
|
|
763
|
+
};
|
|
764
|
+
}
|
|
765
|
+
getValues(e) {
|
|
766
|
+
return Q(this.values, e);
|
|
767
|
+
}
|
|
768
|
+
setValues(e, t) {
|
|
769
|
+
let n = [];
|
|
770
|
+
for (let r in t) e.indexOf(r) >= 0 && !he(t[r], this.values[r]) && n.push(r);
|
|
771
|
+
if (n.length === 0) return;
|
|
772
|
+
let r = Object.assign({}, this.values);
|
|
773
|
+
for (let e of n) this.values[e] = t[e];
|
|
774
|
+
this.onValuesChange && this.onValuesChange(this.values, r);
|
|
775
|
+
for (let [e, t] of this.listeners) {
|
|
776
|
+
if (!ge(e, n)) continue;
|
|
777
|
+
let i = Q(r, e);
|
|
778
|
+
t(Q(this.values, e), i);
|
|
779
|
+
}
|
|
780
|
+
}
|
|
1037
781
|
};
|
|
782
|
+
function _e(t) {
|
|
783
|
+
let n = e.createContext(null);
|
|
784
|
+
return {
|
|
785
|
+
useStore(t) {
|
|
786
|
+
let r = e.useContext(n);
|
|
787
|
+
if (r === null) throw Error("StoreProvider never found.");
|
|
788
|
+
let i = e.useRef(!0), [a, o] = e.useState(r.getValues(t)), s = [r, ...t];
|
|
789
|
+
return e.useLayoutEffect(() => (i.current ? i.current = !1 : o(r.getValues(t)), r.on(t, (e) => o(e))), s), [a, e.useCallback((e) => r.setValues(t, e), s)];
|
|
790
|
+
},
|
|
791
|
+
useStoreSetter(t) {
|
|
792
|
+
let r = e.useContext(n);
|
|
793
|
+
if (r === null) throw Error("StoreProvider never found.");
|
|
794
|
+
return e.useCallback((e) => r.setValues(t, e), [r, ...t]);
|
|
795
|
+
},
|
|
796
|
+
watchStore(t, r, i) {
|
|
797
|
+
let a = e.useContext(n);
|
|
798
|
+
if (a === null) throw Error("StoreProvider never found.");
|
|
799
|
+
let o = [a, ...t];
|
|
800
|
+
i !== void 0 && (o = o.concat(i)), e.useLayoutEffect(() => a.on(t, r), o);
|
|
801
|
+
},
|
|
802
|
+
useStoreAction(r) {
|
|
803
|
+
let i = e.useContext(n);
|
|
804
|
+
if (i === null) throw Error("StoreProvider never found.");
|
|
805
|
+
return e.useCallback((...e) => {
|
|
806
|
+
let [n, ...a] = t[r];
|
|
807
|
+
return n(() => i.getValues(a), (e) => i.setValues(a, e), ...e);
|
|
808
|
+
}, []);
|
|
809
|
+
},
|
|
810
|
+
StoreProvider: class extends e.Component {
|
|
811
|
+
constructor(e) {
|
|
812
|
+
super(e), this.store = new $(e.initialValue, (...e) => {
|
|
813
|
+
this.props.onValuesChange && this.props.onValuesChange(...e);
|
|
814
|
+
});
|
|
815
|
+
}
|
|
816
|
+
shouldComponentUpdate(e) {
|
|
817
|
+
return e.children !== this.props.children;
|
|
818
|
+
}
|
|
819
|
+
render() {
|
|
820
|
+
return e.createElement(n.Provider, { value: this.store }, this.props.children);
|
|
821
|
+
}
|
|
822
|
+
}
|
|
823
|
+
};
|
|
824
|
+
}
|
|
825
|
+
//#endregion
|
|
826
|
+
export { h as FiveCanvas, ne as INJECTION_PROPNAME, $ as Store, me as createFiveFeature, f as createFiveProvider, _e as createStore, g as unsafe__useFiveInstance, T as useFiveAction, A as useFiveCameraDirection, O as useFiveCameraRaycaster, C as useFiveCurrentObserver, S as useFiveCurrentState, w as useFiveEventCallback, N as useFiveFloor, te as useFiveHelper, j as useFiveModelIntersectRaycaster, ee as useFiveModelReadyState, E as useFiveProject2d, v as useFiveScene, _ as useFiveSceneEffect, x as useFiveState, y as useFiveWork, pe as withFive };
|