@realsee/dnalogel 3.72.5-alpha.3 → 3.72.5-alpha.4
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 +4 -0
- package/dist/Sculpt/Objects/Polygon/index.d.ts +5 -0
- package/dist/index.cjs.js +5 -5
- package/dist/index.js +36 -31
- package/dist/index.umd.js +5 -5
- package/libs/PanoTagPlugin/controller/Tag/PointTag.js +85 -84
- package/libs/PanoTagPlugin/controller/index.js +1 -1
- package/libs/Sculpt/Objects/Polygon/index.d.ts +5 -0
- package/libs/Sculpt/Objects/Polygon/index.js +59 -55
- package/libs/base/BasePlugin.js +1 -1
- package/libs/shared-utils/logger.js +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -43,7 +43,7 @@ import { LineGeometry as yb, LineMaterial as wb, THREE_Line2 as Pb, Line as I0 }
|
|
|
43
43
|
import { GLTFLoader as Cb } from "@realsee/five/gltf-loader";
|
|
44
44
|
function Ib() {
|
|
45
45
|
console.debug(
|
|
46
|
-
"%c %c@realsee/dnalogel %cv3.72.5-alpha.
|
|
46
|
+
"%c %c@realsee/dnalogel %cv3.72.5-alpha.4",
|
|
47
47
|
[
|
|
48
48
|
"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=')",
|
|
49
49
|
"background-repeat: no-repeat",
|
|
@@ -13117,7 +13117,7 @@ let bs = class {
|
|
|
13117
13117
|
/**
|
|
13118
13118
|
* @realsee/dnalogel 版本号
|
|
13119
13119
|
*/
|
|
13120
|
-
f(this, "VERSION", "3.72.5-alpha.
|
|
13120
|
+
f(this, "VERSION", "3.72.5-alpha.4");
|
|
13121
13121
|
f(this, "NAME");
|
|
13122
13122
|
f(this, "five");
|
|
13123
13123
|
f(this, "workUtil");
|
|
@@ -33440,7 +33440,7 @@ class D8 extends Hd {
|
|
|
33440
33440
|
const c = (l = (a = (r = i.style) == null ? void 0 : r.point) == null ? void 0 : a.scale) != null ? l : 1;
|
|
33441
33441
|
this.iconPixelGap = i.style.point.width * c * 1.4 / 2 + 2;
|
|
33442
33442
|
}
|
|
33443
|
-
this.initialTagLine();
|
|
33443
|
+
i.contentType === "Audio" && (this.iconPixelGap = 34 / 2 + 2), this.initialTagLine();
|
|
33444
33444
|
}
|
|
33445
33445
|
initialTagLine() {
|
|
33446
33446
|
var o, r, a;
|
|
@@ -33452,7 +33452,7 @@ class D8 extends Hd {
|
|
|
33452
33452
|
color: new y.Vector3(1, 1, 1),
|
|
33453
33453
|
linewidth: (a = (r = e == null ? void 0 : e.tagNormalLineConfig) == null ? void 0 : r.lineWidth) != null ? a : 1.2,
|
|
33454
33454
|
dashed: !1
|
|
33455
|
-
}), this.tagNormalLine.line.material.transparent = !0, this.tagNormalLine.line.material.depthWrite = !1, this.tagNormalLine.line.material.depthTest = !
|
|
33455
|
+
}), this.tagNormalLine.line.material.transparent = !0, this.tagNormalLine.line.material.depthWrite = !1, this.tagNormalLine.line.material.depthTest = !0, this.tagNormalLine.line.material.dashed = !1, this.tagNormalLine.line.renderOrder = 2, this.tagNormalLine.setResolution(i.width * s, i.height * s), this.tagNormalLine.visible = !1, this.tagNormalLine.name = `tagNormalLine-${this.id}`, this.plugin.group.add(this.tagNormalLine);
|
|
33456
33456
|
}
|
|
33457
33457
|
/**
|
|
33458
33458
|
* @description 展开自己,收起其他标签
|
|
@@ -33506,42 +33506,43 @@ class D8 extends Hd {
|
|
|
33506
33506
|
* 更新标签连线的位置,使其端点与icon保持固定像素距离
|
|
33507
33507
|
* 使用屏幕空间反投影方法,确保任意视角下都保持固定像素距离
|
|
33508
33508
|
*/
|
|
33509
|
-
updateTagNormalLinePosition() {
|
|
33510
|
-
var
|
|
33509
|
+
updateTagNormalLinePosition(e) {
|
|
33510
|
+
var I, z, D, j, T, O, b;
|
|
33511
33511
|
if (!this.screenPosition || !this.tagNormalLine)
|
|
33512
33512
|
return;
|
|
33513
|
-
|
|
33513
|
+
const { force: i = !1 } = e != null ? e : {};
|
|
33514
|
+
if (!(i ? this.state.visible : this.currentVisible)) {
|
|
33514
33515
|
this.tagNormalLine.visible = !1;
|
|
33515
33516
|
return;
|
|
33516
33517
|
}
|
|
33517
|
-
const
|
|
33518
|
-
if (!(this.visible !==
|
|
33519
|
-
const
|
|
33520
|
-
if (!
|
|
33518
|
+
const o = this._lastUpdateCache;
|
|
33519
|
+
if (!(this.visible !== o.visible)) {
|
|
33520
|
+
const C = Math.abs(this.position[0] - o.position[0]) > 1e-3 || Math.abs(this.position[1] - o.position[1]) > 1e-3 || Math.abs(this.position[2] - o.position[2]) > 1e-3, M = Math.abs(((I = this.screenPosition.leftPx) != null ? I : 0) - o.screenLeft) > 0.5 || Math.abs(((z = this.screenPosition.topPx) != null ? z : 0) - o.screenTop) > 0.5 || Math.abs(((D = this.screenPosition.scale) != null ? D : 1) - o.scale) > 2e-3;
|
|
33521
|
+
if (!C && !M)
|
|
33521
33522
|
return;
|
|
33522
33523
|
}
|
|
33523
|
-
|
|
33524
|
-
const
|
|
33524
|
+
o.position = new y.Vector3().fromArray(this.position).toArray(), o.screenLeft = (j = this.screenPosition.leftPx) != null ? j : 0, o.screenTop = (T = this.screenPosition.topPx) != null ? T : 0, o.scale = (O = this.screenPosition.scale) != null ? O : 1, o.visible = this.visible;
|
|
33525
|
+
const a = this.five.renderer.getSize(Dc);
|
|
33525
33526
|
this._temp.lineStart.fromArray(this.originPosition), this._temp.iconPos.fromArray(this.position), this._temp.lineStart.project(this.five.camera), this._temp.iconPos.project(this.five.camera), this._temp.screenDirPixel.set(
|
|
33526
|
-
(this._temp.iconPos.x - this._temp.lineStart.x) *
|
|
33527
|
-
(this._temp.iconPos.y - this._temp.lineStart.y) *
|
|
33527
|
+
(this._temp.iconPos.x - this._temp.lineStart.x) * a.x / 2,
|
|
33528
|
+
(this._temp.iconPos.y - this._temp.lineStart.y) * a.y / 2
|
|
33528
33529
|
);
|
|
33529
|
-
const
|
|
33530
|
+
const l = this._temp.screenDirPixel.length();
|
|
33530
33531
|
this._temp.screenDirPixel.normalize();
|
|
33531
|
-
const
|
|
33532
|
+
const c = this.iconPixelGap * ((b = this.screenPosition.scale) != null ? b : 1);
|
|
33532
33533
|
this._temp.targetNDC.set(
|
|
33533
|
-
(this._temp.iconPos.x *
|
|
33534
|
-
(this._temp.iconPos.y *
|
|
33534
|
+
(this._temp.iconPos.x * a.x / 2 - this._temp.screenDirPixel.x * c) / (a.x / 2),
|
|
33535
|
+
(this._temp.iconPos.y * a.y / 2 - this._temp.screenDirPixel.y * c) / (a.y / 2)
|
|
33535
33536
|
), this._temp.raycaster.setFromCamera(this._temp.targetNDC, this.five.camera);
|
|
33536
|
-
const
|
|
33537
|
-
this._temp.lineStart.fromArray(this.originPosition), this._temp.iconPos.fromArray(this.position), this._temp.lineDir.copy(this._temp.iconPos).sub(this._temp.lineStart).normalize(), this._temp.lineEnd.copy(
|
|
33538
|
-
const
|
|
33539
|
-
let
|
|
33540
|
-
Math.abs(
|
|
33541
|
-
const
|
|
33542
|
-
if (this._temp.lineStart.distanceTo(this._temp.lineEnd) >
|
|
33543
|
-
const
|
|
33544
|
-
this._temp.lineEnd.copy(this._temp.lineStart).lerp(this._temp.iconPos,
|
|
33537
|
+
const h = this._temp.raycaster.ray;
|
|
33538
|
+
this._temp.lineStart.fromArray(this.originPosition), this._temp.iconPos.fromArray(this.position), this._temp.lineDir.copy(this._temp.iconPos).sub(this._temp.lineStart).normalize(), this._temp.lineEnd.copy(h.origin).sub(this._temp.lineStart);
|
|
33539
|
+
const d = h.direction.dot(h.direction), u = h.direction.dot(this._temp.lineDir), g = this._temp.lineDir.dot(this._temp.lineDir), p = h.direction.dot(this._temp.lineEnd), m = this._temp.lineDir.dot(this._temp.lineEnd), v = d * g - u * u;
|
|
33540
|
+
let A = 0;
|
|
33541
|
+
Math.abs(v) > 1e-4 && (A = (u * m - g * p) / v), this._temp.lineEnd.copy(h.origin).add(h.direction.multiplyScalar(Math.max(0, A)));
|
|
33542
|
+
const P = this._temp.lineStart.distanceTo(this._temp.iconPos);
|
|
33543
|
+
if (this._temp.lineStart.distanceTo(this._temp.lineEnd) > P) {
|
|
33544
|
+
const C = Math.max(0, 1 - c / l);
|
|
33545
|
+
this._temp.lineEnd.copy(this._temp.lineStart).lerp(this._temp.iconPos, C);
|
|
33545
33546
|
}
|
|
33546
33547
|
this.tagNormalLine.setPoints(this._temp.lineStart, this._temp.lineEnd), this.tagNormalLine.visible = !0;
|
|
33547
33548
|
}
|
|
@@ -33571,7 +33572,7 @@ class D8 extends Hd {
|
|
|
33571
33572
|
leftPx: (r.x + 1) / 2 * h.x,
|
|
33572
33573
|
topPx: (-r.y + 1) / 2 * h.y,
|
|
33573
33574
|
scale: c
|
|
33574
|
-
}, this.updateTagNormalLinePosition();
|
|
33575
|
+
}, this.updateTagNormalLinePosition({ force: e == null ? void 0 : e.force });
|
|
33575
33576
|
} else
|
|
33576
33577
|
this.screenPosition = null;
|
|
33577
33578
|
this.plugin.addRenderQueue({ type: "TagContainerSvelte", keys: ["tags"] });
|
|
@@ -47245,7 +47246,11 @@ function nu(n, t, e) {
|
|
|
47245
47246
|
var de;
|
|
47246
47247
|
j.length = 0;
|
|
47247
47248
|
let Me = P.length === 0 ? re.point : E.clone();
|
|
47248
|
-
l && (Me = Me.clone().setY(d)), P.push(Me), n.setPoints(P, { closed: !1 }),
|
|
47249
|
+
if (l && (Me = Me.clone().setY(d)), P.push(Me), n.setPoints(P, { closed: !1 }), e != null && e.experimental_self_intersect_check && P.length > 2 && n.isBlank) {
|
|
47250
|
+
P.pop(), n.setPoints(P, { closed: !1 }), v(), console.warn("[Polygon] 检测到自相交,无法添加该点");
|
|
47251
|
+
return;
|
|
47252
|
+
}
|
|
47253
|
+
v(), (de = e == null ? void 0 : e.onPointPlaced) == null || de.call(e, P), z && (S(), s());
|
|
47249
47254
|
}, k = (re) => {
|
|
47250
47255
|
const Me = () => {
|
|
47251
47256
|
u.setPoints([]), g.setPoints([]), n.setPoints(P), t.pointSelectorHelper && t.pointSelectorHelper.magnifier && t.pointSelectorHelper.magnifier.render();
|
|
@@ -53401,7 +53406,7 @@ class Lh extends k8 {
|
|
|
53401
53406
|
var e;
|
|
53402
53407
|
this.tags.length && (this.tags.forEach((i) => {
|
|
53403
53408
|
var s, o, r, a, l, c;
|
|
53404
|
-
(s = i.tag3DContentSvelte) == null || s.dispose(), (r = (o = i.mediaPlane) == null ? void 0 : o.parent) == null || r.remove(i.mediaPlane), (c = (l = (a = i.model) == null ? void 0 : a.object) == null ? void 0 : l.parent) == null || c.remove(i.model.object);
|
|
53409
|
+
(s = i.tag3DContentSvelte) == null || s.dispose(), (r = (o = i.mediaPlane) == null ? void 0 : o.parent) == null || r.remove(i.mediaPlane), (c = (l = (a = i.model) == null ? void 0 : a.object) == null ? void 0 : l.parent) == null || c.remove(i.model.object), this.group.remove(i.tagNormalLine);
|
|
53405
53410
|
}), this.tags = [], this.tagsLengthWillUpdate = !0, this.hooks.emit("tagsLengthChange"), (e = this.TagContainerSvelte) == null || e.$destroy(), this.TagContainerSvelte = void 0, this.disposeAllCSS3DContainer()), this.enabledModelTagSet.clear(), this.cache.clear();
|
|
53406
53411
|
}
|
|
53407
53412
|
/**
|