@realsee/dnalogel 3.45.0 → 3.46.0

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 (96) hide show
  1. package/CHANGELOG.md +3 -0
  2. package/dist/Sculpt/Meshes/Line.d.ts +6 -1
  3. package/dist/index.cjs.js +53 -53
  4. package/dist/index.js +29609 -29576
  5. package/dist/index.umd.js +49 -49
  6. package/dist/shared-utils/tag.d.ts +6 -3
  7. package/libs/AreaMakerPlugin/Controller.js +150 -78
  8. package/libs/AreaMakerPlugin/index.js +76 -4
  9. package/libs/AreaMakerPlugin/utils/Item.js +190 -111
  10. package/libs/CSS3DRenderPlugin/Controller.js +89 -29
  11. package/libs/CSS3DRenderPlugin/index.js +75 -15
  12. package/libs/CSS3DRenderPlugin/utils/three/CSS3DObject.js +132 -58
  13. package/libs/CSS3DRenderPlugin/utils/three/CSS3DRender.js +181 -116
  14. package/libs/CruisePlugin/BaseController.js +121 -49
  15. package/libs/CruisePlugin/Move.js +73 -21
  16. package/libs/CruisePlugin/Work.js +98 -46
  17. package/libs/CruisePlugin/index.js +79 -27
  18. package/libs/CurrentPanoImagePlugin/Controller.js +176 -104
  19. package/libs/CurrentPanoImagePlugin/index.js +76 -4
  20. package/libs/GuideLinePlugin/Controller.js +82 -30
  21. package/libs/GuideLinePlugin/GuideLineItem.js +82 -30
  22. package/libs/GuideLinePlugin/GuideLineModeItem/index.js +3 -2
  23. package/libs/GuideLinePlugin/GuideLineModeItem.js +81 -29
  24. package/libs/GuideLinePlugin/index.js +79 -27
  25. package/libs/ModelMakerPlugin/Controller.js +139 -82
  26. package/libs/ModelMakerPlugin/index.js +75 -18
  27. package/libs/ModelTVVideoPlugin/Plugin.js +117 -57
  28. package/libs/ModelTVVideoPlugin/index.js +68 -8
  29. package/libs/Object3DHelperPlugin/Controller.js +54 -31
  30. package/libs/Object3DHelperPlugin/index.js +35 -13
  31. package/libs/PanoCompassPlugin/Controller.js +97 -42
  32. package/libs/PanoCompassPlugin/index.js +71 -16
  33. package/libs/PanoDoorLabelPlugin/BaseController.js +98 -26
  34. package/libs/PanoDoorLabelPlugin/Controller.js +187 -115
  35. package/libs/PanoDoorLabelPlugin/index.js +76 -4
  36. package/libs/PanoMeasurePlugin/Components/Controller0.js +140 -88
  37. package/libs/PanoMeasurePlugin/Components/Controller1.js +178 -126
  38. package/libs/PanoMeasurePlugin/Controller/EditController.js +124 -72
  39. package/libs/PanoMeasurePlugin/Controller/WatchController.js +167 -92
  40. package/libs/PanoMeasurePlugin/Controller/index.js +109 -64
  41. package/libs/PanoMeasurePlugin/Model/area.js +114 -38
  42. package/libs/PanoMeasurePlugin/Modules/Magnifier.js +78 -0
  43. package/libs/PanoMeasurePlugin/Modules/UIController/index.js +97 -45
  44. package/libs/PanoMeasurePlugin/index.js +76 -31
  45. package/libs/PanoMeasurePlugin/utils/dom/areaDom.js +98 -20
  46. package/libs/PanoSpatialTagPlugin/Plugin.js +210 -150
  47. package/libs/PanoSpatialTagPlugin/index.js +66 -6
  48. package/libs/PanoTagPlugin/Components/Common/TagPoint.js +133 -53
  49. package/libs/PanoTagPlugin/Components/Tag/MarketingTag.js +295 -216
  50. package/libs/PanoTagPlugin/Components/Tag/index.js +257 -187
  51. package/libs/PanoTagPlugin/Components/TagContainer.js +157 -87
  52. package/libs/PanoTagPlugin/Components/TagItem.js +144 -74
  53. package/libs/PanoTagPlugin/controller/Tag/BaseTag.js +73 -3
  54. package/libs/PanoTagPlugin/controller/Tag/ModelTag.js +109 -39
  55. package/libs/PanoTagPlugin/controller/Tag/PlaneTag.js +105 -35
  56. package/libs/PanoTagPlugin/controller/Tag/PointTag.js +113 -43
  57. package/libs/PanoTagPlugin/controller/TagRender.js +132 -80
  58. package/libs/PanoTagPlugin/controller/TagUtil.js +136 -84
  59. package/libs/PanoTagPlugin/controller/index.js +113 -61
  60. package/libs/PanoTagPlugin/index.js +89 -37
  61. package/libs/PanoTagPlugin/utils/tag/calculateTagConfig.js +121 -41
  62. package/libs/PanoVideoPlugin/Controller.js +137 -65
  63. package/libs/PanoVideoPlugin/VideoMeshController.js +149 -69
  64. package/libs/PanoVideoPlugin/index.js +82 -10
  65. package/libs/PipelinePlugin/Controller.js +199 -128
  66. package/libs/PipelinePlugin/index.js +76 -5
  67. package/libs/PipelinePlugin/utils/Objects/FlowPipe.js +102 -22
  68. package/libs/PipelinePlugin/utils/Objects/HighlightPipe.js +95 -15
  69. package/libs/PipelinePlugin/utils/Objects/Pipe.js +136 -56
  70. package/libs/Sculpt/Meshes/Box.js +6 -5
  71. package/libs/Sculpt/Meshes/Cylinder.js +7 -6
  72. package/libs/Sculpt/Meshes/Line.d.ts +6 -1
  73. package/libs/Sculpt/Meshes/Line.js +76 -56
  74. package/libs/Sculpt/Meshes/Point.js +6 -5
  75. package/libs/Sculpt/Meshes/Polyline.js +5 -4
  76. package/libs/Sculpt/Meshes/Rectangle.js +3 -2
  77. package/libs/Sculpt/Objects/Line/Editor.js +11 -10
  78. package/libs/Sculpt/utils/three/ColoredMesh.js +14 -13
  79. package/libs/base/BasePlugin.js +14 -13
  80. package/libs/floorplan/MapviewFloorplanPlugin/Controller.js +128 -59
  81. package/libs/floorplan/MapviewFloorplanPlugin/index.js +75 -6
  82. package/libs/floorplan/ModelFloorplanPlugin/Controller.js +129 -59
  83. package/libs/floorplan/ModelFloorplanPlugin/index.js +75 -5
  84. package/libs/floorplan/PanoFloorplanRadarPlugin/Controller.js +158 -86
  85. package/libs/floorplan/PanoFloorplanRadarPlugin/index.js +76 -4
  86. package/libs/floorplan/TopviewFloorplanPlugin/Controller.js +151 -81
  87. package/libs/floorplan/TopviewFloorplanPlugin/index.js +75 -5
  88. package/libs/floorplan/index.js +1 -0
  89. package/libs/index.js +67 -67
  90. package/libs/shared-utils/five/index.js +3 -2
  91. package/libs/shared-utils/five/lookObject.js +3 -2
  92. package/libs/shared-utils/logger.js +1 -1
  93. package/libs/shared-utils/tag.d.ts +6 -3
  94. package/libs/shared-utils/tag.js +38 -24
  95. package/libs/shared-utils/three/index.js +1 -0
  96. package/package.json +1 -1
