@realsee/dnalogel 3.40.4 → 3.41.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.
- package/dist/GuideLinePlugin/typing.d.ts +1 -0
- package/dist/GuideLinePlugin/utils/createLineGeometry.d.ts +5 -0
- package/dist/index.cjs.js +57 -53
- package/dist/index.js +4170 -4067
- package/dist/index.umd.js +50 -46
- package/dist/shared-utils/math/intersecting.d.ts +25 -0
- package/libs/CruisePlugin/Move.js +3 -2
- package/libs/CruisePlugin/Work.js +3 -2
- package/libs/CruisePlugin/index.js +7 -6
- package/libs/GuideLinePlugin/Controller.js +5 -4
- package/libs/GuideLinePlugin/GuideLineItem.js +3 -2
- package/libs/GuideLinePlugin/GuideLineModeItem/index.js +74 -57
- package/libs/GuideLinePlugin/GuideLineModeItem.js +3 -2
- package/libs/GuideLinePlugin/index.js +7 -6
- package/libs/GuideLinePlugin/typing.d.ts +1 -0
- package/libs/GuideLinePlugin/utils/createLineGeometry.d.ts +5 -0
- package/libs/GuideLinePlugin/utils/createLineGeometry.js +123 -57
- package/libs/base/BasePlugin.js +1 -1
- package/libs/index.js +126 -125
- package/libs/shared-utils/logger.js +1 -1
- package/libs/shared-utils/math/intersecting.d.ts +25 -0
- package/libs/shared-utils/math/intersecting.js +25 -0
- package/package.json +2 -2
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @description 两条二维线段是否相交,不考虑端点重合的情况
|
|
3
|
+
*/
|
|
4
|
+
export declare function lineIsIntersecting(line1: {
|
|
5
|
+
x: number;
|
|
6
|
+
y: number;
|
|
7
|
+
}[], line2: {
|
|
8
|
+
x: number;
|
|
9
|
+
y: number;
|
|
10
|
+
}[]): boolean;
|
|
11
|
+
/**
|
|
12
|
+
* @description 两条二维折线段的交点,不考虑端点重合的情况
|
|
13
|
+
*/
|
|
14
|
+
export declare function findIntersectingOfLines(line1: {
|
|
15
|
+
x: number;
|
|
16
|
+
y: number;
|
|
17
|
+
}[], line2: {
|
|
18
|
+
x: number;
|
|
19
|
+
y: number;
|
|
20
|
+
}[]): {
|
|
21
|
+
x: number;
|
|
22
|
+
y: number;
|
|
23
|
+
line1RelativeIndex: number;
|
|
24
|
+
line2RelativeIndex: number;
|
|
25
|
+
};
|
|
@@ -75,6 +75,7 @@ import "../vendor/gl-vec2/set.js";
|
|
|
75
75
|
import "../vendor/gl-vec2/normalize.js";
|
|
76
76
|
import "../vendor/gl-vec2/subtract.js";
|
|
77
77
|
import "../vendor/gl-vec2/dot.js";
|
|
78
|
+
import "../shared-utils/math/intersecting.js";
|
|
78
79
|
import "../shared-utils/five/mode.js";
|
|
79
80
|
import "../shared-utils/isNil.js";
|
|
80
81
|
import "../shared-utils/animationFrame/BetterTween.js";
|
|
@@ -206,7 +207,7 @@ import "./utils/coordinatesAngle.js";
|
|
|
206
207
|
import "./utils/coordinatesToVector.js";
|
|
207
208
|
import "./utils/safeCall.js";
|
|
208
209
|
import "../shared-utils/five/fiveLoaded.js";
|
|
209
|
-
class
|
|
210
|
+
class to extends z {
|
|
210
211
|
constructor(t, r) {
|
|
211
212
|
var h;
|
|
212
213
|
super(t, r);
|
|
@@ -314,5 +315,5 @@ class $r extends z {
|
|
|
314
315
|
}
|
|
315
316
|
}
|
|
316
317
|
export {
|
|
317
|
-
|
|
318
|
+
to as default
|
|
318
319
|
};
|
|
@@ -63,6 +63,7 @@ import "../vendor/gl-vec2/set.js";
|
|
|
63
63
|
import "../vendor/gl-vec2/normalize.js";
|
|
64
64
|
import "../vendor/gl-vec2/subtract.js";
|
|
65
65
|
import "../vendor/gl-vec2/dot.js";
|
|
66
|
+
import "../shared-utils/math/intersecting.js";
|
|
66
67
|
import "../shared-utils/five/mode.js";
|
|
67
68
|
import "../shared-utils/animationFrame/BetterTween.js";
|
|
68
69
|
import "../shared-utils/animationFrame/index.js";
|
|
@@ -206,7 +207,7 @@ import "../shared-utils/Utils/FiveUtil.js";
|
|
|
206
207
|
import "../shared-utils/formatRad.js";
|
|
207
208
|
import "./Work.js";
|
|
208
209
|
import "./utils/coordinatesToVector.js";
|
|
209
|
-
class
|
|
210
|
+
class rr extends G {
|
|
210
211
|
constructor(t, e) {
|
|
211
212
|
super(t, e);
|
|
212
213
|
k(this, "state", {
|
|
@@ -594,5 +595,5 @@ class ir extends G {
|
|
|
594
595
|
}
|
|
595
596
|
}
|
|
596
597
|
export {
|
|
597
|
-
|
|
598
|
+
rr as default
|
|
598
599
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { typing as
|
|
1
|
+
import { typing as ht } from "./typing/index.js";
|
|
2
2
|
import t from "./Work.js";
|
|
3
3
|
import i from "./Move.js";
|
|
4
4
|
import "../GuideLinePlugin/index.js";
|
|
@@ -42,6 +42,7 @@ import "../vendor/gl-vec2/set.js";
|
|
|
42
42
|
import "../vendor/gl-vec2/normalize.js";
|
|
43
43
|
import "../vendor/gl-vec2/subtract.js";
|
|
44
44
|
import "../vendor/gl-vec2/dot.js";
|
|
45
|
+
import "../shared-utils/math/intersecting.js";
|
|
45
46
|
import "../shared-utils/five/mode.js";
|
|
46
47
|
import "../shared-utils/isNil.js";
|
|
47
48
|
import "../shared-utils/animationFrame/BetterTween.js";
|
|
@@ -178,13 +179,13 @@ import "../shared-utils/formatRad.js";
|
|
|
178
179
|
import "./BaseController.js";
|
|
179
180
|
import "../shared-utils/Utils/FiveUtil.js";
|
|
180
181
|
import "./utils/getFiveStateOnCurve.js";
|
|
181
|
-
const
|
|
182
|
+
const kt = (o, r) => new t(o, r), Tt = (o, r) => new i(o, r);
|
|
182
183
|
export {
|
|
183
|
-
|
|
184
|
+
kt as CruisePlugin,
|
|
184
185
|
t as CruisePluginController,
|
|
185
|
-
|
|
186
|
+
ht as CruisePluginTypes,
|
|
186
187
|
i as MoveController,
|
|
187
|
-
|
|
188
|
+
Tt as MovePlugin,
|
|
188
189
|
t as WalkController,
|
|
189
|
-
|
|
190
|
+
kt as default
|
|
190
191
|
};
|
|
@@ -56,6 +56,7 @@ import "../vendor/gl-vec2/set.js";
|
|
|
56
56
|
import "../vendor/gl-vec2/normalize.js";
|
|
57
57
|
import "../vendor/gl-vec2/subtract.js";
|
|
58
58
|
import "../vendor/gl-vec2/dot.js";
|
|
59
|
+
import "../shared-utils/math/intersecting.js";
|
|
59
60
|
import "../shared-utils/five/mode.js";
|
|
60
61
|
import "../shared-utils/isNil.js";
|
|
61
62
|
import "../shared-utils/animationFrame/BetterTween.js";
|
|
@@ -205,8 +206,8 @@ import "../CruisePlugin/utils/coordinatesAngle.js";
|
|
|
205
206
|
import "../CruisePlugin/utils/coordinatesToVector.js";
|
|
206
207
|
import "../CruisePlugin/utils/safeCall.js";
|
|
207
208
|
import "../shared-utils/five/fiveLoaded.js";
|
|
208
|
-
const b = "GuideLinePlugin", g = `${b}`,
|
|
209
|
-
class
|
|
209
|
+
const b = "GuideLinePlugin", g = `${b}`, me = (s) => `${g}--${s}`;
|
|
210
|
+
class pe extends N {
|
|
210
211
|
constructor(t, i) {
|
|
211
212
|
super(t, i);
|
|
212
213
|
h(this, "name", b);
|
|
@@ -348,6 +349,6 @@ class me extends N {
|
|
|
348
349
|
}
|
|
349
350
|
}
|
|
350
351
|
export {
|
|
351
|
-
|
|
352
|
-
|
|
352
|
+
pe as default,
|
|
353
|
+
me as pluginFlag
|
|
353
354
|
};
|
|
@@ -5,7 +5,7 @@ import "../shared-utils/five/changeMode.js";
|
|
|
5
5
|
import "../CruisePlugin/Move.js";
|
|
6
6
|
import "../CruisePlugin/Work.js";
|
|
7
7
|
import "../shared-utils/Subscribe.js";
|
|
8
|
-
import { GuideLineItem as
|
|
8
|
+
import { GuideLineItem as jo } from "./GuideLineItem/index.js";
|
|
9
9
|
import "three";
|
|
10
10
|
import "./utils/createLineGeometry.js";
|
|
11
11
|
import "../vendor/polyline-normals/index.js";
|
|
@@ -15,6 +15,7 @@ import "../vendor/gl-vec2/set.js";
|
|
|
15
15
|
import "../vendor/gl-vec2/normalize.js";
|
|
16
16
|
import "../vendor/gl-vec2/subtract.js";
|
|
17
17
|
import "../vendor/gl-vec2/dot.js";
|
|
18
|
+
import "../shared-utils/math/intersecting.js";
|
|
18
19
|
import "../shared-utils/five/mode.js";
|
|
19
20
|
import "hammerjs";
|
|
20
21
|
import "../vendor/@tweenjs/tween/dist/tween.esm.js.js";
|
|
@@ -178,5 +179,5 @@ import "../CruisePlugin/utils/coordinatesToVector.js";
|
|
|
178
179
|
import "../CruisePlugin/utils/safeCall.js";
|
|
179
180
|
import "../shared-utils/five/fiveLoaded.js";
|
|
180
181
|
export {
|
|
181
|
-
|
|
182
|
+
jo as GuideLineItem
|
|
182
183
|
};
|
|
@@ -1,39 +1,42 @@
|
|
|
1
|
-
var x = Object.defineProperty,
|
|
2
|
-
var
|
|
1
|
+
var x = Object.defineProperty, M = Object.defineProperties;
|
|
2
|
+
var w = Object.getOwnPropertyDescriptors;
|
|
3
3
|
var D = Object.getOwnPropertySymbols;
|
|
4
4
|
var P = Object.prototype.hasOwnProperty, U = Object.prototype.propertyIsEnumerable;
|
|
5
|
-
var y = (
|
|
5
|
+
var y = (m, e, t) => e in m ? x(m, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : m[e] = t, c = (m, e) => {
|
|
6
6
|
for (var t in e || (e = {}))
|
|
7
|
-
P.call(e, t) && y(
|
|
7
|
+
P.call(e, t) && y(m, t, e[t]);
|
|
8
8
|
if (D)
|
|
9
9
|
for (var t of D(e))
|
|
10
|
-
U.call(e, t) && y(
|
|
11
|
-
return
|
|
12
|
-
},
|
|
13
|
-
var i = (
|
|
10
|
+
U.call(e, t) && y(m, t, e[t]);
|
|
11
|
+
return m;
|
|
12
|
+
}, T = (m, e) => M(m, w(e));
|
|
13
|
+
var i = (m, e, t) => (y(m, typeof e != "symbol" ? e + "" : e, t), t);
|
|
14
14
|
import * as h from "three";
|
|
15
15
|
import { logWarning as F, logError as L } from "../../shared-utils/log.js";
|
|
16
16
|
import { createLineGeometry as S } from "../utils/createLineGeometry.js";
|
|
17
|
-
import { isPanoramaLike as
|
|
17
|
+
import { isPanoramaLike as A, isModelLike as O } from "../../shared-utils/five/mode.js";
|
|
18
18
|
import "hammerjs";
|
|
19
19
|
import "../../vendor/@tweenjs/tween/dist/tween.esm.js.js";
|
|
20
20
|
import "../../CSS3DRenderPlugin/utils/three/CSS3DRender.js";
|
|
21
21
|
import "../../CSS3DRenderPlugin/utils/generateBehindFiveElement.js";
|
|
22
22
|
import "animejs";
|
|
23
23
|
import { notNil as V } from "../../shared-utils/isNil.js";
|
|
24
|
-
import { BetterTween as
|
|
24
|
+
import { BetterTween as _, tweenProgress as E } from "../../shared-utils/animationFrame/BetterTween.js";
|
|
25
25
|
import { loadTexture as G } from "../../shared-utils/three/loadTexture.js";
|
|
26
26
|
import k from "../../PanoTagPlugin/controller/index.js";
|
|
27
|
-
import
|
|
28
|
-
import { filterAdjacentDistinct as
|
|
29
|
-
import { objectAssignDeepExports as
|
|
27
|
+
import I from "../Components/Tag.js";
|
|
28
|
+
import { filterAdjacentDistinct as B } from "../utils/index.js";
|
|
29
|
+
import { objectAssignDeepExports as N } from "../../vendor/object-assign-deep/objectAssignDeep.js";
|
|
30
30
|
const R = (
|
|
31
31
|
/* glsl */
|
|
32
32
|
`
|
|
33
33
|
varying vec2 vUv;
|
|
34
|
+
varying float ignoreAnimationMap;
|
|
35
|
+
attribute float animationWillError;
|
|
34
36
|
|
|
35
37
|
void main() {
|
|
36
38
|
vUv = uv;
|
|
39
|
+
ignoreAnimationMap = animationWillError;
|
|
37
40
|
gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);
|
|
38
41
|
}
|
|
39
42
|
`
|
|
@@ -76,12 +79,17 @@ const R = (
|
|
|
76
79
|
uniform float flicker;
|
|
77
80
|
// 纹理坐标
|
|
78
81
|
varying vec2 vUv;
|
|
82
|
+
varying float ignoreAnimationMap;
|
|
79
83
|
|
|
80
84
|
// 获取纹理颜色
|
|
81
85
|
vec4 getImage() {
|
|
82
86
|
vec2 uv = vUv;
|
|
83
87
|
uv.y = uv.y - vOffset;
|
|
84
88
|
|
|
89
|
+
if (ignoreAnimationMap == 1.0) {
|
|
90
|
+
return vec4(0.0, 0.0, 0.0, 0.0);
|
|
91
|
+
}
|
|
92
|
+
|
|
85
93
|
// 原始贴图颜色
|
|
86
94
|
vec4 image = texture2D(map, uv);
|
|
87
95
|
// 如果使用颜色
|
|
@@ -142,10 +150,6 @@ const R = (
|
|
|
142
150
|
if (v < includeMinV || v > includeMaxV) {
|
|
143
151
|
gl_FragColor = vec4(0.0, 0.0, 0.0, 0.0);
|
|
144
152
|
return;
|
|
145
|
-
} else {
|
|
146
|
-
// debug
|
|
147
|
-
// gl_FragColor = vec4(255.0, 255.0, 255.0, 0.6);
|
|
148
|
-
// return;
|
|
149
153
|
}
|
|
150
154
|
}
|
|
151
155
|
if (excludeMinV != -1.0 && excludeMaxV != -1.0) {
|
|
@@ -208,7 +212,7 @@ class Y {
|
|
|
208
212
|
i(this, "plugin");
|
|
209
213
|
i(this, "textureHasLoaded", !1);
|
|
210
214
|
i(this, "disposed", !1);
|
|
211
|
-
i(this, "flowAnime", new
|
|
215
|
+
i(this, "flowAnime", new _({ progress: 0 }).to({ progress: 1 }).duration(1500).repeat(1 / 0));
|
|
212
216
|
i(this, "flickerAnime", E(300).yoyo(!0).repeat(5));
|
|
213
217
|
/** 缓存 panoGroup 中每个点距离起点的长度 */
|
|
214
218
|
i(this, "cacheLengths", []);
|
|
@@ -230,18 +234,18 @@ class Y {
|
|
|
230
234
|
});
|
|
231
235
|
/** 模型状态变更 */
|
|
232
236
|
i(this, "onFiveModeChange", (e) => {
|
|
233
|
-
this.modeVisible = this.mode === "panorama" ?
|
|
237
|
+
this.modeVisible = this.mode === "panorama" ? A(e) : O(e), this.updateVisible();
|
|
234
238
|
});
|
|
235
239
|
/** 走点 */
|
|
236
240
|
i(this, "onFivePanoArrived", (e) => {
|
|
237
|
-
var
|
|
238
|
-
const t = this.panoMap[e];
|
|
239
|
-
if (
|
|
241
|
+
var s, o, a, n, l, d;
|
|
242
|
+
const t = (a = (o = (s = this.path) == null ? void 0 : s[0]) == null ? void 0 : o.panoIndexMap) == null ? void 0 : a[e], r = this.panoMap[t != null ? t : e];
|
|
243
|
+
if (r === void 0)
|
|
240
244
|
this.group.children.includes(this.meshWithoutDepthTest) && this.group.remove(this.meshWithoutDepthTest), this.meshWithDepthTest.material.uniforms.excludeMinV.value = -1, this.meshWithDepthTest.material.uniforms.excludeMaxV.value = -1;
|
|
241
245
|
else {
|
|
242
246
|
this.group.children.includes(this.meshWithoutDepthTest) || this.group.add(this.meshWithoutDepthTest), this.meshWithoutDepthTest.visible = !0;
|
|
243
|
-
const
|
|
244
|
-
this.meshWithDepthTest.material.uniforms.excludeMinV.value =
|
|
247
|
+
const u = this.meshWithDepthTest.geometry.getAttribute("uv"), p = 100 * ((n = this.autoDepthTestEffectDistance) != null ? n : 2), g = (l = u.getY((r - p) * 2)) != null ? l : 0, f = (d = u.getY((r + p) * 2)) != null ? d : u.getY(u.count - 1);
|
|
248
|
+
this.meshWithDepthTest.material.uniforms.excludeMinV.value = g, this.meshWithDepthTest.material.uniforms.excludeMaxV.value = f, this.meshWithoutDepthTest.material.uniforms.includeMinV.value = g, this.meshWithoutDepthTest.material.uniforms.includeMaxV.value = f;
|
|
245
249
|
}
|
|
246
250
|
this.meshWithDepthTest.material.uniformsNeedUpdate = !0, this.meshWithoutDepthTest.material.uniformsNeedUpdate = !0, this.five.needsRender = !0;
|
|
247
251
|
});
|
|
@@ -258,13 +262,13 @@ class Y {
|
|
|
258
262
|
this.meshWithDepthTest.material.uniforms.vOffset.value = t, this.meshWithoutDepthTest.material.uniforms.vOffset.value = t, this.meshWithDepthTest.material.uniformsNeedUpdate = !0, this.meshWithoutDepthTest.material.uniformsNeedUpdate = !0, this.five.needsRender = !0;
|
|
259
263
|
});
|
|
260
264
|
i(this, "onFlickerAnimeUpdate", (e) => {
|
|
261
|
-
var s, o, a, n,
|
|
265
|
+
var s, o, a, n, l;
|
|
262
266
|
const { progress: t } = e, r = 1 - t;
|
|
263
|
-
this.meshWithDepthTest.material.uniforms.flicker.value = r, this.meshWithoutDepthTest.material.uniforms.flicker.value = r, this.meshWithDepthTest.material.uniformsNeedUpdate = !0, this.meshWithoutDepthTest.material.uniformsNeedUpdate = !0, this.five.needsRender = !0, (s = this.startTagContainer) != null && s.tag && W(this.startTagContainer.tag) && ((n = this.startTagContainer.app) == null || n.$set(
|
|
267
|
+
this.meshWithDepthTest.material.uniforms.flicker.value = r, this.meshWithoutDepthTest.material.uniforms.flicker.value = r, this.meshWithDepthTest.material.uniformsNeedUpdate = !0, this.meshWithoutDepthTest.material.uniformsNeedUpdate = !0, this.five.needsRender = !0, (s = this.startTagContainer) != null && s.tag && W(this.startTagContainer.tag) && ((n = this.startTagContainer.app) == null || n.$set(T(c({}, this.startTagContainer.tag.data), {
|
|
264
268
|
opacity: r,
|
|
265
269
|
name: this.name,
|
|
266
270
|
distance: Math.round((a = (o = this.curvePath) == null ? void 0 : o.getLength()) != null ? a : 0)
|
|
267
|
-
}))), this.endTagContainer.tag && W(this.endTagContainer.tag) && ((
|
|
271
|
+
}))), this.endTagContainer.tag && W(this.endTagContainer.tag) && ((l = this.endTagContainer.app) == null || l.$set(T(c({}, this.endTagContainer.tag.data), { opacity: r })));
|
|
268
272
|
});
|
|
269
273
|
i(this, "logWarning", (e) => F("GuideLineModeItem: ", e));
|
|
270
274
|
i(this, "logError", (e) => L("GuideLineModeItem: ", e));
|
|
@@ -342,7 +346,7 @@ class Y {
|
|
|
342
346
|
return this.logError("disposed");
|
|
343
347
|
if (!this.five.work)
|
|
344
348
|
return this.logError("setPathByPanoGroup: work is not ready");
|
|
345
|
-
const r =
|
|
349
|
+
const r = B(e);
|
|
346
350
|
if (this._panoGroup = r, (t == null ? void 0 : t.skipPanoGroup) !== void 0) {
|
|
347
351
|
const o = t.skipPanoGroup ? r.map((a) => this.plugin.workUtil.getObserverStandingPosition(a)).filter(V) : null;
|
|
348
352
|
this.skippedPositions = o;
|
|
@@ -352,12 +356,12 @@ class Y {
|
|
|
352
356
|
}
|
|
353
357
|
/** 通过路径设置线条形状 */
|
|
354
358
|
setGeometryByPath(e, t) {
|
|
355
|
-
var g,
|
|
359
|
+
var g, f, v, C;
|
|
356
360
|
if (this.disposed)
|
|
357
361
|
return this.logError("disposed");
|
|
358
|
-
const r = (g = t == null ? void 0 : t.scale) != null ? g : this.scale, s = (
|
|
362
|
+
const r = (g = t == null ? void 0 : t.scale) != null ? g : this.scale, s = (f = t == null ? void 0 : t.width) != null ? f : this.width, o = (v = t == null ? void 0 : t.unit_length) != null ? v : this.unitLength;
|
|
359
363
|
this.scale = r, this.width = s, this.unitLength = o;
|
|
360
|
-
const { geometry: a, maxV: n, curvePath:
|
|
364
|
+
const { geometry: a, maxV: n, curvePath: l, curvePoints: d, panoMap: u, totalLength: p } = S({
|
|
361
365
|
path: e,
|
|
362
366
|
width: s * r,
|
|
363
367
|
unitLength: o * r,
|
|
@@ -365,9 +369,9 @@ class Y {
|
|
|
365
369
|
useAutoDepthTest: t.useAutoDepthTest
|
|
366
370
|
});
|
|
367
371
|
this.autoDepthTestEffectDistance = (C = t.autoDepthTestEffectDistance) != null ? C : (() => {
|
|
368
|
-
const
|
|
369
|
-
return
|
|
370
|
-
})(), this.panoMap =
|
|
372
|
+
const b = p / 10;
|
|
373
|
+
return b > 3 ? 3 : b < 1 ? 1 : b;
|
|
374
|
+
})(), this.panoMap = u, this._curvePath = l, this._curvePoints = d, this.meshWithDepthTest.geometry.copy(a), this.onFivePanoArrived(this.five.getCurrentState().panoIndex), this.meshWithDepthTest.material.needsUpdate = !0, this.meshWithDepthTest.material.uniforms.maxV.value = n, this.meshWithoutDepthTest.material.needsUpdate = !0, this.meshWithoutDepthTest.material.uniforms.maxV.value = n, this.five.needsRender = !0, this.path = e, this.geometryStyle = c(c({}, this.geometryStyle), t);
|
|
371
375
|
}
|
|
372
376
|
/** 设置线条材质 */
|
|
373
377
|
setMartial(e) {
|
|
@@ -375,7 +379,7 @@ class Y {
|
|
|
375
379
|
if (this.disposed)
|
|
376
380
|
return this.logError("disposed");
|
|
377
381
|
this.setDefaultVisible((r = e == null ? void 0 : e.visible) != null ? r : !1), this.setColor((s = e == null ? void 0 : e.color) != null ? s : "#ffffff"), this.setOpacity((o = e == null ? void 0 : e.opacity) != null ? o : 0.5), this.setTextureUrl((n = (a = e == null ? void 0 : e.texture) == null ? void 0 : a.url) != null ? n : "https://vr-image-4.realsee-cdn.cn/release/web/arrow1.ebe7d0ff.png"), (e == null ? void 0 : e.background_color) !== void 0 && this.setBackgroundColor(e.background_color), (e == null ? void 0 : e.background_opacity) !== void 0 && this.setBackgroundOpacity(e.background_opacity), (e == null ? void 0 : e.border_color) !== void 0 && this.setBorderColor(e.border_color), (e == null ? void 0 : e.border_opacity) !== void 0 && this.setBorderOpacity(e.border_opacity), (e == null ? void 0 : e.border_width) !== void 0 && this.setBorderWidth(e.border_width), (e == null ? void 0 : e.background_clip) !== void 0 && this.setBackgroundClip(e.background_clip);
|
|
378
|
-
const t =
|
|
382
|
+
const t = c(c({}, this.materialStyle), e);
|
|
379
383
|
this.materialStyle = t;
|
|
380
384
|
}
|
|
381
385
|
/** 设置模型状态 */
|
|
@@ -384,7 +388,7 @@ class Y {
|
|
|
384
388
|
const s = new h.Vector3(), o = new h.Vector3().fromArray(e.translate);
|
|
385
389
|
o.y += this.heightOffset, s.add(o), this.group.position.copy(s), r(this.startTagContainer, o), r(this.endTagContainer, o);
|
|
386
390
|
}
|
|
387
|
-
const t =
|
|
391
|
+
const t = c(c({}, this.meshStyle), e);
|
|
388
392
|
this.meshStyle = t;
|
|
389
393
|
function r(s, o) {
|
|
390
394
|
if (!(s != null && s.tag))
|
|
@@ -491,42 +495,42 @@ class Y {
|
|
|
491
495
|
return this.disposed ? this.logError("disposed") : this.cacheLengths.length !== 0 ? this.cacheLengths[e] : (this.cacheLengths = this.getPanoGroupLengths(), this.cacheLengths[e]);
|
|
492
496
|
}
|
|
493
497
|
getPanoGroupLengths() {
|
|
494
|
-
var
|
|
498
|
+
var l;
|
|
495
499
|
if (!this.curvePoints || !this.curvePath)
|
|
496
500
|
return [];
|
|
497
|
-
const e = this.curvePoints.length, t = this.curvePath.getLength(), r = e - 1, s = t / r, o = (
|
|
501
|
+
const e = this.curvePoints.length, t = this.curvePath.getLength(), r = e - 1, s = t / r, o = (l = this.curvePath.getLengths(r)) != null ? l : [], a = [];
|
|
498
502
|
let n = 0;
|
|
499
503
|
for (let d = 0; d < e; d++) {
|
|
500
|
-
const
|
|
501
|
-
if (!
|
|
504
|
+
const u = this.curvePoints[d], p = this.plugin.workUtil.getObserverStandingPosition(n);
|
|
505
|
+
if (!p)
|
|
502
506
|
break;
|
|
503
|
-
|
|
507
|
+
p.clone().setY(0).distanceTo(u.clone().setY(0)) < s && (a.push(o[d]), n += 1);
|
|
504
508
|
}
|
|
505
509
|
return a;
|
|
506
510
|
}
|
|
507
511
|
setTag(e, t) {
|
|
508
|
-
var
|
|
512
|
+
var l, d;
|
|
509
513
|
const r = this.curvePath;
|
|
510
514
|
if (!(t != null && t.data))
|
|
511
515
|
return;
|
|
512
|
-
const s = e === "start" ? (
|
|
516
|
+
const s = e === "start" ? (l = this.startTagContainer) != null ? l : (() => (this.startTagContainer = { tag: null, plugin: new k(this.five, { containerZIndex: 1 }) }, this.startTagContainer))() : (d = this.endTagContainer) != null ? d : (() => (this.endTagContainer = { tag: null, plugin: new k(this.five, { containerZIndex: 1 }) }, this.endTagContainer))(), a = N({}, {
|
|
513
517
|
contentType: "Custom",
|
|
514
518
|
stickType: "2DPoint",
|
|
515
519
|
config: { visibleConfig: { visibleFiveMode: ["Floorplan", "Mapview"], followModelVisibility: !1 } },
|
|
516
520
|
style: { point: { enabled: !1 } },
|
|
517
521
|
data: {}
|
|
518
522
|
}, t);
|
|
519
|
-
s.tag = a, W(a) && (s.tag.element = (
|
|
520
|
-
var
|
|
521
|
-
(
|
|
522
|
-
const
|
|
523
|
+
s.tag = a, W(a) && (s.tag.element = (u) => {
|
|
524
|
+
var f, v;
|
|
525
|
+
(f = s.app) == null || f.$destroy();
|
|
526
|
+
const p = e === "start" ? T(c({}, a.data), { name: this.name, distance: Math.round((v = r.getLength()) != null ? v : 0), i18n: this.plugin.config.i18n }) : a.data, g = new I({ target: u, intro: !0, props: p });
|
|
523
527
|
return s.app = g, () => g.$destroy();
|
|
524
528
|
}), s.plugin.load({ tagList: [s.tag] });
|
|
525
529
|
const n = this.meshStyle.translate;
|
|
526
530
|
if (n && a.position) {
|
|
527
|
-
const
|
|
528
|
-
|
|
529
|
-
const g =
|
|
531
|
+
const u = new h.Vector3().fromArray(a.position), p = new h.Vector3().fromArray(n);
|
|
532
|
+
u.add(p), u.y += this.heightOffset;
|
|
533
|
+
const g = u.toArray();
|
|
530
534
|
s.plugin.changeTagById(s.tag.id, { position: g });
|
|
531
535
|
}
|
|
532
536
|
}
|
|
@@ -542,15 +546,28 @@ class Y {
|
|
|
542
546
|
getPathFromPanoGroup(e, t, r) {
|
|
543
547
|
if (e.length < 2)
|
|
544
548
|
return [];
|
|
545
|
-
const s = e.map((
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
549
|
+
const s = {}, o = e.map((l, d) => {
|
|
550
|
+
const u = this.plugin.workUtil.getObserverStandingPosition(l);
|
|
551
|
+
if (!u)
|
|
552
|
+
return;
|
|
553
|
+
const p = e[d - 1];
|
|
554
|
+
if ((d === 0 ? 999 : u.distanceTo(this.plugin.workUtil.getObserverStandingPosition(p))) < 0.05) {
|
|
555
|
+
let f = p;
|
|
556
|
+
for (; s[f] !== void 0; )
|
|
557
|
+
f = s[f];
|
|
558
|
+
s[l] = f;
|
|
559
|
+
return;
|
|
560
|
+
}
|
|
561
|
+
return {
|
|
562
|
+
position: u,
|
|
563
|
+
panoIndex: l
|
|
564
|
+
};
|
|
565
|
+
}).filter(V), a = o.map((l) => l.position.toArray()), n = o.map((l) => l.panoIndex);
|
|
566
|
+
return [T(c({ type: "CatmullRomCurve3", points: a }, r), { panoIndexList: n, panoIndexMap: s })];
|
|
550
567
|
}
|
|
551
568
|
}
|
|
552
|
-
function W(
|
|
553
|
-
return
|
|
569
|
+
function W(m) {
|
|
570
|
+
return m.contentType === "Custom";
|
|
554
571
|
}
|
|
555
572
|
const he = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
556
573
|
__proto__: null,
|
|
@@ -14,7 +14,7 @@ import "../PanoTagPlugin/controller/index.js";
|
|
|
14
14
|
import "./Components/Tag.js";
|
|
15
15
|
import "./utils/index.js";
|
|
16
16
|
import "../vendor/object-assign-deep/objectAssignDeep.js";
|
|
17
|
-
import { GuideLineModeItem as
|
|
17
|
+
import { GuideLineModeItem as om } from "./GuideLineModeItem/index.js";
|
|
18
18
|
import "../vendor/polyline-normals/index.js";
|
|
19
19
|
import "../vendor/polyline-miter-util/index.js";
|
|
20
20
|
import "../vendor/gl-vec2/add.js";
|
|
@@ -22,6 +22,7 @@ import "../vendor/gl-vec2/set.js";
|
|
|
22
22
|
import "../vendor/gl-vec2/normalize.js";
|
|
23
23
|
import "../vendor/gl-vec2/subtract.js";
|
|
24
24
|
import "../vendor/gl-vec2/dot.js";
|
|
25
|
+
import "../shared-utils/math/intersecting.js";
|
|
25
26
|
import "../shared-utils/positionToVector3.js";
|
|
26
27
|
import "../CSS3DRenderPlugin/utils/three/CSS3DRenderer.js";
|
|
27
28
|
import "three/examples/jsm/renderers/CSS3DRenderer";
|
|
@@ -158,5 +159,5 @@ import "../shared-utils/three/blink.js";
|
|
|
158
159
|
import "../PanoTagPlugin/utils/DebugUtil.js";
|
|
159
160
|
import "../CruisePlugin/utils/sleep.js";
|
|
160
161
|
export {
|
|
161
|
-
|
|
162
|
+
om as GuideLineModeItem
|
|
162
163
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import t from "./Controller.js";
|
|
2
|
-
import { GuideLineItem$1 as
|
|
3
|
-
import { GuideLineModeItem$1 as
|
|
2
|
+
import { GuideLineItem$1 as Ct } from "./GuideLineItem/index.js";
|
|
3
|
+
import { GuideLineModeItem$1 as ht } from "./GuideLineModeItem/index.js";
|
|
4
4
|
import "../base/BasePluginWithData.js";
|
|
5
5
|
import "../base/BasePlugin.js";
|
|
6
6
|
import "../shared-utils/Subscribe.js";
|
|
@@ -52,6 +52,7 @@ import "../vendor/gl-vec2/set.js";
|
|
|
52
52
|
import "../vendor/gl-vec2/normalize.js";
|
|
53
53
|
import "../vendor/gl-vec2/subtract.js";
|
|
54
54
|
import "../vendor/gl-vec2/dot.js";
|
|
55
|
+
import "../shared-utils/math/intersecting.js";
|
|
55
56
|
import "../shared-utils/five/mode.js";
|
|
56
57
|
import "../shared-utils/animationFrame/BetterTween.js";
|
|
57
58
|
import "../shared-utils/animationFrame/index.js";
|
|
@@ -177,10 +178,10 @@ import "../shared-utils/five/changeMode.js";
|
|
|
177
178
|
import "../shared-utils/nearlyEqual.js";
|
|
178
179
|
import "../CruisePlugin/Move.js";
|
|
179
180
|
import "../CruisePlugin/utils/getFiveStateOnCurve.js";
|
|
180
|
-
const r = (i, o) => new t(i, o),
|
|
181
|
+
const r = (i, o) => new t(i, o), Mt = r;
|
|
181
182
|
export {
|
|
182
|
-
|
|
183
|
-
|
|
183
|
+
Ct as GuideLineItem,
|
|
184
|
+
ht as GuideLineModeItem,
|
|
184
185
|
r as GuideLinePlugin,
|
|
185
|
-
|
|
186
|
+
Mt as default
|
|
186
187
|
};
|
|
@@ -22,11 +22,16 @@ export declare function createLineGeometry(options: LineGeometryOption): {
|
|
|
22
22
|
maxV: number;
|
|
23
23
|
curvePath: any;
|
|
24
24
|
curvePoints: any;
|
|
25
|
+
animationWillError?: undefined;
|
|
25
26
|
panoMap?: undefined;
|
|
26
27
|
totalLength?: undefined;
|
|
27
28
|
} | {
|
|
28
29
|
geometry: THREE.BufferGeometry;
|
|
29
30
|
maxV: number;
|
|
31
|
+
animationWillError: {
|
|
32
|
+
start: number;
|
|
33
|
+
end: number;
|
|
34
|
+
}[];
|
|
30
35
|
curvePath: THREE.CurvePath<THREE.Vector3>;
|
|
31
36
|
curvePoints: THREE.Vector3[];
|
|
32
37
|
panoMap: Record<number, number>;
|