@realsee/five 6.8.7 → 6.8.9

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 (215) hide show
  1. package/ai_guides/README.md +2 -0
  2. package/ai_guides/features/flowing-fireworks-3d-pass.md +296 -0
  3. package/ai_guides/features/flowing-light-3d-pass.md +1 -0
  4. package/ai_guides/features/postprocessing.md +3 -1
  5. package/docs/assets/hierarchy.js +1 -1
  6. package/docs/assets/navigation.js +1 -1
  7. package/docs/assets/search.js +1 -1
  8. package/docs/classes/five.AdaptiveLuminancePass.html +1 -1
  9. package/docs/classes/five.BoundingMesh.html +1 -1
  10. package/docs/classes/five.Camera.html +1 -1
  11. package/docs/classes/five.EyeDomeLightingPass.html +1 -1
  12. package/docs/classes/five.Five.html +1 -1
  13. package/docs/classes/five.FivePass.html +1 -1
  14. package/docs/classes/five.FlowingLight2DPass.html +2 -2
  15. package/docs/classes/five.FlowingLight3DPass.html +2 -2
  16. package/docs/classes/five.GaussianBlurPass.html +1 -1
  17. package/docs/classes/five.InternalWebGLRenderer.html +1 -1
  18. package/docs/classes/five.Model.html +1 -1
  19. package/docs/classes/five.ModelScene.html +1 -1
  20. package/docs/classes/five.NetworkSubscribe.html +1 -1
  21. package/docs/classes/five.PBMContainer.html +1 -1
  22. package/docs/classes/five.PBMCustomShader.html +1 -1
  23. package/docs/classes/five.PBMGSObject.html +1 -1
  24. package/docs/classes/five.PBMGroup.html +1 -1
  25. package/docs/classes/five.PBMMesh.html +1 -1
  26. package/docs/classes/five.PBMMeshMaterial.html +1 -1
  27. package/docs/classes/five.PBMPanoFilter.html +1 -1
  28. package/docs/classes/five.PBMPointCloud.html +1 -1
  29. package/docs/classes/five.PBMPointCloudMaterial.html +1 -1
  30. package/docs/classes/five.PBMSkinnedMesh.html +1 -1
  31. package/docs/classes/five.PBMUpdateable.html +1 -1
  32. package/docs/classes/five.PanoCircleMesh.html +1 -1
  33. package/docs/classes/five.PanoCircleMeshCustom.html +1 -1
  34. package/docs/classes/five.PanoCircleMeshSolid.html +1 -1
  35. package/docs/classes/five.Parameter.html +1 -1
  36. package/docs/classes/five.Scene.html +1 -1
  37. package/docs/classes/five.Subscribe.html +1 -1
  38. package/docs/classes/five.TextureLoader.html +1 -1
  39. package/docs/classes/five.Tile3D.html +1 -1
  40. package/docs/classes/five.TileNode.html +1 -1
  41. package/docs/classes/five.TrajectoryNode.html +1 -1
  42. package/docs/classes/five.WorkResolvedObserver.html +1 -1
  43. package/docs/classes/gltf-loader.DDSLoader.html +1 -1
  44. package/docs/classes/gltf-loader.DRACOLoader.html +1 -1
  45. package/docs/classes/gltf-loader.GLTFLoader.html +1 -1
  46. package/docs/classes/gltf-loader.GLTFObject.html +1 -1
  47. package/docs/classes/gltf-loader.THREEGLTFLoader.html +1 -1
  48. package/docs/classes/line.Line.html +1 -1
  49. package/docs/classes/line.LineGeometry.html +1 -1
  50. package/docs/classes/line.LineMaterial.html +1 -1
  51. package/docs/classes/line.LineSegmentsGeometry.html +1 -1
  52. package/docs/classes/line.THREE_Line2.html +1 -1
  53. package/docs/classes/line.THREE_LineSegments2.html +1 -1
  54. package/docs/classes/plugins.BasePlugin.Controller.html +1 -1
  55. package/docs/classes/plugins.CSS2DObject.html +1 -1
  56. package/docs/classes/plugins.CSS3DObject.html +1 -1
  57. package/docs/classes/plugins.CSS3DSprite.html +1 -1
  58. package/docs/classes/plugins.InstancedPrefabBufferGeometry.html +1 -1
  59. package/docs/classes/plugins.Object3DHelperController.html +1 -1
  60. package/docs/classes/plugins.PointBufferGeometry.html +1 -1
  61. package/docs/classes/plugins.PrefabBufferGeometry.html +1 -1
  62. package/docs/classes/plugins.RoundedBoxGeometry.html +1 -1
  63. package/docs/classes/sticker.Sticker.html +1 -1
  64. package/docs/classes/vfx.Airflow.html +1 -1
  65. package/docs/classes/vfx.Flame.html +1 -1
  66. package/docs/classes/vfx.Particle.html +1 -1
  67. package/docs/classes/vfx.ParticleGPU.html +1 -1
  68. package/docs/classes/vfx.SpotLight.html +1 -1
  69. package/docs/documents/README.html +6 -0
  70. package/docs/documents/features_flowing-fireworks-3d-pass.html +242 -0
  71. package/docs/documents/features_flowing-light-3d-pass.html +1 -0
  72. package/docs/documents/features_postprocessing.html +3 -1
  73. package/docs/functions/plugins.calculatePath2DLength.html +1 -0
  74. package/docs/functions/plugins.calculatePath3DLength.html +1 -0
  75. package/docs/hierarchy.html +1 -1
  76. package/docs/index.html +6 -0
  77. package/docs/interfaces/five.AddableObject.html +1 -1
  78. package/docs/interfaces/five.AjaxOptions.html +1 -1
  79. package/docs/interfaces/five.BaseEvent.html +1 -1
  80. package/docs/interfaces/five.BaseExtendableEvent.html +1 -1
  81. package/docs/interfaces/five.EventCallback.html +1 -1
  82. package/docs/interfaces/five.GestureEvent.html +1 -1
  83. package/docs/interfaces/five.ImageOptions.html +1 -1
  84. package/docs/interfaces/five.IntersectEvent.html +1 -1
  85. package/docs/interfaces/five.IntersectMesh.html +1 -1
  86. package/docs/interfaces/five.IntersectMeshInterface.html +1 -1
  87. package/docs/interfaces/five.Intersection.html +1 -1
  88. package/docs/interfaces/five.LooseWorkWithExtrinsics.html +1 -1
  89. package/docs/interfaces/five.ModeChangeEvent.html +1 -1
  90. package/docs/interfaces/five.ModelControllerCustomInitArgs.html +1 -1
  91. package/docs/interfaces/five.ModelEvent.html +1 -1
  92. package/docs/interfaces/five.ModelSceneEvent.html +1 -1
  93. package/docs/interfaces/five.ModelTileEvent.html +1 -1
  94. package/docs/interfaces/five.MovePanoOptions.html +1 -1
  95. package/docs/interfaces/five.NetworkAbortError.html +1 -1
  96. package/docs/interfaces/five.NetworkFirbiddenError.html +1 -1
  97. package/docs/interfaces/five.NetworkOptions.html +1 -1
  98. package/docs/interfaces/five.NetworkProxyError.html +1 -1
  99. package/docs/interfaces/five.NetworkResourceEvent.html +1 -1
  100. package/docs/interfaces/five.NetworkResponseError.html +1 -1
  101. package/docs/interfaces/five.NetworkTimeoutError.html +1 -1
  102. package/docs/interfaces/five.ObjectEvent.html +1 -1
  103. package/docs/interfaces/five.PBMMaterial.html +1 -1
  104. package/docs/interfaces/five.PBMMeshMaterialParameters.html +1 -1
  105. package/docs/interfaces/five.PBMPointCloudMaterialParameters.html +1 -1
  106. package/docs/interfaces/five.PanoCircleMeshInterface.html +1 -1
  107. package/docs/interfaces/five.PanoEvent.html +1 -1
  108. package/docs/interfaces/five.PanoPrepareEvent.html +1 -1
  109. package/docs/interfaces/five.PanoTextureEvent.html +1 -1
  110. package/docs/interfaces/five.PanoramaControllerCustomInitArgs.html +1 -1
  111. package/docs/interfaces/five.PanoramaLikeControllerCustomInitArgs.html +1 -1
  112. package/docs/interfaces/five.ParameterMaterialValue.html +1 -1
  113. package/docs/interfaces/five.ParameterTilesetValue.html +1 -1
  114. package/docs/interfaces/five.ParameterValue.html +1 -1
  115. package/docs/interfaces/five.Pose.html +1 -1
  116. package/docs/interfaces/five.RenderEvent.html +1 -1
  117. package/docs/interfaces/five.ResolvedParameterValue.html +1 -1
  118. package/docs/interfaces/five.State.html +1 -1
  119. package/docs/interfaces/five.StateEvent.html +1 -1
  120. package/docs/interfaces/five.TextureOptions.html +1 -1
  121. package/docs/interfaces/five.TopviewControllerCustomInitArgs.html +1 -1
  122. package/docs/interfaces/five.VRPanoramaControllerCustomInitArgs.html +1 -1
  123. package/docs/interfaces/five.ViewLayer.html +1 -1
  124. package/docs/interfaces/five.WorkCubeImage.html +1 -1
  125. package/docs/interfaces/five.WorkImage.html +1 -1
  126. package/docs/interfaces/five.WorkObserver.html +1 -1
  127. package/docs/interfaces/five.WorkObserverProto.html +1 -1
  128. package/docs/interfaces/five.WorkTile.html +1 -1
  129. package/docs/interfaces/five.WorksEvent.html +1 -1
  130. package/docs/interfaces/five.XRControllerEvent.html +1 -1
  131. package/docs/interfaces/five.XRGestureEvent.html +1 -1
  132. package/docs/interfaces/five.XRPanoramaControllerCustomInitArgs.html +1 -1
  133. package/docs/interfaces/five.XRSessionEvent.html +1 -1
  134. package/docs/interfaces/plugins.BackgroundPluginController.html +1 -1
  135. package/docs/interfaces/plugins.BackgroundPluginType.EventMap.html +1 -1
  136. package/docs/interfaces/plugins.BasePlugin.State.html +1 -1
  137. package/docs/interfaces/plugins.CSS2DPluginController.html +1 -1
  138. package/docs/interfaces/plugins.CSS2DPluginType.EventMap.html +1 -1
  139. package/docs/interfaces/plugins.CSS2DPluginType.State.html +1 -1
  140. package/docs/interfaces/plugins.CSS3DPluginController.html +1 -1
  141. package/docs/interfaces/plugins.CSS3DPluginType.EventMap.html +1 -1
  142. package/docs/interfaces/plugins.CSS3DPluginType.State.html +1 -1
  143. package/docs/interfaces/plugins.DynamicPathLinePluginController.html +1 -1
  144. package/docs/interfaces/plugins.DynamicPathLinePluginType.EventMap.html +1 -1
  145. package/docs/interfaces/plugins.DynamicPathLinePluginType.State.html +1 -1
  146. package/docs/interfaces/plugins.GaussianSplattingEntranceAnimationController.html +1 -1
  147. package/docs/interfaces/plugins.GaussianSplattingEntranceAnimationPluginType.EventMap.html +1 -1
  148. package/docs/interfaces/plugins.GaussianSplattingEntranceAnimationPluginType.State.html +1 -1
  149. package/docs/interfaces/plugins.ItemMaskController.html +1 -1
  150. package/docs/interfaces/plugins.ItemMaskPluginType.EventMap.html +1 -1
  151. package/docs/interfaces/plugins.ItemMaskPluginType.State.html +1 -1
  152. package/docs/interfaces/plugins.Object3DHelperPluginType.BaseController.html +1 -1
  153. package/docs/interfaces/plugins.Object3DHelperPluginType.BaseHelper.html +1 -1
  154. package/docs/interfaces/plugins.Object3DHelperPluginType.BoundingBoxController.html +1 -1
  155. package/docs/interfaces/plugins.Object3DHelperPluginType.MoveController.html +1 -1
  156. package/docs/interfaces/plugins.Object3DHelperPluginType.MoveHelperAbstract.html +1 -1
  157. package/docs/interfaces/plugins.Object3DHelperPluginType.RotateController.html +1 -1
  158. package/docs/interfaces/plugins.Object3DHelperPluginType.RotateHelperAbstract.html +1 -1
  159. package/docs/interfaces/plugins.OrientationPluginController.html +1 -1
  160. package/docs/interfaces/plugins.OrientationPluginType.EventMap.html +1 -1
  161. package/docs/interfaces/plugins.OrientationPluginType.State.html +1 -1
  162. package/docs/interfaces/plugins.PanoAnimeController.html +1 -1
  163. package/docs/interfaces/plugins.PanoAnimePluginType.EventMap.html +1 -1
  164. package/docs/interfaces/plugins.PanoAnimePluginType.State.html +1 -1
  165. package/docs/interfaces/plugins.PluginTemplateType.EventMap.html +1 -1
  166. package/docs/interfaces/plugins.PluginTemplateType.State.html +1 -1
  167. package/docs/interfaces/plugins.TrajectoryController.html +9 -9
  168. package/docs/interfaces/react.FiveInjectionTypes.html +1 -1
  169. package/docs/interfaces/react.UseFivePluginOptions.html +1 -1
  170. package/docs/interfaces/react.UseFivePluginOptionsWithCreate.html +1 -1
  171. package/docs/modules/five.html +1 -1
  172. package/docs/modules/plugins.html +1 -1
  173. package/docs/modules.html +1 -1
  174. package/docs/types/five.FlowingLight2DPassLine.html +10 -0
  175. package/docs/types/five.FlowingLight3DPassLine.html +10 -0
  176. package/docs/types/five.ParseOptions.html +1 -1
  177. package/docs/types/plugins.BasePlugin.EventMap.html +1 -1
  178. package/five/index.js +48 -48
  179. package/five/index.mjs +23 -23
  180. package/five/renderer/index.d.ts +1 -1
  181. package/five/renderer/postprocessing/index.d.ts +3 -2
  182. package/five/renderer/postprocessing/passes/flowing-fireworks-3d-pass.d.ts +74 -0
  183. package/five/renderer/postprocessing/passes/flowing-light-2d-pass.d.ts +4 -5
  184. package/five/renderer/postprocessing/passes/flowing-light-3d-pass.d.ts +4 -5
  185. package/gltf-loader/index.js +3 -3
  186. package/gltf-loader/index.mjs +3 -3
  187. package/line/index.js +3 -3
  188. package/line/index.mjs +3 -3
  189. package/llms.txt +2 -0
  190. package/package.json +1 -1
  191. package/plugins/index.d.ts +1 -0
  192. package/plugins/index.js +4 -4
  193. package/plugins/index.mjs +26 -14
  194. package/plugins/utils/math.d.ts +2 -0
  195. package/react/index.js +2 -2
  196. package/react/index.mjs +2 -2
  197. package/shader-lib/index.js +2 -2
  198. package/shader-lib/index.mjs +2 -2
  199. package/sticker/index.js +3 -3
  200. package/sticker/index.mjs +3 -3
  201. package/umd/five-gltf-loader.js +3 -3
  202. package/umd/five-line.js +3 -3
  203. package/umd/five-plugins.js +4 -4
  204. package/umd/five-react.js +2 -2
  205. package/umd/five-shader-lib.js +2 -2
  206. package/umd/five-sticker.js +3 -3
  207. package/umd/five-vfx.js +2 -2
  208. package/umd/five-vue.js +2 -2
  209. package/umd/five.js +48 -48
  210. package/vfx/index.js +2 -2
  211. package/vfx/index.mjs +2 -2
  212. package/vue/index.js +2 -2
  213. package/vue/index.mjs +2 -2
  214. package/work-downloader/index.js +2 -2
  215. package/work-downloader/index.mjs +2 -2
