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