@realsee/five-webgpu 1.0.0-alpha.5 → 1.0.0-alpha.7

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.
Files changed (378) hide show
  1. package/ai_guides/api.md +9 -8
  2. package/ai_guides/features/camera-animation.md +1 -1
  3. package/ai_guides/features/event.md +0 -1
  4. package/ai_guides/features/five.md +78 -9
  5. package/ai_guides/features/gesture.md +1 -1
  6. package/ai_guides/features/load-external-model.md +6 -6
  7. package/ai_guides/features/load-progress.md +2 -2
  8. package/ai_guides/features/material.md +35 -8
  9. package/ai_guides/features/mode.md +26 -29
  10. package/ai_guides/features/model.md +1 -1
  11. package/ai_guides/features/state.md +2 -2
  12. package/ai_guides/features/ultra-hdr.md +41 -32
  13. package/ai_guides/quick-start.md +2 -2
  14. package/ai_guides/release_notes/6.8.md +2 -2
  15. package/ai_guides/support.md +0 -4
  16. package/docs/assets/hierarchy.js +1 -1
  17. package/docs/assets/navigation.js +1 -1
  18. package/docs/assets/search.js +1 -1
  19. package/docs/classes/index.AdaptiveLuminancePass.html +1 -1
  20. package/docs/classes/index.BoundingMesh.html +1 -1
  21. package/docs/classes/index.Camera.html +1 -1
  22. package/docs/classes/index.EffectComposer.html +1 -1
  23. package/docs/classes/index.EyeDomeLightingPass.html +1 -1
  24. package/docs/classes/index.Five.html +69 -67
  25. package/docs/classes/index.FivePass.html +1 -1
  26. package/docs/classes/index.FlowingFireworks3DPass.html +1 -1
  27. package/docs/classes/index.FlowingLight2DPass.html +1 -1
  28. package/docs/classes/index.FlowingLight3DPass.html +2 -2
  29. package/docs/classes/index.GaussianBlurPass.html +1 -1
  30. package/docs/classes/index.InternalWebGPURenderer.html +8 -5
  31. package/docs/classes/index.Model.html +1 -1
  32. package/docs/classes/index.ModelScene.html +1 -1
  33. package/docs/classes/index.NetworkSubscribe.html +1 -1
  34. package/docs/classes/index.PBMCustomNode.html +8 -8
  35. package/docs/classes/index.PBMGaussianSplattingNodeMaterial.html +8 -6
  36. package/docs/classes/index.PBMGaussianSplattingObject.html +10 -4
  37. package/docs/classes/index.PBMGaussianSplattingRenderMesh.html +26 -15
  38. package/docs/classes/index.PBMGroup.html +1 -1
  39. package/docs/classes/index.PBMMesh.html +1 -1
  40. package/docs/classes/index.PBMMeshBasicMaterial.html +13 -8
  41. package/docs/classes/index.PBMMeshBasicNodeMaterial.html +15 -10
  42. package/docs/classes/index.PBMMeshPanoOnlyMaterial.html +13 -8
  43. package/docs/classes/index.PBMMeshPanoOnlyNodeMaterial.html +13 -8
  44. package/docs/classes/index.PBMMeshPhongMaterial.html +13 -8
  45. package/docs/classes/index.PBMMeshPhongNodeMaterial.html +15 -10
  46. package/docs/classes/index.PBMMeshPhysicalMaterial.html +13 -8
  47. package/docs/classes/index.PBMMeshPhysicalNodeMaterial.html +15 -10
  48. package/docs/classes/index.PBMPanoFilter.html +8 -8
  49. package/docs/classes/index.PBMPointCloud.html +6 -7
  50. package/docs/classes/index.PBMPointCloudMaterial.html +83 -0
  51. package/docs/classes/index.PBMSkinnedMesh.html +1 -1
  52. package/docs/classes/index.PBMUpdateable.html +1 -1
  53. package/docs/classes/index.PanoCircleMesh.html +1 -1
  54. package/docs/classes/index.PanoCircleMeshCustom.html +5 -5
  55. package/docs/classes/index.PanoCircleMeshSolid.html +1 -1
  56. package/docs/classes/index.Parameter.html +57 -56
  57. package/docs/classes/index.Scene.html +1 -1
  58. package/docs/classes/index.Subscribe.html +1 -1
  59. package/docs/classes/index.TextureLoader.html +4 -1
  60. package/docs/classes/index.Tile3D.html +23 -21
  61. package/docs/classes/index.TileNode.html +1 -1
  62. package/docs/classes/index.Tileset.html +4 -4
  63. package/docs/classes/index.TrajectoryNode.html +3 -3
  64. package/docs/classes/index.Work.html +20 -18
  65. package/docs/classes/index.WorkResolvedObserver.html +22 -22
  66. package/docs/classes/index.XRButton.html +3 -0
  67. package/docs/documents/api.html +11 -10
  68. package/docs/documents/features_camera-animation.html +1 -1
  69. package/docs/documents/features_event.html +0 -1
  70. package/docs/documents/features_five.html +51 -9
  71. package/docs/documents/features_gesture.html +1 -1
  72. package/docs/documents/features_load-external-model.html +6 -6
  73. package/docs/documents/features_load-progress.html +1 -1
  74. package/docs/documents/features_material.html +20 -9
  75. package/docs/documents/features_mode.html +28 -13
  76. package/docs/documents/features_model.html +1 -1
  77. package/docs/documents/features_state.html +1 -1
  78. package/docs/documents/features_ultra-hdr.html +50 -44
  79. package/docs/documents/quick-start.html +1 -1
  80. package/docs/documents/release_notes_6.8.html +2 -2
  81. package/docs/documents/support.html +1 -3
  82. package/docs/functions/index.customNodesCacheKey.html +1 -1
  83. package/docs/functions/index.parseWork.html +1 -1
  84. package/docs/functions/index.workToJson.html +1 -1
  85. package/docs/hierarchy.html +1 -1
  86. package/docs/interfaces/index.AddableObject.html +1 -1
  87. package/docs/interfaces/index.AjaxOptions.html +1 -1
  88. package/docs/interfaces/index.BaseEvent.html +2 -2
  89. package/docs/interfaces/index.Clock.html +24 -0
  90. package/docs/interfaces/index.DeviceProfile.html +8 -0
  91. package/docs/interfaces/index.EventCallback.html +49 -47
  92. package/docs/interfaces/index.FiveInitArgs.html +65 -41
  93. package/docs/interfaces/index.GainmapCfgData.html +15 -0
  94. package/docs/interfaces/index.GestureEvent.html +2 -2
  95. package/docs/interfaces/index.IPBMMaterial.html +12 -7
  96. package/docs/interfaces/index.ImageOptions.html +1 -1
  97. package/docs/interfaces/index.IntersectEvent.html +2 -2
  98. package/docs/interfaces/index.IntersectMesh.html +1 -1
  99. package/docs/interfaces/index.IntersectMeshInterface.html +1 -1
  100. package/docs/interfaces/index.Intersection.html +1 -1
  101. package/docs/interfaces/index.LoosePanoWork.html +2 -2
  102. package/docs/interfaces/index.LooseWork.html +2 -2
  103. package/docs/interfaces/index.LooseWorkInitial.html +2 -2
  104. package/docs/interfaces/index.LooseWorkModel.html +2 -2
  105. package/docs/interfaces/index.LooseWorkObserver.html +2 -2
  106. package/docs/interfaces/index.LooseWorkPanorama.html +4 -3
  107. package/docs/interfaces/index.LooseWorkWithExtrinsics.html +15 -9
  108. package/docs/interfaces/index.ModeChangeEvent.html +2 -2
  109. package/docs/interfaces/index.ModelControllerCustomInitArgs.html +1 -1
  110. package/docs/interfaces/index.ModelEvent.html +2 -2
  111. package/docs/interfaces/index.ModelSceneEvent.html +2 -2
  112. package/docs/interfaces/index.ModelTileEvent.html +2 -2
  113. package/docs/interfaces/index.MovePanoOptions.html +1 -1
  114. package/docs/interfaces/index.NetworkAbortError.html +1 -1
  115. package/docs/interfaces/index.NetworkFirbiddenError.html +1 -1
  116. package/docs/interfaces/index.NetworkOptions.html +1 -1
  117. package/docs/interfaces/index.NetworkProxyError.html +1 -1
  118. package/docs/interfaces/index.NetworkResourceEvent.html +2 -2
  119. package/docs/interfaces/index.NetworkResponseError.html +1 -1
  120. package/docs/interfaces/index.NetworkTimeoutError.html +1 -1
  121. package/docs/interfaces/index.ObjectEvent.html +2 -2
  122. package/docs/interfaces/index.PBMClipperParameter.html +2 -2
  123. package/docs/interfaces/index.PBMCustomNodeContext.html +60 -12
  124. package/docs/interfaces/index.PBMCustomNodeOptions.html +4 -4
  125. package/docs/interfaces/index.PBMCustomNodePanoContext.html +13 -6
  126. package/docs/interfaces/index.PBMCustomNodeSlots.html +6 -6
  127. package/docs/interfaces/index.PBMGaussianSplattingNodeMaterialOptions.html +4 -0
  128. package/docs/interfaces/index.PBMPanoDepth.html +5 -5
  129. package/docs/interfaces/index.PBMPanoFilterValue.html +2 -2
  130. package/docs/interfaces/index.PBMPanoGainmap.html +6 -0
  131. package/docs/interfaces/index.PBMPanoPicture.html +9 -8
  132. package/docs/interfaces/index.PBMRefinedScreen.html +2 -2
  133. package/docs/interfaces/index.PanoCircleMeshCustomOptions.html +2 -2
  134. package/docs/interfaces/index.PanoCircleMeshInterface.html +1 -1
  135. package/docs/interfaces/index.PanoEvent.html +2 -2
  136. package/docs/interfaces/index.PanoPrepareEvent.html +15 -0
  137. package/docs/interfaces/index.PanoTextureEvent.html +2 -2
  138. package/docs/interfaces/index.PanoramaControllerCustomInitArgs.html +9 -9
  139. package/docs/interfaces/index.PanoramaLikeControllerCustomInitArgs.html +1 -1
  140. package/docs/interfaces/index.ParameterMaterialValue.html +42 -41
  141. package/docs/interfaces/index.ParameterTilesetValue.html +15 -15
  142. package/docs/interfaces/index.ParameterValue.html +56 -55
  143. package/docs/interfaces/index.Pose.html +1 -1
  144. package/docs/interfaces/index.RenderEvent.html +2 -2
  145. package/docs/interfaces/index.ResolvedParameterValue.html +56 -55
  146. package/docs/interfaces/index.State.html +1 -1
  147. package/docs/interfaces/index.StateEvent.html +2 -2
  148. package/docs/interfaces/index.TextureOptions.html +1 -1
  149. package/docs/interfaces/index.TilesetOptions.html +7 -2
  150. package/docs/interfaces/index.TopviewControllerCustomInitArgs.html +1 -1
  151. package/docs/interfaces/index.VRPanoramaControllerCustomInitArgs.html +37 -0
  152. package/docs/interfaces/index.ViewLayer.html +23 -21
  153. package/docs/interfaces/index.WorkCubeHdrGainmapImage.html +10 -0
  154. package/docs/interfaces/index.WorkCubeImage.html +5 -9
  155. package/docs/interfaces/index.WorkImage.html +8 -12
  156. package/docs/interfaces/index.WorkInitial.html +8 -8
  157. package/docs/interfaces/index.WorkModel.html +8 -8
  158. package/docs/interfaces/index.WorkModelLayer.html +6 -6
  159. package/docs/interfaces/index.WorkObserver.html +23 -23
  160. package/docs/interfaces/index.WorkPanoramaJson.html +3 -2
  161. package/docs/interfaces/index.WorkTile.html +8 -12
  162. package/docs/interfaces/index.WorksEvent.html +2 -2
  163. package/docs/interfaces/index.XRControllerEvent.html +2 -2
  164. package/docs/interfaces/index.XRGestureEvent.html +2 -2
  165. package/docs/interfaces/index.XRPanoramaControllerCustomInitArgs.html +52 -0
  166. package/docs/interfaces/index.XRSessionEvent.html +2 -2
  167. package/docs/modules/index.html +1 -1
  168. package/docs/types/index.ControllerCustomInitTypes.html +4 -2
  169. package/docs/types/index.ControllerEventTypes.html +25 -23
  170. package/docs/types/index.DeviceProfileOverride.html +5 -0
  171. package/docs/types/index.EventTypes.html +26 -26
  172. package/docs/types/index.FlowingLightLineInput.html +11 -0
  173. package/docs/types/index.Mode.html +6 -3
  174. package/docs/types/index.OutputTextureDataType.html +1 -1
  175. package/docs/types/index.PBMCustomNodeTargetType.html +1 -1
  176. package/docs/types/index.ParseOptions.html +14 -8
  177. package/docs/types/index.XRMachineType.html +7 -0
  178. package/docs/variables/index.GSPLAT_PIPELINE_AUTO.html +2 -0
  179. package/docs/variables/index.GSPLAT_PIPELINE_RASTER_CPU_SORT.html +2 -0
  180. package/docs/variables/index.GSPLAT_PIPELINE_RASTER_GPU_SORT.html +2 -0
  181. package/docs/variables/index.PBMVertexMarkFlag.html +4 -0
  182. package/docs/variables/index.PROXY_CONTROLLER_EVENT_NAMES.html +1 -1
  183. package/docs/variables/index.controllersDefaultInitArgs.html +1 -1
  184. package/five/application/controllers.d.ts +8 -0
  185. package/five/application/events.d.ts +1 -1
  186. package/five/application/five.d.ts +6 -1
  187. package/five/application/fiveInitArgs.d.ts +32 -1
  188. package/five/application/mode.d.ts +8 -1
  189. package/five/cardboard/helper.d.ts +2 -0
  190. package/five/cardboard/index.d.ts +13 -0
  191. package/five/cardboard/sensor.d.ts +158 -0
  192. package/five/controllers/base.d.ts +3 -0
  193. package/five/controllers/events.d.ts +5 -3
  194. package/five/controllers/panorama.d.ts +2 -2
  195. package/five/controllers/vrPanorama.d.ts +56 -0
  196. package/five/controllers/xrPanorama.d.ts +506 -0
  197. package/five/core/internalWebGPURenderer.d.ts +7 -1
  198. package/five/core/panoVideo.d.ts +4 -1
  199. package/five/core/tiling.d.ts +25 -11
  200. package/five/core/webglAsyncReadFix.d.ts +25 -0
  201. package/five/gaussian-splatting/gpu-sort/prefixSumKernel.d.ts +65 -0
  202. package/five/gaussian-splatting/gpu-sort/radixSortModule.d.ts +128 -0
  203. package/five/gaussian-splatting/gpu-sort/shaders/prefixSum.d.ts +2 -0
  204. package/five/gaussian-splatting/gpu-sort/shaders/radixHistogram.d.ts +2 -0
  205. package/five/gaussian-splatting/gpu-sort/shaders/radixReorder.d.ts +2 -0
  206. package/five/gaussian-splatting/gpu-sort/shaders/sortKeygen.d.ts +2 -0
  207. package/five/gaussian-splatting/gpu-sort/sortAdapter.d.ts +234 -0
  208. package/five/gaussian-splatting/pipelines/cpuSortPipeline.d.ts +159 -0
  209. package/five/gaussian-splatting/pipelines/gpuSortPipeline.d.ts +98 -0
  210. package/five/gaussian-splatting/pipelines/gsplatPipeline.d.ts +104 -0
  211. package/five/gaussian-splatting/pipelines/pipelineMode.d.ts +42 -0
  212. package/five/gaussian-splatting/pipelines/sortThrottle.d.ts +45 -0
  213. package/five/index.d.ts +8 -2
  214. package/five/index.js +272 -269
  215. package/five/index.mjs +8389 -4487
  216. package/five/meshes/panoCircleMeshCustom.d.ts +1 -0
  217. package/five/model/index.d.ts +3 -2
  218. package/five/model/materials/pbmGaussianSplattingNodeMaterial.d.ts +4 -0
  219. package/five/model/materials/pbmMaterial.d.ts +126 -19
  220. package/five/model/materials/pbmMeshMaterial.d.ts +0 -9
  221. package/five/model/materials/pbmPointCloudNodeMaterial.d.ts +1 -1
  222. package/five/model/materials/tsl/defines.d.ts +6 -1
  223. package/five/model/materials/tsl/outputBuilder.d.ts +1 -12
  224. package/five/model/materials/tsl/panoColor.d.ts +8 -2
  225. package/five/model/materials/tsl/utils.d.ts +13 -0
  226. package/five/model/objects/pbmGaussianSplattingObject.d.ts +9 -0
  227. package/five/model/objects/pbmGaussianSplattingRenderMesh.d.ts +67 -101
  228. package/five/model/objects/pbmPointCloud.d.ts +0 -1
  229. package/five/model/objects/pbmPointCloudObject.d.ts +1 -1
  230. package/five/model/parameter.d.ts +5 -4
  231. package/five/model/tile3d/index.d.ts +2 -0
  232. package/five/model/tile3d/tileset.d.ts +5 -0
  233. package/five/model/tile3d/trajectory-content.d.ts +53 -0
  234. package/five/renderer/index.d.ts +1 -1
  235. package/five/renderer/postprocessing/index.d.ts +1 -1
  236. package/five/texture/loader.d.ts +6 -0
  237. package/five/types/cube.d.ts +0 -1
  238. package/five/utils/detector.d.ts +11 -1
  239. package/five/utils/error.d.ts +1 -0
  240. package/five/utils/event.d.ts +26 -3
  241. package/five/utils/gainmap-data.d.ts +23 -0
  242. package/five/webxr/XRControllerModelFactory.d.ts +55 -0
  243. package/five/webxr/buttonStateMachine.d.ts +31 -0
  244. package/five/webxr/deviceProfile.d.ts +70 -0
  245. package/five/webxr/inputSourceTracker.d.ts +59 -0
  246. package/five/webxr/referenceSpace.d.ts +60 -0
  247. package/five/webxr/renderTargetBridge.d.ts +45 -0
  248. package/five/webxr/xrButton.d.ts +4 -0
  249. package/five/webxr/xrManager.d.ts +174 -0
  250. package/five/work/index.d.ts +1 -1
  251. package/five/work/looseWorkType.d.ts +2 -1
  252. package/five/work/work.d.ts +30 -7
  253. package/five/work/workJsonType.d.ts +2 -1
  254. package/gltf-loader/gltf-object.d.ts +17 -0
  255. package/gltf-loader/index.d.ts +45 -0
  256. package/gltf-loader/index.js +255 -0
  257. package/gltf-loader/index.mjs +302 -0
  258. package/line/circle_png.d.ts +1 -0
  259. package/line/index.d.ts +49 -0
  260. package/line/index.js +255 -0
  261. package/line/index.mjs +340 -0
  262. package/package.json +30 -5
  263. package/plugins/BackgroundPlugin/Controller.d.ts +20 -0
  264. package/plugins/BackgroundPlugin/index.d.ts +5 -0
  265. package/plugins/BackgroundPlugin/typings.d.ts +44 -0
  266. package/plugins/CSS2DPlugin/Controller.d.ts +59 -0
  267. package/plugins/CSS2DPlugin/index.d.ts +5 -0
  268. package/plugins/CSS2DPlugin/typing.d.ts +31 -0
  269. package/plugins/CSS3DPlugin/Controller.d.ts +64 -0
  270. package/plugins/CSS3DPlugin/index.d.ts +5 -0
  271. package/plugins/CSS3DPlugin/typing.d.ts +33 -0
  272. package/plugins/FloorplanPlugin/Controller.d.ts +100 -0
  273. package/plugins/FloorplanPlugin/index.d.ts +6 -0
  274. package/plugins/FloorplanPlugin/render/assets.d.ts +9 -0
  275. package/plugins/FloorplanPlugin/render/index.d.ts +35 -0
  276. package/plugins/FloorplanPlugin/render/isPointInPolygon.d.ts +5 -0
  277. package/plugins/FloorplanPlugin/render/renderFloor.d.ts +22 -0
  278. package/plugins/FloorplanPlugin/render/roomLabelVisibility.d.ts +10 -0
  279. package/plugins/FloorplanPlugin/typing.d.ts +156 -0
  280. package/plugins/FloorplanPlugin/typings/floorplanData.d.ts +112 -0
  281. package/plugins/FloorplanPlugin/typings/floorplanJson.d.ts +167 -0
  282. package/plugins/FloorplanPlugin/typings/floorplanServerData.d.ts +78 -0
  283. package/plugins/FloorplanPlugin/typings/index.d.ts +3 -0
  284. package/plugins/FloorplanPlugin/utils/changeMode.d.ts +5 -0
  285. package/plugins/FloorplanPlugin/utils/changeModelCanvasOpacity.d.ts +6 -0
  286. package/plugins/FloorplanPlugin/utils/correctFiveState.d.ts +11 -0
  287. package/plugins/FloorplanPlugin/utils/equal.d.ts +9 -0
  288. package/plugins/FloorplanPlugin/utils/filter.d.ts +8 -0
  289. package/plugins/FloorplanPlugin/utils/fiveModelLoad.d.ts +6 -0
  290. package/plugins/FloorplanPlugin/utils/formatData.d.ts +6 -0
  291. package/plugins/FloorplanPlugin/utils/formatFloorplanJson.d.ts +20 -0
  292. package/plugins/FloorplanPlugin/utils/formatPosition.d.ts +33 -0
  293. package/plugins/FloorplanPlugin/utils/getDistanceFromModel.d.ts +6 -0
  294. package/plugins/FloorplanPlugin/utils/getPxmm.d.ts +19 -0
  295. package/plugins/FloorplanPlugin/utils/isTruelyObject.d.ts +4 -0
  296. package/plugins/FloorplanPlugin/utils/nearlyEqual.d.ts +8 -0
  297. package/plugins/FloorplanPlugin/utils/polylabel.d.ts +8 -0
  298. package/plugins/FloorplanPlugin/utils/to.d.ts +5 -0
  299. package/plugins/Object3DHelperPlugin/Controller.d.ts +99 -0
  300. package/plugins/Object3DHelperPlugin/Controllers/BaseController.d.ts +142 -0
  301. package/plugins/Object3DHelperPlugin/Controllers/BoundingBoxController.d.ts +16 -0
  302. package/plugins/Object3DHelperPlugin/Controllers/MoveController.d.ts +66 -0
  303. package/plugins/Object3DHelperPlugin/Controllers/RotateController.d.ts +61 -0
  304. package/plugins/Object3DHelperPlugin/FiveControllerWrapper.d.ts +17 -0
  305. package/plugins/Object3DHelperPlugin/Helper/BaseHelper.d.ts +97 -0
  306. package/plugins/Object3DHelperPlugin/Helper/BoundingBoxHelper.d.ts +16 -0
  307. package/plugins/Object3DHelperPlugin/Helper/MoveHelper.d.ts +37 -0
  308. package/plugins/Object3DHelperPlugin/Helper/RotateHelper.d.ts +93 -0
  309. package/plugins/Object3DHelperPlugin/constant.d.ts +27 -0
  310. package/plugins/Object3DHelperPlugin/index.d.ts +6 -0
  311. package/plugins/Object3DHelperPlugin/typing.d.ts +143 -0
  312. package/plugins/Object3DHelperPlugin/utils/ArrowGroup.d.ts +22 -0
  313. package/plugins/Object3DHelperPlugin/utils/CenterHandle.d.ts +23 -0
  314. package/plugins/Object3DHelperPlugin/utils/PlaneHandle.d.ts +19 -0
  315. package/plugins/Object3DHelperPlugin/utils/calculateScaleByCamera.d.ts +5 -0
  316. package/plugins/Object3DHelperPlugin/utils/cameraHooks.d.ts +3 -0
  317. package/plugins/Object3DHelperPlugin/utils/direction.d.ts +14 -0
  318. package/plugins/Object3DHelperPlugin/utils/getMouseRaycaster.d.ts +5 -0
  319. package/plugins/Object3DHelperPlugin/utils/getOrthographicCameraDirection.d.ts +8 -0
  320. package/plugins/Object3DHelperPlugin/utils/setObjectQuaternion.d.ts +8 -0
  321. package/plugins/Object3DHelperPlugin/utils/solidGuide.d.ts +27 -0
  322. package/plugins/Object3DHelperPlugin/utils/tipsDom.d.ts +8 -0
  323. package/plugins/PanoAnimePlugin/Controller.d.ts +49 -0
  324. package/plugins/PanoAnimePlugin/index.d.ts +5 -0
  325. package/plugins/PanoAnimePlugin/typing.d.ts +37 -0
  326. package/plugins/index.d.ts +6 -0
  327. package/plugins/index.js +748 -3
  328. package/plugins/index.mjs +28761 -88
  329. package/plugins/thirdParty/CSS2DRenderer.d.ts +37 -0
  330. package/plugins/thirdParty/CSS3DRenderer.d.ts +45 -0
  331. package/plugins/thirdParty/OrbitControls.d.ts +78 -0
  332. package/plugins/thirdParty/doctorstrange-model.d.ts +92 -0
  333. package/plugins/thirdParty/domevents.d.ts +36 -0
  334. package/plugins/utils/clamp.d.ts +2 -0
  335. package/plugins/utils/uuid.d.ts +2 -0
  336. package/react/index.js +2 -2
  337. package/react/index.mjs +2 -2
  338. package/sticker/geometry.d.ts +3 -0
  339. package/sticker/index.d.ts +68 -0
  340. package/sticker/index.js +255 -0
  341. package/sticker/index.mjs +358 -0
  342. package/umd/five-gltf-loader.js +255 -0
  343. package/umd/five-line.js +322 -0
  344. package/umd/five-plugins.js +816 -3
  345. package/umd/five-react.js +2 -2
  346. package/umd/five-sticker.js +255 -0
  347. package/umd/five-vfx.js +323 -0
  348. package/umd/five.js +347 -344
  349. package/vfx/airflow/airflow.d.ts +18 -0
  350. package/vfx/common/simplex-noise.d.ts +2 -0
  351. package/vfx/frame/frame.d.ts +27 -0
  352. package/vfx/index.d.ts +7 -0
  353. package/vfx/index.js +255 -0
  354. package/vfx/index.mjs +738 -0
  355. package/vfx/particle/instance.d.ts +36 -0
  356. package/vfx/particle/particle.d.ts +119 -0
  357. package/vfx/particle/utils.d.ts +11 -0
  358. package/vfx/particle-gpu/particle.d.ts +75 -0
  359. package/vfx/particle-gpu/utils.d.ts +11 -0
  360. package/vfx/spotLight/spotLight.d.ts +15 -0
  361. package/work-downloader/components/model-3d-tile.d.ts +2 -0
  362. package/work-downloader/components/model.d.ts +3 -0
  363. package/work-downloader/components/observer.d.ts +9 -0
  364. package/work-downloader/download.d.ts +16 -0
  365. package/work-downloader/index.d.ts +2 -0
  366. package/work-downloader/index.js +255 -0
  367. package/work-downloader/index.mjs +595 -0
  368. package/work-downloader/type.d.ts +28 -0
  369. package/work-downloader/utils/download-to-file.d.ts +1 -0
  370. package/work-downloader/utils/image-processing.d.ts +7 -0
  371. package/work-downloader/utils/join-url.d.ts +2 -0
  372. package/work-downloader/utils/log.d.ts +1 -0
  373. package/work-downloader/utils/relative-url.d.ts +1 -0
  374. package/docs/interfaces/index.PBMHDRConfig.html +0 -12
  375. package/five/gaussian-splatting/worker/dataWorker.d.ts +0 -1
  376. package/five/three-version-check.d.ts +0 -1
  377. package/five/utils/hdr-data.d.ts +0 -13
  378. package/five/utils/shaderContentFix.d.ts +0 -7
