@realsee/dnalogel 3.50.13 → 3.50.14
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/index.cjs.js +194 -194
- package/dist/index.js +3617 -3596
- package/dist/index.umd.js +191 -191
- package/dist/shared-utils/equal.d.ts +1 -1
- package/dist/shared-utils/index.d.ts +2 -1
- package/dist/shared-utils/tag.d.ts +18 -7
- package/libs/AreaMakerPlugin/Controller.js +3 -3
- package/libs/AreaMakerPlugin/index.js +6 -6
- package/libs/AreaMakerPlugin/utils/Item.js +3 -3
- package/libs/CSS3DRenderPlugin/Controller.js +3 -3
- package/libs/CSS3DRenderPlugin/index.js +7 -7
- package/libs/CSS3DRenderPlugin/utils/three/CSS3DObject.js +3 -3
- package/libs/CSS3DRenderPlugin/utils/three/CSS3DRender.js +5 -5
- package/libs/CruisePlugin/BaseController.js +13 -13
- package/libs/CruisePlugin/Move.js +3 -3
- package/libs/CruisePlugin/Work.js +2 -2
- package/libs/CruisePlugin/index.js +8 -8
- package/libs/CurrentPanoImagePlugin/Controller.js +3 -3
- package/libs/CurrentPanoImagePlugin/index.js +6 -6
- package/libs/GuideLinePlugin/Controller.js +19 -19
- package/libs/GuideLinePlugin/GuideLineItem.js +7 -7
- package/libs/GuideLinePlugin/GuideLineModeItem/index.js +1 -1
- package/libs/GuideLinePlugin/GuideLineModeItem.js +3 -3
- package/libs/GuideLinePlugin/index.js +8 -8
- package/libs/ModelMakerPlugin/Controller.js +3 -3
- package/libs/ModelMakerPlugin/index.js +7 -7
- package/libs/ModelTVVideoPlugin/Plugin.js +5 -5
- package/libs/ModelTVVideoPlugin/index.js +5 -5
- package/libs/Object3DHelperPlugin/Controller.js +6 -6
- package/libs/Object3DHelperPlugin/index.js +7 -7
- package/libs/PanoCompassPlugin/Controller.js +6 -6
- package/libs/PanoCompassPlugin/index.js +6 -6
- package/libs/PanoDoorLabelPlugin/BaseController.js +7 -7
- package/libs/PanoDoorLabelPlugin/Controller.js +6 -6
- package/libs/PanoDoorLabelPlugin/index.js +6 -6
- package/libs/PanoMeasurePlugin/Components/Controller0.js +5 -5
- package/libs/PanoMeasurePlugin/Components/Controller1.js +5 -5
- package/libs/PanoMeasurePlugin/Controller/EditController.js +5 -5
- package/libs/PanoMeasurePlugin/Controller/WatchController.js +4 -4
- package/libs/PanoMeasurePlugin/Controller/index.js +3 -3
- package/libs/PanoMeasurePlugin/Model/area.js +5 -5
- package/libs/PanoMeasurePlugin/Modules/Magnifier.js +7 -7
- package/libs/PanoMeasurePlugin/Modules/UIController/index.js +5 -5
- package/libs/PanoMeasurePlugin/index.js +3 -3
- package/libs/PanoMeasurePlugin/utils/dom/areaDom.js +3 -3
- package/libs/PanoRulerProPlugin/Controller.js +52 -33
- package/libs/PanoRulerProPlugin/RulerItems.js +104 -85
- package/libs/PanoRulerProPlugin/index.js +23 -4
- package/libs/PanoSpatialTagPlugin/Plugin.js +5 -5
- package/libs/PanoSpatialTagPlugin/index.js +5 -5
- package/libs/PanoTagPlugin/Components/Common/TagPoint.js +3 -3
- package/libs/PanoTagPlugin/Components/Tag/MarketingTag.js +3 -3
- package/libs/PanoTagPlugin/Components/Tag/index.js +3 -3
- package/libs/PanoTagPlugin/Components/TagContainer.js +6 -6
- package/libs/PanoTagPlugin/Components/TagItem.js +3 -3
- package/libs/PanoTagPlugin/controller/Tag/BaseTag.js +3 -3
- package/libs/PanoTagPlugin/controller/Tag/ModelTag.js +7 -7
- package/libs/PanoTagPlugin/controller/Tag/PlaneTag.js +7 -7
- package/libs/PanoTagPlugin/controller/Tag/PointTag.js +7 -7
- package/libs/PanoTagPlugin/controller/TagRender.js +6 -6
- package/libs/PanoTagPlugin/controller/TagUtil.js +5 -5
- package/libs/PanoTagPlugin/controller/index.js +3 -3
- package/libs/PanoTagPlugin/index.js +6 -6
- package/libs/PanoTagPlugin/utils/tag/calculateTagConfig.js +3 -3
- package/libs/PanoVideoPlugin/Controller.js +7 -7
- package/libs/PanoVideoPlugin/VideoMeshController.js +3 -3
- package/libs/PanoVideoPlugin/index.js +7 -7
- package/libs/PipelinePlugin/Controller.js +15 -15
- package/libs/PipelinePlugin/index.js +7 -7
- package/libs/PipelinePlugin/utils/Objects/FlowPipe.js +3 -3
- package/libs/PipelinePlugin/utils/Objects/HighlightPipe.js +3 -3
- package/libs/PipelinePlugin/utils/Objects/Pipe.js +3 -3
- package/libs/Sculpt/Meshes/Box.js +1 -1
- package/libs/Sculpt/Meshes/Cylinder.js +1 -1
- package/libs/Sculpt/Meshes/Line.js +4 -4
- package/libs/Sculpt/Meshes/LineWithDots.js +3 -2
- package/libs/Sculpt/Meshes/Point.js +1 -1
- package/libs/Sculpt/Meshes/Prism.js +9 -8
- package/libs/Sculpt/Meshes/Rectangle.js +1 -1
- package/libs/Sculpt/Objects/Line/Editor.js +1 -1
- package/libs/Sculpt/index.js +1 -1
- package/libs/Sculpt/utils/three/ColoredMesh.js +1 -1
- package/libs/base/BasePlugin.js +2 -2
- package/libs/floorplan/MapviewFloorplanPlugin/Controller.js +3 -3
- package/libs/floorplan/MapviewFloorplanPlugin/index.js +6 -6
- package/libs/floorplan/ModelFloorplanPlugin/Controller.js +3 -3
- package/libs/floorplan/ModelFloorplanPlugin/index.js +6 -6
- package/libs/floorplan/PanoFloorplanRadarPlugin/Controller.js +7 -7
- package/libs/floorplan/PanoFloorplanRadarPlugin/index.js +7 -7
- package/libs/floorplan/TopviewFloorplanPlugin/Controller.js +3 -3
- package/libs/floorplan/TopviewFloorplanPlugin/index.js +6 -6
- package/libs/floorplan/index.js +1 -1
- package/libs/index.js +6 -6
- package/libs/shared-utils/equal.d.ts +1 -1
- package/libs/shared-utils/five/index.js +1 -1
- package/libs/shared-utils/five/lookObject.js +1 -1
- package/libs/shared-utils/index.d.ts +2 -1
- package/libs/shared-utils/index.js +57 -54
- package/libs/shared-utils/logger.js +1 -1
- package/libs/shared-utils/tag.d.ts +18 -7
- package/libs/shared-utils/tag.js +80 -61
- package/libs/shared-utils/three/index.js +1 -1
- package/package.json +1 -1
|
@@ -2,67 +2,70 @@ import { Interval as r } from "./math/Interval.js";
|
|
|
2
2
|
import { Rectangle as e } from "./math/Rectangle.js";
|
|
3
3
|
import { convexHull as t } from "./math/convexHull.js";
|
|
4
4
|
import { inside as o } from "./math/inside.js";
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
23
|
-
|
|
5
|
+
import { LightTag as i, tag as m } from "./tag.js";
|
|
6
|
+
import { checkFiveModelLoaded as n } from "./five/index.js";
|
|
7
|
+
import { Magnifier as p } from "./three/Magnifier.js";
|
|
8
|
+
import { getCoordsFromClient as l, getCoordsFromElement as f } from "./three/getCoords.js";
|
|
9
|
+
import { PointHelper as a } from "./three/PointSelector/utils/PointHelper.js";
|
|
10
|
+
import { PointSelectorHelper as d } from "./three/PointSelector/utils/PointSelectorHelper.js";
|
|
11
|
+
import { Object3D as g } from "./three/core/Object3D.js";
|
|
12
|
+
import { LineSegments as u } from "./three/core/LineSegments.js";
|
|
13
|
+
import { bounding as s, boundingBox as b, boundingSphere as x, boxVertex as c, boxVertexes as k, worldBounding as F, worldBoundingBox as P, worldBoundingSphere as w } from "./three/boundingBox.js";
|
|
14
|
+
import { animeMap as B, blink as L, reblink as S } from "./three/blink.js";
|
|
15
|
+
import { isNil as v, notNil as M } from "./isNil.js";
|
|
16
|
+
import { uuid as h } from "./uuid.js";
|
|
17
|
+
import { absoluteUrl as j, isAbsoluteURL as O } from "./url/absoluteUrl.js";
|
|
18
|
+
import { awaitNextFrame as T, getFrameTime as _, nextFrame as y, requestAnimationFrameInterval as C } from "./animationFrame/index.js";
|
|
19
|
+
import { equal as H } from "./equal.js";
|
|
20
|
+
import { isModelLike as I, isPanoramaLike as N } from "./five/mode.js";
|
|
21
|
+
import { lookObject as q } from "./five/lookObject.js";
|
|
22
|
+
import { lookPoint as A } from "./five/lookPoint.js";
|
|
23
|
+
import { BetterTween as R, tweenProgress as U } from "./animationFrame/BetterTween.js";
|
|
24
|
+
const ao = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
24
25
|
__proto__: null,
|
|
25
|
-
BetterTween:
|
|
26
|
+
BetterTween: R,
|
|
26
27
|
Interval: r,
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
28
|
+
LightTag: i,
|
|
29
|
+
LineSegments: u,
|
|
30
|
+
Magnifier: p,
|
|
31
|
+
Object3D: g,
|
|
32
|
+
PointHelper: a,
|
|
33
|
+
PointSelectorHelper: d,
|
|
32
34
|
Rectangle: e,
|
|
33
|
-
absoluteUrl:
|
|
34
|
-
animeMap:
|
|
35
|
-
awaitNextFrame:
|
|
36
|
-
blink:
|
|
37
|
-
bounding:
|
|
38
|
-
boundingBox:
|
|
39
|
-
boundingSphere:
|
|
40
|
-
boxVertex:
|
|
41
|
-
boxVertexes:
|
|
42
|
-
checkFiveModelLoaded:
|
|
35
|
+
absoluteUrl: j,
|
|
36
|
+
animeMap: B,
|
|
37
|
+
awaitNextFrame: T,
|
|
38
|
+
blink: L,
|
|
39
|
+
bounding: s,
|
|
40
|
+
boundingBox: b,
|
|
41
|
+
boundingSphere: x,
|
|
42
|
+
boxVertex: c,
|
|
43
|
+
boxVertexes: k,
|
|
44
|
+
checkFiveModelLoaded: n,
|
|
43
45
|
convexHull: t,
|
|
44
|
-
equal:
|
|
45
|
-
getCoordsFromClient:
|
|
46
|
-
getCoordsFromElement:
|
|
46
|
+
equal: H,
|
|
47
|
+
getCoordsFromClient: l,
|
|
48
|
+
getCoordsFromElement: f,
|
|
47
49
|
getFrameTime: _,
|
|
48
50
|
inside: o,
|
|
49
|
-
isAbsoluteURL:
|
|
50
|
-
isModelLike:
|
|
51
|
-
isNil:
|
|
52
|
-
isPanoramaLike:
|
|
53
|
-
lookObject:
|
|
54
|
-
lookPoint:
|
|
55
|
-
nextFrame:
|
|
56
|
-
notNil:
|
|
51
|
+
isAbsoluteURL: O,
|
|
52
|
+
isModelLike: I,
|
|
53
|
+
isNil: v,
|
|
54
|
+
isPanoramaLike: N,
|
|
55
|
+
lookObject: q,
|
|
56
|
+
lookPoint: A,
|
|
57
|
+
nextFrame: y,
|
|
58
|
+
notNil: M,
|
|
57
59
|
pointInPolygon: o,
|
|
58
|
-
reblink:
|
|
59
|
-
requestAnimationFrameInterval:
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
60
|
+
reblink: S,
|
|
61
|
+
requestAnimationFrameInterval: C,
|
|
62
|
+
tag: m,
|
|
63
|
+
tweenProgress: U,
|
|
64
|
+
uuid: h,
|
|
65
|
+
worldBounding: F,
|
|
66
|
+
worldBoundingBox: P,
|
|
67
|
+
worldBoundingSphere: w
|
|
65
68
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
66
69
|
export {
|
|
67
|
-
|
|
70
|
+
ao as index
|
|
68
71
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
function A() {
|
|
2
2
|
console.debug(
|
|
3
|
-
"%c %c@realsee/dnalogel %cv3.50.
|
|
3
|
+
"%c %c@realsee/dnalogel %cv3.50.14",
|
|
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",
|
|
@@ -1,10 +1,22 @@
|
|
|
1
1
|
import type { Five } from '@realsee/five';
|
|
2
2
|
import { type AnyPosition } from './positionToVector3';
|
|
3
3
|
import * as THREE from 'three';
|
|
4
|
+
interface LightTagConfig {
|
|
5
|
+
wrapper?: HTMLElement;
|
|
6
|
+
positionsForRotate?: AnyPosition[];
|
|
7
|
+
namespace?: string;
|
|
8
|
+
}
|
|
4
9
|
export declare class LightTag {
|
|
10
|
+
/**
|
|
11
|
+
* @description 单个标签 dom
|
|
12
|
+
*/
|
|
5
13
|
container: HTMLDivElement;
|
|
6
14
|
visible: boolean;
|
|
7
15
|
enabled: boolean;
|
|
16
|
+
/**
|
|
17
|
+
* @description 标签容器的父容器
|
|
18
|
+
* @default this.five.getElement()?.parentElement
|
|
19
|
+
*/
|
|
8
20
|
wrapper: HTMLElement;
|
|
9
21
|
positionsForRotate?: THREE.Vector3[];
|
|
10
22
|
/**
|
|
@@ -17,6 +29,9 @@ export declare class LightTag {
|
|
|
17
29
|
* @default true
|
|
18
30
|
*/
|
|
19
31
|
simulate3D: boolean;
|
|
32
|
+
/**
|
|
33
|
+
* @description 标签的容器,根据 namespace 区分
|
|
34
|
+
*/
|
|
20
35
|
private tagWrapper;
|
|
21
36
|
private five;
|
|
22
37
|
private originPosition?;
|
|
@@ -25,10 +40,7 @@ export declare class LightTag {
|
|
|
25
40
|
private config;
|
|
26
41
|
private fiveUtil;
|
|
27
42
|
private disposers;
|
|
28
|
-
constructor(five: Five, position?: AnyPosition, config?:
|
|
29
|
-
wrapper?: HTMLElement;
|
|
30
|
-
positionsForRotate?: AnyPosition[];
|
|
31
|
-
});
|
|
43
|
+
constructor(five: Five, position?: AnyPosition, config?: LightTagConfig);
|
|
32
44
|
show(): void;
|
|
33
45
|
hide(): void;
|
|
34
46
|
enable(): void;
|
|
@@ -41,6 +53,5 @@ export declare class LightTag {
|
|
|
41
53
|
private onFiveEveryReady;
|
|
42
54
|
private addResizeListener;
|
|
43
55
|
}
|
|
44
|
-
export declare function tag(five: Five, position: AnyPosition, config?:
|
|
45
|
-
|
|
46
|
-
}): LightTag;
|
|
56
|
+
export declare function tag(five: Five, position: AnyPosition, config?: LightTagConfig): LightTag;
|
|
57
|
+
export {};
|
package/libs/shared-utils/tag.js
CHANGED
|
@@ -1,56 +1,68 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
1
|
+
var u = Object.defineProperty;
|
|
2
|
+
var P = (l, t, e) => t in l ? u(l, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : l[t] = e;
|
|
3
|
+
var i = (l, t, e) => (P(l, 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
|
|
8
|
-
import { FiveUtil as
|
|
5
|
+
import * as g from "three";
|
|
6
|
+
import { vector3ToScreen as f } from "./five/vector3ToScreen.js";
|
|
7
|
+
import { getFiveModel as b } from "./five/getFiveModel.js";
|
|
8
|
+
import { FiveUtil as U } from "./Utils/FiveUtil.js";
|
|
9
9
|
import { _raycaster as m } from "./three/temp.js";
|
|
10
|
-
import { resizeObserver as
|
|
11
|
-
const
|
|
12
|
-
class
|
|
10
|
+
import { resizeObserver as x } from "./dom/resizeObserver.js";
|
|
11
|
+
const E = new g.Vector2();
|
|
12
|
+
class w {
|
|
13
13
|
constructor(t, e, o) {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
14
|
+
/**
|
|
15
|
+
* @description 单个标签 dom
|
|
16
|
+
*/
|
|
17
|
+
i(this, "container");
|
|
18
|
+
i(this, "visible", !1);
|
|
19
|
+
i(this, "enabled", !1);
|
|
20
|
+
/**
|
|
21
|
+
* @description 标签容器的父容器
|
|
22
|
+
* @default this.five.getElement()?.parentElement
|
|
23
|
+
*/
|
|
24
|
+
i(this, "wrapper");
|
|
25
|
+
i(this, "positionsForRotate");
|
|
19
26
|
/**
|
|
20
27
|
* @description 碰撞检测
|
|
21
28
|
* @default true
|
|
22
29
|
*/
|
|
23
|
-
|
|
30
|
+
i(this, "intersectCheck", !0);
|
|
24
31
|
/**
|
|
25
32
|
* @description 模拟3D
|
|
26
33
|
* @default true
|
|
27
34
|
*/
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
35
|
+
i(this, "simulate3D", !1);
|
|
36
|
+
/**
|
|
37
|
+
* @description 标签的容器,根据 namespace 区分
|
|
38
|
+
*/
|
|
39
|
+
i(this, "tagWrapper");
|
|
40
|
+
i(this, "five");
|
|
41
|
+
i(this, "originPosition");
|
|
42
|
+
i(this, "transformedPosition");
|
|
43
|
+
i(this, "disposer");
|
|
44
|
+
i(this, "config");
|
|
45
|
+
i(this, "fiveUtil");
|
|
46
|
+
i(this, "disposers", []);
|
|
47
|
+
i(this, "onCameraUpdate", () => {
|
|
38
48
|
this.visible !== !1 && this.updateScreenPosition();
|
|
39
49
|
});
|
|
40
|
-
|
|
50
|
+
i(this, "onFiveEveryReady", () => {
|
|
41
51
|
var t;
|
|
42
52
|
if (this.intersectCheck && this.visible && this.five.state.mode !== "Panorama") {
|
|
43
|
-
let e = 0.01;
|
|
44
|
-
this.fiveUtil.workUtil.fromType === "poincare" && (
|
|
45
|
-
const
|
|
46
|
-
|
|
53
|
+
let e = !1, o = 0.01;
|
|
54
|
+
this.fiveUtil.workUtil.fromType === "poincare" && (o = 0.05);
|
|
55
|
+
const a = this.transformedPosition.clone().sub(this.five.camera.position).normalize();
|
|
56
|
+
m.set(this.five.camera.position, a);
|
|
57
|
+
const n = (t = b(this.five).intersectRaycaster(m)) == null ? void 0 : t[0];
|
|
58
|
+
n ? e = (n == null ? void 0 : n.distance) + o > this.transformedPosition.distanceTo(this.five.camera.position) : e = !0, e ? (this.container.style.opacity = "1", this.container.style.pointerEvents = "auto") : (this.container.style.opacity = "0", this.container.style.pointerEvents = "none");
|
|
47
59
|
}
|
|
48
60
|
});
|
|
49
|
-
var
|
|
50
|
-
this.five = t, this.fiveUtil = (
|
|
51
|
-
const
|
|
52
|
-
return
|
|
53
|
-
})(), this.
|
|
61
|
+
var a, n, h;
|
|
62
|
+
this.five = t, this.fiveUtil = (a = t.__fiveUtil__) != null ? a : t.__fiveUtil__ = new U(t), this.originPosition = e ? d(e).clone() : void 0, this.transformedPosition = (n = this.originPosition) == null ? void 0 : n.clone(), this.positionsForRotate = (h = o == null ? void 0 : o.positionsForRotate) == null ? void 0 : h.map((s) => d(s).clone()), this.config = o != null ? o : {}, this.container = (() => {
|
|
63
|
+
const s = document.createElement("div");
|
|
64
|
+
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;
|
|
65
|
+
})(), this.enable(), this.show(), this.addResizeListener();
|
|
54
66
|
}
|
|
55
67
|
show() {
|
|
56
68
|
this.visible = !0, this.container.style.opacity = "1", this.container.style.pointerEvents = "auto", this.onCameraUpdate();
|
|
@@ -59,21 +71,28 @@ class R {
|
|
|
59
71
|
this.visible = !1, this.container.style.opacity = "0", this.container.style.pointerEvents = "none";
|
|
60
72
|
}
|
|
61
73
|
enable() {
|
|
62
|
-
var
|
|
74
|
+
var a, n, h, s, c;
|
|
63
75
|
if (this.enabled)
|
|
64
76
|
return;
|
|
65
|
-
this.enabled = !0, this.wrapper = (
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
77
|
+
this.enabled = !0, this.wrapper = (h = (n = this.config.wrapper) != null ? n : (a = this.five.getElement()) == null ? void 0 : a.parentElement) != null ? h : document.body;
|
|
78
|
+
const t = `light-tag-wrapper-${(c = (s = this.config) == null ? void 0 : s.namespace) != null ? c : "default"}`;
|
|
79
|
+
if (!this.tagWrapper) {
|
|
80
|
+
let p = Array.from(this.wrapper.children).find((r) => r.id === t);
|
|
81
|
+
if (!p) {
|
|
82
|
+
const r = document.createElement("div");
|
|
83
|
+
p = r, r.id = t, 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(p);
|
|
84
|
+
}
|
|
85
|
+
this.tagWrapper = p;
|
|
86
|
+
}
|
|
87
|
+
this.tagWrapper.appendChild(this.container);
|
|
88
|
+
let e = !1;
|
|
89
|
+
const o = () => {
|
|
90
|
+
e || (e = !0, this.five.ready().then(() => {
|
|
91
|
+
this.onFiveEveryReady(), e = !1;
|
|
73
92
|
}));
|
|
74
93
|
};
|
|
75
|
-
this.five.on("cameraUpdate",
|
|
76
|
-
this.five.off("cameraUpdate",
|
|
94
|
+
this.five.on("cameraUpdate", o), this.five.on("cameraUpdate", this.onCameraUpdate), this.disposer = () => {
|
|
95
|
+
this.five.off("cameraUpdate", o), this.five.off("cameraUpdate", this.onCameraUpdate);
|
|
77
96
|
};
|
|
78
97
|
}
|
|
79
98
|
disable() {
|
|
@@ -95,7 +114,7 @@ class R {
|
|
|
95
114
|
this.container.style.left = "-100%", this.container.style.top = "-100%";
|
|
96
115
|
return;
|
|
97
116
|
}
|
|
98
|
-
const t = this.five.renderer.getSize(
|
|
117
|
+
const t = this.five.renderer.getSize(E), e = f(this.five.camera, this.transformedPosition, t);
|
|
99
118
|
if (!e) {
|
|
100
119
|
this.container.style.left = "-100%", this.container.style.top = "-100%";
|
|
101
120
|
return;
|
|
@@ -103,31 +122,31 @@ class R {
|
|
|
103
122
|
const o = (() => {
|
|
104
123
|
if (!this.simulate3D)
|
|
105
124
|
return 1;
|
|
106
|
-
const
|
|
107
|
-
return Math.max(Math.min(1 -
|
|
108
|
-
})(),
|
|
125
|
+
const n = 2 * Math.tan(0.5 * this.five.camera.fov / 180 * Math.PI), h = this.transformedPosition.distanceTo(this.five.camera.position);
|
|
126
|
+
return Math.max(Math.min(1 - n * h / 40, 1), 0.5);
|
|
127
|
+
})(), a = (() => {
|
|
109
128
|
if (this.positionsForRotate === void 0 || this.positionsForRotate.length !== 2)
|
|
110
129
|
return 0;
|
|
111
|
-
const [
|
|
112
|
-
if (!
|
|
130
|
+
const [n, h] = this.positionsForRotate, s = f(this.five.camera, n, t), c = f(this.five.camera, h, t);
|
|
131
|
+
if (!s || !c)
|
|
113
132
|
return 0;
|
|
114
|
-
const p =
|
|
115
|
-
return Math.atan2(
|
|
133
|
+
const p = s.leftPx > c.leftPx ? c : s, r = s.leftPx > c.leftPx ? s : c, v = r.leftPx - p.leftPx, y = r.topPx - p.topPx;
|
|
134
|
+
return Math.atan2(y, v) * (180 / Math.PI);
|
|
116
135
|
})();
|
|
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})`,
|
|
136
|
+
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})`, a && (this.container.style.transform += ` rotate(${a}deg)`);
|
|
118
137
|
}
|
|
119
138
|
addResizeListener() {
|
|
120
139
|
const t = this.five.getElement();
|
|
121
140
|
if (t) {
|
|
122
|
-
const { observe: e, unobserve: o } =
|
|
141
|
+
const { observe: e, unobserve: o } = x(this.onCameraUpdate, t);
|
|
123
142
|
e(), this.disposers.push(o);
|
|
124
143
|
}
|
|
125
144
|
}
|
|
126
145
|
}
|
|
127
|
-
function
|
|
128
|
-
return new
|
|
146
|
+
function S(l, t, e) {
|
|
147
|
+
return new w(l, t, e);
|
|
129
148
|
}
|
|
130
149
|
export {
|
|
131
|
-
|
|
132
|
-
|
|
150
|
+
w as LightTag,
|
|
151
|
+
S as tag
|
|
133
152
|
};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import "hammerjs";
|
|
2
2
|
import "three";
|
|
3
3
|
import "three/examples/jsm/renderers/CSS3DRenderer";
|
|
4
|
+
import "../tag.js";
|
|
4
5
|
import "@realsee/five/line";
|
|
5
6
|
import "../../vendor/three/examples/jsm/lines/LineGeometry.js";
|
|
6
|
-
import "../tag.js";
|
|
7
7
|
import "./core/Sphere.js";
|
|
8
8
|
import "animejs";
|
|
9
9
|
import "../../vendor/@tweenjs/tween/dist/tween.esm.js.js";
|