package/five/index.mjs CHANGED
@@ -1,8 +1,8 @@
1
1
  /**
2
2
  * @license
3
3
  * @realsee/five
4
- * Generated: 2026/6/10
5
- * Version: 6.8.7
4
+ * Generated: 2026/7/7
5
+ * Version: 6.8.9
6
6
  * Terms:
7
7
  * Realsee SDK License Agreement
8
8
  * Update: July 28, 2021
@@ -5060,7 +5060,7 @@ var mi = [
5060
5060
  let n = Cr(t);
5061
5061
  (n === ".jpg" || n === ".jpeg") && (m.format = e.RGBFormat);
5062
5062
  }
5063
- n.encoding !== void 0 && (m.encoding = n.encoding), m.generateMipmaps = (s = n.generateMipmaps) == null ? !1 : s, m.minFilter = (c = n.minFilter) == null ? e.LinearFilter : c, m.magFilter = (l = n.magFilter) == null ? e.LinearFilter : l;
5063
+ n.encoding !== void 0 && (m.encoding = n.encoding), m.generateMipmaps = (s = n.generateMipmaps) == null ? !1 : s, m.minFilter = (c = n.minFilter) == null ? e.LinearFilter : c, m.magFilter = (l = n.magFilter) == null ? e.LinearFilter : l, n.wrapS && (m.wrapS = n.wrapS), n.wrapT && (m.wrapT = n.wrapT);
5064
5064
  let h = (d = (u = n.imageURL) == null ? void 0 : u.options) == null ? { key: "unknown" } : d;
5065
5065
  if (t = qr(t, (f = n.imageURL) == null ? void 0 : f.transform, h), (p = n.viaAjax) == null ? si : p) return n.fetcher.ajax(t, {
5066
5066
  timeout: n.timeout,
@@ -5098,7 +5098,7 @@ var mi = [
5098
5098
  }
5099
5099
  n && (m.format = e.RGBFormat);
5100
5100
  }
5101
- m.generateMipmaps = (s = n.generateMipmaps) == null ? !1 : s, m.minFilter = (c = n.minFilter) == null ? e.LinearFilter : c, m.magFilter = (l = n.magFilter) == null ? e.LinearFilter : l;
5101
+ m.generateMipmaps = (s = n.generateMipmaps) == null ? !1 : s, m.minFilter = (c = n.minFilter) == null ? e.LinearFilter : c, m.magFilter = (l = n.magFilter) == null ? e.LinearFilter : l, n.wrapS && (m.wrapS = n.wrapS), n.wrapT && (m.wrapT = n.wrapT);
5102
5102
  let h = [
5103
5103
  t[mi[0]],
5104
5104
  t[mi[1]],
@@ -16840,19 +16840,19 @@ var Im = -99999, Lm = "\n attribute vec3 instanceStart;\n attribute vec3 insta
16840
16840
  }), this.mesh = new e.InstancedMesh(n, this.material, t), this.mesh.frustumCulled = !1, this.lineScene.add(this.mesh);
16841
16841
  }
16842
16842
  render(e, t, n, r, i) {
16843
- if (!this.mesh || !this.material) return;
16844
- this.uTime += r;
16845
- let a = n.width, o = n.height;
16846
- (this.lineRenderTarget.width !== a || this.lineRenderTarget.height !== o) && this.lineRenderTarget.setSize(a, o), this.material.uniforms.uTime.value = this.uTime, this.material.uniforms.resolution.value.set(a, o), this.material.uniforms.fiveProjectionMatrix.value = this.camera.projectionMatrix, this.material.uniforms.fiveViewMatrix.value = this.camera.matrixWorldInverse;
16847
- let s = e.getRenderTarget(), c = e.getClearColor(), l = e.getClearAlpha();
16848
- e.setRenderTarget(this.lineRenderTarget), e.setClearColor(0, 0), e.clear(), e.render(this.lineScene, this.orthoCamera), e.setRenderTarget(s), e.setClearColor(c, l), this.blendMaterial.uniforms.tDiffuse.value = n.texture, this.blendMaterial.uniforms.tLine.value = this.lineRenderTarget.texture;
16849
- let u = this.renderToScreen ? null : t;
16850
- e.setRenderTarget(u), this.blendQuad.render(e);
16843
+ let a = !!(this.mesh && this.material);
16844
+ a && (this.uTime += r);
16845
+ let o = n.width, s = n.height;
16846
+ (this.lineRenderTarget.width !== o || this.lineRenderTarget.height !== s) && this.lineRenderTarget.setSize(o, s);
16847
+ let c = e.getRenderTarget(), l = e.getClearColor(), u = e.getClearAlpha();
16848
+ e.setRenderTarget(this.lineRenderTarget), e.setClearColor(0, 0), e.clear(), a && (this.material.uniforms.uTime.value = this.uTime, this.material.uniforms.resolution.value.set(o, s), this.material.uniforms.fiveProjectionMatrix.value = this.camera.projectionMatrix, this.material.uniforms.fiveViewMatrix.value = this.camera.matrixWorldInverse, e.render(this.lineScene, this.orthoCamera)), e.setRenderTarget(c), e.setClearColor(l, u), this.blendMaterial.uniforms.tDiffuse.value = n.texture, this.blendMaterial.uniforms.tLine.value = this.lineRenderTarget.texture;
16849
+ let d = this.renderToScreen ? null : t;
16850
+ e.setRenderTarget(d), this.blendQuad.render(e);
16851
16851
  }
16852
16852
  dispose() {
16853
16853
  this.mesh && (this.mesh.geometry.dispose(), this.lineScene.remove(this.mesh), this.mesh = null), this.material && (this.material.dispose(), this.material = null), this.lineRenderTarget && this.lineRenderTarget.dispose(), this.blendMaterial && this.blendMaterial.dispose(), this.blendQuad && this.blendQuad.dispose();
16854
16854
  }
16855
- }, Hm = "\n attribute vec3 instanceStart; // 线段起点\n attribute vec3 instanceEnd; // 线段终点\n attribute vec4 instanceColor; // 线段颜色 (rgb + opacity)\n attribute vec4 instanceData; // x: lineIndex, y: segmentIndex, z: accumulatedLength, w: lineWidth\n attribute vec3 instanceMeta; // x: totalLength, y: duration, z: tailLengthRatio\n attribute float instanceStartTime; // 线条开始时间\n\n uniform float uTime;\n uniform vec2 resolution;\n uniform mat4 fiveProjectionMatrix;\n uniform mat4 fiveViewMatrix;\n\n varying vec4 vColor;\n varying vec2 vUv;\n varying float vSegmentLength;\n varying float vAccumulatedLength;\n varying float vTotalLength;\n varying float vHeadPos;\n varying float vTailPos;\n varying float vTailLength;\n varying vec2 vSegmentStartScreen; // 线段起点的屏幕坐标\n varying vec2 vSegmentEndScreen; // 线段终点的屏幕坐标\n varying float vLineWidth; // 线宽,用于控制视觉粗细\n\n void main() {\n vUv = uv;\n vColor = instanceColor;\n \n // 计算线段的世界坐标\n vec3 segmentStart = instanceStart;\n vec3 segmentEnd = instanceEnd;\n \n // 计算当前线段的信息\n float totalLength = instanceMeta.x;\n float duration = instanceMeta.y;\n float tailLengthRatio = instanceMeta.z; // 尾巴长度比例\n float segmentLength = length(segmentEnd - segmentStart);\n float accumulatedLength = instanceData.z;\n float lineWidth = instanceData.w;\n \n // 传递给 fragment shader 用于计算渐变\n vSegmentLength = segmentLength;\n vAccumulatedLength = accumulatedLength;\n vTotalLength = totalLength;\n \n // 计算相对时间(从线条开始时间算起)\n float relativeTime = uTime - instanceStartTime;\n \n // 计算流光的头部和尾部位置\n float tailLengthWorld = totalLength * clamp(relativeTime / duration, 0.0, tailLengthRatio);\n float headPosWorld = mod(relativeTime / duration, 1.0) * totalLength;\n float tailPosWorld = headPosWorld - tailLengthWorld;\n if (tailPosWorld < 0.0) tailPosWorld += totalLength;\n \n vHeadPos = headPosWorld;\n vTailPos = tailPosWorld;\n vTailLength = tailLengthWorld;\n \n // 传递 lineWidth 到 fragment shader\n vLineWidth = lineWidth;\n \n // 计算线段起点和终点的屏幕坐标(NDC)\n vec4 clipStart = fiveProjectionMatrix * fiveViewMatrix * vec4(segmentStart, 1.0);\n vec4 clipEnd = fiveProjectionMatrix * fiveViewMatrix * vec4(segmentEnd, 1.0);\n \n // 处理端点在相机后面的情况:将线段裁剪到近平面\n // 当 clip.w <= 0 时,点在相机后面,NDC 会翻转导致线段消失\n float nearEps = 0.001;\n if (clipStart.w < nearEps && clipEnd.w < nearEps) {\n // 两个端点都在相机后面,整条线段不可见\n gl_Position = vec4(0.0, 0.0, -2.0, 1.0);\n return;\n }\n // 如果只有一个端点在后面,沿线段方向插值到近平面\n if (clipStart.w < nearEps) {\n float t_clip = (nearEps - clipStart.w) / (clipEnd.w - clipStart.w);\n clipStart = mix(clipStart, clipEnd, t_clip);\n } else if (clipEnd.w < nearEps) {\n float t_clip = (nearEps - clipEnd.w) / (clipStart.w - clipEnd.w);\n clipEnd = mix(clipEnd, clipStart, t_clip);\n }\n \n vec2 ndcStart = clipStart.xy / clipStart.w;\n vec2 ndcEnd = clipEnd.xy / clipEnd.w;\n \n vSegmentStartScreen = ndcStart;\n vSegmentEndScreen = ndcEnd;\n \n // 转换到屏幕空间(像素坐标)\n vec2 screenStart = (ndcStart + 1.0) * 0.5 * resolution;\n vec2 screenEnd = (ndcEnd + 1.0) * 0.5 * resolution;\n \n vec2 dir = normalize(screenEnd - screenStart);\n vec2 normal = vec2(-dir.y, dir.x);\n \n // PlaneGeometry(1, 20) 旋转 90° 后:\n // position.x 对应原来的 -Y(宽度方向,[-10, 10])\n // position.y 对应原来的 X(长度方向,[-0.5, 0.5])\n float t = position.y + 0.5; // 沿线段的位置 [0, 1]\n \n // 动态扩展几何体边界:基于 lineWidth 确保光线不被裁剪,但限制扩展范围\n // position.x 范围是 [-10, 10](PlaneGeometry 宽度 20)\n float expandedWidth = lineWidth * (1.0 + abs(position.x) * 0.2);\n vec2 offset = normal * position.x * expandedWidth;\n vec2 screenPos = mix(screenStart, screenEnd, t) + offset;\n \n // 转换回 NDC\n vec2 ndc = (screenPos / resolution) * 2.0 - 1.0;\n \n // 使用裁剪后的 clip 坐标插值深度,避免原始端点在相机后面导致 w < 0\n vec4 clipPos = mix(clipStart, clipEnd, t);\n // 确保 w 不为负(安全兜底)\n if (clipPos.w < nearEps) clipPos.w = nearEps;\n \n gl_Position = vec4(ndc * clipPos.w, clipPos.z, clipPos.w);\n }\n", Um = "\n uniform vec2 resolution;\n \n varying vec4 vColor;\n varying vec2 vUv;\n varying float vSegmentLength;\n varying float vAccumulatedLength;\n varying float vTotalLength;\n varying float vHeadPos;\n varying float vTailPos;\n varying float vTailLength;\n varying vec2 vSegmentStartScreen; // 线段起点的屏幕坐标(NDC)\n varying vec2 vSegmentEndScreen; // 线段终点的屏幕坐标(NDC)\n varying float vLineWidth; // 线宽,用于控制视觉粗细\n\n bool inSegment(float pos, float tail, float head) {\n return (tail <= head) ? (pos >= tail && pos <= head) : (pos >= tail || pos <= head);\n }\n\n float pathDistance(float from, float to, float totalLength) {\n float d = from - to;\n return (d < 0.0) ? d + totalLength : d;\n }\n \n // 胶囊形距离场:线段 + 圆形端点(圆角线条)\n float sdCapsule(vec2 p, vec2 a, vec2 b) {\n vec2 pa = p - a;\n vec2 ba = b - a;\n float h = clamp(dot(pa, ba) / dot(ba, ba), 0.0, 1.0);\n return length(pa - ba * h);\n }\n\n void main() {\n // 获取当前片元的屏幕坐标(NDC)\n vec2 uv = (gl_FragCoord.xy / resolution) * 2.0 - 1.0;\n \n // 计算屏幕空间的方向和距离\n vec2 screenDiff = vSegmentEndScreen - vSegmentStartScreen;\n float screenDist = length(screenDiff);\n \n if (screenDist < 1e-6) {\n discard;\n }\n \n vec2 screenDir = screenDiff / screenDist;\n \n // 将当前像素投影到线段上(与原逻辑一致)\n float projRatio = clamp(dot(uv - vSegmentStartScreen, screenDir), 0.0, screenDist) / screenDist;\n \n // 通过投影比例计算在世界空间路径上的位置\n float projWorld = projRatio * vSegmentLength;\n float posAlongPathWorld = vAccumulatedLength + projWorld;\n \n // 检查是否在流光范围内(头尾之间)\n if (!inSegment(posAlongPathWorld, vTailPos, vHeadPos)) {\n discard;\n }\n \n // 计算渐变强度(与原逻辑一致)\n float distAlong = pathDistance(posAlongPathWorld, vTailPos, vTotalLength);\n float grad = clamp(distAlong / vTailLength, 0.0, 1.0);\n\n vec2 aspect = vec2(resolution.x / resolution.y, 1.0);\n \n // 使用胶囊形距离场(圆角线条)\n float dScreen = sdCapsule(uv * aspect, vSegmentStartScreen * aspect, vSegmentEndScreen * aspect);\n \n // 使用 lineWidth 控制视觉粗细\n float baseDecay = 200.0 * (1.0 / vLineWidth);\n \n // 核心光线 + 紧凑光晕,避免远距离散射产生噪点\n float coreGlow = exp(-dScreen * baseDecay * 2.5);\n float softGlow = exp(-dScreen * baseDecay * 1.2);\n float rawGlow = coreGlow * 0.8 + softGlow * 0.2;\n \n // 抗锯齿:用 fwidth 在像素边界做平滑过渡,消除远距离锯齿\n // fwidth(dScreen) 表示距离场在相邻像素间的变化量\n // 当变化量大(远距离/线段短)时,smoothstep 的过渡带更宽,边缘更柔和\n float fw = fwidth(dScreen);\n // 对 rawGlow 做亚像素平滑:glow 值在 [0, fw*3] 范围内从 0 过渡到自身\n float aaGlow = rawGlow * smoothstep(0.0, fw * 3.0, rawGlow);\n \n float glow = aaGlow * grad;\n \n // 硬截断:距离过远的片元直接丢弃,避免大量微弱片元累积产生噪点\n if (glow < 0.005) discard;\n \n // 组合流光强度\n float alpha = glow * vColor.a;\n \n if (alpha < 0.01) discard;\n \n gl_FragColor = vec4(vColor.rgb, alpha);\n }\n", Wm = "\n varying vec2 vUv;\n \n void main() {\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n }\n", Gm = "\n uniform sampler2D tDiffuse;\n uniform sampler2D tLine;\n \n varying vec2 vUv;\n \n void main() {\n vec4 base = texture2D(tDiffuse, vUv);\n vec4 line = texture2D(tLine, vUv);\n \n // 使用加法混合叠加流光效果\n vec3 color = base.rgb + line.rgb * line.a;\n \n gl_FragColor = vec4(color, base.a);\n }\n", Km = class extends am {
16855
+ }, Hm = "\n attribute vec3 instanceStart; // 线段起点\n attribute vec3 instanceEnd; // 线段终点\n attribute vec4 instanceColor; // 线段颜色 (rgb + opacity)\n attribute vec4 instanceData; // x: lineIndex, y: segmentIndex, z: accumulatedLength, w: lineWidth\n attribute vec3 instanceMeta; // x: totalLength, y: duration, z: tailLengthRatio\n attribute float instanceStartTime; // 线条开始时间\n\n uniform float uTime;\n uniform vec2 resolution;\n uniform mat4 fiveProjectionMatrix;\n uniform mat4 fiveViewMatrix;\n\n varying vec4 vColor;\n varying vec2 vUv;\n varying float vSegmentLength;\n varying float vAccumulatedLength;\n varying float vTotalLength;\n varying float vHeadPos;\n varying float vTailPos;\n varying float vTailLength;\n varying vec2 vSegmentStartScreen; // 线段起点的屏幕坐标\n varying vec2 vSegmentEndScreen; // 线段终点的屏幕坐标\n varying float vLineWidth; // 线宽,用于控制视觉粗细\n\n void main() {\n vUv = uv;\n vColor = instanceColor;\n\n // 计算线段的世界坐标\n vec3 segmentStart = instanceStart;\n vec3 segmentEnd = instanceEnd;\n\n // 计算当前线段的信息\n float totalLength = instanceMeta.x;\n float duration = instanceMeta.y;\n float tailLengthRatio = instanceMeta.z; // 尾巴长度比例\n float segmentLength = length(segmentEnd - segmentStart);\n float accumulatedLength = instanceData.z;\n float lineWidth = instanceData.w;\n\n // 传递给 fragment shader 用于计算渐变\n vSegmentLength = segmentLength;\n vAccumulatedLength = accumulatedLength;\n vTotalLength = totalLength;\n\n // 计算相对时间(从线条开始时间算起)\n float relativeTime = uTime - instanceStartTime;\n\n // 计算流光的头部和尾部位置\n float tailLengthWorld = totalLength * clamp(relativeTime / duration, 0.0, tailLengthRatio);\n float headPosWorld = mod(relativeTime / duration, 1.0) * totalLength;\n float tailPosWorld = headPosWorld - tailLengthWorld;\n if (tailPosWorld < 0.0) tailPosWorld += totalLength;\n\n vHeadPos = headPosWorld;\n vTailPos = tailPosWorld;\n vTailLength = tailLengthWorld;\n\n // 传递 lineWidth 到 fragment shader\n vLineWidth = lineWidth;\n\n // 计算线段起点和终点的屏幕坐标(NDC)\n vec4 clipStart = fiveProjectionMatrix * fiveViewMatrix * vec4(segmentStart, 1.0);\n vec4 clipEnd = fiveProjectionMatrix * fiveViewMatrix * vec4(segmentEnd, 1.0);\n\n // 处理端点在相机后面的情况:将线段裁剪到近平面\n // 当 clip.w <= 0 时,点在相机后面,NDC 会翻转导致线段消失\n float nearEps = 0.001;\n if (clipStart.w < nearEps && clipEnd.w < nearEps) {\n // 两个端点都在相机后面,整条线段不可见\n gl_Position = vec4(0.0, 0.0, -2.0, 1.0);\n return;\n }\n // 如果只有一个端点在后面,沿线段方向插值到近平面\n if (clipStart.w < nearEps) {\n float t_clip = (nearEps - clipStart.w) / (clipEnd.w - clipStart.w);\n clipStart = mix(clipStart, clipEnd, t_clip);\n } else if (clipEnd.w < nearEps) {\n float t_clip = (nearEps - clipEnd.w) / (clipStart.w - clipEnd.w);\n clipEnd = mix(clipEnd, clipStart, t_clip);\n }\n\n vec2 ndcStart = clipStart.xy / clipStart.w;\n vec2 ndcEnd = clipEnd.xy / clipEnd.w;\n\n vSegmentStartScreen = ndcStart;\n vSegmentEndScreen = ndcEnd;\n\n // 转换到屏幕空间(像素坐标)\n vec2 screenStart = (ndcStart + 1.0) * 0.5 * resolution;\n vec2 screenEnd = (ndcEnd + 1.0) * 0.5 * resolution;\n\n vec2 dir = normalize(screenEnd - screenStart);\n vec2 normal = vec2(-dir.y, dir.x);\n\n // PlaneGeometry(1, 20) 旋转 90° 后:\n // position.x 对应原来的 -Y(宽度方向,[-10, 10])\n // position.y 对应原来的 X(长度方向,[-0.5, 0.5])\n float t = position.y + 0.5; // 沿线段的位置 [0, 1]\n\n // 动态扩展几何体边界:基于 lineWidth 确保光线不被裁剪,但限制扩展范围\n // position.x 范围是 [-10, 10](PlaneGeometry 宽度 20)\n float expandedWidth = lineWidth * (1.0 + abs(position.x) * 0.2);\n vec2 offset = normal * position.x * expandedWidth;\n vec2 screenPos = mix(screenStart, screenEnd, t) + offset;\n\n // 转换回 NDC\n vec2 ndc = (screenPos / resolution) * 2.0 - 1.0;\n\n // 使用裁剪后的 clip 坐标插值深度,避免原始端点在相机后面导致 w < 0\n vec4 clipPos = mix(clipStart, clipEnd, t);\n // 确保 w 不为负(安全兜底)\n if (clipPos.w < nearEps) clipPos.w = nearEps;\n\n gl_Position = vec4(ndc * clipPos.w, clipPos.z, clipPos.w);\n }\n", Um = "\n uniform vec2 resolution;\n\n varying vec4 vColor;\n varying vec2 vUv;\n varying float vSegmentLength;\n varying float vAccumulatedLength;\n varying float vTotalLength;\n varying float vHeadPos;\n varying float vTailPos;\n varying float vTailLength;\n varying vec2 vSegmentStartScreen; // 线段起点的屏幕坐标(NDC)\n varying vec2 vSegmentEndScreen; // 线段终点的屏幕坐标(NDC)\n varying float vLineWidth; // 线宽,用于控制视觉粗细\n\n bool inSegment(float pos, float tail, float head) {\n return (tail <= head) ? (pos >= tail && pos <= head) : (pos >= tail || pos <= head);\n }\n\n float pathDistance(float from, float to, float totalLength) {\n float d = from - to;\n return (d < 0.0) ? d + totalLength : d;\n }\n\n // 胶囊形距离场:线段 + 圆形端点(圆角线条)\n float sdCapsule(vec2 p, vec2 a, vec2 b) {\n vec2 pa = p - a;\n vec2 ba = b - a;\n float h = clamp(dot(pa, ba) / dot(ba, ba), 0.0, 1.0);\n return length(pa - ba * h);\n }\n\n void main() {\n // 获取当前片元的屏幕坐标(NDC)\n vec2 uv = (gl_FragCoord.xy / resolution) * 2.0 - 1.0;\n\n // 计算屏幕空间的方向和距离\n vec2 screenDiff = vSegmentEndScreen - vSegmentStartScreen;\n float screenDist = length(screenDiff);\n\n if (screenDist < 1e-6) {\n discard;\n }\n\n vec2 screenDir = screenDiff / screenDist;\n\n // 将当前像素投影到线段上(与原逻辑一致)\n float projRatio = clamp(dot(uv - vSegmentStartScreen, screenDir), 0.0, screenDist) / screenDist;\n\n // 通过投影比例计算在世界空间路径上的位置\n float projWorld = projRatio * vSegmentLength;\n float posAlongPathWorld = vAccumulatedLength + projWorld;\n\n // 检查是否在流光范围内(头尾之间)\n if (!inSegment(posAlongPathWorld, vTailPos, vHeadPos)) {\n discard;\n }\n\n // 计算渐变强度(与原逻辑一致)\n float distAlong = pathDistance(posAlongPathWorld, vTailPos, vTotalLength);\n float grad = clamp(distAlong / vTailLength, 0.0, 1.0);\n\n vec2 aspect = vec2(resolution.x / resolution.y, 1.0);\n\n // 使用胶囊形距离场(圆角线条)\n float dScreen = sdCapsule(uv * aspect, vSegmentStartScreen * aspect, vSegmentEndScreen * aspect);\n\n // 使用 lineWidth 控制视觉粗细\n float baseDecay = 200.0 * (1.0 / vLineWidth);\n\n // 核心光线 + 紧凑光晕,避免远距离散射产生噪点\n float coreGlow = exp(-dScreen * baseDecay * 2.5);\n float softGlow = exp(-dScreen * baseDecay * 1.2);\n float rawGlow = coreGlow * 0.8 + softGlow * 0.2;\n\n // 抗锯齿:用 fwidth 在像素边界做平滑过渡,消除远距离锯齿\n // fwidth(dScreen) 表示距离场在相邻像素间的变化量\n // 当变化量大(远距离/线段短)时,smoothstep 的过渡带更宽,边缘更柔和\n float fw = fwidth(dScreen);\n // 对 rawGlow 做亚像素平滑:glow 值在 [0, fw*3] 范围内从 0 过渡到自身\n float aaGlow = rawGlow * smoothstep(0.0, fw * 3.0, rawGlow);\n\n float glow = aaGlow * grad;\n\n // 硬截断:距离过远的片元直接丢弃,避免大量微弱片元累积产生噪点\n if (glow < 0.005) discard;\n\n // 组合流光强度\n float alpha = glow * vColor.a;\n\n if (alpha < 0.01) discard;\n\n gl_FragColor = vec4(vColor.rgb, alpha);\n }\n", Wm = "\n varying vec2 vUv;\n\n void main() {\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n }\n", Gm = "\n uniform sampler2D tDiffuse;\n uniform sampler2D tLine;\n\n varying vec2 vUv;\n\n void main() {\n vec4 base = texture2D(tDiffuse, vUv);\n vec4 line = texture2D(tLine, vUv);\n\n // 使用加法混合叠加流光效果\n vec3 color = base.rgb + line.rgb * line.a;\n\n gl_FragColor = vec4(color, base.a);\n }\n", Km = class extends am {
16856
16856
  constructor(t) {
16857
16857
  super(), this.mesh = null, this.material = null, this.uTime = 0, this.lines = [], this.uTime = 0, this.camera = t, this.lineScene = new e.Scene(), this.orthoCamera = new e.OrthographicCamera(-1, 1, 1, -1, 0, 1), this.lineRenderTarget = new e.WebGLRenderTarget(this.camera.resolution.x, this.camera.resolution.y, {
16858
16858
  minFilter: e.LinearFilter,
@@ -16967,14 +16967,14 @@ var Im = -99999, Lm = "\n attribute vec3 instanceStart;\n attribute vec3 insta
16967
16967
  }), this.mesh = new e.InstancedMesh(n, this.material, t), this.mesh.frustumCulled = !1, this.lineScene.add(this.mesh);
16968
16968
  }
16969
16969
  render(e, t, n, r, i) {
16970
- if (!this.mesh || !this.material) return;
16971
- this.uTime += r;
16972
- let a = n.width, o = n.height;
16973
- (this.lineRenderTarget.width !== a || this.lineRenderTarget.height !== o) && this.lineRenderTarget.setSize(a, o), this.material.uniforms.uTime.value = this.uTime, this.material.uniforms.resolution.value.set(a, o), this.material.uniforms.fiveProjectionMatrix.value = this.camera.projectionMatrix, this.material.uniforms.fiveViewMatrix.value = this.camera.matrixWorldInverse;
16974
- let s = e.getRenderTarget(), c = e.getClearColor(), l = e.getClearAlpha();
16975
- e.setRenderTarget(this.lineRenderTarget), e.setClearColor(0, 0), e.clear(), e.render(this.lineScene, this.orthoCamera), e.setRenderTarget(s), e.setClearColor(c, l), this.blendMaterial.uniforms.tDiffuse.value = n.texture, this.blendMaterial.uniforms.tLine.value = this.lineRenderTarget.texture;
16976
- let u = this.renderToScreen ? null : t;
16977
- e.setRenderTarget(u), this.blendQuad.render(e);
16970
+ let a = !!(this.mesh && this.material);
16971
+ a && (this.uTime += r);
16972
+ let o = n.width, s = n.height;
16973
+ (this.lineRenderTarget.width !== o || this.lineRenderTarget.height !== s) && this.lineRenderTarget.setSize(o, s);
16974
+ let c = e.getRenderTarget(), l = e.getClearColor(), u = e.getClearAlpha();
16975
+ e.setRenderTarget(this.lineRenderTarget), e.setClearColor(0, 0), e.clear(), a && (this.material.uniforms.uTime.value = this.uTime, this.material.uniforms.resolution.value.set(o, s), this.material.uniforms.fiveProjectionMatrix.value = this.camera.projectionMatrix, this.material.uniforms.fiveViewMatrix.value = this.camera.matrixWorldInverse, e.render(this.lineScene, this.orthoCamera)), e.setRenderTarget(c), e.setClearColor(l, u), this.blendMaterial.uniforms.tDiffuse.value = n.texture, this.blendMaterial.uniforms.tLine.value = this.lineRenderTarget.texture;
16976
+ let d = this.renderToScreen ? null : t;
16977
+ e.setRenderTarget(d), this.blendQuad.render(e);
16978
16978
  }
16979
16979
  dispose() {
16980
16980
  this.mesh && (this.mesh.geometry.dispose(), this.lineScene.remove(this.mesh), this.mesh = null), this.material && (this.material.dispose(), this.material = null), this.lineRenderTarget && this.lineRenderTarget.dispose(), this.blendMaterial && this.blendMaterial.dispose(), this.blendQuad && this.blendQuad.dispose();
@@ -24373,7 +24373,7 @@ Object.assign(Nv.prototype, { isLineGeometry: !0 });
24373
24373
  //#region build/line/index.js
24374
24374
  var Pv = 14467195, Fv = 8, Iv = 2, Lv = 20, Rv = null, zv = class extends e.Object3D {
24375
24375
  static get version() {
24376
- return "6.8.7";
24376
+ return "6.8.9";
24377
24377
  }
24378
24378
  constructor(t = new e.Vector3(), n = new e.Vector3()) {
24379
24379
  super(), this.type = "FiveLine", this.needsRender = !0;
@@ -26672,7 +26672,7 @@ var Wy = function(...e) {
26672
26672
  }
26673
26673
  }, Yy = 1e3, Xy = 90, Zy = (e) => e.replace("//vrlab-public.ljcdn.com/", "//vr-public.realsee-cdn.cn/").replace("//vrlab-image4.ljcdn.com/", "//vr-image-4.realsee-cdn.cn/").replace("//vrlab-image3.ljcdn.com/", "//vr-image-3.realsee-cdn.cn/").replace("//vrlab-image2.ljcdn.com/", "//vr-image-2.realsee-cdn.cn/").replace("//vrlab-image1.ljcdn.com/", "//vr-image-1.realsee-cdn.cn/"), Qy = new e.Sphere(), $y = new e.Box3(), eb = new e.Vector4(), tb = new e.Vector4(), nb = new e.Color(), rb = new e.Vector2(), ib = /* @__PURE__ */ new WeakMap(), ab = nm([$p(null)]), ob = {}, sb = class t extends an {
26674
26674
  static get version() {
26675
- return "6.8.7";
26675
+ return "6.8.9";
26676
26676
  }
26677
26677
  static get dracoPath() {
26678
26678
  return eo.decoderPath;
@@ -1,3 +1,3 @@
1
- export { EffectComposer, FivePass, type Pass, AdaptiveLuminancePass, EyeDomeLightingPass, FlowingLight2DPass, FlowingLight3DPass, GaussianBlurPass } from './postprocessing';
1
+ export { EffectComposer, FivePass, type Pass, AdaptiveLuminancePass, EyeDomeLightingPass, FlowingLight2DPass, type FlowingLight2DPassLine, FlowingLight3DPass, type FlowingLight3DPassLine, GaussianBlurPass, } from './postprocessing';
2
2
  export { FullScreenQuad } from './tools/full-screen-quad';
3
3
  export { FiveRenderer } from './five-renderer';
@@ -3,5 +3,6 @@ export { type Pass, FivePass } from './passes/pass';
3
3
  export { AdaptiveLuminancePass } from './passes/adaptive-luminance-pass';
4
4
  export { EyeDomeLightingPass } from './passes/eye-dome-lighting-pass';
5
5
  export { GaussianBlurPass } from './passes/gaussian-blur-pass';
6
- export { FlowingLight2DPass } from './passes/flowing-light-2d-pass';
7
- export { FlowingLight3DPass } from './passes/flowing-light-3d-pass';
6
+ export { FlowingLight2DPass, type FlowingLight2DPassLine } from './passes/flowing-light-2d-pass';
7
+ export { FlowingLight3DPass, type FlowingLight3DPassLine } from './passes/flowing-light-3d-pass';
8
+ export { FlowingFireworks3DPass } from './passes/flowing-fireworks-3d-pass';
@@ -0,0 +1,74 @@
1
+ import * as THREE from 'three';
2
+ import { FivePass } from './pass';
3
+ import { type Camera } from '../../../core/camera';
4
+ type FireworksLine = {
5
+ id?: string;
6
+ points: THREE.Vector3[];
7
+ totalLength: number;
8
+ color: THREE.Color;
9
+ opacity?: number;
10
+ tailLengthRatio?: number;
11
+ duration?: number;
12
+ startTime?: number;
13
+ particleCount?: number;
14
+ emissionRate?: number;
15
+ spread?: number;
16
+ particleSize?: number;
17
+ particleLife?: number;
18
+ gravity?: THREE.Vector3;
19
+ leadRatio?: number;
20
+ };
21
+ /**
22
+ * FlowingFireworks3DPass
23
+ *
24
+ * 与 FlowingLight3DPass 配套使用:在每条流光线条的「尾部位置」持续喷射出
25
+ * 烟花状向四周发散的粒子。粒子的运动周期、尾部位置计算与 FlowingLight3DPass
26
+ * 完全一致(共用 points / totalLength / duration / startTime / tailLengthRatio),
27
+ * 因此把本 Pass 与 FlowingLight3DPass 配置同样的线条数据即可获得「流光拖尾烟花」效果。
28
+ */
29
+ export declare class FlowingFireworks3DPass extends FivePass {
30
+ private camera;
31
+ private points;
32
+ private material;
33
+ private uTime;
34
+ private lines;
35
+ private blocks;
36
+ private geometry;
37
+ private arrPosition;
38
+ private arrVelocity;
39
+ private arrAccel;
40
+ private arrColor;
41
+ private arrBirthTime;
42
+ private arrMaxLife;
43
+ private arrSeed;
44
+ private arrSize;
45
+ private particleScene;
46
+ private orthoCamera;
47
+ private particleRenderTarget;
48
+ private blendMaterial;
49
+ private blendQuad;
50
+ private _tmpTail;
51
+ constructor(camera: Camera);
52
+ /** 批量设置线条(替换现有全部线条) */
53
+ setLines(lines: FireworksLine[]): void;
54
+ /** 追加一条或多条线,返回生成的 id 数组 */
55
+ addLine(...lines: FireworksLine[]): string[];
56
+ /** 按 id 移除一条或多条线,返回实际移除的数量 */
57
+ removeLine(...ids: string[]): number;
58
+ /**
59
+ * 通过 id 修改单条线的参数(部分更新)。
60
+ * 大多数字段(points、color、totalLength、duration 等)会在下一帧发射时即时生效,
61
+ * 无需重建;仅当 particleCount 改变时才会重建粒子缓冲。
62
+ */
63
+ setLine(params: {
64
+ id: string;
65
+ } & Partial<Omit<FireworksLine, 'id'>>): void;
66
+ private _rebuild;
67
+ private _samplePointAtLength;
68
+ private _emitParticle;
69
+ private _emit;
70
+ render(renderer: THREE.WebGLRenderer, writeBuffer: THREE.WebGLRenderTarget, readBuffer: THREE.WebGLRenderTarget, deltaTime: number, _maskActive?: boolean): void;
71
+ dispose(): void;
72
+ private _disposeParticles;
73
+ }
74
+ export {};
@@ -1,7 +1,7 @@
1
1
  import * as THREE from 'three';
2
2
  import { FivePass } from './pass';
3
3
  import { type Camera } from '../../../core/camera';
4
- type Line = {
4
+ export type FlowingLight2DPassLine = {
5
5
  id?: string;
6
6
  points: THREE.Vector2[];
7
7
  totalLength: number;
@@ -27,15 +27,14 @@ export declare class FlowingLight2DPass extends FivePass {
27
27
  /** 将 2D 归一化坐标点转为内部 vec3(z = MARKER_Z) */
28
28
  private toInternal;
29
29
  private toInternalLine;
30
- setLines(lines: Line[]): void;
31
- addLine(...lines: Line[]): string[];
30
+ setLines(lines: FlowingLight2DPassLine[]): void;
31
+ addLine(...lines: FlowingLight2DPassLine[]): string[];
32
32
  removeLine(...ids: string[]): number;
33
33
  setLine(params: {
34
34
  id: string;
35
- } & Partial<Omit<Line, 'id'>>): void;
35
+ } & Partial<Omit<FlowingLight2DPassLine, 'id'>>): void;
36
36
  private _updateLineAttributes;
37
37
  private _rebuildMesh;
38
38
  render(renderer: THREE.WebGLRenderer, writeBuffer: THREE.WebGLRenderTarget, readBuffer: THREE.WebGLRenderTarget, deltaTime: number, maskActive?: boolean): void;
39
39
  dispose(): void;
40
40
  }
41
- export {};
@@ -1,7 +1,7 @@
1
1
  import * as THREE from 'three';
2
2
  import { FivePass } from './pass';
3
3
  import { type Camera } from '../../../core/camera';
4
- type Line = {
4
+ export type FlowingLight3DPassLine = {
5
5
  id?: string;
6
6
  points: THREE.Vector3[];
7
7
  totalLength: number;
@@ -24,15 +24,14 @@ export declare class FlowingLight3DPass extends FivePass {
24
24
  private blendMaterial;
25
25
  private blendQuad;
26
26
  constructor(camera: Camera);
27
- setLines(lines: Line[]): void;
28
- addLine(...lines: Line[]): string[];
27
+ setLines(lines: FlowingLight3DPassLine[]): void;
28
+ addLine(...lines: FlowingLight3DPassLine[]): string[];
29
29
  removeLine(...ids: string[]): number;
30
30
  setLine(params: {
31
31
  id: string;
32
- } & Partial<Omit<Line, 'id'>>): void;
32
+ } & Partial<Omit<FlowingLight3DPassLine, 'id'>>): void;
33
33
  private _updateLineAttributes;
34
34
  private _rebuildMesh;
35
35
  render(renderer: THREE.WebGLRenderer, writeBuffer: THREE.WebGLRenderTarget, readBuffer: THREE.WebGLRenderTarget, deltaTime: number, maskActive?: boolean): void;
36
36
  dispose(): void;
37
37
  }
38
- export {};
@@ -1,8 +1,8 @@
1
1
  /**
2
2
  * @license
3
3
  * @realsee/five
4
- * Generated: 2026/6/10
5
- * Version: 6.8.7
4
+ * Generated: 2026/7/7
5
+ * Version: 6.8.9
6
6
  * Terms:
7
7
  * Realsee SDK License Agreement
8
8
  * Update: July 28, 2021
@@ -258,4 +258,4 @@
258
258
  `),i=[`float glossinessFactor = glossiness;`,`#ifdef USE_GLOSSINESSMAP`,` vec4 texelGlossiness = texture2D( glossinessMap, vUv );`,` // reads channel A, compatible with a glTF Specular-Glossiness (RGBA) texture`,` glossinessFactor *= texelGlossiness.a;`,`#endif`].join(`
259
259
  `),a=[`PhysicalMaterial material;`,`material.diffuseColor = diffuseColor.rgb;`,`vec3 dxy = max( abs( dFdx( geometryNormal ) ), abs( dFdy( geometryNormal ) ) );`,`float geometryRoughness = max( max( dxy.x, dxy.y ), dxy.z );`,`material.specularRoughness = max( 1.0 - glossinessFactor, 0.0525 );// 0.0525 corresponds to the base mip of a 256 cubemap.`,`material.specularRoughness += geometryRoughness;`,`material.specularRoughness = min( material.specularRoughness, 1.0 );`,`material.specularColor = specularFactor.rgb;`].join(`
260
260
  `),o={specular:{value:new c.Color().setHex(16777215)},glossiness:{value:1},specularMap:{value:null},glossinessMap:{value:null}};this._extraUniforms=o,this.onBeforeCompile=function(e){for(var s in o)e.uniforms[s]=o[s];e.fragmentShader=e.fragmentShader.replace(`uniform float roughness;`,`uniform vec3 specular;`),e.fragmentShader=e.fragmentShader.replace(`uniform float metalness;`,`uniform float glossiness;`),e.fragmentShader=e.fragmentShader.replace(`#include <roughnessmap_pars_fragment>`,t),e.fragmentShader=e.fragmentShader.replace(`#include <metalnessmap_pars_fragment>`,n),e.fragmentShader=e.fragmentShader.replace(`#include <roughnessmap_fragment>`,r),e.fragmentShader=e.fragmentShader.replace(`#include <metalnessmap_fragment>`,i),e.fragmentShader=e.fragmentShader.replace(`#include <lights_physical_fragment>`,a)},Object.defineProperties(this,{specular:{get:function(){return o.specular.value},set:function(e){o.specular.value=e}},specularMap:{get:function(){return o.specularMap.value},set:function(e){o.specularMap.value=e}},glossiness:{get:function(){return o.glossiness.value},set:function(e){o.glossiness.value=e}},glossinessMap:{get:function(){return o.glossinessMap.value},set:function(e){o.glossinessMap.value=e,e?(this.defines.USE_GLOSSINESSMAP=``,this.defines.USE_ROUGHNESSMAP=``):(delete this.defines.USE_ROUGHNESSMAP,delete this.defines.USE_GLOSSINESSMAP)}}}),delete this.metalness,delete this.roughness,delete this.metalnessMap,delete this.roughnessMap,this.setValues(e)}h.prototype=Object.create(c.MeshStandardMaterial.prototype),h.prototype.constructor=h,h.prototype.copy=function(e){return c.MeshStandardMaterial.prototype.copy.call(this,e),this.specularMap=e.specularMap,this.specular.copy(e.specular),this.glossinessMap=e.glossinessMap,this.glossiness=e.glossiness,delete this.metalness,delete this.roughness,delete this.metalnessMap,delete this.roughnessMap,this};function g(){return{name:n.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS,specularGlossinessParams:[`color`,`map`,`lightMap`,`lightMapIntensity`,`aoMap`,`aoMapIntensity`,`emissive`,`emissiveIntensity`,`emissiveMap`,`bumpMap`,`bumpScale`,`normalMap`,`normalMapType`,`displacementMap`,`displacementScale`,`displacementBias`,`specularMap`,`specular`,`glossinessMap`,`glossiness`,`alphaMap`,`envMap`,`envMapIntensity`,`refractionRatio`],getMaterialType:function(){return h},extendParams:function(e,t,n){var r=t.extensions[this.name];e.color=new c.Color(1,1,1),e.opacity=1;var i=[];if(Array.isArray(r.diffuseFactor)){var a=r.diffuseFactor;e.color.fromArray(a),e.opacity=a[3]}if(r.diffuseTexture!==void 0&&i.push(n.assignTexture(e,`map`,r.diffuseTexture)),e.emissive=new c.Color(0,0,0),e.glossiness=r.glossinessFactor===void 0?1:r.glossinessFactor,e.specular=new c.Color(1,1,1),Array.isArray(r.specularFactor)&&e.specular.fromArray(r.specularFactor),r.specularGlossinessTexture!==void 0){var o=r.specularGlossinessTexture;i.push(n.assignTexture(e,`glossinessMap`,o)),i.push(n.assignTexture(e,`specularMap`,o))}return Promise.all(i)},createMaterial:function(e){var t=new h(e);return t.fog=!0,t.color=e.color,t.map=e.map===void 0?null:e.map,t.lightMap=null,t.lightMapIntensity=1,t.aoMap=e.aoMap===void 0?null:e.aoMap,t.aoMapIntensity=1,t.emissive=e.emissive,t.emissiveIntensity=1,t.emissiveMap=e.emissiveMap===void 0?null:e.emissiveMap,t.bumpMap=e.bumpMap===void 0?null:e.bumpMap,t.bumpScale=1,t.normalMap=e.normalMap===void 0?null:e.normalMap,t.normalMapType=c.TangentSpaceNormalMap,e.normalScale&&(t.normalScale=e.normalScale),t.displacementMap=null,t.displacementScale=1,t.displacementBias=0,t.specularMap=e.specularMap===void 0?null:e.specularMap,t.specular=e.specular,t.glossinessMap=e.glossinessMap===void 0?null:e.glossinessMap,t.glossiness=e.glossiness,t.alphaMap=null,t.envMap=e.envMap===void 0?null:e.envMap,t.envMapIntensity=1,t.refractionRatio=.98,t}}}function _(){this.name=n.KHR_MESH_QUANTIZATION}function v(e,t,n,r){c.Interpolant.call(this,e,t,n,r)}v.prototype=Object.create(c.Interpolant.prototype),v.prototype.constructor=v,v.prototype.copySampleValue_=function(e){for(var t=this.resultBuffer,n=this.sampleValues,r=this.valueSize,i=e*r*3+r,a=0;a!==r;a++)t[a]=n[i+a];return t},v.prototype.beforeStart_=v.prototype.copySampleValue_,v.prototype.afterEnd_=v.prototype.copySampleValue_,v.prototype.interpolate_=function(e,t,n,r){for(var i=this.resultBuffer,a=this.sampleValues,o=this.valueSize,s=o*2,c=o*3,l=r-t,u=(n-t)/l,d=u*u,f=d*u,p=e*c,m=p-c,h=-2*f+3*d,g=f-d,_=1-h,v=g-d+u,y=0;y!==o;y++){var b=a[m+y+o],x=a[m+y+s]*l,S=a[p+y+o],C=a[p+y]*l;i[y]=_*b+v*x+h*S+g*C}return i};function y(e){this.parser=e,this.name=n.REALSEE_MATERIALS_LIGHTMAP}y.prototype.getMaterialType=function(e){return c.MeshPhongMaterial},y.prototype.extendParams=function(e,t,n){if(!t.extensions||!t.extensions[this.name])return Promise.resolve();var r=[],i=t.extensions[this.name];return i.lightMapTexture!==void 0&&r.push(n.assignTexture(e,`lightMap`,i.lightMapTexture)),i.lightMapIntensity!==void 0&&(e.lightMapIntensity=i.lightMapIntensity),Promise.all(r)};var b={FLOAT:5126,FLOAT_MAT3:35675,FLOAT_MAT4:35676,FLOAT_VEC2:35664,FLOAT_VEC3:35665,FLOAT_VEC4:35666,LINEAR:9729,REPEAT:10497,SAMPLER_2D:35678,POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6,UNSIGNED_BYTE:5121,UNSIGNED_SHORT:5123},x={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array},S={9728:c.NearestFilter,9729:c.LinearFilter,9984:c.NearestMipmapNearestFilter,9985:c.LinearMipmapNearestFilter,9986:c.NearestMipmapLinearFilter,9987:c.LinearMipmapLinearFilter},C={33071:c.ClampToEdgeWrapping,33648:c.MirroredRepeatWrapping,10497:c.RepeatWrapping},w={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},T={POSITION:`position`,NORMAL:`normal`,TANGENT:`tangent`,TEXCOORD_0:`uv`,TEXCOORD_1:`uv2`,COLOR_0:`color`,WEIGHTS_0:`skinWeight`,JOINTS_0:`skinIndex`},E={scale:`scale`,translation:`position`,rotation:`quaternion`,weights:`morphTargetInfluences`},D={CUBICSPLINE:void 0,LINEAR:c.InterpolateLinear,STEP:c.InterpolateDiscrete},O={OPAQUE:`OPAQUE`,MASK:`MASK`,BLEND:`BLEND`},k={"image/png":c.RGBAFormat,"image/jpeg":c.RGBFormat};function A(e,t){return typeof e!=`string`||e===``?``:(/^https?:\/\//i.test(t)&&/^\//.test(e)&&(t=t.replace(/(^https?:\/\/[^\/]+).*/i,`$1`)),/^(https?:)?\/\//i.test(e)||/^data:.*,.*$/i.test(e)||/^blob:.*$/i.test(e)?e:t+e)}function j(e){return e.DefaultMaterial===void 0&&(e.DefaultMaterial=new c.MeshStandardMaterial({color:16777215,emissive:0,metalness:1,roughness:1,transparent:!1,depthTest:!0,side:c.FrontSide})),e.DefaultMaterial}function M(e,t,n){for(var r in n.extensions)e[r]===void 0&&(t.userData.gltfExtensions=t.userData.gltfExtensions||{},t.userData.gltfExtensions[r]=n.extensions[r])}function N(e,t){t.extras!==void 0&&(typeof t.extras==`object`?Object.assign(e.userData,t.extras):console.warn(`THREE.GLTFLoader: Ignoring primitive type .extras, `+t.extras))}function P(e,t,n){for(var r=!1,i=!1,a=0,o=t.length;a<o;a++){var s=t[a];if(s.POSITION!==void 0&&(r=!0),s.NORMAL!==void 0&&(i=!0),r&&i)break}if(!r&&!i)return Promise.resolve(e);for(var c=[],l=[],a=0,o=t.length;a<o;a++){var s=t[a];if(r){var u=s.POSITION===void 0?e.attributes.position:n.getDependency(`accessor`,s.POSITION);c.push(u)}if(i){var u=s.NORMAL===void 0?e.attributes.normal:n.getDependency(`accessor`,s.NORMAL);l.push(u)}}return Promise.all([Promise.all(c),Promise.all(l)]).then(function(t){var n=t[0],a=t[1];return r&&(e.morphAttributes.position=n),i&&(e.morphAttributes.normal=a),e.morphTargetsRelative=!0,e})}function F(e,t){if(e.updateMorphTargets(),t.weights!==void 0)for(var n=0,r=t.weights.length;n<r;n++)e.morphTargetInfluences[n]=t.weights[n];if(t.extras&&Array.isArray(t.extras.targetNames)){var i=t.extras.targetNames;if(e.morphTargetInfluences.length===i.length){e.morphTargetDictionary={};for(var n=0,r=i.length;n<r;n++)e.morphTargetDictionary[i[n]]=n}else console.warn(`THREE.GLTFLoader: Invalid extras.targetNames length. Ignoring names.`)}}function I(e){var t=e.extensions&&e.extensions[n.KHR_DRACO_MESH_COMPRESSION];return t?`draco:`+t.bufferView+`:`+t.indices+`:`+L(t.attributes):e.indices+`:`+L(e.attributes)+`:`+e.mode}function L(e){for(var t=``,n=Object.keys(e).sort(),r=0,i=n.length;r<i;r++)t+=n[r]+`:`+e[n[r]]+`;`;return t}function R(e,n,r){this.json=e||{},this.extensions=n||{},this.options=r||{},this.cache=new t,this.associations=new Map,this.primitiveCache={},this.textureLoader=new c.TextureLoader(this.options.manager),this.textureLoader.setCrossOrigin(this.options.crossOrigin),this.fileLoader=new c.FileLoader(this.options.manager),this.fileLoader.setResponseType(`arraybuffer`),this.options.crossOrigin===`use-credentials`&&this.fileLoader.setWithCredentials(!0)}R.prototype.parse=function(e,t){var n=this,r=this.json,i=this.extensions;this.cache.removeAll(),this.markDefs(),Promise.all([this.getDependencies(`scene`),this.getDependencies(`animation`),this.getDependencies(`camera`)]).then(function(t){var a={scene:t[0][r.scene||0],scenes:t[0],animations:t[1],cameras:t[2],asset:r.asset,parser:n,userData:{}};M(i,a,r),N(a,r),e(a)}).catch(t)},R.prototype.markDefs=function(){for(var e=this.json.nodes||[],t=this.json.skins||[],n=this.json.meshes||[],r={},i={},a=0,o=t.length;a<o;a++)for(var s=t[a].joints,c=0,l=s.length;c<l;c++)e[s[c]].isBone=!0;for(var u=0,d=e.length;u<d;u++){var f=e[u];f.mesh!==void 0&&(r[f.mesh]===void 0&&(r[f.mesh]=i[f.mesh]=0),r[f.mesh]++,f.skin!==void 0&&(n[f.mesh].isSkinnedMesh=!0))}this.json.meshReferences=r,this.json.meshUses=i},R.prototype.getDependency=function(e,t){var r=e+`:`+t,i=this.cache.get(r);if(!i){switch(e){case`scene`:i=this.loadScene(t);break;case`node`:i=this.loadNode(t);break;case`mesh`:i=this.loadMesh(t);break;case`accessor`:i=this.loadAccessor(t);break;case`bufferView`:i=this.loadBufferView(t);break;case`buffer`:i=this.loadBuffer(t);break;case`material`:i=this.loadMaterial(t);break;case`texture`:i=this.loadTexture(t);break;case`skin`:i=this.loadSkin(t);break;case`animation`:i=this.loadAnimation(t);break;case`camera`:i=this.loadCamera(t);break;case`light`:i=this.extensions[n.KHR_LIGHTS_PUNCTUAL].loadLight(t);break;default:throw Error(`Unknown type: `+e)}this.cache.add(r,i)}return i},R.prototype.getDependencies=function(e){var t=this.cache.get(e);if(!t){var n=this,r=this.json[e+(e===`mesh`?`es`:`s`)]||[];t=Promise.all(r.map(function(t,r){return n.getDependency(e,r)})),this.cache.add(e,t)}return t},R.prototype.loadBuffer=function(e){var t=this.json.buffers[e],r=this.fileLoader;if(t.type&&t.type!==`arraybuffer`)throw Error(`THREE.GLTFLoader: `+t.type+` buffer type is not supported.`);if(t.uri===void 0&&e===0)return Promise.resolve(this.extensions[n.KHR_BINARY_GLTF].body);var i=this.options;return new Promise(function(e,n){r.load(A(t.uri,i.path),e,void 0,function(){n(Error(`THREE.GLTFLoader: Failed to load buffer "`+t.uri+`".`))})})},R.prototype.loadBufferView=function(e){var t=this.json.bufferViews[e];return this.getDependency(`buffer`,t.buffer).then(function(e){var n=t.byteLength||0,r=t.byteOffset||0;return e.slice(r,r+n)})},R.prototype.loadAccessor=function(e){var t=this,n=this.json,r=this.json.accessors[e];if(r.bufferView===void 0&&r.sparse===void 0)return Promise.resolve(null);var i=[];return r.bufferView===void 0?i.push(null):i.push(this.getDependency(`bufferView`,r.bufferView)),r.sparse!==void 0&&(i.push(this.getDependency(`bufferView`,r.sparse.indices.bufferView)),i.push(this.getDependency(`bufferView`,r.sparse.values.bufferView))),Promise.all(i).then(function(e){var i=e[0],a=w[r.type],o=x[r.componentType],s=o.BYTES_PER_ELEMENT,l=s*a,u=r.byteOffset||0,d=r.bufferView===void 0?void 0:n.bufferViews[r.bufferView].byteStride,f=r.normalized===!0,p,m;if(d&&d!==l){var h=Math.floor(u/d),g=`InterleavedBuffer:`+r.bufferView+`:`+r.componentType+`:`+h+`:`+r.count,_=t.cache.get(g);_||(p=new o(i,h*d,r.count*d/s),_=new c.InterleavedBuffer(p,d/s),t.cache.add(g,_)),m=new c.InterleavedBufferAttribute(_,a,u%d/s,f)}else p=i===null?new o(r.count*a):new o(i,u,r.count*a),m=new c.BufferAttribute(p,a,f);if(r.sparse!==void 0){var v=w.SCALAR,y=x[r.sparse.indices.componentType],b=r.sparse.indices.byteOffset||0,S=r.sparse.values.byteOffset||0,C=new y(e[1],b,r.sparse.count*v),T=new o(e[2],S,r.sparse.count*a);i!==null&&(m=new c.BufferAttribute(m.array.slice(),m.itemSize,m.normalized));for(var E=0,D=C.length;E<D;E++){var O=C[E];if(m.setX(O,T[E*a]),a>=2&&m.setY(O,T[E*a+1]),a>=3&&m.setZ(O,T[E*a+2]),a>=4&&m.setW(O,T[E*a+3]),a>=5)throw Error(`THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.`)}}return m})},R.prototype.loadTexture=function(e){var t=this,r=this.json,i=this.options,a=this.textureLoader,o=self.URL||self.webkitURL,s=r.textures[e],l=s.extensions||{},u=l[n.MSFT_TEXTURE_DDS]?r.images[l[n.MSFT_TEXTURE_DDS].source]:r.images[s.source],d=u.uri,f=!1;return u.bufferView!==void 0&&(d=t.getDependency(`bufferView`,u.bufferView).then(function(e){f=!0;var t=new Blob([e],{type:u.mimeType});return d=o.createObjectURL(t),d})),Promise.resolve(d).then(function(e){var r=i.manager.getHandler(e);return r||(r=l[n.MSFT_TEXTURE_DDS]?t.extensions[n.MSFT_TEXTURE_DDS].ddsLoader:a),new Promise(function(t,n){r.load(A(e,i.path),t,void 0,n)})}).then(function(n){f===!0&&o.revokeObjectURL(d),n.flipY=!1,s.name&&(n.name=s.name),u.mimeType in k&&(n.format=k[u.mimeType]);var i=(r.samplers||{})[s.sampler]||{};return n.magFilter=S[i.magFilter]||c.LinearFilter,n.minFilter=S[i.minFilter]||c.LinearMipmapLinearFilter,n.wrapS=C[i.wrapS]||c.RepeatWrapping,n.wrapT=C[i.wrapT]||c.RepeatWrapping,t.associations.set(n,{type:`textures`,index:e}),n})},R.prototype.assignTexture=function(e,t,r){var i=this;return this.getDependency(`texture`,r.index).then(function(a){if(!a.isCompressedTexture)switch(t){case`aoMap`:case`emissiveMap`:case`metalnessMap`:case`normalMap`:case`roughnessMap`:a.format=c.RGBFormat;break}if(r.texCoord!==void 0&&r.texCoord!=0&&!(t===`aoMap`&&r.texCoord==1)&&console.warn(`THREE.GLTFLoader: Custom UV set `+r.texCoord+` for texture `+t+` not yet supported.`),i.extensions[n.KHR_TEXTURE_TRANSFORM]){var o=r.extensions===void 0?void 0:r.extensions[n.KHR_TEXTURE_TRANSFORM];if(o){var s=i.associations.get(a);a=i.extensions[n.KHR_TEXTURE_TRANSFORM].extendTexture(a,o),i.associations.set(a,s)}}e[t]=a})},R.prototype.assignFinalMaterial=function(e){var t=e.geometry,n=e.material,r=t.attributes.tangent!==void 0,i=t.attributes.color!==void 0,a=t.attributes.normal===void 0,o=e.isSkinnedMesh===!0,s=Object.keys(t.morphAttributes).length>0,l=s&&t.morphAttributes.normal!==void 0;if(e.isPoints){var u=`PointsMaterial:`+n.uuid,d=this.cache.get(u);d||(d=new c.PointsMaterial,c.Material.prototype.copy.call(d,n),d.color.copy(n.color),d.map=n.map,d.sizeAttenuation=!1,this.cache.add(u,d)),n=d}else if(e.isLine){var u=`LineBasicMaterial:`+n.uuid,f=this.cache.get(u);f||(f=new c.LineBasicMaterial,c.Material.prototype.copy.call(f,n),f.color.copy(n.color),this.cache.add(u,f)),n=f}if(r||i||a||o||s){var u=`ClonedMaterial:`+n.uuid+`:`;n.isGLTFSpecularGlossinessMaterial&&(u+=`specular-glossiness:`),o&&(u+=`skinning:`),r&&(u+=`vertex-tangents:`),i&&(u+=`vertex-colors:`),a&&(u+=`flat-shading:`),s&&(u+=`morph-targets:`),l&&(u+=`morph-normals:`);var p=this.cache.get(u);p||(p=n.clone(),o&&(p.skinning=!0),r&&(p.vertexTangents=!0),i&&(p.vertexColors=!0),a&&(p.flatShading=!0),s&&(p.morphTargets=!0),l&&(p.morphNormals=!0),this.cache.add(u,p),this.associations.set(p,this.associations.get(n))),n=p}n.aoMap&&t.attributes.uv2===void 0&&t.attributes.uv!==void 0&&t.setAttribute(`uv2`,t.attributes.uv),n.normalScale&&!r&&(n.normalScale.y=-n.normalScale.y),n.clearcoatNormalScale&&!r&&(n.clearcoatNormalScale.y=-n.clearcoatNormalScale.y),e.material=n},R.prototype.loadMaterial=function(e){var t=this,r=this.json,i=this.extensions,a=r.materials[e],o,s={},l=a.extensions||{},u=[];if(l[n.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS]){var d=i[n.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS];o=d.getMaterialType(),u.push(d.extendParams(s,a,t))}else if(l[n.KHR_MATERIALS_UNLIT]){var f=i[n.KHR_MATERIALS_UNLIT];o=f.getMaterialType(),u.push(f.extendParams(s,a,t))}else{o=c.MeshStandardMaterial;var p=a.pbrMetallicRoughness||{};if(s.color=new c.Color(1,1,1),s.opacity=1,Array.isArray(p.baseColorFactor)){var m=p.baseColorFactor;s.color.fromArray(m),s.opacity=m[3]}p.baseColorTexture!==void 0&&u.push(t.assignTexture(s,`map`,p.baseColorTexture)),s.metalness=p.metallicFactor===void 0?1:p.metallicFactor,s.roughness=p.roughnessFactor===void 0?1:p.roughnessFactor,p.metallicRoughnessTexture!==void 0&&(u.push(t.assignTexture(s,`metalnessMap`,p.metallicRoughnessTexture)),u.push(t.assignTexture(s,`roughnessMap`,p.metallicRoughnessTexture)))}a.doubleSided===!0&&(s.side=c.DoubleSide);var g=a.alphaMode||O.OPAQUE;if(g===O.BLEND?(s.transparent=!0,s.depthWrite=!1):(s.transparent=!1,g===O.MASK&&(s.alphaTest=a.alphaCutoff===void 0?.5:a.alphaCutoff)),a.normalTexture!==void 0&&o!==c.MeshBasicMaterial&&(u.push(t.assignTexture(s,`normalMap`,a.normalTexture)),s.normalScale=new c.Vector2(1,1),a.normalTexture.scale!==void 0&&s.normalScale.set(a.normalTexture.scale,a.normalTexture.scale)),a.occlusionTexture!==void 0&&o!==c.MeshBasicMaterial&&(u.push(t.assignTexture(s,`aoMap`,a.occlusionTexture)),a.occlusionTexture.strength!==void 0&&(s.aoMapIntensity=a.occlusionTexture.strength)),a.emissiveFactor!==void 0&&o!==c.MeshBasicMaterial&&(s.emissive=new c.Color().fromArray(a.emissiveFactor)),a.emissiveTexture!==void 0&&o!==c.MeshBasicMaterial&&u.push(t.assignTexture(s,`emissiveMap`,a.emissiveTexture)),l[n.KHR_MATERIALS_CLEARCOAT]){var _=i[n.KHR_MATERIALS_CLEARCOAT];o=_.getMaterialType(),u.push(_.extendParams(s,{extensions:l},t))}if(l[n.KHR_MATERIALS_TRANSMISSION]){var _=i[n.KHR_MATERIALS_TRANSMISSION];o=_.getMaterialType(),u.push(_.extendParams(s,{extensions:l},t))}if(l[n.REALSEE_MATERIALS_LIGHTMAP]){var v=i[n.REALSEE_MATERIALS_LIGHTMAP];o=v.getMaterialType(),u.push(v.extendParams(s,{extensions:l},t))}return Promise.all(u).then(function(){var r=o===h?i[n.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS].createMaterial(s):new o(s);return a.name&&(r.name=a.name),r.map&&(r.map.encoding=c.sRGBEncoding),r.emissiveMap&&(r.emissiveMap.encoding=c.sRGBEncoding),N(r,a),t.associations.set(r,{type:`materials`,index:e}),a.extensions&&M(i,r,a),r})};function z(e,t,n){var r=t.attributes,i=new c.Box3;if(r.POSITION!==void 0){var a=n.json.accessors[r.POSITION],o=a.min,s=a.max;if(o!==void 0&&s!==void 0)i.set(new c.Vector3(o[0],o[1],o[2]),new c.Vector3(s[0],s[1],s[2]));else{console.warn(`THREE.GLTFLoader: Missing min/max properties for accessor POSITION.`);return}}else return;var l=t.targets;if(l!==void 0){for(var u=new c.Vector3,d=new c.Vector3,f=0,p=l.length;f<p;f++){var m=l[f];if(m.POSITION!==void 0){var a=n.json.accessors[m.POSITION],o=a.min,s=a.max;o!==void 0&&s!==void 0?(d.setX(Math.max(Math.abs(o[0]),Math.abs(s[0]))),d.setY(Math.max(Math.abs(o[1]),Math.abs(s[1]))),d.setZ(Math.max(Math.abs(o[2]),Math.abs(s[2]))),u.max(d)):console.warn(`THREE.GLTFLoader: Missing min/max properties for accessor POSITION.`)}}i.expandByVector(u)}e.boundingBox=i;var h=new c.Sphere;i.getCenter(h.center),h.radius=i.min.distanceTo(i.max)/2,e.boundingSphere=h}function B(e,t,n){var r=t.attributes,i=[];function a(t,r){return n.getDependency(`accessor`,t).then(function(t){e.setAttribute(r,t)})}for(var o in r){var s=T[o]||o.toLowerCase();s in e.attributes||i.push(a(r[o],s))}if(t.indices!==void 0&&!e.index){var c=n.getDependency(`accessor`,t.indices).then(function(t){e.setIndex(t)});i.push(c)}return N(e,t),z(e,t,n),Promise.all(i).then(function(){return t.targets===void 0?e:P(e,t.targets,n)})}function V(e,t){var n=e.getIndex();if(n===null){var r=[],i=e.getAttribute(`position`);if(i!==void 0){for(var a=0;a<i.count;a++)r.push(a);e.setIndex(r),n=e.getIndex()}else return console.error(`THREE.GLTFLoader.toTrianglesDrawMode(): Undefined position attribute. Processing not possible.`),e}var o=n.count-2,s=[];if(t===c.TriangleFanDrawMode)for(var a=1;a<=o;a++)s.push(n.getX(0)),s.push(n.getX(a)),s.push(n.getX(a+1));else for(var a=0;a<o;a++)a%2==0?(s.push(n.getX(a)),s.push(n.getX(a+1)),s.push(n.getX(a+2))):(s.push(n.getX(a+2)),s.push(n.getX(a+1)),s.push(n.getX(a)));s.length/3!==o&&console.error(`THREE.GLTFLoader.toTrianglesDrawMode(): Unable to generate correct amount of triangles.`);var l=e.clone();return l.setIndex(s),l}return R.prototype.loadGeometries=function(e){var t=this,r=this.extensions,i=this.primitiveCache;function a(e){return r[n.KHR_DRACO_MESH_COMPRESSION].decodePrimitive(e,t).then(function(n){return B(n,e,t)})}for(var o=[],s=0,l=e.length;s<l;s++){var u=e[s],d=I(u),f=i[d];if(f)o.push(f.promise);else{var p=u.extensions&&u.extensions[n.KHR_DRACO_MESH_COMPRESSION]?a(u):B(new c.BufferGeometry,u,t);i[d]={primitive:u,promise:p},o.push(p)}}return Promise.all(o)},R.prototype.loadMesh=function(e){for(var t=this,n=this.json.meshes[e],r=n.primitives,i=[],a=0,o=r.length;a<o;a++){var s=r[a].material===void 0?j(this.cache):this.getDependency(`material`,r[a].material);i.push(s)}return i.push(t.loadGeometries(r)),Promise.all(i).then(function(i){for(var a=i.slice(0,i.length-1),o=i[i.length-1],s=[],l=0,u=o.length;l<u;l++){var d=o[l],f=r[l],p,m=a[l];if(f.mode===b.TRIANGLES||f.mode===b.TRIANGLE_STRIP||f.mode===b.TRIANGLE_FAN||f.mode===void 0)p=n.isSkinnedMesh===!0?new c.SkinnedMesh(d,m):new c.Mesh(d,m),p.isSkinnedMesh===!0&&!p.geometry.attributes.skinWeight.normalized&&p.normalizeSkinWeights(),f.mode===b.TRIANGLE_STRIP?p.geometry=V(p.geometry,c.TriangleStripDrawMode):f.mode===b.TRIANGLE_FAN&&(p.geometry=V(p.geometry,c.TriangleFanDrawMode));else if(f.mode===b.LINES)p=new c.LineSegments(d,m);else if(f.mode===b.LINE_STRIP)p=new c.Line(d,m);else if(f.mode===b.LINE_LOOP)p=new c.LineLoop(d,m);else if(f.mode===b.POINTS)p=new c.Points(d,m);else throw Error(`THREE.GLTFLoader: Primitive mode unsupported: `+f.mode);Object.keys(p.geometry.morphAttributes).length>0&&F(p,n),p.name=n.name||`mesh_`+e,o.length>1&&(p.name+=`_`+l),N(p,n),t.assignFinalMaterial(p),s.push(p)}if(s.length===1)return s[0];for(var h=new c.Group,l=0,u=s.length;l<u;l++)h.add(s[l]);return h})},R.prototype.loadCamera=function(e){var t,n=this.json.cameras[e],r=n[n.type];if(!r){console.warn(`THREE.GLTFLoader: Missing camera parameters.`);return}return n.type===`perspective`?t=new c.PerspectiveCamera(c.MathUtils.radToDeg(r.yfov),r.aspectRatio||1,r.znear||1,r.zfar||2e6):n.type===`orthographic`&&(t=new c.OrthographicCamera(-r.xmag,r.xmag,r.ymag,-r.ymag,r.znear,r.zfar)),n.name&&(t.name=n.name),N(t,n),Promise.resolve(t)},R.prototype.loadSkin=function(e){var t=this.json.skins[e],n={joints:t.joints};return t.inverseBindMatrices===void 0?Promise.resolve(n):this.getDependency(`accessor`,t.inverseBindMatrices).then(function(e){return n.inverseBindMatrices=e,n})},R.prototype.loadAnimation=function(e){for(var t=this.json.animations[e],n=[],r=[],i=[],a=[],o=[],s=0,l=t.channels.length;s<l;s++){var u=t.channels[s],d=t.samplers[u.sampler],f=u.target,p=f.node===void 0?f.id:f.node,m=t.parameters===void 0?d.input:t.parameters[d.input],h=t.parameters===void 0?d.output:t.parameters[d.output];n.push(this.getDependency(`node`,p)),r.push(this.getDependency(`accessor`,m)),i.push(this.getDependency(`accessor`,h)),a.push(d),o.push(f)}return Promise.all([Promise.all(n),Promise.all(r),Promise.all(i),Promise.all(a),Promise.all(o)]).then(function(n){for(var r=n[0],i=n[1],a=n[2],o=n[3],s=n[4],l=[],u=0,d=r.length;u<d;u++){var f=r[u],p=i[u],m=a[u],h=o[u],g=s[u];if(f!==void 0){f.updateMatrix(),f.matrixAutoUpdate=!0;var _;switch(E[g.path]){case E.weights:_=c.NumberKeyframeTrack;break;case E.rotation:_=c.QuaternionKeyframeTrack;break;case E.position:case E.scale:default:_=c.VectorKeyframeTrack;break}var y=f.name?f.name:f.uuid,b=h.interpolation===void 0?c.InterpolateLinear:D[h.interpolation],x=[];E[g.path]===E.weights?f.traverse(function(e){e.isMesh===!0&&e.morphTargetInfluences&&x.push(e.name?e.name:e.uuid)}):x.push(y);var S=m.array;if(m.normalized){var C;if(S.constructor===Int8Array)C=1/127;else if(S.constructor===Uint8Array)C=1/255;else if(S.constructor==Int16Array)C=1/32767;else if(S.constructor===Uint16Array)C=1/65535;else throw Error(`THREE.GLTFLoader: Unsupported output accessor component type.`);for(var w=new Float32Array(S.length),T=0,O=S.length;T<O;T++)w[T]=S[T]*C;S=w}for(var T=0,O=x.length;T<O;T++){var k=new _(x[T]+`.`+E[g.path],p.array,S,b);h.interpolation===`CUBICSPLINE`&&(k.createInterpolant=function(e){return new v(this.times,this.values,this.getValueSize()/3,e)},k.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline=!0),l.push(k)}}}return new c.AnimationClip(t.name?t.name:`animation_`+e,void 0,l)})},R.prototype.loadNode=function(e){var t=this.json,r=this.extensions,i=this,a=t.meshReferences,o=t.meshUses,s=t.nodes[e];return function(){var e=[];return s.mesh!==void 0&&e.push(i.getDependency(`mesh`,s.mesh).then(function(e){var t;if(a[s.mesh]>1){var n=o[s.mesh]++;t=e.clone(),t.name+=`_instance_`+n}else t=e;return s.weights!==void 0&&t.traverse(function(e){if(e.isMesh)for(var t=0,n=s.weights.length;t<n;t++)e.morphTargetInfluences[t]=s.weights[t]}),t})),s.camera!==void 0&&e.push(i.getDependency(`camera`,s.camera)),s.extensions&&s.extensions[n.KHR_LIGHTS_PUNCTUAL]&&s.extensions[n.KHR_LIGHTS_PUNCTUAL].light!==void 0&&e.push(i.getDependency(`light`,s.extensions[n.KHR_LIGHTS_PUNCTUAL].light)),Promise.all(e)}().then(function(t){var n=s.isBone===!0?new c.Bone:t.length>1?new c.Group:t.length===1?t[0]:new c.Object3D;if(n!==t[0])for(var a=0,o=t.length;a<o;a++)n.add(t[a]);if(s.name&&(n.userData.name=s.name,n.name=c.PropertyBinding.sanitizeNodeName(s.name)),N(n,s),s.extensions&&M(r,n,s),s.matrix!==void 0){var l=new c.Matrix4;l.fromArray(s.matrix),n.applyMatrix4(l)}else s.translation!==void 0&&n.position.fromArray(s.translation),s.rotation!==void 0&&n.quaternion.fromArray(s.rotation),s.scale!==void 0&&n.scale.fromArray(s.scale);return i.associations.set(n,{type:`nodes`,index:e}),n})},R.prototype.loadScene=function(){function e(t,n,r,i){var a=r.nodes[t];return i.getDependency(`node`,t).then(function(e){if(a.skin===void 0)return e;var t;return i.getDependency(`skin`,a.skin).then(function(e){t=e;for(var n=[],r=0,a=t.joints.length;r<a;r++)n.push(i.getDependency(`node`,t.joints[r]));return Promise.all(n)}).then(function(n){return e.traverse(function(e){if(e.isMesh){for(var r=[],i=[],a=0,o=n.length;a<o;a++){var s=n[a];if(s){r.push(s);var l=new c.Matrix4;t.inverseBindMatrices!==void 0&&l.fromArray(t.inverseBindMatrices.array,a*16),i.push(l)}else console.warn(`THREE.GLTFLoader: Joint "%s" could not be found.`,t.joints[a])}e.bind(new c.Skeleton(r,i),e.matrixWorld)}}),e})}).then(function(t){n.add(t);var o=[];if(a.children)for(var s=a.children,c=0,l=s.length;c<l;c++){var u=s[c];o.push(e(u,t,r,i))}return Promise.all(o)})}return function(t){var n=this.json,r=this.extensions,i=this.json.scenes[t],a=this,o=new c.Group;i.name&&(o.name=i.name),N(o,i),i.extensions&&M(r,o,i);for(var s=i.nodes||[],l=[],u=0,d=s.length;u<d;u++)l.push(e(s[u],o,n,a));return Promise.all(l).then(function(){return o})}}(),e})(),u=function(e){c.Loader.call(this,e),this.decoderPath=``,this.decoderConfig={},this.decoderBinary=null,this.decoderPending=null,this.workerLimit=4,this.workerPool=[],this.workerNextTaskID=1,this.workerSourceURL=``,this.defaultAttributeIDs={position:`POSITION`,normal:`NORMAL`,color:`COLOR`,uv:`TEX_COORD`},this.defaultAttributeTypes={position:`Float32Array`,normal:`Float32Array`,color:`Float32Array`,uv:`Float32Array`}};u.prototype=Object.assign(Object.create(c.Loader.prototype),{constructor:u,setDecoderPath:function(e){return this.decoderPath=e,this},setDecoderConfig:function(e){return this.decoderConfig=e,this},setWorkerLimit:function(e){return this.workerLimit=e,this},setVerbosity:function(){console.warn(`THREE.DRACOLoader: The .setVerbosity() method has been removed.`)},setDrawMode:function(){console.warn(`THREE.DRACOLoader: The .setDrawMode() method has been removed.`)},setSkipDequantization:function(){console.warn(`THREE.DRACOLoader: The .setSkipDequantization() method has been removed.`)},load:function(e,t,n,r){var i=new c.FileLoader(this.manager);i.setPath(this.path),i.setResponseType(`arraybuffer`),this.crossOrigin===`use-credentials`&&i.setWithCredentials(!0),i.load(e,e=>{var n={attributeIDs:this.defaultAttributeIDs,attributeTypes:this.defaultAttributeTypes,useUniqueIDs:!1};this.decodeGeometry(e,n).then(t).catch(r)},n,r)},decodeDracoFile:function(e,t,n,r){var i={attributeIDs:n||this.defaultAttributeIDs,attributeTypes:r||this.defaultAttributeTypes,useUniqueIDs:!!n};this.decodeGeometry(e,i).then(t)},decodeGeometry:function(e,t){for(var n in t.attributeTypes){var r=t.attributeTypes[n];r.BYTES_PER_ELEMENT!==void 0&&(t.attributeTypes[n]=r.name)}var i=JSON.stringify(t);if(u.taskCache.has(e)){var a=u.taskCache.get(e);if(a.key===i)return a.promise;if(e.byteLength===0)throw Error(`THREE.DRACOLoader: Unable to re-decode a buffer with different settings. Buffer has already been transferred.`)}var o,s=this.workerNextTaskID++,c=e.byteLength,l=this._getWorker(s,c).then(n=>(o=n,new Promise((n,r)=>{o._callbacks[s]={resolve:n,reject:r},o.postMessage({type:`decode`,id:s,taskConfig:t,buffer:e},[e])}))).then(e=>this._createGeometry(e.geometry));return l.catch(()=>!0).then(()=>{o&&s&&this._releaseTask(o,s)}),u.taskCache.set(e,{key:i,promise:l}),l},_createGeometry:function(e){var t=new c.BufferGeometry;e.index&&t.setIndex(new c.BufferAttribute(e.index.array,1));for(var n=0;n<e.attributes.length;n++){var r=e.attributes[n],i=r.name,a=r.array,o=r.itemSize;t.setAttribute(i,new c.BufferAttribute(a,o))}return t},_loadLibrary:function(e,t){var n=new c.FileLoader(this.manager);return n.setPath(this.decoderPath),n.setResponseType(t),new Promise((t,r)=>{n.load(e,t,void 0,r)})},preload:function(){return this._initDecoder(),this},_initDecoder:function(){if(this.decoderPending)return this.decoderPending;var e=typeof WebAssembly!=`object`||this.decoderConfig.type===`js`,t=[];return e?t.push(this._loadLibrary(`draco_decoder.js`,`text`)):(t.push(this._loadLibrary(`draco_wasm_wrapper.js`,`text`)),t.push(this._loadLibrary(`draco_decoder.wasm`,`arraybuffer`))),this.decoderPending=Promise.all(t).then(t=>{var n=t[0];e||(this.decoderConfig.wasmBinary=t[1]);var r=u.DRACOWorker.toString(),i=[`/* draco decoder */`,n,``,`/* worker */`,r.substring(r.indexOf(`{`)+1,r.lastIndexOf(`}`))].join(`
