@realsee/dnalogel 3.49.9-alpha.0 → 3.49.10
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/index.cjs.js +194 -194
- package/dist/index.js +3720 -3714
- package/dist/index.umd.js +195 -195
- package/dist/shared-utils/tag.d.ts +4 -3
- package/dist/shared-utils/three/PointSelector/index.d.ts +1 -1
- package/libs/AreaMakerPlugin/Controller.js +1 -1
- package/libs/AreaMakerPlugin/index.js +1 -1
- package/libs/CSS3DRenderPlugin/Controller.js +20 -19
- package/libs/CSS3DRenderPlugin/index.js +6 -5
- package/libs/CSS3DRenderPlugin/utils/three/CSS3DObject.js +3 -2
- package/libs/CSS3DRenderPlugin/utils/three/CSS3DRender.js +16 -15
- package/libs/CruisePlugin/BaseController.js +5 -4
- package/libs/CruisePlugin/Move.js +1 -1
- package/libs/CruisePlugin/index.js +1 -1
- package/libs/CurrentPanoImagePlugin/Controller.js +3 -2
- package/libs/CurrentPanoImagePlugin/index.js +4 -3
- package/libs/GuideLinePlugin/GuideLineItem.js +1 -1
- package/libs/GuideLinePlugin/GuideLineModeItem.js +1 -1
- package/libs/GuideLinePlugin/index.js +1 -1
- package/libs/ModelMakerPlugin/Controller.js +9 -8
- package/libs/ModelMakerPlugin/index.js +3 -2
- package/libs/ModelMakerPlugin/item/baseItem.js +3 -2
- package/libs/ModelMakerPlugin/item/boxItem.js +3 -2
- package/libs/ModelMakerPlugin/item/polygonItem.js +8 -7
- package/libs/ModelMakerPlugin/item/prismItem.js +3 -2
- package/libs/ModelTVVideoPlugin/Plugin.js +4 -3
- package/libs/ModelTVVideoPlugin/index.js +3 -2
- package/libs/Object3DHelperPlugin/Controller.js +3 -2
- package/libs/Object3DHelperPlugin/index.js +6 -5
- package/libs/PanoCompassPlugin/Controller.js +3 -2
- package/libs/PanoCompassPlugin/index.js +4 -3
- package/libs/PanoDoorLabelPlugin/BaseController.js +8 -7
- package/libs/PanoDoorLabelPlugin/Controller.js +3 -2
- package/libs/PanoDoorLabelPlugin/index.js +4 -3
- package/libs/PanoMeasurePlugin/Components/Controller0.js +3 -2
- package/libs/PanoMeasurePlugin/Components/Controller1.js +3 -2
- package/libs/PanoMeasurePlugin/Controller/EditController.js +3 -2
- package/libs/PanoMeasurePlugin/Controller/WatchController.js +3 -2
- package/libs/PanoMeasurePlugin/Controller/index.js +3 -2
- package/libs/PanoMeasurePlugin/Model/area.js +3 -2
- package/libs/PanoMeasurePlugin/Modules/Magnifier.js +1 -0
- package/libs/PanoMeasurePlugin/Modules/UIController/index.js +12 -11
- package/libs/PanoMeasurePlugin/index.js +14 -13
- package/libs/PanoMeasurePlugin/utils/dom/areaDom.js +3 -2
- package/libs/PanoSpatialTagPlugin/Plugin.js +4 -3
- package/libs/PanoSpatialTagPlugin/index.js +1 -0
- package/libs/PanoTagPlugin/Components/Common/TagPoint.js +3 -2
- package/libs/PanoTagPlugin/Components/Tag/MarketingTag.js +3 -2
- package/libs/PanoTagPlugin/Components/Tag/index.js +3 -2
- package/libs/PanoTagPlugin/Components/TagContainer.js +3 -2
- package/libs/PanoTagPlugin/Components/TagItem.js +3 -2
- package/libs/PanoTagPlugin/controller/Tag/BaseTag.js +3 -2
- package/libs/PanoTagPlugin/controller/Tag/ModelTag.js +3 -2
- package/libs/PanoTagPlugin/controller/Tag/PlaneTag.js +3 -2
- package/libs/PanoTagPlugin/controller/Tag/PointTag.js +3 -2
- package/libs/PanoTagPlugin/controller/TagRender.js +3 -2
- package/libs/PanoTagPlugin/controller/TagUtil.js +3 -2
- package/libs/PanoTagPlugin/utils/tag/calculateTagConfig.js +10 -9
- package/libs/PanoVideoPlugin/Controller.js +3 -2
- package/libs/PanoVideoPlugin/VideoMeshController.js +3 -2
- package/libs/PanoVideoPlugin/index.js +6 -5
- package/libs/PipelinePlugin/Controller.js +3 -2
- package/libs/PipelinePlugin/index.js +4 -3
- package/libs/PipelinePlugin/utils/Objects/FlowPipe.js +3 -2
- package/libs/PipelinePlugin/utils/Objects/HighlightPipe.js +3 -2
- package/libs/PipelinePlugin/utils/Objects/Pipe.js +1 -0
- package/libs/Sculpt/Objects/Line/index.js +2 -0
- package/libs/base/BasePlugin.js +1 -1
- package/libs/floorplan/MapviewFloorplanPlugin/Controller.js +3 -2
- package/libs/floorplan/MapviewFloorplanPlugin/index.js +4 -3
- package/libs/floorplan/ModelFloorplanPlugin/Controller.js +3 -2
- package/libs/floorplan/ModelFloorplanPlugin/index.js +4 -3
- package/libs/floorplan/PanoFloorplanRadarPlugin/Controller.js +9 -8
- package/libs/floorplan/PanoFloorplanRadarPlugin/index.js +4 -3
- package/libs/floorplan/TopviewFloorplanPlugin/Controller.js +19 -18
- package/libs/floorplan/TopviewFloorplanPlugin/index.js +4 -3
- package/libs/index.js +1 -1
- package/libs/shared-utils/logger.js +1 -1
- package/libs/shared-utils/tag.d.ts +4 -3
- package/libs/shared-utils/tag.js +44 -36
- package/libs/shared-utils/three/PointSelector/index.d.ts +1 -1
- package/libs/shared-utils/three/PointSelector/index.js +12 -15
- package/package.json +1 -1
- package/README.md +0 -116
|
@@ -35,14 +35,15 @@ import "../../shared-utils/Utils/BaseUtil.js";
|
|
|
35
35
|
import "../../shared-utils/Utils/WorkUtil.js";
|
|
36
36
|
import "../../shared-utils/five/transformPosition.js";
|
|
37
37
|
import "../../shared-utils/three/temp.js";
|
|
38
|
+
import "../../shared-utils/dom/resizeObserver.js";
|
|
38
39
|
import "../../shared-utils/three/core/Sphere.js";
|
|
39
40
|
import "animejs";
|
|
40
41
|
import "../../shared-utils/url/absoluteUrl.js";
|
|
41
42
|
import "../../vendor/@tweenjs/tween/dist/tween.esm.js.js";
|
|
42
43
|
import "../utils/formatData.js";
|
|
43
44
|
import "../Assets/floorplanExtraObject.js";
|
|
44
|
-
const
|
|
45
|
+
const V = (o, r) => new t(o, r);
|
|
45
46
|
export {
|
|
46
|
-
|
|
47
|
-
|
|
47
|
+
V as PanoFloorplanRadarPlugin,
|
|
48
|
+
V as default
|
|
48
49
|
};
|
|
@@ -15,14 +15,14 @@ var f = (d, n, t) => new Promise((e, i) => {
|
|
|
15
15
|
var s = (h) => {
|
|
16
16
|
try {
|
|
17
17
|
a(t.next(h));
|
|
18
|
-
} catch (
|
|
19
|
-
i(
|
|
18
|
+
} catch (p) {
|
|
19
|
+
i(p);
|
|
20
20
|
}
|
|
21
21
|
}, r = (h) => {
|
|
22
22
|
try {
|
|
23
23
|
a(t.throw(h));
|
|
24
|
-
} catch (
|
|
25
|
-
i(
|
|
24
|
+
} catch (p) {
|
|
25
|
+
i(p);
|
|
26
26
|
}
|
|
27
27
|
}, a = (h) => h.done ? e(h.value) : Promise.resolve(h.value).then(s, r);
|
|
28
28
|
a((t = t.apply(d, n)).next());
|
|
@@ -91,9 +91,10 @@ import "../../vendor/three/build/three.module.js";
|
|
|
91
91
|
import "../../shared-utils/positionToVector3.js";
|
|
92
92
|
import "../../shared-utils/five/vector3ToScreen.js";
|
|
93
93
|
import "../../shared-utils/three/temp.js";
|
|
94
|
-
|
|
94
|
+
import "../../shared-utils/dom/resizeObserver.js";
|
|
95
|
+
class Jt extends M {
|
|
95
96
|
constructor(t, e) {
|
|
96
|
-
var h,
|
|
97
|
+
var h, p;
|
|
97
98
|
super(t);
|
|
98
99
|
// =============== public properties =================
|
|
99
100
|
o(this, "name", "topviewFloorplanPlugin");
|
|
@@ -123,8 +124,8 @@ class qt extends M {
|
|
|
123
124
|
o(this, "updateSize", () => {
|
|
124
125
|
if (!this.data || !this.container || !this.wrapper || this.five.getCurrentState().mode !== "Topview")
|
|
125
126
|
return !1;
|
|
126
|
-
const { min: t, max: e } = this.data.bounding, i = e.x - t.x, s = e.y - t.y, r = this.state.config.attachedTo ? { attachedTo: this.state.config.attachedTo } : void 0, a = D(this.five, this.wrapper, this.floorIndex, r), h = Math.ceil(i * a),
|
|
127
|
-
return this.size.width === h && this.size.height ===
|
|
127
|
+
const { min: t, max: e } = this.data.bounding, i = e.x - t.x, s = e.y - t.y, r = this.state.config.attachedTo ? { attachedTo: this.state.config.attachedTo } : void 0, a = D(this.five, this.wrapper, this.floorIndex, r), h = Math.ceil(i * a), p = Math.ceil(s * a);
|
|
128
|
+
return this.size.width === h && this.size.height === p || (this.container.style.width = h + "px", this.container.style.height = p + "px", this.size = { width: h, height: p }), !0;
|
|
128
129
|
});
|
|
129
130
|
/** 销毁插件 */
|
|
130
131
|
o(this, "dispose", () => {
|
|
@@ -189,7 +190,7 @@ class qt extends M {
|
|
|
189
190
|
imageURL: this.staticPrefix + "/release/web/saas/missing-floorplan.e274c596.png",
|
|
190
191
|
imageWidth: 200,
|
|
191
192
|
imageHeight: 120,
|
|
192
|
-
text: (
|
|
193
|
+
text: (p = (h = e.i18n) == null ? void 0 : h.call(e, "暂无平面图")) != null ? p : "暂无平面图",
|
|
193
194
|
textFontSize: 14
|
|
194
195
|
};
|
|
195
196
|
const i = {
|
|
@@ -210,23 +211,23 @@ class qt extends M {
|
|
|
210
211
|
attachedTo: _.BOUNDING_CENTER,
|
|
211
212
|
getLabelElement: void 0,
|
|
212
213
|
missingFloorConfig: l(l({}, this.defaultMissingFloorConfig), e.missingFloorConfig),
|
|
213
|
-
i18n: (
|
|
214
|
+
i18n: (c) => c,
|
|
214
215
|
adaptiveRoomLabelVisibleEnable: !0,
|
|
215
|
-
getRoomAreaText: (
|
|
216
|
-
getRoomDimensionText: (
|
|
217
|
-
getRuleDistanceText: (
|
|
216
|
+
getRoomAreaText: (c) => (c / 1e6).toFixed(1) + "㎡",
|
|
217
|
+
getRoomDimensionText: (c, w) => (c / 1e3).toFixed(1) + "m × " + (w / 1e3).toFixed(1) + "m",
|
|
218
|
+
getRuleDistanceText: (c) => c.toString()
|
|
218
219
|
}, s = e ? T(e, ["selector", "scale"]) : {}, r = l(l({}, i.missingFloorConfig), s.missingFloorConfig), a = m(l(l({}, i), s), { missingFloorConfig: r });
|
|
219
220
|
this.state = { enabled: !0, visible: !1, config: a }, this.initContainer(), t.model.loaded ? this.onFiveModelLoaded() : t.once("modelLoaded", this.onFiveModelLoaded), t.once("dispose", this.dispose), this.addEventListener();
|
|
220
221
|
}
|
|
221
222
|
load(t, e, i = !0) {
|
|
222
223
|
return f(this, null, function* () {
|
|
223
|
-
function s(
|
|
224
|
-
return Object.prototype.hasOwnProperty.apply(
|
|
224
|
+
function s(c) {
|
|
225
|
+
return Object.prototype.hasOwnProperty.apply(c, ["version"]);
|
|
225
226
|
}
|
|
226
227
|
const r = t;
|
|
227
228
|
r && k(r.version) && console.warn("传入 serverData.data 的方式后续可能不再支持,请把 serverData 整体传入 load 函数");
|
|
228
|
-
const a = JSON.parse(JSON.stringify(t)), h = s(a) ? a.data : a,
|
|
229
|
-
this.data = yield v(h), this.hooks.emit("dataLoaded", this.data), this.hooks.emit("dataChange", this.data,
|
|
229
|
+
const a = JSON.parse(JSON.stringify(t)), h = s(a) ? a.data : a, p = this.data;
|
|
230
|
+
this.data = yield v(h), this.hooks.emit("dataLoaded", this.data), this.hooks.emit("dataChange", this.data, p), e && this.updateState(e, i), this.render();
|
|
230
231
|
});
|
|
231
232
|
}
|
|
232
233
|
/** 更新户型图位置 */
|
|
@@ -364,5 +365,5 @@ class qt extends M {
|
|
|
364
365
|
}
|
|
365
366
|
}
|
|
366
367
|
export {
|
|
367
|
-
|
|
368
|
+
Jt as Controller
|
|
368
369
|
};
|
|
@@ -53,6 +53,7 @@ import "../../shared-utils/Utils/BaseUtil.js";
|
|
|
53
53
|
import "../../shared-utils/Utils/WorkUtil.js";
|
|
54
54
|
import "../../shared-utils/five/transformPosition.js";
|
|
55
55
|
import "../../shared-utils/three/temp.js";
|
|
56
|
+
import "../../shared-utils/dom/resizeObserver.js";
|
|
56
57
|
import "../../shared-utils/three/core/Sphere.js";
|
|
57
58
|
import "animejs";
|
|
58
59
|
import "../../shared-utils/url/absoluteUrl.js";
|
|
@@ -63,8 +64,8 @@ import "../../shared-utils/to.js";
|
|
|
63
64
|
import "../../shared-utils/getPxmm.js";
|
|
64
65
|
import "../../shared-utils/changeModelCanvasOpacity.js";
|
|
65
66
|
import "../../shared-utils/isNil.js";
|
|
66
|
-
const
|
|
67
|
+
const go = (o, r) => new t(o, r);
|
|
67
68
|
export {
|
|
68
|
-
|
|
69
|
-
|
|
69
|
+
go as TopviewFloorplanPlugin,
|
|
70
|
+
go as default
|
|
70
71
|
};
|
package/libs/index.js
CHANGED
|
@@ -93,6 +93,7 @@ import "./shared-utils/Subscribe.js";
|
|
|
93
93
|
import "./shared-utils/Utils/WorkUtil.js";
|
|
94
94
|
import "./shared-utils/five/transformPosition.js";
|
|
95
95
|
import "./shared-utils/three/temp.js";
|
|
96
|
+
import "./shared-utils/dom/resizeObserver.js";
|
|
96
97
|
import "./shared-utils/three/core/Sphere.js";
|
|
97
98
|
import "animejs";
|
|
98
99
|
import "./shared-utils/url/absoluteUrl.js";
|
|
@@ -300,7 +301,6 @@ import "./PanoTagPlugin/utils/debounce.js";
|
|
|
300
301
|
import "./PanoTagPlugin/utils/throttle.js";
|
|
301
302
|
import "./PanoTagPlugin/utils/tag/format.js";
|
|
302
303
|
import "./shared-utils/audio.js";
|
|
303
|
-
import "./shared-utils/dom/resizeObserver.js";
|
|
304
304
|
import "./PanoTagPlugin/controller/TagRender.js";
|
|
305
305
|
import "./PanoTagPlugin/Components/Tag/index.js";
|
|
306
306
|
import "./PanoTagPlugin/Components/Tag/TextTag/index.js";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
function A() {
|
|
2
2
|
console.debug(
|
|
3
|
-
"%c %c@realsee/dnalogel %cv3.49.
|
|
3
|
+
"%c %c@realsee/dnalogel %cv3.49.10",
|
|
4
4
|
[
|
|
5
5
|
"background: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAkAAAAMCAMAAACHgmeRAAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAABLFBMVEUAAAAapPoap/oaqvkbrfkbr/gZnfwZoPsaqfnD4v/E4/8Ylv0clPm93/+/4P/B4f8Yj/683/8Wif+33P8Uhv+x2f8ShP+s1v8Pgf+n0/8Nf/+h0f8Lff8Lff8Nf/9dl/+czv8KfP8KfP+Lxf+Uyv+Xy/+Hwv+Jw/+Mxf+Oxv+RyP8aovsapfoap/oZmfwZm/wZnvsYnPsYkf4YlP0NePsDYfgYcfi43f+63v8Xiv8Xjf4EWfwCV/sWZ/qz2v+02/8Vh/8WiP8EUf8CTf4WXv2u1/+v2P8Thf8Thv8ETf8CR/8VV/+o1f+q1f8Qgv8Rg/8DSv8BRf8UVP+j0v+k0v8OgP8Pgf8DR/8DQv9Nhf+dzv+fz/+Kv/+Vyv+Xy/+azf+Oxv+Qx/+SyP////8MUhLdAAAAK3RSTlMACEWQ2bd98uQECPXxqO7c+Pb49vj2+Pb49vj23Oul8fMHA+TwerXXjEIG2P+bHgAAAAFiS0dEY1y+LaoAAAB+SURBVAjXY2BgZGJmYWVgYGBgY9fW0eVg4ORi4NbTNzDk4eXjZxAwMjYxNTO3EGQQsrSytrG1sxdmEHFwdHJ2cXUTZRBz9/D08vbxFWeQ8PMPCAwKDpFkkAoNC4+IjIqWZpCRlZOPiY2LV2BQVGJQTkhMUlEFWaOmrqGpxQAAyg0S9Dq+VPYAAAAASUVORK5CYII=')",
|
|
6
6
|
"background-repeat: no-repeat",
|
|
@@ -3,9 +3,9 @@ import { type AnyPosition } from './positionToVector3';
|
|
|
3
3
|
import * as THREE from 'three';
|
|
4
4
|
export declare class LightTag {
|
|
5
5
|
container: HTMLDivElement;
|
|
6
|
-
wrapper: HTMLElement;
|
|
7
6
|
visible: boolean;
|
|
8
7
|
enabled: boolean;
|
|
8
|
+
wrapper: HTMLElement;
|
|
9
9
|
positionsForRotate?: THREE.Vector3[];
|
|
10
10
|
/**
|
|
11
11
|
* @description 碰撞检测
|
|
@@ -17,16 +17,16 @@ export declare class LightTag {
|
|
|
17
17
|
* @default true
|
|
18
18
|
*/
|
|
19
19
|
simulate3D: boolean;
|
|
20
|
-
tagWrapper
|
|
20
|
+
private tagWrapper;
|
|
21
21
|
private five;
|
|
22
22
|
private originPosition?;
|
|
23
23
|
private transformedPosition?;
|
|
24
24
|
private disposer;
|
|
25
25
|
private config;
|
|
26
26
|
private fiveUtil;
|
|
27
|
+
private disposers;
|
|
27
28
|
constructor(five: Five, position?: AnyPosition, config?: {
|
|
28
29
|
wrapper?: HTMLElement;
|
|
29
|
-
tagWrapper?: HTMLElement;
|
|
30
30
|
positionsForRotate?: AnyPosition[];
|
|
31
31
|
});
|
|
32
32
|
show(): void;
|
|
@@ -39,6 +39,7 @@ export declare class LightTag {
|
|
|
39
39
|
updateScreenPosition(): void;
|
|
40
40
|
private onCameraUpdate;
|
|
41
41
|
private onFiveEveryReady;
|
|
42
|
+
private addResizeListener;
|
|
42
43
|
}
|
|
43
44
|
export declare function tag(five: Five, position: AnyPosition, config?: {
|
|
44
45
|
wrapper?: HTMLElement;
|
package/libs/shared-utils/tag.js
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var s = (h, t, e) => (
|
|
1
|
+
var P = Object.defineProperty;
|
|
2
|
+
var g = (h, t, e) => t in h ? P(h, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : h[t] = e;
|
|
3
|
+
var s = (h, t, e) => (g(h, typeof t != "symbol" ? t + "" : t, e), e);
|
|
4
4
|
import { anyPositionToVector3 as d } from "./positionToVector3.js";
|
|
5
|
-
import * as
|
|
6
|
-
import { vector3ToScreen as
|
|
7
|
-
import { getFiveModel as
|
|
5
|
+
import * as b from "three";
|
|
6
|
+
import { vector3ToScreen as l } from "./five/vector3ToScreen.js";
|
|
7
|
+
import { getFiveModel as U } from "./five/getFiveModel.js";
|
|
8
8
|
import { FiveUtil as x } from "./Utils/FiveUtil.js";
|
|
9
9
|
import { _raycaster as m } from "./three/temp.js";
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
10
|
+
import { resizeObserver as E } from "./dom/resizeObserver.js";
|
|
11
|
+
const v = "LightTagContainer_shgjakdhwakjdhsja", w = new b.Vector2();
|
|
12
|
+
class R {
|
|
13
|
+
constructor(t, e, o) {
|
|
14
14
|
s(this, "container");
|
|
15
|
-
s(this, "wrapper");
|
|
16
15
|
s(this, "visible", !1);
|
|
17
16
|
s(this, "enabled", !1);
|
|
17
|
+
s(this, "wrapper");
|
|
18
18
|
s(this, "positionsForRotate");
|
|
19
19
|
/**
|
|
20
20
|
* @description 碰撞检测
|
|
@@ -33,6 +33,7 @@ class w {
|
|
|
33
33
|
s(this, "disposer");
|
|
34
34
|
s(this, "config");
|
|
35
35
|
s(this, "fiveUtil");
|
|
36
|
+
s(this, "disposers", []);
|
|
36
37
|
s(this, "onCameraUpdate", () => {
|
|
37
38
|
this.visible !== !1 && this.updateScreenPosition();
|
|
38
39
|
});
|
|
@@ -41,15 +42,15 @@ class w {
|
|
|
41
42
|
if (this.intersectCheck && this.visible && this.five.state.mode !== "Panorama") {
|
|
42
43
|
let e = 0.01;
|
|
43
44
|
this.fiveUtil.workUtil.fromType === "poincare" && (e = 0.05), m.set(this.five.camera.position, this.transformedPosition.clone().sub(this.five.camera.position));
|
|
44
|
-
const
|
|
45
|
-
(
|
|
45
|
+
const o = (t = U(this.five).intersectRaycaster(m)) == null ? void 0 : t[0];
|
|
46
|
+
(o == null ? void 0 : o.distance) + e > this.transformedPosition.distanceTo(this.five.camera.position) ? (this.container.style.opacity = "1", this.container.style.pointerEvents = "auto") : (this.container.style.opacity = "0", this.container.style.pointerEvents = "none");
|
|
46
47
|
}
|
|
47
48
|
});
|
|
48
|
-
var n,
|
|
49
|
-
this.five = t, this.
|
|
50
|
-
const
|
|
51
|
-
return
|
|
52
|
-
})(), this.config =
|
|
49
|
+
var n, r, a;
|
|
50
|
+
this.five = t, this.fiveUtil = (n = t.__fiveUtil__) != null ? n : t.__fiveUtil__ = new x(t), this.originPosition = e ? d(e).clone() : void 0, this.transformedPosition = (r = this.originPosition) == null ? void 0 : r.clone(), this.positionsForRotate = (a = o == null ? void 0 : o.positionsForRotate) == null ? void 0 : a.map((i) => d(i).clone()), this.container = (() => {
|
|
51
|
+
const i = document.createElement("div");
|
|
52
|
+
return i.style.width = "0", i.style.height = "0", i.style.position = "absolute", i.style.transition = "opacity 0.2s linear", i;
|
|
53
|
+
})(), this.config = o != null ? o : {}, this.enable(), this.show(), this.addResizeListener();
|
|
53
54
|
}
|
|
54
55
|
show() {
|
|
55
56
|
this.visible = !0, this.container.style.opacity = "1", this.container.style.pointerEvents = "auto", this.onCameraUpdate();
|
|
@@ -58,12 +59,12 @@ class w {
|
|
|
58
59
|
this.visible = !1, this.container.style.opacity = "0", this.container.style.pointerEvents = "none";
|
|
59
60
|
}
|
|
60
61
|
enable() {
|
|
61
|
-
var
|
|
62
|
+
var o, n, r, a;
|
|
62
63
|
if (this.enabled)
|
|
63
64
|
return;
|
|
64
|
-
this.enabled = !0, this.wrapper = (
|
|
65
|
-
const
|
|
66
|
-
return
|
|
65
|
+
this.enabled = !0, this.wrapper = (r = (n = this.config.wrapper) != null ? n : (o = this.five.getElement()) == null ? void 0 : o.parentElement) != null ? r : document.body, this.tagWrapper || (this.tagWrapper = (a = document.getElementById(v)) != null ? a : (() => {
|
|
66
|
+
const i = document.createElement("div");
|
|
67
|
+
return i.id = v, i.style.position = "absolute", i.style.top = "0", i.style.left = "0", i.style.width = "100%", i.style.height = "100%", i.style.pointerEvents = "none", i.style.zIndex = "1", i;
|
|
67
68
|
})(), this.wrapper.contains(this.tagWrapper) || this.wrapper.appendChild(this.tagWrapper)), this.tagWrapper.appendChild(this.container);
|
|
68
69
|
let t = !1;
|
|
69
70
|
const e = () => {
|
|
@@ -80,7 +81,7 @@ class w {
|
|
|
80
81
|
this.enabled && (this.enabled = !1, this.tagWrapper.removeChild(this.container), (t = this.disposer) == null || t.call(this));
|
|
81
82
|
}
|
|
82
83
|
destroy() {
|
|
83
|
-
this.disable(), this.container.remove();
|
|
84
|
+
this.disable(), this.container.remove(), this.disposers.forEach((t) => t());
|
|
84
85
|
}
|
|
85
86
|
setTransformMatrix(t) {
|
|
86
87
|
var e;
|
|
@@ -94,32 +95,39 @@ class w {
|
|
|
94
95
|
this.container.style.left = "-100%", this.container.style.top = "-100%";
|
|
95
96
|
return;
|
|
96
97
|
}
|
|
97
|
-
const t = this.five.renderer.getSize(
|
|
98
|
+
const t = this.five.renderer.getSize(w), e = l(this.five.camera, this.transformedPosition, t);
|
|
98
99
|
if (!e) {
|
|
99
100
|
this.container.style.left = "-100%", this.container.style.top = "-100%";
|
|
100
101
|
return;
|
|
101
102
|
}
|
|
102
|
-
const
|
|
103
|
+
const o = (() => {
|
|
103
104
|
if (!this.simulate3D)
|
|
104
105
|
return 1;
|
|
105
|
-
const
|
|
106
|
-
return Math.max(Math.min(1 -
|
|
106
|
+
const r = 2 * Math.tan(0.5 * this.five.camera.fov / 180 * Math.PI), a = this.transformedPosition.distanceTo(this.five.camera.position);
|
|
107
|
+
return Math.max(Math.min(1 - r * a / 40, 1), 0.5);
|
|
107
108
|
})(), n = (() => {
|
|
108
109
|
if (this.positionsForRotate === void 0 || this.positionsForRotate.length !== 2)
|
|
109
110
|
return 0;
|
|
110
|
-
const [
|
|
111
|
-
if (!
|
|
111
|
+
const [r, a] = this.positionsForRotate, i = l(this.five.camera, r, t), c = l(this.five.camera, a, t);
|
|
112
|
+
if (!i || !c)
|
|
112
113
|
return 0;
|
|
113
|
-
const
|
|
114
|
-
return Math.atan2(
|
|
114
|
+
const p = i.leftPx > c.leftPx ? c : i, f = i.leftPx > c.leftPx ? i : c, y = f.leftPx - p.leftPx, u = f.topPx - p.topPx;
|
|
115
|
+
return Math.atan2(u, y) * (180 / Math.PI);
|
|
115
116
|
})();
|
|
116
|
-
this.container.style.left = e.leftPx + "px", this.container.style.top = e.topPx + "px", this.container.style.transformOrigin = "center", this.container.style.transform = `scale(${
|
|
117
|
+
this.container.style.left = e.leftPx + "px", this.container.style.top = e.topPx + "px", this.container.style.transformOrigin = "center", this.container.style.transform = `scale(${o})`, n && (this.container.style.transform += ` rotate(${n}deg)`);
|
|
118
|
+
}
|
|
119
|
+
addResizeListener() {
|
|
120
|
+
const t = this.five.getElement();
|
|
121
|
+
if (t) {
|
|
122
|
+
const { observe: e, unobserve: o } = E(this.onCameraUpdate, t);
|
|
123
|
+
e(), this.disposers.push(o);
|
|
124
|
+
}
|
|
117
125
|
}
|
|
118
126
|
}
|
|
119
|
-
function
|
|
120
|
-
return new
|
|
127
|
+
function z(h, t, e) {
|
|
128
|
+
return new R(h, t, e);
|
|
121
129
|
}
|
|
122
130
|
export {
|
|
123
|
-
|
|
124
|
-
|
|
131
|
+
R as LightTag,
|
|
132
|
+
z as tag
|
|
125
133
|
};
|
|
@@ -16,11 +16,11 @@ import { isTouchDevice as v } from "../../isTouchDevice.js";
|
|
|
16
16
|
import M from "hammerjs";
|
|
17
17
|
import * as d from "three";
|
|
18
18
|
import { Subscribe as N } from "../../Subscribe.js";
|
|
19
|
-
import { getIntersectByRaycaster as F, getVirtualIntersectByRaycaster as
|
|
20
|
-
import { getRaycasterByNdcPosition as
|
|
19
|
+
import { getIntersectByRaycaster as F, getVirtualIntersectByRaycaster as L } from "../../five/getPosition.js";
|
|
20
|
+
import { getRaycasterByNdcPosition as U } from "../../five/getRaycasterByNdcPosition.js";
|
|
21
21
|
import { CURSOR_NOT_ALLOW_URL as P } from "./utils/contents.js";
|
|
22
|
-
const
|
|
23
|
-
class
|
|
22
|
+
const C = new d.Vector3(), u = () => !1;
|
|
23
|
+
class k extends N {
|
|
24
24
|
constructor(e, t) {
|
|
25
25
|
var a, o, c;
|
|
26
26
|
super();
|
|
@@ -73,11 +73,8 @@ class G extends N {
|
|
|
73
73
|
i(this, "onLeave", () => {
|
|
74
74
|
this.pointSelectorHelper.hide(), this.outOfFive = !0, this.emit("intersectionUpdate", null);
|
|
75
75
|
});
|
|
76
|
-
i(this, "
|
|
77
|
-
|
|
78
|
-
clientX: e.center.x,
|
|
79
|
-
clientY: e.center.y
|
|
80
|
-
}), this.select();
|
|
76
|
+
i(this, "onClick", () => {
|
|
77
|
+
this.select();
|
|
81
78
|
});
|
|
82
79
|
/**
|
|
83
80
|
* 1. 如果之前没有长按行为「即没有长按点时」-> 滑动全景
|
|
@@ -117,11 +114,11 @@ class G extends N {
|
|
|
117
114
|
*/
|
|
118
115
|
i(this, "updateByNdcPosition", (e) => {
|
|
119
116
|
var h, a;
|
|
120
|
-
const t =
|
|
117
|
+
const t = U(this.five, e), r = F(this.five, t);
|
|
121
118
|
if (r)
|
|
122
119
|
return this.updatePointSelectorHelperIntersect(r), this.lastIntersection = r, !0;
|
|
123
120
|
if (this.plane) {
|
|
124
|
-
const o = t.ray.intersectPlane(this.plane,
|
|
121
|
+
const o = t.ray.intersectPlane(this.plane, C);
|
|
125
122
|
if (o) {
|
|
126
123
|
const c = {
|
|
127
124
|
distance: this.five.camera.position.distanceTo(o),
|
|
@@ -137,7 +134,7 @@ class G extends N {
|
|
|
137
134
|
if (this.actionIfNoModelUnderMouse === "lastPoint")
|
|
138
135
|
return this.updatePointSelectorHelperIntersect(this.lastIntersection), !0;
|
|
139
136
|
if (this.actionIfNoModelUnderMouse === "virtualPoint") {
|
|
140
|
-
const o =
|
|
137
|
+
const o = L(t, (h = this.lastIntersection) == null ? void 0 : h.distance);
|
|
141
138
|
return o.face = new d.Face3(0, 0, 0, (a = this.lastIntersection) == null ? void 0 : a.face.normal), o.isVirtual = !0, this.lastIntersection = o, this.updatePointSelectorHelperIntersect(o), !0;
|
|
142
139
|
} else if (this.actionIfNoModelUnderMouse === "disable")
|
|
143
140
|
return this.updatePointSelectorHelperIntersect(null), !1;
|
|
@@ -227,14 +224,14 @@ class G extends N {
|
|
|
227
224
|
const e = this.five.getElement();
|
|
228
225
|
if (!e)
|
|
229
226
|
throw new Error("five element not found");
|
|
230
|
-
this.hammer || (this.hammer = new M(e)), this.mode === "cursor" ? (this.five.on("wantsMoveToPano", u), this.five.on("wantsChangeMode", u), this.five.on("wantsTapGesture", u), e.addEventListener("mousemove", this.updateByMousePosition), v || e.addEventListener("wheel", this.onMouseWheel), e.addEventListener("
|
|
227
|
+
this.hammer || (this.hammer = new M(e)), this.mode === "cursor" ? (this.five.on("wantsMoveToPano", u), this.five.on("wantsChangeMode", u), this.five.on("wantsTapGesture", u), e.addEventListener("mousemove", this.updateByMousePosition), v || e.addEventListener("wheel", this.onMouseWheel), e.addEventListener("click", this.onClick), e.addEventListener("mouseenter", this.onEnter), e.addEventListener("mouseout", this.onLeave), this.five.on("wantsPanGesture", this.onFiveWantsPanGesture), this.hammer.on("pan", this.onPan), this.hammer.on("press", this.onPress), this.hammer.on("panend", this.onPanEnd)) : this.mode === "fixed" && (this.five.on("panoArrived", this.renderScreenCenter), this.five.on("panGesture", this.renderScreenCenter), this.five.on("interiaPan", this.renderScreenCenter), this.renderScreenCenter(), this.pointSelectorHelper.show()), this.pointSelectorHelper.hooks.on("intersectionUpdate", this.emitIntersectionUpdate), this.lastFiveHelperVisible = this.five.helperVisible, this.five.helperVisible = !1, this.emit("enable");
|
|
231
228
|
}
|
|
232
229
|
disable() {
|
|
233
230
|
if (!this.enabled)
|
|
234
231
|
return;
|
|
235
232
|
this.enabled = !1, this.pointSelectorHelper.disable(), this.five.getElement().style.cursor = "";
|
|
236
233
|
const e = this.five.getElement();
|
|
237
|
-
this.five.off("wantsPanGesture", this.onFiveWantsPanGesture), this.five.off("wantsMoveToPano", u), this.five.off("wantsChangeMode", u), this.five.off("wantsTapGesture", u), this.five.helperVisible = this.lastFiveHelperVisible, e == null || e.removeEventListener("mousemove", this.updateByMousePosition), e == null || e.removeEventListener("wheel", this.onMouseWheel), e == null || e.removeEventListener("mouseenter", this.onEnter), e == null || e.removeEventListener("mouseout", this.onLeave),
|
|
234
|
+
this.five.off("wantsPanGesture", this.onFiveWantsPanGesture), this.five.off("wantsMoveToPano", u), this.five.off("wantsChangeMode", u), this.five.off("wantsTapGesture", u), this.five.helperVisible = this.lastFiveHelperVisible, e == null || e.removeEventListener("mousemove", this.updateByMousePosition), e == null || e.removeEventListener("wheel", this.onMouseWheel), e == null || e.removeEventListener("mouseenter", this.onEnter), e == null || e.removeEventListener("mouseout", this.onLeave), e == null || e.removeEventListener("click", this.onClick), this.hammer.off("pan", this.onPan), this.hammer.off("press", this.onPress), this.hammer.off("panend", this.onPanEnd), this.five.off("panoArrived", this.renderScreenCenter), this.five.off("panGesture", this.renderScreenCenter), this.five.off("interiaPan", this.renderScreenCenter), this.pointSelectorHelper.hooks.off("intersectionUpdate", this.emitIntersectionUpdate), this.emit("disable");
|
|
238
235
|
}
|
|
239
236
|
dispose() {
|
|
240
237
|
this.disable(), this.pointSelectorHelper.dispose();
|
|
@@ -244,5 +241,5 @@ class G extends N {
|
|
|
244
241
|
}
|
|
245
242
|
}
|
|
246
243
|
export {
|
|
247
|
-
|
|
244
|
+
k as PointSelector
|
|
248
245
|
};
|
package/package.json
CHANGED
package/README.md
DELETED
|
@@ -1,116 +0,0 @@
|
|
|
1
|
-
<p align="center">
|
|
2
|
-
<a href="https://realsee.js.org/"><img src="https://vrlab-public.ljcdn.com/common/file/web/ea031fa5-ad82-46b3-86c8-7b20ec1e635a.jpg" width="60" /></a>
|
|
3
|
-
</p>
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
<p align="center">
|
|
7
|
-
<a href="https://www.npmjs.com/package/@realsee/dnalogel">
|
|
8
|
-
<img src="https://img.shields.io/npm/v/@realsee/dnalogel.svg" alt="npm version" >
|
|
9
|
-
</a>
|
|
10
|
-
<a href="https://packagephobia.now.sh/result?p=@realsee/dnalogel">
|
|
11
|
-
<img src="https://packagephobia.now.sh/badge?p=@realsee/dnalogel" alt="install size" >
|
|
12
|
-
</a>
|
|
13
|
-
<a href="https://github.com/realsee-developer/dnalogel/blob/main/TERMS.txt">
|
|
14
|
-
<img src="https://img.shields.io/npm/l/@realsee/dnalogel.svg" alt="license">
|
|
15
|
-
</a>
|
|
16
|
-
</p>
|
|
17
|
-
|
|
18
|
-
<h1 align="center">@realsee/dnalogel</h1>
|
|
19
|
-
|
|
20
|
-
# 👀 Overview
|
|
21
|
-
|
|
22
|
-
@realsee/dnalogel 将 [如视(realsee.com)](https://realsee.com) **VR 空间交互** 常用能力沉淀,并以 `Five Plugins` 形式进行抽象。
|
|
23
|
-
结合[如视三维空间重建渲染引擎 Five](https://open-platform.realsee.com/developer/docs/five/intro/)
|
|
24
|
-
与 [如视开放 API](https://open-platform.realsee.com/developer/openapi/?id=1001) ,可以制作出丰富多彩的三维空间应用。不论是经过线上环境千锤百炼的刚需功能,还是灵感一现的炫酷尝试,所有已经落地的功能我们均毫无保留的开源至github [realsee-developer/dnalogel](https://github.com/realsee-developer/dnalogel) 。
|
|
25
|
-
|
|
26
|
-
# 🔨 Usage
|
|
27
|
-
|
|
28
|
-
**1、安装**
|
|
29
|
-
|
|
30
|
-
```bash
|
|
31
|
-
npm install @realsee/dnalogel
|
|
32
|
-
```
|
|
33
|
-
|
|
34
|
-
```bash
|
|
35
|
-
yarn add @realsee/dnalogel
|
|
36
|
-
```
|
|
37
|
-
|
|
38
|
-
**2、插件注册**
|
|
39
|
-
|
|
40
|
-
```js
|
|
41
|
-
import { Five } from '@realsee/five'
|
|
42
|
-
import { Plugin } from '@realsee/dnalogel'
|
|
43
|
-
const five = new Five({
|
|
44
|
-
plugins: [[Plugin, 'PluginName', initOptions]],
|
|
45
|
-
})
|
|
46
|
-
```
|
|
47
|
-
|
|
48
|
-
**3、插件方法使用**
|
|
49
|
-
|
|
50
|
-
```js
|
|
51
|
-
// 不同插件提供的方法可能存在差异,请参考各插件 API 文档
|
|
52
|
-
five.plugins.PluginName.load(data)
|
|
53
|
-
five.plugins.PluginName.enable()
|
|
54
|
-
five.plugins.PluginName.disable()
|
|
55
|
-
five.plugins.PluginName.dispose()
|
|
56
|
-
```
|
|
57
|
-
|
|
58
|
-
**4、插件依赖数据获取**
|
|
59
|
-
|
|
60
|
-
您可以通过 [open API](https://open-platform.realsee.com/developer/open/api#/) 查看数据获取方式及相关 open API 。
|
|
61
|
-
|
|
62
|
-
# 📖 Documents
|
|
63
|
-
|
|
64
|
-
- [说明文档](https://open-platform.realsee.com/developer/docs/dnalogel/intro/)
|
|
65
|
-
- [API 文档](https://open-platform.realsee.com/developer/openapi/?id=1001)
|
|
66
|
-
- [demo 源码](https://github.com/realsee-developer/dnalogel)
|
|
67
|
-
- [数据依赖来源:open API](https://open-platform.realsee.com/developer/openapi/?id=1001)
|
|
68
|
-
|
|
69
|
-
# 💡 Preview
|
|
70
|
-
|
|
71
|
-
我们为每个插件书写了简单的效果示例,您可点击预览:
|
|
72
|
-
[@realsee/dnalogel showcase](https://realsee-developer.github.io/dnalogel/)
|
|
73
|
-
|
|
74
|
-
# 🧾 Lists
|
|
75
|
-
|
|
76
|
-
- 🔌 ModelViewPlugin:模型小窗插件
|
|
77
|
-
- 🔌 PanoFloorplanRadarPlugin:全景户型雷达图插件
|
|
78
|
-
- 🔌 ModelRoomLabelPlugin:模型态房屋标签插件
|
|
79
|
-
- 🔌 TopviewFloorplanPlugin:俯视模型户型图插件
|
|
80
|
-
- 🔌 ModelChassisCompassPlugin:模型底盘指南针插件
|
|
81
|
-
- 🔌 ModelEntryDoorGuidePlugin:模型入户门引导插件
|
|
82
|
-
- 🔌 CSS3DRenderPlugin:CSS3D渲染插件
|
|
83
|
-
- 🔌 CameraMovementPlugin:相机运镜插件
|
|
84
|
-
- 🔌 ModelFloorplanPlugin:模型户型图插件
|
|
85
|
-
- 🔌 PanoRulerPlugin:全景标尺插件
|
|
86
|
-
- 🔌 PanoCompassPlugin:全景指南针插件
|
|
87
|
-
- 其他插件持续更新中...
|
|
88
|
-
|
|
89
|
-
# 可能遇到的问题
|
|
90
|
-
|
|
91
|
-
1. webpack打包出现以下错误
|
|
92
|
-
|
|
93
|
-
```bash
|
|
94
|
-
Module not found: Error: Can't resolve '@realsee/five/line' in 'xxx/node_modules/@realsee/dnalogel/libs'
|
|
95
|
-
Did you mean 'index.js'?
|
|
96
|
-
BREAKING CHANGE: The request '@realsee/five/line' failed to resolve only because it was resolved as fully specified
|
|
97
|
-
(probably because the origin is strict EcmaScript Module, e. g. a module with javascript mimetype, a '*.mjs' file, or a '*.js' file where the package.json contains '"type": "module"').
|
|
98
|
-
The extension in the request is mandatory for it to be fully specified.
|
|
99
|
-
Add the extension to the request.
|
|
100
|
-
```
|
|
101
|
-
|
|
102
|
-
解决方案:在webpack配置里加以下rule
|
|
103
|
-
参考:[resolvefullyspecified](https://webpack.js.org/configuration/module/#resolvefullyspecified)
|
|
104
|
-
|
|
105
|
-
```js
|
|
106
|
-
{
|
|
107
|
-
test: /\.m?js$/,
|
|
108
|
-
resolve: {
|
|
109
|
-
fullySpecified: false, // disable the behaviour
|
|
110
|
-
},
|
|
111
|
-
},
|
|
112
|
-
```
|
|
113
|
-
|
|
114
|
-
# License
|
|
115
|
-
|
|
116
|
-
[TERMS](https://github.com/realsee-developer/dnalogel/blob/main/TERMS.txt)
|