@realsee/five 6.8.5 → 6.8.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (137) hide show
  1. package/docs/assets/hierarchy.js +1 -1
  2. package/docs/assets/navigation.js +1 -1
  3. package/docs/assets/search.js +1 -1
  4. package/docs/classes/five.AdaptiveLuminancePass.html +1 -1
  5. package/docs/classes/five.EyeDomeLightingPass.html +1 -1
  6. package/docs/classes/five.FivePass.html +1 -1
  7. package/docs/classes/five.FlowingLight2DPass.html +22 -0
  8. package/docs/classes/five.FlowingLight3DPass.html +22 -0
  9. package/docs/classes/five.GaussianBlurPass.html +20 -0
  10. package/docs/classes/five.Model.html +1 -1
  11. package/docs/classes/five.ModelScene.html +1 -1
  12. package/docs/classes/five.PBMCustomShader.html +1 -1
  13. package/docs/classes/five.PBMGSObject.html +2 -1
  14. package/docs/classes/five.PBMMeshMaterial.html +1 -1
  15. package/docs/classes/five.PBMPanoFilter.html +1 -1
  16. package/docs/classes/five.PBMPointCloudMaterial.html +1 -1
  17. package/docs/classes/five.PBMUpdateable.html +1 -1
  18. package/docs/classes/five.Parameter.html +22 -20
  19. package/docs/classes/five.Tile3D.html +1 -1
  20. package/docs/classes/five.TileNode.html +1 -1
  21. package/docs/classes/five.TrajectoryNode.html +1 -1
  22. package/docs/classes/five.WorkResolvedObserver.html +1 -1
  23. package/docs/classes/gltf-loader.DDSLoader.html +1 -1
  24. package/docs/classes/gltf-loader.DRACOLoader.html +1 -1
  25. package/docs/classes/gltf-loader.GLTFObject.html +1 -1
  26. package/docs/classes/gltf-loader.THREEGLTFLoader.html +1 -1
  27. package/docs/classes/line.LineGeometry.html +1 -1
  28. package/docs/classes/line.LineMaterial.html +1 -1
  29. package/docs/classes/line.LineSegmentsGeometry.html +1 -1
  30. package/docs/classes/line.THREE_Line2.html +1 -1
  31. package/docs/classes/line.THREE_LineSegments2.html +1 -1
  32. package/docs/classes/plugins.CSS2DObject.html +1 -1
  33. package/docs/classes/plugins.CSS3DObject.html +1 -1
  34. package/docs/classes/plugins.CSS3DSprite.html +1 -1
  35. package/docs/classes/plugins.InstancedPrefabBufferGeometry.html +1 -1
  36. package/docs/classes/plugins.Object3DHelperController.html +1 -1
  37. package/docs/classes/plugins.PointBufferGeometry.html +1 -1
  38. package/docs/classes/plugins.PrefabBufferGeometry.html +1 -1
  39. package/docs/classes/plugins.RoundedBoxGeometry.html +1 -1
  40. package/docs/classes/vfx.Airflow.html +1 -1
  41. package/docs/classes/vfx.Flame.html +1 -1
  42. package/docs/classes/vfx.Particle.html +1 -1
  43. package/docs/classes/vfx.ParticleGPU.html +1 -1
  44. package/docs/classes/vfx.SpotLight.html +1 -1
  45. package/docs/hierarchy.html +1 -1
  46. package/docs/interfaces/five.LooseWorkWithExtrinsics.html +1 -1
  47. package/docs/interfaces/five.PBMMaterial.html +1 -1
  48. package/docs/interfaces/five.PBMMeshMaterialParameters.html +1 -1
  49. package/docs/interfaces/five.PBMPointCloudMaterialParameters.html +1 -1
  50. package/docs/interfaces/five.ParameterMaterialValue.html +5 -3
  51. package/docs/interfaces/five.ParameterTilesetValue.html +15 -15
  52. package/docs/interfaces/five.ParameterValue.html +19 -17
  53. package/docs/interfaces/five.ResolvedParameterValue.html +20 -18
  54. package/docs/interfaces/five.ViewLayer.html +1 -1
  55. package/docs/interfaces/five.WorkCubeImage.html +1 -1
  56. package/docs/interfaces/five.WorkImage.html +1 -1
  57. package/docs/interfaces/five.WorkObserver.html +1 -1
  58. package/docs/interfaces/five.WorkObserverProto.html +1 -1
  59. package/docs/interfaces/five.WorkTile.html +1 -1
  60. package/docs/interfaces/plugins.BackgroundPluginController.html +1 -1
  61. package/docs/interfaces/plugins.BackgroundPluginType.EventMap.html +1 -1
  62. package/docs/interfaces/plugins.CSS2DPluginController.html +1 -1
  63. package/docs/interfaces/plugins.CSS2DPluginType.EventMap.html +1 -1
  64. package/docs/interfaces/plugins.CSS2DPluginType.State.html +1 -1
  65. package/docs/interfaces/plugins.CSS3DPluginController.html +1 -1
  66. package/docs/interfaces/plugins.CSS3DPluginType.EventMap.html +1 -1
  67. package/docs/interfaces/plugins.CSS3DPluginType.State.html +1 -1
  68. package/docs/interfaces/plugins.DynamicPathLinePluginController.html +1 -1
  69. package/docs/interfaces/plugins.DynamicPathLinePluginType.EventMap.html +1 -1
  70. package/docs/interfaces/plugins.DynamicPathLinePluginType.State.html +1 -1
  71. package/docs/interfaces/plugins.GaussianSplattingEntranceAnimationController.html +3 -3
  72. package/docs/interfaces/plugins.GaussianSplattingEntranceAnimationPluginType.EventMap.html +1 -1
  73. package/docs/interfaces/plugins.GaussianSplattingEntranceAnimationPluginType.State.html +1 -1
  74. package/docs/interfaces/plugins.ItemMaskController.html +1 -1
  75. package/docs/interfaces/plugins.ItemMaskPluginType.EventMap.html +1 -1
  76. package/docs/interfaces/plugins.ItemMaskPluginType.State.html +1 -1
  77. package/docs/interfaces/plugins.Object3DHelperPluginType.BaseController.html +1 -1
  78. package/docs/interfaces/plugins.Object3DHelperPluginType.BaseHelper.html +1 -1
  79. package/docs/interfaces/plugins.Object3DHelperPluginType.BoundingBoxController.html +1 -1
  80. package/docs/interfaces/plugins.Object3DHelperPluginType.MoveController.html +1 -1
  81. package/docs/interfaces/plugins.Object3DHelperPluginType.MoveHelperAbstract.html +1 -1
  82. package/docs/interfaces/plugins.Object3DHelperPluginType.RotateController.html +1 -1
  83. package/docs/interfaces/plugins.Object3DHelperPluginType.RotateHelperAbstract.html +1 -1
  84. package/docs/interfaces/plugins.OrientationPluginController.html +1 -1
  85. package/docs/interfaces/plugins.OrientationPluginType.EventMap.html +1 -1
  86. package/docs/interfaces/plugins.OrientationPluginType.State.html +1 -1
  87. package/docs/interfaces/plugins.PanoAnimeController.html +1 -1
  88. package/docs/interfaces/plugins.PanoAnimePluginType.EventMap.html +1 -1
  89. package/docs/interfaces/plugins.PanoAnimePluginType.State.html +1 -1
  90. package/docs/interfaces/plugins.PluginTemplateType.EventMap.html +1 -1
  91. package/docs/interfaces/plugins.PluginTemplateType.State.html +1 -1
  92. package/docs/interfaces/plugins.TrajectoryController.html +1 -1
  93. package/docs/interfaces/react.FiveInjectionTypes.html +1 -1
  94. package/docs/interfaces/react.UseFivePluginOptions.html +1 -1
  95. package/docs/interfaces/react.UseFivePluginOptionsWithCreate.html +1 -1
  96. package/docs/modules/five.html +1 -1
  97. package/docs/types/five.ParseOptions.html +1 -1
  98. package/five/gaussian-splatting/util/renderData.d.ts +2 -0
  99. package/five/index.js +531 -50
  100. package/five/index.mjs +1903 -1591
  101. package/five/model/objects/pbmGaussianSplattingObject.d.ts +1 -0
  102. package/five/model/objects/pbmGaussianSplattingRenderMesh.d.ts +2 -0
  103. package/five/model/parameter.d.ts +4 -0
  104. package/five/renderer/index.d.ts +1 -1
  105. package/gltf-loader/index.js +3 -3
  106. package/gltf-loader/index.mjs +3 -3
  107. package/line/index.js +3 -3
  108. package/line/index.mjs +3 -3
  109. package/package.json +1 -1
  110. package/plugins/GaussianSplattingEntranceAnimationPlugin/Controller.d.ts +1 -0
  111. package/plugins/index.js +3 -3
  112. package/plugins/index.mjs +19 -8
  113. package/react/index.js +3 -3
  114. package/react/index.mjs +38 -16
  115. package/shader-lib/SweepModelScreen/index.d.ts +6 -0
  116. package/shader-lib/SweepModelScreen/plugin.d.ts +23 -0
  117. package/shader-lib/SweepModelScreen/utils.d.ts +39 -0
  118. package/shader-lib/index.d.ts +1 -0
  119. package/shader-lib/index.js +34 -3
  120. package/shader-lib/index.mjs +118 -3
  121. package/sticker/index.js +3 -3
  122. package/sticker/index.mjs +3 -3
  123. package/umd/five-gltf-loader.js +3 -3
  124. package/umd/five-line.js +3 -3
  125. package/umd/five-plugins.js +3 -3
  126. package/umd/five-react.js +3 -3
  127. package/umd/five-shader-lib.js +34 -3
  128. package/umd/five-sticker.js +3 -3
  129. package/umd/five-vfx.js +2 -2
  130. package/umd/five-vue.js +2 -2
  131. package/umd/five.js +499 -18
  132. package/vfx/index.js +2 -2
  133. package/vfx/index.mjs +2 -2
  134. package/vue/index.js +2 -2
  135. package/vue/index.mjs +2 -2
  136. package/work-downloader/index.js +2 -2
  137. package/work-downloader/index.mjs +2 -2
package/react/index.mjs CHANGED
@@ -1,8 +1,8 @@
1
1
  /**
2
2
  * @license
3
3
  * @realsee/five
4
- * Generated: 2026/5/22
5
- * Version: 6.8.5
4
+ * Generated: 2026/6/10
5
+ * Version: 6.8.7
6
6
  * Terms:
7
7
  * Realsee SDK License Agreement
8
8
  * Update: July 28, 2021
@@ -255,14 +255,36 @@
255
255
  */import * as e from "react";