261
- `);this.workerSourceURL=URL.createObjectURL(new Blob([i]))}),this.decoderPending},_getWorker:function(e,t){return this._initDecoder().then(()=>{if(this.workerPool.length<this.workerLimit){var n=new Worker(this.workerSourceURL);n._callbacks={},n._taskCosts={},n._taskLoad=0,n.postMessage({type:`init`,decoderConfig:this.decoderConfig}),n.onmessage=function(e){var t=e.data;switch(t.type){case`decode`:n._callbacks[t.id].resolve(t);break;case`error`:n._callbacks[t.id].reject(t);break;default:console.error(`THREE.DRACOLoader: Unexpected message, "`+t.type+`"`)}},this.workerPool.push(n)}else this.workerPool.sort(function(e,t){return e._taskLoad>t._taskLoad?-1:1});var n=this.workerPool[this.workerPool.length-1];return n._taskCosts[e]=t,n._taskLoad+=t,n})},_releaseTask:function(e,t){e._taskLoad-=e._taskCosts[t],delete e._callbacks[t],delete e._taskCosts[t]},debug:function(){console.log(`Task load: `,this.workerPool.map(e=>e._taskLoad))},dispose:function(){for(var e=0;e<this.workerPool.length;++e)this.workerPool[e].terminate();return this.workerPool.length=0,this}}),u.DRACOWorker=function(){var e,t;onmessage=function(r){var i=r.data;switch(i.type){case`init`:e=i.decoderConfig,t=new Promise(function(t){e.onModuleLoaded=function(e){t({draco:e})},DracoDecoderModule(e)});break;case`decode`:var a=i.buffer,o=i.taskConfig;t.then(e=>{var t=e.draco,r=new t.Decoder,s=new t.DecoderBuffer;s.Init(new Int8Array(a),a.byteLength);try{var c=n(t,r,s,o),l=c.attributes.map(e=>e.array.buffer);c.index&&l.push(c.index.array.buffer),self.postMessage({type:`decode`,id:i.id,geometry:c},l)}catch(e){console.error(e),self.postMessage({type:`error`,id:i.id,error:e.message})}finally{t.destroy(s),t.destroy(r)}});break}};function n(e,t,n,i){var a=i.attributeIDs,o=i.attributeTypes,s,c,l=t.GetEncodedGeometryType(n);if(l===e.TRIANGULAR_MESH)s=new e.Mesh,c=t.DecodeBufferToMesh(n,s);else if(l===e.POINT_CLOUD)s=new e.PointCloud,c=t.DecodeBufferToPointCloud(n,s);else throw Error(`THREE.DRACOLoader: Unexpected geometry type.`);if(!c.ok()||s.ptr===0)throw Error(`THREE.DRACOLoader: Decoding failed: `+c.error_msg());var u={index:null,attributes:[]};for(var d in a){var f=self[o[d]],p,m;if(i.useUniqueIDs)m=a[d],p=t.GetAttributeByUniqueId(s,m);else{if(m=t.GetAttributeId(s,e[a[d]]),m===-1)continue;p=t.GetAttribute(s,m)}u.attributes.push(r(e,t,s,d,f,p))}if(l===e.TRIANGULAR_MESH){for(var h=s.num_faces(),g=h*3,_=new Uint32Array(g),v=new e.DracoInt32Array,y=0;y<h;++y){t.GetFaceFromMesh(s,y,v);for(var b=0;b<3;++b)_[y*3+b]=v.GetValue(b)}u.index={array:_,itemSize:1},e.destroy(v)}return e.destroy(s),u}function r(e,t,n,r,i,a){var o=a.num_components(),s=n.num_points()*o,c,l;switch(i){case Float32Array:c=new e.DracoFloat32Array,t.GetAttributeFloatForAllPoints(n,a,c),l=new Float32Array(s);break;case Int8Array:c=new e.DracoInt8Array,t.GetAttributeInt8ForAllPoints(n,a,c),l=new Int8Array(s);break;case Int16Array:c=new e.DracoInt16Array,t.GetAttributeInt16ForAllPoints(n,a,c),l=new Int16Array(s);break;case Int32Array:c=new e.DracoInt32Array,t.GetAttributeInt32ForAllPoints(n,a,c),l=new Int32Array(s);break;case Uint8Array:c=new e.DracoUInt8Array,t.GetAttributeUInt8ForAllPoints(n,a,c),l=new Uint8Array(s);break;case Uint16Array:c=new e.DracoUInt16Array,t.GetAttributeUInt16ForAllPoints(n,a,c),l=new Uint16Array(s);break;case Uint32Array:c=new e.DracoUInt32Array,t.GetAttributeUInt32ForAllPoints(n,a,c),l=new Uint32Array(s);break;default:throw Error(`THREE.DRACOLoader: Unexpected attribute type.`)}for(var u=0;u<s;u++)l[u]=c.GetValue(u);return e.destroy(c),{name:r,array:l,itemSize:o}}},u.taskCache=new WeakMap,u.setDecoderPath=function(){console.warn(`THREE.DRACOLoader: The .setDecoderPath() method has been removed. Use instance methods.`)},u.setDecoderConfig=function(){console.warn(`THREE.DRACOLoader: The .setDecoderConfig() method has been removed. Use instance methods.`)},u.releaseDecoderModule=function(){console.warn(`THREE.DRACOLoader: The .releaseDecoderModule() method has been removed. Use instance methods.`)},u.getDecoderModule=function(){console.warn(`THREE.DRACOLoader: The .getDecoderModule() method has been removed. Use instance methods.`)};var d=function(e){c.CompressedTextureLoader.call(this,e)};d.prototype=Object.assign(Object.create(c.CompressedTextureLoader.prototype),{constructor:d,parse:function(e,t){var n={mipmaps:[],width:0,height:0,format:null,mipmapCount:1},r=542327876,i=131072,a=512,o=1024,s=2048,l=4096,u=8192,d=16384,f=32768,p=4;function m(e){return e.charCodeAt(0)+(e.charCodeAt(1)<<8)+(e.charCodeAt(2)<<16)+(e.charCodeAt(3)<<24)}function h(e){return String.fromCharCode(e&255,e>>8&255,e>>16&255,e>>24&255)}function g(e,t,n,r){for(var i=n*r*4,a=new Uint8Array(e,t,i),o=new Uint8Array(i),s=0,c=0,l=0;l<r;l++)for(var u=0;u<n;u++){var d=a[c];c++;var f=a[c];c++;var p=a[c];c++;var m=a[c];c++,o[s]=p,s++,o[s]=f,s++,o[s]=d,s++,o[s]=m,s++}return o}var _=m(`DXT1`),v=m(`DXT3`),y=m(`DXT5`),b=m(`ETC1`),x=31,S=0,C=1,w=2,T=3,E=4,D=7,O=20,k=21,A=22,j=23,M=24,N=25,P=26,F=28,I=new Int32Array(e,0,x);if(I[S]!==r)return console.error(`THREE.DDSLoader.parse: Invalid magic number in DDS header.`),n;if(!I[O]&p)return console.error(`THREE.DDSLoader.parse: Unsupported format, must contain a FourCC code.`),n;var L,R=I[k],z=!1;switch(R){case _:L=8,n.format=c.RGB_S3TC_DXT1_Format;break;case v:L=16,n.format=c.RGBA_S3TC_DXT3_Format;break;case y:L=16,n.format=c.RGBA_S3TC_DXT5_Format;break;case b:L=8,n.format=c.RGB_ETC1_Format;break;default:if(I[A]===32&&I[j]&16711680&&I[M]&65280&&I[N]&255&&I[P]&4278190080)z=!0,L=64,n.format=c.RGBAFormat;else return console.error(`THREE.DDSLoader.parse: Unsupported FourCC code `,h(R)),n}n.mipmapCount=1,I[w]&i&&t!==!1&&(n.mipmapCount=Math.max(1,I[D]));var B=I[F];if(n.isCubemap=!!(B&a),n.isCubemap&&(!(B&o)||!(B&s)||!(B&l)||!(B&u)||!(B&d)||!(B&f)))return console.error(`THREE.DDSLoader.parse: Incomplete cubemap faces`),n;n.width=I[E],n.height=I[T];for(var V=I[C]+4,H=n.isCubemap?6:1,U=0;U<H;U++)for(var W=n.width,G=n.height,K=0;K<n.mipmapCount;K++){if(z)var q=g(e,V,W,G),J=q.length;else var J=Math.max(4,W)/4*Math.max(4,G)/4*L,q=new Uint8Array(e,V,J);var Y={data:q,width:W,height:G};n.mipmaps.push(Y),V+=J,W=Math.max(W>>1,1),G=Math.max(G>>1,1)}return n}});var f=class extends c.Group{constructor(e){super(),this.needsRender=!0,e&&e.children.length&&this.add(...e.children),this.mixer=new c.AnimationMixer(this)}clone(){let e=super.clone(!0);return e.mixer=new c.AnimationMixer(e),e.needsRender=!0,e}},p=`https://vr-public.realsee-cdn.cn/release/static/image/release/five/resource/draco/1.5.6/`,m=class extends l{static get version(){return`6.8.7`}constructor(e){super(e),this.ddsLoader=new d(e),this.dracoLoader=new u(e),this.dracoLoader.setDecoderPath(p)}load(e,t,n,r){return super.load(e,t,n,r)}parse(e,t,n,r){return super.parse(e,t,e=>{let t=new f(e.scene),r=e.scenes.map(n=>n===e.scene?t:new f(n));n(Object.assign(e,{scene:t,scenes:r}))},r)}};exports.DDSLoader=d,exports.DRACOLoader=u,exports.GLTFLoader=m,exports.GLTFObject=f,exports.THREEGLTFLoader=l;
261
+ `);this.workerSourceURL=URL.createObjectURL(new Blob([i]))}),this.decoderPending},_getWorker:function(e,t){return this._initDecoder().then(()=>{if(this.workerPool.length<this.workerLimit){var n=new Worker(this.workerSourceURL);n._callbacks={},n._taskCosts={},n._taskLoad=0,n.postMessage({type:`init`,decoderConfig:this.decoderConfig}),n.onmessage=function(e){var t=e.data;switch(t.type){case`decode`:n._callbacks[t.id].resolve(t);break;case`error`:n._callbacks[t.id].reject(t);break;default:console.error(`THREE.DRACOLoader: Unexpected message, "`+t.type+`"`)}},this.workerPool.push(n)}else this.workerPool.sort(function(e,t){return e._taskLoad>t._taskLoad?-1:1});var n=this.workerPool[this.workerPool.length-1];return n._taskCosts[e]=t,n._taskLoad+=t,n})},_releaseTask:function(e,t){e._taskLoad-=e._taskCosts[t],delete e._callbacks[t],delete e._taskCosts[t]},debug:function(){console.log(`Task load: `,this.workerPool.map(e=>e._taskLoad))},dispose:function(){for(var e=0;e<this.workerPool.length;++e)this.workerPool[e].terminate();return this.workerPool.length=0,this}}),u.DRACOWorker=function(){var e,t;onmessage=function(r){var i=r.data;switch(i.type){case`init`:e=i.decoderConfig,t=new Promise(function(t){e.onModuleLoaded=function(e){t({draco:e})},DracoDecoderModule(e)});break;case`decode`:var a=i.buffer,o=i.taskConfig;t.then(e=>{var t=e.draco,r=new t.Decoder,s=new t.DecoderBuffer;s.Init(new Int8Array(a),a.byteLength);try{var c=n(t,r,s,o),l=c.attributes.map(e=>e.array.buffer);c.index&&l.push(c.index.array.buffer),self.postMessage({type:`decode`,id:i.id,geometry:c},l)}catch(e){console.error(e),self.postMessage({type:`error`,id:i.id,error:e.message})}finally{t.destroy(s),t.destroy(r)}});break}};function n(e,t,n,i){var a=i.attributeIDs,o=i.attributeTypes,s,c,l=t.GetEncodedGeometryType(n);if(l===e.TRIANGULAR_MESH)s=new e.Mesh,c=t.DecodeBufferToMesh(n,s);else if(l===e.POINT_CLOUD)s=new e.PointCloud,c=t.DecodeBufferToPointCloud(n,s);else throw Error(`THREE.DRACOLoader: Unexpected geometry type.`);if(!c.ok()||s.ptr===0)throw Error(`THREE.DRACOLoader: Decoding failed: `+c.error_msg());var u={index:null,attributes:[]};for(var d in a){var f=self[o[d]],p,m;if(i.useUniqueIDs)m=a[d],p=t.GetAttributeByUniqueId(s,m);else{if(m=t.GetAttributeId(s,e[a[d]]),m===-1)continue;p=t.GetAttribute(s,m)}u.attributes.push(r(e,t,s,d,f,p))}if(l===e.TRIANGULAR_MESH){for(var h=s.num_faces(),g=h*3,_=new Uint32Array(g),v=new e.DracoInt32Array,y=0;y<h;++y){t.GetFaceFromMesh(s,y,v);for(var b=0;b<3;++b)_[y*3+b]=v.GetValue(b)}u.index={array:_,itemSize:1},e.destroy(v)}return e.destroy(s),u}function r(e,t,n,r,i,a){var o=a.num_components(),s=n.num_points()*o,c,l;switch(i){case Float32Array:c=new e.DracoFloat32Array,t.GetAttributeFloatForAllPoints(n,a,c),l=new Float32Array(s);break;case Int8Array:c=new e.DracoInt8Array,t.GetAttributeInt8ForAllPoints(n,a,c),l=new Int8Array(s);break;case Int16Array:c=new e.DracoInt16Array,t.GetAttributeInt16ForAllPoints(n,a,c),l=new Int16Array(s);break;case Int32Array:c=new e.DracoInt32Array,t.GetAttributeInt32ForAllPoints(n,a,c),l=new Int32Array(s);break;case Uint8Array:c=new e.DracoUInt8Array,t.GetAttributeUInt8ForAllPoints(n,a,c),l=new Uint8Array(s);break;case Uint16Array:c=new e.DracoUInt16Array,t.GetAttributeUInt16ForAllPoints(n,a,c),l=new Uint16Array(s);break;case Uint32Array:c=new e.DracoUInt32Array,t.GetAttributeUInt32ForAllPoints(n,a,c),l=new Uint32Array(s);break;default:throw Error(`THREE.DRACOLoader: Unexpected attribute type.`)}for(var u=0;u<s;u++)l[u]=c.GetValue(u);return e.destroy(c),{name:r,array:l,itemSize:o}}},u.taskCache=new WeakMap,u.setDecoderPath=function(){console.warn(`THREE.DRACOLoader: The .setDecoderPath() method has been removed. Use instance methods.`)},u.setDecoderConfig=function(){console.warn(`THREE.DRACOLoader: The .setDecoderConfig() method has been removed. Use instance methods.`)},u.releaseDecoderModule=function(){console.warn(`THREE.DRACOLoader: The .releaseDecoderModule() method has been removed. Use instance methods.`)},u.getDecoderModule=function(){console.warn(`THREE.DRACOLoader: The .getDecoderModule() method has been removed. Use instance methods.`)};var d=function(e){c.CompressedTextureLoader.call(this,e)};d.prototype=Object.assign(Object.create(c.CompressedTextureLoader.prototype),{constructor:d,parse:function(e,t){var n={mipmaps:[],width:0,height:0,format:null,mipmapCount:1},r=542327876,i=131072,a=512,o=1024,s=2048,l=4096,u=8192,d=16384,f=32768,p=4;function m(e){return e.charCodeAt(0)+(e.charCodeAt(1)<<8)+(e.charCodeAt(2)<<16)+(e.charCodeAt(3)<<24)}function h(e){return String.fromCharCode(e&255,e>>8&255,e>>16&255,e>>24&255)}function g(e,t,n,r){for(var i=n*r*4,a=new Uint8Array(e,t,i),o=new Uint8Array(i),s=0,c=0,l=0;l<r;l++)for(var u=0;u<n;u++){var d=a[c];c++;var f=a[c];c++;var p=a[c];c++;var m=a[c];c++,o[s]=p,s++,o[s]=f,s++,o[s]=d,s++,o[s]=m,s++}return o}var _=m(`DXT1`),v=m(`DXT3`),y=m(`DXT5`),b=m(`ETC1`),x=31,S=0,C=1,w=2,T=3,E=4,D=7,O=20,k=21,A=22,j=23,M=24,N=25,P=26,F=28,I=new Int32Array(e,0,x);if(I[S]!==r)return console.error(`THREE.DDSLoader.parse: Invalid magic number in DDS header.`),n;if(!I[O]&p)return console.error(`THREE.DDSLoader.parse: Unsupported format, must contain a FourCC code.`),n;var L,R=I[k],z=!1;switch(R){case _:L=8,n.format=c.RGB_S3TC_DXT1_Format;break;case v:L=16,n.format=c.RGBA_S3TC_DXT3_Format;break;case y:L=16,n.format=c.RGBA_S3TC_DXT5_Format;break;case b:L=8,n.format=c.RGB_ETC1_Format;break;default:if(I[A]===32&&I[j]&16711680&&I[M]&65280&&I[N]&255&&I[P]&4278190080)z=!0,L=64,n.format=c.RGBAFormat;else return console.error(`THREE.DDSLoader.parse: Unsupported FourCC code `,h(R)),n}n.mipmapCount=1,I[w]&i&&t!==!1&&(n.mipmapCount=Math.max(1,I[D]));var B=I[F];if(n.isCubemap=!!(B&a),n.isCubemap&&(!(B&o)||!(B&s)||!(B&l)||!(B&u)||!(B&d)||!(B&f)))return console.error(`THREE.DDSLoader.parse: Incomplete cubemap faces`),n;n.width=I[E],n.height=I[T];for(var V=I[C]+4,H=n.isCubemap?6:1,U=0;U<H;U++)for(var W=n.width,G=n.height,K=0;K<n.mipmapCount;K++){if(z)var q=g(e,V,W,G),J=q.length;else var J=Math.max(4,W)/4*Math.max(4,G)/4*L,q=new Uint8Array(e,V,J);var Y={data:q,width:W,height:G};n.mipmaps.push(Y),V+=J,W=Math.max(W>>1,1),G=Math.max(G>>1,1)}return n}});var f=class extends c.Group{constructor(e){super(),this.needsRender=!0,e&&e.children.length&&this.add(...e.children),this.mixer=new c.AnimationMixer(this)}clone(){let e=super.clone(!0);return e.mixer=new c.AnimationMixer(e),e.needsRender=!0,e}},p=`https://vr-public.realsee-cdn.cn/release/static/image/release/five/resource/draco/1.5.6/`,m=class extends l{static get version(){return`6.8.9`}constructor(e){super(e),this.ddsLoader=new d(e),this.dracoLoader=new u(e),this.dracoLoader.setDecoderPath(p)}load(e,t,n,r){return super.load(e,t,n,r)}parse(e,t,n,r){return super.parse(e,t,e=>{let t=new f(e.scene),r=e.scenes.map(n=>n===e.scene?t:new f(n));n(Object.assign(e,{scene:t,scenes:r}))},r)}};exports.DDSLoader=d,exports.DRACOLoader=u,exports.GLTFLoader=m,exports.GLTFObject=f,exports.THREEGLTFLoader=l;
@@ -1,8 +1,8 @@
1
1
  /**
2
2
  * @license
3
3
  * @realsee/five
4
- * Generated: 2026/6/10
5
- * Version: 6.8.7
4
+ * Generated: 2026/7/7
5
+ * Version: 6.8.9
6
6
  * Terms:
7
7
  * Realsee SDK License Agreement
8
8
  * Update: July 28, 2021
@@ -1588,7 +1588,7 @@ var K = class extends e.Group {
1588
1588
  }
1589
1589
  }, Te = "https://vr-public.realsee-cdn.cn/release/static/image/release/five/resource/draco/1.5.6/", Ee = class extends U {
1590
1590
  static get version() {
1591
- return "6.8.7";
1591
+ return "6.8.9";
1592
1592
  }
1593
1593
  constructor(e) {
1594
1594
  super(e), this.ddsLoader = new G(e), this.dracoLoader = new W(e), this.dracoLoader.setDecoderPath(Te);
package/line/index.js CHANGED
@@ -1,8 +1,8 @@
1
1
  /**
2
2
  * @license
3
3
  * @realsee/five
4
- * Generated: 2026/6/10
5
- * Version: 6.8.7
4
+ * Generated: 2026/7/7
5
+ * Version: 6.8.9
6
6
  * Terms:
7
7
  * Realsee SDK License Agreement
8
8
  * Update: July 28, 2021
@@ -451,4 +451,4 @@
451
451
  #include <premultiplied_alpha_fragment>
452
452
 
453
453
  }
454
- `},d=class extends c.ShaderMaterial{constructor(e){super({uniforms:c.UniformsUtils.clone(u.uniforms),vertexShader:u.vertexShader,fragmentShader:u.fragmentShader,clipping:!0}),this.type=`LineMaterial`,this.dashed=!1,Object.defineProperties(this,{color:{enumerable:!0,get(){return this.uniforms.diffuse.value},set(e){this.uniforms.diffuse.value=e}},linewidth:{enumerable:!0,get(){return this.uniforms.linewidth.value},set(e){this.uniforms.linewidth.value=e}},dashScale:{enumerable:!0,get(){return this.uniforms.dashScale.value},set(e){this.uniforms.dashScale.value=e}},dashSize:{enumerable:!0,get(){return this.uniforms.dashSize.value},set(e){this.uniforms.dashSize.value=e}},gapSize:{enumerable:!0,get(){return this.uniforms.gapSize.value},set(e){this.uniforms.gapSize.value=e}},opacity:{enumerable:!0,get(){return this.uniforms.opacity.value},set(e){this.uniforms.opacity.value=e}},resolution:{enumerable:!0,get(){return this.uniforms.resolution.value},set(e){this.uniforms.resolution.value.copy(e)}}}),this.setValues(e)}};Object.assign(d.prototype,{isLineMaterial:!0});var f=class extends c.Mesh{constructor(e,t){super(),this.type=`LineSegments2`,this.geometry=e===void 0?new l:e,this.material=t===void 0?new d({color:Math.random()*16777215}):t}computeLineDistances(){let e=this.geometry,t=e.attributes.instanceStart,n=e.attributes.instanceEnd,r=new Float32Array(2*t.count),i=new c.Vector3,a=new c.Vector3;for(var o=0,s=0,l=t.count;o<l;o++,s+=2)i.fromBufferAttribute(t,o),a.fromBufferAttribute(n,o),r[s]=s===0?0:r[s-1],r[s+1]=r[s]+i.distanceTo(a);let u=new c.InstancedInterleavedBuffer(r,2,1);return e.setAttribute(`instanceDistanceStart`,new c.InterleavedBufferAttribute(u,1,0)),e.setAttribute(`instanceDistanceEnd`,new c.InterleavedBufferAttribute(u,1,1)),this}raycast(e,t){e.camera===null&&console.error(`LineSegments2: "Raycaster.camera" needs to be set in order to raycast against LineSegments2.`);let n=e.ray,r=e.camera,i=r.projectionMatrix,a=this.geometry,o=this.material,s=o.resolution,l=o.linewidth,u=a.attributes.instanceStart,d=a.attributes.instanceEnd,f=new c.Vector4,p=new c.Vector4,m=new c.Vector4,h=new c.Vector3,g=new c.Matrix4,_=new c.Line3,v=new c.Vector3;n.at(1,m),m.w=1,m.applyMatrix4(r.matrixWorldInverse),m.applyMatrix4(i),m.multiplyScalar(1/m.w),m.x*=s.x/2,m.y*=s.y/2,m.z=0,h.copy(m);let y=this.matrixWorld;g.multiplyMatrices(r.matrixWorldInverse,y);for(var b=0,x=u.count;b<x;b++){f.fromBufferAttribute(u,b),p.fromBufferAttribute(d,b),f.w=1,p.w=1,f.applyMatrix4(g),p.applyMatrix4(g),f.applyMatrix4(i),p.applyMatrix4(i),f.multiplyScalar(1/f.w),p.multiplyScalar(1/p.w);var S=f.z<-1&&p.z<-1,C=f.z>1&&p.z>1;if(S||C)continue;f.x*=s.x/2,f.y*=s.y/2,p.x*=s.x/2,p.y*=s.y/2,_.start.copy(f),_.start.z=0,_.end.copy(p),_.end.z=0;let e=_.closestPointToPointParameter(h,!0);_.at(e,v);let r=c.MathUtils.lerp(f.z,p.z,e),a=r>=-1&&r<=1;var w=h.distanceTo(v)<l*.5;if(a&&w){_.start.fromBufferAttribute(u,b),_.end.fromBufferAttribute(d,b),_.start.applyMatrix4(y),_.end.applyMatrix4(y);var T=new c.Vector3,E=new c.Vector3;n.distanceSqToSegment(_.start,_.end,E,T),t.push({point:E,pointOnLine:T,distance:n.origin.distanceTo(E),object:this,faceIndex:b})}}}};Object.assign(f.prototype,{isLineSegments2:!0});var p=class extends f{constructor(e,t){super(e,t),this.type=`Line2`}};Object.assign(p.prototype,{isLine2:!0});var m=class extends l{constructor(){super(),this.type=`LineGeometry`}setPositions(e){let t=e.length-3,n=new Float32Array(2*t);for(let r=0;r<t;r+=3)n[2*r]=e[r],n[2*r+1]=e[r+1],n[2*r+2]=e[r+2],n[2*r+3]=e[r+3],n[2*r+4]=e[r+4],n[2*r+5]=e[r+5];return super.setPositions(n),this}setColors(e){let t=e.length-3,n=new Float32Array(2*t);for(let r=0;r<t;r+=3)n[2*r]=e[r],n[2*r+1]=e[r+1],n[2*r+2]=e[r+2],n[2*r+3]=e[r+3],n[2*r+4]=e[r+4],n[2*r+5]=e[r+5];return super.setColors(n),this}fromLine(e){let t=e.geometry;if(t instanceof c.Geometry){let e=new c.BufferGeometry().fromGeometry(t);this.setPositions(e.attributes.position.array)}else t instanceof c.BufferGeometry&&this.setPositions(t.attributes.position.array);return this}copy(){return this}};Object.assign(m.prototype,{isLineGeometry:!0});var h=14467195,g=8,_=2,v=20,y=null,b=class extends c.Object3D{static get version(){return`6.8.7`}constructor(e=new c.Vector3,t=new c.Vector3){super(),this.type=`FiveLine`,this.needsRender=!0;let n=new m,r=new d({color:h,linewidth:_,dashScale:v,dashed:!1});this.line=new p(n,r);let i=new c.BufferGeometry,a=new c.PointsMaterial({color:h,size:g,map:y||(y=new c.TextureLoader().load(`data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAAAAZiS0dEAAAAAAAA+UO7fwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB9sHDgwCEMBJZu0AAAAdaVRYdENvbW1lbnQAAAAAAENyZWF0ZWQgd2l0aCBHSU1QZC5lBwAABM5JREFUWMO1V0tPG2cUPZ4Hxh6DazIOrjFNqJs0FIMqWFgWQkatsmvVbtggKlSVRVf5AWz4AWz4AUSKEChll19QJYSXkECuhFxsHjEhxCYm+DWGMZ5HF72DJq4bAzFXurI0M/I5997v3u9cC65vTJVn2lX/xHINQOYSBLTLEuIuCWw4Z3IGAEvf6ASmVHjNzHCXBG4A0AjACsAOwEbO0nsFQBnAGYASAIl+ZRMR7SolMEdsByD09fV5R0ZGgg8ePPjW5/N1iqLYpuu6RZblciKR2I9Go69evnwZnZ+fjwI4IS8AKBIRzeQfJWCANwKwh0KhtrGxsYehUOin1tbW+zzP23ietzY2NnIAoGmaLsuyUiqVyvl8XtrY2NiamZn589mzZxsAUgCOAeQAnFI2tI+VxIjaAeDzoaGh7xYWFuZOTk6OZVk+12uYqqq6JEnn0Wg0OT4+/geAXwGEAdwDIFJQXC1wO4DWR48e/RCPxxclSSroVzRFUbSDg4P848ePFwH8DuAhkWih83TRQWxFOXgAwvDwcOfo6OhvXV1d39tsNtuVBwTDWBwOh1UUxVsMw1hXVlbSdCgNV43uYSvrHg6H24aHh38eHBz85TrgF9FYLHA4HLzH43FvbW2d7u/vG+dANp8FpqIlbd3d3V8Fg8EfBUFw4BONZVmL3+9vHhkZCQL4AoAHgJPK8G+yzC0XDofdoVAo5PP5vkadTBAEtr+/39ff3x8gAp/RPOEqx2qjx+NpvXv3bk9DQ0NDvQgwDIOWlhZrMBj8kgi0UJdxRgYMArzL5XJ7vd57qLPZ7Xamp6fnNgBXtQxcjFuHw+Hyer3t9SYgCAITCAScAJoBNNEY/08GOFVVrfVMv7kMNDntFD1vjIAPrlRN0xjckOm6biFQ3jwNPwDMZrOnqVTqfb3Bi8Wivru7W/VCYkwPlKOjo0IikXh7EwQikYgE4Nw0CfXKDCipVCoTj8df3QABbW1tLUc6oUgkFPMkVACUNjc337148eKvw8PDbJ2jP1taWkoCyNDVXDSECmNSK4qiKNLq6urW8+fPI/UicHx8rD59+jSVy+WOAKSJhKENwFItLtoxk8mwsixzHR0dHe3t7c5PAU+n09rs7OzJkydPYqVSaQfANoDXALIk31S2smU1TWMPDg7K5XKZ7+3t9TudTut1U7+wsFCcmJiIpdPpbQBxADsAknQWymYCOukBHYCuKApisdhpMpnURFEU79y503TVyKenpzOTk5M7e3t7MQKPV0Zv1gNm+awB0MvlshqLxfLb29uyJElWURSbXC4XXyvqxcXFs6mpqeTc3Nzu3t7e3wQcA7BPZ8Cov1pNlJplmQtAG8MwHV6v95tAINA5MDBwPxAIuLu6upr8fr/VAN3c3JQjkcjZ+vp6fnl5+d2bN29SuVzuNYAEpf01CdRChUL+X1VskHACuA3Ay3Fcu9vt7nA6nZ7m5uYWQRCaNE3jVVW15PP580KhIGUymWw2m00DOAJwSP4WwPtq4LX2Ao6USxNlQyS/RcQcdLGwlNIz6vEMAaZpNzCk2Pll94LK/cDYimxERiBwG10sxjgvEZBE0UpE6vxj+0Ct5bTaXthgEhRmja8QWNkkPGsuIpfdjpkK+cZUWTC0KredVmtD/gdlSl6EG4AMvQAAAABJRU5ErkJggg==`)),sizeAttenuation:!1,transparent:!0});this.points=new c.Points(i,a),this.points.renderOrder=11,this.points.frustumCulled=!1,this.setPoints(e,t),this.add(this.line,this.points)}setPoints(e,t){let n=[].concat(e.toArray(),t.toArray());this.points.geometry.setAttribute(`position`,new c.BufferAttribute(new Float32Array(n),3)),this.line.geometry.setPositions(n),this.line.computeLineDistances(),this.needsRender=!0}getPoints(){let e=this.points.geometry.attributes.position.array;return[new c.Vector3(e[0],e[1],e[2]),new c.Vector3(e[3],e[4],e[5])]}setMaterial(e){let t=this.line.material;for(let n in e){if(!e.hasOwnProperty(n))continue;let r=e[n];n===`dashed`?(t.dashed=r,r?t.defines.USE_DASH=``:delete t.defines.USE_DASH,t.needsUpdate=!0):t[n]=e[n]}this.needsRender=!0}setResolution(e,t){let n=this.line.material.resolution;(n.x!==e||n.y!==t)&&(n.set(e,t),this.needsRender=!0)}};Object.assign(b.prototype,{isFiveLine:!0}),exports.Line=b,exports.LineGeometry=m,exports.LineMaterial=d,exports.LineSegmentsGeometry=l,exports.THREE_Line2=p,exports.THREE_LineSegments2=f;
454
+ `},d=class extends c.ShaderMaterial{constructor(e){super({uniforms:c.UniformsUtils.clone(u.uniforms),vertexShader:u.vertexShader,fragmentShader:u.fragmentShader,clipping:!0}),this.type=`LineMaterial`,this.dashed=!1,Object.defineProperties(this,{color:{enumerable:!0,get(){return this.uniforms.diffuse.value},set(e){this.uniforms.diffuse.value=e}},linewidth:{enumerable:!0,get(){return this.uniforms.linewidth.value},set(e){this.uniforms.linewidth.value=e}},dashScale:{enumerable:!0,get(){return this.uniforms.dashScale.value},set(e){this.uniforms.dashScale.value=e}},dashSize:{enumerable:!0,get(){return this.uniforms.dashSize.value},set(e){this.uniforms.dashSize.value=e}},gapSize:{enumerable:!0,get(){return this.uniforms.gapSize.value},set(e){this.uniforms.gapSize.value=e}},opacity:{enumerable:!0,get(){return this.uniforms.opacity.value},set(e){this.uniforms.opacity.value=e}},resolution:{enumerable:!0,get(){return this.uniforms.resolution.value},set(e){this.uniforms.resolution.value.copy(e)}}}),this.setValues(e)}};Object.assign(d.prototype,{isLineMaterial:!0});var f=class extends c.Mesh{constructor(e,t){super(),this.type=`LineSegments2`,this.geometry=e===void 0?new l:e,this.material=t===void 0?new d({color:Math.random()*16777215}):t}computeLineDistances(){let e=this.geometry,t=e.attributes.instanceStart,n=e.attributes.instanceEnd,r=new Float32Array(2*t.count),i=new c.Vector3,a=new c.Vector3;for(var o=0,s=0,l=t.count;o<l;o++,s+=2)i.fromBufferAttribute(t,o),a.fromBufferAttribute(n,o),r[s]=s===0?0:r[s-1],r[s+1]=r[s]+i.distanceTo(a);let u=new c.InstancedInterleavedBuffer(r,2,1);return e.setAttribute(`instanceDistanceStart`,new c.InterleavedBufferAttribute(u,1,0)),e.setAttribute(`instanceDistanceEnd`,new c.InterleavedBufferAttribute(u,1,1)),this}raycast(e,t){e.camera===null&&console.error(`LineSegments2: "Raycaster.camera" needs to be set in order to raycast against LineSegments2.`);let n=e.ray,r=e.camera,i=r.projectionMatrix,a=this.geometry,o=this.material,s=o.resolution,l=o.linewidth,u=a.attributes.instanceStart,d=a.attributes.instanceEnd,f=new c.Vector4,p=new c.Vector4,m=new c.Vector4,h=new c.Vector3,g=new c.Matrix4,_=new c.Line3,v=new c.Vector3;n.at(1,m),m.w=1,m.applyMatrix4(r.matrixWorldInverse),m.applyMatrix4(i),m.multiplyScalar(1/m.w),m.x*=s.x/2,m.y*=s.y/2,m.z=0,h.copy(m);let y=this.matrixWorld;g.multiplyMatrices(r.matrixWorldInverse,y);for(var b=0,x=u.count;b<x;b++){f.fromBufferAttribute(u,b),p.fromBufferAttribute(d,b),f.w=1,p.w=1,f.applyMatrix4(g),p.applyMatrix4(g),f.applyMatrix4(i),p.applyMatrix4(i),f.multiplyScalar(1/f.w),p.multiplyScalar(1/p.w);var S=f.z<-1&&p.z<-1,C=f.z>1&&p.z>1;if(S||C)continue;f.x*=s.x/2,f.y*=s.y/2,p.x*=s.x/2,p.y*=s.y/2,_.start.copy(f),_.start.z=0,_.end.copy(p),_.end.z=0;let e=_.closestPointToPointParameter(h,!0);_.at(e,v);let r=c.MathUtils.lerp(f.z,p.z,e),a=r>=-1&&r<=1;var w=h.distanceTo(v)<l*.5;if(a&&w){_.start.fromBufferAttribute(u,b),_.end.fromBufferAttribute(d,b),_.start.applyMatrix4(y),_.end.applyMatrix4(y);var T=new c.Vector3,E=new c.Vector3;n.distanceSqToSegment(_.start,_.end,E,T),t.push({point:E,pointOnLine:T,distance:n.origin.distanceTo(E),object:this,faceIndex:b})}}}};Object.assign(f.prototype,{isLineSegments2:!0});var p=class extends f{constructor(e,t){super(e,t),this.type=`Line2`}};Object.assign(p.prototype,{isLine2:!0});var m=class extends l{constructor(){super(),this.type=`LineGeometry`}setPositions(e){let t=e.length-3,n=new Float32Array(2*t);for(let r=0;r<t;r+=3)n[2*r]=e[r],n[2*r+1]=e[r+1],n[2*r+2]=e[r+2],n[2*r+3]=e[r+3],n[2*r+4]=e[r+4],n[2*r+5]=e[r+5];return super.setPositions(n),this}setColors(e){let t=e.length-3,n=new Float32Array(2*t);for(let r=0;r<t;r+=3)n[2*r]=e[r],n[2*r+1]=e[r+1],n[2*r+2]=e[r+2],n[2*r+3]=e[r+3],n[2*r+4]=e[r+4],n[2*r+5]=e[r+5];return super.setColors(n),this}fromLine(e){let t=e.geometry;if(t instanceof c.Geometry){let e=new c.BufferGeometry().fromGeometry(t);this.setPositions(e.attributes.position.array)}else t instanceof c.BufferGeometry&&this.setPositions(t.attributes.position.array);return this}copy(){return this}};Object.assign(m.prototype,{isLineGeometry:!0});var h=14467195,g=8,_=2,v=20,y=null,b=class extends c.Object3D{static get version(){return`6.8.9`}constructor(e=new c.Vector3,t=new c.Vector3){super(),this.type=`FiveLine`,this.needsRender=!0;let n=new m,r=new d({color:h,linewidth:_,dashScale:v,dashed:!1});this.line=new p(n,r);let i=new c.BufferGeometry,a=new c.PointsMaterial({color:h,size:g,map:y||(y=new c.TextureLoader().load(`data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAAAAZiS0dEAAAAAAAA+UO7fwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB9sHDgwCEMBJZu0AAAAdaVRYdENvbW1lbnQAAAAAAENyZWF0ZWQgd2l0aCBHSU1QZC5lBwAABM5JREFUWMO1V0tPG2cUPZ4Hxh6DazIOrjFNqJs0FIMqWFgWQkatsmvVbtggKlSVRVf5AWz4AWz4AUSKEChll19QJYSXkECuhFxsHjEhxCYm+DWGMZ5HF72DJq4bAzFXurI0M/I5997v3u9cC65vTJVn2lX/xHINQOYSBLTLEuIuCWw4Z3IGAEvf6ASmVHjNzHCXBG4A0AjACsAOwEbO0nsFQBnAGYASAIl+ZRMR7SolMEdsByD09fV5R0ZGgg8ePPjW5/N1iqLYpuu6RZblciKR2I9Go69evnwZnZ+fjwI4IS8AKBIRzeQfJWCANwKwh0KhtrGxsYehUOin1tbW+zzP23ietzY2NnIAoGmaLsuyUiqVyvl8XtrY2NiamZn589mzZxsAUgCOAeQAnFI2tI+VxIjaAeDzoaGh7xYWFuZOTk6OZVk+12uYqqq6JEnn0Wg0OT4+/geAXwGEAdwDIFJQXC1wO4DWR48e/RCPxxclSSroVzRFUbSDg4P848ePFwH8DuAhkWih83TRQWxFOXgAwvDwcOfo6OhvXV1d39tsNtuVBwTDWBwOh1UUxVsMw1hXVlbSdCgNV43uYSvrHg6H24aHh38eHBz85TrgF9FYLHA4HLzH43FvbW2d7u/vG+dANp8FpqIlbd3d3V8Fg8EfBUFw4BONZVmL3+9vHhkZCQL4AoAHgJPK8G+yzC0XDofdoVAo5PP5vkadTBAEtr+/39ff3x8gAp/RPOEqx2qjx+NpvXv3bk9DQ0NDvQgwDIOWlhZrMBj8kgi0UJdxRgYMArzL5XJ7vd57qLPZ7Xamp6fnNgBXtQxcjFuHw+Hyer3t9SYgCAITCAScAJoBNNEY/08GOFVVrfVMv7kMNDntFD1vjIAPrlRN0xjckOm6biFQ3jwNPwDMZrOnqVTqfb3Bi8Wivru7W/VCYkwPlKOjo0IikXh7EwQikYgE4Nw0CfXKDCipVCoTj8df3QABbW1tLUc6oUgkFPMkVACUNjc337148eKvw8PDbJ2jP1taWkoCyNDVXDSECmNSK4qiKNLq6urW8+fPI/UicHx8rD59+jSVy+WOAKSJhKENwFItLtoxk8mwsixzHR0dHe3t7c5PAU+n09rs7OzJkydPYqVSaQfANoDXALIk31S2smU1TWMPDg7K5XKZ7+3t9TudTut1U7+wsFCcmJiIpdPpbQBxADsAknQWymYCOukBHYCuKApisdhpMpnURFEU79y503TVyKenpzOTk5M7e3t7MQKPV0Zv1gNm+awB0MvlshqLxfLb29uyJElWURSbXC4XXyvqxcXFs6mpqeTc3Nzu3t7e3wQcA7BPZ8Cov1pNlJplmQtAG8MwHV6v95tAINA5MDBwPxAIuLu6upr8fr/VAN3c3JQjkcjZ+vp6fnl5+d2bN29SuVzuNYAEpf01CdRChUL+X1VskHACuA3Ay3Fcu9vt7nA6nZ7m5uYWQRCaNE3jVVW15PP580KhIGUymWw2m00DOAJwSP4WwPtq4LX2Ao6USxNlQyS/RcQcdLGwlNIz6vEMAaZpNzCk2Pll94LK/cDYimxERiBwG10sxjgvEZBE0UpE6vxj+0Ct5bTaXthgEhRmja8QWNkkPGsuIpfdjpkK+cZUWTC0KredVmtD/gdlSl6EG4AMvQAAAABJRU5ErkJggg==`)),sizeAttenuation:!1,transparent:!0});this.points=new c.Points(i,a),this.points.renderOrder=11,this.points.frustumCulled=!1,this.setPoints(e,t),this.add(this.line,this.points)}setPoints(e,t){let n=[].concat(e.toArray(),t.toArray());this.points.geometry.setAttribute(`position`,new c.BufferAttribute(new Float32Array(n),3)),this.line.geometry.setPositions(n),this.line.computeLineDistances(),this.needsRender=!0}getPoints(){let e=this.points.geometry.attributes.position.array;return[new c.Vector3(e[0],e[1],e[2]),new c.Vector3(e[3],e[4],e[5])]}setMaterial(e){let t=this.line.material;for(let n in e){if(!e.hasOwnProperty(n))continue;let r=e[n];n===`dashed`?(t.dashed=r,r?t.defines.USE_DASH=``:delete t.defines.USE_DASH,t.needsUpdate=!0):t[n]=e[n]}this.needsRender=!0}setResolution(e,t){let n=this.line.material.resolution;(n.x!==e||n.y!==t)&&(n.set(e,t),this.needsRender=!0)}};Object.assign(b.prototype,{isFiveLine:!0}),exports.Line=b,exports.LineGeometry=m,exports.LineMaterial=d,exports.LineSegmentsGeometry=l,exports.THREE_Line2=p,exports.THREE_LineSegments2=f;
package/line/index.mjs CHANGED
@@ -1,8 +1,8 @@
1
1
  /**
2
2
  * @license
3
3
  * @realsee/five
4
- * Generated: 2026/6/10
5
- * Version: 6.8.7
4
+ * Generated: 2026/7/7
5
+ * Version: 6.8.9
6
6
  * Terms:
7
7
  * Realsee SDK License Agreement
8
8
  * Update: July 28, 2021
@@ -549,7 +549,7 @@ Object.assign(o.prototype, { isLineGeometry: !0 });
549
549
  //#region build/line/index.js
550
550
  var s = 14467195, c = 8, l = 2, u = 20, d = null, f = class extends e.Object3D {
551
551
  static get version() {
552
- return "6.8.7";
552
+ return "6.8.9";
553
553
  }
554
554
  constructor(t = new e.Vector3(), n = new e.Vector3()) {
555
555
  super(), this.type = "FiveLine", this.needsRender = !0;
package/llms.txt CHANGED
@@ -53,6 +53,7 @@
53
53
  * **[Postprocessing](ai_guides/features/postprocessing.md)**: Visual effects.
54
54
  * **[Flowing Light 2D Pass](ai_guides/features/flowing-light-2d-pass.md)**: Flowing light screen-space effect with InstancedMesh rendering.
55
55
  * **[Flowing Light 3D Pass](ai_guides/features/flowing-light-3d-pass.md)**: Flowing light effect with 3D world-space projection and InstancedMesh rendering.
56
+ * **[Flowing Fireworks 3D Pass](ai_guides/features/flowing-fireworks-3d-pass.md)**: Firework-like sparks emitted from the tail of a FlowingLight3DPass streak, using GPU particles.
56
57
  * **[Gaussian Blur Pass](ai_guides/features/gaussian-blur-pass.md)**: Gaussian blur post-processing effect.
57
58
  * **[Clipper](ai_guides/features/clipper.md)**: Model clipping.
58
59
  * **[3D Tile](ai_guides/features/3dtile.md)**: Large scene 3D tiles.
@@ -80,6 +81,7 @@
80
81
  | 截图 / 放大镜 / Screen capture | [Get Screen Pixels](ai_guides/features/get-screen-pixels.md) | magnifier, screenshot, color-picker, 取色器 |
81
82
  | 模型裁切 / 房屋剖面 | [Clipper](ai_guides/features/clipper.md) | clipping-box, section-view, discard, 开盖, 剖面 |
82
83
  | 流光特效 / Flowing light effect | [Flowing Light 2D](ai_guides/features/flowing-light-2d-pass.md), [Flowing Light 3D](ai_guides/features/flowing-light-3d-pass.md) | 光带, 导航路径, 动态路径, instanced |
84
+ | 烟花 / 火花 / 流光拖尾粒子 / Fireworks sparks | [Flowing Fireworks 3D](ai_guides/features/flowing-fireworks-3d-pass.md) | 烟花, 火花, 粒子, 发散, 爆裂, fireworks, particle, sparks |
83
85
  | 模糊特效 / Blur effect | [Gaussian Blur Pass](ai_guides/features/gaussian-blur-pass.md) | 毛玻璃, 背景虚化, gaussian |
84
86
  | 保存/恢复场景状态 | [State](ai_guides/features/state.md) | snapshot, save, restore, 快照, 场景还原 |
85
87
  | 多场景切换 / 沙盘 | [Multi-Work](ai_guides/features/multi-work.md) | sandbox, 多户型, 拼接, workCode |
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@realsee/five",
3
- "version": "6.8.7",
3
+ "version": "6.8.9",
4
4
  "description": "Realsee Renderer SDK",
5
5
  "author": "BEIKE REALSEE TECHNOLOGY (HK) LIMITED",
6
6
  "license": "SEE LICENSE IN TERMS.txt",
@@ -15,3 +15,4 @@ export { OrbitControls } from './thirdParty/OrbitControls';
15
15
  export { InstancedPrefabBufferGeometry } from './thirdParty/instancedPrefabBufferGeometry';
16
16
  export { PrefabBufferGeometry } from './thirdParty/prefabBufferGeometry';
17
17
  export { PointBufferGeometry } from './thirdParty/pointBufferGeometry';
18
+ export { calculatePath3DLength, calculatePath2DLength } from './utils/math';