@realsee/five-webgpu 1.0.0-alpha.1
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 +9 -0
- package/AI_CONTEXT.md +9 -0
- package/README.md +80 -0
- package/TERMS.txt +54 -0
- package/ai_guides/README.md +118 -0
- package/ai_guides/ai-doc-guidelines.md +102 -0
- package/ai_guides/api.md +274 -0
- package/ai_guides/features/3dtile.md +172 -0
- package/ai_guides/features/camera-animation.md +205 -0
- package/ai_guides/features/clipper.md +135 -0
- package/ai_guides/features/coordinate-system.md +128 -0
- package/ai_guides/features/event.md +154 -0
- package/ai_guides/features/five.md +184 -0
- package/ai_guides/features/gesture.md +181 -0
- package/ai_guides/features/get-screen-pixels.md +182 -0
- package/ai_guides/features/image-options.md +164 -0
- package/ai_guides/features/load-external-model.md +350 -0
- package/ai_guides/features/load-progress.md +140 -0
- package/ai_guides/features/material.md +153 -0
- package/ai_guides/features/mode.md +269 -0
- package/ai_guides/features/model.md +186 -0
- package/ai_guides/features/move-pano-effect.md +145 -0
- package/ai_guides/features/multi-work.md +146 -0
- package/ai_guides/features/pano-filter.md +144 -0
- package/ai_guides/features/pano-tile.md +132 -0
- package/ai_guides/features/pano-uv.md +131 -0
- package/ai_guides/features/parameter.md +153 -0
- package/ai_guides/features/raycast.md +175 -0
- package/ai_guides/features/request-proxy.md +112 -0
- package/ai_guides/features/screen-project.md +165 -0
- package/ai_guides/features/state.md +101 -0
- package/ai_guides/features/ultra-hdr.md +204 -0
- package/ai_guides/features/view-layer.md +187 -0
- package/ai_guides/features/work.md +303 -0
- package/ai_guides/glossary.md +93 -0
- package/ai_guides/intro.md +23 -0
- package/ai_guides/quick-start.md +69 -0
- package/ai_guides/release_notes/6.6.md +86 -0
- package/ai_guides/release_notes/6.7.md +401 -0
- package/ai_guides/release_notes/6.8.md +208 -0
- package/ai_guides/support.md +23 -0
- package/ai_guides/template.md +70 -0
- package/docs/.nojekyll +1 -0
- package/docs/00_FOR_AI_AGENTS.md +12 -0
- package/docs/README.md +12 -0
- package/docs/assets/hierarchy.js +1 -0
- package/docs/assets/highlight.css +134 -0
- package/docs/assets/icons.js +18 -0
- package/docs/assets/icons.svg +1 -0
- package/docs/assets/main.js +60 -0
- package/docs/assets/navigation.js +1 -0
- package/docs/assets/search.js +1 -0
- package/docs/assets/style.css +1633 -0
- package/docs/classes/index.AdaptiveLuminancePass.html +23 -0
- package/docs/classes/index.AnimationFrameLoop.html +18 -0
- package/docs/classes/index.BoundingMesh.html +4 -0
- package/docs/classes/index.Camera.html +42 -0
- package/docs/classes/index.EffectComposer.html +25 -0
- package/docs/classes/index.EyeDomeLightingPass.html +20 -0
- package/docs/classes/index.Fetcher.html +5 -0
- package/docs/classes/index.Five.html +311 -0
- package/docs/classes/index.FivePass.html +17 -0
- package/docs/classes/index.FiveRenderer.html +8 -0
- package/docs/classes/index.FlowingFireworks3DPass.html +22 -0
- package/docs/classes/index.FlowingLight2DPass.html +21 -0
- package/docs/classes/index.FlowingLight3DPass.html +23 -0
- package/docs/classes/index.FullScreenQuad.html +7 -0
- package/docs/classes/index.GaussianBlurPass.html +19 -0
- package/docs/classes/index.Histogram.html +19 -0
- package/docs/classes/index.InternalWebGPURenderer.html +4 -0
- package/docs/classes/index.Model.html +93 -0
- package/docs/classes/index.ModelScene.html +40 -0
- package/docs/classes/index.Motion.html +17 -0
- package/docs/classes/index.NetworkSubscribe.html +41 -0
- package/docs/classes/index.PBMGaussianSplattingNodeMaterial.html +37 -0
- package/docs/classes/index.PBMGaussianSplattingObject.html +32 -0
- package/docs/classes/index.PBMGaussianSplattingRenderMesh.html +19 -0
- package/docs/classes/index.PBMGroup.html +5 -0
- package/docs/classes/index.PBMMesh.html +2 -0
- package/docs/classes/index.PBMMeshBasicMaterial.html +70 -0
- package/docs/classes/index.PBMMeshBasicNodeMaterial.html +74 -0
- package/docs/classes/index.PBMMeshPanoOnlyMaterial.html +70 -0
- package/docs/classes/index.PBMMeshPanoOnlyNodeMaterial.html +74 -0
- package/docs/classes/index.PBMMeshPhongMaterial.html +69 -0
- package/docs/classes/index.PBMMeshPhongNodeMaterial.html +73 -0
- package/docs/classes/index.PBMMeshPhysicalMaterial.html +69 -0
- package/docs/classes/index.PBMMeshPhysicalNodeMaterial.html +73 -0
- package/docs/classes/index.PBMPanoFilter.html +61 -0
- package/docs/classes/index.PBMPointCloud.html +50 -0
- package/docs/classes/index.PBMSkinnedMesh.html +8 -0
- package/docs/classes/index.PBMUpdateable.html +41 -0
- package/docs/classes/index.PanoCircleMesh.html +30 -0
- package/docs/classes/index.PanoCircleMeshCustom.html +30 -0
- package/docs/classes/index.PanoCircleMeshSolid.html +30 -0
- package/docs/classes/index.Parameter.html +114 -0
- package/docs/classes/index.Scene.html +18 -0
- package/docs/classes/index.Subscribe.html +43 -0
- package/docs/classes/index.TextureLoader.html +4 -0
- package/docs/classes/index.Tile.html +34 -0
- package/docs/classes/index.Tile3D.html +98 -0
- package/docs/classes/index.TileCache.html +8 -0
- package/docs/classes/index.TileNode.html +14 -0
- package/docs/classes/index.TileRequestScheduler.html +4 -0
- package/docs/classes/index.Tileset.html +38 -0
- package/docs/classes/index.Trajectory.html +8 -0
- package/docs/classes/index.TrajectoryNode.html +8 -0
- package/docs/classes/index.Work.html +52 -0
- package/docs/classes/index.WorkResolvedObserver.html +68 -0
- package/docs/documents/README.html +134 -0
- package/docs/documents/ai-doc-guidelines.html +117 -0
- package/docs/documents/api.html +337 -0
- package/docs/documents/features_3dtile.html +216 -0
- package/docs/documents/features_camera-animation.html +157 -0
- package/docs/documents/features_clipper.html +80 -0
- package/docs/documents/features_coordinate-system.html +127 -0
- package/docs/documents/features_event.html +104 -0
- package/docs/documents/features_five.html +147 -0
- package/docs/documents/features_gesture.html +121 -0
- package/docs/documents/features_get-screen-pixels.html +88 -0
- package/docs/documents/features_image-options.html +108 -0
- package/docs/documents/features_load-external-model.html +600 -0
- package/docs/documents/features_load-progress.html +110 -0
- package/docs/documents/features_material.html +341 -0
- package/docs/documents/features_mode.html +114 -0
- package/docs/documents/features_model.html +141 -0
- package/docs/documents/features_move-pano-effect.html +110 -0
- package/docs/documents/features_multi-work.html +97 -0
- package/docs/documents/features_pano-filter.html +119 -0
- package/docs/documents/features_pano-tile.html +100 -0
- package/docs/documents/features_pano-uv.html +82 -0
- package/docs/documents/features_parameter.html +101 -0
- package/docs/documents/features_raycast.html +98 -0
- package/docs/documents/features_request-proxy.html +78 -0
- package/docs/documents/features_screen-project.html +112 -0
- package/docs/documents/features_state.html +71 -0
- package/docs/documents/features_ultra-hdr.html +188 -0
- package/docs/documents/features_view-layer.html +158 -0
- package/docs/documents/features_work.html +129 -0
- package/docs/documents/glossary.html +94 -0
- package/docs/documents/intro.html +24 -0
- package/docs/documents/quick-start.html +32 -0
- package/docs/documents/release_notes_6.6.html +79 -0
- package/docs/documents/release_notes_6.7.html +209 -0
- package/docs/documents/release_notes_6.8.html +189 -0
- package/docs/documents/support.html +49 -0
- package/docs/documents/template.html +80 -0
- package/docs/enums/index.VolumePlaneIntersect.html +4 -0
- package/docs/functions/index.coordinatesToVector.html +2 -0
- package/docs/functions/index.createDebugBoundingMesh.html +1 -0
- package/docs/functions/index.createWorks.html +1 -0
- package/docs/functions/index.defaultImageURLTransform.html +5 -0
- package/docs/functions/index.getViewportScale.html +1 -0
- package/docs/functions/index.headingToLongitude.html +4 -0
- package/docs/functions/index.imageSupport.html +1 -0
- package/docs/functions/index.isBoundingVolume.html +1 -0
- package/docs/functions/index.isPanoId.html +1 -0
- package/docs/functions/index.loadAt3d.html +1 -0
- package/docs/functions/index.loadDome.html +1 -0
- package/docs/functions/index.loadDomez.html +1 -0
- package/docs/functions/index.loadGltf.html +1 -0
- package/docs/functions/index.loadPbm.html +1 -0
- package/docs/functions/index.loadPly.html +1 -0
- package/docs/functions/index.longitudeToHeading.html +4 -0
- package/docs/functions/index.makeBoundingVolume.html +1 -0
- package/docs/functions/index.panoEqual.html +1 -0
- package/docs/functions/index.panoParse.html +1 -0
- package/docs/functions/index.panoStringify.html +1 -0
- package/docs/functions/index.parseWork.html +7 -0
- package/docs/functions/index.registerPBMMaterials.html +3 -0
- package/docs/functions/index.vectorToCoordinates.html +2 -0
- package/docs/functions/index.workToJson.html +1 -0
- package/docs/hierarchy.html +1 -0
- package/docs/index.html +134 -0
- package/docs/interfaces/index.AddableObject.html +9 -0
- package/docs/interfaces/index.AjaxOptions.html +9 -0
- package/docs/interfaces/index.AnimationFrame.html +6 -0
- package/docs/interfaces/index.AnimationFrameContext.html +3 -0
- package/docs/interfaces/index.BaseEvent.html +5 -0
- package/docs/interfaces/index.BoundingVolume.html +15 -0
- package/docs/interfaces/index.BoxBoundingVolume.html +18 -0
- package/docs/interfaces/index.CameraPose.html +6 -0
- package/docs/interfaces/index.CullingVolume.html +9 -0
- package/docs/interfaces/index.Draco.html +12 -0
- package/docs/interfaces/index.EventCallback.html +394 -0
- package/docs/interfaces/index.FiveInitArgs.html +104 -0
- package/docs/interfaces/index.FiveLoadOptions.html +12 -0
- package/docs/interfaces/index.FloorplanControllerCustomInitArgs.html +17 -0
- package/docs/interfaces/index.GestureEvent.html +19 -0
- package/docs/interfaces/index.IPBMMaterial.html +64 -0
- package/docs/interfaces/index.ImageOptions.html +21 -0
- package/docs/interfaces/index.ImageURLMappings.html +1 -0
- package/docs/interfaces/index.ImageURLOptions.html +17 -0
- package/docs/interfaces/index.IntersectEvent.html +8 -0
- package/docs/interfaces/index.IntersectMesh.html +2 -0
- package/docs/interfaces/index.IntersectMeshInterface.html +3 -0
- package/docs/interfaces/index.Intersection.html +9 -0
- package/docs/interfaces/index.LoosePanoWork.html +10 -0
- package/docs/interfaces/index.LooseWork.html +15 -0
- package/docs/interfaces/index.LooseWorkInitial.html +11 -0
- package/docs/interfaces/index.LooseWorkModel.html +8 -0
- package/docs/interfaces/index.LooseWorkObserver.html +17 -0
- package/docs/interfaces/index.LooseWorkPanorama.html +22 -0
- package/docs/interfaces/index.LooseWorkVideo.html +4 -0
- package/docs/interfaces/index.LooseWorkWithExtrinsics.html +15 -0
- package/docs/interfaces/index.MapviewControllerCustomInitArgs.html +20 -0
- package/docs/interfaces/index.ModeChangeEvent.html +9 -0
- package/docs/interfaces/index.ModelControllerCustomInitArgs.html +20 -0
- package/docs/interfaces/index.ModelEvent.html +8 -0
- package/docs/interfaces/index.ModelOptions.html +11 -0
- package/docs/interfaces/index.ModelSceneEvent.html +6 -0
- package/docs/interfaces/index.ModelTileEvent.html +8 -0
- package/docs/interfaces/index.MotionKeyframe.html +4 -0
- package/docs/interfaces/index.MovePanoOptions.html +35 -0
- package/docs/interfaces/index.NetworkAbortError.html +1 -0
- package/docs/interfaces/index.NetworkFirbiddenError.html +1 -0
- package/docs/interfaces/index.NetworkOptions.html +7 -0
- package/docs/interfaces/index.NetworkProxyError.html +1 -0
- package/docs/interfaces/index.NetworkResourceEvent.html +9 -0
- package/docs/interfaces/index.NetworkResponseError.html +2 -0
- package/docs/interfaces/index.NetworkTimeoutError.html +1 -0
- package/docs/interfaces/index.ObjectEvent.html +6 -0
- package/docs/interfaces/index.PBMClipperParameter.html +3 -0
- package/docs/interfaces/index.PBMHDRConfig.html +12 -0
- package/docs/interfaces/index.PBMPanoDepth.html +9 -0
- package/docs/interfaces/index.PBMPanoFilterValue.html +6 -0
- package/docs/interfaces/index.PBMPanoPicture.html +14 -0
- package/docs/interfaces/index.PBMRefinedScreen.html +6 -0
- package/docs/interfaces/index.PanoCircleMeshCustomOptions.html +9 -0
- package/docs/interfaces/index.PanoCircleMeshInterface.html +30 -0
- package/docs/interfaces/index.PanoCircleMeshOptions.html +3 -0
- package/docs/interfaces/index.PanoCircleMeshSolidOptions.html +3 -0
- package/docs/interfaces/index.PanoEvent.html +11 -0
- package/docs/interfaces/index.PanoTextureEvent.html +9 -0
- package/docs/interfaces/index.PanoramaControllerCustomInitArgs.html +41 -0
- package/docs/interfaces/index.PanoramaLikeControllerCustomInitArgs.html +20 -0
- package/docs/interfaces/index.ParameterMaterialValue.html +74 -0
- package/docs/interfaces/index.ParameterTilesetValue.html +30 -0
- package/docs/interfaces/index.ParameterValue.html +103 -0
- package/docs/interfaces/index.Pass.html +9 -0
- package/docs/interfaces/index.PointCloudData.html +6 -0
- package/docs/interfaces/index.Pose.html +12 -0
- package/docs/interfaces/index.RegionBoundingVolume.html +21 -0
- package/docs/interfaces/index.RenderEvent.html +6 -0
- package/docs/interfaces/index.ResolvedParameterValue.html +104 -0
- package/docs/interfaces/index.RgbaData.html +7 -0
- package/docs/interfaces/index.SphereBoundingVolume.html +17 -0
- package/docs/interfaces/index.SplatData.html +10 -0
- package/docs/interfaces/index.State.html +23 -0
- package/docs/interfaces/index.StateEvent.html +7 -0
- package/docs/interfaces/index.TextureOptions.html +23 -0
- package/docs/interfaces/index.Tile3DOptions.html +11 -0
- package/docs/interfaces/index.TileCoordinateSystem.html +3 -0
- package/docs/interfaces/index.TileHeader.html +9 -0
- package/docs/interfaces/index.TilesetHeader.html +20 -0
- package/docs/interfaces/index.TilesetOptions.html +7 -0
- package/docs/interfaces/index.TopviewControllerCustomInitArgs.html +13 -0
- package/docs/interfaces/index.TrajectoryHeader.html +5 -0
- package/docs/interfaces/index.ViewLayer.html +97 -0
- package/docs/interfaces/index.Viewport.html +13 -0
- package/docs/interfaces/index.WebXRAxesParams.html +4 -0
- package/docs/interfaces/index.WebXRControllerParams.html +2 -0
- package/docs/interfaces/index.WorkCubeImage.html +15 -0
- package/docs/interfaces/index.WorkImage.html +22 -0
- package/docs/interfaces/index.WorkInitial.html +17 -0
- package/docs/interfaces/index.WorkInitialJson.html +8 -0
- package/docs/interfaces/index.WorkJson.html +11 -0
- package/docs/interfaces/index.WorkModel.html +16 -0
- package/docs/interfaces/index.WorkModelJson.html +6 -0
- package/docs/interfaces/index.WorkModelLayer.html +11 -0
- package/docs/interfaces/index.WorkModelLayerJson.html +5 -0
- package/docs/interfaces/index.WorkObserver.html +63 -0
- package/docs/interfaces/index.WorkObserverJson.html +10 -0
- package/docs/interfaces/index.WorkPanoramaJson.html +14 -0
- package/docs/interfaces/index.WorkPanoramasJson.html +3 -0
- package/docs/interfaces/index.WorkTile.html +21 -0
- package/docs/interfaces/index.WorkVideo.html +9 -0
- package/docs/interfaces/index.WorksEvent.html +8 -0
- package/docs/interfaces/index.XRControllerEvent.html +8 -0
- package/docs/interfaces/index.XRGestureEvent.html +11 -0
- package/docs/interfaces/index.XRSessionEvent.html +7 -0
- package/docs/modules/index.html +1 -0
- package/docs/modules.html +1 -0
- package/docs/types/index.AjaxResponseType.html +1 -0
- package/docs/types/index.AjaxResponseTypeMapping.html +1 -0
- package/docs/types/index.AnimationFrameLoopType.html +1 -0
- package/docs/types/index.BoundingVolumeJson.html +1 -0
- package/docs/types/index.BoxBoundingVolumeJson.html +2 -0
- package/docs/types/index.ControllerCustomInitTypes.html +6 -0
- package/docs/types/index.ControllerEventTypes.html +68 -0
- package/docs/types/index.CubeFace.html +1 -0
- package/docs/types/index.EasingFunction.html +1 -0
- package/docs/types/index.EventTypes.html +28 -0
- package/docs/types/index.FivePlugin.html +4 -0
- package/docs/types/index.FivePluginInit.html +3 -0
- package/docs/types/index.FivePluginInstance.html +3 -0
- package/docs/types/index.FlowingFireworks3DPassLine.html +16 -0
- package/docs/types/index.FlowingLight2DPassLine.html +10 -0
- package/docs/types/index.FlowingLight3DPassLine.html +10 -0
- package/docs/types/index.GestureTypes.html +1 -0
- package/docs/types/index.LegacyEventType.html +282 -0
- package/docs/types/index.LoadResultType.html +12 -0
- package/docs/types/index.Mode.html +15 -0
- package/docs/types/index.Models.html +11 -0
- package/docs/types/index.MotionCircle.html +2 -0
- package/docs/types/index.MotionConfig.html +1 -0
- package/docs/types/index.MotionInitalValue.html +1 -0
- package/docs/types/index.MotionValue.html +1 -0
- package/docs/types/index.MovePanoEffect.html +12 -0
- package/docs/types/index.NetWorkMeta.html +8 -0
- package/docs/types/index.NetworkError.html +1 -0
- package/docs/types/index.NetworkErrorCallback.html +1 -0
- package/docs/types/index.NetworkProgressCallback.html +1 -0
- package/docs/types/index.NetworkResponse.html +3 -0
- package/docs/types/index.NetworkState.html +1 -0
- package/docs/types/index.NetworkSuccessCallback.html +1 -0
- package/docs/types/index.NetworkType.html +1 -0
- package/docs/types/index.OutputTextureDataType.html +1 -0
- package/docs/types/index.PBMAlphaMode.html +1 -0
- package/docs/types/index.PBMColorStyle.html +1 -0
- package/docs/types/index.PBMFloorStyle.html +1 -0
- package/docs/types/index.PBMMeshMaterial.html +1 -0
- package/docs/types/index.PBMPointBack.html +1 -0
- package/docs/types/index.PBMPointCloudShaderType.html +1 -0
- package/docs/types/index.PBMPointShape.html +1 -0
- package/docs/types/index.PBMPointSize.html +1 -0
- package/docs/types/index.PBMTransition.html +1 -0
- package/docs/types/index.Pano.html +3 -0
- package/docs/types/index.PanoId.html +1 -0
- package/docs/types/index.ParseOptions.html +13 -0
- package/docs/types/index.PostProcessingType.html +1 -0
- package/docs/types/index.RegionBoundingVolumeJson.html +2 -0
- package/docs/types/index.RequestAnimationFrameArgs.html +1 -0
- package/docs/types/index.Scissor.html +2 -0
- package/docs/types/index.SphereBoundingVolumeJson.html +2 -0
- package/docs/types/index.SubscribeEventMap.html +1 -0
- package/docs/types/index.TileCacheOptions.html +3 -0
- package/docs/types/index.TileContentData.html +6 -0
- package/docs/types/index.TileRequestOrder.html +1 -0
- package/docs/types/index.TileRequestSchedulerOptions.html +4 -0
- package/docs/types/index.TilesetFrameState.html +21 -0
- package/docs/types/index.TrajectoryContentData.html +7 -0
- package/docs/types/index.WebXRControllerKey.html +1 -0
- package/docs/types/index.WebXRControllerType.html +1 -0
- package/docs/types/index.Works.html +1 -0
- package/docs/variables/index.PROXY_CONTROLLER_EVENT_NAMES.html +1 -0
- package/docs/variables/index.controllersDefaultInitArgs.html +1 -0
- package/docs/variables/index.draco.html +1 -0
- package/five/application/analysis.d.ts +40 -0
- package/five/application/controllers.d.ts +33 -0
- package/five/application/events-legacy.d.ts +454 -0
- package/five/application/events.d.ts +69 -0
- package/five/application/five.d.ts +498 -0
- package/five/application/fiveInitArgs.d.ts +173 -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 +24 -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-pmg-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 +19 -0
- package/five/bvh/bvhPoints.d.ts +6 -0
- package/five/bvh/index.d.ts +14 -0
- package/five/bvh/type.d.ts +1 -0
- package/five/bvh/worker.d.ts +36 -0
- package/five/certificates/hardware.d.ts +1 -0
- package/five/controllers/base.d.ts +166 -0
- package/five/controllers/events.d.ts +71 -0
- package/five/controllers/floorplan.d.ts +119 -0
- package/five/controllers/mapview.d.ts +138 -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/core/camera.d.ts +65 -0
- package/five/core/internalWebGPURenderer.d.ts +13 -0
- package/five/core/panoVideo.d.ts +18 -0
- package/five/core/scene.d.ts +10 -0
- package/five/core/tiling.d.ts +56 -0
- package/five/declare.d.ts +35 -0
- package/five/gaussian-splatting/util/renderData.d.ts +66 -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 +58 -0
- package/five/index.js +1179 -0
- package/five/index.mjs +25111 -0
- package/five/meshes/boundingMesh.d.ts +12 -0
- package/five/meshes/intersectMesh.d.ts +8 -0
- package/five/meshes/panoCircleMesh.d.ts +36 -0
- package/five/meshes/panoCircleMeshCustom.d.ts +40 -0
- package/five/meshes/panoCircleMeshSolid.d.ts +35 -0
- package/five/meshes/panoSphereMesh.d.ts +29 -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 +55 -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 +10 -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.d.ts +26 -0
- package/five/model/loaders/glTF-helpers/extensions/KHR_gaussian_splatting_compression_spz.d.ts +11 -0
- package/five/model/loaders/glTF-helpers/extensions/KHR_gaussian_splatting_compression_spz_2.d.ts +13 -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 +12 -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 +25 -0
- package/five/model/loaders/glTF-helpers/glTF.d.ts +713 -0
- package/five/model/loaders/glTF-helpers/index.d.ts +51 -0
- package/five/model/loaders/glTF-helpers/parser.d.ts +115 -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 +36 -0
- package/five/model/loaders/x3p.d.ts +22 -0
- package/five/model/materials/nodes/pbmMeshBasicNodeMaterial.d.ts +14 -0
- package/five/model/materials/nodes/pbmMeshPanoOnlyNodeMaterial.d.ts +14 -0
- package/five/model/materials/nodes/pbmMeshPhongNodeMaterial.d.ts +14 -0
- package/five/model/materials/nodes/pbmMeshPhysicalNodeMaterial.d.ts +14 -0
- package/five/model/materials/nodes/pbmPointCloudNodeMaterial.d.ts +22 -0
- package/five/model/materials/pbmGaussianSplattingNodeMaterial.d.ts +78 -0
- package/five/model/materials/pbmMaterial.d.ts +171 -0
- package/five/model/materials/pbmMaterialRegister.d.ts +6 -0
- package/five/model/materials/pbmMeshMaterial.d.ts +57 -0
- package/five/model/materials/pbmPointCloudMaterial.d.ts +20 -0
- package/five/model/materials/pbmPointCloudNodeMaterial.d.ts +46 -0
- package/five/model/materials/tsl/colorFilter.d.ts +9 -0
- package/five/model/materials/tsl/defines.d.ts +68 -0
- package/five/model/materials/tsl/nodeTypes.d.ts +12 -0
- package/five/model/materials/tsl/outputBuilder.d.ts +26 -0
- package/five/model/materials/tsl/panoColor.d.ts +17 -0
- package/five/model/materials/tsl/panoTransition.d.ts +8 -0
- package/five/model/materials/tsl/utils.d.ts +11 -0
- package/five/model/model-scene.d.ts +172 -0
- package/five/model/model.d.ts +203 -0
- package/five/model/objects/pbmGaussianSplattingObject.d.ts +47 -0
- package/five/model/objects/pbmGaussianSplattingRenderMesh.d.ts +73 -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 +89 -0
- package/five/model/objects/pbmPointCloudObject.d.ts +81 -0
- package/five/model/parameter.d.ts +138 -0
- package/five/model/tile3d/header.d.ts +88 -0
- package/five/model/tile3d/index.d.ts +213 -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 +26 -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 +65 -0
- package/five/model/tile3d/trajectory-content.d.ts +0 -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/compute-renderers/pointcloud-compute-renderer.d.ts +154 -0
- package/five/renderer/compute-renderers/rgb565.d.ts +45 -0
- package/five/renderer/compute-renderers/shaders/clear.d.ts +2 -0
- package/five/renderer/compute-renderers/shaders/fullscreenQuad.d.ts +2 -0
- package/five/renderer/compute-renderers/shaders/rasterize.d.ts +2 -0
- package/five/renderer/five-renderer.d.ts +33 -0
- package/five/renderer/index.d.ts +3 -0
- package/five/renderer/postprocessing/composer.d.ts +45 -0
- package/five/renderer/postprocessing/index.d.ts +8 -0
- package/five/renderer/postprocessing/passes/adaptive-luminance-pass.d.ts +27 -0
- package/five/renderer/postprocessing/passes/eye-dome-lighting-pass.d.ts +31 -0
- package/five/renderer/postprocessing/passes/flowing-fireworks-3d-pass.d.ts +71 -0
- package/five/renderer/postprocessing/passes/flowing-light-2d-pass.d.ts +26 -0
- package/five/renderer/postprocessing/passes/flowing-light-3d-pass.d.ts +75 -0
- package/five/renderer/postprocessing/passes/gaussian-blur-pass.d.ts +22 -0
- package/five/renderer/postprocessing/passes/pass.d.ts +38 -0
- package/five/renderer/scene-renderers/scene-renderer.d.ts +9 -0
- package/five/renderer/tools/full-screen-quad.d.ts +17 -0
- package/five/renderer/tools/postprocess-uv.d.ts +11 -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 +2 -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 +30 -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/face3.d.ts +12 -0
- package/five/utils/formatRad.d.ts +7 -0
- package/five/utils/hdr-data.d.ts +13 -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 +37 -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/worker.d.ts +26 -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 +128 -0
- package/five/work/verify.d.ts +7 -0
- package/five/work/work.d.ts +246 -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/llms.txt +66 -0
- package/package.json +56 -0
- package/plugins/BasePlugin/index.d.ts +96 -0
- package/plugins/GaussianSplattingEntranceAnimationPlugin/Controller.d.ts +66 -0
- package/plugins/GaussianSplattingEntranceAnimationPlugin/index.d.ts +5 -0
- package/plugins/GaussianSplattingEntranceAnimationPlugin/typing.d.ts +32 -0
- package/plugins/index.d.ts +2 -0
- package/plugins/index.js +255 -0
- package/plugins/index.mjs +539 -0
- package/plugins/utils/absoluteUrl.d.ts +5 -0
- package/react/autoCanvas.d.ts +9 -0
- package/react/canvas.d.ts +19 -0
- package/react/context.d.ts +12 -0
- package/react/createProvider.d.ts +98 -0
- package/react/createStore.d.ts +144 -0
- package/react/fiveApp.d.ts +22 -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/useFivePlugin.d.ts +22 -0
- package/react/hooks/useFiveProject2d.d.ts +21 -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 +28 -0
- package/react/index.js +255 -0
- package/react/index.mjs +896 -0
- package/react/withFive.d.ts +213 -0
- package/resource/basis/1.16/basis_transcoder.js +22 -0
- package/resource/basis/1.16/basis_transcoder.wasm +0 -0
- package/resource/basis/README.md +5 -0
- package/resource/draco/1.5.6/draco_decoder.js +34 -0
- package/resource/draco/1.5.6/draco_decoder.wasm +0 -0
- package/resource/draco/1.5.6/draco_decoder_gltf.js +33 -0
- package/resource/draco/1.5.6/draco_decoder_gltf.wasm +0 -0
- package/resource/draco/1.5.6/draco_encoder.js +35 -0
- package/resource/draco/1.5.6/draco_encoder.wasm +0 -0
- package/resource/draco/1.5.6/draco_encoder_wrapper.js +97 -0
- package/resource/draco/1.5.6/draco_wasm_wrapper.js +117 -0
- package/resource/draco/1.5.6/draco_wasm_wrapper_gltf.js +116 -0
- package/resource/draco/README.md +5 -0
- package/umd/five-plugins.js +255 -0
- package/umd/five-react.js +255 -0
- package/umd/five.js +1579 -0
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
# 多 Work (沙盘) 场景 (Multi-Work / Sandbox)
|
|
2
|
+
|
|
3
|
+
- **Summary**: 在同一个 Five 实例中加载和管理多个 Work 数据(如沙盘场景),实现多楼盘/多户型的同屏展示与切换。
|
|
4
|
+
- **Schema**: `Work[]`, `LooseWorkWithExtrinsics`, `FiveLoadOptions`.
|
|
5
|
+
- **Concepts**: WorkCode, Works Collection, Coordinate Transform.
|
|
6
|
+
- **Configuration**: `five.load()` 参数配置。
|
|
7
|
+
- **Examples**: 加载多个 Work、动态添加 Work、Work 间切换。
|
|
8
|
+
|
|
9
|
+
## Schema
|
|
10
|
+
|
|
11
|
+
> **Definition**: [FiveLoadOptions](../../five/application/fiveLoadOptions.d.ts), [LooseWorkWithExtrinsics](../../five/work/looseWorkType.d.ts)
|
|
12
|
+
|
|
13
|
+
### 核心类型定义
|
|
14
|
+
|
|
15
|
+
```typescript
|
|
16
|
+
// 输入数据类型
|
|
17
|
+
type FiveLoadInput =
|
|
18
|
+
| Work[]
|
|
19
|
+
| LooseWorkWithExtrinsics[]
|
|
20
|
+
| string[]; // JSON Strings
|
|
21
|
+
|
|
22
|
+
// 带位姿信息的 LooseWork (用于调整模型在场景中的位置)
|
|
23
|
+
interface LooseWorkWithExtrinsics {
|
|
24
|
+
work: LooseWork; // Work 数据内容
|
|
25
|
+
transform?: number[]; // 4x4 变换矩阵 (数组格式), 用于整体偏移/旋转该 Work
|
|
26
|
+
workCode?: string; // 强制指定 WorkCode (覆盖数据中的默认值)
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
// 加载选项
|
|
30
|
+
interface FiveLoadOptions {
|
|
31
|
+
mode?: "replace" | "add"; // 替换当前场景 vs 追加到当前场景
|
|
32
|
+
// ... 其他常规选项
|
|
33
|
+
}
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
## Concepts
|
|
37
|
+
|
|
38
|
+
### 1. Works Collection (数据集)
|
|
39
|
+
当 Five 加载多个 Work 时,它们被存储在 `five.works` 集合中。
|
|
40
|
+
- `five.works` 是一个增强的只读数组 (`ReadonlyArray<Work>`)。
|
|
41
|
+
- 提供了 `getWork(workCode)` 和 `getObserver(panoId)` 等辅助方法。
|
|
42
|
+
|
|
43
|
+
### 2. WorkCode (唯一标识)
|
|
44
|
+
在多 Work 场景中,`workCode` 是区分不同 Work 的关键。
|
|
45
|
+
- **必须唯一**: 加载的每个 Work 必须有唯一的 `workCode`。如果数据中重复,建议在加载时通过 `ParseOptions` 重写。
|
|
46
|
+
- **状态索引**: `five.state` 和 `five.setState` 中需要通过 `workCode` 来指定目标 Work。
|
|
47
|
+
|
|
48
|
+
### 3. Coordinate Alignment (坐标对齐)
|
|
49
|
+
不同 Work 的原始模型可能位于其各自的坐标系原点。为了在沙盘中正确排列它们(避免重叠),需要使用 `transform` 矩阵对每个 Work 进行空间变换(平移、旋转)。
|
|
50
|
+
|
|
51
|
+
## Configuration
|
|
52
|
+
|
|
53
|
+
`five.load(input, state, options)` 是入口方法。
|
|
54
|
+
|
|
55
|
+
| 参数 | 类型 | 说明 |
|
|
56
|
+
| :--- | :--- | :--- |
|
|
57
|
+
| `input` | `FiveLoadInput` | Work 数据数组。 |
|
|
58
|
+
| `options.mode` | `"replace" \| "add"` | 默认为 `"replace"` (清空当前场景)。设为 `"add"` 可保留现有场景并追加新 Work。 |
|
|
59
|
+
|
|
60
|
+
## Examples
|
|
61
|
+
|
|
62
|
+
### 1. 基础加载 (Basic Loading)
|
|
63
|
+
一次性加载两个 Work。
|
|
64
|
+
|
|
65
|
+
```typescript
|
|
66
|
+
const works = [workDataA, workDataB];
|
|
67
|
+
|
|
68
|
+
five.load(works).then(() => {
|
|
69
|
+
console.log("所有 Work 加载完成");
|
|
70
|
+
console.log("当前 Works:", five.works);
|
|
71
|
+
});
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
### 2. 沙盘排布 (Sandbox Layout)
|
|
75
|
+
使用 `transform` 将两个户型并排摆放。
|
|
76
|
+
|
|
77
|
+
```typescript
|
|
78
|
+
import * as THREE from "three/webgpu";
|
|
79
|
+
|
|
80
|
+
// 创建变换矩阵:向 X 轴正方向平移 20 米
|
|
81
|
+
const matrixB = new THREE.Matrix4().makeTranslation(20, 0, 0);
|
|
82
|
+
|
|
83
|
+
const input = [
|
|
84
|
+
// Work A: 保持在原点
|
|
85
|
+
{ work: workDataA },
|
|
86
|
+
// Work B: 偏移位置
|
|
87
|
+
{
|
|
88
|
+
work: workDataB,
|
|
89
|
+
transform: matrixB.toArray()
|
|
90
|
+
}
|
|
91
|
+
];
|
|
92
|
+
|
|
93
|
+
five.load(input);
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
### 3. 动态添加 (Dynamic Add)
|
|
97
|
+
在不销毁当前场景的情况下,追加一个新的 Work。
|
|
98
|
+
|
|
99
|
+
```typescript
|
|
100
|
+
// 假设当前已经加载了 Work A
|
|
101
|
+
// 追加 Work C
|
|
102
|
+
five.load(workDataC, undefined, {
|
|
103
|
+
mode: "add" // 关键参数
|
|
104
|
+
}).then(() => {
|
|
105
|
+
console.log("Work C 已加入场景");
|
|
106
|
+
});
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
### 4. Work 间切换 (Switching Works)
|
|
110
|
+
跳转到指定 Work 的特定点位。
|
|
111
|
+
|
|
112
|
+
```typescript
|
|
113
|
+
const targetWorkCode = "work-id-b";
|
|
114
|
+
|
|
115
|
+
// 方式一:指定点位索引
|
|
116
|
+
five.setState({
|
|
117
|
+
workCode: targetWorkCode,
|
|
118
|
+
panoIndex: 0, // 目标 Work 的第 0 个点位
|
|
119
|
+
mode: "Panorama"
|
|
120
|
+
});
|
|
121
|
+
|
|
122
|
+
// 方式二:查找特定 Work
|
|
123
|
+
const targetWork = five.works.getWork(targetWorkCode);
|
|
124
|
+
if (targetWork) {
|
|
125
|
+
// 你的业务逻辑
|
|
126
|
+
}
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
## Common Pitfalls
|
|
130
|
+
|
|
131
|
+
1. **WorkCode 冲突**: 如果加载的两个 Work 拥有相同的 `workCode`,SDK 行为可能不可预期。务必确保唯一性。
|
|
132
|
+
* *解决*: 在构造 `LooseWorkWithExtrinsics` 时传入 `workCode` 字段强制覆盖。
|
|
133
|
+
2. **资源隔离**: 每个 Work 的纹理/模型请求是独立的。如果 Work A 和 Work B 引用了相同的 URL 资源,浏览器缓存会生效,但 SDK 内部逻辑仍视为独立资源。
|
|
134
|
+
3. **内存压力**: 同时加载多个大型模型会显著增加显存占用。建议根据设备性能限制同时加载的 Work 数量。
|
|
135
|
+
4. **坐标系混淆**: `transform` 仅影响 3D 模型的渲染位置。Work 内部的点位坐标 (`observer.position`) 也会自动应用此变换,但开发者在进行手动射线检测或计算时,需注意区分**原始坐标**和**世界坐标**。
|
|
136
|
+
|
|
137
|
+
## Related
|
|
138
|
+
|
|
139
|
+
* [Five](./five.md): Five 核心类说明。
|
|
140
|
+
* [State](./state.md): 状态管理说明。
|
|
141
|
+
* [Work](./work.md): Work 数据结构详解。
|
|
142
|
+
|
|
143
|
+
---
|
|
144
|
+
```yaml
|
|
145
|
+
tags: [multi-work, sandbox, works, load, transform]
|
|
146
|
+
```
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
# Pano Filter (全景图滤镜)
|
|
2
|
+
|
|
3
|
+
- **Summary**: `PBMPanoFilter` 用于调整全景图的视觉效果,包括亮度、对比度、饱和度、色温、色调等。它作为参数传递给 `ModelScene`,可实时改变全景图的渲染表现。
|
|
4
|
+
- **Schema**: `PBMPanoFilter`, `PBMUpdateable`
|
|
5
|
+
- **Concepts**: Material Filter, Color Correction
|
|
6
|
+
- **Configuration**: Temperature, Tint, Brightness, Contrast, Saturation
|
|
7
|
+
- **Examples**: 滤镜开启与参数调整
|
|
8
|
+
|
|
9
|
+
## Schema
|
|
10
|
+
|
|
11
|
+
> **Definition**: [PBMPanoFilter](../../five/model/materials/pbmMaterial.d.ts)
|
|
12
|
+
|
|
13
|
+
`PBMPanoFilter` 类定义了全景图的滤镜参数。所有属性均为对象引用,直接修改其内部属性即可生效。
|
|
14
|
+
|
|
15
|
+
```typescript
|
|
16
|
+
import { PBMUpdateable } from "@realsee/five";
|
|
17
|
+
|
|
18
|
+
export class PBMPanoFilter extends PBMUpdateable {
|
|
19
|
+
/** 对比度控制 */
|
|
20
|
+
public readonly contrast: {
|
|
21
|
+
/** 对比度偏移 [-1, 1] (默认 0) */
|
|
22
|
+
contrastBias: number;
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
/** 饱和度控制 */
|
|
26
|
+
public readonly saturation: {
|
|
27
|
+
/** 饱和度偏移 [-1, 1] (默认 0) */
|
|
28
|
+
saturationBias: number;
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
/** 颜色控制 (色温与色调) */
|
|
32
|
+
public readonly color: {
|
|
33
|
+
/** 色温偏移 [-100, 100] (默认 0) */
|
|
34
|
+
temperatureBias: number;
|
|
35
|
+
/** 色调偏移 [-100, 100] (默认 0) */
|
|
36
|
+
tintBias: number
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
/** 高光与阴影控制 */
|
|
40
|
+
public readonly highlightShadow: {
|
|
41
|
+
/** 全局亮度偏移 [-255, 255] (默认 0) */
|
|
42
|
+
globalBias: number;
|
|
43
|
+
/** 高光偏移 [-255, 255] (默认 0) */
|
|
44
|
+
highlightBias: number;
|
|
45
|
+
/** 阴影偏移 [-255, 255] (默认 0) */
|
|
46
|
+
shadowBias: number;
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
## Concepts
|
|
52
|
+
|
|
53
|
+
### Parameter Binding (参数绑定)
|
|
54
|
+
滤镜实例需要通过 `five.modelScene.parameter.set('panoFilter', filter)` 绑定到场景中才能生效。
|
|
55
|
+
|
|
56
|
+
## Configuration
|
|
57
|
+
|
|
58
|
+
以下参数均通过修改 `PBMPanoFilter` 实例的属性进行配置。
|
|
59
|
+
|
|
60
|
+
### Color & Tone (色彩与色调)
|
|
61
|
+
|
|
62
|
+
| Property | Type | Range | Default | Description |
|
|
63
|
+
| :--- | :--- | :--- | :--- | :--- |
|
|
64
|
+
| `color.temperatureBias` | `number` | `[-100, 100]` | `0` | **色温**。正值偏暖 (黄),负值偏冷 (蓝)。 |
|
|
65
|
+
| `color.tintBias` | `number` | `[-100, 100]` | `0` | **色调**。正值偏洋红,负值偏绿。 |
|
|
66
|
+
| `saturation.saturationBias` | `number` | `[-1, 1]` | `0` | **饱和度**。`0` 为原色,`-1` 为黑白。 |
|
|
67
|
+
| `contrast.contrastBias` | `number` | `[-1, 1]` | `0` | **对比度**。正值增强对比,负值降低对比。 |
|
|
68
|
+
|
|
69
|
+
### Light & Shadow (光影)
|
|
70
|
+
|
|
71
|
+
| Property | Type | Range | Default | Description |
|
|
72
|
+
| :--- | :--- | :--- | :--- | :--- |
|
|
73
|
+
| `highlightShadow.globalBias` | `number` | `[-255, 255]` | `0` | **亮度 (Brightness)**。整体提升或降低画面亮度。 |
|
|
74
|
+
| `highlightShadow.highlightBias` | `number` | `[-255, 255]` | `0` | **高光 (Highlight)**。仅调整画面亮部的亮度。 |
|
|
75
|
+
| `highlightShadow.shadowBias` | `number` | `[-255, 255]` | `0` | **阴影 (Shadow)**。仅调整画面暗部的亮度。 |
|
|
76
|
+
|
|
77
|
+
## Examples
|
|
78
|
+
|
|
79
|
+
### Basic Usage (基础用法)
|
|
80
|
+
|
|
81
|
+
创建一个滤镜实例并应用到 Five 场景中。
|
|
82
|
+
|
|
83
|
+
```typescript
|
|
84
|
+
import { Five, PBMPanoFilter } from "@realsee/five";
|
|
85
|
+
|
|
86
|
+
const five = new Five();
|
|
87
|
+
// ... 初始化 five ...
|
|
88
|
+
|
|
89
|
+
// 1. 创建滤镜实例
|
|
90
|
+
const panoFilter = new PBMPanoFilter();
|
|
91
|
+
|
|
92
|
+
// 2. 配置参数 (例如:增加一点暖色调和亮度)
|
|
93
|
+
panoFilter.color.temperatureBias = 10; // 暖色
|
|
94
|
+
panoFilter.highlightShadow.globalBias = 20; // 提亮
|
|
95
|
+
|
|
96
|
+
// 3. 启用滤镜
|
|
97
|
+
five.modelScene.parameter.set('panoFilter', panoFilter);
|
|
98
|
+
|
|
99
|
+
// 4. (可选) 停用滤镜
|
|
100
|
+
// five.modelScene.parameter.reset('panoFilter');
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
### Interactive Adjustment (动态调整)
|
|
104
|
+
|
|
105
|
+
滤镜参数支持实时修改,适合制作调节面板。
|
|
106
|
+
|
|
107
|
+
```typescript
|
|
108
|
+
import { Five, PBMPanoFilter } from "@realsee/five";
|
|
109
|
+
|
|
110
|
+
// 假设已经有 five 实例
|
|
111
|
+
const panoFilter = new PBMPanoFilter();
|
|
112
|
+
five.modelScene.parameter.set('panoFilter', panoFilter);
|
|
113
|
+
|
|
114
|
+
// 模拟 UI 绑定的数据对象
|
|
115
|
+
const filterSettings = {
|
|
116
|
+
brightness: 0,
|
|
117
|
+
contrast: 0,
|
|
118
|
+
};
|
|
119
|
+
|
|
120
|
+
// 监听 UI 变化 (示例伪代码)
|
|
121
|
+
function onBrightnessChange(value: number) {
|
|
122
|
+
// value range: [-255, 255]
|
|
123
|
+
panoFilter.highlightShadow.globalBias = value;
|
|
124
|
+
// 如果 five 没有开启自动渲染 (play: false),需要手动触发重绘
|
|
125
|
+
five.needsRender = true;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
function onContrastChange(value: number) {
|
|
129
|
+
// value range: [-1, 1]
|
|
130
|
+
panoFilter.contrast.contrastBias = value;
|
|
131
|
+
five.needsRender = true;
|
|
132
|
+
}
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
## Related
|
|
136
|
+
|
|
137
|
+
* [Model](./model.md): 了解 ModelScene 及其参数系统。
|
|
138
|
+
* [Parameter](./parameter.md): 了解 Five 的全局初始化参数。
|
|
139
|
+
|
|
140
|
+
---
|
|
141
|
+
|
|
142
|
+
```yaml
|
|
143
|
+
tags: [filter, material, visual, color, brightness, contrast]
|
|
144
|
+
```
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
# Panorama Tile
|
|
2
|
+
|
|
3
|
+
- **Summary**: 全景模式下的瓦片加载策略,支持多分辨率层级(LOD)和视锥体裁剪,以优化全景浏览的性能和清晰度。
|
|
4
|
+
- **Schema**: WorkTile 接口及相关配置参数。
|
|
5
|
+
- **Concepts**: LOD (Level of Detail), Frustum Culling, Tile URL Generation.
|
|
6
|
+
- **Configuration**: tileLevelForFov, tileMaxRequest, imageOptions.
|
|
7
|
+
- **Examples**: 瓦片数据结构查看与 Five 初始化配置。
|
|
8
|
+
|
|
9
|
+
## Schema
|
|
10
|
+
|
|
11
|
+
> **Definition**: [WorkImage](../../five/work/work.d.ts), [ImageOptions](../../five/types/imageOptions.d.ts)
|
|
12
|
+
|
|
13
|
+
### WorkObserver.images
|
|
14
|
+
点位全景图数据结构,包含瓦片列表。
|
|
15
|
+
|
|
16
|
+
```typescript
|
|
17
|
+
interface WorkImage {
|
|
18
|
+
/** 分辨率列表 */
|
|
19
|
+
sizeList: readonly number[];
|
|
20
|
+
/** 瓦片信息列表,按 level 排序 */
|
|
21
|
+
tiles: readonly WorkTile[];
|
|
22
|
+
// ... 其他基础图片 URL
|
|
23
|
+
}
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
### ImageOptions
|
|
27
|
+
全景图及瓦片的图片处理配置。
|
|
28
|
+
|
|
29
|
+
```typescript
|
|
30
|
+
interface ImageOptions {
|
|
31
|
+
/** 图片尺寸参数 (例如 512, 1024...) */
|
|
32
|
+
size?: number;
|
|
33
|
+
/** 图片质量参数 (0-100) */
|
|
34
|
+
quality?: number;
|
|
35
|
+
/** 图片格式参数 */
|
|
36
|
+
format?: "jpg" | "jpeg" | "png" | "heif" | "heic" | "webp" | "avif";
|
|
37
|
+
/** URL 转换函数 */
|
|
38
|
+
transform?: (url: string, options: ImageURLOptions) => string;
|
|
39
|
+
}
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
## Concepts
|
|
43
|
+
|
|
44
|
+
### Tile Parsing (瓦片解析)
|
|
45
|
+
在 `Five` 加载 `Work` 数据时,`WorkParser` 会解析 `panorama.size_list` (或 `panorama.tiles`) 字段。
|
|
46
|
+
- **Level 计算**: `level = log2(size / 512)`。
|
|
47
|
+
- **URL 生成**:
|
|
48
|
+
- 如果 `size > baseSize` (通常是初始全景图大小),URL 中的 `/cube_{size}/` 部分会被动态替换(通过 `replaceImageSize` 函数)。
|
|
49
|
+
- 如果 `size <= baseSize`,直接使用基础全景图 URL,并设置 `scale`。
|
|
50
|
+
- **排序**: 解析后的 `tiles` 数组会按 `level` 升序排列。
|
|
51
|
+
|
|
52
|
+
### sizeList
|
|
53
|
+
- **类型**: `readonly number[]`
|
|
54
|
+
- **说明**: 包含所有可用的分辨率(以像素为单位)。
|
|
55
|
+
- **示例**: `[2048, 6144]` 表示该点位全景图有两个层级,分别是 2048px 和 6144px。
|
|
56
|
+
- **图片路径**: 每个层级的图片路径都是 `cube_{size}`,`{size}` 是层级分辨率,必须与 `sizeList` 中的值对应。并必须存在 2048px 层级的图片。
|
|
57
|
+
|
|
58
|
+
### Level of Detail (LOD) & Loading Strategy
|
|
59
|
+
`PanoramaController` 使用 `Tiling` 类来管理瓦片加载:
|
|
60
|
+
- **LOD 选择**: 根据当前的视场角 (`FOV`) 和视图大小 (`viewSize`),计算所需的最佳瓦片层级。默认策略会优先保证画面清晰度,同时考虑网络开销。
|
|
61
|
+
- **视锥体裁剪 (Frustum Culling)**: 仅加载当前相机视锥体可见范围内的瓦片面。
|
|
62
|
+
- **并发控制**: 通过 `tileMaxRequest` 限制同时进行的网络请求数量,避免阻塞。
|
|
63
|
+
|
|
64
|
+
## Configuration
|
|
65
|
+
|
|
66
|
+
在初始化 `Five` 时,可以通过 `panorama` 配置参数来配置瓦片加载行为。
|
|
67
|
+
|
|
68
|
+
| Parameter | Type | Default | Description |
|
|
69
|
+
| :--- | :--- | :--- | :--- |
|
|
70
|
+
| `tileLevelForFov` | `(fov: number, viewSize: Vector2) => number` \| `false` | `undefined` | 自定义函数,用于根据当前 FOV 和视图尺寸决定加载哪个层级的瓦片。返回 `level` 数值。如果设置为 `false`,则禁用动态瓦片加载。默认使用内部策略。 |
|
|
71
|
+
| `tileMaxRequest` | `number` | `3` | 最大的瓦片图片并发请求数。增加此值可能加快加载速度,但也可能导致网络拥塞。 |
|
|
72
|
+
| `imageOptions` | `ImageOptions` | `undefined` | 全景图及瓦片的图片处理配置。可用于全局控制图片的加载格式(如强制使用 WebP)、质量压缩比例或通过 `transform` 函数自定义图片 URL。 |
|
|
73
|
+
|
|
74
|
+
## Examples
|
|
75
|
+
|
|
76
|
+
### 查看瓦片数据结构
|
|
77
|
+
|
|
78
|
+
```typescript
|
|
79
|
+
import { Five } from "@realsee/five";
|
|
80
|
+
|
|
81
|
+
const five = new Five();
|
|
82
|
+
|
|
83
|
+
five.on("loaded", () => {
|
|
84
|
+
const observer = five.work.observers[0];
|
|
85
|
+
if (observer && observer.images && observer.images.tiles) {
|
|
86
|
+
console.log("Available Tiles:", observer.images.tiles);
|
|
87
|
+
observer.images.tiles.forEach(tile => {
|
|
88
|
+
console.log(`Level: ${tile.level}, Size: ${tile.size}, Scale: ${tile.scale}`);
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
});
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
### 配置瓦片加载策略与图片参数
|
|
95
|
+
|
|
96
|
+
```typescript
|
|
97
|
+
import { Five } from "@realsee/five";
|
|
98
|
+
|
|
99
|
+
const five = new Five({
|
|
100
|
+
// 自定义瓦片层级选择策略
|
|
101
|
+
tileLevelForFov: (fov, viewSize) => {
|
|
102
|
+
// 简单示例:FOV 小于 60 度时强制使用 Level 2,否则使用 Level 1
|
|
103
|
+
if (fov < 60) {
|
|
104
|
+
return 2;
|
|
105
|
+
}
|
|
106
|
+
return 1;
|
|
107
|
+
},
|
|
108
|
+
// 限制并发请求数
|
|
109
|
+
tileMaxRequest: 6,
|
|
110
|
+
// 图片加载配置
|
|
111
|
+
imageOptions: {
|
|
112
|
+
// 强制请求 WebP 格式的图片
|
|
113
|
+
format: "webp",
|
|
114
|
+
// 图片质量设置为 80%
|
|
115
|
+
quality: 80,
|
|
116
|
+
// (可选) 自定义 URL 转换逻辑
|
|
117
|
+
// transform: (url, options) => {
|
|
118
|
+
// return url + `?x-oss-process=image/format,webp/quality,q_80`;
|
|
119
|
+
// }
|
|
120
|
+
}
|
|
121
|
+
});
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
## Related
|
|
125
|
+
- [Mode](./mode.md): 了解不同模态下 Work 数据的表现。
|
|
126
|
+
- [ImageOptions](./image-options.md): 了解图片加载配置选项。
|
|
127
|
+
|
|
128
|
+
---
|
|
129
|
+
|
|
130
|
+
```yaml
|
|
131
|
+
tags: [pano-tile, observer]
|
|
132
|
+
```
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
# 全景图 UV 与方向转换 (Panorama UV Conversion)
|
|
2
|
+
|
|
3
|
+
- **Summary**: 提供了一组工具方法,用于在**全景图 UV 坐标** (Equirectangular UV / Cubemap UV) 与**三维空间方向向量** (Vector3) 之间进行转换。
|
|
4
|
+
- **Schema**: 依赖 `WorkObserver` 实例,提供四个核心转换方法。
|
|
5
|
+
- **Concepts**: Equirectangular Projection, Cubemap Projection, UV Origin, Coordinate Systems.
|
|
6
|
+
- **Configuration**: `uvOrigin` (UV 原点设置).
|
|
7
|
+
- **Examples**: 向量转全景 UV、UV 转向量、Cubemap 转换。
|
|
8
|
+
|
|
9
|
+
## Schema
|
|
10
|
+
|
|
11
|
+
> **Definition**: [WorkObserver](../../five/work/work.d.ts)
|
|
12
|
+
|
|
13
|
+
这些方法挂载在 `WorkObserver` 实例上,依赖当前观察点 (Observer) 的位姿信息 (Position & Quaternion) 以及 `work.transform` 进行计算。
|
|
14
|
+
|
|
15
|
+
```typescript
|
|
16
|
+
interface WorkObserver {
|
|
17
|
+
/**
|
|
18
|
+
* 将方向向量转化为全景图 uv
|
|
19
|
+
* @param vector - 全局方向向量 (World Space)
|
|
20
|
+
* @param uvOrigin - UV 原点位置,默认为 'top-left'
|
|
21
|
+
*/
|
|
22
|
+
vectorToEquirectangularUv(vector: THREE.Vector3, uvOrigin?: 'top-left' | 'bottom-left'): THREE.Vector2;
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* 将全景图 uv 转化为方向向量
|
|
26
|
+
* @param uv - 全景图 UV 坐标 [0, 1]
|
|
27
|
+
* @param uvOrigin - UV 原点位置,默认为 'top-left'
|
|
28
|
+
*/
|
|
29
|
+
equirectangularUvToVector(uv: THREE.Vector2, uvOrigin?: 'top-left' | 'bottom-left'): THREE.Vector3;
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* 将方向向量转化为六视图 uv
|
|
33
|
+
* @param vector - 全局方向向量 (World Space)
|
|
34
|
+
* @param uvOrigin - UV 原点位置,默认为 'top-left'
|
|
35
|
+
*/
|
|
36
|
+
vectorToCubemapUv(vector: THREE.Vector3, uvOrigin?: 'top-left' | 'bottom-left'): [cubeFace: CubeFace, cubemapUv: THREE.Vector2];
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* 将六视图 uv 转化为方向向量
|
|
40
|
+
* @param cubeFace - 立方体面 ('up' | 'down' | 'left' | 'right' | 'front' | 'back')
|
|
41
|
+
* @param uv - 该面上的 UV 坐标 [0, 1]
|
|
42
|
+
* @param uvOrigin - UV 原点位置,默认为 'top-left'
|
|
43
|
+
*/
|
|
44
|
+
cubemapUvToVector(cubeFace: CubeFace, uv: THREE.Vector2, uvOrigin?: 'top-left' | 'bottom-left'): THREE.Vector3;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
type CubeFace = 'up' | 'down' | 'left' | 'right' | 'front' | 'back';
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
## Concepts
|
|
51
|
+
|
|
52
|
+
### 1. 坐标系转换 (Coordinate Transformation)
|
|
53
|
+
转换过程会自动处理以下坐标空间的变换:
|
|
54
|
+
1. **World Space (世界坐标系)**: `vector` 参数所处的坐标系。
|
|
55
|
+
2. **Work Space (Work 坐标系)**: 考虑 `work.transform` 带来的整体旋转。
|
|
56
|
+
3. **Observer Space (观察者坐标系)**: 考虑 `observer.quaternion` 带来的观察点旋转。
|
|
57
|
+
4. **Panorama Space (全景图空间)**: 最终映射到 2D 图片上的 UV 坐标。
|
|
58
|
+
|
|
59
|
+
### 2. 投影方式 (Projection Types)
|
|
60
|
+
* **Equirectangular (等距柱状投影)**: 将球体展开为 2:1 的矩形图片。常用于全景图预览。
|
|
61
|
+
* **Cubemap (立方体贴图)**: 将球体投影到立方体的六个面上。常用于高清全景浏览。
|
|
62
|
+
|
|
63
|
+
### 3. UV 原点 (UV Origin)
|
|
64
|
+
* **top-left (默认)**: 原点 `(0, 0)` 在图片**左上角**。U 轴向右,V 轴向下。符合大多数 Web 图片处理习惯 (Canvas, DOM)。
|
|
65
|
+
* **bottom-left**: 原点 `(0, 0)` 在图片**左下角**。U 轴向右,V 轴向上。符合 WebGL / OpenGL 纹理坐标习惯。
|
|
66
|
+
|
|
67
|
+
## Configuration
|
|
68
|
+
|
|
69
|
+
所有方法均包含可选参数 `uvOrigin`。
|
|
70
|
+
|
|
71
|
+
### Common Configuration
|
|
72
|
+
|
|
73
|
+
| Parameter | Type | Default | Description |
|
|
74
|
+
| :--- | :--- | :--- | :--- |
|
|
75
|
+
| `uvOrigin` | `'top-left' \| 'bottom-left'` | `'top-left'` | 指定 UV 坐标系的原点位置。 |
|
|
76
|
+
|
|
77
|
+
## Examples
|
|
78
|
+
|
|
79
|
+
### 1. 点击全景图获取空间方向 (Click to Vector)
|
|
80
|
+
假设你有一个全景图的点击事件,获取到了点击位置的 UV:
|
|
81
|
+
|
|
82
|
+
```typescript
|
|
83
|
+
const observer = five.work.observers[0];
|
|
84
|
+
// 假设这是用户点击全景图后归一化得到的 UV (0~1)
|
|
85
|
+
const clickUv = new THREE.Vector2(0.5, 0.5);
|
|
86
|
+
|
|
87
|
+
// 转换为世界空间的方向向量
|
|
88
|
+
const direction = observer.equirectangularUvToVector(clickUv);
|
|
89
|
+
|
|
90
|
+
console.log('点击方向:', direction);
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
### 2. 将空间点映射到全景图上 (World Point to UV)
|
|
94
|
+
假设场景中有一个 3D 物体,你想知道它在当前全景图上的位置(例如打标签):
|
|
95
|
+
|
|
96
|
+
```typescript
|
|
97
|
+
const observer = five.work.observers[0];
|
|
98
|
+
const objectPosition = new THREE.Vector3(10, 2, 5);
|
|
99
|
+
|
|
100
|
+
// 计算物体相对于观察点的方向向量
|
|
101
|
+
const direction = objectPosition.clone().sub(observer.position).normalize();
|
|
102
|
+
|
|
103
|
+
// 获取全景图 UV
|
|
104
|
+
const uv = observer.vectorToEquirectangularUv(direction);
|
|
105
|
+
|
|
106
|
+
console.log(`物体在全景图上的位置: u=${uv.x}, v=${uv.y}`);
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
### 3. 处理 Cubemap 坐标 (Cubemap Conversion)
|
|
110
|
+
如果你使用的是六面体全景图资源:
|
|
111
|
+
|
|
112
|
+
```typescript
|
|
113
|
+
const observer = five.work.observers[0];
|
|
114
|
+
const direction = new THREE.Vector3(0, 0, -1); // 正前方
|
|
115
|
+
|
|
116
|
+
// 获取对应的面和 UV
|
|
117
|
+
const [face, uv] = observer.vectorToCubemapUv(direction);
|
|
118
|
+
|
|
119
|
+
console.log(`正前方对应 Cubemap 的 ${face} 面,UV 为`, uv);
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
## Related
|
|
123
|
+
|
|
124
|
+
* [Work](./work.md): 了解 WorkObserver 的数据结构。
|
|
125
|
+
* [Coordinate System](./coordinate-system.md): 了解 Five 的坐标系定义。
|
|
126
|
+
|
|
127
|
+
---
|
|
128
|
+
|
|
129
|
+
```yaml
|
|
130
|
+
tags: [work, observer, uv, projection, math]
|
|
131
|
+
```
|