@realsee/five 6.9.0-alpha.0 → 6.9.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.
Files changed (266) hide show
  1. package/ai_guides/3dgs-current-branch-changes.md +237 -0
  2. package/docs/assets/hierarchy.js +1 -1
  3. package/docs/assets/highlight.css +18 -18
  4. package/docs/assets/navigation.js +1 -1
  5. package/docs/assets/search.js +1 -1
  6. package/docs/classes/five.AdaptiveLuminancePass.html +1 -1
  7. package/docs/classes/five.BoundingMesh.html +1 -1
  8. package/docs/classes/five.Camera.html +1 -1
  9. package/docs/classes/five.EyeDomeLightingPass.html +1 -1
  10. package/docs/classes/five.Five.html +4 -4
  11. package/docs/classes/five.FivePass.html +1 -1
  12. package/docs/classes/five.FlowingFireworks3DPass.html +30 -0
  13. package/docs/classes/five.FlowingLight2DPass.html +1 -1
  14. package/docs/classes/five.FlowingLight3DPass.html +1 -1
  15. package/docs/classes/five.GaussianBlurPass.html +1 -1
  16. package/docs/classes/five.InternalWebGLRenderer.html +1 -1
  17. package/docs/classes/five.Model.html +2 -2
  18. package/docs/classes/five.ModelScene.html +1 -1
  19. package/docs/classes/five.NetworkSubscribe.html +2 -2
  20. package/docs/classes/five.PBMContainer.html +1 -1
  21. package/docs/classes/five.PBMCustomShader.html +2 -2
  22. package/docs/classes/five.PBMGSObject.html +7 -7
  23. package/docs/classes/five.PBMGroup.html +1 -1
  24. package/docs/classes/five.PBMMesh.html +1 -1
  25. package/docs/classes/five.PBMMeshMaterial.html +1 -1
  26. package/docs/classes/five.PBMPanoFilter.html +2 -2
  27. package/docs/classes/five.PBMPointCloud.html +1 -1
  28. package/docs/classes/five.PBMPointCloudMaterial.html +1 -1
  29. package/docs/classes/five.PBMSkinnedMesh.html +1 -1
  30. package/docs/classes/five.PBMUpdateable.html +2 -2
  31. package/docs/classes/five.PanoCircleMesh.html +1 -1
  32. package/docs/classes/five.PanoCircleMeshCustom.html +1 -1
  33. package/docs/classes/five.PanoCircleMeshSolid.html +1 -1
  34. package/docs/classes/five.Parameter.html +1 -1
  35. package/docs/classes/five.Scene.html +1 -1
  36. package/docs/classes/five.Subscribe.html +2 -2
  37. package/docs/classes/five.Tile3D.html +1 -1
  38. package/docs/classes/five.TileNode.html +1 -1
  39. package/docs/classes/five.TrajectoryNode.html +1 -1
  40. package/docs/classes/five.WorkResolvedObserver.html +2 -2
  41. package/docs/classes/gltf-loader.DDSLoader.html +1 -1
  42. package/docs/classes/gltf-loader.DRACOLoader.html +1 -1
  43. package/docs/classes/gltf-loader.GLTFLoader.html +2 -2
  44. package/docs/classes/gltf-loader.GLTFObject.html +1 -1
  45. package/docs/classes/gltf-loader.THREEGLTFLoader.html +1 -1
  46. package/docs/classes/line.Line.html +1 -1
  47. package/docs/classes/line.LineGeometry.html +1 -1
  48. package/docs/classes/line.LineMaterial.html +1 -1
  49. package/docs/classes/line.LineSegmentsGeometry.html +1 -1
  50. package/docs/classes/line.THREE_Line2.html +1 -1
  51. package/docs/classes/line.THREE_LineSegments2.html +1 -1
  52. package/docs/classes/plugins.BasePlugin.Controller.html +1 -1
  53. package/docs/classes/plugins.CSS2DObject.html +1 -1
  54. package/docs/classes/plugins.CSS3DObject.html +1 -1
  55. package/docs/classes/plugins.CSS3DSprite.html +1 -1
  56. package/docs/classes/plugins.InstancedPrefabBufferGeometry.html +1 -1
  57. package/docs/classes/plugins.Object3DHelperController.html +1 -1
  58. package/docs/classes/plugins.PointBufferGeometry.html +1 -1
  59. package/docs/classes/plugins.PrefabBufferGeometry.html +1 -1
  60. package/docs/classes/plugins.RoundedBoxGeometry.html +1 -1
  61. package/docs/classes/react.Store.html +1 -1
  62. package/docs/classes/sticker.Sticker.html +2 -2
  63. package/docs/classes/vfx.Airflow.html +1 -1
  64. package/docs/classes/vfx.Flame.html +1 -1
  65. package/docs/classes/vfx.Particle.html +1 -1
  66. package/docs/classes/vfx.ParticleGPU.html +1 -1
  67. package/docs/classes/vfx.SpotLight.html +1 -1
  68. package/docs/documents/3dgs-current-branch-changes.html +205 -0
  69. package/docs/documents/api.html +6 -6
  70. package/docs/documents/features_3dtile.html +4 -4
  71. package/docs/documents/features_camera-animation.html +10 -10
  72. package/docs/documents/features_clipper.html +3 -3
  73. package/docs/documents/features_coordinate-system.html +3 -3
  74. package/docs/documents/features_event.html +10 -10
  75. package/docs/documents/features_five.html +4 -4
  76. package/docs/documents/features_flowing-fireworks-3d-pass.html +7 -7
  77. package/docs/documents/features_flowing-light-2d-pass.html +11 -11
  78. package/docs/documents/features_flowing-light-3d-pass.html +11 -11
  79. package/docs/documents/features_gaussian-blur-pass.html +6 -6
  80. package/docs/documents/features_gesture.html +6 -6
  81. package/docs/documents/features_get-screen-pixels.html +4 -4
  82. package/docs/documents/features_image-options.html +5 -5
  83. package/docs/documents/features_load-external-model.html +8 -8
  84. package/docs/documents/features_load-progress.html +7 -7
  85. package/docs/documents/features_material.html +3 -3
  86. package/docs/documents/features_mode.html +11 -11
  87. package/docs/documents/features_model.html +4 -4
  88. package/docs/documents/features_move-pano-effect.html +5 -5
  89. package/docs/documents/features_multi-work.html +5 -5
  90. package/docs/documents/features_pano-filter.html +3 -3
  91. package/docs/documents/features_pano-tile.html +4 -4
  92. package/docs/documents/features_pano-uv.html +4 -4
  93. package/docs/documents/features_parameter.html +7 -7
  94. package/docs/documents/features_plugin.html +4 -4
  95. package/docs/documents/features_postprocessing.html +5 -5
  96. package/docs/documents/features_raycast.html +4 -4
  97. package/docs/documents/features_request-proxy.html +4 -4
  98. package/docs/documents/features_screen-project.html +3 -3
  99. package/docs/documents/features_state.html +4 -4
  100. package/docs/documents/features_view-layer.html +4 -4
  101. package/docs/documents/features_work.html +5 -5
  102. package/docs/documents/quick-start.html +2 -2
  103. package/docs/documents/release_notes_6.6.html +4 -4
  104. package/docs/documents/release_notes_6.7.html +14 -14
  105. package/docs/documents/release_notes_6.8.html +4 -4
  106. package/docs/functions/react.useFiveAction.html +6 -6
  107. package/docs/functions/react.useFiveCurrentObserver.html +1 -1
  108. package/docs/functions/react.useFiveCurrentState.html +1 -1
  109. package/docs/functions/react.useFiveEventCallback.html +1 -1
  110. package/docs/functions/react.useFiveFloor.html +1 -1
  111. package/docs/functions/react.useFiveHelper.html +1 -1
  112. package/docs/functions/react.useFiveModelIntersectRaycaster.html +2 -2
  113. package/docs/functions/react.useFiveProject2d.html +2 -2
  114. package/docs/functions/react.useFiveSceneEffect.html +1 -1
  115. package/docs/functions/react.useFiveWork.html +2 -2
  116. package/docs/functions/vue.useFiveAction.html +8 -8
  117. package/docs/functions/vue.useFiveCurrentObserver.html +1 -1
  118. package/docs/functions/vue.useFiveCurrentState.html +1 -1
  119. package/docs/functions/vue.useFiveEventCallback.html +1 -1
  120. package/docs/functions/vue.useFiveFloor.html +1 -1
  121. package/docs/functions/vue.useFiveHelper.html +1 -1
  122. package/docs/functions/vue.useFiveModelIntersectRaycaster.html +2 -2
  123. package/docs/functions/vue.useFiveProject2d.html +2 -2
  124. package/docs/functions/vue.useFiveState.html +1 -1
  125. package/docs/functions/vue.useFiveWorks.html +2 -2
  126. package/docs/hierarchy.html +1 -1
  127. package/docs/interfaces/five.AddableObject.html +1 -1
  128. package/docs/interfaces/five.AjaxOptions.html +1 -1
  129. package/docs/interfaces/five.BaseEvent.html +1 -1
  130. package/docs/interfaces/five.BaseExtendableEvent.html +1 -1
  131. package/docs/interfaces/five.EventCallback.html +1 -1
  132. package/docs/interfaces/five.FiveInitArgs.html +2 -2
  133. package/docs/interfaces/five.GestureEvent.html +1 -1
  134. package/docs/interfaces/five.ImageOptions.html +1 -1
  135. package/docs/interfaces/five.IntersectEvent.html +1 -1
  136. package/docs/interfaces/five.IntersectMesh.html +1 -1
  137. package/docs/interfaces/five.IntersectMeshInterface.html +1 -1
  138. package/docs/interfaces/five.Intersection.html +1 -1
  139. package/docs/interfaces/five.LooseWorkWithExtrinsics.html +1 -1
  140. package/docs/interfaces/five.ModeChangeEvent.html +1 -1
  141. package/docs/interfaces/five.ModelControllerCustomInitArgs.html +1 -1
  142. package/docs/interfaces/five.ModelEvent.html +1 -1
  143. package/docs/interfaces/five.ModelSceneEvent.html +1 -1
  144. package/docs/interfaces/five.ModelTileEvent.html +1 -1
  145. package/docs/interfaces/five.MovePanoOptions.html +1 -1
  146. package/docs/interfaces/five.NetworkAbortError.html +1 -1
  147. package/docs/interfaces/five.NetworkFirbiddenError.html +1 -1
  148. package/docs/interfaces/five.NetworkOptions.html +1 -1
  149. package/docs/interfaces/five.NetworkProxyError.html +1 -1
  150. package/docs/interfaces/five.NetworkResourceEvent.html +1 -1
  151. package/docs/interfaces/five.NetworkResponseError.html +1 -1
  152. package/docs/interfaces/five.NetworkTimeoutError.html +1 -1
  153. package/docs/interfaces/five.ObjectEvent.html +1 -1
  154. package/docs/interfaces/five.PBMMaterial.html +1 -1
  155. package/docs/interfaces/five.PBMMeshMaterialParameters.html +1 -1
  156. package/docs/interfaces/five.PBMPointCloudMaterialParameters.html +1 -1
  157. package/docs/interfaces/five.PanoCircleMeshInterface.html +1 -1
  158. package/docs/interfaces/five.PanoEvent.html +1 -1
  159. package/docs/interfaces/five.PanoPrepareEvent.html +1 -1
  160. package/docs/interfaces/five.PanoTextureEvent.html +1 -1
  161. package/docs/interfaces/five.PanoramaControllerCustomInitArgs.html +1 -1
  162. package/docs/interfaces/five.PanoramaLikeControllerCustomInitArgs.html +1 -1
  163. package/docs/interfaces/five.ParameterMaterialValue.html +1 -1
  164. package/docs/interfaces/five.ParameterTilesetValue.html +1 -1
  165. package/docs/interfaces/five.ParameterValue.html +1 -1
  166. package/docs/interfaces/five.Pose.html +1 -1
  167. package/docs/interfaces/five.RenderEvent.html +1 -1
  168. package/docs/interfaces/five.ResolvedParameterValue.html +1 -1
  169. package/docs/interfaces/five.State.html +1 -1
  170. package/docs/interfaces/five.StateEvent.html +1 -1
  171. package/docs/interfaces/five.TextureOptions.html +1 -1
  172. package/docs/interfaces/five.TopviewControllerCustomInitArgs.html +1 -1
  173. package/docs/interfaces/five.VRPanoramaControllerCustomInitArgs.html +1 -1
  174. package/docs/interfaces/five.ViewLayer.html +1 -1
  175. package/docs/interfaces/five.WorkCubeImage.html +1 -1
  176. package/docs/interfaces/five.WorkImage.html +1 -1
  177. package/docs/interfaces/five.WorkObserver.html +2 -2
  178. package/docs/interfaces/five.WorkObserverProto.html +1 -1
  179. package/docs/interfaces/five.WorkTile.html +1 -1
  180. package/docs/interfaces/five.WorksEvent.html +1 -1
  181. package/docs/interfaces/five.XRControllerEvent.html +1 -1
  182. package/docs/interfaces/five.XRGestureEvent.html +1 -1
  183. package/docs/interfaces/five.XRPanoramaControllerCustomInitArgs.html +1 -1
  184. package/docs/interfaces/five.XRSessionEvent.html +1 -1
  185. package/docs/interfaces/plugins.BackgroundPluginController.html +1 -1
  186. package/docs/interfaces/plugins.BackgroundPluginType.EventMap.html +1 -1
  187. package/docs/interfaces/plugins.BasePlugin.State.html +1 -1
  188. package/docs/interfaces/plugins.CSS2DPluginController.html +1 -1
  189. package/docs/interfaces/plugins.CSS2DPluginType.EventMap.html +1 -1
  190. package/docs/interfaces/plugins.CSS2DPluginType.State.html +1 -1
  191. package/docs/interfaces/plugins.CSS3DPluginController.html +1 -1
  192. package/docs/interfaces/plugins.CSS3DPluginType.EventMap.html +1 -1
  193. package/docs/interfaces/plugins.CSS3DPluginType.State.html +1 -1
  194. package/docs/interfaces/plugins.DynamicPathLinePluginController.html +1 -1
  195. package/docs/interfaces/plugins.DynamicPathLinePluginType.EventMap.html +1 -1
  196. package/docs/interfaces/plugins.DynamicPathLinePluginType.State.html +1 -1
  197. package/docs/interfaces/plugins.GaussianSplattingEntranceAnimationController.html +1 -1
  198. package/docs/interfaces/plugins.GaussianSplattingEntranceAnimationPluginType.EventMap.html +1 -1
  199. package/docs/interfaces/plugins.GaussianSplattingEntranceAnimationPluginType.State.html +1 -1
  200. package/docs/interfaces/plugins.ItemMaskController.html +1 -1
  201. package/docs/interfaces/plugins.ItemMaskPluginType.EventMap.html +1 -1
  202. package/docs/interfaces/plugins.ItemMaskPluginType.State.html +1 -1
  203. package/docs/interfaces/plugins.Object3DHelperPluginType.BaseController.html +1 -1
  204. package/docs/interfaces/plugins.Object3DHelperPluginType.BaseHelper.html +1 -1
  205. package/docs/interfaces/plugins.Object3DHelperPluginType.BoundingBoxController.html +1 -1
  206. package/docs/interfaces/plugins.Object3DHelperPluginType.MoveController.html +1 -1
  207. package/docs/interfaces/plugins.Object3DHelperPluginType.MoveHelperAbstract.html +1 -1
  208. package/docs/interfaces/plugins.Object3DHelperPluginType.RotateController.html +1 -1
  209. package/docs/interfaces/plugins.Object3DHelperPluginType.RotateHelperAbstract.html +1 -1
  210. package/docs/interfaces/plugins.OrientationPluginController.html +1 -1
  211. package/docs/interfaces/plugins.OrientationPluginType.EventMap.html +1 -1
  212. package/docs/interfaces/plugins.OrientationPluginType.State.html +1 -1
  213. package/docs/interfaces/plugins.PanoAnimeController.html +1 -1
  214. package/docs/interfaces/plugins.PanoAnimePluginType.EventMap.html +1 -1
  215. package/docs/interfaces/plugins.PanoAnimePluginType.State.html +1 -1
  216. package/docs/interfaces/plugins.PluginTemplateType.EventMap.html +1 -1
  217. package/docs/interfaces/plugins.PluginTemplateType.State.html +1 -1
  218. package/docs/interfaces/plugins.TrajectoryController.html +1 -1
  219. package/docs/interfaces/react.FiveInjectionTypes.html +2 -2
  220. package/docs/interfaces/react.UseFivePluginOptions.html +1 -1
  221. package/docs/interfaces/react.UseFivePluginOptionsWithCreate.html +1 -1
  222. package/docs/modules/five.html +1 -1
  223. package/docs/modules.html +1 -1
  224. package/docs/types/five.FlowingFireworks3DPassLine.html +16 -0
  225. package/docs/types/five.ParseOptions.html +1 -1
  226. package/docs/types/plugins.BasePlugin.EventMap.html +1 -1
  227. package/docs/variables/react.FiveCanvas.html +1 -1
  228. package/docs/variables/react.useFiveScene.html +1 -1
  229. package/docs/variables/vue.FiveCanvas.html +1 -1
  230. package/docs/variables/vue.FiveProvider.html +1 -1
  231. package/five/index.js +177 -106
  232. package/five/index.mjs +795 -639
  233. package/five/model/objects/pbmGaussianSplattingObject.d.ts +5 -5
  234. package/five/renderer/index.d.ts +1 -1
  235. package/five/renderer/postprocessing/index.d.ts +1 -1
  236. package/five/renderer/postprocessing/passes/flowing-fireworks-3d-pass.d.ts +4 -5
  237. package/gltf-loader/index.js +3 -3
  238. package/gltf-loader/index.mjs +3 -3
  239. package/line/index.js +3 -3
  240. package/line/index.mjs +3 -3
  241. package/package.json +1 -1
  242. package/{pbmGaussianSplattingObject-B2uXNUOB.cjs → pbmGaussianSplattingObject-C6i7CUTu.cjs} +3 -3
  243. package/{pbmGaussianSplattingObject-yJQySQfR.js → pbmGaussianSplattingObject-CaE6q4r-.js} +16 -20
  244. package/plugins/index.js +2 -2
  245. package/plugins/index.mjs +2 -2
  246. package/react/index.js +2 -2
  247. package/react/index.mjs +2 -2
  248. package/shader-lib/index.js +2 -2
  249. package/shader-lib/index.mjs +2 -2
  250. package/sticker/index.js +3 -3
  251. package/sticker/index.mjs +3 -3
  252. package/umd/five-gltf-loader.js +3 -3
  253. package/umd/five-line.js +3 -3
  254. package/umd/five-plugins.js +2 -2
  255. package/umd/five-react.js +2 -2
  256. package/umd/five-shader-lib.js +2 -2
  257. package/umd/five-sticker.js +3 -3
  258. package/umd/five-vfx.js +2 -2
  259. package/umd/five-vue.js +2 -2
  260. package/umd/five.js +151 -80
  261. package/vfx/index.js +2 -2
  262. package/vfx/index.mjs +2 -2
  263. package/vue/index.js +2 -2
  264. package/vue/index.mjs +2 -2
  265. package/work-downloader/index.js +2 -2
  266. package/work-downloader/index.mjs +2 -2
