@realsee/dnalogel 3.73.4 → 3.73.5
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 +10 -4
- package/dist/index.cjs.js +21 -21
- package/dist/index.js +252 -244
- package/dist/index.umd.js +20 -20
- package/libs/base/BasePlugin.js +1 -1
- package/libs/shared-utils/Object3DHelper/Controller/ScaleController.js +41 -33
- package/libs/shared-utils/logger.js +1 -1
- package/package.json +1 -1
package/libs/base/BasePlugin.js
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var g = (
|
|
4
|
-
import { BaseController as
|
|
5
|
-
import { RENDER_ORDER as
|
|
1
|
+
var C = Object.defineProperty;
|
|
2
|
+
var S = (v, m, e) => m in v ? C(v, m, { enumerable: !0, configurable: !0, writable: !0, value: e }) : v[m] = e;
|
|
3
|
+
var g = (v, m, e) => (S(v, typeof m != "symbol" ? m + "" : m, e), e);
|
|
4
|
+
import { BaseController as G } from "../Base/BaseController.js";
|
|
5
|
+
import { RENDER_ORDER as E } from "../Constants/RenderOrder.js";
|
|
6
6
|
import * as c from "three";
|
|
7
|
-
import { getMouseRaycaster as
|
|
8
|
-
import { SolidGuideLine as
|
|
9
|
-
import { rayOnLine as
|
|
7
|
+
import { getMouseRaycaster as A } from "../utils/getMouseRaycaster.js";
|
|
8
|
+
import { SolidGuideLine as k } from "../utils/solidGuide.js";
|
|
9
|
+
import { rayOnLine as P } from "../../../Sculpt/utils/three/rayOnLine.js";
|
|
10
10
|
import { worldBoundingBox as I } from "../../three/boundingBox.js";
|
|
11
|
-
import { getNormal as
|
|
12
|
-
var
|
|
13
|
-
class Y extends
|
|
11
|
+
import { getNormal as H } from "../../three/getNormal.js";
|
|
12
|
+
var L, w;
|
|
13
|
+
class Y extends G {
|
|
14
14
|
constructor(...e) {
|
|
15
15
|
super(...e);
|
|
16
16
|
g(this, "name", "ScaleController");
|
|
@@ -18,7 +18,7 @@ class Y extends A {
|
|
|
18
18
|
g(this, "dragGuideLine");
|
|
19
19
|
/** 当前拖拽时显示的面片 */
|
|
20
20
|
g(this, "currentFacePatch");
|
|
21
|
-
g(this, "solidGuide", new
|
|
21
|
+
g(this, "solidGuide", new k(this.camera, this.container, (w = (L = this.config) == null ? void 0 : L.solidGuide) != null ? w : {}));
|
|
22
22
|
g(this, "startInfo");
|
|
23
23
|
g(this, "dragStart", (e) => {
|
|
24
24
|
if (this.isDragging)
|
|
@@ -30,20 +30,20 @@ class Y extends A {
|
|
|
30
30
|
i = i.parent;
|
|
31
31
|
const n = i, o = n.scalePosition.basePosition.clone(), h = n.scalePosition.handlePosition.clone(), l = h.clone().sub(o).clone(), a = new c.Line3(o, o.clone().add(l.normalize().multiplyScalar(5)));
|
|
32
32
|
a.applyMatrix4(this.helperObject3D.matrixWorld);
|
|
33
|
-
const d = new c.Raycaster(r, t.point.clone().sub(r)), p =
|
|
33
|
+
const d = new c.Raycaster(r, t.point.clone().sub(r)), p = P({ raycaster: d, line: a });
|
|
34
34
|
this.startInfo = { line: a, scaleStartPoint: p, draggingObject: n }, this.helperObject3D.scaleMeshes.forEach((u) => {
|
|
35
35
|
u.uuid !== n.uuid && (u.visible = !1);
|
|
36
36
|
}), "hideLineConnections" in this.helperObject3D && typeof this.helperObject3D.hideLineConnections == "function" && this.helperObject3D.hideLineConnections();
|
|
37
37
|
try {
|
|
38
38
|
this.originObject3D.updateMatrixWorld(!0), this.helperObject3D.updateMatrixWorld(!0);
|
|
39
|
-
const u = this.getObjectWorldCenter(),
|
|
40
|
-
this.isRectangleWithEdgeMesh() || this.scene.add(
|
|
39
|
+
const u = this.getObjectWorldCenter(), M = h.clone().applyMatrix4(this.helperObject3D.matrixWorld).clone().sub(u).normalize(), b = u, y = this.solidGuide.createSolidLine(b, M, { color: 16777215, renderOrder: E.DRAG_GUIDE_LINE });
|
|
40
|
+
this.isRectangleWithEdgeMesh() || this.scene.add(y), this.dragGuideLine = y, this.addFaceMesh();
|
|
41
41
|
} catch (u) {
|
|
42
42
|
}
|
|
43
43
|
n.visible = !0, this.hooks.emit("scaleStart");
|
|
44
44
|
});
|
|
45
45
|
g(this, "dragging", (e) => {
|
|
46
|
-
const t = "touches" in e ? e.touches[0].clientX : e.x, r = "touches" in e ? e.touches[0].clientY : e.y, s =
|
|
46
|
+
const t = "touches" in e ? e.touches[0].clientX : e.x, r = "touches" in e ? e.touches[0].clientY : e.y, s = A(this.camera, { x: t, y: r }, this.container), i = this.isMoveControllerDragging();
|
|
47
47
|
if (!this.isDragging && !i && s) {
|
|
48
48
|
this.addHoverFaceMesh(s);
|
|
49
49
|
return;
|
|
@@ -61,26 +61,34 @@ class Y extends A {
|
|
|
61
61
|
const d = this.originObject3D, u = d.geometry.attributes.position;
|
|
62
62
|
if (!u)
|
|
63
63
|
return [];
|
|
64
|
-
const
|
|
65
|
-
for (let
|
|
66
|
-
const
|
|
67
|
-
d.updateMatrixWorld(!0),
|
|
64
|
+
const D = [], M = u.count;
|
|
65
|
+
for (let f = 0; f < M; f++) {
|
|
66
|
+
const j = new c.Vector3().fromBufferAttribute(u, f);
|
|
67
|
+
d.updateMatrixWorld(!0), j.applyMatrix4(d.matrixWorld), D.push(j);
|
|
68
68
|
}
|
|
69
|
-
const
|
|
70
|
-
if (!
|
|
69
|
+
const b = D.slice(0, 4);
|
|
70
|
+
if (!b || b.length < 4)
|
|
71
71
|
return;
|
|
72
|
-
const
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
72
|
+
const y = H(b).normalize(), x = new c.Plane().setFromNormalAndCoplanarPoint(y, b[0]), F = Math.abs(e.ray.direction.dot(y)) < 0.1;
|
|
73
|
+
let O;
|
|
74
|
+
if (F)
|
|
75
|
+
O = P({ raycaster: e, line: t, clampToLine: !1 }).applyMatrix4(new c.Matrix4().getInverse(this.helperObject3D.matrixWorld.clone()));
|
|
76
|
+
else {
|
|
77
|
+
const f = new c.Vector3();
|
|
78
|
+
if (e.ray.intersectPlane(x, f), !f)
|
|
79
|
+
return;
|
|
80
|
+
const j = new c.Matrix4().getInverse(this.helperObject3D.matrixWorld);
|
|
81
|
+
O = f.clone().applyMatrix4(j);
|
|
82
|
+
}
|
|
83
|
+
const W = r.clone().applyMatrix4(new c.Matrix4().getInverse(this.helperObject3D.matrixWorld));
|
|
76
84
|
(h = (o = this.config) == null ? void 0 : o.scaleCallback) == null || h.call(o, {
|
|
77
|
-
intersectPoint:
|
|
85
|
+
intersectPoint: O,
|
|
78
86
|
scalePosition: i,
|
|
79
|
-
offset:
|
|
80
|
-
}), s.position.copy(
|
|
87
|
+
offset: O.clone().sub(W)
|
|
88
|
+
}), s.position.copy(O), this.hooks.emit("scale", new c.Vector3(1, 1, 1));
|
|
81
89
|
return;
|
|
82
90
|
}
|
|
83
|
-
const n =
|
|
91
|
+
const n = P({ raycaster: e, line: t, clampToLine: !1 });
|
|
84
92
|
n.applyMatrix4(new c.Matrix4().getInverse(this.helperObject3D.matrixWorld.clone())), (a = (l = this.config) == null ? void 0 : l.scaleCallback) == null || a.call(l, {
|
|
85
93
|
intersectPoint: n,
|
|
86
94
|
scalePosition: i,
|
|
@@ -159,8 +167,8 @@ class Y extends A {
|
|
|
159
167
|
if (!d.vertices || d.vertices.length < 3)
|
|
160
168
|
continue;
|
|
161
169
|
const p = new c.Vector3();
|
|
162
|
-
for (const
|
|
163
|
-
p.add(
|
|
170
|
+
for (const D of d.vertices)
|
|
171
|
+
p.add(D);
|
|
164
172
|
p.divideScalar(d.vertices.length);
|
|
165
173
|
const u = n.distanceTo(p);
|
|
166
174
|
u < a && (a = u, l = d);
|
|
@@ -290,7 +298,7 @@ class Y extends A {
|
|
|
290
298
|
transparent: !0,
|
|
291
299
|
opacity: 0.45
|
|
292
300
|
}), s = new c.Mesh(t, r);
|
|
293
|
-
return s.renderOrder =
|
|
301
|
+
return s.renderOrder = E.DRAG_FACE_PATCH, this.scene.add(s), this.currentFacePatch = s, this.render(), s;
|
|
294
302
|
}
|
|
295
303
|
}
|
|
296
304
|
export {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
function A() {
|
|
2
2
|
console.debug(
|
|
3
|
-
"%c %c@realsee/dnalogel %cv3.73.
|
|
3
|
+
"%c %c@realsee/dnalogel %cv3.73.5",
|
|
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",
|