@realsee/dnalogel 3.11.0 → 3.12.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/CruisePlugin/BaseController.d.ts +5 -0
- package/dist/CruisePlugin/Work.d.ts +1 -5
- package/dist/GuideLinePlugin/Controller.d.ts +4 -0
- package/dist/PanoTagPlugin/controller/TagUtil.d.ts +2 -3
- package/dist/PanoTagPlugin/controller/index.d.ts +1 -0
- package/dist/PanoTagPlugin/utils/DebugUtil.d.ts +6 -0
- package/dist/base/BasePlugin.d.ts +1 -1
- package/dist/index.cjs.js +52 -52
- package/dist/index.js +3178 -3067
- package/dist/index.umd.js +44 -44
- package/dist/shared-utils/Utils/BaseUtil.d.ts +5 -0
- package/dist/shared-utils/Utils/FiveUtil.d.ts +10 -0
- package/dist/shared-utils/Utils/WorkUtil.d.ts +33 -0
- package/libs/CruisePlugin/BaseController.d.ts +5 -0
- package/libs/CruisePlugin/BaseController.js +66 -54
- package/libs/CruisePlugin/Move.js +29 -25
- package/libs/CruisePlugin/Work.d.ts +1 -5
- package/libs/CruisePlugin/Work.js +133 -129
- package/libs/CruisePlugin/index.js +10 -6
- package/libs/GuideLinePlugin/Controller.d.ts +4 -0
- package/libs/GuideLinePlugin/Controller.js +41 -30
- package/libs/GuideLinePlugin/GuideLineItem.js +6 -2
- package/libs/GuideLinePlugin/GuideLineModeItem/index.js +61 -61
- package/libs/GuideLinePlugin/GuideLineModeItem.js +5 -2
- package/libs/GuideLinePlugin/index.js +12 -8
- package/libs/PanoTagPlugin/controller/TagComputer.js +24 -22
- package/libs/PanoTagPlugin/controller/TagRender.js +4 -2
- package/libs/PanoTagPlugin/controller/TagUtil.d.ts +2 -3
- package/libs/PanoTagPlugin/controller/TagUtil.js +92 -100
- package/libs/PanoTagPlugin/controller/index.d.ts +1 -0
- package/libs/PanoTagPlugin/controller/index.js +32 -26
- package/libs/PanoTagPlugin/index.js +14 -11
- package/libs/PanoTagPlugin/utils/DebugUtil.d.ts +6 -0
- package/libs/PanoTagPlugin/utils/DebugUtil.js +25 -0
- package/libs/base/BasePlugin.d.ts +1 -1
- package/libs/base/BasePlugin.js +2 -2
- package/libs/index.js +125 -121
- package/libs/shared-utils/Utils/BaseUtil.d.ts +5 -0
- package/libs/shared-utils/Utils/BaseUtil.js +12 -0
- package/libs/shared-utils/Utils/FiveUtil.d.ts +10 -0
- package/libs/shared-utils/Utils/FiveUtil.js +27 -0
- package/libs/shared-utils/Utils/WorkUtil.d.ts +33 -0
- package/libs/shared-utils/Utils/WorkUtil.js +68 -0
- package/libs/shared-utils/logger.js +1 -1
- package/package.json +1 -1
|
@@ -1,41 +1,41 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
var I = (h, l, t) => l in h ?
|
|
1
|
+
var b = Object.defineProperty, E = Object.defineProperties;
|
|
2
|
+
var F = Object.getOwnPropertyDescriptors;
|
|
3
|
+
var w = Object.getOwnPropertySymbols;
|
|
4
|
+
var D = Object.prototype.hasOwnProperty, C = Object.prototype.propertyIsEnumerable;
|
|
5
|
+
var I = (h, l, t) => l in h ? b(h, l, { enumerable: !0, configurable: !0, writable: !0, value: t }) : h[l] = t, g = (h, l) => {
|
|
6
6
|
for (var t in l || (l = {}))
|
|
7
|
-
|
|
8
|
-
if (
|
|
9
|
-
for (var t of
|
|
10
|
-
|
|
7
|
+
D.call(l, t) && I(h, t, l[t]);
|
|
8
|
+
if (w)
|
|
9
|
+
for (var t of w(l))
|
|
10
|
+
C.call(l, t) && I(h, t, l[t]);
|
|
11
11
|
return h;
|
|
12
|
-
}, x = (h, l) =>
|
|
12
|
+
}, x = (h, l) => E(h, F(l));
|
|
13
13
|
var k = (h, l, t) => (I(h, typeof l != "symbol" ? l + "" : l, t), t);
|
|
14
14
|
var y = (h, l, t) => new Promise((e, r) => {
|
|
15
|
-
var i = (
|
|
15
|
+
var i = (n) => {
|
|
16
16
|
try {
|
|
17
|
-
|
|
17
|
+
m(t.next(n));
|
|
18
18
|
} catch (o) {
|
|
19
19
|
r(o);
|
|
20
20
|
}
|
|
21
|
-
},
|
|
21
|
+
}, s = (n) => {
|
|
22
22
|
try {
|
|
23
|
-
|
|
23
|
+
m(t.throw(n));
|
|
24
24
|
} catch (o) {
|
|
25
25
|
r(o);
|
|
26
26
|
}
|
|
27
|
-
},
|
|
28
|
-
|
|
27
|
+
}, m = (n) => n.done ? e(n.value) : Promise.resolve(n.value).then(i, s);
|
|
28
|
+
m((t = t.apply(h, l)).next());
|
|
29
29
|
});
|
|
30
|
-
import { GuideLinePlugin as
|
|
30
|
+
import { GuideLinePlugin as K } from "../GuideLinePlugin/index.js";
|
|
31
31
|
import { uuid as S } from "../shared-utils/uuid.js";
|
|
32
|
-
import { coordinatesAngle as
|
|
33
|
-
import { safeCall as
|
|
34
|
-
import * as
|
|
35
|
-
import { sleep as
|
|
36
|
-
import { waitFiveLoaded as
|
|
37
|
-
import { vectorToCoordinates as
|
|
38
|
-
import
|
|
32
|
+
import { coordinatesAngle as L } from "./utils/coordinatesAngle.js";
|
|
33
|
+
import { safeCall as T } from "./utils/safeCall.js";
|
|
34
|
+
import * as U from "three";
|
|
35
|
+
import { sleep as O } from "./utils/sleep.js";
|
|
36
|
+
import { waitFiveLoaded as M } from "../shared-utils/five/fiveLoaded.js";
|
|
37
|
+
import { vectorToCoordinates as A } from "../shared-utils/vectorToCoordinate.js";
|
|
38
|
+
import G from "./BaseController.js";
|
|
39
39
|
import "../GuideLinePlugin/Controller.js";
|
|
40
40
|
import "../base/BasePluginWithData.js";
|
|
41
41
|
import "../base/BasePlugin.js";
|
|
@@ -113,6 +113,8 @@ import "../PanoTagPlugin/utils/tag/adaptConfig.js";
|
|
|
113
113
|
import "../shared-utils/typescript/entries.js";
|
|
114
114
|
import "../shared-utils/url/getUrl.js";
|
|
115
115
|
import "../shared-utils/five/transformPosition.js";
|
|
116
|
+
import "../shared-utils/Utils/WorkUtil.js";
|
|
117
|
+
import "../shared-utils/Utils/BaseUtil.js";
|
|
116
118
|
import "../shared-utils/five/getFloorIndex.js";
|
|
117
119
|
import "../shared-utils/safeObj.js";
|
|
118
120
|
import "../PanoTagPlugin/Components/TagContainer.js";
|
|
@@ -192,6 +194,7 @@ import "../CSS3DRenderPlugin/utils/waitFiveModelLoaded.js";
|
|
|
192
194
|
import "../shared-utils/three/GLTFLoader.js";
|
|
193
195
|
import "@realsee/five/gltf-loader";
|
|
194
196
|
import "../shared-utils/five/fiveModelLoad.js";
|
|
197
|
+
import "../PanoTagPlugin/utils/DebugUtil.js";
|
|
195
198
|
import "../GuideLinePlugin/Components/Tag.js";
|
|
196
199
|
import "../GuideLinePlugin/utils/index.js";
|
|
197
200
|
import "../shared-utils/to.js";
|
|
@@ -199,10 +202,11 @@ import "../shared-utils/five/changeMode.js";
|
|
|
199
202
|
import "../shared-utils/nearlyEqual.js";
|
|
200
203
|
import "./Move.js";
|
|
201
204
|
import "./utils/getFiveStateOnCurve.js";
|
|
205
|
+
import "../shared-utils/Utils/FiveUtil.js";
|
|
202
206
|
import "../shared-utils/formatRad.js";
|
|
203
207
|
import "./Work.js";
|
|
204
208
|
import "./utils/coordinatesToVector.js";
|
|
205
|
-
class
|
|
209
|
+
class er extends G {
|
|
206
210
|
constructor(t, e) {
|
|
207
211
|
super(t, e);
|
|
208
212
|
k(this, "state", {
|
|
@@ -234,30 +238,30 @@ class tr extends R {
|
|
|
234
238
|
*/
|
|
235
239
|
load(t, e, r) {
|
|
236
240
|
return y(this, null, function* () {
|
|
237
|
-
var a,
|
|
241
|
+
var a, p;
|
|
238
242
|
if (this.state.disposed)
|
|
239
243
|
return this.disposedErrorLog();
|
|
240
244
|
this.clear();
|
|
241
|
-
const i = this.data ? JSON.parse(JSON.stringify(this.data)) : void 0,
|
|
242
|
-
this.data = g({ id:
|
|
243
|
-
let
|
|
244
|
-
const o = this.data.keyframes.filter((
|
|
245
|
-
o.filter((
|
|
246
|
-
var
|
|
247
|
-
return
|
|
248
|
-
}).map((
|
|
249
|
-
var
|
|
250
|
-
const
|
|
251
|
-
if (
|
|
252
|
-
if (
|
|
253
|
-
const c =
|
|
254
|
-
|
|
245
|
+
const i = this.data ? JSON.parse(JSON.stringify(this.data)) : void 0, s = yield this.formatData(t);
|
|
246
|
+
this.data = g({ id: s.keyframesId }, s), this.hooks.emit("dataChange", s, i);
|
|
247
|
+
let m = [], n;
|
|
248
|
+
const o = this.data.keyframes.filter((d) => d.data.panoIndex !== void 0);
|
|
249
|
+
o.filter((d, u) => {
|
|
250
|
+
var f;
|
|
251
|
+
return d.data.panoIndex !== ((f = o[u - 1]) == null ? void 0 : f.data.panoIndex);
|
|
252
|
+
}).map((d) => d.data.panoIndex).forEach((d) => {
|
|
253
|
+
var f, v;
|
|
254
|
+
const u = (f = this.workUtil.getObserver(d)) == null ? void 0 : f.floorIndex;
|
|
255
|
+
if (u !== void 0)
|
|
256
|
+
if (n === u) {
|
|
257
|
+
const c = m.length - 1;
|
|
258
|
+
m[c] = [...(v = m[c]) != null ? v : [], d];
|
|
255
259
|
} else {
|
|
256
|
-
|
|
257
|
-
const c =
|
|
258
|
-
|
|
260
|
+
n = u;
|
|
261
|
+
const c = m.length;
|
|
262
|
+
m[c] = [d];
|
|
259
263
|
}
|
|
260
|
-
}), !this.GuideLine && ((a = this.config) == null ? void 0 : a.useGuideLine) !== !1 &&
|
|
264
|
+
}), !this.GuideLine && ((a = this.config) == null ? void 0 : a.useGuideLine) !== !1 && s.useGuildLine !== !1 && (this.GuideLine = K(this.five, this.config)), (p = this.GuideLine) == null || p.load({ routes: m.map((d) => ({ panoIndexList: d })), config: s.guildPluginOptions }), e ? this.setState(e, { userAction: r }) : (this.setState({ playing: !1 }, { userAction: !1 }), this.handleVisible(this.state.visible), this.handleEnable(this.state.enabled), this.changePlayState(this.state.playing, { userAction: !1 }), this.changeSpeed(this.state.speed)), this.clearPauseData(), console.debug("WORKPLUGIN loaded", s), this.hooks.emit("dataLoaded", s);
|
|
261
265
|
});
|
|
262
266
|
}
|
|
263
267
|
/**
|
|
@@ -280,45 +284,45 @@ class tr extends R {
|
|
|
280
284
|
*/
|
|
281
285
|
formatData(t) {
|
|
282
286
|
return y(this, null, function* () {
|
|
283
|
-
this.five.work || (yield
|
|
284
|
-
const e =
|
|
285
|
-
const
|
|
286
|
-
return typeof
|
|
287
|
+
this.five.work || (yield M(this.five));
|
|
288
|
+
const e = (() => {
|
|
289
|
+
const r = t;
|
|
290
|
+
return typeof r == "object" && r !== null && r.version && r.data ? r.data : r;
|
|
287
291
|
})();
|
|
288
|
-
if (
|
|
292
|
+
if (e.keyframes)
|
|
289
293
|
return {
|
|
290
294
|
keyframesId: S(),
|
|
291
|
-
keyframes:
|
|
292
|
-
var
|
|
293
|
-
const s =
|
|
294
|
-
return x(g({ id: (
|
|
295
|
+
keyframes: e.keyframes.map((r, i) => {
|
|
296
|
+
var n;
|
|
297
|
+
const s = e.keyframes[i + 1], m = (() => !s || s.start === void 0 || r.end === void 0 ? 0 : s.start - r.end)();
|
|
298
|
+
return x(g({ id: (n = r.uuid) != null ? n : S(), moveIndex: i, stay: m, index: i }, r), { guildPluginOptions: e.guildPluginOptions });
|
|
295
299
|
})
|
|
296
300
|
};
|
|
297
|
-
if (
|
|
298
|
-
let
|
|
299
|
-
const { moveEffect:
|
|
300
|
-
return this.privateState.moveToFirstPanoEffect = s, this.privateState.moveToFirstPanoDuration =
|
|
301
|
-
const
|
|
302
|
-
var
|
|
303
|
-
const p =
|
|
301
|
+
if (e.panoIndexList) {
|
|
302
|
+
let r = [];
|
|
303
|
+
const { moveEffect: i, moveToFirstPanoEffect: s, moveToFirstPanoDuration: m } = e;
|
|
304
|
+
return this.privateState.moveToFirstPanoEffect = s, this.privateState.moveToFirstPanoDuration = m, e.panoIndexList.forEach((n, o) => {
|
|
305
|
+
const a = (() => {
|
|
306
|
+
var v, c;
|
|
307
|
+
const p = e.panoIndexList.slice(o).find((P) => P !== n);
|
|
304
308
|
if (p === void 0)
|
|
305
309
|
return;
|
|
306
|
-
const
|
|
307
|
-
if (!u || !
|
|
310
|
+
const d = this.workUtil.getObserverPosition(n), u = this.workUtil.getObserverPosition(p);
|
|
311
|
+
if (!u || !d || ((v = this.workUtil.getObserver(n)) == null ? void 0 : v.floorIndex) !== ((c = this.workUtil.getObserver(p)) == null ? void 0 : c.floorIndex))
|
|
308
312
|
return;
|
|
309
|
-
const
|
|
310
|
-
return
|
|
313
|
+
const f = new U.Vector3().subVectors(u, d);
|
|
314
|
+
return A(f.normalize());
|
|
311
315
|
})();
|
|
312
|
-
|
|
313
|
-
moveIndex:
|
|
314
|
-
stay:
|
|
315
|
-
data: g({ effect: "Move", panoIndex:
|
|
316
|
-
}) :
|
|
316
|
+
e.moveType === void 0 || e.moveType === "justMove" ? r.push({
|
|
317
|
+
moveIndex: o,
|
|
318
|
+
stay: e.stay,
|
|
319
|
+
data: g({ effect: "Move", panoIndex: n, moveEffect: i }, a != null ? a : {})
|
|
320
|
+
}) : e.moveType === "moveAndRotate" && (r.push({ moveIndex: o, stay: e.stay, data: { effect: "Move", panoIndex: n, moveEffect: i } }), a && r.push({ moveIndex: o, stay: e.stay, data: g({ effect: "Rotate", panoIndex: n }, a) }));
|
|
317
321
|
}), {
|
|
318
322
|
keyframesId: S(),
|
|
319
|
-
keyframes:
|
|
320
|
-
guildPluginOptions:
|
|
321
|
-
useGuildLine:
|
|
323
|
+
keyframes: r.map((n, o) => g({ id: S(), index: o }, n)),
|
|
324
|
+
guildPluginOptions: e.guildPluginOptions,
|
|
325
|
+
useGuildLine: e.useGuildLine
|
|
322
326
|
};
|
|
323
327
|
} else
|
|
324
328
|
throw new Error("format error: data no keyframes or no panoIndexList");
|
|
@@ -332,21 +336,21 @@ class tr extends R {
|
|
|
332
336
|
// eslint-disable-next-line complexity
|
|
333
337
|
handlePlay(t) {
|
|
334
338
|
return y(this, null, function* () {
|
|
335
|
-
var
|
|
336
|
-
const { data: e, state: r, privateState: i, hooks:
|
|
339
|
+
var u;
|
|
340
|
+
const { data: e, state: r, privateState: i, hooks: s } = this;
|
|
337
341
|
if (i.playing || !(e != null && e.keyframes) || (e == null ? void 0 : e.keyframes.length) === 0)
|
|
338
342
|
return;
|
|
339
|
-
const
|
|
340
|
-
i.playId =
|
|
341
|
-
const
|
|
342
|
-
(t == null ? void 0 : t.notEmitEvent) !== !0 &&
|
|
343
|
+
const m = S();
|
|
344
|
+
i.playId = m, i.playing = !0, i.broke = !1;
|
|
345
|
+
const n = e.keyframes, o = this.getPauseData();
|
|
346
|
+
(t == null ? void 0 : t.notEmitEvent) !== !0 && s.emit("play", { userAction: (u = t == null ? void 0 : t.userAction) != null ? u : !0 });
|
|
343
347
|
let a = !1;
|
|
344
|
-
const
|
|
345
|
-
var
|
|
348
|
+
const d = yield (() => y(this, null, function* () {
|
|
349
|
+
var f, v;
|
|
346
350
|
if ((t == null ? void 0 : t.playFromIndex) !== void 0)
|
|
347
351
|
return t.playFromIndex;
|
|
348
352
|
if ((t == null ? void 0 : t.playFromId) !== void 0)
|
|
349
|
-
return (
|
|
353
|
+
return (f = this.data) == null ? void 0 : f.keyframes.findIndex((c) => c.id === t.playFromId);
|
|
350
354
|
if (o != null && o.id) {
|
|
351
355
|
const c = (v = this.data) == null ? void 0 : v.keyframes.find((P) => P.id === o.id);
|
|
352
356
|
if (o != null && o.fiveState && (yield this.move(o.fiveState, {
|
|
@@ -363,40 +367,40 @@ class tr extends R {
|
|
|
363
367
|
}
|
|
364
368
|
}))();
|
|
365
369
|
this.clearPauseData();
|
|
366
|
-
for (const
|
|
367
|
-
if (i.broke || !r.playing || !i.playing ||
|
|
370
|
+
for (const f of n) {
|
|
371
|
+
if (i.broke || !r.playing || !i.playing || m !== i.playId)
|
|
368
372
|
return;
|
|
369
|
-
if (!(
|
|
373
|
+
if (!(d !== void 0 && f.index < d))
|
|
370
374
|
try {
|
|
371
|
-
|
|
375
|
+
s.emit("playIndexChange", f.index, f), yield this.playKeyframe(f, {
|
|
372
376
|
moveEffect: a === !1 ? i.moveToFirstPanoEffect : void 0,
|
|
373
377
|
duration: a === !1 && typeof i.moveToFirstPanoDuration == "number" ? i.moveToFirstPanoDuration : void 0
|
|
374
|
-
}),
|
|
378
|
+
}), f.stay && (yield O(f.stay)), a === !1 && (a = !0);
|
|
375
379
|
} catch (v) {
|
|
376
380
|
return console.error(v), Promise.resolve("broke");
|
|
377
381
|
}
|
|
378
382
|
}
|
|
379
|
-
r.playing &&
|
|
383
|
+
r.playing && m === i.playId && (this.setState({ playing: !1 }, { userAction: !1 }), s.emit("end"), this.clearPauseData());
|
|
380
384
|
});
|
|
381
385
|
}
|
|
382
386
|
/**
|
|
383
387
|
* @description: Pause and record pause state
|
|
384
388
|
*/
|
|
385
389
|
handlePause(t) {
|
|
386
|
-
var
|
|
390
|
+
var s;
|
|
387
391
|
const { state: e, privateState: r, hooks: i } = this;
|
|
388
|
-
e.playing = !1, r.playing !== !1 && (r.playing = !1, (t == null ? void 0 : t.userAction) !== !1 && this.setPauseData(), r.broke || this.forceInteruptUpdateCamera(), (t == null ? void 0 : t.notEmitEvent) !== !0 && i.emit("pause", { userAction: (
|
|
392
|
+
e.playing = !1, r.playing !== !1 && (r.playing = !1, (t == null ? void 0 : t.userAction) !== !1 && this.setPauseData(), r.broke || this.forceInteruptUpdateCamera(), (t == null ? void 0 : t.notEmitEvent) !== !0 && i.emit("pause", { userAction: (s = t == null ? void 0 : t.userAction) != null ? s : !0 }));
|
|
389
393
|
}
|
|
390
394
|
/**
|
|
391
395
|
* @description: Change play speed
|
|
392
396
|
*/
|
|
393
397
|
changeSpeed(t, e = !0) {
|
|
394
|
-
const { state: r, privateState: i, hooks:
|
|
395
|
-
if (
|
|
398
|
+
const { state: r, privateState: i, hooks: s } = this, { currentPlayKeyframe: m } = i;
|
|
399
|
+
if (s.emit("speedChange", t, { userAction: e }), r.playing && m)
|
|
396
400
|
try {
|
|
397
|
-
const
|
|
401
|
+
const n = m.originDuration !== void 0 ? m.originDuration * (1 - this.getProgress()) : void 0, o = this.playKeyframe(m.keyframe, { duration: n });
|
|
398
402
|
i.currentPlayQueue.push(o);
|
|
399
|
-
} catch (
|
|
403
|
+
} catch (n) {
|
|
400
404
|
}
|
|
401
405
|
}
|
|
402
406
|
/**
|
|
@@ -439,20 +443,20 @@ class tr extends R {
|
|
|
439
443
|
*/
|
|
440
444
|
getPlayPromise(r) {
|
|
441
445
|
return y(this, arguments, function* (t, e = {}) {
|
|
442
|
-
var
|
|
446
|
+
var s;
|
|
443
447
|
const i = t.data;
|
|
444
|
-
if (e.duration = (
|
|
445
|
-
return new Promise((
|
|
448
|
+
if (e.duration = (s = e.duration) != null ? s : t.start !== void 0 && t.end !== void 0 ? t.end - t.start : void 0, !!i)
|
|
449
|
+
return new Promise((m, n) => {
|
|
446
450
|
let o = !1;
|
|
447
451
|
this.addInterruptListener(() => {
|
|
448
452
|
if (!o)
|
|
449
|
-
return this.hooks.emit("broke"), this.privateState.broke = !0, this.setState({ playing: !1 }), o = !0,
|
|
453
|
+
return this.hooks.emit("broke"), this.privateState.broke = !0, this.setState({ playing: !1 }), o = !0, n(new Error("play is interupted"));
|
|
450
454
|
});
|
|
451
455
|
try {
|
|
452
456
|
if (o)
|
|
453
457
|
return;
|
|
454
458
|
const a = () => {
|
|
455
|
-
|
|
459
|
+
m(), o = !0;
|
|
456
460
|
};
|
|
457
461
|
switch (i.effect) {
|
|
458
462
|
case "Move":
|
|
@@ -519,26 +523,26 @@ class tr extends R {
|
|
|
519
523
|
*/
|
|
520
524
|
updateCamera(r) {
|
|
521
525
|
return y(this, arguments, function* (t, e = {}) {
|
|
522
|
-
const { five: i, privateState:
|
|
523
|
-
var
|
|
524
|
-
const
|
|
525
|
-
if ((
|
|
526
|
-
return
|
|
527
|
-
if (
|
|
528
|
-
return
|
|
526
|
+
const { five: i, privateState: s, state: m } = this, n = (() => {
|
|
527
|
+
var u, f;
|
|
528
|
+
const p = (u = m.config) == null ? void 0 : u.speedConfig, d = (f = t.rotateSpeed) != null ? f : p == null ? void 0 : p.rotateSpeed;
|
|
529
|
+
if ((p == null ? void 0 : p.rotateSpeedUnit) === void 0)
|
|
530
|
+
return d;
|
|
531
|
+
if (d !== void 0)
|
|
532
|
+
return p.rotateSpeedUnit === "rad/ms" ? d : d / 1e3;
|
|
529
533
|
})(), o = (() => {
|
|
530
534
|
if (e.duration)
|
|
531
535
|
return e.duration;
|
|
532
|
-
if (
|
|
533
|
-
const
|
|
534
|
-
return
|
|
536
|
+
if (n) {
|
|
537
|
+
const p = this.five.getCurrentState();
|
|
538
|
+
return L(p, t) / n;
|
|
535
539
|
}
|
|
536
540
|
return 800;
|
|
537
541
|
})();
|
|
538
|
-
|
|
542
|
+
s.currentPlayKeyframe && (s.currentPlayKeyframe.originDuration = o);
|
|
539
543
|
const a = this.getSpeededDuration(o);
|
|
540
|
-
return new Promise((
|
|
541
|
-
|
|
544
|
+
return new Promise((p) => {
|
|
545
|
+
T(() => i.updateCamera(t, a)), setTimeout(() => p(), a);
|
|
542
546
|
});
|
|
543
547
|
});
|
|
544
548
|
}
|
|
@@ -547,39 +551,39 @@ class tr extends R {
|
|
|
547
551
|
*/
|
|
548
552
|
changePano(t, e) {
|
|
549
553
|
return y(this, null, function* () {
|
|
550
|
-
const { five: r, privateState: i, state:
|
|
554
|
+
const { five: r, privateState: i, state: s } = this;
|
|
551
555
|
if (typeof t.panoIndex != "number" || t.panoIndex === r.panoIndex)
|
|
552
556
|
return;
|
|
553
|
-
const
|
|
554
|
-
|
|
555
|
-
const
|
|
556
|
-
var
|
|
557
|
-
const a = (
|
|
557
|
+
const m = r.getCurrentState().mode !== "Panorama";
|
|
558
|
+
m && (this.privateState.modeChanging = !0);
|
|
559
|
+
const n = (() => {
|
|
560
|
+
var d, u;
|
|
561
|
+
const a = (d = s.config) == null ? void 0 : d.speedConfig, p = (u = t.moveSpeed) != null ? u : a == null ? void 0 : a.moveSpeed;
|
|
558
562
|
if ((a == null ? void 0 : a.moveSpeedUnit) === void 0)
|
|
559
|
-
return
|
|
560
|
-
if (
|
|
561
|
-
return a.moveSpeedUnit === "m/ms" ?
|
|
563
|
+
return p;
|
|
564
|
+
if (p !== void 0)
|
|
565
|
+
return a.moveSpeedUnit === "m/ms" ? p : p / 1e3;
|
|
562
566
|
})(), o = (() => {
|
|
563
567
|
if (e != null && e.duration)
|
|
564
568
|
return e.duration;
|
|
565
|
-
if (
|
|
566
|
-
const a =
|
|
567
|
-
return a.distanceTo(
|
|
569
|
+
if (n && typeof r.panoIndex == "number" && typeof t.panoIndex == "number") {
|
|
570
|
+
const a = this.workUtil.getObserverPosition(r.panoIndex), p = this.workUtil.getObserverPosition(t.panoIndex);
|
|
571
|
+
return a && p ? a.distanceTo(p) / n : 800;
|
|
568
572
|
}
|
|
569
573
|
return 800;
|
|
570
574
|
})();
|
|
571
575
|
i.currentPlayKeyframe && (i.currentPlayKeyframe.originDuration = o), yield new Promise((a) => {
|
|
572
|
-
var
|
|
573
|
-
|
|
576
|
+
var p, d, u;
|
|
577
|
+
this.fiveUtil.moveToPano(t.panoIndex, {
|
|
574
578
|
latitude: t.latitude,
|
|
575
579
|
longitude: t.longitude,
|
|
576
580
|
fov: t.fov,
|
|
577
581
|
duration: this.getSpeededDuration(o),
|
|
578
|
-
effect: (
|
|
582
|
+
effect: (u = (d = e == null ? void 0 : e.moveEffect) != null ? d : (p = this.state.config) == null ? void 0 : p.moveEffect) != null ? u : t.moveEffect,
|
|
579
583
|
moveCancelCallback: () => a(),
|
|
580
584
|
moveEndCallback: () => a()
|
|
581
|
-
}),
|
|
582
|
-
}),
|
|
585
|
+
}), m && r.once("panoArrived", () => a());
|
|
586
|
+
}), m && (this.privateState.modeChanging = !1);
|
|
583
587
|
});
|
|
584
588
|
}
|
|
585
589
|
/**
|
|
@@ -592,5 +596,5 @@ class tr extends R {
|
|
|
592
596
|
}
|
|
593
597
|
}
|
|
594
598
|
export {
|
|
595
|
-
|
|
599
|
+
er as default
|
|
596
600
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { typing as
|
|
1
|
+
import { typing as bt } from "./typing/index.js";
|
|
2
2
|
import t from "./Work.js";
|
|
3
3
|
import i from "./Move.js";
|
|
4
4
|
import "../GuideLinePlugin/index.js";
|
|
@@ -80,6 +80,8 @@ import "../PanoTagPlugin/utils/tag/adaptConfig.js";
|
|
|
80
80
|
import "../shared-utils/typescript/entries.js";
|
|
81
81
|
import "../shared-utils/url/getUrl.js";
|
|
82
82
|
import "../shared-utils/five/transformPosition.js";
|
|
83
|
+
import "../shared-utils/Utils/WorkUtil.js";
|
|
84
|
+
import "../shared-utils/Utils/BaseUtil.js";
|
|
83
85
|
import "../shared-utils/five/getFloorIndex.js";
|
|
84
86
|
import "../shared-utils/safeObj.js";
|
|
85
87
|
import "../PanoTagPlugin/Components/TagContainer.js";
|
|
@@ -160,6 +162,7 @@ import "../CSS3DRenderPlugin/utils/waitFiveModelLoaded.js";
|
|
|
160
162
|
import "../shared-utils/three/GLTFLoader.js";
|
|
161
163
|
import "@realsee/five/gltf-loader";
|
|
162
164
|
import "../shared-utils/five/fiveModelLoad.js";
|
|
165
|
+
import "../PanoTagPlugin/utils/DebugUtil.js";
|
|
163
166
|
import "../GuideLinePlugin/Components/Tag.js";
|
|
164
167
|
import "../GuideLinePlugin/utils/index.js";
|
|
165
168
|
import "../shared-utils/to.js";
|
|
@@ -173,14 +176,15 @@ import "./utils/sleep.js";
|
|
|
173
176
|
import "../shared-utils/vectorToCoordinate.js";
|
|
174
177
|
import "../shared-utils/formatRad.js";
|
|
175
178
|
import "./BaseController.js";
|
|
179
|
+
import "../shared-utils/Utils/FiveUtil.js";
|
|
176
180
|
import "./utils/getFiveStateOnCurve.js";
|
|
177
|
-
const
|
|
181
|
+
const dt = (o, r) => new t(o, r), kt = (o, r) => new i(o, r);
|
|
178
182
|
export {
|
|
179
|
-
|
|
183
|
+
dt as CruisePlugin,
|
|
180
184
|
t as CruisePluginController,
|
|
181
|
-
|
|
185
|
+
bt as CruisePluginTypes,
|
|
182
186
|
i as MoveController,
|
|
183
|
-
|
|
187
|
+
kt as MovePlugin,
|
|
184
188
|
t as WalkController,
|
|
185
|
-
|
|
189
|
+
dt as default
|
|
186
190
|
};
|
|
@@ -5,10 +5,14 @@ import type * as PluginType from './typing';
|
|
|
5
5
|
import type { Config } from '../base/BasePlugin';
|
|
6
6
|
import { GuideLineItem } from './GuideLineItem';
|
|
7
7
|
import CruisePluginController from '../CruisePlugin/Work';
|
|
8
|
+
import { WorkUtil } from '../shared-utils/Utils/WorkUtil';
|
|
8
9
|
export declare const pluginFlag: (name: string) => string;
|
|
9
10
|
export default class Controller extends BasePluginWithData.Controller<PluginState, EventMap, PluginServerData, PluginData> {
|
|
10
11
|
readonly name = "GuideLinePlugin";
|
|
11
12
|
readonly cruisePlugin: CruisePluginController;
|
|
13
|
+
set workCode(workCode: string);
|
|
14
|
+
get workCode(): string;
|
|
15
|
+
workUtils: WorkUtil;
|
|
12
16
|
/** GuideLineItem 索引 */
|
|
13
17
|
readonly itemMap: Map<string | number, GuideLineItem>;
|
|
14
18
|
get config(): Config;
|