@@ -0,0 +1,205 @@
1
+ <!DOCTYPE html><html class="default" lang="en" data-base="../"><head><meta charset="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>3dgs-current-branch-changes | 如视 Five SDK</title><meta name="description" content="Documentation for 如视 Five SDK"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="../assets/style.css"/><link rel="stylesheet" href="../assets/highlight.css"/><script defer src="../assets/main.js"></script><script async src="../assets/icons.js" id="tsd-icons-script"></script><script async src="../assets/search.js" id="tsd-search-script"></script><script async src="../assets/navigation.js" id="tsd-nav-script"></script><script async src="../assets/hierarchy.js" id="tsd-hierarchy-script"></script></head><body><script>document.documentElement.dataset.theme = localStorage.getItem("tsd-theme") || "os";document.body.style.display="none";setTimeout(() => window.app?app.showPage():document.body.style.removeProperty("display"),500)</script><header class="tsd-page-toolbar"><div class="tsd-toolbar-contents container"><a href="../index.html" class="title">如视 Five SDK</a><div id="tsd-toolbar-links"></div><button id="tsd-search-trigger" class="tsd-widget" aria-label="Search"><svg width="16" height="16" viewBox="0 0 16 16" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-search"></use></svg></button><dialog id="tsd-search" aria-label="Search"><input role="combobox" id="tsd-search-input" aria-controls="tsd-search-results" aria-autocomplete="list" aria-expanded="true" autocapitalize="off" autocomplete="off" placeholder="Search the docs" maxLength="100"/><ul role="listbox" id="tsd-search-results"></ul><div id="tsd-search-status" aria-live="polite" aria-atomic="true"><div>Preparing search index...</div></div></dialog><a href="#" class="tsd-widget menu" id="tsd-toolbar-menu-trigger" data-toggle="menu" aria-label="Menu"><svg width="16" height="16" viewBox="0 0 16 16" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-menu"></use></svg></a></div></header><div class="container container-main"><div class="col-content"><div class="tsd-page-title"><ul class="tsd-breadcrumb" aria-label="Breadcrumb"><li><a href="" aria-current="page">3dgs-current-branch-changes</a></li></ul></div><div class="tsd-panel tsd-typography"><h1 id="当前分支(68x)3dgs-渲染架构总结" class="tsd-anchor-link">当前分支(6.8.x)3DGS 渲染架构总结<a href="#当前分支(68x)3dgs-渲染架构总结" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h1>
2
+ <blockquote>
3
+ <p>本文档记录当前分支 <code>6.8.x</code>(HEAD: 8df53101d)上 3DGS 渲染管线中<strong>协方差、着色器、J 矩阵</strong>的完整实现细节,
4
+ 供切换到 <code>6.x</code> 分支(含 <code>18562e668 3dgs重构</code> 及 aholo tile 局部更新架构)后参考合并。</p>
5
+ </blockquote>
6
+ <hr>
7
+ <h2 id="1-协方差(covariance)计算" class="tsd-anchor-link">1. 协方差(Covariance)计算<a href="#1-协方差(covariance)计算" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h2>
8
+ <h3 id="11-cpuwasm-预计算(-函数)" class="tsd-anchor-link">1.1 CPU/WASM 预计算(<code>data.cpp</code> / <code>_pack</code> 函数)<a href="#11-cpuwasm-预计算(-函数)" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3>
9
+ <p><strong>路径</strong>: <code>lib/five/gaussian-splatting/wasm/data.cpp</code></p>
10
+ <ul>
11
+ <li>输入: <code>positions[N*3]</code>, <code>rotations[N*4]</code> (wxyz), <code>scales[N*3]</code>, <code>colors[N*4]</code></li>
12
+ <li>输出: <code>data[N*4]</code> (RGBA32UI texel per splat)</li>
13
+ </ul>
14
+ <p><strong>协方差计算过程</strong> (<code>computeCov3D</code>):</p>
15
+ <pre><code><span class="hl-3">1.</span><span class="hl-1"> </span><span class="hl-4">归一化四元数</span><span class="hl-1"> (</span><span class="hl-5">w</span><span class="hl-1">, </span><span class="hl-5">x</span><span class="hl-1">, </span><span class="hl-5">y</span><span class="hl-1">, </span><span class="hl-5">z</span><span class="hl-1">)</span><br/><span class="hl-3">2.</span><span class="hl-1"> </span><span class="hl-5">构造旋转矩阵</span><span class="hl-1"> </span><span class="hl-6">R</span><span class="hl-1">(</span><span class="hl-5">Hamilton</span><span class="hl-1"> </span><span class="hl-5">标准</span><span class="hl-1">,</span><span class="hl-5">row</span><span class="hl-1">-</span><span class="hl-5">major</span><span class="hl-1">)</span><br/><span class="hl-3">3.</span><span class="hl-1"> </span><span class="hl-6">M</span><span class="hl-1"> = </span><span class="hl-6">R</span><span class="hl-1"> * </span><span class="hl-4">diag</span><span class="hl-1">(</span><span class="hl-5">sx</span><span class="hl-1">, </span><span class="hl-5">sy</span><span class="hl-1">, </span><span class="hl-5">sz</span><span class="hl-1">)</span><br/><span class="hl-3">4.</span><span class="hl-1"> </span><span class="hl-6">Σ</span><span class="hl-1"> = </span><span class="hl-6">M</span><span class="hl-1"> * </span><span class="hl-6">M</span><span class="hl-1">^</span><span class="hl-6">T</span><span class="hl-1"> → </span><span class="hl-5">对称矩阵</span><span class="hl-1">,6</span><span class="hl-5">个独立分量</span><br/><span class="hl-1"> </span><span class="hl-5">s00</span><span class="hl-1">, </span><span class="hl-5">s01</span><span class="hl-1">, </span><span class="hl-5">s02</span><span class="hl-1">, </span><span class="hl-5">s11</span><span class="hl-1">, </span><span class="hl-5">s12</span><span class="hl-1">, </span><span class="hl-5">s22</span>
16
+ </code><button>Copy</button></pre>
17
+
18
+ <p><strong>Texel 打包格式</strong> (每 splat 1 个 RGBA32UI = 16 bytes):</p>
19
+ <pre><code><span class="hl-5">data</span><span class="hl-1">[</span><span class="hl-3">0</span><span class="hl-1">] = </span><span class="hl-4">packHalf2x16</span><span class="hl-1">(</span><span class="hl-5">s00</span><span class="hl-1">, </span><span class="hl-5">s01</span><span class="hl-1">) </span><span class="hl-7">// cov(0,0) | cov(0,1)</span><br/><span class="hl-5">data</span><span class="hl-1">[</span><span class="hl-3">1</span><span class="hl-1">] = </span><span class="hl-4">packHalf2x16</span><span class="hl-1">(</span><span class="hl-5">s02</span><span class="hl-1">, </span><span class="hl-5">s11</span><span class="hl-1">) </span><span class="hl-7">// cov(0,2) | cov(1,1)</span><br/><span class="hl-5">data</span><span class="hl-1">[</span><span class="hl-3">2</span><span class="hl-1">] = </span><span class="hl-4">packHalf2x16</span><span class="hl-1">(</span><span class="hl-5">s12</span><span class="hl-1">, </span><span class="hl-5">s22</span><span class="hl-1">) </span><span class="hl-7">// cov(1,2) | cov(2,2)</span><br/><span class="hl-5">data</span><span class="hl-1">[</span><span class="hl-3">3</span><span class="hl-1">] = </span><span class="hl-6">R</span><span class="hl-1"> | </span><span class="hl-6">G</span><span class="hl-1">&lt;&lt;</span><span class="hl-3">8</span><span class="hl-1"> | </span><span class="hl-6">B</span><span class="hl-1">&lt;&lt;</span><span class="hl-3">16</span><span class="hl-1"> | </span><span class="hl-6">A</span><span class="hl-1">&lt;&lt;</span><span class="hl-3">24</span><span class="hl-1"> </span><span class="hl-7">// 颜色 RGBA8</span>
20
+ </code><button>Copy</button></pre>
21
+
22
+ <h3 id="12-位置数据(独立纹理)" class="tsd-anchor-link">1.2 位置数据(独立纹理)<a href="#12-位置数据(独立纹理)" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3>
23
+ <p>为规避 fp16 量化导致的直线锯齿,splat 中心用独立的 <code>positionTexture</code>(RGB32F)存储全精度 float32 坐标。</p>
24
+ <ul>
25
+ <li><code>positionData: Float32Array</code> → <code>u_positionTexture</code> (RGB32F)</li>
26
+ <li>寻址: <code>ivec2(splatIndexU &amp; 0x7ff, splatIndexU &gt;&gt; 11)</code>(宽度 2048)</li>
27
+ </ul>
28
+ <hr>
29
+ <h2 id="2-顶点着色器(vertexglsl)" class="tsd-anchor-link">2. 顶点着色器(vertex.glsl)<a href="#2-顶点着色器(vertexglsl)" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h2>
30
+ <p><strong>路径</strong>: <code>lib/five/model/shaders/pbm_gaussian_splatting/vertex.glsl</code></p>
31
+ <h3 id="21-数据读取" class="tsd-anchor-link">2.1 数据读取<a href="#21-数据读取" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3>
32
+ <pre><code class="glsl">// 协方差纹理 (RGBA32UI)
33
+ uvec4 packed = texelFetch(u_texture, ivec2(splatIndexU & 0x7ff, splatIndexU >> 11), 0);
34
+
35
+ // 全精度位置 (RGB32F)
36
+ vec3 splatCenter = texelFetch(u_positionTexture, ivec2(splatIndexU & 0x7ff, splatIndexU >> 11), 0).xyz;
37
+
38
+ // 解包 3D 协方差
39
+ vec2 cov_a = unpackHalf2x16(packed.x); // (s00, s01)
40
+ vec2 cov_b = unpackHalf2x16(packed.y); // (s02, s11)
41
+ vec2 cov_c = unpackHalf2x16(packed.z); // (s12, s22)
42
+
43
+ // 对称矩阵 Vrk (object space)
44
+ mat3 Vrk = mat3(
45
+ cov_a.x, cov_a.y, cov_b.x,
46
+ cov_a.y, cov_b.y, cov_c.x,
47
+ cov_b.x, cov_c.x, cov_c.y
48
+ );
49
+ </code><button type="button">Copy</button></pre>
50
+
51
+ <h3 id="22-j-矩阵(jacobian)计算" class="tsd-anchor-link">2.2 J 矩阵(Jacobian)计算<a href="#22-j-矩阵(jacobian)计算" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3>
52
+ <pre><code class="glsl">vec2 focal = vec2(
53
+ projectionMatrix[0][0] * resolution.x * 0.5,
54
+ projectionMatrix[1][1] * resolution.y * 0.5
55
+ );
56
+
57
+ bool isOrthographic = projectionMatrix[3][3] > 0.7;
58
+ mat3 J;
59
+ if (isOrthographic) {
60
+ J = transpose(mat3(
61
+ focal.x, 0.0, 0.0,
62
+ 0.0, focal.y, 0.0,
63
+ 0.0, 0.0, 0.0
64
+ ));
65
+ } else {
66
+ float s = 1.0 / (viewCenter.z * viewCenter.z);
67
+ J = mat3(
68
+ focal.x / viewCenter.z, 0.0, -(focal.x * viewCenter.x) * s,
69
+ 0.0, focal.y / viewCenter.z, -(focal.y * viewCenter.y) * s,
70
+ 0.0, 0.0, 0.0
71
+ );
72
+ }
73
+ </code><button type="button">Copy</button></pre>
74
+
75
+ <p><strong>注意</strong>: J 矩阵直接构造(非 transpose),因为后续投影公式会配合 W 的 transpose 来完成。</p>
76
+ <h3 id="23-2d-协方差投影(gsplat-renderprogram-一致)" class="tsd-anchor-link">2.3 2D 协方差投影(gsplat RenderProgram 一致)<a href="#23-2d-协方差投影(gsplat-renderprogram-一致)" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3>
77
+ <pre><code class="glsl">mat3 W = transpose(mat3(transformModelViewMatrix));
78
+ mat3 T = W * J;
79
+
80
+ // 3D → 2D 投影: cov2D = T^T * Vrk * T
81
+ mat3 cov2Dm = transpose(T) * Vrk * T;
82
+
83
+ // 低通滤波(防止亚像素 splat 产生混叠)
84
+ cov2Dm[0][0] += kernel2DSize; // kernel2DSize = 0.3
85
+ cov2Dm[1][1] += kernel2DSize;
86
+ </code><button type="button">Copy</button></pre>
87
+
88
+ <h3 id="24-特征值分解-→-椭圆轴" class="tsd-anchor-link">2.4 特征值分解 → 椭圆轴<a href="#24-特征值分解-→-椭圆轴" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3>
89
+ <pre><code class="glsl">float mid = (cov2Dm[0][0] + cov2Dm[1][1]) / 2.0;
90
+ float radius = length(vec2((cov2Dm[0][0] - cov2Dm[1][1]) / 2.0, cov2Dm[0][1]));
91
+ float lambda1 = mid + radius;
92
+ float lambda2 = mid - radius;
93
+
94
+ if (lambda2 < 0.0) return; // 退化情况
95
+
96
+ vec2 diagonalVector = normalize(vec2(cov2Dm[0][1], lambda1 - cov2Dm[0][0]));
97
+ vec2 majorAxis = min(sqrt(8.0 * lambda1), maxScreenSpaceSplatSize) * diagonalVector;
98
+ vec2 minorAxis = min(sqrt(8.0 * lambda2), maxScreenSpaceSplatSize) * vec2(diagonalVector.y, -diagonalVector.x);
99
+ </code><button type="button">Copy</button></pre>
100
+
101
+ <h3 id="25-quad-顶点偏移" class="tsd-anchor-link">2.5 Quad 顶点偏移<a href="#25-quad-顶点偏移" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3>
102
+ <pre><code class="glsl">// quad 顶点为 [-2,2],等价于 gsplat 的 position * axis / viewport
103
+ vec2 basisViewport = vec2(1.0 / resolution.x, 1.0 / resolution.y);
104
+ vec2 ndcOffset = (vPosition.x * majorAxis + vPosition.y * minorAxis) * basisViewport;
105
+ vec4 quadPos = vec4(ndcCenter.xy + ndcOffset, ndcCenter.z, 1.0);
106
+ gl_Position = quadPos;
107
+ </code><button type="button">Copy</button></pre>
108
+
109
+ <hr>
110
+ <h2 id="3-片段着色器(fragmentglsl)" class="tsd-anchor-link">3. 片段着色器(fragment.glsl)<a href="#3-片段着色器(fragmentglsl)" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h2>
111
+ <pre><code class="glsl">// vPosition 为 [-2,2] 的 quad 坐标
112
+ float A = -dot(vPosition, vPosition);
113
+ if (A < -4.0) discard;
114
+
115
+ vec3 color = vColor.rgb;
116
+ float opacity = exp(A) * vColor.a;
117
+ gl_FragColor = vec4(color.rgb, opacity);
118
+ </code><button type="button">Copy</button></pre>
119
+
120
+ <p>与 gsplat RenderProgram 完全一致:高斯衰减 <code>exp(-r²)</code>,<code>r² &gt; 4</code> 时丢弃。</p>
121
+ <hr>
122
+ <h2 id="4-数据管线架构(当前分支)" class="tsd-anchor-link">4. 数据管线架构(当前分支)<a href="#4-数据管线架构(当前分支)" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h2>
123
+ <h3 id="41-renderdata()" class="tsd-anchor-link">4.1 RenderData(<code>renderData.ts</code>)<a href="#41-renderdata()" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3>
124
+ <ul>
125
+ <li><strong>单一聚合类</strong>: 管理所有 <code>PBMGaussianSplattingObject</code> 的合并数据</li>
126
+ <li><strong>CPU 端数组</strong>:
127
+ <ul>
128
+ <li><code>data: Uint32Array</code> → 协方差+颜色 (RGBA32UI)</li>
129
+ <li><code>positionData: Float32Array</code> → 全精度位置 (RGB32F)</li>
130
+ <li><code>transforms: Float32Array</code> → 变换矩阵</li>
131
+ <li><code>transformIndices / layerIndices: Uint32Array</code> → 索引</li>
132
+ <li><code>sh1/sh2/sh3: Float32Array</code> → 球谐数据</li>
133
+ <li><code>positions/rotations/scales: Float32Array</code> → 排序用世界坐标</li>
134
+ </ul>
135
+ </li>
136
+ </ul>
137
+ <h3 id="42-rendermesh()" class="tsd-anchor-link">4.2 RenderMesh(<code>pbmGaussianSplattingRenderMesh.ts</code>)<a href="#42-rendermesh()" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3>
138
+ <ul>
139
+ <li><strong>双缓冲 Slot 架构</strong> (active + pending):
140
+ <ul>
141
+ <li><code>RenderSlot = { generation, renderData, textures, awaitingFirstSort, sortDataUploaded }</code></li>
142
+ <li>pending 构建完成后,首次排序回来时 swap 到 active</li>
143
+ </ul>
144
+ </li>
145
+ <li><strong>增量追加</strong> (<code>appendObjects</code>): 新对象追加到已有 slot 而非全量重建</li>
146
+ <li><strong>纹理复用池</strong> (<code>freeSlotPool</code>): 回收旧 slot 的 DataTexture 对象</li>
147
+ <li><strong>排序</strong>: 专用 SortWorker + WASM radix sort,通过 transferable 零拷贝</li>
148
+ </ul>
149
+ <h3 id="43-内存管理" class="tsd-anchor-link">4.3 内存管理<a href="#43-内存管理" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3>
150
+ <ul>
151
+ <li><code>releaseSortData()</code>: 排序完成后释放 positions/rotations/scales</li>
152
+ <li><code>releaseAggregatedData()</code>: 纹理上传后释放 CPU 端 data/positionData</li>
153
+ <li><code>releaseSHData()</code>: SH 纹理创建后释放 CPU 端 sh1/sh2/sh3</li>
154
+ <li><code>releaseIndexData()</code>: transformIndices/layerIndices 纹理已创建且 sortData 已上传后释放</li>
155
+ </ul>
156
+ <hr>
157
+ <h2 id="5-排序(sortcpp-sortworker)" class="tsd-anchor-link">5. 排序(sort.cpp / sortWorker)<a href="#5-排序(sortcpp-sortworker)" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h2>
158
+ <ul>
159
+ <li>Two-pass radix sort (base 65536)</li>
160
+ <li>深度编码: <code>floatToSortableUint</code> (IEEE 754 正序利用)</li>
161
+ <li>降序 (远→近): 对 key 做 <code>~key</code> 实现</li>
162
+ <li>无效 splat (∞深度) 跳过</li>
163
+ </ul>
164
+ <hr>
165
+ <h2 id="6-球谐(sh)" class="tsd-anchor-link">6. 球谐(SH)<a href="#6-球谐(sh)" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h2>
166
+ <ul>
167
+ <li>最高支持 2 阶(<code>u_maxShDegree = 0/1/2</code>)</li>
168
+ <li>数据打包到单张 RGBA32F 纹理,按 padded component count 排列</li>
169
+ <li>着色器中逐阶计算视角相关颜色</li>
170
+ </ul>
171
+ <hr>
172
+ <h2 id="7-其他特性" class="tsd-anchor-link">7. 其他特性<a href="#7-其他特性" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h2>
173
+ <ul>
174
+ <li><strong>入场聚合动画</strong> (<code>ENABLE_GS_INIT_ANIMATION</code>): 通过 define 开关,splat 从爆炸散开收敛到正确位置</li>
175
+ <li><strong>Clipper 裁剪</strong>: 层级 clipper 系统,每层分配 clipper range</li>
176
+ <li><strong>Transform 系统</strong>: 每对象独立变换矩阵,通过 transformIndices 索引</li>
177
+ </ul>
178
+ <hr>
179
+ <h2 id="8-与目标分支(6x-3dgs重构)的关键差异预览" class="tsd-anchor-link">8. 与目标分支(6.x / 3dgs重构)的关键差异预览<a href="#8-与目标分支(6x-3dgs重构)的关键差异预览" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h2>
180
+ <p>目标分支(<code>18562e668</code>)引入了以下新文件/重构:</p>
181
+ <ul>
182
+ <li><code>splatAssembler.ts</code> — tile-based 数据组装(替代 RenderData 的整体聚合)</li>
183
+ <li><code>tileTexture.ts</code> — tile 级别的纹理管理</li>
184
+ <li><code>orderTexture.ts</code> — 排序结果纹理</li>
185
+ <li><code>reorderPass.ts</code> — GPU reorder pass</li>
186
+ <li><code>layerRegistry.ts</code> — 层注册表</li>
187
+ <li><code>shStore.ts</code> — SH 数据存储</li>
188
+ <li><code>transformStore.ts</code> — 变换存储</li>
189
+ <li><code>renderData.ts</code> — <strong>已删除</strong>(被上述模块替代)</li>
190
+ <li><code>vertex.glsl</code> — 着色器改动 (123 行变动)</li>
191
+ <li><code>pbmGaussianSplattingRenderMesh.ts</code> — 大幅重构(1062行变动)</li>
192
+ </ul>
193
+ <p><strong>核心架构变化</strong>: 从&quot;全量聚合 + CPU 端数据管理&quot;转向&quot;tile 粒度局部更新 + GPU 端重排&quot;。</p>
194
+ <hr>
195
+ <h2 id="9-切换分支后的修改指导" class="tsd-anchor-link">9. 切换分支后的修改指导<a href="#9-切换分支后的修改指导" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h2>
196
+ <p>切换到目标分支后,需要确保:</p>
197
+ <ol>
198
+ <li><strong>协方差计算</strong>: <code>data.cpp</code> 的 <code>computeCov3D</code> + <code>packHalf2x16</code> 逻辑保持一致(对称矩阵 6 分量 → 3 个 half2x16)</li>
199
+ <li><strong>着色器 J 矩阵</strong>: 目标分支的 vertex.glsl 中 J 矩阵计算需要与当前分支保持相同的透视/正交分支逻辑</li>
200
+ <li><strong>2D 投影公式</strong>: <code>cov2D = T^T * Vrk * T</code>(T = W * J),加 kernel2DSize 低通</li>
201
+ <li><strong>Fragment</strong>: 保持 <code>exp(-dot(vPos, vPos))</code> 和 <code>discard &lt; -4.0</code></li>
202
+ <li><strong>位置纹理</strong>: 保持 RGB32F 独立纹理避免 fp16 精度问题</li>
203
+ <li><strong>SH</strong>: 确保新架构下 SH 纹理布局与着色器读取一致</li>
204
+ </ol>
205
+ </div></div><div class="col-sidebar"><div class="page-menu"><div class="tsd-navigation settings"><details class="tsd-accordion"><summary class="tsd-accordion-summary"><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg><h3>Settings</h3></summary><div class="tsd-accordion-details"><div class="tsd-filter-visibility"><span class="settings-label">Member Visibility</span><ul id="tsd-filter-options"><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-inherited" name="inherited" checked/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Inherited</span></label></li></ul></div><div class="tsd-theme-toggle"><label class="settings-label" for="tsd-theme">Theme</label><select id="tsd-theme"><option value="os">OS</option><option value="light">Light</option><option value="dark">Dark</option></select></div></div></details></div><details open class="tsd-accordion tsd-page-navigation"><summary class="tsd-accordion-summary"><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg><h3>On This Page</h3></summary><div class="tsd-accordion-details"><a href="#当前分支(68x)3dgs-渲染架构总结"><span>当前分支(6.8.x)3<wbr/>DGS 渲染架构总结</span></a><ul><li><a href="#1-协方差(covariance)计算"><span>1. 协方差(<wbr/>Covariance)计算</span></a></li><li><ul><li><a href="#11-cpuwasm-预计算(-函数)"><span>1.1 <wbr/>CPU/<wbr/>WASM 预计算( / 函数)</span></a></li><li><a href="#12-位置数据(独立纹理)"><span>1.2 位置数据(独立纹理)</span></a></li></ul></li><li><a href="#2-顶点着色器(vertexglsl)"><span>2. 顶点着色器(vertex.glsl)</span></a></li><li><ul><li><a href="#21-数据读取"><span>2.1 数据读取</span></a></li><li><a href="#22-j-矩阵(jacobian)计算"><span>2.2 <wbr/>J 矩阵(<wbr/>Jacobian)计算</span></a></li><li><a href="#23-2d-协方差投影(gsplat-renderprogram-一致)"><span>2.3 2<wbr/>D 协方差投影(gsplat <wbr/>Render<wbr/>Program 一致)</span></a></li><li><a href="#24-特征值分解-→-椭圆轴"><span>2.4 特征值分解 → 椭圆轴</span></a></li><li><a href="#25-quad-顶点偏移"><span>2.5 <wbr/>Quad 顶点偏移</span></a></li></ul></li><li><a href="#3-片段着色器(fragmentglsl)"><span>3. 片段着色器(fragment.glsl)</span></a></li><li><a href="#4-数据管线架构(当前分支)"><span>4. 数据管线架构(当前分支)</span></a></li><li><ul><li><a href="#41-renderdata()"><span>4.1 <wbr/>Render<wbr/>Data()</span></a></li><li><a href="#42-rendermesh()"><span>4.2 <wbr/>Render<wbr/>Mesh()</span></a></li><li><a href="#43-内存管理"><span>4.3 内存管理</span></a></li></ul></li><li><a href="#5-排序(sortcpp-sortworker)"><span>5. 排序(sort.cpp / sort<wbr/>Worker)</span></a></li><li><a href="#6-球谐(sh)"><span>6. 球谐(<wbr/>SH)</span></a></li><li><a href="#7-其他特性"><span>7. 其他特性</span></a></li><li><a href="#8-与目标分支(6x-3dgs重构)的关键差异预览"><span>8. 与目标分支(6.x / 3dgs重构)的关键差异预览</span></a></li><li><a href="#9-切换分支后的修改指导"><span>9. 切换分支后的修改指导</span></a></li></ul></div></details></div><div class="site-menu"><nav class="tsd-navigation"><a href="../modules.html">如视 Five SDK</a><ul class="tsd-small-nested-navigation" id="tsd-nav-container"><li>Loading...</li></ul></nav></div></div></div><footer><p class="tsd-generator">Generated using <a href="https://typedoc.org/" target="_blank">TypeDoc</a></p></footer><div class="overlay"></div></body></html>
@@ -3,7 +3,7 @@
3
3
  <h2 id="core-class" class="tsd-anchor-link">Core Class: <code>Five</code><a href="#core-class" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h2>