256
256
  import { useCallback as t, useEffect as n, useRef as r, useState as i } from "react";
257
257
  import * as a from "three";
258
- import { Five as o, InternalWebGLRenderer as s, getViewportScale as c } from "@realsee/five";
258
+ import { Five as o, getViewportScale as s } from "@realsee/five";
259
259
  //#region build/react/rendererPool.js
260
- var l = [], u = [], d = null, f = 3e3;
261
- function p({ preserveDrawingBuffer: e = !0, premultipliedAlpha: t = !0, stencil: n = !0, antialias: r = !1, webgl2: i = !1, logarithmicDepthBuffer: a, precision: o, powerPreference: c, backgroundColor: f = 1579548, backgroundAlpha: p = 1, pixelRatio: m } = {}) {
260
+ var c = [], l = [], u = null, d = 3e3;
261
+ function f({ preserveDrawingBuffer: e, premultipliedAlpha: t, stencil: n, antialias: r, webgl2: i, logarithmicDepthBuffer: o, precision: s, powerPreference: c }) {
262
+ let l = {
263
+ antialias: r,
264
+ alpha: !0,
265
+ depth: !0,
266
+ preserveDrawingBuffer: e,
267
+ stencil: n,
268
+ premultipliedAlpha: t,
269
+ powerPreference: c
270
+ }, u = {
271
+ logarithmicDepthBuffer: o,
272
+ precision: s
273
+ }, d;
274
+ if (i) {
275
+ let e = document.createElement("canvas"), t = e.getContext("webgl2", l);
276
+ t ? d = new a.WebGLRenderer(Object.assign(Object.assign(Object.assign({}, l), u), {
277
+ canvas: e,
278
+ context: t
279
+ })) : (console.error("error occurred when getting webgl2 canvas context, maybe webgl2 not supported, fallback to webgl."), d = new a.WebGLRenderer(Object.assign(Object.assign({}, l), u)));
280
+ } else d = new a.WebGLRenderer(Object.assign(Object.assign({}, l), u));
281
+ return d.outputEncoding = a.sRGBEncoding, d.autoClear = !0, d;
282
+ }
283
+ function p({ preserveDrawingBuffer: e = !0, premultipliedAlpha: t = !0, stencil: n = !0, antialias: r = !1, webgl2: i = !1, logarithmicDepthBuffer: a, precision: o, powerPreference: s, backgroundColor: d = 1579548, backgroundAlpha: p = 1, pixelRatio: m } = {}) {
262
284
  if (typeof window > "u") return;
263
- d && (clearTimeout(d), d = null);
285
+ u && (clearTimeout(u), u = null);
264
286
  let h;
265
- return h = i ? u.shift() : l.shift(), h || (h = new s({
287
+ return h = i ? l.shift() : c.shift(), h || (h = f({
266
288
  preserveDrawingBuffer: e,
267
289
  premultipliedAlpha: t,
268
290
  stencil: n,
@@ -270,21 +292,21 @@ function p({ preserveDrawingBuffer: e = !0, premultipliedAlpha: t = !0, stencil:
270
292
  webgl2: i,
271
293
  logarithmicDepthBuffer: a,
272
294
  precision: o,
273
- powerPreference: c
274
- })), m !== void 0 && h.setPixelRatio(m), h.setClearColor(f, p), h.autoClear = !0, h;
295
+ powerPreference: s
296
+ })), m !== void 0 && h.setPixelRatio(m), h.setClearColor(d, p), h.autoClear = !0, h;
275
297
  }
276
298
  function m(e) {
277
- e && (e.capabilities.isWebGL2 ? u.indexOf(e) === -1 && u.push(e) : l.indexOf(e) === -1 && l.push(e), h());
299
+ e && (e.capabilities.isWebGL2 ? l.indexOf(e) === -1 && l.push(e) : c.indexOf(e) === -1 && c.push(e), h());
278
300
  }
279
- function h(e = f) {
280
- d && clearTimeout(d), d = setTimeout(() => {
281
- d = null, g();
301
+ function h(e = d) {
302
+ u && clearTimeout(u), u = setTimeout(() => {
303
+ u = null, g();
282
304
  }, e);
283
305
  }
284
306
  function g() {
307
+ for (let e of c) e.dispose();
285
308
  for (let e of l) e.dispose();
286
- for (let e of u) e.dispose();
287
- l.length = 0, u.length = 0;
309
+ c.length = 0, l.length = 0;
288
310
  }
289
311
  //#endregion
290
312
  //#region build/react/context.js
@@ -308,7 +330,7 @@ function b(e, t) {
308
330
  return !0;
309
331
  }
310
332
  function x(e = {}) {
311
- let t = c() === 1 ? window.devicePixelRatio : 1, n = e.backgroundColor;
333
+ let t = s() === 1 ? window.devicePixelRatio : 1, n = e.backgroundColor;
312
334
  return {
313
335
  webgl2: e.webgl2,
314
336
  preserveDrawingBuffer: e.preserveDrawingBuffer,
@@ -0,0 +1,6 @@
1
+ import { CustomShader } from '@realsee/five';
2
+ export declare class SweepModelScreenShader extends CustomShader {
3
+ constructor();
4
+ }
5
+ export * from './utils';
6
+ export * from './plugin';
@@ -0,0 +1,23 @@
1
+ import type { Five } from '@realsee/five';
2
+ import { SweepModelScreenParams } from './utils';
3
+ /**
4
+ * SweepModelScreen 插件控制器接口
5
+ */
6
+ export interface SweepModelScreenController {
7
+ /** 启用插件,注册事件监听 */
8
+ enable(): void;
9
+ /** 禁用插件,移除事件监听并停止动画 */
10
+ disable(): void;
11
+ /** 销毁插件,释放所有资源 */
12
+ dispose(): void;
13
+ /** 运行时更新配置参数 */
14
+ updateParams(params: Partial<SweepModelScreenParams>): void;
15
+ }
16
+ /**
17
+ * SweepModelScreen 插件工厂函数
18
+ *
19
+ * 监听 pressGesture 事件,在用户长按结束时以长按位置为中心
20
+ * 构建屏幕空间子视锥,并在子视锥内的模型表面播放从点击交点向外扩散的扫光动画。
21
+ * 扫光基于世界空间欧氏距离,因此会沿着物体表面的实际几何形状扩散。
22
+ */
23
+ export declare const SweepModelScreenPlugin: (five: Five, params?: Partial<SweepModelScreenParams>) => SweepModelScreenController;
@@ -0,0 +1,39 @@
1
+ import * as THREE from 'three';
2
+ /**
3
+ * SweepModelScreen 插件参数接口
4
+ */
5
+ export interface SweepModelScreenParams {
6
+ /** 动画时长 ms, [100, 10000], 默认 800 */
7
+ animationDuration?: number;
8
+ /** 扫光颜色 RGB [0,1], 默认 [1,1,1] */
9
+ sweepColor?: [number, number, number];
10
+ /** 边缘衰减范围 [0.01, 1.0], 默认 0.15 */
11
+ sweepRange?: number;
12
+ /** 子视锥宽度占比 [0.01, 1.0], 默认 1/6 */
13
+ frustumWidth?: number;
14
+ /** 子视锥高度占比 [0.01, 1.0], 默认 1/6 */
15
+ frustumHeight?: number;
16
+ }
17
+ /**
18
+ * 将值钳制到 [-1, 1] 范围
19
+ */
20
+ export declare function clampNDC(value: number): number;
21
+ /**
22
+ * 填充默认值并钳制参数范围
23
+ */
24
+ export declare function clampParams(params: Partial<SweepModelScreenParams>): Required<SweepModelScreenParams>;
25
+ /**
26
+ * 计算子视锥 extent 并 clamp 角点到 NDC 范围。
27
+ * 返回 clamp 后的中心和半宽半高 extent。
28
+ *
29
+ * frustumWidth/frustumHeight 表示占屏幕的比例(如 1/6)。
30
+ * NDC 空间总宽度为 2(-1 到 1),所以 NDC 半宽 = frustumWidth(即占比 * 总宽/2 = frustumWidth * 2 / 2)。
31
+ */
32
+ export declare function computeFrustumExtent(center: THREE.Vector2, frustumWidth: number, frustumHeight: number): {
33
+ center: THREE.Vector2;
34
+ extent: THREE.Vector2;
35
+ };
36
+ /**
37
+ * 计算动画进度 [0, 1]
38
+ */
39
+ export declare function computeProgress(elapsedMs: number, duration: number): number;
@@ -3,3 +3,4 @@ export * from './SweepModel';
3
3
  export * from './PointCloudExpand';
4
4
  export * from './PolygonCuter';
5
5
  export * from './ShineModel';
6
+ export * from './SweepModelScreen';
@@ -1,8 +1,8 @@
1
1
  /**
2
2
  * @license
3
3
  * @realsee/five
4
- * Generated: 2026/5/22
5
- * Version: 6.8.5
4
+ * Generated: 2026/6/10
5
+ * Version: 6.8.7
6
6
  * Terms:
7
7
  * Realsee SDK License Agreement
8
8
  * Update: July 28, 2021
@@ -533,4 +533,35 @@ vPointSize = gl_PointSize;
533
533
  }
534
534
  #pragma unroll_loop_end
535
535
  #endif
536
- `,j=``,M=class extends c.CustomShader{constructor(){super({type:[`basic`,`phong`,`none`],fragment:{mainBefore:k,mainStart:j,mainEnd:A},uniforms:{shineProgress:new l.Uniform(0),shineBoxes:new l.Uniform([])},defines:{NUM_SHINE_OBJECTS:0}}),Object.defineProperties(this,{shineBoxes:{get(){return this.uniforms.shineBoxes.value},set(e){let t=e.length;t>0&&(this.defines.NUM_SHINE_OBJECTS=t,this.uniforms.shineBoxes.value=e)}}}),this.shineBoxes=[]}onBeforeCompile(e,t){let n=String(this.shineBoxes.length);e.vertexShader=e.vertexShader.replace(/NUM_SHINE_OBJECTS/g,n),e.fragmentShader=e.fragmentShader.replace(/NUM_SHINE_OBJECTS/g,n)}};exports.EvenessPlaneShader=d,exports.PointCloudExpandShader=v,exports.PolygonCuterShader=O,exports.PolygonGenerater=D,exports.ShineModelShader=M,exports.SweepModelShader=h,exports.computeAlignmentMatrix=w;
536
+ `,j=``,M=class extends c.CustomShader{constructor(){super({type:[`basic`,`phong`,`none`],fragment:{mainBefore:k,mainStart:j,mainEnd:A},uniforms:{shineProgress:new l.Uniform(0),shineBoxes:new l.Uniform([])},defines:{NUM_SHINE_OBJECTS:0}}),Object.defineProperties(this,{shineBoxes:{get(){return this.uniforms.shineBoxes.value},set(e){let t=e.length;t>0&&(this.defines.NUM_SHINE_OBJECTS=t,this.uniforms.shineBoxes.value=e)}}}),this.shineBoxes=[]}onBeforeCompile(e,t){let n=String(this.shineBoxes.length);e.vertexShader=e.vertexShader.replace(/NUM_SHINE_OBJECTS/g,n),e.fragmentShader=e.fragmentShader.replace(/NUM_SHINE_OBJECTS/g,n)}},N={animationDuration:800,sweepColor:[1,1,1],sweepRange:.15,frustumWidth:1/6,frustumHeight:1/6};function P(e){return Math.max(-1,Math.min(1,e))}function F(e){var t,n,r,i;return{animationDuration:Math.max(100,Math.min(1e4,(t=e.animationDuration)==null?N.animationDuration:t)),sweepColor:e.sweepColor?[Math.max(0,Math.min(1,e.sweepColor[0])),Math.max(0,Math.min(1,e.sweepColor[1])),Math.max(0,Math.min(1,e.sweepColor[2]))]:[...N.sweepColor],sweepRange:Math.max(.01,Math.min(1,(n=e.sweepRange)==null?N.sweepRange:n)),frustumWidth:Math.max(.01,Math.min(1,(r=e.frustumWidth)==null?N.frustumWidth:r)),frustumHeight:Math.max(.01,Math.min(1,(i=e.frustumHeight)==null?N.frustumHeight:i))}}function I(e,t,n){let r=t,i=n,a=P(e.x-r),o=P(e.x+r),s=P(e.y-i),c=P(e.y+i),u=(a+o)/2,d=(s+c)/2,f=(o-a)/2,p=(c-s)/2,m=t/2,h=n/2,g=Math.max(f,m),_=Math.max(p,h);return{center:new l.Vector2(u,d),extent:new l.Vector2(g,_)}}function L(e,t){return Math.min(1,e/t)}var R=(e,t)=>{let n=!0,r=!1,i=!1,a=null,o=F(t==null?{}:t),s=null,c=1,u=!1,d=(t,n,r,a)=>{if(a){u=!1;return}if(u)return!1;if(r<700)return;if(i)return!1;u=!0;let d=e.model.intersectRaycaster(t);if(!d||d.length===0)return;let p=d[0].point,m=P(n.x),h=P(n.y),g=I(new l.Vector2(m,h),o.frustumWidth,o.frustumHeight),_=e.camera.position.distanceTo(p)*Math.sqrt(o.frustumWidth*o.frustumWidth+o.frustumHeight*o.frustumHeight);s||(s=new V);let v=new l.Matrix4;return v.multiplyMatrices(e.camera.projectionMatrix,e.camera.matrixWorldInverse),s.uniforms.sweepViewProjectionMatrix.value.copy(v),s.uniforms.sweepCenter.value.copy(g.center),s.uniforms.sweepExtent.value.copy(g.extent),s.uniforms.sweepRange.value=_*o.sweepRange,s.uniforms.sweepColor.value.set(o.sweepColor[0],o.sweepColor[1],o.sweepColor[2]),s.uniforms.sweepOrigin.value.copy(p),s.uniforms.sweepProgress.value=0,c=_,e.model.customShaders=[s],f(),!1};function f(){i=!0;let t=performance.now(),n=new l.Matrix4;function u(){if(!i||r)return;let l=L(performance.now()-t,o.animationDuration);s&&(s.uniforms.sweepProgress.value=l*c,n.multiplyMatrices(e.camera.projectionMatrix,e.camera.matrixWorldInverse),s.uniforms.sweepViewProjectionMatrix.value.copy(n)),e.needsRender=!0,e.modelSceneNeedsRender=!0,l>=1?p():a=requestAnimationFrame(u)}a=requestAnimationFrame(u)}function p(){a!==null&&(cancelAnimationFrame(a),a=null),i=!1,e.model.customShaders=[]}function m(){e.on(`wantsPressGesture`,d)}function h(){e.off(`wantsPressGesture`,d)}return m(),{enable(){r||n||(n=!0,m())},disable(){r||n&&(n=!1,h(),p())},dispose(){r||(r=!0,n=!1,h(),p(),s=null)},updateParams(e){r||(o=F(Object.assign(Object.assign({},o),e)))}}},z=`
537
+ uniform float sweepProgress;
538
+ uniform vec2 sweepCenter;
539
+ uniform vec2 sweepExtent;
540
+ uniform float sweepRange;
541
+ uniform vec3 sweepColor;
542
+ uniform vec3 sweepOrigin;
543
+ uniform mat4 sweepViewProjectionMatrix;
544
+ `,B=`
545
+ // 用当前帧的 VP 矩阵计算片元在屏幕上的实际 NDC 位置
546
+ // 注意:projectionMatrix 和 viewMatrix 是 THREE.js 内置的当前帧 uniform(仅 vertex shader 可用)
547
+ // 所以我们用自定义的 sweepViewProjectionMatrix(每帧更新)来做
548
+ vec4 clipPos = sweepViewProjectionMatrix * vFinalPosition;
549
+ vec2 fragNDC = clipPos.xy / clipPos.w;
550
+
551
+ // 判断是否在子视锥内(屏幕空间固定矩形区域)
552
+ vec2 absDiff = abs(fragNDC - sweepCenter);
553
+ if (absDiff.x <= sweepExtent.x && absDiff.y <= sweepExtent.y && sweepProgress > 0.0) {
554
+ // 计算片元世界坐标到扫光原点的欧氏距离(沿物体表面扩散)
555
+ float worldDist = distance(vFinalPosition.xyz, sweepOrigin);
556
+
557
+ // sweepProgress 是当前扫光半径(世界空间绝对值)
558
+ // sweepRange 是扫光波前的宽度(世界空间绝对值)
559
+ if (worldDist <= sweepProgress + sweepRange && worldDist >= sweepProgress - sweepRange) {
560
+ float k = 5.0 / sweepRange;
561
+ float distanceFromSweep = abs(worldDist - sweepProgress);
562
+ float intensity = exp(-k * distanceFromSweep) * 0.8;
563
+
564
+ gl_FragColor.rgb = mix(gl_FragColor.rgb, sweepColor, intensity);
565
+ }
566
+ }
567
+ `,V=class extends c.CustomShader{constructor(){super({type:[`basic`,`phong`,`pointcloud`],fragment:{mainBefore:z,mainStart:``,mainEnd:B},uniforms:{sweepProgress:new l.Uniform(0),sweepCenter:new l.Uniform(new l.Vector2(0,0)),sweepExtent:new l.Uniform(new l.Vector2(1/6,1/6)),sweepRange:new l.Uniform(.3),sweepColor:new l.Uniform(new l.Vector3(1,1,1)),sweepOrigin:new l.Uniform(new l.Vector3(0,0,0)),sweepViewProjectionMatrix:new l.Uniform(new l.Matrix4)},defines:{}})}};exports.EvenessPlaneShader=d,exports.PointCloudExpandShader=v,exports.PolygonCuterShader=O,exports.PolygonGenerater=D,exports.ShineModelShader=M,exports.SweepModelScreenPlugin=R,exports.SweepModelScreenShader=V,exports.SweepModelShader=h,exports.clampNDC=P,exports.clampParams=F,exports.computeAlignmentMatrix=w,exports.computeFrustumExtent=I,exports.computeProgress=L;
@@ -1,8 +1,8 @@
1
1
  /**
2
2
  * @license
3
3
  * @realsee/five
4
- * Generated: 2026/5/22
5
- * Version: 6.8.5
4
+ * Generated: 2026/6/10
5
+ * Version: 6.8.7
6
6
  * Terms:
7
7
  * Realsee SDK License Agreement
8
8
  * Update: July 28, 2021
@@ -676,6 +676,121 @@ var _ = "\n uniform sampler2D polygonTexture;\n\n struct PolygonClipper {\n
676
676
  let n = String(this.shineBoxes.length);
677
677
  e.vertexShader = e.vertexShader.replace(/NUM_SHINE_OBJECTS/g, n), e.fragmentShader = e.fragmentShader.replace(/NUM_SHINE_OBJECTS/g, n);
678
678
  }
679
+ }, T = {
680
+ animationDuration: 800,
681
+ sweepColor: [
682
+ 1,
683
+ 1,
684
+ 1
685
+ ],
686
+ sweepRange: .15,
687
+ frustumWidth: 1 / 6,
688
+ frustumHeight: 1 / 6
689
+ };
690
+ function E(e) {
691
+ return Math.max(-1, Math.min(1, e));
692
+ }
693
+ function D(e) {
694
+ var t, n, r, i;
695
+ return {
696
+ animationDuration: Math.max(100, Math.min(1e4, (t = e.animationDuration) == null ? T.animationDuration : t)),
697
+ sweepColor: e.sweepColor ? [
698
+ Math.max(0, Math.min(1, e.sweepColor[0])),
699
+ Math.max(0, Math.min(1, e.sweepColor[1])),
700
+ Math.max(0, Math.min(1, e.sweepColor[2]))
701
+ ] : [...T.sweepColor],
702
+ sweepRange: Math.max(.01, Math.min(1, (n = e.sweepRange) == null ? T.sweepRange : n)),
703
+ frustumWidth: Math.max(.01, Math.min(1, (r = e.frustumWidth) == null ? T.frustumWidth : r)),
704
+ frustumHeight: Math.max(.01, Math.min(1, (i = e.frustumHeight) == null ? T.frustumHeight : i))
705
+ };
706
+ }
707
+ function O(e, n, r) {
708
+ let i = n, a = r, o = E(e.x - i), s = E(e.x + i), c = E(e.y - a), l = E(e.y + a), u = (o + s) / 2, d = (c + l) / 2, f = (s - o) / 2, p = (l - c) / 2, m = n / 2, h = r / 2, g = Math.max(f, m), _ = Math.max(p, h);
709
+ return {
710
+ center: new t.Vector2(u, d),
711
+ extent: new t.Vector2(g, _)
712
+ };
713
+ }
714
+ function k(e, t) {
715
+ return Math.min(1, e / t);
716
+ }
717
+ //#endregion
718
+ //#region build/shader-lib/SweepModelScreen/plugin.js
719
+ var A = (e, n) => {
720
+ let r = !0, i = !1, a = !1, o = null, s = D(n == null ? {} : n), c = null, l = 1, u = !1, d = (n, r, i, o) => {
721
+ if (o) {
722
+ u = !1;
723
+ return;
724
+ }
725
+ if (u) return !1;
726
+ if (i < 700) return;
727
+ if (a) return !1;
728
+ u = !0;
729
+ let d = e.model.intersectRaycaster(n);
730
+ if (!d || d.length === 0) return;
731
+ let p = d[0].point, m = E(r.x), h = E(r.y), g = O(new t.Vector2(m, h), s.frustumWidth, s.frustumHeight), _ = e.camera.position.distanceTo(p) * Math.sqrt(s.frustumWidth * s.frustumWidth + s.frustumHeight * s.frustumHeight);
732
+ c || (c = new N());
733
+ let v = new t.Matrix4();
734
+ return v.multiplyMatrices(e.camera.projectionMatrix, e.camera.matrixWorldInverse), c.uniforms.sweepViewProjectionMatrix.value.copy(v), c.uniforms.sweepCenter.value.copy(g.center), c.uniforms.sweepExtent.value.copy(g.extent), c.uniforms.sweepRange.value = _ * s.sweepRange, c.uniforms.sweepColor.value.set(s.sweepColor[0], s.sweepColor[1], s.sweepColor[2]), c.uniforms.sweepOrigin.value.copy(p), c.uniforms.sweepProgress.value = 0, l = _, e.model.customShaders = [c], f(), !1;
735
+ };
736
+ function f() {
737
+ a = !0;
738
+ let n = performance.now(), r = new t.Matrix4();
739
+ function u() {
740
+ if (!a || i) return;
741
+ let t = k(performance.now() - n, s.animationDuration);
742
+ c && (c.uniforms.sweepProgress.value = t * l, r.multiplyMatrices(e.camera.projectionMatrix, e.camera.matrixWorldInverse), c.uniforms.sweepViewProjectionMatrix.value.copy(r)), e.needsRender = !0, e.modelSceneNeedsRender = !0, t >= 1 ? p() : o = requestAnimationFrame(u);
743
+ }
744
+ o = requestAnimationFrame(u);
745
+ }
746
+ function p() {
747
+ o !== null && (cancelAnimationFrame(o), o = null), a = !1, e.model.customShaders = [];
748
+ }
749
+ function m() {
750
+ e.on("wantsPressGesture", d);
751
+ }
752
+ function h() {
753
+ e.off("wantsPressGesture", d);
754
+ }
755
+ return m(), {
756
+ enable() {
757
+ i || r || (r = !0, m());
758
+ },
759
+ disable() {
760
+ i || r && (r = !1, h(), p());
761
+ },
762
+ dispose() {
763
+ i || (i = !0, r = !1, h(), p(), c = null);
764
+ },
765
+ updateParams(e) {
766
+ i || (s = D(Object.assign(Object.assign({}, s), e)));
767
+ }
768
+ };
769
+ }, j = "\n uniform float sweepProgress;\n uniform vec2 sweepCenter;\n uniform vec2 sweepExtent;\n uniform float sweepRange;\n uniform vec3 sweepColor;\n uniform vec3 sweepOrigin;\n uniform mat4 sweepViewProjectionMatrix;\n", M = "\n // 用当前帧的 VP 矩阵计算片元在屏幕上的实际 NDC 位置\n // 注意:projectionMatrix 和 viewMatrix 是 THREE.js 内置的当前帧 uniform(仅 vertex shader 可用)\n // 所以我们用自定义的 sweepViewProjectionMatrix(每帧更新)来做\n vec4 clipPos = sweepViewProjectionMatrix * vFinalPosition;\n vec2 fragNDC = clipPos.xy / clipPos.w;\n\n // 判断是否在子视锥内(屏幕空间固定矩形区域)\n vec2 absDiff = abs(fragNDC - sweepCenter);\n if (absDiff.x <= sweepExtent.x && absDiff.y <= sweepExtent.y && sweepProgress > 0.0) {\n // 计算片元世界坐标到扫光原点的欧氏距离(沿物体表面扩散)\n float worldDist = distance(vFinalPosition.xyz, sweepOrigin);\n\n // sweepProgress 是当前扫光半径(世界空间绝对值)\n // sweepRange 是扫光波前的宽度(世界空间绝对值)\n if (worldDist <= sweepProgress + sweepRange && worldDist >= sweepProgress - sweepRange) {\n float k = 5.0 / sweepRange;\n float distanceFromSweep = abs(worldDist - sweepProgress);\n float intensity = exp(-k * distanceFromSweep) * 0.8;\n\n gl_FragColor.rgb = mix(gl_FragColor.rgb, sweepColor, intensity);\n }\n }\n", N = class extends e {
770
+ constructor() {
771
+ super({
772
+ type: [
773
+ "basic",
774
+ "phong",
775
+ "pointcloud"
776
+ ],
777
+ fragment: {
778
+ mainBefore: j,
779
+ mainStart: "",
780
+ mainEnd: M
781
+ },
782
+ uniforms: {
783
+ sweepProgress: new t.Uniform(0),
784
+ sweepCenter: new t.Uniform(new t.Vector2(0, 0)),
785
+ sweepExtent: new t.Uniform(new t.Vector2(1 / 6, 1 / 6)),
786
+ sweepRange: new t.Uniform(.3),
787
+ sweepColor: new t.Uniform(new t.Vector3(1, 1, 1)),
788
+ sweepOrigin: new t.Uniform(new t.Vector3(0, 0, 0)),
789
+ sweepViewProjectionMatrix: new t.Uniform(new t.Matrix4())
790
+ },
791
+ defines: {}
792
+ });
793
+ }
679
794
  };
680
795
  //#endregion
681
- export { r as EvenessPlaneShader, u as PointCloudExpandShader, b as PolygonCuterShader, y as PolygonGenerater, w as ShineModelShader, s as SweepModelShader, g as computeAlignmentMatrix };
796
+ export { r as EvenessPlaneShader, u as PointCloudExpandShader, b as PolygonCuterShader, y as PolygonGenerater, w as ShineModelShader, A as SweepModelScreenPlugin, N as SweepModelScreenShader, s as SweepModelShader, E as clampNDC, D as clampParams, g as computeAlignmentMatrix, O as computeFrustumExtent, k as computeProgress };
package/sticker/index.js CHANGED
@@ -1,8 +1,8 @@
1
1
  /**
2
2
  * @license
3
3
  * @realsee/five
4
- * Generated: 2026/5/22
5
- * Version: 6.8.5
4
+ * Generated: 2026/6/10
5
+ * Version: 6.8.7
6
6
  * Terms:
7
7
  * Realsee SDK License Agreement
8
8
  * Update: July 28, 2021
@@ -252,4 +252,4 @@
252
252
  * No amendment to or modification of this Agreement will be binding unless in
253
253
  * writing and signed by Realsee. You and Realsee hereto confirm that this
254
254
  * Agreement and all related documents shall be drafted in English.
255
- */Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},s=(n,r,a)=>(a=n==null?{}:e(i(n)),o(r||!n||!n.__esModule?t(a,`default`,{value:n,enumerable:!0}):a,n));let c=require(`three`);c=s(c,1);var l=new Float32Array([-.5,-.5,0,.5,-.5,0,-.5,.5,0,.5,.5,0]),u=new Float32Array([0,0,1,0,0,1,1,1]),d=new Uint8Array([0,1,2,1,3,2]),f=new c.BufferGeometry;f.setAttribute(`position`,new c.BufferAttribute(l,3)),f.setAttribute(`uv`,new c.BufferAttribute(u,2)),f.setIndex(new c.BufferAttribute(d,1));var p=window,m=p.requestAnimationFrame||p.mozRequestAnimationFrame||p.webkitRequestAnimationFrame||p.msRequestAnimationFrame||(e=>setTimeout(e,16)),h=typeof performance<`u`&&performance.timing!==void 0?performance.timing.navigationStart:Date.now(),g=typeof performance<`u`?(()=>h+performance.now()):(()=>Date.now());function _(e,t){e.naturalWidth>0&&m(()=>t());let n=()=>t();return e.addEventListener(`load`,n,!1),()=>e.removeEventListener(`load`,n,!1)}function v(e,t){let n=g(),r=!1,i=()=>{r=!0,t(),g()-n<3e3?m(i):r=!1},a=()=>{n=g(),r===!1&&i()};return e.addEventListener(`timeupdate`,a,!1),()=>{e.removeEventListener(`timeupdate`,a,!1),r=!1}}function y(e,t){let n=e.dispose;e.dispose=()=>{t(),n.call(e)}}var b=class extends c.Mesh{static get version(){return`6.8.5`}constructor(e,t,n){let r=new c.MeshBasicMaterial;if(super(f,r),this._needsRender=!1,this.scale.set(e,t,1),typeof n==`string`){r.transparent=/\.png$/.test(n);let e=new Image;e.src=n,e.crossOrigin=``,n=e}if(n instanceof HTMLImageElement){let e=r.map=new c.Texture;e.wrapS=c.ClampToEdgeWrapping,e.wrapT=c.ClampToEdgeWrapping,e.minFilter=c.LinearFilter,e.encoding=c.sRGBEncoding,y(e,_(n,()=>{e.image=n,e.needsUpdate=!0,this._needsRender=!0}))}else if(n instanceof HTMLCanvasElement)r.map=new c.CanvasTexture(n);else if(n instanceof HTMLVideoElement){let e=r.map=new c.VideoTexture(n);e.wrapS=c.ClampToEdgeWrapping,e.wrapT=c.ClampToEdgeWrapping,e.minFilter=c.LinearFilter,e.encoding=c.sRGBEncoding,y(e,v(n,()=>{this._needsRender=!0}))}}get needsRender(){return this._needsRender}set needsRender(e){this._needsRender=e,e===!0&&this.material.map&&(this.material.map.needsUpdate=!0)}setSize(e,t){this.scale.set(e,t,1),this._needsRender=!0}setTransparent(e){this.material.transparent=e,this._needsRender=!0}locationWithIntersection(e,t=.005){let{point:n,face:r}=e;this.position.copy(n),r&&(this.position.add(r.normal.clone().setLength(t)),this.lookAt(n.clone().add(r.normal))),this._needsRender=!0}dispose(){var e;(e=this.material.map)==null||e.dispose(),this.material.dispose()}};exports.Sticker=b;
255
+ */Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},s=(n,r,a)=>(a=n==null?{}:e(i(n)),o(r||!n||!n.__esModule?t(a,`default`,{value:n,enumerable:!0}):a,n));let c=require(`three`);c=s(c,1);var l=new Float32Array([-.5,-.5,0,.5,-.5,0,-.5,.5,0,.5,.5,0]),u=new Float32Array([0,0,1,0,0,1,1,1]),d=new Uint8Array([0,1,2,1,3,2]),f=new c.BufferGeometry;f.setAttribute(`position`,new c.BufferAttribute(l,3)),f.setAttribute(`uv`,new c.BufferAttribute(u,2)),f.setIndex(new c.BufferAttribute(d,1));var p=window,m=p.requestAnimationFrame||p.mozRequestAnimationFrame||p.webkitRequestAnimationFrame||p.msRequestAnimationFrame||(e=>setTimeout(e,16)),h=typeof performance<`u`&&performance.timing!==void 0?performance.timing.navigationStart:Date.now(),g=typeof performance<`u`?(()=>h+performance.now()):(()=>Date.now());function _(e,t){e.naturalWidth>0&&m(()=>t());let n=()=>t();return e.addEventListener(`load`,n,!1),()=>e.removeEventListener(`load`,n,!1)}function v(e,t){let n=g(),r=!1,i=()=>{r=!0,t(),g()-n<3e3?m(i):r=!1},a=()=>{n=g(),r===!1&&i()};return e.addEventListener(`timeupdate`,a,!1),()=>{e.removeEventListener(`timeupdate`,a,!1),r=!1}}function y(e,t){let n=e.dispose;e.dispose=()=>{t(),n.call(e)}}var b=class extends c.Mesh{static get version(){return`6.8.7`}constructor(e,t,n){let r=new c.MeshBasicMaterial;if(super(f,r),this._needsRender=!1,this.scale.set(e,t,1),typeof n==`string`){r.transparent=/\.png$/.test(n);let e=new Image;e.src=n,e.crossOrigin=``,n=e}if(n instanceof HTMLImageElement){let e=r.map=new c.Texture;e.wrapS=c.ClampToEdgeWrapping,e.wrapT=c.ClampToEdgeWrapping,e.minFilter=c.LinearFilter,e.encoding=c.sRGBEncoding,y(e,_(n,()=>{e.image=n,e.needsUpdate=!0,this._needsRender=!0}))}else if(n instanceof HTMLCanvasElement)r.map=new c.CanvasTexture(n);else if(n instanceof HTMLVideoElement){let e=r.map=new c.VideoTexture(n);e.wrapS=c.ClampToEdgeWrapping,e.wrapT=c.ClampToEdgeWrapping,e.minFilter=c.LinearFilter,e.encoding=c.sRGBEncoding,y(e,v(n,()=>{this._needsRender=!0}))}}get needsRender(){return this._needsRender}set needsRender(e){this._needsRender=e,e===!0&&this.material.map&&(this.material.map.needsUpdate=!0)}setSize(e,t){this.scale.set(e,t,1),this._needsRender=!0}setTransparent(e){this.material.transparent=e,this._needsRender=!0}locationWithIntersection(e,t=.005){let{point:n,face:r}=e;this.position.copy(n),r&&(this.position.add(r.normal.clone().setLength(t)),this.lookAt(n.clone().add(r.normal))),this._needsRender=!0}dispose(){var e;(e=this.material.map)==null||e.dispose(),this.material.dispose()}};exports.Sticker=b;
package/sticker/index.mjs CHANGED
@@ -1,8 +1,8 @@
1
1
  /**
2
2
  * @license
3
3
  * @realsee/five
4
- * Generated: 2026/5/22
5
- * Version: 6.8.5
4
+ * Generated: 2026/6/10
5
+ * Version: 6.8.7
6
6
  * Terms:
7
7
  * Realsee SDK License Agreement
8
8
  * Update: July 28, 2021
@@ -311,7 +311,7 @@ function d(e, t) {
311
311
  }
312
312
  var f = class extends e.Mesh {
313
313
  static get version() {
314
- return "6.8.5";
314
+ return "6.8.7";
315
315
  }
316
316
  constructor(t, n, r) {
317
317
  let a = new e.MeshBasicMaterial();
@@ -1,8 +1,8 @@
1
1
  /**
2
2
  * @license
3
3
  * @realsee/five
4
- * Generated: 2026/5/22
5
- * Version: 6.8.5
4
+ * Generated: 2026/6/10
5
+ * Version: 6.8.7
6
6
  * Terms:
7
7
  * Realsee SDK License Agreement
8
8
  * Update: July 28, 2021
@@ -258,4 +258,4 @@
258
258
  `),a=[`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
  `),o=[`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
  `),s={specular:{value:new t.Color().setHex(16777215)},glossiness:{value:1},specularMap:{value:null},glossinessMap:{value:null}};this._extraUniforms=s,this.onBeforeCompile=function(e){for(var t in s)e.uniforms[t]=s[t];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>`,n),e.fragmentShader=e.fragmentShader.replace(`#include <metalnessmap_pars_fragment>`,r),e.fragmentShader=e.fragmentShader.replace(`#include <roughnessmap_fragment>`,i),e.fragmentShader=e.fragmentShader.replace(`#include <metalnessmap_fragment>`,a),e.fragmentShader=e.fragmentShader.replace(`#include <lights_physical_fragment>`,o)},Object.defineProperties(this,{specular:{get:function(){return s.specular.value},set:function(e){s.specular.value=e}},specularMap:{get:function(){return s.specularMap.value},set:function(e){s.specularMap.value=e}},glossiness:{get:function(){return s.glossiness.value},set:function(e){s.glossiness.value=e}},glossinessMap:{get:function(){return s.glossinessMap.value},set:function(e){s.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(t.MeshStandardMaterial.prototype),h.prototype.constructor=h,h.prototype.copy=function(e){return t.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:r.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,n,r){var i=n.extensions[this.name];e.color=new t.Color(1,1,1),e.opacity=1;var a=[];if(Array.isArray(i.diffuseFactor)){var o=i.diffuseFactor;e.color.fromArray(o),e.opacity=o[3]}if(i.diffuseTexture!==void 0&&a.push(r.assignTexture(e,`map`,i.diffuseTexture)),e.emissive=new t.Color(0,0,0),e.glossiness=i.glossinessFactor===void 0?1:i.glossinessFactor,e.specular=new t.Color(1,1,1),Array.isArray(i.specularFactor)&&e.specular.fromArray(i.specularFactor),i.specularGlossinessTexture!==void 0){var s=i.specularGlossinessTexture;a.push(r.assignTexture(e,`glossinessMap`,s)),a.push(r.assignTexture(e,`specularMap`,s))}return Promise.all(a)},createMaterial:function(e){var n=new h(e);return n.fog=!0,n.color=e.color,n.map=e.map===void 0?null:e.map,n.lightMap=null,n.lightMapIntensity=1,n.aoMap=e.aoMap===void 0?null:e.aoMap,n.aoMapIntensity=1,n.emissive=e.emissive,n.emissiveIntensity=1,n.emissiveMap=e.emissiveMap===void 0?null:e.emissiveMap,n.bumpMap=e.bumpMap===void 0?null:e.bumpMap,n.bumpScale=1,n.normalMap=e.normalMap===void 0?null:e.normalMap,n.normalMapType=t.TangentSpaceNormalMap,e.normalScale&&(n.normalScale=e.normalScale),n.displacementMap=null,n.displacementScale=1,n.displacementBias=0,n.specularMap=e.specularMap===void 0?null:e.specularMap,n.specular=e.specular,n.glossinessMap=e.glossinessMap===void 0?null:e.glossinessMap,n.glossiness=e.glossiness,n.alphaMap=null,n.envMap=e.envMap===void 0?null:e.envMap,n.envMapIntensity=1,n.refractionRatio=.98,n}}}function _(){this.name=r.KHR_MESH_QUANTIZATION}function v(e,n,r,i){t.Interpolant.call(this,e,n,r,i)}v.prototype=Object.create(t.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=r.REALSEE_MATERIALS_LIGHTMAP}y.prototype.getMaterialType=function(e){return t.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:t.NearestFilter,9729:t.LinearFilter,9984:t.NearestMipmapNearestFilter,9985:t.LinearMipmapNearestFilter,9986:t.NearestMipmapLinearFilter,9987:t.LinearMipmapLinearFilter},C={33071:t.ClampToEdgeWrapping,33648:t.MirroredRepeatWrapping,10497:t.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:t.InterpolateLinear,STEP:t.InterpolateDiscrete},O={OPAQUE:`OPAQUE`,MASK:`MASK`,BLEND:`BLEND`},k={"image/png":t.RGBAFormat,"image/jpeg":t.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 t.MeshStandardMaterial({color:16777215,emissive:0,metalness:1,roughness:1,transparent:!1,depthTest:!0,side:t.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[r.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,r,i){this.json=e||{},this.extensions=r||{},this.options=i||{},this.cache=new n,this.associations=new Map,this.primitiveCache={},this.textureLoader=new t.TextureLoader(this.options.manager),this.textureLoader.setCrossOrigin(this.options.crossOrigin),this.fileLoader=new t.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 n=e+`:`+t,i=this.cache.get(n);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[r.KHR_LIGHTS_PUNCTUAL].loadLight(t);break;default:throw Error(`Unknown type: `+e)}this.cache.add(n,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],n=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[r.KHR_BINARY_GLTF].body);var i=this.options;return new Promise(function(e,r){n.load(A(t.uri,i.path),e,void 0,function(){r(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 n=this,r=this.json,i=this.json.accessors[e];if(i.bufferView===void 0&&i.sparse===void 0)return Promise.resolve(null);var a=[];return i.bufferView===void 0?a.push(null):a.push(this.getDependency(`bufferView`,i.bufferView)),i.sparse!==void 0&&(a.push(this.getDependency(`bufferView`,i.sparse.indices.bufferView)),a.push(this.getDependency(`bufferView`,i.sparse.values.bufferView))),Promise.all(a).then(function(e){var a=e[0],o=w[i.type],s=x[i.componentType],c=s.BYTES_PER_ELEMENT,l=c*o,u=i.byteOffset||0,d=i.bufferView===void 0?void 0:r.bufferViews[i.bufferView].byteStride,f=i.normalized===!0,p,m;if(d&&d!==l){var h=Math.floor(u/d),g=`InterleavedBuffer:`+i.bufferView+`:`+i.componentType+`:`+h+`:`+i.count,_=n.cache.get(g);_||(p=new s(a,h*d,i.count*d/c),_=new t.InterleavedBuffer(p,d/c),n.cache.add(g,_)),m=new t.InterleavedBufferAttribute(_,o,u%d/c,f)}else p=a===null?new s(i.count*o):new s(a,u,i.count*o),m=new t.BufferAttribute(p,o,f);if(i.sparse!==void 0){var v=w.SCALAR,y=x[i.sparse.indices.componentType],b=i.sparse.indices.byteOffset||0,S=i.sparse.values.byteOffset||0,C=new y(e[1],b,i.sparse.count*v),T=new s(e[2],S,i.sparse.count*o);a!==null&&(m=new t.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*o]),o>=2&&m.setY(O,T[E*o+1]),o>=3&&m.setZ(O,T[E*o+2]),o>=4&&m.setW(O,T[E*o+3]),o>=5)throw Error(`THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.`)}}return m})},R.prototype.loadTexture=function(e){var n=this,i=this.json,a=this.options,o=this.textureLoader,s=self.URL||self.webkitURL,c=i.textures[e],l=c.extensions||{},u=l[r.MSFT_TEXTURE_DDS]?i.images[l[r.MSFT_TEXTURE_DDS].source]:i.images[c.source],d=u.uri,f=!1;return u.bufferView!==void 0&&(d=n.getDependency(`bufferView`,u.bufferView).then(function(e){f=!0;var t=new Blob([e],{type:u.mimeType});return d=s.createObjectURL(t),d})),Promise.resolve(d).then(function(e){var t=a.manager.getHandler(e);return t||(t=l[r.MSFT_TEXTURE_DDS]?n.extensions[r.MSFT_TEXTURE_DDS].ddsLoader:o),new Promise(function(n,r){t.load(A(e,a.path),n,void 0,r)})}).then(function(r){f===!0&&s.revokeObjectURL(d),r.flipY=!1,c.name&&(r.name=c.name),u.mimeType in k&&(r.format=k[u.mimeType]);var a=(i.samplers||{})[c.sampler]||{};return r.magFilter=S[a.magFilter]||t.LinearFilter,r.minFilter=S[a.minFilter]||t.LinearMipmapLinearFilter,r.wrapS=C[a.wrapS]||t.RepeatWrapping,r.wrapT=C[a.wrapT]||t.RepeatWrapping,n.associations.set(r,{type:`textures`,index:e}),r})},R.prototype.assignTexture=function(e,n,i){var a=this;return this.getDependency(`texture`,i.index).then(function(o){if(!o.isCompressedTexture)switch(n){case`aoMap`:case`emissiveMap`:case`metalnessMap`:case`normalMap`:case`roughnessMap`:o.format=t.RGBFormat;break}if(i.texCoord!==void 0&&i.texCoord!=0&&!(n===`aoMap`&&i.texCoord==1)&&console.warn(`THREE.GLTFLoader: Custom UV set `+i.texCoord+` for texture `+n+` not yet supported.`),a.extensions[r.KHR_TEXTURE_TRANSFORM]){var s=i.extensions===void 0?void 0:i.extensions[r.KHR_TEXTURE_TRANSFORM];if(s){var c=a.associations.get(o);o=a.extensions[r.KHR_TEXTURE_TRANSFORM].extendTexture(o,s),a.associations.set(o,c)}}e[n]=o})},R.prototype.assignFinalMaterial=function(e){var n=e.geometry,r=e.material,i=n.attributes.tangent!==void 0,a=n.attributes.color!==void 0,o=n.attributes.normal===void 0,s=e.isSkinnedMesh===!0,c=Object.keys(n.morphAttributes).length>0,l=c&&n.morphAttributes.normal!==void 0;if(e.isPoints){var u=`PointsMaterial:`+r.uuid,d=this.cache.get(u);d||(d=new t.PointsMaterial,t.Material.prototype.copy.call(d,r),d.color.copy(r.color),d.map=r.map,d.sizeAttenuation=!1,this.cache.add(u,d)),r=d}else if(e.isLine){var u=`LineBasicMaterial:`+r.uuid,f=this.cache.get(u);f||(f=new t.LineBasicMaterial,t.Material.prototype.copy.call(f,r),f.color.copy(r.color),this.cache.add(u,f)),r=f}if(i||a||o||s||c){var u=`ClonedMaterial:`+r.uuid+`:`;r.isGLTFSpecularGlossinessMaterial&&(u+=`specular-glossiness:`),s&&(u+=`skinning:`),i&&(u+=`vertex-tangents:`),a&&(u+=`vertex-colors:`),o&&(u+=`flat-shading:`),c&&(u+=`morph-targets:`),l&&(u+=`morph-normals:`);var p=this.cache.get(u);p||(p=r.clone(),s&&(p.skinning=!0),i&&(p.vertexTangents=!0),a&&(p.vertexColors=!0),o&&(p.flatShading=!0),c&&(p.morphTargets=!0),l&&(p.morphNormals=!0),this.cache.add(u,p),this.associations.set(p,this.associations.get(r))),r=p}r.aoMap&&n.attributes.uv2===void 0&&n.attributes.uv!==void 0&&n.setAttribute(`uv2`,n.attributes.uv),r.normalScale&&!i&&(r.normalScale.y=-r.normalScale.y),r.clearcoatNormalScale&&!i&&(r.clearcoatNormalScale.y=-r.clearcoatNormalScale.y),e.material=r},R.prototype.loadMaterial=function(e){var n=this,i=this.json,a=this.extensions,o=i.materials[e],s,c={},l=o.extensions||{},u=[];if(l[r.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS]){var d=a[r.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS];s=d.getMaterialType(),u.push(d.extendParams(c,o,n))}else if(l[r.KHR_MATERIALS_UNLIT]){var f=a[r.KHR_MATERIALS_UNLIT];s=f.getMaterialType(),u.push(f.extendParams(c,o,n))}else{s=t.MeshStandardMaterial;var p=o.pbrMetallicRoughness||{};if(c.color=new t.Color(1,1,1),c.opacity=1,Array.isArray(p.baseColorFactor)){var m=p.baseColorFactor;c.color.fromArray(m),c.opacity=m[3]}p.baseColorTexture!==void 0&&u.push(n.assignTexture(c,`map`,p.baseColorTexture)),c.metalness=p.metallicFactor===void 0?1:p.metallicFactor,c.roughness=p.roughnessFactor===void 0?1:p.roughnessFactor,p.metallicRoughnessTexture!==void 0&&(u.push(n.assignTexture(c,`metalnessMap`,p.metallicRoughnessTexture)),u.push(n.assignTexture(c,`roughnessMap`,p.metallicRoughnessTexture)))}o.doubleSided===!0&&(c.side=t.DoubleSide);var g=o.alphaMode||O.OPAQUE;if(g===O.BLEND?(c.transparent=!0,c.depthWrite=!1):(c.transparent=!1,g===O.MASK&&(c.alphaTest=o.alphaCutoff===void 0?.5:o.alphaCutoff)),o.normalTexture!==void 0&&s!==t.MeshBasicMaterial&&(u.push(n.assignTexture(c,`normalMap`,o.normalTexture)),c.normalScale=new t.Vector2(1,1),o.normalTexture.scale!==void 0&&c.normalScale.set(o.normalTexture.scale,o.normalTexture.scale)),o.occlusionTexture!==void 0&&s!==t.MeshBasicMaterial&&(u.push(n.assignTexture(c,`aoMap`,o.occlusionTexture)),o.occlusionTexture.strength!==void 0&&(c.aoMapIntensity=o.occlusionTexture.strength)),o.emissiveFactor!==void 0&&s!==t.MeshBasicMaterial&&(c.emissive=new t.Color().fromArray(o.emissiveFactor)),o.emissiveTexture!==void 0&&s!==t.MeshBasicMaterial&&u.push(n.assignTexture(c,`emissiveMap`,o.emissiveTexture)),l[r.KHR_MATERIALS_CLEARCOAT]){var _=a[r.KHR_MATERIALS_CLEARCOAT];s=_.getMaterialType(),u.push(_.extendParams(c,{extensions:l},n))}if(l[r.KHR_MATERIALS_TRANSMISSION]){var _=a[r.KHR_MATERIALS_TRANSMISSION];s=_.getMaterialType(),u.push(_.extendParams(c,{extensions:l},n))}if(l[r.REALSEE_MATERIALS_LIGHTMAP]){var v=a[r.REALSEE_MATERIALS_LIGHTMAP];s=v.getMaterialType(),u.push(v.extendParams(c,{extensions:l},n))}return Promise.all(u).then(function(){var i=s===h?a[r.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS].createMaterial(c):new s(c);return o.name&&(i.name=o.name),i.map&&(i.map.encoding=t.sRGBEncoding),i.emissiveMap&&(i.emissiveMap.encoding=t.sRGBEncoding),N(i,o),n.associations.set(i,{type:`materials`,index:e}),o.extensions&&M(a,i,o),i})};function z(e,n,r){var i=n.attributes,a=new t.Box3;if(i.POSITION!==void 0){var o=r.json.accessors[i.POSITION],s=o.min,c=o.max;if(s!==void 0&&c!==void 0)a.set(new t.Vector3(s[0],s[1],s[2]),new t.Vector3(c[0],c[1],c[2]));else{console.warn(`THREE.GLTFLoader: Missing min/max properties for accessor POSITION.`);return}}else return;var l=n.targets;if(l!==void 0){for(var u=new t.Vector3,d=new t.Vector3,f=0,p=l.length;f<p;f++){var m=l[f];if(m.POSITION!==void 0){var o=r.json.accessors[m.POSITION],s=o.min,c=o.max;s!==void 0&&c!==void 0?(d.setX(Math.max(Math.abs(s[0]),Math.abs(c[0]))),d.setY(Math.max(Math.abs(s[1]),Math.abs(c[1]))),d.setZ(Math.max(Math.abs(s[2]),Math.abs(c[2]))),u.max(d)):console.warn(`THREE.GLTFLoader: Missing min/max properties for accessor POSITION.`)}}a.expandByVector(u)}e.boundingBox=a;var h=new t.Sphere;a.getCenter(h.center),h.radius=a.min.distanceTo(a.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,n){var r=e.getIndex();if(r===null){var i=[],a=e.getAttribute(`position`);if(a!==void 0){for(var o=0;o<a.count;o++)i.push(o);e.setIndex(i),r=e.getIndex()}else return console.error(`THREE.GLTFLoader.toTrianglesDrawMode(): Undefined position attribute. Processing not possible.`),e}var s=r.count-2,c=[];if(n===t.TriangleFanDrawMode)for(var o=1;o<=s;o++)c.push(r.getX(0)),c.push(r.getX(o)),c.push(r.getX(o+1));else for(var o=0;o<s;o++)o%2==0?(c.push(r.getX(o)),c.push(r.getX(o+1)),c.push(r.getX(o+2))):(c.push(r.getX(o+2)),c.push(r.getX(o+1)),c.push(r.getX(o)));c.length/3!==s&&console.error(`THREE.GLTFLoader.toTrianglesDrawMode(): Unable to generate correct amount of triangles.`);var l=e.clone();return l.setIndex(c),l}return R.prototype.loadGeometries=function(e){var n=this,i=this.extensions,a=this.primitiveCache;function o(e){return i[r.KHR_DRACO_MESH_COMPRESSION].decodePrimitive(e,n).then(function(t){return B(t,e,n)})}for(var s=[],c=0,l=e.length;c<l;c++){var u=e[c],d=I(u),f=a[d];if(f)s.push(f.promise);else{var p=u.extensions&&u.extensions[r.KHR_DRACO_MESH_COMPRESSION]?o(u):B(new t.BufferGeometry,u,n);a[d]={primitive:u,promise:p},s.push(p)}}return Promise.all(s)},R.prototype.loadMesh=function(e){for(var n=this,r=this.json.meshes[e],i=r.primitives,a=[],o=0,s=i.length;o<s;o++){var c=i[o].material===void 0?j(this.cache):this.getDependency(`material`,i[o].material);a.push(c)}return a.push(n.loadGeometries(i)),Promise.all(a).then(function(a){for(var o=a.slice(0,a.length-1),s=a[a.length-1],c=[],l=0,u=s.length;l<u;l++){var d=s[l],f=i[l],p,m=o[l];if(f.mode===b.TRIANGLES||f.mode===b.TRIANGLE_STRIP||f.mode===b.TRIANGLE_FAN||f.mode===void 0)p=r.isSkinnedMesh===!0?new t.SkinnedMesh(d,m):new t.Mesh(d,m),p.isSkinnedMesh===!0&&!p.geometry.attributes.skinWeight.normalized&&p.normalizeSkinWeights(),f.mode===b.TRIANGLE_STRIP?p.geometry=V(p.geometry,t.TriangleStripDrawMode):f.mode===b.TRIANGLE_FAN&&(p.geometry=V(p.geometry,t.TriangleFanDrawMode));else if(f.mode===b.LINES)p=new t.LineSegments(d,m);else if(f.mode===b.LINE_STRIP)p=new t.Line(d,m);else if(f.mode===b.LINE_LOOP)p=new t.LineLoop(d,m);else if(f.mode===b.POINTS)p=new t.Points(d,m);else throw Error(`THREE.GLTFLoader: Primitive mode unsupported: `+f.mode);Object.keys(p.geometry.morphAttributes).length>0&&F(p,r),p.name=r.name||`mesh_`+e,s.length>1&&(p.name+=`_`+l),N(p,r),n.assignFinalMaterial(p),c.push(p)}if(c.length===1)return c[0];for(var h=new t.Group,l=0,u=c.length;l<u;l++)h.add(c[l]);return h})},R.prototype.loadCamera=function(e){var n,r=this.json.cameras[e],i=r[r.type];if(!i){console.warn(`THREE.GLTFLoader: Missing camera parameters.`);return}return r.type===`perspective`?n=new t.PerspectiveCamera(t.MathUtils.radToDeg(i.yfov),i.aspectRatio||1,i.znear||1,i.zfar||2e6):r.type===`orthographic`&&(n=new t.OrthographicCamera(-i.xmag,i.xmag,i.ymag,-i.ymag,i.znear,i.zfar)),r.name&&(n.name=r.name),N(n,r),Promise.resolve(n)},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 n=this.json.animations[e],r=[],i=[],a=[],o=[],s=[],c=0,l=n.channels.length;c<l;c++){var u=n.channels[c],d=n.samplers[u.sampler],f=u.target,p=f.node===void 0?f.id:f.node,m=n.parameters===void 0?d.input:n.parameters[d.input],h=n.parameters===void 0?d.output:n.parameters[d.output];r.push(this.getDependency(`node`,p)),i.push(this.getDependency(`accessor`,m)),a.push(this.getDependency(`accessor`,h)),o.push(d),s.push(f)}return Promise.all([Promise.all(r),Promise.all(i),Promise.all(a),Promise.all(o),Promise.all(s)]).then(function(r){for(var i=r[0],a=r[1],o=r[2],s=r[3],c=r[4],l=[],u=0,d=i.length;u<d;u++){var f=i[u],p=a[u],m=o[u],h=s[u],g=c[u];if(f!==void 0){f.updateMatrix(),f.matrixAutoUpdate=!0;var _;switch(E[g.path]){case E.weights:_=t.NumberKeyframeTrack;break;case E.rotation:_=t.QuaternionKeyframeTrack;break;case E.position:case E.scale:default:_=t.VectorKeyframeTrack;break}var y=f.name?f.name:f.uuid,b=h.interpolation===void 0?t.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 t.AnimationClip(n.name?n.name:`animation_`+e,void 0,l)})},R.prototype.loadNode=function(e){var n=this.json,i=this.extensions,a=this,o=n.meshReferences,s=n.meshUses,c=n.nodes[e];return function(){var e=[];return c.mesh!==void 0&&e.push(a.getDependency(`mesh`,c.mesh).then(function(e){var t;if(o[c.mesh]>1){var n=s[c.mesh]++;t=e.clone(),t.name+=`_instance_`+n}else t=e;return c.weights!==void 0&&t.traverse(function(e){if(e.isMesh)for(var t=0,n=c.weights.length;t<n;t++)e.morphTargetInfluences[t]=c.weights[t]}),t})),c.camera!==void 0&&e.push(a.getDependency(`camera`,c.camera)),c.extensions&&c.extensions[r.KHR_LIGHTS_PUNCTUAL]&&c.extensions[r.KHR_LIGHTS_PUNCTUAL].light!==void 0&&e.push(a.getDependency(`light`,c.extensions[r.KHR_LIGHTS_PUNCTUAL].light)),Promise.all(e)}().then(function(n){var r=c.isBone===!0?new t.Bone:n.length>1?new t.Group:n.length===1?n[0]:new t.Object3D;if(r!==n[0])for(var o=0,s=n.length;o<s;o++)r.add(n[o]);if(c.name&&(r.userData.name=c.name,r.name=t.PropertyBinding.sanitizeNodeName(c.name)),N(r,c),c.extensions&&M(i,r,c),c.matrix!==void 0){var l=new t.Matrix4;l.fromArray(c.matrix),r.applyMatrix4(l)}else c.translation!==void 0&&r.position.fromArray(c.translation),c.rotation!==void 0&&r.quaternion.fromArray(c.rotation),c.scale!==void 0&&r.scale.fromArray(c.scale);return a.associations.set(r,{type:`nodes`,index:e}),r})},R.prototype.loadScene=function(){function e(n,r,i,a){var o=i.nodes[n];return a.getDependency(`node`,n).then(function(e){if(o.skin===void 0)return e;var n;return a.getDependency(`skin`,o.skin).then(function(e){n=e;for(var t=[],r=0,i=n.joints.length;r<i;r++)t.push(a.getDependency(`node`,n.joints[r]));return Promise.all(t)}).then(function(r){return e.traverse(function(e){if(e.isMesh){for(var i=[],a=[],o=0,s=r.length;o<s;o++){var c=r[o];if(c){i.push(c);var l=new t.Matrix4;n.inverseBindMatrices!==void 0&&l.fromArray(n.inverseBindMatrices.array,o*16),a.push(l)}else console.warn(`THREE.GLTFLoader: Joint "%s" could not be found.`,n.joints[o])}e.bind(new t.Skeleton(i,a),e.matrixWorld)}}),e})}).then(function(t){r.add(t);var n=[];if(o.children)for(var s=o.children,c=0,l=s.length;c<l;c++){var u=s[c];n.push(e(u,t,i,a))}return Promise.all(n)})}return function(n){var r=this.json,i=this.extensions,a=this.json.scenes[n],o=this,s=new t.Group;a.name&&(s.name=a.name),N(s,a),a.extensions&&M(i,s,a);for(var c=a.nodes||[],l=[],u=0,d=c.length;u<d;u++)l.push(e(c[u],s,r,o));return Promise.all(l).then(function(){return s})}}(),e})(),u=function(e){t.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(t.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,n,r,i){var a=new t.FileLoader(this.manager);a.setPath(this.path),a.setResponseType(`arraybuffer`),this.crossOrigin===`use-credentials`&&a.setWithCredentials(!0),a.load(e,e=>{var t={attributeIDs:this.defaultAttributeIDs,attributeTypes:this.defaultAttributeTypes,useUniqueIDs:!1};this.decodeGeometry(e,t).then(n).catch(i)},r,i)},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 n=new t.BufferGeometry;e.index&&n.setIndex(new t.BufferAttribute(e.index.array,1));for(var r=0;r<e.attributes.length;r++){var i=e.attributes[r],a=i.name,o=i.array,s=i.itemSize;n.setAttribute(a,new t.BufferAttribute(o,s))}return n},_loadLibrary:function(e,n){var r=new t.FileLoader(this.manager);return r.setPath(this.decoderPath),r.setResponseType(n),new Promise((t,n)=>{r.load(e,t,void 0,n)})},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){t.CompressedTextureLoader.call(this,e)};d.prototype=Object.assign(Object.create(t.CompressedTextureLoader.prototype),{constructor:d,parse:function(e,n){var r={mipmaps:[],width:0,height:0,format:null,mipmapCount:1},i=542327876,a=131072,o=512,s=1024,c=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]!==i)return console.error(`THREE.DDSLoader.parse: Invalid magic number in DDS header.`),r;if(!I[O]&p)return console.error(`THREE.DDSLoader.parse: Unsupported format, must contain a FourCC code.`),r;var L,R=I[k],z=!1;switch(R){case _:L=8,r.format=t.RGB_S3TC_DXT1_Format;break;case v:L=16,r.format=t.RGBA_S3TC_DXT3_Format;break;case y:L=16,r.format=t.RGBA_S3TC_DXT5_Format;break;case b:L=8,r.format=t.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,r.format=t.RGBAFormat;else return console.error(`THREE.DDSLoader.parse: Unsupported FourCC code `,h(R)),r}r.mipmapCount=1,I[w]&a&&n!==!1&&(r.mipmapCount=Math.max(1,I[D]));var B=I[F];if(r.isCubemap=!!(B&o),r.isCubemap&&(!(B&s)||!(B&c)||!(B&l)||!(B&u)||!(B&d)||!(B&f)))return console.error(`THREE.DDSLoader.parse: Incomplete cubemap faces`),r;r.width=I[E],r.height=I[T];for(var V=I[C]+4,H=r.isCubemap?6:1,U=0;U<H;U++)for(var W=r.width,G=r.height,K=0;K<r.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};r.mipmaps.push(Y),V+=J,W=Math.max(W>>1,1),G=Math.max(G>>1,1)}return r}});var f=class extends t.Group{constructor(e){super(),this.needsRender=!0,e&&e.children.length&&this.add(...e.children),this.mixer=new t.AnimationMixer(this)}clone(){let e=super.clone(!0);return e.mixer=new t.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.5`}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)}};e.DDSLoader=d,e.DRACOLoader=u,e.GLTFLoader=m,e.GLTFObject=f,e.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){t.CompressedTextureLoader.call(this,e)};d.prototype=Object.assign(Object.create(t.CompressedTextureLoader.prototype),{constructor:d,parse:function(e,n){var r={mipmaps:[],width:0,height:0,format:null,mipmapCount:1},i=542327876,a=131072,o=512,s=1024,c=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]!==i)return console.error(`THREE.DDSLoader.parse: Invalid magic number in DDS header.`),r;if(!I[O]&p)return console.error(`THREE.DDSLoader.parse: Unsupported format, must contain a FourCC code.`),r;var L,R=I[k],z=!1;switch(R){case _:L=8,r.format=t.RGB_S3TC_DXT1_Format;break;case v:L=16,r.format=t.RGBA_S3TC_DXT3_Format;break;case y:L=16,r.format=t.RGBA_S3TC_DXT5_Format;break;case b:L=8,r.format=t.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,r.format=t.RGBAFormat;else return console.error(`THREE.DDSLoader.parse: Unsupported FourCC code `,h(R)),r}r.mipmapCount=1,I[w]&a&&n!==!1&&(r.mipmapCount=Math.max(1,I[D]));var B=I[F];if(r.isCubemap=!!(B&o),r.isCubemap&&(!(B&s)||!(B&c)||!(B&l)||!(B&u)||!(B&d)||!(B&f)))return console.error(`THREE.DDSLoader.parse: Incomplete cubemap faces`),r;r.width=I[E],r.height=I[T];for(var V=I[C]+4,H=r.isCubemap?6:1,U=0;U<H;U++)for(var W=r.width,G=r.height,K=0;K<r.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};r.mipmaps.push(Y),V+=J,W=Math.max(W>>1,1),G=Math.max(G>>1,1)}return r}});var f=class extends t.Group{constructor(e){super(),this.needsRender=!0,e&&e.children.length&&this.add(...e.children),this.mixer=new t.AnimationMixer(this)}clone(){let e=super.clone(!0);return e.mixer=new t.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)}};e.DDSLoader=d,e.DRACOLoader=u,e.GLTFLoader=m,e.GLTFObject=f,e.THREEGLTFLoader=l});
package/umd/five-line.js CHANGED
@@ -1,8 +1,8 @@
1
1
  /**
2
2
  * @license
3
3
  * @realsee/five
4
- * Generated: 2026/5/22
5
- * Version: 6.8.5
4
+ * Generated: 2026/6/10
5
+ * Version: 6.8.7
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 t.ShaderMaterial{constructor(e){super({uniforms:t.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 t.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,n=e.attributes.instanceStart,r=e.attributes.instanceEnd,i=new Float32Array(2*n.count),a=new t.Vector3,o=new t.Vector3;for(var s=0,c=0,l=n.count;s<l;s++,c+=2)a.fromBufferAttribute(n,s),o.fromBufferAttribute(r,s),i[c]=c===0?0:i[c-1],i[c+1]=i[c]+a.distanceTo(o);let u=new t.InstancedInterleavedBuffer(i,2,1);return e.setAttribute(`instanceDistanceStart`,new t.InterleavedBufferAttribute(u,1,0)),e.setAttribute(`instanceDistanceEnd`,new t.InterleavedBufferAttribute(u,1,1)),this}raycast(e,n){e.camera===null&&console.error(`LineSegments2: "Raycaster.camera" needs to be set in order to raycast against LineSegments2.`);let r=e.ray,i=e.camera,a=i.projectionMatrix,o=this.geometry,s=this.material,c=s.resolution,l=s.linewidth,u=o.attributes.instanceStart,d=o.attributes.instanceEnd,f=new t.Vector4,p=new t.Vector4,m=new t.Vector4,h=new t.Vector3,g=new t.Matrix4,_=new t.Line3,v=new t.Vector3;r.at(1,m),m.w=1,m.applyMatrix4(i.matrixWorldInverse),m.applyMatrix4(a),m.multiplyScalar(1/m.w),m.x*=c.x/2,m.y*=c.y/2,m.z=0,h.copy(m);let y=this.matrixWorld;g.multiplyMatrices(i.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(a),p.applyMatrix4(a),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*=c.x/2,f.y*=c.y/2,p.x*=c.x/2,p.y*=c.y/2,_.start.copy(f),_.start.z=0,_.end.copy(p),_.end.z=0;let e=_.closestPointToPointParameter(h,!0);_.at(e,v);let i=t.MathUtils.lerp(f.z,p.z,e),o=i>=-1&&i<=1;var w=h.distanceTo(v)<l*.5;if(o&&w){_.start.fromBufferAttribute(u,b),_.end.fromBufferAttribute(d,b),_.start.applyMatrix4(y),_.end.applyMatrix4(y);var T=new t.Vector3,E=new t.Vector3;r.distanceSqToSegment(_.start,_.end,E,T),n.push({point:E,pointOnLine:T,distance:r.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 n=e.geometry;if(n instanceof t.Geometry){let e=new t.BufferGeometry().fromGeometry(n);this.setPositions(e.attributes.position.array)}else n instanceof t.BufferGeometry&&this.setPositions(n.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 t.Object3D{static get version(){return`6.8.5`}constructor(e=new t.Vector3,n=new t.Vector3){super(),this.type=`FiveLine`,this.needsRender=!0;let r=new m,i=new d({color:h,linewidth:_,dashScale:v,dashed:!1});this.line=new p(r,i);let a=new t.BufferGeometry,o=new t.PointsMaterial({color:h,size:g,map:y||(y=new t.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 t.Points(a,o),this.points.renderOrder=11,this.points.frustumCulled=!1,this.setPoints(e,n),this.add(this.line,this.points)}setPoints(e,n){let r=[].concat(e.toArray(),n.toArray());this.points.geometry.setAttribute(`position`,new t.BufferAttribute(new Float32Array(r),3)),this.line.geometry.setPositions(r),this.line.computeLineDistances(),this.needsRender=!0}getPoints(){let e=this.points.geometry.attributes.position.array;return[new t.Vector3(e[0],e[1],e[2]),new t.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}),e.Line=b,e.LineGeometry=m,e.LineMaterial=d,e.LineSegmentsGeometry=l,e.THREE_Line2=p,e.THREE_LineSegments2=f});
454
+ `},d=class extends t.ShaderMaterial{constructor(e){super({uniforms:t.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 t.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,n=e.attributes.instanceStart,r=e.attributes.instanceEnd,i=new Float32Array(2*n.count),a=new t.Vector3,o=new t.Vector3;for(var s=0,c=0,l=n.count;s<l;s++,c+=2)a.fromBufferAttribute(n,s),o.fromBufferAttribute(r,s),i[c]=c===0?0:i[c-1],i[c+1]=i[c]+a.distanceTo(o);let u=new t.InstancedInterleavedBuffer(i,2,1);return e.setAttribute(`instanceDistanceStart`,new t.InterleavedBufferAttribute(u,1,0)),e.setAttribute(`instanceDistanceEnd`,new t.InterleavedBufferAttribute(u,1,1)),this}raycast(e,n){e.camera===null&&console.error(`LineSegments2: "Raycaster.camera" needs to be set in order to raycast against LineSegments2.`);let r=e.ray,i=e.camera,a=i.projectionMatrix,o=this.geometry,s=this.material,c=s.resolution,l=s.linewidth,u=o.attributes.instanceStart,d=o.attributes.instanceEnd,f=new t.Vector4,p=new t.Vector4,m=new t.Vector4,h=new t.Vector3,g=new t.Matrix4,_=new t.Line3,v=new t.Vector3;r.at(1,m),m.w=1,m.applyMatrix4(i.matrixWorldInverse),m.applyMatrix4(a),m.multiplyScalar(1/m.w),m.x*=c.x/2,m.y*=c.y/2,m.z=0,h.copy(m);let y=this.matrixWorld;g.multiplyMatrices(i.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(a),p.applyMatrix4(a),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*=c.x/2,f.y*=c.y/2,p.x*=c.x/2,p.y*=c.y/2,_.start.copy(f),_.start.z=0,_.end.copy(p),_.end.z=0;let e=_.closestPointToPointParameter(h,!0);_.at(e,v);let i=t.MathUtils.lerp(f.z,p.z,e),o=i>=-1&&i<=1;var w=h.distanceTo(v)<l*.5;if(o&&w){_.start.fromBufferAttribute(u,b),_.end.fromBufferAttribute(d,b),_.start.applyMatrix4(y),_.end.applyMatrix4(y);var T=new t.Vector3,E=new t.Vector3;r.distanceSqToSegment(_.start,_.end,E,T),n.push({point:E,pointOnLine:T,distance:r.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 n=e.geometry;if(n instanceof t.Geometry){let e=new t.BufferGeometry().fromGeometry(n);this.setPositions(e.attributes.position.array)}else n instanceof t.BufferGeometry&&this.setPositions(n.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 t.Object3D{static get version(){return`6.8.7`}constructor(e=new t.Vector3,n=new t.Vector3){super(),this.type=`FiveLine`,this.needsRender=!0;let r=new m,i=new d({color:h,linewidth:_,dashScale:v,dashed:!1});this.line=new p(r,i);let a=new t.BufferGeometry,o=new t.PointsMaterial({color:h,size:g,map:y||(y=new t.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 t.Points(a,o),this.points.renderOrder=11,this.points.frustumCulled=!1,this.setPoints(e,n),this.add(this.line,this.points)}setPoints(e,n){let r=[].concat(e.toArray(),n.toArray());this.points.geometry.setAttribute(`position`,new t.BufferAttribute(new Float32Array(r),3)),this.line.geometry.setPositions(r),this.line.computeLineDistances(),this.needsRender=!0}getPoints(){let e=this.points.geometry.attributes.position.array;return[new t.Vector3(e[0],e[1],e[2]),new t.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}),e.Line=b,e.LineGeometry=m,e.LineMaterial=d,e.LineSegmentsGeometry=l,e.THREE_Line2=p,e.THREE_LineSegments2=f});