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