4
4
  <p>The <code>Five</code> class is the main entry point for the SDK. It manages the rendering, state, and interaction of the 3D scene.</p>
5
5
  <h3 id="constructor" class="tsd-anchor-link">Constructor<a href="#constructor" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3>
6
- <pre><code class="typescript"><span class="hl-3">const</span><span class="hl-1"> </span><span class="hl-4">five</span><span class="hl-1"> = </span><span class="hl-3">new</span><span class="hl-1"> </span><span class="hl-5">Five</span><span class="hl-1">(</span><span class="hl-6">initArgs</span><span class="hl-1">?: </span><span class="hl-6">FiveInitArgs</span><span class="hl-1">);</span>
6
+ <pre><code class="typescript"><span class="hl-8">const</span><span class="hl-1"> </span><span class="hl-6">five</span><span class="hl-1"> = </span><span class="hl-8">new</span><span class="hl-1"> </span><span class="hl-4">Five</span><span class="hl-1">(</span><span class="hl-5">initArgs</span><span class="hl-1">?: </span><span class="hl-5">FiveInitArgs</span><span class="hl-1">);</span>
7
7
  </code><button type="button">Copy</button></pre>
8
8
 
9
9
  <h3 id="properties" class="tsd-anchor-link">Properties<a href="#properties" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3>
