@realsee/dnalogel 3.50.17-alpha.0 → 3.51.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/CHANGELOG.md +3 -0
- package/dist/ModelMakerPlugin/Controller.d.ts +2 -0
- package/dist/Sculpt/utils/export.d.ts +18 -0
- package/dist/index.cjs.js +207 -207
- package/dist/index.js +34866 -34775
- package/dist/index.umd.js +211 -211
- package/dist/shared-utils/five/fiveEveryReadyListener.d.ts +2 -0
- package/dist/shared-utils/index.d.ts +1 -0
- package/dist/shared-utils/tag.d.ts +40 -1
- package/dist/shared-utils/three/temp.d.ts +2 -2
- package/libs/AreaMakerPlugin/Controller.js +100 -46
- package/libs/AreaMakerPlugin/index.js +64 -10
- package/libs/AreaMakerPlugin/utils/Item.js +156 -100
- package/libs/CSS3DRenderPlugin/Controller.js +93 -44
- package/libs/CSS3DRenderPlugin/index.js +62 -13
- package/libs/CSS3DRenderPlugin/utils/three/CSS3DObject.js +105 -49
- package/libs/CSS3DRenderPlugin/utils/three/CSS3DRender.js +130 -77
- package/libs/CruisePlugin/BaseController.js +143 -89
- package/libs/CruisePlugin/Move.js +83 -39
- package/libs/CruisePlugin/Work.js +95 -51
- package/libs/CruisePlugin/index.js +66 -22
- package/libs/CurrentPanoImagePlugin/Controller.js +139 -85
- package/libs/CurrentPanoImagePlugin/index.js +63 -9
- package/libs/GuideLinePlugin/Controller.js +57 -13
- package/libs/GuideLinePlugin/GuideLineItem.js +63 -19
- package/libs/GuideLinePlugin/GuideLineModeItem/index.js +6 -2
- package/libs/GuideLinePlugin/GuideLineModeItem.js +58 -14
- package/libs/GuideLinePlugin/index.js +66 -22
- package/libs/ModelMakerPlugin/Controller.d.ts +2 -0
- package/libs/ModelMakerPlugin/Controller.js +190 -129
- package/libs/ModelMakerPlugin/index.js +63 -21
- package/libs/ModelMakerPlugin/item/baseItem.js +4 -2
- package/libs/ModelMakerPlugin/item/boxItem.js +5 -3
- package/libs/ModelMakerPlugin/item/polygonItem.js +9 -7
- package/libs/ModelMakerPlugin/item/prismItem.js +5 -3
- package/libs/ModelTVVideoPlugin/Plugin.js +96 -47
- package/libs/ModelTVVideoPlugin/index.js +55 -6
- package/libs/Object3DHelperPlugin/Controller.js +42 -25
- package/libs/Object3DHelperPlugin/index.js +28 -12
- package/libs/PanoCompassPlugin/Controller.js +92 -44
- package/libs/PanoCompassPlugin/index.js +63 -15
- package/libs/PanoDoorLabelPlugin/BaseController.js +79 -25
- package/libs/PanoDoorLabelPlugin/Controller.js +132 -78
- package/libs/PanoDoorLabelPlugin/index.js +63 -9
- package/libs/PanoMeasurePlugin/Components/Controller0.js +126 -77
- package/libs/PanoMeasurePlugin/Components/Controller1.js +139 -90
- package/libs/PanoMeasurePlugin/Controller/EditController.js +120 -71
- package/libs/PanoMeasurePlugin/Controller/WatchController.js +120 -70
- package/libs/PanoMeasurePlugin/Controller/index.js +132 -86
- package/libs/PanoMeasurePlugin/Model/area.js +72 -22
- package/libs/PanoMeasurePlugin/Modules/Magnifier.js +56 -0
- package/libs/PanoMeasurePlugin/Modules/UIController/index.js +64 -15
- package/libs/PanoMeasurePlugin/index.js +62 -16
- package/libs/PanoMeasurePlugin/utils/dom/areaDom.js +57 -2
- package/libs/PanoRulerProPlugin/Controller.js +88 -33
- package/libs/PanoRulerProPlugin/RulerItems.js +146 -91
- package/libs/PanoRulerProPlugin/index.js +64 -9
- package/libs/PanoSpatialTagPlugin/Plugin.js +177 -128
- package/libs/PanoSpatialTagPlugin/index.js +53 -4
- package/libs/PanoTagPlugin/Components/Common/TagPoint.js +116 -60
- package/libs/PanoTagPlugin/Components/Tag/MarketingTag.js +192 -136
- package/libs/PanoTagPlugin/Components/Tag/index.js +194 -139
- package/libs/PanoTagPlugin/Components/TagContainer.js +112 -57
- package/libs/PanoTagPlugin/Components/TagItem.js +204 -149
- package/libs/PanoTagPlugin/controller/Tag/BaseTag.js +157 -101
- package/libs/PanoTagPlugin/controller/Tag/ModelTag.js +75 -20
- package/libs/PanoTagPlugin/controller/Tag/PlaneTag.js +86 -31
- package/libs/PanoTagPlugin/controller/Tag/PointTag.js +93 -37
- package/libs/PanoTagPlugin/controller/TagRender.js +62 -18
- package/libs/PanoTagPlugin/controller/TagUtil.js +123 -79
- package/libs/PanoTagPlugin/controller/index.js +110 -72
- package/libs/PanoTagPlugin/index.js +72 -28
- package/libs/PanoTagPlugin/utils/tag/calculateTagConfig.js +77 -21
- package/libs/PanoVideoPlugin/Controller.js +95 -41
- package/libs/PanoVideoPlugin/VideoMeshController.js +119 -63
- package/libs/PanoVideoPlugin/index.js +66 -12
- package/libs/PipelinePlugin/Controller.js +173 -119
- package/libs/PipelinePlugin/index.js +63 -9
- package/libs/PipelinePlugin/utils/Objects/FlowPipe.js +70 -14
- package/libs/PipelinePlugin/utils/Objects/HighlightPipe.js +58 -2
- package/libs/PipelinePlugin/utils/Objects/Pipe.js +98 -42
- package/libs/Sculpt/Meshes/Box.js +3 -2
- package/libs/Sculpt/Meshes/Cylinder.js +10 -6
- package/libs/Sculpt/Meshes/Line.js +43 -38
- package/libs/Sculpt/Meshes/LineWithDots.js +14 -10
- package/libs/Sculpt/Meshes/Point.js +24 -20
- package/libs/Sculpt/Meshes/Polygon.js +5 -2
- package/libs/Sculpt/Meshes/Prism.js +19 -16
- package/libs/Sculpt/Objects/Line/Editor.js +6 -5
- package/libs/Sculpt/index.js +15 -14
- package/libs/Sculpt/utils/export.d.ts +18 -0
- package/libs/Sculpt/utils/export.js +21 -0
- package/libs/Sculpt/utils/three/ColoredMesh.js +26 -22
- package/libs/base/BasePlugin.js +14 -10
- package/libs/floorplan/MapviewFloorplanPlugin/Controller.js +146 -94
- package/libs/floorplan/MapviewFloorplanPlugin/index.js +62 -10
- package/libs/floorplan/ModelFloorplanPlugin/Controller.js +109 -56
- package/libs/floorplan/ModelFloorplanPlugin/index.js +62 -9
- package/libs/floorplan/PanoFloorplanRadarPlugin/Controller.js +116 -63
- package/libs/floorplan/PanoFloorplanRadarPlugin/index.js +62 -9
- package/libs/floorplan/TopviewFloorplanPlugin/Controller.js +105 -52
- package/libs/floorplan/TopviewFloorplanPlugin/index.js +62 -9
- package/libs/floorplan/index.js +4 -0
- package/libs/index.js +208 -206
- package/libs/shared-utils/five/fiveEveryReadyListener.d.ts +2 -0
- package/libs/shared-utils/five/fiveEveryReadyListener.js +15 -0
- package/libs/shared-utils/five/index.js +6 -2
- package/libs/shared-utils/five/lookObject.js +31 -27
- package/libs/shared-utils/index.d.ts +1 -0
- package/libs/shared-utils/index.js +19 -17
- package/libs/shared-utils/logger.js +1 -1
- package/libs/shared-utils/tag.d.ts +40 -1
- package/libs/shared-utils/tag.js +139 -86
- package/libs/shared-utils/three/index.js +4 -0
- package/libs/shared-utils/three/temp.d.ts +2 -2
- package/libs/shared-utils/three/temp.js +4 -4
- package/package.json +1 -1
- package/README.md +0 -116
|
@@ -9,23 +9,23 @@ var V = (o, e, t) => e in o ? B(o, e, { enumerable: !0, configurable: !0, writab
|
|
|
9
9
|
H.call(e, t) && V(o, t, e[t]);
|
|
10
10
|
return o;
|
|
11
11
|
};
|
|
12
|
-
var g = (o, e, t) => new Promise((
|
|
13
|
-
var u = (
|
|
12
|
+
var g = (o, e, t) => new Promise((n, l) => {
|
|
13
|
+
var u = (r) => {
|
|
14
14
|
try {
|
|
15
|
-
|
|
16
|
-
} catch (
|
|
17
|
-
|
|
15
|
+
m(t.next(r));
|
|
16
|
+
} catch (p) {
|
|
17
|
+
l(p);
|
|
18
18
|
}
|
|
19
|
-
}, s = (
|
|
19
|
+
}, s = (r) => {
|
|
20
20
|
try {
|
|
21
|
-
|
|
22
|
-
} catch (
|
|
23
|
-
|
|
21
|
+
m(t.throw(r));
|
|
22
|
+
} catch (p) {
|
|
23
|
+
l(p);
|
|
24
24
|
}
|
|
25
|
-
},
|
|
26
|
-
|
|
25
|
+
}, m = (r) => r.done ? n(r.value) : Promise.resolve(r.value).then(u, s);
|
|
26
|
+
m((t = t.apply(o, e)).next());
|
|
27
27
|
});
|
|
28
|
-
import * as
|
|
28
|
+
import * as a from "three";
|
|
29
29
|
import "hammerjs";
|
|
30
30
|
import "../three/PointSelector/index.js";
|
|
31
31
|
import "three/examples/jsm/renderers/CSS3DRenderer";
|
|
@@ -34,35 +34,39 @@ import { vectorToCoordinates as N } from "../vectorToCoordinate.js";
|
|
|
34
34
|
import { FiveUtil as O } from "../Utils/FiveUtil.js";
|
|
35
35
|
import { notNil as Y } from "../isNil.js";
|
|
36
36
|
import "../../vendor/@tweenjs/tween/dist/tween.esm.js.js";
|
|
37
|
+
import "../../Sculpt/Meshes/Polygon.js";
|
|
38
|
+
import "../../Sculpt/utils/Modules/Global.js";
|
|
37
39
|
import "@realsee/five/line";
|
|
38
40
|
import "../../vendor/three/examples/jsm/lines/LineGeometry.js";
|
|
41
|
+
import "../../vendor/hotkeys-js/dist/hotkeys.esm.js";
|
|
42
|
+
import "../../Sculpt/utils/three/rayOnLine.js";
|
|
39
43
|
import { worldBoundingSphere as j } from "../three/boundingBox.js";
|
|
40
44
|
import "animejs";
|
|
41
|
-
function
|
|
45
|
+
function nt(o, e, t) {
|
|
42
46
|
return g(this, null, function* () {
|
|
43
47
|
var P, x, z;
|
|
44
48
|
if (!e)
|
|
45
49
|
return;
|
|
46
|
-
const
|
|
47
|
-
if (!
|
|
50
|
+
const n = j(e);
|
|
51
|
+
if (!n)
|
|
48
52
|
return;
|
|
49
|
-
const
|
|
50
|
-
let
|
|
53
|
+
const l = new O(o), u = (P = t == null ? void 0 : t.scale) != null ? P : 1.4, s = n.center, m = o.camera.position.clone().sub(s).setY(0).normalize(), r = o.state.mode === "Mapview" ? o.state.fov : 60, C = Math.max(1.5, n.radius * u), k = C * (1 / Math.tan(a.MathUtils.degToRad(r / 2)));
|
|
54
|
+
let d = 0;
|
|
51
55
|
const w = [], M = (c) => {
|
|
52
|
-
const i =
|
|
53
|
-
return
|
|
56
|
+
const i = a.MathUtils.degToRad(c);
|
|
57
|
+
return m.clone().applyAxisAngle(new a.Vector3(0, 1, 0), i).clone().multiplyScalar(k).add(new a.Vector3(0, C, 0)).add(s);
|
|
54
58
|
};
|
|
55
|
-
for (;
|
|
59
|
+
for (; d !== 360; ) {
|
|
56
60
|
let c = 0;
|
|
57
|
-
const i = M(
|
|
58
|
-
const I = y.distanceTo(i), _ = new
|
|
61
|
+
const i = M(d), f = (y) => {
|
|
62
|
+
const I = y.distanceTo(i), _ = new a.Raycaster(y, i.clone().sub(y).normalize()), h = l.model.intersectRaycaster(_, void 0, !0)[0], S = h == null ? void 0 : h.distance;
|
|
59
63
|
Y(S) ? S > I && (c += 1) : c += 1;
|
|
60
|
-
}, A =
|
|
64
|
+
}, A = n.clampPoint(i, new a.Vector3());
|
|
61
65
|
f(A);
|
|
62
|
-
const E = new
|
|
63
|
-
if (f(E), w[c] =
|
|
66
|
+
const E = new a.Vector3(s.x, i.y, s.z);
|
|
67
|
+
if (f(E), w[c] = d, c === 2)
|
|
64
68
|
break;
|
|
65
|
-
|
|
69
|
+
d += 30;
|
|
66
70
|
}
|
|
67
71
|
const R = M((z = (x = w[2]) != null ? x : w[1]) != null ? z : 0), v = R.distanceTo(s), b = N(s.clone().sub(R).normalize());
|
|
68
72
|
if (o.state.mode === "Mapview")
|
|
@@ -81,5 +85,5 @@ function et(o, e, t) {
|
|
|
81
85
|
});
|
|
82
86
|
}
|
|
83
87
|
export {
|
|
84
|
-
|
|
88
|
+
nt as lookObject
|
|
85
89
|
};
|
|
@@ -18,16 +18,17 @@ import { uuid as j } from "./uuid.js";
|
|
|
18
18
|
import { absoluteUrl as I, isAbsoluteURL as O } from "./url/absoluteUrl.js";
|
|
19
19
|
import { awaitNextFrame as T, getFrameTime as _, nextFrame as y, requestAnimationFrameInterval as C } from "./animationFrame/index.js";
|
|
20
20
|
import { equal as H } from "./equal.js";
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
23
|
-
import {
|
|
24
|
-
import {
|
|
25
|
-
import {
|
|
26
|
-
import {
|
|
27
|
-
|
|
21
|
+
import { sculpt as N } from "../Sculpt/utils/export.js";
|
|
22
|
+
import { isModelLike as q, isPanoramaLike as A } from "./five/mode.js";
|
|
23
|
+
import { lookObject as D } from "./five/lookObject.js";
|
|
24
|
+
import { lookPoint as E } from "./five/lookPoint.js";
|
|
25
|
+
import { fiveModelIsLoaded as R, waitFiveModelLoaded as U } from "./five/fiveModelLoad.js";
|
|
26
|
+
import { FiveDomEvents as V } from "./five/FiveDomEvents.js";
|
|
27
|
+
import { BetterTween as z, tweenProgress as G } from "./animationFrame/BetterTween.js";
|
|
28
|
+
const Lo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
28
29
|
__proto__: null,
|
|
29
|
-
BetterTween:
|
|
30
|
-
FiveDomEvents:
|
|
30
|
+
BetterTween: z,
|
|
31
|
+
FiveDomEvents: V,
|
|
31
32
|
Interval: r,
|
|
32
33
|
LightTag: i,
|
|
33
34
|
LineSegments: u,
|
|
@@ -49,30 +50,31 @@ const vo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
49
50
|
checkFiveModelLoaded: n,
|
|
50
51
|
convexHull: t,
|
|
51
52
|
equal: H,
|
|
52
|
-
fiveModelIsLoaded:
|
|
53
|
+
fiveModelIsLoaded: R,
|
|
53
54
|
getCoordsFromClient: l,
|
|
54
55
|
getCoordsFromElement: f,
|
|
55
56
|
getFrameTime: _,
|
|
56
57
|
inside: o,
|
|
57
58
|
isAbsoluteURL: O,
|
|
58
|
-
isModelLike:
|
|
59
|
+
isModelLike: q,
|
|
59
60
|
isNil: B,
|
|
60
|
-
isPanoramaLike:
|
|
61
|
-
lookObject:
|
|
62
|
-
lookPoint:
|
|
61
|
+
isPanoramaLike: A,
|
|
62
|
+
lookObject: D,
|
|
63
|
+
lookPoint: E,
|
|
63
64
|
nextFrame: y,
|
|
64
65
|
notNil: h,
|
|
65
66
|
pointInPolygon: o,
|
|
66
67
|
reblink: S,
|
|
67
68
|
requestAnimationFrameInterval: C,
|
|
69
|
+
sculpt: N,
|
|
68
70
|
tag: m,
|
|
69
|
-
tweenProgress:
|
|
71
|
+
tweenProgress: G,
|
|
70
72
|
uuid: j,
|
|
71
|
-
waitFiveModelLoaded:
|
|
73
|
+
waitFiveModelLoaded: U,
|
|
72
74
|
worldBounding: L,
|
|
73
75
|
worldBoundingBox: P,
|
|
74
76
|
worldBoundingSphere: k
|
|
75
77
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
76
78
|
export {
|
|
77
|
-
|
|
79
|
+
Lo as index
|
|
78
80
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
function A() {
|
|
2
2
|
console.debug(
|
|
3
|
-
"%c %c@realsee/dnalogel %cv3.
|
|
3
|
+
"%c %c@realsee/dnalogel %cv3.51.0",
|
|
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",
|
|
@@ -13,6 +13,16 @@ export declare class LightTag {
|
|
|
13
13
|
container: HTMLDivElement;
|
|
14
14
|
visible: boolean;
|
|
15
15
|
enabled: boolean;
|
|
16
|
+
/**
|
|
17
|
+
* @description 标签的可见性数组
|
|
18
|
+
* ```
|
|
19
|
+
* [0] this.visible
|
|
20
|
+
* [1] 碰撞检测
|
|
21
|
+
* [2] 元素遮挡
|
|
22
|
+
* ```
|
|
23
|
+
*/
|
|
24
|
+
visibles: boolean[];
|
|
25
|
+
get position(): THREE.Vector3;
|
|
16
26
|
/**
|
|
17
27
|
* @description 标签容器的父容器
|
|
18
28
|
* @default this.five.getElement()?.parentElement
|
|
@@ -24,11 +34,16 @@ export declare class LightTag {
|
|
|
24
34
|
* @default true
|
|
25
35
|
*/
|
|
26
36
|
intersectCheck: boolean;
|
|
37
|
+
/**
|
|
38
|
+
* @description 用于碰撞检测的额外 Object3D
|
|
39
|
+
*/
|
|
40
|
+
extraObjectsForIntersectCheck: THREE.Object3D[];
|
|
27
41
|
/**
|
|
28
42
|
* @description 模拟3D
|
|
29
43
|
* @default true
|
|
30
44
|
*/
|
|
31
45
|
simulate3D: boolean;
|
|
46
|
+
set needsRender(val: true);
|
|
32
47
|
/**
|
|
33
48
|
* @description 标签的容器,根据 namespace 区分
|
|
34
49
|
*/
|
|
@@ -41,16 +56,40 @@ export declare class LightTag {
|
|
|
41
56
|
private fiveUtil;
|
|
42
57
|
private disposers;
|
|
43
58
|
constructor(five: Five, position?: AnyPosition, config?: LightTagConfig);
|
|
59
|
+
/**
|
|
60
|
+
* @description 显示标签
|
|
61
|
+
*/
|
|
44
62
|
show(): void;
|
|
63
|
+
/**
|
|
64
|
+
* @description 隐藏标签
|
|
65
|
+
*/
|
|
45
66
|
hide(): void;
|
|
67
|
+
/**
|
|
68
|
+
* @description 启用标签
|
|
69
|
+
*/
|
|
46
70
|
enable(): void;
|
|
71
|
+
/**
|
|
72
|
+
* @description 禁用标签
|
|
73
|
+
*/
|
|
47
74
|
disable(): void;
|
|
75
|
+
/**
|
|
76
|
+
* @description 销毁标签,并释放相关资源
|
|
77
|
+
*/
|
|
48
78
|
destroy(): void;
|
|
49
|
-
|
|
79
|
+
/**
|
|
80
|
+
* @description 设置标签位置
|
|
81
|
+
* @param position 位置
|
|
82
|
+
* @param positionsForRotate 用于 css 旋转的斜线的两个端点
|
|
83
|
+
*/
|
|
50
84
|
setPosition(position: AnyPosition, positionsForRotate?: AnyPosition[]): void;
|
|
85
|
+
setTransformMatrix(matrix: THREE.Matrix4): void;
|
|
51
86
|
updateScreenPosition(): void;
|
|
52
87
|
private onCameraUpdate;
|
|
88
|
+
private onCameraFovUpdate;
|
|
53
89
|
private onFiveEveryReady;
|
|
90
|
+
private updateVisible;
|
|
91
|
+
private applyVisible;
|
|
92
|
+
private updateIntersectCheckVisible;
|
|
54
93
|
private addResizeListener;
|
|
55
94
|
}
|
|
56
95
|
export declare function tag(...params: ConstructorParameters<typeof LightTag>): LightTag;
|
package/libs/shared-utils/tag.js
CHANGED
|
@@ -1,152 +1,205 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
import { anyPositionToVector3 as
|
|
5
|
-
import * as
|
|
6
|
-
import { vector3ToScreen as
|
|
7
|
-
import { getFiveModel as
|
|
8
|
-
import { FiveUtil as
|
|
9
|
-
import { _raycaster as
|
|
10
|
-
import { resizeObserver as
|
|
11
|
-
|
|
1
|
+
var y = Object.defineProperty;
|
|
2
|
+
var b = (c, e, t) => e in c ? y(c, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : c[e] = t;
|
|
3
|
+
var i = (c, e, t) => (b(c, typeof e != "symbol" ? e + "" : e, t), t);
|
|
4
|
+
import { anyPositionToVector3 as d } from "./positionToVector3.js";
|
|
5
|
+
import * as P from "three";
|
|
6
|
+
import { vector3ToScreen as m } from "./five/vector3ToScreen.js";
|
|
7
|
+
import { getFiveModel as g } from "./five/getFiveModel.js";
|
|
8
|
+
import { FiveUtil as C } from "./Utils/FiveUtil.js";
|
|
9
|
+
import { _raycaster as v } from "./three/temp.js";
|
|
10
|
+
import { resizeObserver as U } from "./dom/resizeObserver.js";
|
|
11
|
+
import { fiveEveryReadyListener as x } from "./five/fiveEveryReadyListener.js";
|
|
12
|
+
const E = new P.Vector2();
|
|
12
13
|
class w {
|
|
13
|
-
constructor(
|
|
14
|
+
constructor(e, t, o) {
|
|
14
15
|
/**
|
|
15
16
|
* @description 单个标签 dom
|
|
16
17
|
*/
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
18
|
+
i(this, "container");
|
|
19
|
+
i(this, "visible", !1);
|
|
20
|
+
i(this, "enabled", !1);
|
|
21
|
+
/**
|
|
22
|
+
* @description 标签的可见性数组
|
|
23
|
+
* ```
|
|
24
|
+
* [0] this.visible
|
|
25
|
+
* [1] 碰撞检测
|
|
26
|
+
* [2] 元素遮挡
|
|
27
|
+
* ```
|
|
28
|
+
*/
|
|
29
|
+
i(this, "visibles", []);
|
|
20
30
|
/**
|
|
21
31
|
* @description 标签容器的父容器
|
|
22
32
|
* @default this.five.getElement()?.parentElement
|
|
23
33
|
*/
|
|
24
|
-
|
|
25
|
-
|
|
34
|
+
i(this, "wrapper");
|
|
35
|
+
i(this, "positionsForRotate");
|
|
26
36
|
/**
|
|
27
37
|
* @description 碰撞检测
|
|
28
38
|
* @default true
|
|
29
39
|
*/
|
|
30
|
-
|
|
40
|
+
i(this, "intersectCheck", !0);
|
|
41
|
+
/**
|
|
42
|
+
* @description 用于碰撞检测的额外 Object3D
|
|
43
|
+
*/
|
|
44
|
+
i(this, "extraObjectsForIntersectCheck", []);
|
|
31
45
|
/**
|
|
32
46
|
* @description 模拟3D
|
|
33
47
|
* @default true
|
|
34
48
|
*/
|
|
35
|
-
|
|
49
|
+
i(this, "simulate3D", !1);
|
|
36
50
|
/**
|
|
37
51
|
* @description 标签的容器,根据 namespace 区分
|
|
38
52
|
*/
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
53
|
+
i(this, "tagWrapper");
|
|
54
|
+
i(this, "five");
|
|
55
|
+
i(this, "originPosition");
|
|
56
|
+
i(this, "transformedPosition");
|
|
57
|
+
i(this, "disposer");
|
|
58
|
+
i(this, "config");
|
|
59
|
+
i(this, "fiveUtil");
|
|
60
|
+
i(this, "disposers", []);
|
|
61
|
+
i(this, "onCameraUpdate", () => {
|
|
48
62
|
this.visible !== !1 && this.updateScreenPosition();
|
|
49
63
|
});
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
64
|
+
i(this, "onCameraFovUpdate", () => {
|
|
65
|
+
this.onCameraUpdate(), this.five.off("render.prepare", this.onCameraUpdate), this.five.on("render.prepare", this.onCameraUpdate), setTimeout(() => {
|
|
66
|
+
this.five.off("render.prepare", this.onCameraUpdate);
|
|
67
|
+
}, 1e3);
|
|
68
|
+
});
|
|
69
|
+
i(this, "onFiveEveryReady", () => {
|
|
70
|
+
this.five.state.mode !== "Panorama" && this.updateVisible();
|
|
71
|
+
});
|
|
72
|
+
i(this, "updateVisible", () => {
|
|
73
|
+
this.visible && (this.updateIntersectCheckVisible(), this.needsRender = !0);
|
|
74
|
+
});
|
|
75
|
+
i(this, "applyVisible", () => {
|
|
76
|
+
console.log(this.visibles), this.visibles.every((t) => t !== !1) ? (this.container.style.opacity = "1", this.container.style.pointerEvents = "auto") : (this.container.style.opacity = "0", this.container.style.pointerEvents = "none");
|
|
77
|
+
});
|
|
78
|
+
i(this, "updateIntersectCheckVisible", () => {
|
|
79
|
+
var n, r;
|
|
80
|
+
if (!this.intersectCheck) {
|
|
81
|
+
this.visibles[1] = !0;
|
|
82
|
+
return;
|
|
59
83
|
}
|
|
84
|
+
let e = !1, t = 0.01;
|
|
85
|
+
this.fiveUtil.workUtil.fromType === "poincare" && (t = 0.05);
|
|
86
|
+
const o = this.transformedPosition.clone().sub(this.five.camera.position).normalize();
|
|
87
|
+
v.set(this.five.camera.position, o);
|
|
88
|
+
const h = (n = g(this.five).intersectRaycaster(v)) != null ? n : [], a = (r = v.intersectObjects(this.extraObjectsForIntersectCheck, !0)) != null ? r : [], s = [...h, ...a].sort((p, f) => p.distance - f.distance)[0];
|
|
89
|
+
s ? e = (s == null ? void 0 : s.distance) + t > this.transformedPosition.distanceTo(this.five.camera.position) : e = !0, this.visibles[1] = e;
|
|
60
90
|
});
|
|
61
|
-
var
|
|
62
|
-
this.five =
|
|
63
|
-
const
|
|
64
|
-
return
|
|
65
|
-
})(), this.
|
|
91
|
+
var h, a, l;
|
|
92
|
+
this.five = e, this.fiveUtil = (h = e.__fiveUtil__) != null ? h : e.__fiveUtil__ = new C(e), this.originPosition = t ? d(t).clone() : void 0, this.transformedPosition = (a = this.originPosition) == null ? void 0 : a.clone(), this.positionsForRotate = (l = o == null ? void 0 : o.positionsForRotate) == null ? void 0 : l.map((s) => d(s).clone()), this.config = o != null ? o : {}, this.container = (() => {
|
|
93
|
+
const s = document.createElement("div");
|
|
94
|
+
return s.classList.add("light-tag"), s.style.width = "0", s.style.height = "0", s.style.position = "absolute", s.style.transition = "opacity 0.2s linear", s;
|
|
95
|
+
})(), this.addResizeListener(), this.show(), this.enable(), setTimeout(() => {
|
|
96
|
+
this.updateVisible(), this.needsRender = !0;
|
|
97
|
+
}, 0);
|
|
66
98
|
}
|
|
99
|
+
get position() {
|
|
100
|
+
return this.transformedPosition;
|
|
101
|
+
}
|
|
102
|
+
set needsRender(e) {
|
|
103
|
+
this.applyVisible();
|
|
104
|
+
}
|
|
105
|
+
/**
|
|
106
|
+
* @description 显示标签
|
|
107
|
+
*/
|
|
67
108
|
show() {
|
|
68
|
-
this.visible = !0, this.container.style.opacity = "1", this.container.style.pointerEvents = "auto", this.onCameraUpdate();
|
|
109
|
+
this.visible = !0, this.visibles[0] = !0, this.container.style.opacity = "1", this.container.style.pointerEvents = "auto", this.updateVisible(), this.onCameraUpdate();
|
|
69
110
|
}
|
|
111
|
+
/**
|
|
112
|
+
* @description 隐藏标签
|
|
113
|
+
*/
|
|
70
114
|
hide() {
|
|
71
|
-
this.visible = !1, this.container.style.opacity = "0", this.container.style.pointerEvents = "none";
|
|
115
|
+
this.visible = !1, this.visibles[0] = !1, this.container.style.opacity = "0", this.container.style.pointerEvents = "none";
|
|
72
116
|
}
|
|
117
|
+
/**
|
|
118
|
+
* @description 启用标签
|
|
119
|
+
*/
|
|
73
120
|
enable() {
|
|
74
|
-
var
|
|
121
|
+
var o, h, a, l, s;
|
|
75
122
|
if (this.enabled)
|
|
76
123
|
return;
|
|
77
|
-
this.enabled = !0, this.wrapper = (
|
|
78
|
-
const
|
|
124
|
+
this.enabled = !0, this.wrapper = (a = (h = this.config.wrapper) != null ? h : (o = this.five.getElement()) == null ? void 0 : o.parentElement) != null ? a : document.body;
|
|
125
|
+
const e = `light-tag-wrapper-${(s = (l = this.config) == null ? void 0 : l.namespace) != null ? s : "default"}`;
|
|
79
126
|
if (!this.tagWrapper) {
|
|
80
|
-
let
|
|
81
|
-
if (!
|
|
127
|
+
let n = Array.from(this.wrapper.children).find((r) => r.id === e);
|
|
128
|
+
if (!n) {
|
|
82
129
|
const r = document.createElement("div");
|
|
83
|
-
|
|
130
|
+
n = r, r.id = e, r.style.position = "absolute", r.style.overflow = "hidden", r.style.top = "0", r.style.left = "0", r.style.width = "100%", r.style.height = "100%", r.style.pointerEvents = "none", r.style.zIndex = "1", this.wrapper.appendChild(n);
|
|
84
131
|
}
|
|
85
|
-
this.tagWrapper =
|
|
132
|
+
this.tagWrapper = n;
|
|
86
133
|
}
|
|
87
|
-
this.tagWrapper.appendChild(this.container);
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
this.onFiveEveryReady(), e = !1;
|
|
92
|
-
}));
|
|
93
|
-
};
|
|
94
|
-
this.five.on("cameraUpdate", i), this.five.on("cameraUpdate", this.onCameraUpdate), this.disposer = () => {
|
|
95
|
-
this.five.off("cameraUpdate", i), this.five.off("cameraUpdate", this.onCameraUpdate);
|
|
134
|
+
this.tagWrapper.appendChild(this.container), this.updateVisible();
|
|
135
|
+
const t = x(this.five, this.onFiveEveryReady);
|
|
136
|
+
this.five.on("cameraUpdate", this.onCameraUpdate), this.five.on("cameraFovUpdate", this.onCameraFovUpdate), this.five.on("panoArrived", this.updateVisible), this.five.on("modeChange", this.updateVisible), this.disposer = () => {
|
|
137
|
+
t(), this.five.off("cameraUpdate", this.onCameraUpdate), this.five.off("cameraFovUpdate", this.onCameraFovUpdate), this.five.off("panoArrived", this.updateVisible), this.five.off("modeChange", this.updateVisible);
|
|
96
138
|
};
|
|
97
139
|
}
|
|
140
|
+
/**
|
|
141
|
+
* @description 禁用标签
|
|
142
|
+
*/
|
|
98
143
|
disable() {
|
|
99
|
-
var
|
|
100
|
-
this.enabled && (this.enabled = !1, this.tagWrapper.removeChild(this.container), (
|
|
144
|
+
var e;
|
|
145
|
+
this.enabled && (this.enabled = !1, this.tagWrapper.removeChild(this.container), (e = this.disposer) == null || e.call(this));
|
|
101
146
|
}
|
|
147
|
+
/**
|
|
148
|
+
* @description 销毁标签,并释放相关资源
|
|
149
|
+
*/
|
|
102
150
|
destroy() {
|
|
103
|
-
this.disable(), this.container.remove(), this.disposers.forEach((
|
|
151
|
+
this.disable(), this.container.remove(), this.disposers.forEach((e) => e());
|
|
104
152
|
}
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
153
|
+
/**
|
|
154
|
+
* @description 设置标签位置
|
|
155
|
+
* @param position 位置
|
|
156
|
+
* @param positionsForRotate 用于 css 旋转的斜线的两个端点
|
|
157
|
+
*/
|
|
158
|
+
setPosition(e, t) {
|
|
159
|
+
this.transformedPosition = d(e).clone(), this.positionsForRotate = t == null ? void 0 : t.map((o) => d(o).clone()), this.onCameraUpdate(), setTimeout(() => this.onCameraUpdate(), 0);
|
|
108
160
|
}
|
|
109
|
-
|
|
110
|
-
|
|
161
|
+
setTransformMatrix(e) {
|
|
162
|
+
var t;
|
|
163
|
+
this.transformedPosition = (t = this.originPosition) == null ? void 0 : t.clone().applyMatrix4(e), this.onCameraUpdate();
|
|
111
164
|
}
|
|
112
165
|
updateScreenPosition() {
|
|
113
166
|
if (!this.transformedPosition) {
|
|
114
167
|
this.container.style.left = "-100%", this.container.style.top = "-100%";
|
|
115
168
|
return;
|
|
116
169
|
}
|
|
117
|
-
const
|
|
118
|
-
if (!
|
|
170
|
+
const e = this.five.renderer.getSize(E), t = m(this.five.camera, this.transformedPosition, e);
|
|
171
|
+
if (!t) {
|
|
119
172
|
this.container.style.left = "-100%", this.container.style.top = "-100%";
|
|
120
173
|
return;
|
|
121
174
|
}
|
|
122
|
-
const
|
|
175
|
+
const o = (() => {
|
|
123
176
|
if (!this.simulate3D)
|
|
124
177
|
return 1;
|
|
125
|
-
const
|
|
126
|
-
return Math.max(Math.min(1 -
|
|
127
|
-
})(),
|
|
178
|
+
const a = 2 * Math.tan(0.5 * this.five.camera.fov / 180 * Math.PI), l = this.transformedPosition.distanceTo(this.five.camera.position);
|
|
179
|
+
return Math.max(Math.min(1 - a * l / 40, 1), 0.5);
|
|
180
|
+
})(), h = (() => {
|
|
128
181
|
if (this.positionsForRotate === void 0 || this.positionsForRotate.length !== 2)
|
|
129
182
|
return 0;
|
|
130
|
-
const [
|
|
131
|
-
if (!
|
|
183
|
+
const [a, l] = this.positionsForRotate, s = m(this.five.camera, a, e), n = m(this.five.camera, l, e);
|
|
184
|
+
if (!s || !n)
|
|
132
185
|
return 0;
|
|
133
|
-
const
|
|
134
|
-
return Math.atan2(
|
|
186
|
+
const r = s.leftPx > n.leftPx ? n : s, p = s.leftPx > n.leftPx ? s : n, f = p.leftPx - r.leftPx, u = p.topPx - r.topPx;
|
|
187
|
+
return Math.atan2(u, f) * (180 / Math.PI);
|
|
135
188
|
})();
|
|
136
|
-
this.container.style.left =
|
|
189
|
+
this.container.style.left = t.leftPx + "px", this.container.style.top = t.topPx + "px", this.container.style.transformOrigin = "center", this.container.style.transform = `scale(${o})`, h && (this.container.style.transform += ` rotate(${h}deg)`);
|
|
137
190
|
}
|
|
138
191
|
addResizeListener() {
|
|
139
|
-
const
|
|
140
|
-
if (
|
|
141
|
-
const { observe:
|
|
142
|
-
|
|
192
|
+
const e = this.five.getElement();
|
|
193
|
+
if (e) {
|
|
194
|
+
const { observe: t, unobserve: o } = U(this.onCameraUpdate, e);
|
|
195
|
+
t(), this.disposers.push(o);
|
|
143
196
|
}
|
|
144
197
|
}
|
|
145
198
|
}
|
|
146
|
-
function
|
|
147
|
-
return new w(...
|
|
199
|
+
function k(...c) {
|
|
200
|
+
return new w(...c);
|
|
148
201
|
}
|
|
149
202
|
export {
|
|
150
203
|
w as LightTag,
|
|
151
|
-
|
|
204
|
+
k as tag
|
|
152
205
|
};
|
|
@@ -8,3 +8,7 @@ import "../../vendor/three/examples/jsm/lines/LineGeometry.js";
|
|
|
8
8
|
import "./core/Sphere.js";
|
|
9
9
|
import "animejs";
|
|
10
10
|
import "../../vendor/@tweenjs/tween/dist/tween.esm.js.js";
|
|
11
|
+
import "../../Sculpt/Meshes/Polygon.js";
|
|
12
|
+
import "../../Sculpt/utils/Modules/Global.js";
|
|
13
|
+
import "../../vendor/hotkeys-js/dist/hotkeys.esm.js";
|
|
14
|
+
import "../../Sculpt/utils/three/rayOnLine.js";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import
|
|
2
|
-
export declare const _raycaster:
|
|
1
|
+
import { THREERaycaster } from './core/Raycaster';
|
|
2
|
+
export declare const _raycaster: THREERaycaster;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import
|
|
2
|
-
const
|
|
3
|
-
|
|
1
|
+
import { THREERaycaster as r } from "./core/Raycaster.js";
|
|
2
|
+
const t = new r();
|
|
3
|
+
t.params.Points.threshold = 0.02;
|
|
4
4
|
export {
|
|
5
|
-
|
|
5
|
+
t as _raycaster
|
|
6
6
|
};
|