@@ -1,38 +1,110 @@
1
- var f = Object.defineProperty, b = Object.defineProperties;
2
- var m = Object.getOwnPropertyDescriptors;
3
- var c = Object.getOwnPropertySymbols;
1
+ var g = Object.defineProperty, f = Object.defineProperties;
2
+ var b = Object.getOwnPropertyDescriptors;
3
+ var d = Object.getOwnPropertySymbols;
4
4
  var M = Object.prototype.hasOwnProperty, W = Object.prototype.propertyIsEnumerable;
5
- var l = (o, t, e) => t in o ? f(o, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : o[t] = e, a = (o, t) => {
6
- for (var e in t || (t = {}))
7
- M.call(t, e) && l(o, e, t[e]);
8
- if (c)
9
- for (var e of c(t))
10
- W.call(t, e) && l(o, e, t[e]);
11
- return o;
12
- }, d = (o, t) => b(o, m(t));
13
- var s = (o, t, e) => (l(o, typeof t != "symbol" ? t + "" : t, e), e);
14
- import { VideoMeshController as p } from "./VideoMeshController.js";
5
+ var p = (e, i, r) => i in e ? g(e, i, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[i] = r, l = (e, i) => {
6
+ for (var r in i || (i = {}))
7
+ M.call(i, r) && p(e, r, i[r]);
8
+ if (d)
9
+ for (var r of d(i))
10
+ W.call(i, r) && p(e, r, i[r]);
11
+ return e;
12
+ }, m = (e, i) => f(e, b(i));
13
+ var s = (e, i, r) => (p(e, typeof i != "symbol" ? i + "" : i, r), r);
14
+ import { VideoMeshController as h } from "./VideoMeshController.js";
15
15
  import { Controller as _ } from "../base/BasePlugin.js";
16
16
  import "./utils/shader.js";
17
17
  import "three";
18
18
  import "hammerjs";
19
19
  import "three/examples/jsm/renderers/CSS3DRenderer";
20
20
  import "@realsee/five/line";
21
+ import "../Sculpt/utils/Modules/Global.js";
22
+ import "../Sculpt/utils/Modules/Cursor.js";
23
+ import "../Object3DHelperPlugin/Controller.js";
21
24
  import "../shared-utils/three/THREESphere.js";
25
+ import "../shared-utils/Object3DHelper/Helper/MoveHelper.js";
26
+ import "../shared-utils/Object3DHelper/Base/BaseHelper.js";
27
+ import "../shared-utils/Object3DHelper/utils/setObjectQuaternion.js";
28
+ import "../shared-utils/three/IObject3D.js";
29
+ import "../shared-utils/three/boundingBox.js";
30
+ import "../shared-utils/Object3DHelper/Helper/Objects/ArrowGroup.js";
31
+ import "../shared-utils/Object3DHelper/utils/direction.js";
32
+ import "../shared-utils/Object3DHelper/Constants/color.js";
33
+ import "../shared-utils/Object3DHelper/utils/calculateScaleByCamera.js";
34
+ import "../CSS3DRenderPlugin/utils/three/CSS3DRender.js";
35
+ import "../shared-utils/positionToVector3.js";
36
+ import "../CSS3DRenderPlugin/utils/three/CSS3DRenderer.js";
37
+ import "../CSS3DRenderPlugin/utils/three/THREEJS_CSS3DRenderer.js";
38
+ import "../CSS3DRenderPlugin/utils/createResizeObserver.js";
39
+ import "../CSS3DRenderPlugin/utils/even.js";
40
+ import "../shared-utils/Subscribe.js";
41
+ import "../CSS3DRenderPlugin/utils/three/CSS3DObject.js";
42
+ import "../CSS3DRenderPlugin/utils/three/OpacityMesh.js";
43
+ import "../shared-utils/three/centerPoint.js";
44
+ import "../shared-utils/three/getObjectVisible.js";
22
45
  import "animejs";
23
- import "../shared-utils/animationFrame/index.js";
46
+ import "../shared-utils/isNil.js";
24
47
  import "../vendor/@tweenjs/tween/dist/tween.esm.js.js";
25
- import "./utils/index.js";
26
- import "../shared-utils/Subscribe.js";
27
48
  import "../shared-utils/Utils/FiveUtil.js";
28
49
  import "../shared-utils/Utils/BaseUtil.js";
29
50
  import "../shared-utils/Utils/WorkUtil.js";
30
51
  import "../shared-utils/five/transformPosition.js";
31
52
  import "../shared-utils/five/getFiveModel.js";
32
53
  import "../shared-utils/url/absoluteUrl.js";
33
- class F extends _ {
34
- constructor(e) {
35
- super(e);
54
+ import "../CSS3DRenderPlugin/utils/three/CSS3DScene.js";
55
+ import "../CSS3DRenderPlugin/utils/getAllCSS3DObject.js";
56
+ import "../shared-utils/util.js";
57
+ import "../CSS3DRenderPlugin/utils/three/CSS3DGroup.js";
58
+ import "../shared-utils/Object3DHelper/Helper/RotateHelper.js";
59
+ import "../shared-utils/Object3DHelper/Helper/HTML/tipsDom.js";
60
+ import "../shared-utils/Object3DHelper/Helper/HTML/utils/createElement.js";
61
+ import "../shared-utils/Object3DHelper/Helper/CSS3DScaleHelper.js";
62
+ import "../shared-utils/Object3DHelper/Helper/HTML/rectangleScaleDom.js";
63
+ import "../shared-utils/Object3DHelper/Helper/BoundingBoxHelper.js";
64
+ import "../shared-utils/Object3DHelper/Controller/MoveController.js";
65
+ import "../shared-utils/Object3DHelper/Base/BaseController.js";
66
+ import "../shared-utils/threex/domevents/index.js";
67
+ import "../shared-utils/Object3DHelper/utils/getMouseRaycaster.js";
68
+ import "../shared-utils/Object3DHelper/utils/calculateThreeMouse.js";
69
+ import "../Sculpt/utils/three/rayOnLine.js";
70
+ import "../Object3DHelperPlugin/FiveControllerWrapper.js";
71
+ import "../shared-utils/Object3DHelper/index.js";
72
+ import "../shared-utils/Object3DHelper/Controller/RotateController.js";
73
+ import "../shared-utils/math/rad2Deg.js";
74
+ import "../shared-utils/math/deg2Rad.js";
75
+ import "../shared-utils/Object3DHelper/Controller/CSS3DScaleController.js";
76
+ import "../shared-utils/Object3DHelper/Controller/RectangleScaleController.js";
77
+ import "../shared-utils/Object3DHelper/utils/vectorIsEqual.js";
78
+ import "../CSS3DRenderPlugin/utils/generateBehindFiveElement.js";
79
+ import "../shared-utils/Object3DHelper/Controller/BoundingBoxController.js";
80
+ import "../shared-utils/Object3DHelper/Helper/ScaleHelper.js";
81
+ import "../shared-utils/Object3DHelper/Controller/ScaleController.js";
82
+ import "../shared-utils/five/fiveModelLoad.js";
83
+ import "../shared-utils/five/FiveDomEvents.js";
84
+ import "../shared-utils/five/calculateThreeMouse.js";
85
+ import "../shared-utils/three/THREERaycaster.js";
86
+ import "../shared-utils/three/PointSelector/index.js";
87
+ import "../shared-utils/three/PointSelector/utils/PointSelectorHelper.js";
88
+ import "../shared-utils/three/Magnifier.js";
89
+ import "../shared-utils/three/PointSelector/utils/PointHelper.js";
90
+ import "../shared-utils/three/Assets/index.js";
91
+ import "../shared-utils/three/PointSelector/utils/html.js";
92
+ import "../shared-utils/five/initialCSS3DRender.js";
93
+ import "../shared-utils/three/PointSelector/utils/PointHelper2.js";
94
+ import "../Sculpt/Meshes/Line.js";
95
+ import "../Sculpt/typings/style.js";
96
+ import "../shared-utils/five/FiveLine.js";
97
+ import "../shared-utils/tag.js";
98
+ import "../shared-utils/five/vector3ToScreen.js";
99
+ import "../CSS3DRenderPlugin/utils/three/CSS3DSprite.js";
100
+ import "../shared-utils/isTouchDevice.js";
101
+ import "../shared-utils/five/getPosition.js";
102
+ import "../shared-utils/five/getRaycasterByNdcPosition.js";
103
+ import "../shared-utils/animationFrame/index.js";
104
+ import "./utils/index.js";
105
+ class nt extends _ {
106
+ constructor(r) {
107
+ super(r);
36
108
  s(this, "controllerMap", /* @__PURE__ */ new Map());
37
109
  s(this, "data");
38
110
  s(this, "enabled", !0);
@@ -49,58 +121,58 @@ class F extends _ {
49
121
  return this._disposed;
50
122
  }
51
123
  /** 加载点位视频数据,加载数据并不代表会加载点位视频。 */
52
- load(e, r) {
53
- var i;
124
+ load(r, t) {
125
+ var o;
54
126
  if (this.disposed)
55
127
  return this.logWarning("插件已被销毁");
56
- typeof ((i = r == null ? void 0 : r.initialState) == null ? void 0 : i.enabled) != "undefined" && r.initialState.enabled !== this.enabled && (r.initialState.enabled ? this.enable() : this.disable()), e.list.forEach((n) => {
57
- const u = n.pano_index, g = n.render_id;
58
- n.video_list.forEach((h) => {
128
+ typeof ((o = t == null ? void 0 : t.initialState) == null ? void 0 : o.enabled) != "undefined" && t.initialState.enabled !== this.enabled && (t.initialState.enabled ? this.enable() : this.disable()), r.list.forEach((n) => {
129
+ const c = n.pano_index, u = n.render_id;
130
+ n.video_list.forEach((a) => {
59
131
  this.controllerMap.set(
60
- h.render_id,
61
- new p(this.five, d(a({}, h), {
62
- panoIndex: u,
63
- renderID: g,
132
+ a.render_id,
133
+ new h(this.five, m(l({}, a), {
134
+ panoIndex: c,
135
+ renderID: u,
64
136
  hooks: this.hooks,
65
137
  initialState: { enabled: this.enabled }
66
138
  }))
67
139
  );
68
140
  });
69
- }), this.data = e, this.hooks.emit("dataLoaded", e);
141
+ }), this.data = r, this.hooks.emit("dataLoaded", r);
70
142
  }
71
143
  /** 开启插件功能。 */
72
- enable(e) {
73
- var i;
144
+ enable(r) {
145
+ var o;
74
146
  if (this.disposed)
75
147
  return this.logWarning("插件已被销毁");
76
148
  if (this.enabled)
77
149
  return;
78
150
  this.enabled = !0, Array.from(this.controllerMap.values()).forEach((n) => n.enable());
79
- const r = (i = e == null ? void 0 : e.userAction) != null ? i : !0;
80
- this.hooks.emit("enable", { userAction: r });
151
+ const t = (o = r == null ? void 0 : r.userAction) != null ? o : !0;
152
+ this.hooks.emit("enable", { userAction: t });
81
153
  }
82
154
  /** 禁用插件功能。 */
83
- disable(e) {
84
- var i;
155
+ disable(r) {
156
+ var o;
85
157
  if (this.disposed)
86
158
  return this.logWarning("插件已被销毁");
87
159
  if (!this.enabled)
88
160
  return;
89
161
  this.enabled = !1, Array.from(this.controllerMap.values()).forEach((n) => n.disable());
90
- const r = (i = e == null ? void 0 : e.userAction) != null ? i : !0;
91
- this.hooks.emit("disable", { userAction: r });
162
+ const t = (o = r == null ? void 0 : r.userAction) != null ? o : !0;
163
+ this.hooks.emit("disable", { userAction: t });
92
164
  }
93
165
  /** 看向某个视频。
94
166
  * - 会自动切换到全景模式。
95
167
  * - 如果遇到不能自动播放的问题,需要放到用户交互事件中调用。
96
168
  */
97
- lookAtVideoItemByRenderID(e) {
169
+ lookAtVideoItemByRenderID(r) {
98
170
  if (this.disposed)
99
171
  return this.logWarning("插件已被销毁");
100
- const r = this.controllerMap.get(e);
101
- if (!r)
102
- return this.logWarning(`ID 为 ${e} 的点位视频不存在`);
103
- r.lookAtVideo();
172
+ const t = this.controllerMap.get(r);
173
+ if (!t)
174
+ return this.logWarning(`ID 为 ${r} 的点位视频不存在`);
175
+ t.lookAtVideo();
104
176
  }
105
177
  /**
106
178
  * 取消静音。
@@ -118,26 +190,26 @@ class F extends _ {
118
190
  * }}
119
191
  * ```
120
192
  */
121
- unmuteByRenderID(e) {
193
+ unmuteByRenderID(r) {
122
194
  if (this.disposed)
123
195
  return this.logWarning("插件已被销毁");
124
- const r = this.controllerMap.get(e);
125
- if (!r)
126
- return this.logWarning(`ID 为 ${e} 的点位视频不存在`);
127
- r.unmute();
196
+ const t = this.controllerMap.get(r);
197
+ if (!t)
198
+ return this.logWarning(`ID 为 ${r} 的点位视频不存在`);
199
+ t.unmute();
128
200
  }
129
201
  /** 为一个点位添加视频(可以是多条)。 */
130
- add(e, r) {
202
+ add(r, t) {
131
203
  if (this.disposed)
132
204
  return this.logWarning("插件已被销毁");
133
- r.forEach((i) => {
134
- if (this.controllerMap.get(i.render_id))
135
- return this.logWarning(`ID 为 ${i.render_id} 的点位视频已存在`);
136
- const n = i.render_id;
205
+ t.forEach((o) => {
206
+ if (this.controllerMap.get(o.render_id))
207
+ return this.logWarning(`ID 为 ${o.render_id} 的点位视频已存在`);
208
+ const n = o.render_id;
137
209
  this.controllerMap.set(
138
- i.render_id,
139
- new p(this.five, d(a({}, i), {
140
- panoIndex: e,
210
+ o.render_id,
211
+ new h(this.five, m(l({}, o), {
212
+ panoIndex: r,
141
213
  renderID: n,
142
214
  hooks: this.hooks,
143
215
  initialState: { enabled: this.enabled }
@@ -146,32 +218,32 @@ class F extends _ {
146
218
  });
147
219
  }
148
220
  /** 根据 VideoItem render_id 删除某个视频。 */
149
- removeByRenderID(e) {
221
+ removeByRenderID(r) {
150
222
  if (this.disposed)
151
223
  return this.logWarning("插件已被销毁");
152
- const r = this.controllerMap.get(e);
153
- if (!r)
154
- return this.logWarning(`ID 为 ${e} 的点位视频不存在`);
155
- r.dispose(), this.controllerMap.delete(e);
224
+ const t = this.controllerMap.get(r);
225
+ if (!t)
226
+ return this.logWarning(`ID 为 ${r} 的点位视频不存在`);
227
+ t.dispose(), this.controllerMap.delete(r);
156
228
  }
157
229
  /** 清空现有数据 */
158
230
  clear() {
159
231
  if (this.disposed)
160
232
  return this.logWarning("插件已被销毁");
161
- Array.from(this.controllerMap.values()).forEach((e) => e.dispose()), this.controllerMap.clear();
233
+ Array.from(this.controllerMap.values()).forEach((r) => r.dispose()), this.controllerMap.clear();
162
234
  }
163
235
  /** 销毁插件 */
164
236
  dispose() {
165
237
  if (this.disposed)
166
238
  return this.logWarning("插件已被销毁");
167
- this._disposed = !0, Array.from(this.controllerMap.values()).forEach((e) => e.dispose()), this.controllerMap.clear();
239
+ this._disposed = !0, Array.from(this.controllerMap.values()).forEach((r) => r.dispose()), this.controllerMap.clear();
168
240
  }
169
241
  /** 控制台打印警告 */
170
242
  // TODO: 全局函数 curry 化
171
- logWarning(e) {
172
- console.warn("⛔ ==> [PanoVideoPluginController]:", e);
243
+ logWarning(r) {
244
+ console.warn("⛔ ==> [PanoVideoPluginController]:", r);
173
245
  }
174
246
  }
175
247
  export {
176
- F as PanoVideoPluginController
248
+ nt as PanoVideoPluginController
177
249
  };
@@ -1,19 +1,99 @@
1
1
  var g = Object.defineProperty;
2
- var I = (v, e, i) => e in v ? g(v, e, { enumerable: !0, configurable: !0, writable: !0, value: i }) : v[e] = i;
3
- var t = (v, e, i) => (I(v, typeof e != "symbol" ? e + "" : e, i), i);
2
+ var I = (v, i, e) => i in v ? g(v, i, { enumerable: !0, configurable: !0, writable: !0, value: e }) : v[i] = e;
3
+ var t = (v, i, e) => (I(v, typeof i != "symbol" ? i + "" : i, e), e);
4
4
  import { vertexShader as M, fragmentShader as P } from "./utils/shader.js";
5
- import { VideoTexture as F, LinearFilter as m, ShaderMaterial as y, Vector4 as x, SphereBufferGeometry as L, Mesh as V, Vector3 as l, Quaternion as b } from "three";
5
+ import { VideoTexture as F, LinearFilter as c, ShaderMaterial as y, Vector4 as x, SphereBufferGeometry as L, Mesh as V, Vector3 as m, Quaternion as b } from "three";
6
6
  import "hammerjs";
7
7
  import "three/examples/jsm/renderers/CSS3DRenderer";
8
8
  import "@realsee/five/line";
9
+ import "../Sculpt/utils/Modules/Global.js";
9
10
  import "../shared-utils/three/THREESphere.js";
10
11
  import A from "animejs";
11
12
  import { requestAnimationFrameInterval as D } from "../shared-utils/animationFrame/index.js";
12
13
  import E from "./utils/index.js";
14
+ import "../Sculpt/utils/Modules/Cursor.js";
15
+ import "../Object3DHelperPlugin/Controller.js";
16
+ import "../base/BasePlugin.js";
17
+ import "../shared-utils/Subscribe.js";
18
+ import "../shared-utils/Utils/FiveUtil.js";
19
+ import "../shared-utils/Utils/BaseUtil.js";
20
+ import "../shared-utils/Utils/WorkUtil.js";
21
+ import "../shared-utils/five/transformPosition.js";
22
+ import "../shared-utils/five/getFiveModel.js";
23
+ import "../shared-utils/url/absoluteUrl.js";
13
24
  import "../vendor/@tweenjs/tween/dist/tween.esm.js.js";
14
- class z {
25
+ import "../shared-utils/Object3DHelper/Helper/MoveHelper.js";
26
+ import "../shared-utils/Object3DHelper/Base/BaseHelper.js";
27
+ import "../shared-utils/Object3DHelper/utils/setObjectQuaternion.js";
28
+ import "../shared-utils/three/IObject3D.js";
29
+ import "../shared-utils/three/boundingBox.js";
30
+ import "../shared-utils/Object3DHelper/Helper/Objects/ArrowGroup.js";
31
+ import "../shared-utils/Object3DHelper/utils/direction.js";
32
+ import "../shared-utils/Object3DHelper/Constants/color.js";
33
+ import "../shared-utils/Object3DHelper/utils/calculateScaleByCamera.js";
34
+ import "../CSS3DRenderPlugin/utils/three/CSS3DRender.js";
35
+ import "../shared-utils/positionToVector3.js";
36
+ import "../CSS3DRenderPlugin/utils/three/CSS3DRenderer.js";
37
+ import "../CSS3DRenderPlugin/utils/three/THREEJS_CSS3DRenderer.js";
38
+ import "../CSS3DRenderPlugin/utils/createResizeObserver.js";
39
+ import "../CSS3DRenderPlugin/utils/even.js";
40
+ import "../CSS3DRenderPlugin/utils/three/CSS3DObject.js";
41
+ import "../CSS3DRenderPlugin/utils/three/OpacityMesh.js";
42
+ import "../shared-utils/three/centerPoint.js";
43
+ import "../shared-utils/three/getObjectVisible.js";
44
+ import "../shared-utils/isNil.js";
45
+ import "../CSS3DRenderPlugin/utils/three/CSS3DScene.js";
46
+ import "../CSS3DRenderPlugin/utils/getAllCSS3DObject.js";
47
+ import "../shared-utils/util.js";
48
+ import "../CSS3DRenderPlugin/utils/three/CSS3DGroup.js";
49
+ import "../shared-utils/Object3DHelper/Helper/RotateHelper.js";
50
+ import "../shared-utils/Object3DHelper/Helper/HTML/tipsDom.js";
51
+ import "../shared-utils/Object3DHelper/Helper/HTML/utils/createElement.js";
52
+ import "../shared-utils/Object3DHelper/Helper/CSS3DScaleHelper.js";
53
+ import "../shared-utils/Object3DHelper/Helper/HTML/rectangleScaleDom.js";
54
+ import "../shared-utils/Object3DHelper/Helper/BoundingBoxHelper.js";
55
+ import "../shared-utils/Object3DHelper/Controller/MoveController.js";
56
+ import "../shared-utils/Object3DHelper/Base/BaseController.js";
57
+ import "../shared-utils/threex/domevents/index.js";
58
+ import "../shared-utils/Object3DHelper/utils/getMouseRaycaster.js";
59
+ import "../shared-utils/Object3DHelper/utils/calculateThreeMouse.js";
60
+ import "../Sculpt/utils/three/rayOnLine.js";
61
+ import "../Object3DHelperPlugin/FiveControllerWrapper.js";
62
+ import "../shared-utils/Object3DHelper/index.js";
63
+ import "../shared-utils/Object3DHelper/Controller/RotateController.js";
64
+ import "../shared-utils/math/rad2Deg.js";
65
+ import "../shared-utils/math/deg2Rad.js";
66
+ import "../shared-utils/Object3DHelper/Controller/CSS3DScaleController.js";
67
+ import "../shared-utils/Object3DHelper/Controller/RectangleScaleController.js";
68
+ import "../shared-utils/Object3DHelper/utils/vectorIsEqual.js";
69
+ import "../CSS3DRenderPlugin/utils/generateBehindFiveElement.js";
70
+ import "../shared-utils/Object3DHelper/Controller/BoundingBoxController.js";
71
+ import "../shared-utils/Object3DHelper/Helper/ScaleHelper.js";
72
+ import "../shared-utils/Object3DHelper/Controller/ScaleController.js";
73
+ import "../shared-utils/five/fiveModelLoad.js";
74
+ import "../shared-utils/five/FiveDomEvents.js";
75
+ import "../shared-utils/five/calculateThreeMouse.js";
76
+ import "../shared-utils/three/THREERaycaster.js";
77
+ import "../shared-utils/three/PointSelector/index.js";
78
+ import "../shared-utils/three/PointSelector/utils/PointSelectorHelper.js";
79
+ import "../shared-utils/three/Magnifier.js";
80
+ import "../shared-utils/three/PointSelector/utils/PointHelper.js";
81
+ import "../shared-utils/three/Assets/index.js";
82
+ import "../shared-utils/three/PointSelector/utils/html.js";
83
+ import "../shared-utils/five/initialCSS3DRender.js";
84
+ import "../shared-utils/three/PointSelector/utils/PointHelper2.js";
85
+ import "../Sculpt/Meshes/Line.js";
86
+ import "../Sculpt/typings/style.js";
87
+ import "../shared-utils/five/FiveLine.js";
88
+ import "../shared-utils/tag.js";
89
+ import "../shared-utils/five/vector3ToScreen.js";
90
+ import "../CSS3DRenderPlugin/utils/three/CSS3DSprite.js";
91
+ import "../shared-utils/isTouchDevice.js";
92
+ import "../shared-utils/five/getPosition.js";
93
+ import "../shared-utils/five/getRaycasterByNdcPosition.js";
94
+ class ue {
15
95
  /** 初始化视频、模型以及相关事件监听。 */
16
- constructor(e, i) {
96
+ constructor(i, e) {
17
97
  t(this, "video");
18
98
  t(this, "_id");
19
99
  /** 视频资源地址 */
@@ -49,75 +129,75 @@ class z {
49
129
  this.video.muted = !1;
50
130
  });
51
131
  /** 把 uv 值转换成位置 */
52
- t(this, "uv2Position", (e, i) => {
53
- var p;
54
- const n = Math.PI, a = Math.PI * 2, d = e, s = 1 - i, r = new l(
55
- -1 * Math.cos(a * d) * Math.sin(n * s),
56
- 1 * Math.cos(n * s),
57
- 1 * Math.sin(a * d) * Math.sin(n * s)
132
+ t(this, "uv2Position", (i, e) => {
133
+ var f;
134
+ const o = Math.PI, a = Math.PI * 2, d = i, s = 1 - e, r = new m(
135
+ -1 * Math.cos(a * d) * Math.sin(o * s),
136
+ 1 * Math.cos(o * s),
137
+ 1 * Math.sin(a * d) * Math.sin(o * s)
58
138
  );
59
139
  r.setX(-r.x);
60
- const h = (p = this.five.work) == null ? void 0 : p.observers[this.panoIndex];
140
+ const h = (f = this.five.work) == null ? void 0 : f.observers[this.panoIndex];
61
141
  if (!h)
62
142
  return this.logWarning(`点位 ${this.panoIndex} 不存在,请检查 Five 数据是否正常。`);
63
- const f = h.position.clone(), c = h.quaternion.clone(), u = r.clone();
64
- return u.applyAxisAngle(new l(0, 1, 0), Math.PI / 2), u.applyQuaternion(c), u.add(f), u;
143
+ const u = h.position.clone(), l = h.quaternion.clone(), p = r.clone();
144
+ return p.applyAxisAngle(new m(0, 1, 0), Math.PI / 2), p.applyQuaternion(l), p.add(u), p;
65
145
  });
66
146
  /** Five 数据加载后需要根据点位位姿调整点位模型位置 */
67
147
  t(this, "onFiveDataLoaded", () => {
68
148
  var r;
69
- const e = (r = this.five.work) == null ? void 0 : r.observers[this.panoIndex];
70
- if (!e)
149
+ const i = (r = this.five.work) == null ? void 0 : r.observers[this.panoIndex];
150
+ if (!i)
71
151
  return this.logWarning(`点位 ${this.panoIndex} 不存在,请检查 Five 数据是否正常。`);
72
- this.observer = e;
73
- const { x: i, y: o, z: n, w: a } = e.quaternion, d = new b(i, o, n, a), s = e.position;
74
- this.videoMesh.position.fromArray([s.x, s.y, s.z]), this.videoMesh.quaternion.set(0, 0, 0, 1), this.videoMesh.rotateOnAxis(new l(0, 1, 0), Math.PI / 2), this.videoMesh.applyQuaternion(d);
152
+ this.observer = i;
153
+ const { x: e, y: n, z: o, w: a } = i.quaternion, d = new b(e, n, o, a), s = i.position;
154
+ this.videoMesh.position.fromArray([s.x, s.y, s.z]), this.videoMesh.quaternion.set(0, 0, 0, 1), this.videoMesh.rotateOnAxis(new m(0, 1, 0), Math.PI / 2), this.videoMesh.applyQuaternion(d);
75
155
  });
76
156
  /** 兼容视频播放 */
77
- t(this, "onFiveWantsMoveToPano", (e) => {
78
- e === this.panoIndex && (this.hasVideoEverPlayed || this.video.play().catch(() => {
157
+ t(this, "onFiveWantsMoveToPano", (i) => {
158
+ i === this.panoIndex && (this.hasVideoEverPlayed || this.video.play().catch(() => {
79
159
  }));
80
160
  });
81
161
  /** 走到某个点位上时,挂载/卸载视频 */
82
- t(this, "onFivePanoArrived", (e) => {
162
+ t(this, "onFivePanoArrived", (i) => {
83
163
  if (this.disposed)
84
164
  return this.logWarning("实例已被销毁");
85
- this.enabled && this.panoIndex === e && this.mount();
165
+ this.enabled && this.panoIndex === i && this.mount();
86
166
  });
87
- t(this, "onFivePanoWillArrive", (e) => {
88
- if (e !== this.panoIndex)
167
+ t(this, "onFivePanoWillArrive", (i) => {
168
+ if (i !== this.panoIndex)
89
169
  return this.unmount();
90
- this.panoIndex !== e && this.unmount();
170
+ this.panoIndex !== i && this.unmount();
91
171
  });
92
172
  /** Five 模型变化 */
93
- t(this, "onFiveModeChange", (e) => {
94
- e !== "Panorama" && this.hide();
173
+ t(this, "onFiveModeChange", (i) => {
174
+ i !== "Panorama" && this.hide();
95
175
  });
96
176
  /** Five mode change 动画结束 */
97
177
  t(this, "onFiveInitAnimationEnded", () => {
98
- const e = this.five.getCurrentState();
99
- e.mode === "Panorama" && e.panoIndex === this.panoIndex && this.mount();
178
+ const i = this.five.getCurrentState();
179
+ i.mode === "Panorama" && i.panoIndex === this.panoIndex && this.mount();
100
180
  });
101
181
  /** Five Canvas 点击 */
102
- t(this, "onFiveWantsTapGesture", (e) => {
182
+ t(this, "onFiveWantsTapGesture", (i) => {
103
183
  if (!this.five.scene.children.includes(this.videoMesh))
104
184
  return;
105
185
  if (this.disposed)
106
186
  return this.logWarning("实例已被销毁");
107
187
  if (!this.enabled)
108
188
  return this.logWarning("实例已被禁用");
109
- const [i] = e.intersectObject(this.videoMesh);
110
- if (!i)
189
+ const [e] = i.intersectObject(this.videoMesh);
190
+ if (!e)
111
191
  return;
112
- if (this.checkIntersectionInBounding(this.origin, i)) {
113
- const n = {
192
+ if (this.checkIntersectionInBounding(this.origin, e)) {
193
+ const o = {
114
194
  target: this,
115
195
  _preventDefaultReturn: !1,
116
196
  preventDefault: () => {
117
- n._preventDefaultReturn = !0;
197
+ o._preventDefaultReturn = !0;
118
198
  }
119
199
  };
120
- return this.hooks.emit("click", n), n._preventDefaultReturn === !1 && (this.video.muted = !this.video.muted), !1;
200
+ return this.hooks.emit("click", o), o._preventDefaultReturn === !1 && (this.video.muted = !this.video.muted), !1;
121
201
  }
122
202
  });
123
203
  /** video canplaythrough 事件触发 */
@@ -146,16 +226,16 @@ class z {
146
226
  if (this.enabled && this.panoIndex === this.five.getCurrentState().panoIndex && this.five.getCurrentState().mode === "Panorama" && (this.renderFiveDisposer || (this.renderFiveDisposer = D(() => {
147
227
  this.five.needsRender = !0;
148
228
  }, 30)), this.five.scene.add(this.videoMesh), this.videoMesh.material.uniforms.opacity.value === 0)) {
149
- const e = {
229
+ const i = {
150
230
  value: 0
151
231
  };
152
232
  A({
153
- targets: e,
233
+ targets: i,
154
234
  value: 1,
155
235
  duration: 300,
156
236
  easing: "linear",
157
237
  update: () => {
158
- this.videoMesh.material.uniforms.opacity.value = e.value;
238
+ this.videoMesh.material.uniforms.opacity.value = i.value;
159
239
  },
160
240
  complete: () => {
161
241
  this.videoMesh.material.uniforms.opacity.value = 1;
@@ -168,20 +248,20 @@ class z {
168
248
  });
169
249
  /** video pause 事件触发 */
170
250
  t(this, "onVideoPaused", () => {
171
- var e;
172
- (e = this.renderFiveDisposer) == null || e.call(this), this.renderFiveDisposer = void 0;
251
+ var i;
252
+ (i = this.renderFiveDisposer) == null || i.call(this), this.renderFiveDisposer = void 0;
173
253
  });
174
254
  var r, h;
175
- this.five = e, this.panoIndex = i.panoIndex, this._id = i.renderID, this.url = i.url, this.origin = i.origin.slice(), this.hooks = i.hooks, this._enabled = (h = (r = i.initialState) == null ? void 0 : r.enabled) != null ? h : !0;
176
- const o = document.createElement("video");
177
- o.crossOrigin = "anonymous", o.autoplay = !1, o.muted = !0, o.loop = !0, o.playsInline = !0, this.video = o;
178
- const n = new F(this.video);
179
- n.minFilter = m, n.magFilter = m;
255
+ this.five = i, this.panoIndex = e.panoIndex, this._id = e.renderID, this.url = e.url, this.origin = e.origin.slice(), this.hooks = e.hooks, this._enabled = (h = (r = e.initialState) == null ? void 0 : r.enabled) != null ? h : !0;
256
+ const n = document.createElement("video");
257
+ n.crossOrigin = "anonymous", n.autoplay = !1, n.muted = !0, n.loop = !0, n.playsInline = !0, this.video = n;
258
+ const o = new F(this.video);
259
+ o.minFilter = c, o.magFilter = c;
180
260
  const a = new y({
181
261
  vertexShader: M,
182
262
  fragmentShader: P,
183
263
  uniforms: {
184
- map: { value: n },
264
+ map: { value: o },
185
265
  size: {
186
266
  value: new x(this.origin[0], 1 - this.origin[1] - this.origin[3], this.origin[2], this.origin[3])
187
267
  },
@@ -223,21 +303,21 @@ class z {
223
303
  lookAtVideo() {
224
304
  if (!this.observer)
225
305
  return;
226
- const e = this.getUVCenter();
227
- if (!e)
228
- return;
229
- const i = this.uv2Position(e[0], e[1]);
306
+ const i = this.getUVCenter();
230
307
  if (!i)
231
308
  return;
232
- const o = new l().subVectors(i, this.observer.position).normalize(), { longitude: n, latitude: a } = E(o);
233
- this.five.setState({ panoIndex: this.panoIndex, longitude: n, latitude: a }), this.onFiveWantsMoveToPano(this.panoIndex);
309
+ const e = this.uv2Position(i[0], i[1]);
310
+ if (!e)
311
+ return;
312
+ const n = new m().subVectors(e, this.observer.position).normalize(), { longitude: o, latitude: a } = E(n);
313
+ this.five.setState({ panoIndex: this.panoIndex, longitude: o, latitude: a }), this.onFiveWantsMoveToPano(this.panoIndex);
234
314
  }
235
315
  /** 获取视频中心点的 uv */
236
316
  getUVCenter() {
237
317
  if (!this.origin)
238
318
  return;
239
- const e = this.origin[0] + this.origin[2] / 2, i = this.origin[1] + this.origin[3] / 2;
240
- return [e, i];
319
+ const i = this.origin[0] + this.origin[2] / 2, e = this.origin[1] + this.origin[3] / 2;
320
+ return [i, e];
241
321
  }
242
322
  /** 添加时间监听 */
243
323
  addEventListeners() {
@@ -249,8 +329,8 @@ class z {
249
329
  }
250
330
  /** 如果满足 mount 条件,mount */
251
331
  mountIfNeeded() {
252
- const e = this.five.getCurrentState();
253
- e.mode === "Panorama" && e.panoIndex === this.panoIndex && this.enabled && this.mount();
332
+ const i = this.five.getCurrentState();
333
+ i.mode === "Panorama" && i.panoIndex === this.panoIndex && this.enabled && this.mount();
254
334
  }
255
335
  /** 挂载:加载视频资源;添加模型。 */
256
336
  mount() {
@@ -258,10 +338,10 @@ class z {
258
338
  return this.logWarning("插件已经销毁,无法挂载。");
259
339
  if (this.url === "")
260
340
  return this.logWarning("视频资源不存在。");
261
- this.video.src !== this.url && (this.video.src = this.url), this.video.paused && this.video.play().catch((e) => {
262
- this.logWarning(e instanceof Error ? e.message : "视频播放失败。"), this.five.once("gesture", () => {
263
- this.video.play().catch((i) => {
264
- this.logWarning(i instanceof Error ? i.message : "自动播放视频失败。");
341
+ this.video.src !== this.url && (this.video.src = this.url), this.video.paused && this.video.play().catch((i) => {
342
+ this.logWarning(i instanceof Error ? i.message : "视频播放失败。"), this.five.once("gesture", () => {
343
+ this.video.play().catch((e) => {
344
+ this.logWarning(e instanceof Error ? e.message : "自动播放视频失败。");
265
345
  });
266
346
  });
267
347
  });
@@ -275,17 +355,17 @@ class z {
275
355
  this.video.pause(), this.videoMesh.material.uniforms.opacity.value = 0, this.five.scene.remove(this.videoMesh);
276
356
  }
277
357
  /** 控制台打印警告 */
278
- logWarning(e) {
279
- console.warn("⛔ ==> [VideoMeshController]:", e);
358
+ logWarning(i) {
359
+ console.warn("⛔ ==> [VideoMeshController]:", i);
280
360
  }
281
361
  /** 检测射线与模型的交点是不是在视频的范围内 */
282
- checkIntersectionInBounding(e, i) {
283
- if (!i.uv)
362
+ checkIntersectionInBounding(i, e) {
363
+ if (!e.uv)
284
364
  return !1;
285
- const [o, n] = i.uv.toArray(), [a, d, s, r] = e, h = 1 - d - r, f = a + s, c = h + r;
286
- return o >= a && o <= f && n >= h && n <= c;
365
+ const [n, o] = e.uv.toArray(), [a, d, s, r] = i, h = 1 - d - r, u = a + s, l = h + r;
366
+ return n >= a && n <= u && o >= h && o <= l;
287
367
  }
288
368
  }
289
369
  export {
290
- z as VideoMeshController
370
+ ue as VideoMeshController
291
371
  };