@@ -92,7 +92,7 @@
92
92
  </table>
93
93
  <h2 id="initialization-configuration-" class="tsd-anchor-link">Initialization Configuration (<code>FiveInitArgs</code>)<a href="#initialization-configuration-" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h2>
94
94
  <p>Configuration object passed to the <code>Five</code> constructor.</p>
95
- <pre><code class="typescript"><span class="hl-3">interface</span><span class="hl-1"> </span><span class="hl-7">FiveInitArgs</span><span class="hl-1"> {</span><br/><span class="hl-1"> </span><span class="hl-8">/** External WebGLRenderer. If provided, internal renderer creation is skipped. */</span><br/><span class="hl-1"> </span><span class="hl-6">renderer</span><span class="hl-1">?: </span><span class="hl-7">THREE</span><span class="hl-1">.</span><span class="hl-7">WebGLRenderer</span><span class="hl-1">;</span><br/><br/><span class="hl-1"> </span><span class="hl-8">/** Width/Height of the viewport relative to container (0-1). */</span><br/><span class="hl-1"> </span><span class="hl-6">viewport</span><span class="hl-1">?: { </span><span class="hl-6">left</span><span class="hl-1">: </span><span class="hl-7">number</span><span class="hl-1">; </span><span class="hl-6">bottom</span><span class="hl-1">: </span><span class="hl-7">number</span><span class="hl-1">; </span><span class="hl-6">width</span><span class="hl-1">: </span><span class="hl-7">number</span><span class="hl-1">; </span><span class="hl-6">height</span><span class="hl-1">: </span><span class="hl-7">number</span><span class="hl-1"> };</span><br/><br/><span class="hl-1"> </span><span class="hl-8">/** Canvas background color. Default: 0x181A1C */</span><br/><span class="hl-1"> </span><span class="hl-6">backgroundColor</span><span class="hl-1">?: </span><span class="hl-7">number</span><span class="hl-1"> | </span><span class="hl-7">THREE</span><span class="hl-1">.</span><span class="hl-7">Color</span><span class="hl-1">;</span><br/><br/><span class="hl-1"> </span><span class="hl-8">/** Canvas background alpha (0-1). Default: 1 */</span><br/><span class="hl-1"> </span><span class="hl-6">backgroundAlpha</span><span class="hl-1">?: </span><span class="hl-7">number</span><span class="hl-1">;</span><br/><br/><span class="hl-1"> </span><span class="hl-8">/** Enable antialiasing. Default: false */</span><br/><span class="hl-1"> </span><span class="hl-6">antialias</span><span class="hl-1">?: </span><span class="hl-7">boolean</span><span class="hl-1">;</span><br/><br/><span class="hl-1"> </span><span class="hl-8">/** Auto-play rendering loop. Default: true */</span><br/><span class="hl-1"> </span><span class="hl-6">play</span><span class="hl-1">?: </span><span class="hl-7">boolean</span><span class="hl-1">;</span><br/><br/><span class="hl-1"> </span><span class="hl-8">/** Enable on-demand rendering to save battery. Default: true */</span><br/><span class="hl-1"> </span><span class="hl-6">onlyRenderIfNeeds</span><span class="hl-1">?: </span><span class="hl-7">boolean</span><span class="hl-1">;</span><br/><br/><span class="hl-1"> </span><span class="hl-8">/** Max FPS limit. false = unlimited. Default: false */</span><br/><span class="hl-1"> </span><span class="hl-6">maxFps</span><span class="hl-1">?: </span><span class="hl-7">number</span><span class="hl-1"> | </span><span class="hl-7">false</span><span class="hl-1">;</span><br/><br/><span class="hl-1"> </span><span class="hl-8">/** Mode transition duration in ms. Default: 1000 */</span><br/><span class="hl-1"> </span><span class="hl-6">modeChangeDuration</span><span class="hl-1">?: </span><span class="hl-7">number</span><span class="hl-1">;</span><br/><br/><span class="hl-1"> </span><span class="hl-8">/** Enable mouse wheel zoom. Default: true */</span><br/><span class="hl-1"> </span><span class="hl-6">enableWheel</span><span class="hl-1">?: </span><span class="hl-7">boolean</span><span class="hl-1">;</span><br/><br/><span class="hl-1"> </span><span class="hl-8">/** Initial plugins to load. */</span><br/><span class="hl-1"> </span><span class="hl-6">plugins</span><span class="hl-1">?: </span><span class="hl-7">FivePlugin</span><span class="hl-1">[];</span><br/><br/><span class="hl-1"> </span><span class="hl-8">/** Dynamic image configuration for optimization. */</span><br/><span class="hl-1"> </span><span class="hl-6">imageOptions</span><span class="hl-1">?: </span><span class="hl-7">ImageOptions</span><span class="hl-1">;</span><br/><br/><span class="hl-1"> </span><span class="hl-8">/** Dynamic texture configuration for optimization. */</span><br/><span class="hl-1"> </span><span class="hl-6">textureOptions</span><span class="hl-1">?: </span><span class="hl-7">TextureOptions</span><span class="hl-1">;</span><br/><br/><span class="hl-1"> </span><span class="hl-8">/** Request URL interceptor for auth/CDN. */</span><br/><span class="hl-1"> </span><span class="hl-5">requestProxy</span><span class="hl-1">?: (</span><span class="hl-6">url</span><span class="hl-1">: </span><span class="hl-7">string</span><span class="hl-1">) </span><span class="hl-3">=&gt;</span><span class="hl-1"> </span><span class="hl-7">string</span><span class="hl-1"> | </span><span class="hl-7">Promise</span><span class="hl-1">&lt;</span><span class="hl-7">string</span><span class="hl-1">&gt;;</span><br/><br/><span class="hl-1"> </span><span class="hl-8">/** Per-mode configuration (panorama, mapview, floorplan, topview, model). */</span><br/><span class="hl-1"> </span><span class="hl-6">panorama</span><span class="hl-1">?: </span><span class="hl-7">PanoramaConfig</span><span class="hl-1">;</span><br/><span class="hl-1"> </span><span class="hl-6">mapview</span><span class="hl-1">?: </span><span class="hl-7">MapviewConfig</span><span class="hl-1">;</span><br/><span class="hl-1"> </span><span class="hl-6">floorplan</span><span class="hl-1">?: </span><span class="hl-7">FloorplanConfig</span><span class="hl-1">;</span><br/><span class="hl-1"> </span><span class="hl-6">topview</span><span class="hl-1">?: </span><span class="hl-7">TopviewConfig</span><span class="hl-1">;</span><br/><span class="hl-1"> </span><span class="hl-6">model</span><span class="hl-1">?: </span><span class="hl-7">ModelConfig</span><span class="hl-1">;</span><br/><span class="hl-1">}</span>
95
+ <pre><code class="typescript"><span class="hl-8">interface</span><span class="hl-1"> </span><span class="hl-9">FiveInitArgs</span><span class="hl-1"> {</span><br/><span class="hl-1"> </span><span class="hl-7">/** External WebGLRenderer. If provided, internal renderer creation is skipped. */</span><br/><span class="hl-1"> </span><span class="hl-5">renderer</span><span class="hl-1">?: </span><span class="hl-9">THREE</span><span class="hl-1">.</span><span class="hl-9">WebGLRenderer</span><span class="hl-1">;</span><br/><br/><span class="hl-1"> </span><span class="hl-7">/** Width/Height of the viewport relative to container (0-1). */</span><br/><span class="hl-1"> </span><span class="hl-5">viewport</span><span class="hl-1">?: { </span><span class="hl-5">left</span><span class="hl-1">: </span><span class="hl-9">number</span><span class="hl-1">; </span><span class="hl-5">bottom</span><span class="hl-1">: </span><span class="hl-9">number</span><span class="hl-1">; </span><span class="hl-5">width</span><span class="hl-1">: </span><span class="hl-9">number</span><span class="hl-1">; </span><span class="hl-5">height</span><span class="hl-1">: </span><span class="hl-9">number</span><span class="hl-1"> };</span><br/><br/><span class="hl-1"> </span><span class="hl-7">/** Canvas background color. Default: 0x181A1C */</span><br/><span class="hl-1"> </span><span class="hl-5">backgroundColor</span><span class="hl-1">?: </span><span class="hl-9">number</span><span class="hl-1"> | </span><span class="hl-9">THREE</span><span class="hl-1">.</span><span class="hl-9">Color</span><span class="hl-1">;</span><br/><br/><span class="hl-1"> </span><span class="hl-7">/** Canvas background alpha (0-1). Default: 1 */</span><br/><span class="hl-1"> </span><span class="hl-5">backgroundAlpha</span><span class="hl-1">?: </span><span class="hl-9">number</span><span class="hl-1">;</span><br/><br/><span class="hl-1"> </span><span class="hl-7">/** Enable antialiasing. Default: false */</span><br/><span class="hl-1"> </span><span class="hl-5">antialias</span><span class="hl-1">?: </span><span class="hl-9">boolean</span><span class="hl-1">;</span><br/><br/><span class="hl-1"> </span><span class="hl-7">/** Auto-play rendering loop. Default: true */</span><br/><span class="hl-1"> </span><span class="hl-5">play</span><span class="hl-1">?: </span><span class="hl-9">boolean</span><span class="hl-1">;</span><br/><br/><span class="hl-1"> </span><span class="hl-7">/** Enable on-demand rendering to save battery. Default: true */</span><br/><span class="hl-1"> </span><span class="hl-5">onlyRenderIfNeeds</span><span class="hl-1">?: </span><span class="hl-9">boolean</span><span class="hl-1">;</span><br/><br/><span class="hl-1"> </span><span class="hl-7">/** Max FPS limit. false = unlimited. Default: false */</span><br/><span class="hl-1"> </span><span class="hl-5">maxFps</span><span class="hl-1">?: </span><span class="hl-9">number</span><span class="hl-1"> | </span><span class="hl-9">false</span><span class="hl-1">;</span><br/><br/><span class="hl-1"> </span><span class="hl-7">/** Mode transition duration in ms. Default: 1000 */</span><br/><span class="hl-1"> </span><span class="hl-5">modeChangeDuration</span><span class="hl-1">?: </span><span class="hl-9">number</span><span class="hl-1">;</span><br/><br/><span class="hl-1"> </span><span class="hl-7">/** Enable mouse wheel zoom. Default: true */</span><br/><span class="hl-1"> </span><span class="hl-5">enableWheel</span><span class="hl-1">?: </span><span class="hl-9">boolean</span><span class="hl-1">;</span><br/><br/><span class="hl-1"> </span><span class="hl-7">/** Initial plugins to load. */</span><br/><span class="hl-1"> </span><span class="hl-5">plugins</span><span class="hl-1">?: </span><span class="hl-9">FivePlugin</span><span class="hl-1">[];</span><br/><br/><span class="hl-1"> </span><span class="hl-7">/** Dynamic image configuration for optimization. */</span><br/><span class="hl-1"> </span><span class="hl-5">imageOptions</span><span class="hl-1">?: </span><span class="hl-9">ImageOptions</span><span class="hl-1">;</span><br/><br/><span class="hl-1"> </span><span class="hl-7">/** Dynamic texture configuration for optimization. */</span><br/><span class="hl-1"> </span><span class="hl-5">textureOptions</span><span class="hl-1">?: </span><span class="hl-9">TextureOptions</span><span class="hl-1">;</span><br/><br/><span class="hl-1"> </span><span class="hl-7">/** Request URL interceptor for auth/CDN. */</span><br/><span class="hl-1"> </span><span class="hl-4">requestProxy</span><span class="hl-1">?: (</span><span class="hl-5">url</span><span class="hl-1">: </span><span class="hl-9">string</span><span class="hl-1">) </span><span class="hl-8">=&gt;</span><span class="hl-1"> </span><span class="hl-9">string</span><span class="hl-1"> | </span><span class="hl-9">Promise</span><span class="hl-1">&lt;</span><span class="hl-9">string</span><span class="hl-1">&gt;;</span><br/><br/><span class="hl-1"> </span><span class="hl-7">/** Per-mode configuration (panorama, mapview, floorplan, topview, model). */</span><br/><span class="hl-1"> </span><span class="hl-5">panorama</span><span class="hl-1">?: </span><span class="hl-9">PanoramaConfig</span><span class="hl-1">;</span><br/><span class="hl-1"> </span><span class="hl-5">mapview</span><span class="hl-1">?: </span><span class="hl-9">MapviewConfig</span><span class="hl-1">;</span><br/><span class="hl-1"> </span><span class="hl-5">floorplan</span><span class="hl-1">?: </span><span class="hl-9">FloorplanConfig</span><span class="hl-1">;</span><br/><span class="hl-1"> </span><span class="hl-5">topview</span><span class="hl-1">?: </span><span class="hl-9">TopviewConfig</span><span class="hl-1">;</span><br/><span class="hl-1"> </span><span class="hl-5">model</span><span class="hl-1">?: </span><span class="hl-9">ModelConfig</span><span class="hl-1">;</span><br/><span class="hl-1">}</span>
96
96
  </code><button type="button">Copy</button></pre>
