@realsee/dnalogel 3.47.5 → 3.47.6

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.
@@ -6,6 +6,7 @@ export declare class LightTag {
6
6
  visible: boolean;
7
7
  enabled: boolean;
8
8
  wrapper: HTMLElement;
9
+ positionsForRotate?: THREE.Vector3[];
9
10
  private tagWrapper;
10
11
  private five;
11
12
  private originPosition?;
@@ -14,6 +15,7 @@ export declare class LightTag {
14
15
  private config;
15
16
  constructor(five: Five, position?: AnyPosition, config?: {
16
17
  wrapper?: HTMLElement;
18
+ positionsForRotate?: AnyPosition[];
17
19
  });
18
20
  show(): void;
19
21
  hide(): void;
@@ -21,7 +23,7 @@ export declare class LightTag {
21
23
  disable(): void;
22
24
  destroy(): void;
23
25
  setTransformMatrix(matrix: THREE.Matrix4): void;
24
- setPosition(position: THREE.Vector3): void;
26
+ setPosition(position: THREE.Vector3, positionsForRotate?: THREE.Vector3[]): void;
25
27
  updateScreenPosition(): void;
26
28
  private onCameraUpdate;
27
29
  private onFiveEveryReady;
@@ -1,38 +1,37 @@
1
- var C = Object.defineProperty;
2
- var _ = Object.getOwnPropertySymbols;
3
- var I = Object.prototype.hasOwnProperty, R = Object.prototype.propertyIsEnumerable;
4
- var m = (s, o, e) => o in s ? C(s, o, { enumerable: !0, configurable: !0, writable: !0, value: e }) : s[o] = e, b = (s, o) => {
1
+ var _ = Object.defineProperty;
2
+ var b = Object.getOwnPropertySymbols;
3
+ var S = Object.prototype.hasOwnProperty, k = Object.prototype.propertyIsEnumerable;
4
+ var u = (s, o, e) => o in s ? _(s, o, { enumerable: !0, configurable: !0, writable: !0, value: e }) : s[o] = e, f = (s, o) => {
5
5
  for (var e in o || (o = {}))
6
- I.call(o, e) && m(s, e, o[e]);
7
- if (_)
8
- for (var e of _(o))
9
- R.call(o, e) && m(s, e, o[e]);
6
+ S.call(o, e) && u(s, e, o[e]);
7
+ if (b)
8
+ for (var e of b(o))
9
+ k.call(o, e) && u(s, e, o[e]);
10
10
  return s;
11
11
  };
12
- var r = (s, o, e) => (m(s, typeof o != "symbol" ? o + "" : o, e), e);
12
+ var h = (s, o, e) => (u(s, typeof o != "symbol" ? o + "" : o, e), e);
13
13
  import * as d from "three";
14
- import { DEFAULT_LINE_COLOR as P, DEFAULT_LINE_WIDTH as v, DEFAULT_HIGHLIGHT_OPACITY as M } from "../typings/style.js";
15
- import { LineGeometry as D, LineMaterial as V, THREE_Line2 as W } from "../../shared-utils/five/FiveLine.js";
16
- import { anyPositionToVector3 as A } from "../../shared-utils/positionToVector3.js";
17
- import { IObject3D as O } from "../../shared-utils/three/IObject3D.js";
14
+ import { DEFAULT_LINE_COLOR as m, DEFAULT_LINE_WIDTH as M, DEFAULT_HIGHLIGHT_OPACITY as D } from "../typings/style.js";
15
+ import { LineGeometry as y, LineMaterial as w, THREE_Line2 as H } from "../../shared-utils/five/FiveLine.js";
16
+ import { anyPositionToVector3 as C } from "../../shared-utils/positionToVector3.js";
17
+ import { IObject3D as I } from "../../shared-utils/three/IObject3D.js";
18
18
  import "hammerjs";
19
19
  import "three/examples/jsm/renderers/CSS3DRenderer";
20
- import { centerPoint as B } from "../../shared-utils/three/centerPoint.js";
20
+ import { centerPoint as R } from "../../shared-utils/three/centerPoint.js";
21
21
  import "../../shared-utils/three/THREESphere.js";
22
22
  import "animejs";
23
23
  import { notNil as c } from "../../shared-utils/isNil.js";
24
24
  import "../../vendor/@tweenjs/tween/dist/tween.esm.js.js";
25
- import { LightTag as F } from "../../shared-utils/tag.js";
26
- import { globalModules as L } from "../utils/Modules/Global.js";
27
- import { removeAllTag as U } from "../utils/removeAllTag.js";
28
- import { getLengthHTML as z } from "../utils/Meshes/getLengthHTML.js";
29
- import { vector3ToScreen as k } from "../../shared-utils/five/vector3ToScreen.js";
30
- const G = new d.Vector2();
31
- class x extends V {
25
+ import { LightTag as p } from "../../shared-utils/tag.js";
26
+ import { globalModules as x } from "../utils/Modules/Global.js";
27
+ import { removeAllTag as P } from "../utils/removeAllTag.js";
28
+ import { getLengthHTML as V } from "../utils/Meshes/getLengthHTML.js";
29
+ new d.Vector2();
30
+ class E extends w {
32
31
  constructor(e) {
33
32
  var n, t;
34
33
  super(e);
35
- r(this, "_three_color");
34
+ h(this, "_three_color");
36
35
  c(e == null ? void 0 : e.color) && (this.three_color = (n = e == null ? void 0 : e.color) != null ? n : 16777215), Object.keys(e).forEach((i) => {
37
36
  ["color", "dashed", "dashScale", "dashSize", "gapSize", "resolution"].includes(i) || i in this && (this[i] = e[i]);
38
37
  }), this.setDashed((t = e == null ? void 0 : e.dashed) != null ? t : !1);
@@ -47,34 +46,34 @@ class x extends V {
47
46
  this.dashed = e, e ? this.defines.USE_DASH = "" : delete this.defines.USE_DASH, this.needsUpdate = !0;
48
47
  }
49
48
  }
50
- class w extends W {
49
+ class T extends H {
51
50
  constructor(e, n) {
52
51
  super(e, n);
53
- r(this, "name", "Line3");
52
+ h(this, "name", "Line3");
54
53
  }
55
54
  }
56
- class he extends O {
55
+ class X extends I {
57
56
  constructor(e) {
58
- var l, h, f, g, a;
57
+ var l, r, g, a, L;
59
58
  super();
60
- r(this, "name", "LineMesh");
61
- r(this, "points");
62
- r(this, "lengthDoms", []);
63
- r(this, "highlighted", !1);
64
- r(this, "line");
65
- r(this, "backLine");
66
- r(this, "opacityBeforeHighlight");
67
- r(this, "paramsStyle", {});
59
+ h(this, "name", "LineMesh");
60
+ h(this, "points");
61
+ h(this, "lengthDoms", []);
62
+ h(this, "highlighted", !1);
63
+ h(this, "line");
64
+ h(this, "backLine");
65
+ h(this, "opacityBeforeHighlight");
66
+ h(this, "paramsStyle", {});
68
67
  this.paramsStyle = e != null ? e : {};
69
- const n = new D(), t = new x({
70
- color: new d.Color((l = e == null ? void 0 : e.lineColor) != null ? l : P),
71
- linewidth: (h = e == null ? void 0 : e.lineWidth) != null ? h : v,
68
+ const n = new y(), t = new E({
69
+ color: new d.Color((l = e == null ? void 0 : e.lineColor) != null ? l : m),
70
+ linewidth: (r = e == null ? void 0 : e.lineWidth) != null ? r : M,
72
71
  dashScale: 40,
73
- opacity: (f = e == null ? void 0 : e.opacity) != null ? f : 1,
72
+ opacity: (g = e == null ? void 0 : e.opacity) != null ? g : 1,
74
73
  transparent: !0,
75
- dashed: (g = e == null ? void 0 : e.dashed) != null ? g : !1
76
- }), i = new x({
77
- color: new d.Color((a = e == null ? void 0 : e.lineColor) != null ? a : P),
74
+ dashed: (a = e == null ? void 0 : e.dashed) != null ? a : !1
75
+ }), i = new E({
76
+ color: new d.Color((L = e == null ? void 0 : e.lineColor) != null ? L : m),
78
77
  linewidth: t.linewidth * 0.9,
79
78
  dashScale: t.dashScale,
80
79
  opacity: t.opacity * 0.8,
@@ -83,8 +82,8 @@ class he extends O {
83
82
  transparent: !0,
84
83
  resolution: t.resolution
85
84
  });
86
- this.line = new w(n, t), this.backLine = new w(n, i), this.line.renderOrder = 1, this.backLine.renderOrder = 0, this.line.name = "lineFrontMaterial", this.backLine.name = "lineBackMaterial", e && this.setStyle(e), e != null && e.points && this.setPoints(e.points), this.addEventListener("removed", () => {
87
- U(this);
85
+ this.line = new T(n, t), this.backLine = new T(n, i), this.line.renderOrder = 1, this.backLine.renderOrder = 0, this.line.name = "lineFrontMaterial", this.backLine.name = "lineBackMaterial", e && this.setStyle(e), e != null && e.points && this.setPoints(e.points), this.addEventListener("removed", () => {
86
+ P(this);
88
87
  });
89
88
  }
90
89
  get style() {
@@ -113,14 +112,14 @@ class he extends O {
113
112
  return this.line.material.depthTest === !1 ? "depthTest" : "translucence";
114
113
  }
115
114
  setPoints(e) {
116
- const n = e.map(A).filter(c);
115
+ const n = e.map(C).filter(c);
117
116
  if (this.points = n, n.length < 2) {
118
- this.line.geometry = new D(), this.backLine.geometry = this.line.geometry, this.updateLengthItems();
117
+ this.line.geometry = new y(), this.backLine.geometry = this.line.geometry, this.updateLengthItems();
119
118
  return;
120
119
  }
121
120
  this.addIfNotExists(this.line, this.backLine);
122
121
  const t = n.flatMap((i) => [i.x, i.y, i.z]);
123
- t.length > 2 && (this.line.geometry.dispose(), this.line.geometry = new D(), this.backLine.geometry = this.line.geometry), this.line.geometry.setPositions(t), this.line.computeLineDistances(), this.updateLengthItems(), this.needsRender = !0;
122
+ t.length > 2 && (this.line.geometry.dispose(), this.line.geometry = new y(), this.backLine.geometry = this.line.geometry), this.line.geometry.setPositions(t), this.line.computeLineDistances(), this.updateLengthItems(), this.needsRender = !0;
124
123
  }
125
124
  setResolution(e, n) {
126
125
  const t = this.line.material.resolution;
@@ -129,13 +128,13 @@ class he extends O {
129
128
  (i.x !== e || i.y !== n) && (i.set(e, n), this.needsRender = !0);
130
129
  }
131
130
  setStyle(e) {
132
- var i, l, h;
133
- this.paramsStyle = b(b({}, this.paramsStyle), e), c(e.lineColor) && (this.line.material.three_color = new d.Color(e.lineColor), this.backLine.material.three_color = new d.Color(e.lineColor)), c(e.lineWidth) && (this.line.material.linewidth = e.lineWidth), c(e.dashed) && this.line.material.setDashed(e.dashed), c(e.opacity) && (this.line.material.opacity = e.opacity, this.backLine.material.opacity = this.line.material.opacity * 0.2), this.updateLengthItems();
134
- const n = (i = e.occlusionVisibility) != null ? i : this.paramsStyle.occlusionVisibility, t = (h = (l = e.occlusionMode) != null ? l : this.paramsStyle.occlusionMode) != null ? h : "translucence";
131
+ var i, l, r;
132
+ this.paramsStyle = f(f({}, this.paramsStyle), e), c(e.lineColor) && (this.line.material.three_color = new d.Color(e.lineColor), this.backLine.material.three_color = new d.Color(e.lineColor)), c(e.lineWidth) && (this.line.material.linewidth = e.lineWidth), c(e.dashed) && this.line.material.setDashed(e.dashed), c(e.opacity) && (this.line.material.opacity = e.opacity, this.backLine.material.opacity = this.line.material.opacity * 0.2), this.updateLengthItems();
133
+ const n = (i = e.occlusionVisibility) != null ? i : this.paramsStyle.occlusionVisibility, t = (r = (l = e.occlusionMode) != null ? l : this.paramsStyle.occlusionMode) != null ? r : "translucence";
135
134
  n ? t === "depthTest" ? (this.line.material.depthTest = !1, this.backLine.visible = !1) : t === "translucence" && (this.line.material.depthTest = !0, this.backLine.visible = !0, this.line.material.opacity === 1 ? this.backLine.material.setDashed(!0) : this.backLine.material.setDashed(this.line.material.dashed)) : (this.line.material.depthTest = !0, this.backLine.visible = !1), this.needsRender = !0;
136
135
  }
137
136
  highlight() {
138
- this.highlighted || (this.highlighted = !0, this.opacityBeforeHighlight = this.line.material.opacity, this.line.material.opacity = this.opacityBeforeHighlight * M, this.backLine.material.opacity = this.backLine.material.opacity * M, this.needsRender = !0);
137
+ this.highlighted || (this.highlighted = !0, this.opacityBeforeHighlight = this.line.material.opacity, this.line.material.opacity = this.opacityBeforeHighlight * D, this.backLine.material.opacity = this.backLine.material.opacity * D, this.needsRender = !0);
139
138
  }
140
139
  unhighlight() {
141
140
  this.highlighted && (this.highlighted = !1, this.line.material.opacity = this.opacityBeforeHighlight, this.backLine.material.opacity = 0.2, this.needsRender = !0);
@@ -147,18 +146,15 @@ class he extends O {
147
146
  if (l !== 0)
148
147
  return [this.points[l - 1], i];
149
148
  }).filter(c)) != null ? n : [];
150
- t.forEach(([i, l], h) => {
149
+ t.forEach(([i, l], r) => {
151
150
  var a;
152
- const f = B(i, l), g = (() => {
153
- const T = L.five.renderer.getSize(G), u = k(L.five.camera, i, T), y = k(L.five.camera, l, T), E = u.leftPx > y.leftPx ? y : u, S = u.leftPx > y.leftPx ? u : y, H = S.leftPx - E.leftPx, p = S.topPx - E.topPx;
154
- return Math.atan2(p, H) * (180 / Math.PI);
155
- })();
156
- this.lengthDoms[h] = (a = this.lengthDoms[h]) != null ? a : new F(L.five), this.lengthDoms[h].setPosition(f), this.lengthDoms[h].container.style.rotate = g + "deg", this.lengthDoms[h].container.innerHTML = z(i.distanceTo(l).toFixed(2) + "m");
151
+ const g = R(i, l);
152
+ this.lengthDoms[r] = (a = this.lengthDoms[r]) != null ? a : new p(x.five), this.lengthDoms[r].setPosition(g, [i, l]), this.lengthDoms[r].container.innerHTML = V(i.distanceTo(l).toFixed(2) + "m");
157
153
  }), this.lengthDoms.length > t.length && (this.lengthDoms.slice(t.length).forEach((i) => i.destroy()), this.lengthDoms.length = t.length);
158
154
  } else
159
155
  this.lengthDoms.forEach((t) => t.destroy()), this.lengthDoms = [];
160
156
  }
161
157
  }
162
158
  export {
163
- he as LineMesh
159
+ X as LineMesh
164
160
  };
@@ -16,7 +16,7 @@ let c = class {
16
16
  /**
17
17
  * @realsee/dnalogel 版本号
18
18
  */
19
- e(this, "VERSION", "3.47.5");
19
+ e(this, "VERSION", "3.47.6");
20
20
  e(this, "NAME");
21
21
  e(this, "five");
22
22
  e(this, "workUtil");
@@ -1,6 +1,6 @@
1
1
  function A() {
2
2
  console.debug(
3
- "%c %c@realsee/dnalogel %cv3.47.5",
3
+ "%c %c@realsee/dnalogel %cv3.47.6",
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",
@@ -6,6 +6,7 @@ export declare class LightTag {
6
6
  visible: boolean;
7
7
  enabled: boolean;
8
8
  wrapper: HTMLElement;
9
+ positionsForRotate?: THREE.Vector3[];
9
10
  private tagWrapper;
10
11
  private five;
11
12
  private originPosition?;
@@ -14,6 +15,7 @@ export declare class LightTag {
14
15
  private config;
15
16
  constructor(five: Five, position?: AnyPosition, config?: {
16
17
  wrapper?: HTMLElement;
18
+ positionsForRotate?: AnyPosition[];
17
19
  });
18
20
  show(): void;
19
21
  hide(): void;
@@ -21,7 +23,7 @@ export declare class LightTag {
21
23
  disable(): void;
22
24
  destroy(): void;
23
25
  setTransformMatrix(matrix: THREE.Matrix4): void;
24
- setPosition(position: THREE.Vector3): void;
26
+ setPosition(position: THREE.Vector3, positionsForRotate?: THREE.Vector3[]): void;
25
27
  updateScreenPosition(): void;
26
28
  private onCameraUpdate;
27
29
  private onFiveEveryReady;
@@ -1,40 +1,41 @@
1
- var l = Object.defineProperty;
2
- var d = (n, t, e) => t in n ? l(n, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : n[t] = e;
3
- var i = (n, t, e) => (d(n, typeof t != "symbol" ? t + "" : t, e), e);
1
+ var u = Object.defineProperty;
2
+ var g = (h, t, e) => t in h ? u(h, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : h[t] = e;
3
+ var o = (h, t, e) => (g(h, typeof t != "symbol" ? t + "" : t, e), e);
4
4
  import { anyPositionToVector3 as f } from "./positionToVector3.js";
5
- import * as m from "three";
6
- import { vector3ToScreen as v } from "./five/vector3ToScreen.js";
7
- import { getFiveModel as y } from "./five/getFiveModel.js";
8
- import { _raycaster as c } from "./three/raycaster.js";
9
- const p = "LightTagContainer_shgjakdhwakjdhsja", u = new m.Vector2();
10
- class g {
11
- constructor(t, e, s) {
12
- i(this, "container");
13
- i(this, "visible", !1);
14
- i(this, "enabled", !1);
15
- i(this, "wrapper");
16
- i(this, "tagWrapper");
17
- i(this, "five");
18
- i(this, "originPosition");
19
- i(this, "transformedPosition");
20
- i(this, "disposer");
21
- i(this, "config");
22
- i(this, "onCameraUpdate", () => {
5
+ import * as b from "three";
6
+ import { vector3ToScreen as p } from "./five/vector3ToScreen.js";
7
+ import { getFiveModel as x } from "./five/getFiveModel.js";
8
+ import { _raycaster as m } from "./three/raycaster.js";
9
+ const v = "LightTagContainer_shgjakdhwakjdhsja", E = new b.Vector2();
10
+ class w {
11
+ constructor(t, e, i) {
12
+ o(this, "container");
13
+ o(this, "visible", !1);
14
+ o(this, "enabled", !1);
15
+ o(this, "wrapper");
16
+ o(this, "positionsForRotate");
17
+ o(this, "tagWrapper");
18
+ o(this, "five");
19
+ o(this, "originPosition");
20
+ o(this, "transformedPosition");
21
+ o(this, "disposer");
22
+ o(this, "config");
23
+ o(this, "onCameraUpdate", () => {
23
24
  this.visible !== !1 && this.updateScreenPosition();
24
25
  });
25
- i(this, "onFiveEveryReady", () => {
26
+ o(this, "onFiveEveryReady", () => {
26
27
  var t;
27
28
  if (this.visible && this.five.state.mode !== "Panorama") {
28
- c.set(this.five.camera.position, this.transformedPosition.clone().sub(this.five.camera.position));
29
- const s = (t = y(this.five).intersectRaycaster(c)) == null ? void 0 : t[0];
30
- (s == null ? void 0 : s.distance) + 0.01 > 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");
29
+ m.set(this.five.camera.position, this.transformedPosition.clone().sub(this.five.camera.position));
30
+ const i = (t = x(this.five).intersectRaycaster(m)) == null ? void 0 : t[0];
31
+ (i == null ? void 0 : i.distance) + 0.01 > 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");
31
32
  }
32
33
  });
33
- var o;
34
- this.five = t, this.originPosition = e ? f(e).clone() : void 0, this.transformedPosition = (o = this.originPosition) == null ? void 0 : o.clone(), this.container = (() => {
35
- const r = document.createElement("div");
36
- return r.style.width = "0", r.style.height = "0", r.style.position = "absolute", r.style.transition = "opacity 0.2s linear", r;
37
- })(), this.config = s != null ? s : {}, this.enable(), this.show();
34
+ var r, a;
35
+ this.five = t, this.originPosition = e ? f(e).clone() : void 0, this.transformedPosition = (r = this.originPosition) == null ? void 0 : r.clone(), this.positionsForRotate = (a = i == null ? void 0 : i.positionsForRotate) == null ? void 0 : a.map((s) => f(s).clone()), this.container = (() => {
36
+ const s = document.createElement("div");
37
+ return s.style.width = "0", s.style.height = "0", s.style.position = "absolute", s.style.transition = "opacity 0.2s linear", s;
38
+ })(), this.config = i != null ? i : {}, this.enable(), this.show();
38
39
  }
39
40
  show() {
40
41
  this.visible = !0, this.container.style.opacity = "1", this.container.style.pointerEvents = "auto", this.onCameraUpdate();
@@ -43,12 +44,12 @@ class g {
43
44
  this.visible = !1, this.container.style.opacity = "0", this.container.style.pointerEvents = "none";
44
45
  }
45
46
  enable() {
46
- var s, o, r, h;
47
+ var i, r, a, s;
47
48
  if (this.enabled)
48
49
  return;
49
- this.enabled = !0, this.wrapper = (r = (o = this.config.wrapper) != null ? o : (s = this.five.getElement()) == null ? void 0 : s.parentElement) != null ? r : document.body, this.tagWrapper || (this.tagWrapper = (h = document.getElementById(p)) != null ? h : (() => {
50
- const a = document.createElement("div");
51
- return a.id = p, a.style.position = "absolute", a.style.top = "0", a.style.left = "0", a.style.width = "100%", a.style.height = "100%", a.style.pointerEvents = "none", a;
50
+ this.enabled = !0, this.wrapper = (a = (r = this.config.wrapper) != null ? r : (i = this.five.getElement()) == null ? void 0 : i.parentElement) != null ? a : document.body, this.tagWrapper || (this.tagWrapper = (s = document.getElementById(v)) != null ? s : (() => {
51
+ const n = document.createElement("div");
52
+ return n.id = v, n.style.position = "absolute", n.style.top = "0", n.style.left = "0", n.style.width = "100%", n.style.height = "100%", n.style.pointerEvents = "none", n;
52
53
  })(), this.wrapper.contains(this.tagWrapper) || this.wrapper.appendChild(this.tagWrapper)), this.tagWrapper.appendChild(this.container);
53
54
  let t = !1;
54
55
  const e = () => {
@@ -71,30 +72,35 @@ class g {
71
72
  var e;
72
73
  this.transformedPosition = (e = this.originPosition) == null ? void 0 : e.clone().applyMatrix4(t), this.onCameraUpdate();
73
74
  }
74
- setPosition(t) {
75
- this.transformedPosition = t, this.onCameraUpdate();
75
+ setPosition(t, e) {
76
+ this.transformedPosition = t, this.positionsForRotate = e, this.onCameraUpdate();
76
77
  }
77
78
  updateScreenPosition() {
78
79
  if (!this.transformedPosition) {
79
80
  this.container.style.left = "-100%", this.container.style.top = "-100%";
80
81
  return;
81
82
  }
82
- const t = v(this.five.camera, this.transformedPosition, this.five.renderer.getSize(u));
83
- if (!t) {
83
+ const t = this.five.renderer.getSize(E), e = p(this.five.camera, this.transformedPosition, t);
84
+ if (!e) {
84
85
  this.container.style.left = "-100%", this.container.style.top = "-100%";
85
86
  return;
86
87
  }
87
- const e = (() => {
88
- const s = 2 * Math.tan(0.5 * this.five.camera.fov / 180 * Math.PI), o = this.transformedPosition.distanceTo(this.five.camera.position);
89
- return Math.max(Math.min(1 - s * o / 40, 1), 0.5);
88
+ const i = (() => {
89
+ const a = 2 * Math.tan(0.5 * this.five.camera.fov / 180 * Math.PI), s = this.transformedPosition.distanceTo(this.five.camera.position);
90
+ return Math.max(Math.min(1 - a * s / 40, 1), 0.5);
91
+ })(), r = (() => {
92
+ if (this.positionsForRotate === void 0 || this.positionsForRotate.length !== 2)
93
+ return 0;
94
+ const [a, s] = this.positionsForRotate, n = p(this.five.camera, a, t), c = p(this.five.camera, s, t), l = n.leftPx > c.leftPx ? c : n, d = n.leftPx > c.leftPx ? n : c, y = d.leftPx - l.leftPx, P = d.topPx - l.topPx;
95
+ return Math.atan2(P, y) * (180 / Math.PI);
90
96
  })();
91
- this.container.style.left = t.leftPx + "px", this.container.style.top = t.topPx + "px", this.container.style.transform = `scale(${e})`;
97
+ this.container.style.left = e.leftPx + "px", this.container.style.top = e.topPx + "px", this.container.style.transformOrigin = "center", this.container.style.transform = `scale(${i})`, r && (this.container.style.transform += ` rotate(${r}deg)`);
92
98
  }
93
99
  }
94
- function T(n, t, e) {
95
- return new g(n, t, e);
100
+ function M(h, t, e) {
101
+ return new w(h, t, e);
96
102
  }
97
103
  export {
98
- g as LightTag,
99
- T as tag
104
+ w as LightTag,
105
+ M as tag
100
106
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@realsee/dnalogel",
3
- "version": "3.47.5",
3
+ "version": "3.47.6",
4
4
  "main": "./dist/index.js",
5
5
  "module": "./libs/index.js",
6
6
  "types": "./libs/index.d.ts",