@@ -0,0 +1,506 @@
1
+ import * as THREE from "three/webgpu";
2
+ import { State } from "../types/state";
3
+ import { Pose } from "../types/pose";
4
+ import { CameraPose } from "../core/camera";
5
+ import { XRGestureEvent } from "../utils/event";
6
+ import { XRManager } from "../webxr/xrManager";
7
+ import { DeviceProfileOverride } from "../webxr/deviceProfile";
8
+ import { XRControllerModelFactory } from "../webxr/XRControllerModelFactory";
9
+ import { ButtonStateMachine, ButtonEvent } from "../webxr/buttonStateMachine";
10
+ import { PanoCircleMeshInterface } from "../types/panoCircleMeshInterface";
11
+ import { BaseControllerInitArgs } from "./base";
12
+ import { PanoramaController, PanoramaControllerCustomInitArgs, PanoramaControllerInitArgs } from "./panorama";
13
+ /**
14
+ * XRPanorama(WebXR / VR 硬件)控制器的自定义初始化参数。
15
+ *
16
+ * 与 {@link PanoramaControllerCustomInitArgs} 的关系与 `VRPanoramaController`
17
+ * 完全同构:XR 下相机朝向由头显决定,纬度不受限,因此 `Omit` 掉
18
+ * `maxLatitude` / `minLatitude`({@link parseArgs} 中会强制为 `±π/2`)。
19
+ *
20
+ * 在此基础上新增 XR 专属的可选字段(参考空间 / foveation / 手柄显示 / 设备映射 / 诊断)。
21
+ */
22
+ interface XRPanoramaControllerCustomInitArgs extends Omit<PanoramaControllerCustomInitArgs, "maxLatitude" | "minLatitude"> {
23
+ /** 参考空间类型,默认 `'local-floor'` */
24
+ referenceSpaceType?: XRReferenceSpaceType;
25
+ /** 注视点渲染(foveation)强度 `[0, 1]`,默认 `1`(边缘最省) */
26
+ foveation?: number;
27
+ /** 是否显示手柄模型,默认 `true` */
28
+ showControllerModel?: boolean;
29
+ /** 是否显示 pointer ray(指向射线),默认 `true` */
30
+ showPointerRay?: boolean;
31
+ /** 按字段覆盖设备的按键 / 轴映射与手柄模型选择(Device_Profile),默认不覆盖 */
32
+ deviceProfile?: DeviceProfileOverride;
33
+ }
34
+ /**
35
+ * XRPanorama 控制器的自定义参数默认值。
36
+ *
37
+ * 从 {@link defaultPanoramaControllerCustomInitArgs} 中 `omit` 掉
38
+ * `maxLatitude` / `minLatitude`(这两项在 XR 下无意义),再补上 XR 专属字段。
39
+ */
40
+ declare const defaultXRPanoramaControllerCustomInitArgs: Required<XRPanoramaControllerCustomInitArgs>;
41
+ type XRPanoramaControllerInitArgs = BaseControllerInitArgs & XRPanoramaControllerCustomInitArgs;
42
+ /**
43
+ * XRPanorama 模式控制器。
44
+ *
45
+ * 通过 WebXR 在 VR 头显中呈现全景。继承 {@link PanoramaController},
46
+ * 复用其全景资源管理、点位移动动画、瓦片细化与视频全景逻辑;
47
+ * 相机 / 渲染 / 输入段将在后续任务(8.2–8.9)中接管重写。
48
+ *
49
+ * @remarks
50
+ * 前置条件:renderer 的后端必须为 WebGL2(非 WebGPU),即 `new Five()` 时
51
+ * 传入 `forceWebGL: true`。`three` 的 WebGPU 后端目前不支持 WebXR。
52
+ */
53
+ declare class XRPanoramaController extends PanoramaController {
54
+ /**
55
+ * 自研 WebXR 会话管理(唯一持有 `XRSession` / XR layer 的地方)。
56
+ *
57
+ * @remarks
58
+ * 负责进入 / 退出、眼相机、手柄位姿追踪与逐眼渲染;控制器只经它取 session、
59
+ * 输入源射线与 Eye_Camera,不再依赖 three 渲染器自带的 XR 管理器。
60
+ */
61
+ protected xrManager: XRManager;
62
+ /** 是否显示手柄模型(构造参数 `showControllerModel`,默认 `true`)。 */
63
+ protected showControllerModel: boolean;
64
+ /** 是否显示 pointer ray(构造参数 `showPointerRay`,默认 `true`)。 */
65
+ protected showPointerRay: boolean;
66
+ /**
67
+ * 左右手 pointer ray 的 `Raycaster`(**复用实例**,不每帧 new)。
68
+ *
69
+ * @description
70
+ * 每帧由 {@link XRManager.fillRaycaster} 按输入源的 target ray 填充(对应需求 8.6)。
71
+ * 按 `inputSource.handedness` 分左右手(`'none'` 归右手),供拾取
72
+ * (任务 8.9 的 `intersect`)消费。
73
+ *
74
+ * 复用时统一设置拾取参数(与 `VRPanoramaController.intersect` 中 raycaster 的参数对齐):
75
+ * `params.Points.threshold = 0.1`、`firstHitOnly = true`、`floorIndex = -1`。
76
+ */
77
+ protected controllerRaycasters: {
78
+ left: THREE.Raycaster;
79
+ right: THREE.Raycaster;
80
+ };
81
+ /**
82
+ * 注视 / 手势射线(**复用实例**)。
83
+ *
84
+ * @description
85
+ * 当设备提供 hand tracking 或 `targetRayMode === 'transient-pointer'`(如 Apple Vision Pro)
86
+ * 时,用它作为拾取源(对应需求 8.8)。首次需要时在 {@link updateGazeRay} 中惰性创建,
87
+ * 不需要时保持 `null`。拾取参数与 {@link controllerRaycasters} 一致。
88
+ */
89
+ protected gazeRaycaster: THREE.Raycaster | null;
90
+ /**
91
+ * 本帧 {@link controllerRaycasters} 的哪一只手被真正填充过。
92
+ *
93
+ * @description
94
+ * `controllerRaycasters` 是复用实例,某只手本帧没有输入源时它里面残留的是**上一帧**
95
+ * 的 origin / direction。拾取与走点必须只用本帧填过的射线,否则会按一条陈旧射线选点。
96
+ * 由 {@link updateControllerHelper} 每帧重置并写入,{@link pickPickingRaycaster} 据此判断。
97
+ */
98
+ protected controllerRayFilled: {
99
+ left: boolean;
100
+ right: boolean;
101
+ };
102
+ /**
103
+ * 手柄模型工厂(承载 glTF 手柄模型,`gltfLoader` 桥接到 five 的 fetcher)。
104
+ * @description 惰性创建:第一次需要建手柄模型时才 new(见 {@link getControllerModelFactory})。
105
+ */
106
+ protected controllerModelFactory: XRControllerModelFactory | null;
107
+ /**
108
+ * 按键状态机(纯逻辑):把每帧采样到的 `pressed` 转成 `buttonDown / press / buttonUp / tap` 事件,
109
+ * 状态以 `(XRInputSource, 按键名)` 为键。
110
+ */
111
+ protected buttonStateMachine: ButtonStateMachine;
112
+ /** 按 Device_Profile 生成的左右手按键映射(profile 在会话内不变,构造期算一次)。 */
113
+ private buttonMaps;
114
+ /** 以 `XRInputSource` 为键的手柄模型 / pointer ray 引用,用于移除时清理。 */
115
+ private inputVisuals;
116
+ /** `showControllerModel` / `showPointerRay` 变化后置位,下一帧在 {@link updateTime} 中重建 / 移除。 */
117
+ private inputsDirty;
118
+ /** 同一帧最多走点一次的标志(tap 走点与驻留走点共用),每帧 {@link updateTime} 开头清零。 */
119
+ private walkedThisFrame;
120
+ /** 最近一次 {@link updateTime} 的帧时间,供输入源移除 / 会话结束时补发 buttonUp 用。 */
121
+ private lastFrameTime;
122
+ /** 本帧需要走点的 trigger tap 来源(未被 preventDefault),先右后左处理。 */
123
+ private walkSources;
124
+ /**
125
+ * 驻留走点状态:当前被射线持续指向的点位 `panoMesh`。
126
+ *
127
+ * @description
128
+ * 与 `VRPanoramaController` 的同名字段同义:{@link intersect} 每帧记录射线命中的点位,
129
+ * 若连续多帧命中同一个点位且时长超过 {@link ACTIVE_TO_CURRENT_DELAY},则自动走点。
130
+ * `XRPanoramaController` 与 `VRPanoramaController` 平级(都 `extends PanoramaController`),
131
+ * 继承不到 VR 的这两个字段,故在本类里新增。
132
+ */
133
+ protected activePanoMesh?: PanoCircleMeshInterface;
134
+ /**
135
+ * 驻留走点状态:{@link activePanoMesh} 开始被指向的时间戳。
136
+ * 与 {@link activePanoMesh} 配合判定驻留时长。
137
+ */
138
+ protected activeTime?: number;
139
+ /**
140
+ * 注视 / 手势射线的复用实例(惰性创建,不每帧 new)。
141
+ * @description {@link updateGazeRay} 与 `select` 回调共用;是否「生效」由 {@link gazeRaycaster} 是否非空表达。
142
+ */
143
+ private gazeRayPool;
144
+ /**
145
+ * 强制 latitude 不受限(`±π/2`),再交给父类解析。
146
+ *
147
+ * 与 `VRPanoramaController.parseArgs` 同构:XR 下相机朝向由头显决定,
148
+ * 不应被 `maxLatitude` / `minLatitude` 约束。
149
+ */
150
+ static parseArgs(args: XRPanoramaControllerInitArgs): Required<PanoramaControllerInitArgs>;
151
+ /** 返回 `mode: 'XRPanorama'` 的初始化动画终态 */
152
+ static initAnimationEndState(args: XRPanoramaControllerInitArgs): State;
153
+ constructor(args: XRPanoramaControllerInitArgs);
154
+ /**
155
+ * 更新配置:强制 latitude 不受限后交给父类。
156
+ *
157
+ * 与 `VRPanoramaController.updateConfiguration` 同构。
158
+ */
159
+ updateConfiguration(args: XRPanoramaControllerCustomInitArgs): boolean;
160
+ /**
161
+ * 时间迭代(XR 版)。
162
+ *
163
+ * @description
164
+ * 全景业务段(动画推进 / panoMeshes / 瓦片细化 / 全景视频)直接复用父类
165
+ * {@link PanoramaController.updateTime}。父类在 `locationMotion` 运行时算出站点位置
166
+ * `cameraPose.offset`,并**只通过** `setCamera` 应用到相机;本类覆写的 {@link setCamera}
167
+ * 只取其中的位置(朝向 / fov / distance 一律忽略),因此站点位置必须先经父类
168
+ * `updateTime` 更新,眼相机才能用到**本帧**的站点。相机朝向则由本方法从头显单向同步。
169
+ *
170
+ * 每帧顺序:
171
+ * 1. 父类全景业务(经 {@link setCamera} 更新 `camera.position`);
172
+ * 2. `xrManager.beginFrame`:以本帧站点位置算 Head_Pose、更新 Eye_Camera 与手柄位姿;
173
+ * 3. `hasPose` 时把 five 相机朝向同步为头部朝向(位置保持站点,不写 `zoom`);
174
+ * 4. 手柄采样 / 注视射线;
175
+ * 5. 射线拾取与驻留走点。
176
+ *
177
+ * @param time - 当前帧时间戳
178
+ * @param deltaTime - 距上一帧的时间增量
179
+ * @param args - rAF 透传的实参,`args[1]` 为 `XRFrame`(`args[0]` 是 rAF 自己的时间戳)
180
+ */
181
+ updateTime(time: number, deltaTime: number, ...args: any[]): void;
182
+ /**
183
+ * 相机反向同步:XR → five(每帧在 {@link updateTime} 中、`hasPose` 时调用)。
184
+ *
185
+ * 只写朝向,**不改 `camera.position`**(站点位置只由全景业务段 A 的 `locationMotion`
186
+ * 经 {@link setCamera} 驱动,头部平移不改变站点),也不碰只读的 `zoom`:
187
+ * 直接 compose 本地矩阵再反算 pose。
188
+ *
189
+ * @param headOrientation - 本帧头部朝向(`FrameInfo.headOrientation`)
190
+ */
191
+ protected syncCameraFromXR(headOrientation: THREE.Quaternion): void;
192
+ /**
193
+ * 生命周期:渲染(XR 版)。
194
+ *
195
+ * @description
196
+ * 返回 `true` 表示「本帧已自行处理」,`Five.render()` 据此跳过 `FiveRenderer`
197
+ * (`five.ts` 约 1842-1851 行),XR 下没有后处理合成。已进入但本帧 `hasPose` 为假时
198
+ * `renderEyes` 返回 `false` 并跳过绘制,这里仍返回 `true`,避免 `FiveRenderer`
199
+ * 白白渲染一帧到头显不可见的画布。
200
+ *
201
+ * 清屏、视口、scissor、渲染目标与状态恢复都由 `xrManager.renderEyes` 内部处理。
202
+ *
203
+ * @returns 已进入返回 `true`(旁路 `FiveRenderer`);未进入返回 `false`(退回普通渲染路径)
204
+ */
205
+ render(): boolean;
206
+ /**
207
+ * 转动摄像头(任务 8.6,姿态旁路)。
208
+ *
209
+ * XR 下相机朝向由头显决定,不接受外部姿态驱动,直接 resolve 空 Promise。
210
+ * 与 `VRPanoramaController.updateCamera` 同构。
211
+ *
212
+ * @param pose - 目标姿态(忽略)
213
+ * @param duration - 动画时长(忽略)
214
+ * @param userAction - 是否用户操作(忽略)
215
+ */
216
+ updateCamera(pose: Partial<Pose>, duration: number, userAction: boolean): Promise<void>;
217
+ /**
218
+ * 通过帧动画转动摄像头(任务 8.6,姿态旁路)。
219
+ *
220
+ * XR 下相机朝向由头显决定,不接受外部关键帧驱动,直接 resolve 空 Promise。
221
+ * 与 `VRPanoramaController.updateCameraWithKeyframes` 同构。
222
+ *
223
+ * @param keyframes - 关键帧列表(忽略)
224
+ * @param duration - 动画时长(忽略)
225
+ * @param userAction - 是否用户操作(忽略)
226
+ */
227
+ updateCameraWithKeyframes(keyframes: {
228
+ progress: number;
229
+ value: Pose;
230
+ key?: string;
231
+ }[], duration: number, userAction: boolean): Promise<void>;
232
+ /**
233
+ * 同步修改相机参数(任务 8.6,姿态旁路)。
234
+ *
235
+ * **只应用站点位置,忽略朝向 / fov / distance。**
236
+ * 父类 `PanoramaController.updateTime` 在 `locationMotion` 运行时算出站点位置
237
+ * `cameraPose.offset`,并且只通过 `setCamera` 应用到相机;若这里是空实现,
238
+ * 切换全景图时 `camera.position` 永远不更新,眼相机停在旧站点,而全景球贴图已切到新点位,
239
+ * 渲染就会错位。因此这里把 `offset` 写入 `camera.position`。
240
+ *
241
+ * 其余字段一律忽略:
242
+ * - `longitude` / `latitude`:朝向由头显决定,由 {@link syncCameraFromXR} 单向反写,
243
+ * 写入会与头显朝向打架;
244
+ * - `fov`:视场角由头显的各眼投影矩阵决定;
245
+ * - `distance`:XR 下相机不后退(后退会使眼相机偏离站点、与头部真实位置不符),故忽略。
246
+ *
247
+ * 写入位置后,用现有四元数 / 缩放 compose 本地矩阵并 `computePose`,
248
+ * 让 `camera.pose` 与 `camera.position` 保持一致(`camera.zoom` 只读,不写)。
249
+ *
250
+ * @param cameraPose - 相机姿态(仅使用 `offset`)
251
+ */
252
+ protected setCamera(cameraPose?: Partial<CameraPose>): void;
253
+ /**
254
+ * 生命周期:更新屏幕渲染尺寸(任务 8.6,姿态旁路)。
255
+ *
256
+ * XR presenting 期间 `setSize` / `setPixelRatio` 是 no-op(尺寸由 three 的
257
+ * XRManager 管,见风险 R5),这里只标记需要重渲染。
258
+ * 与 `VRPanoramaController.updateRenderSize` 同构。
259
+ */
260
+ updateRenderSize(): void;
261
+ /**
262
+ * 是否准备好(任务 8.6,姿态旁路)。
263
+ *
264
+ * XR 期间始终视为用户操作中,返回 `false`。
265
+ * 与 `VRPanoramaController.isReady` 同构。
266
+ */
267
+ isReady(): boolean;
268
+ /**
269
+ * 新建一个用于拾取的 `Raycaster`,并设置与 `VRPanoramaController.intersect` 一致的参数。
270
+ *
271
+ * @description
272
+ * `params.Points.threshold = 0.1`、`firstHitOnly = true`、`floorIndex = -1`。
273
+ * 这些参数在构造期设一次,之后每帧只 {@link XRManager.fillRaycaster}
274
+ * 复用填充 origin / direction,不会被覆盖。
275
+ */
276
+ protected createPickingRaycaster(): THREE.Raycaster;
277
+ /**
278
+ * 每帧填充手柄射线,采样按键并派发 `xr.controller.update` 与按键手势(`updateTime` 的第 ③ 步)。
279
+ *
280
+ * @description
281
+ * 1. 重置本帧 {@link controllerRayFilled} 与 {@link walkSources};`inputSources` 为空时直接返回。
282
+ * 2. 遍历输入源,按对象区分左右手(`handedness` 为 `'none'` 归右手),用
283
+ * {@link XRManager.fillRaycaster} 填充复用的 {@link controllerRaycasters};只有它返回 `true`
284
+ * (本帧 pose 有效)才把该手标记为已填充。
285
+ * 3. 按 Device_Profile 读 axes / buttons;对每个已映射的按键调用
286
+ * {@link ButtonStateMachine.sample},按返回事件的顺序派发 `xr.gesture.*`。
287
+ * 4. 派发一次 `xr.controller.update`。
288
+ * 5. 处理 trigger tap 走点(先右后左,同一帧最多一次,见 {@link walkByTap})。
289
+ *
290
+ * @param inputSources - 当前 session 的输入源
291
+ * @param time - 当前帧时间戳
292
+ * @param deltaTime - 距上一帧的时间增量
293
+ */
294
+ protected updateControllerHelper(inputSources: ArrayLike<XRInputSource>, time: number, deltaTime: number): void;
295
+ /**
296
+ * 按 Device_Profile 生成某只手的按键映射。
297
+ *
298
+ * @description
299
+ * trigger → `LeftTrigger` / `RightTrigger`;primary → `X` / `A`;secondary → `Y` / `B`;
300
+ * pinch → `LeftPinch` / `RightPinch`。下标为 `null`(该设备不映射)的项直接略过,
301
+ * 等价于「始终松开」。
302
+ */
303
+ private createButtonMap;
304
+ /**
305
+ * 派发状态机产出的一个按键事件为 `xr.gesture.*`。
306
+ *
307
+ * @description
308
+ * `isFirst` / `isFinal` 沿用原语义:`buttonDown` 为首次、`buttonUp` 为末次、`tap` 两者皆是、
309
+ * `press` 两者皆非。`LeftTrigger` / `RightTrigger` 的 `tap` 且未被业务 `preventDefault` 时,
310
+ * 记录到 {@link walkSources},由 {@link walkByTap} 在本帧采样结束后统一走点。
311
+ */
312
+ protected dispatchButtonEvent(buttonEvent: ButtonEvent): void;
313
+ /**
314
+ * trigger tap 走点:顺序为先 `RightTrigger` 后 `LeftTrigger`,同一帧最多走点一次。
315
+ *
316
+ * @description
317
+ * 只有该输入源本帧射线已被填充({@link XRManager.fillRaycaster} 返回 `true`)才走点;
318
+ * 走点后清零驻留状态。press 与其它按键不走点。
319
+ */
320
+ protected walkByTap(): void;
321
+ private tryWalk;
322
+ /**
323
+ * 会话结束前重置按键状态:仍按下中的键只补发 `buttonUp`(不派发 tap / press),并清空状态。
324
+ * 由 `XRManager` 的 `onSessionEnding` 回调调用。
325
+ */
326
+ protected resetButtonStates(): void;
327
+ /**
328
+ * 按 Device_Profile 的 `axes.x` / `axes.y` 从 `gamepad.axes` 读摇杆方向,
329
+ * 写入传入的 axes 对象。下标为 `null` / 越界 / gamepad 为空时按 0 处理(保持默认 0)。
330
+ *
331
+ * @param gamepad - 输入源的 gamepad(可能为 `null`)
332
+ * @param out - 待写入的 axes 对象
333
+ */
334
+ protected readAxes(gamepad: Gamepad | null | undefined, out: {
335
+ up: number;
336
+ down: number;
337
+ left: number;
338
+ right: number;
339
+ }): void;
340
+ /** 惰性创建手柄模型工厂(`gltfLoader` 桥接到 five 的 fetcher)。 */
341
+ private getControllerModelFactory;
342
+ /**
343
+ * 让某个输入源上的手柄模型 / pointer ray 与当前开关、设备能力保持一致(按需创建或移除)。
344
+ *
345
+ * @description
346
+ * - 模型:仅 `tracked-pointer` 且 gamepad / gripSpace 均非空、`showControllerModel` 为真、
347
+ * `profile.model !== 'none'` 时存在,挂在 tracker 条目的 `grip` 下。
348
+ * - pointer ray:仅 `tracked-pointer` 且 `showPointerRay` 为真时存在,挂在 `targetRay` 下。
349
+ * - 该输入源已不在 tracker 里时直接忽略。
350
+ */
351
+ protected syncInputVisual(source: XRInputSource): void;
352
+ /**
353
+ * 按本帧拾取结果更新 pointer ray 的长度(需求 7.6)。
354
+ *
355
+ * @description
356
+ * - 被用于拾取的那只手(`raycaster` 与该输入源对应手的复用 `Raycaster` 是同一个实例):
357
+ * 命中时长度取「射线起点到命中点的距离」与 {@link POINTER_RAY_LENGTH} 的较小值,
358
+ * 使射线远端落在命中点上,与焦点环 `intersectMesh` 的中心重合;
359
+ * - 其余输入源,以及本帧没有命中 / 没有拾取射线(`raycaster` 或 `point` 为 `null`):恢复为 {@link POINTER_RAY_LENGTH}。
360
+ *
361
+ * 射线节点挂在 target ray 下,XR 到世界的变换是纯平移(无旋转无缩放),
362
+ * 所以局部 -Z 方向的长度等于世界距离。
363
+ *
364
+ * @param raycaster - 本帧用于拾取的射线,没有时传 `null`
365
+ * @param point - 命中点(世界坐标),未命中时传 `null`
366
+ */
367
+ protected updatePointerRayLength(raycaster: THREE.Raycaster | null, point: THREE.Vector3 | null): void;
368
+ /** 输入源被移除:摘掉其模型 / ray 并释放 ray 的几何 / 材质,删除 Map 条目。 */
369
+ protected removeInputVisual(source: XRInputSource): void;
370
+ /** 清理全部输入源的模型 / ray(会话结束、析构时调用)。 */
371
+ protected clearInputVisuals(): void;
372
+ private disposeRay;
373
+ /**
374
+ * 构造并派发一个 {@link XRGestureEvent}({@link dispatchButtonEvent} 的内部辅助)。
375
+ *
376
+ * @param type - 事件名(`xr.gesture.*`)
377
+ * @param button - 触发的按键名
378
+ * @param isFirst - 是否为手势序列的首次
379
+ * @param isFinal - 是否为手势序列的末次
380
+ * @returns 派发出去的事件对象,调用方可据其 `defaultPrevented` 决定是否执行默认行为
381
+ */
382
+ protected emitGesture(type: 'xr.gesture.tap' | 'xr.gesture.press' | 'xr.gesture.buttonUp' | 'xr.gesture.buttonDown', button: XRGestureEvent['buttons'], isFirst: boolean, isFinal: boolean): XRGestureEvent;
383
+ /**
384
+ * 注视 / 手势射线:当设备提供 hand tracking,或输入源 `targetRayMode` 为
385
+ * `gaze` / `transient-pointer`(如 Apple Vision Pro)时,用它作为拾取源。
386
+ *
387
+ * @description
388
+ * 判定走能力检测,不看 `machineType`(UA 只用来挑模型)。命中输入源后用
389
+ * {@link XRManager.fillRaycaster} 填充复用的射线并赋给 {@link gazeRaycaster};
390
+ * 没有命中的输入源,或本帧该输入源 pose 无效时置回 `null`,让拾取回落到手柄射线
391
+ * (不保留陈旧射线)。
392
+ */
393
+ protected updateGazeRay(): void;
394
+ /**
395
+ * session `select` 回调(捏合 / 注视选点)。
396
+ *
397
+ * 只有 `targetRayMode` 为 `gaze` 或 `transient-pointer` 的输入源走点(这类设备没有扳机);
398
+ * 射线取该输入源本帧已填充的 target ray,未填充则不选点。
399
+ *
400
+ * @param source - 触发 `select` 的输入源
401
+ */
402
+ protected onXRSelect(source: XRInputSource): void;
403
+ /**
404
+ * 选取本帧用于拾取的射线源(任务 8.9)。
405
+ *
406
+ * ## 优先级
407
+ *
408
+ * 1. **注视 / 手势射线**({@link gazeRaycaster}):非 `null` 时优先。
409
+ * `gazeRaycaster` 仅在 {@link updateGazeRay} 判定「设备提供 hand tracking 或
410
+ * `targetRayMode === 'transient-pointer'`」时才被填充(如 Apple Vision Pro 的
411
+ * 捏合注视交互),否则保持 `null`。因此它非空即代表「本设备这一帧应走注视拾取」,
412
+ * 对应需求 8.8「设备提供 hand tracking 或 transient-pointer 时用注视 / 手势射线作为拾取源」。
413
+ * 2. **手柄射线**:无注视射线时回落到手柄。右手为主手(参照原始 five 的习惯),
414
+ * 故**优先右手** {@link controllerRaycasters.right},其次左手。但要确认该手本帧确有
415
+ * 输入源 —— {@link controllerRaycasters} 是复用实例,若某手本帧未连接,其内容是上一帧的
416
+ * 陈旧值,不能据此拾取。所以这里按 `session.inputSources` 的 `handedness` 判定哪只手在场。
417
+ * 3. 两手都不在场且无注视射线:返回 `null`(本帧无可用拾取源)。
418
+ *
419
+ * @returns 本帧应使用的 `Raycaster`,无可用射线源时为 `null`。
420
+ */
421
+ protected pickPickingRaycaster(): THREE.Raycaster | null;
422
+ /**
423
+ * 计算射线碰撞并刷新点位选中态 / 驻留走点(任务 8.9)。
424
+ *
425
+ * ## 与 `VRPanoramaController.intersect` 的关系
426
+ *
427
+ * 结构与点位判定、驻留走点逻辑完全照搬 `VRPanoramaController.intersect`
428
+ * (见 `controllers/vrPanorama.ts`),差异只有一处 —— **射线源**:
429
+ *
430
+ * - `VRPanorama` 的射线源是**注视方向**(相机朝向):
431
+ * `new THREE.Raycaster(this.camera.position, this.camera.getDirection(...))`。
432
+ * - `XRPanorama` 的射线源换成 {@link pickPickingRaycaster} 选出的**手柄射线(优先)
433
+ * 或注视 / 手势射线**。这些 `Raycaster` 已由 {@link updateControllerHelper} /
434
+ * {@link updateGazeRay} 在本帧填充好 origin / direction 与拾取参数
435
+ * (`params.Points` / `firstHitOnly` / `floorIndex`,见 {@link createPickingRaycaster}),
436
+ * 这里**直接复用,不新建 `Raycaster`、不重设 params**(对应需求 8.6)。
437
+ *
438
+ * 其余(locationMotion 守卫、驻留走点、对 `accessibleNodes` 的 panoMesh 求交、取最近、
439
+ * 焦点环 {@link intersectMesh} 的位置 / 朝向、`intersect.update` 派发、模型求交兜底)
440
+ * 与 VR 版逐行同构。
441
+ *
442
+ * ## 无射线源时的降级
443
+ *
444
+ * {@link pickPickingRaycaster} 返回 `null`(本帧两手都不在场且无注视射线)时,
445
+ * 隐藏焦点环、清空驻留状态并返回 `undefined`,不做求交(对应需求 8.9 的「射线不可用时
446
+ * 不拾取」语义)。
447
+ *
448
+ * @param time - 当前帧时间戳
449
+ * @returns 本帧被指向的点位 `panoMesh`,无则 `undefined`。
450
+ */
451
+ protected intersect(time: number): PanoCircleMeshInterface | undefined;
452
+ /**
453
+ * 用一条射线选点并触发走点(扣扳机 / 捏合选点)。
454
+ *
455
+ * ## 为什么要单独实现
456
+ *
457
+ * five-webgpu 的 2D 走点逻辑内联在 `PanoramaController.onTapGesture(event)` 里,
458
+ * 入参是 `GestureEvent`(要 `event.center.raycaster` / `event.state` / `event.userAction`,
459
+ * 还要往回写 `event.state` 再派发 `gesture.tap`)。XR 没有 `GestureEvent`,
460
+ * 射线来自手柄 / 捏合,硬套会得到一个半真半假的事件对象。
461
+ *
462
+ * 原始 five 的 XR 控制器同样是单独实现了一个 `checkSelectedPano(raycaster)`
463
+ * (`xrPanorama.ts:984`),本方法照它移植,只把 API 换成 five-webgpu 的。
464
+ * 相比重构父类那 200 行 `onTapGesture`,这样对 2D 路径零风险。
465
+ *
466
+ * ## 选点策略(与原始 five 同构)
467
+ *
468
+ * 1. 先把「可到达点位」过滤出来:排除当前点位、排除超过 `maxAccessibleDistance` 的、
469
+ * 排除既不可加载也未激活的。
470
+ * 2. 射线与**模型**求交,拿到地面落点;在可到达点位里找离落点最近的,距离小于
471
+ * `panoTapTriggerRadius` 则选中它(=「指着地板上的点位圈走过去」)。
472
+ * 3. 没命中则退化为「沿射线方向找前方点位」({@link getForwardObserverOrNot})。
473
+ * 这里传 `xrManager.eyeCameras[0]` 而不是 five 的 `camera`:该方法要把点位投影到屏幕空间
474
+ * 比较距离,必须用**头显实际的投影矩阵**(单眼 Eye_Camera 的 view 投影),
475
+ * 用 five 那个 2D 相机(fov 90 / 画布宽高比)
476
+ * 会和头显里看到的范围不符。
477
+ * 4. 已在本次位移动画目标里的点位不重复选(避免连点抖动)。
478
+ * 5. 没选中:不在动画中时播一下 {@link cameraBounce} 回弹反馈。
479
+ *
480
+ * ## 为什么不直接调 `moveToPano`
481
+ *
482
+ * 走点要走 five 的既有事件链:派发 `pano.select` → `pano.request`,由
483
+ * `five.ts` 的 `controller.on("pano.request")` 统一调 `five.moveToPano`
484
+ * (见 `five.ts:2801-2806`)。这样业务侧 `preventDefault` 拦截、以及 five 层面的
485
+ * state 同步都和 2D 路径一致。直接调 `moveToPano` 会绕过这条链。
486
+ *
487
+ * @param raycaster - 选点射线(手柄射线或注视 / 捏合射线)
488
+ */
489
+ protected checkSelectedPano(raycaster: THREE.Raycaster): void;
490
+ /**
491
+ * 析构。
492
+ *
493
+ * @description
494
+ * 先 `super.destroy()` 回收全景业务侧资源,再清理 XR 资源(与 `VRPanoramaController` 同构)。
495
+ * `xrManager.dispose()` 幂等:已进入时同步归还(移除会话监听、释放 XR layer 与帧源)并尝试
496
+ * `session.end()`;归还过程中会回调 `onSessionEnding` / `onSessionEnd`。随后把手柄根节点
497
+ * `inputs.root` 从场景移除(其下的手柄节点已在归还时被 `inputs.clear()` 清掉)。
498
+ */
499
+ destroy(): void;
500
+ protected onPanGesture(): void;
501
+ protected onTapGesture(): void;
502
+ protected onPinchGesture(): void;
503
+ protected onMouseMove(): void;
504
+ protected onMouseOut(): void;
505
+ }
506
+ export { XRPanoramaController, XRPanoramaControllerCustomInitArgs, XRPanoramaControllerInitArgs, defaultXRPanoramaControllerCustomInitArgs, };
@@ -9,12 +9,18 @@ declare class InternalWebGPURenderer extends THREE.WebGPURenderer {
9
9
  * 上层可通过该回调感知并尝试恢复(重新配置 canvas、触发重渲染)。
10
10
  */
11
11
  onDeviceLostCallback?: (info: unknown) => void;
12
- constructor({ antialias, logarithmicDepthBuffer, outputType, }: {
12
+ readonly forceWebGL: boolean;
13
+ constructor({ antialias, logarithmicDepthBuffer, outputType, forceWebGL, }: {
13
14
  antialias?: boolean;
14
15
  logarithmicDepthBuffer?: boolean;
15
16
  outputType?: OutputTextureDataType | undefined;
17
+ forceWebGL?: boolean;
16
18
  });
17
19
  get isInitialized(): boolean;
20
+ /**
21
+ * XR(WebXR)是否可用。
22
+ */
23
+ get isXRCapable(): boolean;
18
24
  /**
19
25
  * 强制让 WebGPU backend 重新配置 canvas 上下文。
20
26
  *
@@ -8,8 +8,11 @@ interface PanoVideoProps {
8
8
  }
9
9
  declare class PanoVideo {
10
10
  private material;
11
- object: THREE.Mesh<THREE.BufferGeometry, THREE.ShaderMaterial>;
11
+ object: THREE.Mesh<THREE.BufferGeometry, THREE.NodeMaterial>;
12
12
  private alphaMotion;
13
+ private u;
14
+ /** 是否已设置视频材质(等价于原来的 USE_PANO_VIDEO 宏状态) */
15
+ private active;
13
16
  constructor();
14
17
  setMaterial(value: PanoVideoProps | null): void;
15
18
  updateTime(time: number): void;
@@ -1,6 +1,7 @@
1
1
  import * as THREE from "three/webgpu";
2
2
  import { WorkObserver } from "../work";
3
3
  import { ImageOptions } from "../types/imageOptions";
4
+ import type { PBMPanoGainmap } from "../model";
4
5
  export interface TilingFrameState {
5
6
  time: number;
6
7
  resolution: THREE.Vector2;
@@ -9,25 +10,24 @@ export interface TilingFrameState {
9
10
  cameraMatrix: THREE.Matrix4;
10
11
  cameraProjectionMatrix: THREE.Matrix4;
11
12
  panoMap: THREE.CubeTexture | null;
12
- gainMap?: THREE.CubeTexture;
13
+ /**
14
+ * 该 pano 的 gainmap(cube 贴图 + 配置),无 HDR 时不存在
15
+ * @description 复用 `PBMPanoGainmap` 类型(type-only import,不产生运行时依赖)
16
+ */
17
+ panoGainmap?: PBMPanoGainmap;
13
18
  panoMatrix: THREE.Matrix4;
14
19
  panoZoom: number;
15
20
  minLevel: number;
16
21
  level: number;
17
- /** HDR:是否启用,以及该 pano 的 gainmap 配置 + 显示增益 */
22
+ /** HDR:是否启用,以及显示增益 */
18
23
  useHDR?: boolean;
19
24
  maxDisplayBoost?: number;
20
- hdrConfig?: {
21
- gamma?: number;
22
- minContentBoost?: number;
23
- maxContentBoost?: number;
24
- hdrCapacityMin?: number;
25
- hdrCapacityMax?: number;
26
- };
27
25
  }
28
26
  export declare class Tiling {
29
27
  private disposed;
30
28
  fiveId: string;
29
+ /** 是否开启 HDR 支持,详见 {@link FiveInitArgs.enableHDR} */
30
+ enableHDR: boolean;
31
31
  level: number;
32
32
  pedding: number;
33
33
  maxRequest: number;
@@ -52,15 +52,29 @@ export declare class Tiling {
52
52
  private forceRenderWhenNextUpdate;
53
53
  constructor(options: {
54
54
  fiveId: string;
55
+ /**
56
+ * 是否开启 HDR 支持,详见 {@link FiveInitArgs.enableHDR}
57
+ * @description
58
+ * 决定 `renderTarget` 的纹理类型:开启时使用 `THREE.HalfFloatType` 以承载 HDR 数据,
59
+ * 关闭时使用默认的 `THREE.UnsignedByteType`,避免不必要的显存与性能开销。
60
+ * @default `false`
61
+ */
62
+ enableHDR?: boolean;
55
63
  });
56
64
  dispose(): void;
57
65
  /** 从池取用一个 TileMaterial,池空则新建 */
58
66
  private acquireTileMaterial;
59
67
  /** 归还 TileMaterial 到池:清空纹理引用并重置状态;超出上限或已销毁则直接 dispose */
60
68
  private releaseTileMaterial;
61
- /** 从纹理池取一个同尺寸 THREE.Texture,池空则新建。复用可保留其 GPUTexture,后续 setImage+needsUpdate 会原地重传(同 video texture 机制)。 */
69
+ /**
70
+ * 从纹理池取一个同尺寸、同色彩空间的 THREE.Texture,池空则新建。
71
+ * 复用可保留其 GPUTexture,后续 setImage+needsUpdate 会原地重传(同 video texture 机制)。
72
+ * @description 必须带上 colorSpace 分桶:GPU 纹理格式在首次创建时按 colorSpace 决定
73
+ * (sRGB 会创建 rgba8unorm-srgb 做硬件解码),之后只重传像素、不会重建格式。
74
+ * 色图(sRGB)与 gainmap(NoColorSpace)若共用同一张池化纹理,格式会被串用而渲染错误。
75
+ */
62
76
  private acquireTileTexture;
63
- /** 归还瓦片纹理到池(按尺寸分桶);超出上限或已销毁或尺寸未知则直接 dispose。 */
77
+ /** 归还瓦片纹理到池(按尺寸 + 色彩空间分桶);超出上限或已销毁或尺寸未知则直接 dispose。 */
64
78
  private releaseTileTexture;
65
79
  /**
66
80
  * 把 loadTexture 产出的“一次性纹理”的图像搬进池化纹理并复用其 GPUTexture。
@@ -0,0 +1,25 @@
1
+ /**
2
+ * 修复 WebXR 沉浸式会话期间 WebGL 后端异步回读(readRenderTargetPixelsAsync 等)永不 resolve 的问题。
3
+ *
4
+ * 根因:
5
+ * three r183 `src/renderers/webgl-fallback/utils/WebGLUtils.js`(约 273-310 行)的
6
+ * `_clientWaitAsync()` 在 `gl.clientWaitSync` 返回 `TIMEOUT_EXPIRED` 时,
7
+ * 使用 `window.requestAnimationFrame(test)` 继续轮询。
8
+ * 沉浸式 XR 会话期间 `window.requestAnimationFrame` 不会触发(帧由 `XRSession.requestAnimationFrame` 驱动),
9
+ * 导致该 Promise 永不 resolve;
10
+ * `WebGLTextureUtils.copyTextureToBuffer` → `readRenderTargetPixelsAsync` 随之挂死,
11
+ * 进而 `PanoramaController.moveToPano` 里 `await getRgbaDataFromCubeTexture(...)` 永不返回,点位无法真正移动。
12
+ *
13
+ * 修复:实例级替换 `backend.utils._clientWaitAsync`,逻辑与 three 原版逐行一致,
14
+ * 唯一区别是轮询用 `setTimeout(test, 0)` 代替 `requestAnimationFrame`——setTimeout 在 XR 会话中仍然工作。
15
+ *
16
+ * 非 XR 设备、WebGPU 后端下均为空操作。
17
+ */
18
+ /**
19
+ * 仅当设备被识别为 XR 头显(Pico / Oculus / Vision Pro)、后端为 WebGL 且存在
20
+ * `utils._clientWaitAsync` 时,安装实例级补丁;其余情况什么都不做。
21
+ * @param backend `renderer.backend`,需在 `init()` 完成之后传入
22
+ * @returns 是否实际安装了补丁
23
+ */
24
+ declare function installWebGLAsyncReadFix(backend: unknown): boolean;
25
+ export { installWebGLAsyncReadFix };