97
97
 
98
98
  <blockquote>
@@ -211,7 +211,7 @@
211
211
  <p>Destroys the Five instance and releases resources.</p>
212
212
  <h2 id="state-management" class="tsd-anchor-link">State Management<a href="#state-management" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h2>
213
213
  <p>The <code>State</code> interface defines the complete status of the Five instance at any moment.</p>
214
- <pre><code class="typescript"><span class="hl-3">interface</span><span class="hl-1"> </span><span class="hl-7">State</span><span class="hl-1"> {</span><br/><span class="hl-1"> </span><span class="hl-6">mode</span><span class="hl-1">: </span><span class="hl-7">Mode</span><span class="hl-1">; </span><span class="hl-8">// Current view mode</span><br/><span class="hl-1"> </span><span class="hl-6">panoIndex</span><span class="hl-1">: </span><span class="hl-7">number</span><span class="hl-1">; </span><span class="hl-8">// Current panorama index</span><br/><span class="hl-1"> </span><span class="hl-6">workCode</span><span class="hl-1">: </span><span class="hl-7">string</span><span class="hl-1">; </span><span class="hl-8">// ID of the current work</span><br/><span class="hl-1"> </span><span class="hl-6">latitude</span><span class="hl-1">: </span><span class="hl-7">number</span><span class="hl-1">; </span><span class="hl-8">// Camera latitude (radians)</span><br/><span class="hl-1"> </span><span class="hl-6">longitude</span><span class="hl-1">: </span><span class="hl-7">number</span><span class="hl-1">; </span><span class="hl-8">// Camera longitude (radians)</span><br/><span class="hl-1"> </span><span class="hl-6">distance</span><span class="hl-1">: </span><span class="hl-7">number</span><span class="hl-1">; </span><span class="hl-8">// Camera distance from target</span><br/><span class="hl-1"> </span><span class="hl-6">fov</span><span class="hl-1">: </span><span class="hl-7">number</span><span class="hl-1">; </span><span class="hl-8">// Field of view</span><br/><span class="hl-1"> </span><span class="hl-6">offset</span><span class="hl-1">: </span><span class="hl-7">THREE</span><span class="hl-1">.</span><span class="hl-7">Vector3</span><span class="hl-1">; </span><span class="hl-8">// Camera target offset</span><br/><span class="hl-1">}</span>
214
+ <pre><code class="typescript"><span class="hl-8">interface</span><span class="hl-1"> </span><span class="hl-9">State</span><span class="hl-1"> {</span><br/><span class="hl-1"> </span><span class="hl-5">mode</span><span class="hl-1">: </span><span class="hl-9">Mode</span><span class="hl-1">; </span><span class="hl-7">// Current view mode</span><br/><span class="hl-1"> </span><span class="hl-5">panoIndex</span><span class="hl-1">: </span><span class="hl-9">number</span><span class="hl-1">; </span><span class="hl-7">// Current panorama index</span><br/><span class="hl-1"> </span><span class="hl-5">workCode</span><span class="hl-1">: </span><span class="hl-9">string</span><span class="hl-1">; </span><span class="hl-7">// ID of the current work</span><br/><span class="hl-1"> </span><span class="hl-5">latitude</span><span class="hl-1">: </span><span class="hl-9">number</span><span class="hl-1">; </span><span class="hl-7">// Camera latitude (radians)</span><br/><span class="hl-1"> </span><span class="hl-5">longitude</span><span class="hl-1">: </span><span class="hl-9">number</span><span class="hl-1">; </span><span class="hl-7">// Camera longitude (radians)</span><br/><span class="hl-1"> </span><span class="hl-5">distance</span><span class="hl-1">: </span><span class="hl-9">number</span><span class="hl-1">; </span><span class="hl-7">// Camera distance from target</span><br/><span class="hl-1"> </span><span class="hl-5">fov</span><span class="hl-1">: </span><span class="hl-9">number</span><span class="hl-1">; </span><span class="hl-7">// Field of view</span><br/><span class="hl-1"> </span><span class="hl-5">offset</span><span class="hl-1">: </span><span class="hl-9">THREE</span><span class="hl-1">.</span><span class="hl-9">Vector3</span><span class="hl-1">; </span><span class="hl-7">// Camera target offset</span><br/><span class="hl-1">}</span>
215
215
  </code><button type="button">Copy</button></pre>
216
216
 
217
217
  <h2 id="data-structures" class="tsd-anchor-link">Data Structures<a href="#data-structures" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h2>
@@ -220,12 +220,12 @@
220
220
  </blockquote>
221
221
  <h3 id="_-15" class="tsd-anchor-link"><code>Work</code><a href="#_-15" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3>
222
222
  <p>The main data object containing the scene description.</p>
223
- <pre><code class="typescript"><span class="hl-3">interface</span><span class="hl-1"> </span><span class="hl-7">Work</span><span class="hl-1"> {</span><br/><span class="hl-1"> </span><span class="hl-6">workCode</span><span class="hl-1">: </span><span class="hl-7">string</span><span class="hl-1">; </span><span class="hl-8">// Unique identifier</span><br/><span class="hl-1"> </span><span class="hl-6">name</span><span class="hl-1">: </span><span class="hl-7">string</span><span class="hl-1">; </span><span class="hl-8">// Project name</span><br/><span class="hl-1"> </span><span class="hl-6">observers</span><span class="hl-1">: </span><span class="hl-7">WorkObserver</span><span class="hl-1">[]; </span><span class="hl-8">// List of panorama points</span><br/><span class="hl-1"> </span><span class="hl-6">model</span><span class="hl-1">: </span><span class="hl-7">WorkModel</span><span class="hl-1">; </span><span class="hl-8">// 3D model data</span><br/><span class="hl-1"> </span><span class="hl-6">initial</span><span class="hl-1">: </span><span class="hl-7">WorkInitial</span><span class="hl-1">; </span><span class="hl-8">// Initial view state</span><br/><span class="hl-1"> </span><span class="hl-6">transform</span><span class="hl-1">: </span><span class="hl-7">THREE</span><span class="hl-1">.</span><span class="hl-7">Matrix4</span><span class="hl-1">; </span><span class="hl-8">// World transform matrix</span><br/><span class="hl-1">}</span>
223
+ <pre><code class="typescript"><span class="hl-8">interface</span><span class="hl-1"> </span><span class="hl-9">Work</span><span class="hl-1"> {</span><br/><span class="hl-1"> </span><span class="hl-5">workCode</span><span class="hl-1">: </span><span class="hl-9">string</span><span class="hl-1">; </span><span class="hl-7">// Unique identifier</span><br/><span class="hl-1"> </span><span class="hl-5">name</span><span class="hl-1">: </span><span class="hl-9">string</span><span class="hl-1">; </span><span class="hl-7">// Project name</span><br/><span class="hl-1"> </span><span class="hl-5">observers</span><span class="hl-1">: </span><span class="hl-9">WorkObserver</span><span class="hl-1">[]; </span><span class="hl-7">// List of panorama points</span><br/><span class="hl-1"> </span><span class="hl-5">model</span><span class="hl-1">: </span><span class="hl-9">WorkModel</span><span class="hl-1">; </span><span class="hl-7">// 3D model data</span><br/><span class="hl-1"> </span><span class="hl-5">initial</span><span class="hl-1">: </span><span class="hl-9">WorkInitial</span><span class="hl-1">; </span><span class="hl-7">// Initial view state</span><br/><span class="hl-1"> </span><span class="hl-5">transform</span><span class="hl-1">: </span><span class="hl-9">THREE</span><span class="hl-1">.</span><span class="hl-9">Matrix4</span><span class="hl-1">; </span><span class="hl-7">// World transform matrix</span><br/><span class="hl-1">}</span>
224
224
  </code><button type="button">Copy</button></pre>
225
225
 
226
226
  <h3 id="panorama-point" class="tsd-anchor-link"><code>WorkObserver</code> (Panorama Point)<a href="#panorama-point" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3>
227
227
  <p>Represents a single panorama spot.</p>
228
- <pre><code class="typescript"><span class="hl-3">interface</span><span class="hl-1"> </span><span class="hl-7">WorkObserver</span><span class="hl-1"> {</span><br/><span class="hl-1"> </span><span class="hl-6">index</span><span class="hl-1">: </span><span class="hl-7">number</span><span class="hl-1">; </span><span class="hl-8">// Index in the list</span><br/><span class="hl-1"> </span><span class="hl-6">floorIndex</span><span class="hl-1">: </span><span class="hl-7">number</span><span class="hl-1">; </span><span class="hl-8">// Floor number</span><br/><span class="hl-1"> </span><span class="hl-6">position</span><span class="hl-1">: </span><span class="hl-7">THREE</span><span class="hl-1">.</span><span class="hl-7">Vector3</span><span class="hl-1">; </span><span class="hl-8">// Position in 3D space</span><br/><span class="hl-1"> </span><span class="hl-6">quaternion</span><span class="hl-1">: </span><span class="hl-7">THREE</span><span class="hl-1">.</span><span class="hl-7">Quaternion</span><span class="hl-1">; </span><span class="hl-8">// Rotation relative to model</span><br/><span class="hl-1"> </span><span class="hl-6">accessibleNodes</span><span class="hl-1">: </span><span class="hl-7">number</span><span class="hl-1">[]; </span><span class="hl-8">// Indices of reachable points</span><br/><span class="hl-1"> </span><span class="hl-6">images</span><span class="hl-1">: </span><span class="hl-7">WorkImage</span><span class="hl-1">; </span><span class="hl-8">// Panorama image URLs</span><br/><span class="hl-1"> </span><span class="hl-6">active</span><span class="hl-1">: </span><span class="hl-7">boolean</span><span class="hl-1">; </span><span class="hl-8">// Whether the point is enabled</span><br/><br/><span class="hl-1"> </span><span class="hl-8">// Coordinate Methods</span><br/><span class="hl-1"> </span><span class="hl-5">getWorldPosition</span><span class="hl-1">(): </span><span class="hl-7">THREE</span><span class="hl-1">.</span><span class="hl-7">Vector3</span><span class="hl-1">;</span><br/><span class="hl-1"> </span><span class="hl-5">getWorldStandingPosition</span><span class="hl-1">(): </span><span class="hl-7">THREE</span><span class="hl-1">.</span><span class="hl-7">Vector3</span><span class="hl-1">;</span><br/><br/><span class="hl-1"> </span><span class="hl-8">// UV Conversion Methods</span><br/><span class="hl-1"> </span><span class="hl-5">vectorToEquirectangularUv</span><span class="hl-1">(</span><span class="hl-6">vector</span><span class="hl-1">: </span><span class="hl-7">THREE</span><span class="hl-1">.</span><span class="hl-7">Vector3</span><span class="hl-1">, </span><span class="hl-6">uvOrigin</span><span class="hl-1">?: </span><span class="hl-9">&#39;top-left&#39;</span><span class="hl-1"> | </span><span class="hl-9">&#39;bottom-left&#39;</span><span class="hl-1">): </span><span class="hl-7">THREE</span><span class="hl-1">.</span><span class="hl-7">Vector2</span><span class="hl-1">;</span><br/><span class="hl-1"> </span><span class="hl-5">equirectangularUvToVector</span><span class="hl-1">(</span><span class="hl-6">uv</span><span class="hl-1">: </span><span class="hl-7">THREE</span><span class="hl-1">.</span><span class="hl-7">Vector2</span><span class="hl-1">, </span><span class="hl-6">uvOrigin</span><span class="hl-1">?: </span><span class="hl-9">&#39;top-left&#39;</span><span class="hl-1"> | </span><span class="hl-9">&#39;bottom-left&#39;</span><span class="hl-1">): </span><span class="hl-7">THREE</span><span class="hl-1">.</span><span class="hl-7">Vector3</span><span class="hl-1">;</span><br/><span class="hl-1"> </span><span class="hl-5">vectorToCubemapUv</span><span class="hl-1">(</span><span class="hl-6">vector</span><span class="hl-1">: </span><span class="hl-7">THREE</span><span class="hl-1">.</span><span class="hl-7">Vector3</span><span class="hl-1">, </span><span class="hl-6">uvOrigin</span><span class="hl-1">?: </span><span class="hl-9">&#39;top-left&#39;</span><span class="hl-1"> | </span><span class="hl-9">&#39;bottom-left&#39;</span><span class="hl-1">): [</span><span class="hl-7">CubeFace</span><span class="hl-1">, </span><span class="hl-7">THREE</span><span class="hl-1">.</span><span class="hl-7">Vector2</span><span class="hl-1">];</span><br/><span class="hl-1"> </span><span class="hl-5">cubemapUvToVector</span><span class="hl-1">(</span><span class="hl-6">cubeFace</span><span class="hl-1">: </span><span class="hl-7">CubeFace</span><span class="hl-1">, </span><span class="hl-6">uv</span><span class="hl-1">: </span><span class="hl-7">THREE</span><span class="hl-1">.</span><span class="hl-7">Vector2</span><span class="hl-1">, </span><span class="hl-6">uvOrigin</span><span class="hl-1">?: </span><span class="hl-9">&#39;top-left&#39;</span><span class="hl-1"> | </span><span class="hl-9">&#39;bottom-left&#39;</span><span class="hl-1">): </span><span class="hl-7">THREE</span><span class="hl-1">.</span><span class="hl-7">Vector3</span><span class="hl-1">;</span><br/><span class="hl-1">}</span>
228
+ <pre><code class="typescript"><span class="hl-8">interface</span><span class="hl-1"> </span><span class="hl-9">WorkObserver</span><span class="hl-1"> {</span><br/><span class="hl-1"> </span><span class="hl-5">index</span><span class="hl-1">: </span><span class="hl-9">number</span><span class="hl-1">; </span><span class="hl-7">// Index in the list</span><br/><span class="hl-1"> </span><span class="hl-5">floorIndex</span><span class="hl-1">: </span><span class="hl-9">number</span><span class="hl-1">; </span><span class="hl-7">// Floor number</span><br/><span class="hl-1"> </span><span class="hl-5">position</span><span class="hl-1">: </span><span class="hl-9">THREE</span><span class="hl-1">.</span><span class="hl-9">Vector3</span><span class="hl-1">; </span><span class="hl-7">// Position in 3D space</span><br/><span class="hl-1"> </span><span class="hl-5">quaternion</span><span class="hl-1">: </span><span class="hl-9">THREE</span><span class="hl-1">.</span><span class="hl-9">Quaternion</span><span class="hl-1">; </span><span class="hl-7">// Rotation relative to model</span><br/><span class="hl-1"> </span><span class="hl-5">accessibleNodes</span><span class="hl-1">: </span><span class="hl-9">number</span><span class="hl-1">[]; </span><span class="hl-7">// Indices of reachable points</span><br/><span class="hl-1"> </span><span class="hl-5">images</span><span class="hl-1">: </span><span class="hl-9">WorkImage</span><span class="hl-1">; </span><span class="hl-7">// Panorama image URLs</span><br/><span class="hl-1"> </span><span class="hl-5">active</span><span class="hl-1">: </span><span class="hl-9">boolean</span><span class="hl-1">; </span><span class="hl-7">// Whether the point is enabled</span><br/><br/><span class="hl-1"> </span><span class="hl-7">// Coordinate Methods</span><br/><span class="hl-1"> </span><span class="hl-4">getWorldPosition</span><span class="hl-1">(): </span><span class="hl-9">THREE</span><span class="hl-1">.</span><span class="hl-9">Vector3</span><span class="hl-1">;</span><br/><span class="hl-1"> </span><span class="hl-4">getWorldStandingPosition</span><span class="hl-1">(): </span><span class="hl-9">THREE</span><span class="hl-1">.</span><span class="hl-9">Vector3</span><span class="hl-1">;</span><br/><br/><span class="hl-1"> </span><span class="hl-7">// UV Conversion Methods</span><br/><span class="hl-1"> </span><span class="hl-4">vectorToEquirectangularUv</span><span class="hl-1">(</span><span class="hl-5">vector</span><span class="hl-1">: </span><span class="hl-9">THREE</span><span class="hl-1">.</span><span class="hl-9">Vector3</span><span class="hl-1">, </span><span class="hl-5">uvOrigin</span><span class="hl-1">?: </span><span class="hl-10">&#39;top-left&#39;</span><span class="hl-1"> | </span><span class="hl-10">&#39;bottom-left&#39;</span><span class="hl-1">): </span><span class="hl-9">THREE</span><span class="hl-1">.</span><span class="hl-9">Vector2</span><span class="hl-1">;</span><br/><span class="hl-1"> </span><span class="hl-4">equirectangularUvToVector</span><span class="hl-1">(</span><span class="hl-5">uv</span><span class="hl-1">: </span><span class="hl-9">THREE</span><span class="hl-1">.</span><span class="hl-9">Vector2</span><span class="hl-1">, </span><span class="hl-5">uvOrigin</span><span class="hl-1">?: </span><span class="hl-10">&#39;top-left&#39;</span><span class="hl-1"> | </span><span class="hl-10">&#39;bottom-left&#39;</span><span class="hl-1">): </span><span class="hl-9">THREE</span><span class="hl-1">.</span><span class="hl-9">Vector3</span><span class="hl-1">;</span><br/><span class="hl-1"> </span><span class="hl-4">vectorToCubemapUv</span><span class="hl-1">(</span><span class="hl-5">vector</span><span class="hl-1">: </span><span class="hl-9">THREE</span><span class="hl-1">.</span><span class="hl-9">Vector3</span><span class="hl-1">, </span><span class="hl-5">uvOrigin</span><span class="hl-1">?: </span><span class="hl-10">&#39;top-left&#39;</span><span class="hl-1"> | </span><span class="hl-10">&#39;bottom-left&#39;</span><span class="hl-1">): [</span><span class="hl-9">CubeFace</span><span class="hl-1">, </span><span class="hl-9">THREE</span><span class="hl-1">.</span><span class="hl-9">Vector2</span><span class="hl-1">];</span><br/><span class="hl-1"> </span><span class="hl-4">cubemapUvToVector</span><span class="hl-1">(</span><span class="hl-5">cubeFace</span><span class="hl-1">: </span><span class="hl-9">CubeFace</span><span class="hl-1">, </span><span class="hl-5">uv</span><span class="hl-1">: </span><span class="hl-9">THREE</span><span class="hl-1">.</span><span class="hl-9">Vector2</span><span class="hl-1">, </span><span class="hl-5">uvOrigin</span><span class="hl-1">?: </span><span class="hl-10">&#39;top-left&#39;</span><span class="hl-1"> | </span><span class="hl-10">&#39;bottom-left&#39;</span><span class="hl-1">): </span><span class="hl-9">THREE</span><span class="hl-1">.</span><span class="hl-9">Vector3</span><span class="hl-1">;</span><br/><span class="hl-1">}</span>
229
229
  </code><button type="button">Copy</button></pre>
230
230
 
231
231
  <h2 id="events" class="tsd-anchor-link">Events<a href="#events" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h2>
@@ -459,7 +459,7 @@
459
459
  </tbody>
460
460
  </table>
461
461
  <h3 id="usage-example" class="tsd-anchor-link">Usage Example<a href="#usage-example" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3>
462
- <pre><code class="typescript"><span class="hl-8">// Recommended: Use the new event system</span><br/><span class="hl-6">five</span><span class="hl-1">.</span><span class="hl-5">on</span><span class="hl-1">(</span><span class="hl-9">&#39;gesture.tap&#39;</span><span class="hl-1">, (</span><span class="hl-6">event</span><span class="hl-1">) </span><span class="hl-3">=&gt;</span><span class="hl-1"> {</span><br/><span class="hl-1"> </span><span class="hl-6">console</span><span class="hl-1">.</span><span class="hl-5">log</span><span class="hl-1">(</span><span class="hl-9">&#39;User tapped at:&#39;</span><span class="hl-1">, </span><span class="hl-6">event</span><span class="hl-1">);</span><br/><span class="hl-1">});</span><br/><br/><span class="hl-8">// Legacy (Avoid):</span><br/><span class="hl-8">// five.on(&#39;wantsTapGesture&#39;, (raycaster) =&gt; { ... });</span>
462
+ <pre><code class="typescript"><span class="hl-7">// Recommended: Use the new event system</span><br/><span class="hl-5">five</span><span class="hl-1">.</span><span class="hl-4">on</span><span class="hl-1">(</span><span class="hl-10">&#39;gesture.tap&#39;</span><span class="hl-1">, (</span><span class="hl-5">event</span><span class="hl-1">) </span><span class="hl-8">=&gt;</span><span class="hl-1"> {</span><br/><span class="hl-1"> </span><span class="hl-5">console</span><span class="hl-1">.</span><span class="hl-4">log</span><span class="hl-1">(</span><span class="hl-10">&#39;User tapped at:&#39;</span><span class="hl-1">, </span><span class="hl-5">event</span><span class="hl-1">);</span><br/><span class="hl-1">});</span><br/><br/><span class="hl-7">// Legacy (Avoid):</span><br/><span class="hl-7">// five.on(&#39;wantsTapGesture&#39;, (raycaster) =&gt; { ... });</span>
463
463
  </code><button type="button">Copy</button></pre>
464
464
 
465
465
  </div></div><div class="col-sidebar"><div class="page-menu"><div class="tsd-navigation settings"><details class="tsd-accordion"><summary class="tsd-accordion-summary"><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg><h3>Settings</h3></summary><div class="tsd-accordion-details"><div class="tsd-filter-visibility"><span class="settings-label">Member Visibility</span><ul id="tsd-filter-options"><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-inherited" name="inherited" checked/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Inherited</span></label></li></ul></div><div class="tsd-theme-toggle"><label class="settings-label" for="tsd-theme">Theme</label><select id="tsd-theme"><option value="os">OS</option><option value="light">Light</option><option value="dark">Dark</option></select></div></div></details></div><details open class="tsd-accordion tsd-page-navigation"><summary class="tsd-accordion-summary"><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg><h3>On This Page</h3></summary><div class="tsd-accordion-details"><a href="#five-sdk-api-reference"><span>Five <wbr/>SDK <wbr/>API <wbr/>Reference</span></a><ul><li><a href="#core-class"><span>Core <wbr/>Class: </span></a></li><li><ul><li><a href="#constructor"><span>Constructor</span></a></li><li><a href="#properties"><span>Properties</span></a></li><li><a href="#static-properties"><span>Static <wbr/>Properties</span></a></li></ul></li><li><a href="#initialization-configuration-"><span>Initialization <wbr/>Configuration ()</span></a></li><li><a href="#core-methods"><span>Core <wbr/>Methods</span></a></li><li><ul><li><a href="#_"><span></span></a></li><li><a href="#_-1"><span></span></a></li><li><a href="#_-2"><span></span></a></li><li><a href="#_-3"><span></span></a></li><li><a href="#_-4"><span></span></a></li><li><a href="#_-5"><span></span></a></li><li><a href="#_-6"><span></span></a></li><li><a href="#_-7"><span></span></a></li><li><a href="#_-8"><span></span></a></li><li><a href="#_-9"><span></span></a></li><li><a href="#_-10"><span></span></a></li><li><a href="#_-11"><span></span></a></li><li><a href="#_-12"><span> / </span></a></li><li><a href="#_-13"><span></span></a></li><li><a href="#_-14"><span></span></a></li></ul></li><li><a href="#state-management"><span>State <wbr/>Management</span></a></li><li><a href="#data-structures"><span>Data <wbr/>Structures</span></a></li><li><ul><li><a href="#_-15"><span></span></a></li><li><a href="#panorama-point"><span> (<wbr/>Panorama <wbr/>Point)</span></a></li></ul></li><li><a href="#events"><span>Events</span></a></li><li><ul><li><a href="#recommended-events-modern"><span>Recommended <wbr/>Events (<wbr/>Modern)</span></a></li><li><ul><li><a href="#interaction-gestures"><span>Interaction &amp; <wbr/>Gestures</span></a></li><li><a href="#state-mode"><span>State &amp; <wbr/>Mode</span></a></li><li><a href="#lifecycle-resources"><span>Lifecycle &amp; <wbr/>Resources</span></a></li></ul></li><li><a href="#legacy-events-deprecated"><span>Legacy <wbr/>Events (<wbr/>Deprecated)</span></a></li><li><a href="#usage-example"><span>Usage <wbr/>Example</span></a></li></ul></li></ul></div></details></div><div class="site-menu"><nav class="tsd-navigation"><a href="../modules.html">如视 Five SDK</a><ul class="tsd-small-nested-navigation" id="tsd-nav-container"><li>Loading...</li></ul></nav></div></div></div><footer><p class="tsd-generator">Generated using <a href="https://typedoc.org/" target="_blank">TypeDoc</a></p></footer><div class="overlay"></div></body></html>
@@ -11,7 +11,7 @@
11
11
  <p><strong>Definition</strong>: <a href="../../five/model/parameter.d.ts">ParameterTilesetValue</a></p>
12
12
  </blockquote>
13
13
  <p>以下是 <code>ParameterTilesetValue</code> 的 TypeScript 定义摘要:</p>
14
- <pre><code class="typescript"><span class="hl-10">export</span><span class="hl-1"> </span><span class="hl-3">interface</span><span class="hl-1"> </span><span class="hl-7">ParameterTilesetValue</span><span class="hl-1"> {</span><br/><span class="hl-1"> </span><span class="hl-8">/** 屏幕空间误差阈值 (像素) */</span><br/><span class="hl-1"> </span><span class="hl-6">maxScreenSpaceError</span><span class="hl-1">: </span><span class="hl-7">number</span><span class="hl-1">;</span><br/><span class="hl-1"> </span><span class="hl-8">/** 最大显存占用 (MB) */</span><br/><span class="hl-1"> </span><span class="hl-6">maxMemoryUsage</span><span class="hl-1">: </span><span class="hl-7">number</span><span class="hl-1">;</span><br/><span class="hl-1"> </span><span class="hl-8">/** 最小几何误差 (精度上限锁) */</span><br/><span class="hl-1"> </span><span class="hl-6">minGeometricError</span><span class="hl-1">: </span><span class="hl-7">number</span><span class="hl-1">;</span><br/><span class="hl-1"> </span><span class="hl-8">// ... 更多字段见下方配置表</span><br/><span class="hl-1">}</span>
14
+ <pre><code class="typescript"><span class="hl-11">export</span><span class="hl-1"> </span><span class="hl-8">interface</span><span class="hl-1"> </span><span class="hl-9">ParameterTilesetValue</span><span class="hl-1"> {</span><br/><span class="hl-1"> </span><span class="hl-7">/** 屏幕空间误差阈值 (像素) */</span><br/><span class="hl-1"> </span><span class="hl-5">maxScreenSpaceError</span><span class="hl-1">: </span><span class="hl-9">number</span><span class="hl-1">;</span><br/><span class="hl-1"> </span><span class="hl-7">/** 最大显存占用 (MB) */</span><br/><span class="hl-1"> </span><span class="hl-5">maxMemoryUsage</span><span class="hl-1">: </span><span class="hl-9">number</span><span class="hl-1">;</span><br/><span class="hl-1"> </span><span class="hl-7">/** 最小几何误差 (精度上限锁) */</span><br/><span class="hl-1"> </span><span class="hl-5">minGeometricError</span><span class="hl-1">: </span><span class="hl-9">number</span><span class="hl-1">;</span><br/><span class="hl-1"> </span><span class="hl-7">// ... 更多字段见下方配置表</span><br/><span class="hl-1">}</span>
15
15
  </code><button type="button">Copy</button></pre>
16
16
 
17
17
  <h2 id="concepts" class="tsd-anchor-link">Concepts<a href="#concepts" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h2>
@@ -178,17 +178,17 @@
178
178
  <h2 id="examples" class="tsd-anchor-link">Examples<a href="#examples" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h2>
179
179
  <h3 id="1-adjusting-quality-memory-调整画质与内存平衡" class="tsd-anchor-link">1. Adjusting Quality &amp; Memory (调整画质与内存平衡)<a href="#1-adjusting-quality-memory-调整画质与内存平衡" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3>
180
180
  <p>在移动端或性能受限设备上,建议适当降低画质以保证流畅度。</p>
181
- <pre><code class="typescript"><span class="hl-3">const</span><span class="hl-1"> </span><span class="hl-4">parameter</span><span class="hl-1"> = </span><span class="hl-6">five</span><span class="hl-1">.</span><span class="hl-6">modelScene</span><span class="hl-1">.</span><span class="hl-6">parameter</span><span class="hl-1">;</span><br/><br/><span class="hl-8">// 1. 性能优先模式 (适用于低端设备)</span><br/><span class="hl-8">// 增大 SSE 阈值,降低画质</span><br/><span class="hl-6">parameter</span><span class="hl-1">.</span><span class="hl-5">set</span><span class="hl-1">(</span><span class="hl-9">&#39;maxScreenSpaceError&#39;</span><span class="hl-1">, </span><span class="hl-11">16</span><span class="hl-1">);</span><br/><span class="hl-8">// 限制显存,防止 Crash</span><br/><span class="hl-6">parameter</span><span class="hl-1">.</span><span class="hl-5">set</span><span class="hl-1">(</span><span class="hl-9">&#39;maxMemoryUsage&#39;</span><span class="hl-1">, </span><span class="hl-11">256</span><span class="hl-1">);</span><br/><br/><span class="hl-8">// 2. 画质优先模式 (适用于桌面端/截图)</span><br/><span class="hl-8">// 减小 SSE 阈值,提升细节</span><br/><span class="hl-6">parameter</span><span class="hl-1">.</span><span class="hl-5">set</span><span class="hl-1">(</span><span class="hl-9">&#39;maxScreenSpaceError&#39;</span><span class="hl-1">, </span><span class="hl-11">4</span><span class="hl-1">);</span><br/><span class="hl-8">// 允许更多显存占用</span><br/><span class="hl-6">parameter</span><span class="hl-1">.</span><span class="hl-5">set</span><span class="hl-1">(</span><span class="hl-9">&#39;maxMemoryUsage&#39;</span><span class="hl-1">, </span><span class="hl-11">1024</span><span class="hl-1">);</span><br/><br/><span class="hl-8">// 3. 重置为默认</span><br/><span class="hl-6">parameter</span><span class="hl-1">.</span><span class="hl-5">reset</span><span class="hl-1">(</span><span class="hl-9">&#39;maxScreenSpaceError&#39;</span><span class="hl-1">, </span><span class="hl-9">&#39;maxMemoryUsage&#39;</span><span class="hl-1">);</span>
181
+ <pre><code class="typescript"><span class="hl-8">const</span><span class="hl-1"> </span><span class="hl-6">parameter</span><span class="hl-1"> = </span><span class="hl-5">five</span><span class="hl-1">.</span><span class="hl-5">modelScene</span><span class="hl-1">.</span><span class="hl-5">parameter</span><span class="hl-1">;</span><br/><br/><span class="hl-7">// 1. 性能优先模式 (适用于低端设备)</span><br/><span class="hl-7">// 增大 SSE 阈值,降低画质</span><br/><span class="hl-5">parameter</span><span class="hl-1">.</span><span class="hl-4">set</span><span class="hl-1">(</span><span class="hl-10">&#39;maxScreenSpaceError&#39;</span><span class="hl-1">, </span><span class="hl-3">16</span><span class="hl-1">);</span><br/><span class="hl-7">// 限制显存,防止 Crash</span><br/><span class="hl-5">parameter</span><span class="hl-1">.</span><span class="hl-4">set</span><span class="hl-1">(</span><span class="hl-10">&#39;maxMemoryUsage&#39;</span><span class="hl-1">, </span><span class="hl-3">256</span><span class="hl-1">);</span><br/><br/><span class="hl-7">// 2. 画质优先模式 (适用于桌面端/截图)</span><br/><span class="hl-7">// 减小 SSE 阈值,提升细节</span><br/><span class="hl-5">parameter</span><span class="hl-1">.</span><span class="hl-4">set</span><span class="hl-1">(</span><span class="hl-10">&#39;maxScreenSpaceError&#39;</span><span class="hl-1">, </span><span class="hl-3">4</span><span class="hl-1">);</span><br/><span class="hl-7">// 允许更多显存占用</span><br/><span class="hl-5">parameter</span><span class="hl-1">.</span><span class="hl-4">set</span><span class="hl-1">(</span><span class="hl-10">&#39;maxMemoryUsage&#39;</span><span class="hl-1">, </span><span class="hl-3">1024</span><span class="hl-1">);</span><br/><br/><span class="hl-7">// 3. 重置为默认</span><br/><span class="hl-5">parameter</span><span class="hl-1">.</span><span class="hl-4">reset</span><span class="hl-1">(</span><span class="hl-10">&#39;maxScreenSpaceError&#39;</span><span class="hl-1">, </span><span class="hl-10">&#39;maxMemoryUsage&#39;</span><span class="hl-1">);</span>
182
182
  </code><button type="button">Copy</button></pre>
183
183
 
184
184
  <h3 id="2-multi-viewlayer-optimization-多-viewlayer-优化" class="tsd-anchor-link">2. Multi-ViewLayer Optimization (多 ViewLayer 优化)<a href="#2-multi-viewlayer-optimization-多-viewlayer-优化" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3>
185
185
  <p>在对比查看或多楼层场景中,通常存在多个 <code>ViewLayer</code>。为了避免资源竞争,建议对非焦点的 ViewLayer 进行降级处理。</p>
186
- <pre><code class="typescript"><span class="hl-8">// 假设 viewLayerA 是当前主要查看的模型,viewLayerB 是背景参考</span><br/><br/><span class="hl-8">// 聚焦 ViewLayerA: 正常画质</span><br/><span class="hl-6">viewLayerA</span><span class="hl-1">.</span><span class="hl-6">parameter</span><span class="hl-1">.</span><span class="hl-5">reset</span><span class="hl-1">(</span><span class="hl-9">&#39;maxScreenSpaceError&#39;</span><span class="hl-1">);</span><br/><br/><span class="hl-8">// 降级 ViewLayerB: 仅显示轮廓,节省资源</span><br/><span class="hl-6">viewLayerB</span><span class="hl-1">.</span><span class="hl-6">parameter</span><span class="hl-1">.</span><span class="hl-5">set</span><span class="hl-1">(</span><span class="hl-9">&#39;maxScreenSpaceError&#39;</span><span class="hl-1">, </span><span class="hl-11">48</span><span class="hl-1">); </span><span class="hl-8">// 极低画质</span><br/><span class="hl-6">viewLayerB</span><span class="hl-1">.</span><span class="hl-6">parameter</span><span class="hl-1">.</span><span class="hl-5">set</span><span class="hl-1">(</span><span class="hl-9">&#39;maxMemoryUsage&#39;</span><span class="hl-1">, </span><span class="hl-11">128</span><span class="hl-1">); </span><span class="hl-8">// 极低显存配额</span>
186
+ <pre><code class="typescript"><span class="hl-7">// 假设 viewLayerA 是当前主要查看的模型,viewLayerB 是背景参考</span><br/><br/><span class="hl-7">// 聚焦 ViewLayerA: 正常画质</span><br/><span class="hl-5">viewLayerA</span><span class="hl-1">.</span><span class="hl-5">parameter</span><span class="hl-1">.</span><span class="hl-4">reset</span><span class="hl-1">(</span><span class="hl-10">&#39;maxScreenSpaceError&#39;</span><span class="hl-1">);</span><br/><br/><span class="hl-7">// 降级 ViewLayerB: 仅显示轮廓,节省资源</span><br/><span class="hl-5">viewLayerB</span><span class="hl-1">.</span><span class="hl-5">parameter</span><span class="hl-1">.</span><span class="hl-4">set</span><span class="hl-1">(</span><span class="hl-10">&#39;maxScreenSpaceError&#39;</span><span class="hl-1">, </span><span class="hl-3">48</span><span class="hl-1">); </span><span class="hl-7">// 极低画质</span><br/><span class="hl-5">viewLayerB</span><span class="hl-1">.</span><span class="hl-5">parameter</span><span class="hl-1">.</span><span class="hl-4">set</span><span class="hl-1">(</span><span class="hl-10">&#39;maxMemoryUsage&#39;</span><span class="hl-1">, </span><span class="hl-3">128</span><span class="hl-1">); </span><span class="hl-7">// 极低显存配额</span>
187
187
  </code><button type="button">Copy</button></pre>
188
188
 
189
189
  <h2 id="debugging" class="tsd-anchor-link">Debugging<a href="#debugging" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h2>
190
190
  <p>在开发过程中,可以通过访问 <code>ViewLayer</code> 内部的 <code>tileset</code> 对象来实时监控渲染状态。</p>
191
- <pre><code class="typescript"><span class="hl-8">// 假设已获取 viewLayer 实例</span><br/><span class="hl-3">const</span><span class="hl-1"> </span><span class="hl-4">tileset</span><span class="hl-1"> = </span><span class="hl-6">viewLayer</span><span class="hl-1">.</span><span class="hl-6">tileset</span><span class="hl-1">;</span><br/><br/><span class="hl-8">// 1. 查看当前加载的瓦片数量</span><br/><span class="hl-6">console</span><span class="hl-1">.</span><span class="hl-5">log</span><span class="hl-1">(</span><span class="hl-6">tileset</span><span class="hl-1">.</span><span class="hl-6">loadedTiles</span><span class="hl-1">.</span><span class="hl-6">size</span><span class="hl-1">);</span><br/><br/><span class="hl-8">// 2. 查看当前实际生效的 SSE (如果开启了动态调整,此值会波动)</span><br/><span class="hl-6">console</span><span class="hl-1">.</span><span class="hl-5">log</span><span class="hl-1">(</span><span class="hl-6">tileset</span><span class="hl-1">.</span><span class="hl-6">currentMaxScreenSpaceError</span><span class="hl-1">);</span><br/><br/><span class="hl-8">// 3. 查看显存占用 (近似值,单位字节)</span><br/><span class="hl-8">// 注意: 这是内部私有属性,仅供调试参考</span><br/><span class="hl-6">console</span><span class="hl-1">.</span><span class="hl-5">log</span><span class="hl-1">((</span><span class="hl-6">tileset</span><span class="hl-1"> </span><span class="hl-10">as</span><span class="hl-1"> </span><span class="hl-7">any</span><span class="hl-1">).</span><span class="hl-6">cacheMemoryUsageInBytes</span><span class="hl-1"> / </span><span class="hl-11">1024</span><span class="hl-1"> / </span><span class="hl-11">1024</span><span class="hl-1"> + </span><span class="hl-9">&#39; MB&#39;</span><span class="hl-1">);</span>
191
+ <pre><code class="typescript"><span class="hl-7">// 假设已获取 viewLayer 实例</span><br/><span class="hl-8">const</span><span class="hl-1"> </span><span class="hl-6">tileset</span><span class="hl-1"> = </span><span class="hl-5">viewLayer</span><span class="hl-1">.</span><span class="hl-5">tileset</span><span class="hl-1">;</span><br/><br/><span class="hl-7">// 1. 查看当前加载的瓦片数量</span><br/><span class="hl-5">console</span><span class="hl-1">.</span><span class="hl-4">log</span><span class="hl-1">(</span><span class="hl-5">tileset</span><span class="hl-1">.</span><span class="hl-5">loadedTiles</span><span class="hl-1">.</span><span class="hl-5">size</span><span class="hl-1">);</span><br/><br/><span class="hl-7">// 2. 查看当前实际生效的 SSE (如果开启了动态调整,此值会波动)</span><br/><span class="hl-5">console</span><span class="hl-1">.</span><span class="hl-4">log</span><span class="hl-1">(</span><span class="hl-5">tileset</span><span class="hl-1">.</span><span class="hl-5">currentMaxScreenSpaceError</span><span class="hl-1">);</span><br/><br/><span class="hl-7">// 3. 查看显存占用 (近似值,单位字节)</span><br/><span class="hl-7">// 注意: 这是内部私有属性,仅供调试参考</span><br/><span class="hl-5">console</span><span class="hl-1">.</span><span class="hl-4">log</span><span class="hl-1">((</span><span class="hl-5">tileset</span><span class="hl-1"> </span><span class="hl-11">as</span><span class="hl-1"> </span><span class="hl-9">any</span><span class="hl-1">).</span><span class="hl-5">cacheMemoryUsageInBytes</span><span class="hl-1"> / </span><span class="hl-3">1024</span><span class="hl-1"> / </span><span class="hl-3">1024</span><span class="hl-1"> + </span><span class="hl-10">&#39; MB&#39;</span><span class="hl-1">);</span>
192
192
  </code><button type="button">Copy</button></pre>
193
193
 
194
194
  <h2 id="common-pitfalls" class="tsd-anchor-link">Common Pitfalls<a href="#common-pitfalls" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h2>