@realsee/dnalogel 3.76.0 → 3.77.0-alpha.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 +9 -0
- package/dist/Sculpt/Objects/Base/Editor.d.ts +20 -1
- package/dist/Sculpt/Objects/Box/index.d.ts +5 -2
- package/dist/Sculpt/Objects/Rectangle/index.d.ts +7 -4
- package/dist/index.cjs.js +49 -49
- package/dist/index.js +2805 -2740
- package/dist/index.umd.js +32 -32
- package/dist/shared-utils/Object3DHelper/typings/Hooks.d.ts +4 -3
- package/libs/Sculpt/Objects/Base/Editor.d.ts +20 -1
- package/libs/Sculpt/Objects/Base/Editor.js +91 -35
- package/libs/Sculpt/Objects/Box/index.d.ts +5 -2
- package/libs/Sculpt/Objects/Box/index.js +61 -55
- package/libs/Sculpt/Objects/Prism/index.js +48 -47
- package/libs/Sculpt/Objects/Rectangle/index.d.ts +7 -4
- package/libs/Sculpt/Objects/Rectangle/index.js +119 -117
- package/libs/base/BasePlugin.js +5 -5
- package/libs/shared-utils/Object3DHelper/Controller/MoveController.js +1 -1
- package/libs/shared-utils/Object3DHelper/Controller/RectangleScaleController.js +18 -18
- package/libs/shared-utils/Object3DHelper/Controller/RotateController.js +1 -1
- package/libs/shared-utils/Object3DHelper/typings/Hooks.d.ts +4 -3
- package/libs/shared-utils/logger.js +1 -1
- package/package.json +1 -1
|
@@ -2,34 +2,34 @@ var q = Object.defineProperty, G = Object.defineProperties;
|
|
|
2
2
|
var J = Object.getOwnPropertyDescriptors;
|
|
3
3
|
var W = Object.getOwnPropertySymbols;
|
|
4
4
|
var K = Object.prototype.hasOwnProperty, Q = Object.prototype.propertyIsEnumerable;
|
|
5
|
-
var T = (s,
|
|
6
|
-
for (var
|
|
7
|
-
K.call(
|
|
5
|
+
var T = (s, t, e) => t in s ? q(s, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : s[t] = e, f = (s, t) => {
|
|
6
|
+
for (var e in t || (t = {}))
|
|
7
|
+
K.call(t, e) && T(s, e, t[e]);
|
|
8
8
|
if (W)
|
|
9
|
-
for (var
|
|
10
|
-
Q.call(
|
|
9
|
+
for (var e of W(t))
|
|
10
|
+
Q.call(t, e) && T(s, e, t[e]);
|
|
11
11
|
return s;
|
|
12
|
-
},
|
|
13
|
-
var
|
|
14
|
-
var D = (s,
|
|
15
|
-
var
|
|
12
|
+
}, u = (s, t) => G(s, J(t));
|
|
13
|
+
var z = (s, t, e) => (T(s, typeof t != "symbol" ? t + "" : t, e), e);
|
|
14
|
+
var D = (s, t, e) => new Promise((i, m) => {
|
|
15
|
+
var w = (d) => {
|
|
16
16
|
try {
|
|
17
|
-
|
|
18
|
-
} catch (
|
|
19
|
-
|
|
17
|
+
a(e.next(d));
|
|
18
|
+
} catch (P) {
|
|
19
|
+
m(P);
|
|
20
20
|
}
|
|
21
|
-
}, l = (
|
|
21
|
+
}, l = (d) => {
|
|
22
22
|
try {
|
|
23
|
-
|
|
24
|
-
} catch (
|
|
25
|
-
|
|
23
|
+
a(e.throw(d));
|
|
24
|
+
} catch (P) {
|
|
25
|
+
m(P);
|
|
26
26
|
}
|
|
27
|
-
},
|
|
28
|
-
|
|
27
|
+
}, a = (d) => d.done ? i(d.value) : Promise.resolve(d.value).then(w, l);
|
|
28
|
+
a((e = e.apply(s, t)).next());
|
|
29
29
|
});
|
|
30
30
|
import { BaseObject as X } from "../Base/index.js";
|
|
31
31
|
import * as r from "three";
|
|
32
|
-
import { PolylineWithDotsMesh as
|
|
32
|
+
import { PolylineWithDotsMesh as M } from "../../Meshes/Polyline.js";
|
|
33
33
|
import { RectangleMeshEditor as Y } from "../../Editors/RectangleMeshEditor.js";
|
|
34
34
|
import { RectangleMesh as Z } from "../../Meshes/Rectangle.js";
|
|
35
35
|
import { RectangleWithEdgeMesh as B } from "../../Meshes/RectangleWithEdge.js";
|
|
@@ -40,19 +40,19 @@ import { anyPositionToVector3 as j } from "../../../shared-utils/positionToVecto
|
|
|
40
40
|
import { withResolvers as U } from "../../../shared-utils/promise/withResolvers.js";
|
|
41
41
|
import { PolygonMesh as S } from "../../Meshes/Polygon.js";
|
|
42
42
|
import { getNormal as ee } from "../../../shared-utils/three/getNormal.js";
|
|
43
|
-
class
|
|
44
|
-
constructor(
|
|
45
|
-
super(
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
43
|
+
class ye extends X {
|
|
44
|
+
constructor(e, i) {
|
|
45
|
+
super(e, i);
|
|
46
|
+
z(this, "type", "Rectangle");
|
|
47
|
+
z(this, "rectangleMesh");
|
|
48
|
+
z(this, "_editor");
|
|
49
|
+
e && (this.rectangleMesh = new B(f(f({}, e.style), e)), this.add(this.rectangleMesh));
|
|
50
50
|
}
|
|
51
51
|
get editor() {
|
|
52
52
|
return this._editor || (this._editor = new Y(this.rectangleMesh)), this._editor;
|
|
53
53
|
}
|
|
54
54
|
get data() {
|
|
55
|
-
return
|
|
55
|
+
return u(f({}, this.baseData), {
|
|
56
56
|
points: $(this.applyObjectMatrixWorld(this.rectangleMesh.points, this.rectangleMesh)),
|
|
57
57
|
style: {
|
|
58
58
|
color: this.rectangleMesh.color.getHex(),
|
|
@@ -62,142 +62,144 @@ class ge extends X {
|
|
|
62
62
|
}
|
|
63
63
|
});
|
|
64
64
|
}
|
|
65
|
-
setData(
|
|
66
|
-
|
|
65
|
+
setData(e) {
|
|
66
|
+
e.points && this.rectangleMesh.setPoints(this.applyObjectReversalMatrixWorld(e.points.map(j), this.rectangleMesh)), this.rectangleMesh.setStyle(e.style), this._editor && this._editor.initialHelperMatrix();
|
|
67
67
|
}
|
|
68
68
|
highlight() {
|
|
69
|
-
var
|
|
70
|
-
(
|
|
69
|
+
var e;
|
|
70
|
+
(e = this.rectangleMesh) == null || e.highlight();
|
|
71
71
|
}
|
|
72
72
|
unhighlight() {
|
|
73
|
-
var
|
|
74
|
-
(
|
|
73
|
+
var e;
|
|
74
|
+
(e = this.rectangleMesh) == null || e.unhighlight();
|
|
75
75
|
}
|
|
76
|
-
create(
|
|
76
|
+
create(e) {
|
|
77
77
|
return D(this, null, function* () {
|
|
78
78
|
this.removeChildren();
|
|
79
|
-
const
|
|
80
|
-
this.rectangleMesh =
|
|
79
|
+
const i = new B(e);
|
|
80
|
+
this.rectangleMesh = i, this.add(this.rectangleMesh), yield te(this.rectangleMesh, this.pointSelector, e), this.config.defaultAction && this.editor.enable();
|
|
81
81
|
});
|
|
82
82
|
}
|
|
83
83
|
}
|
|
84
|
-
function te(s,
|
|
85
|
-
var
|
|
86
|
-
return ((
|
|
84
|
+
function te(s, t, e) {
|
|
85
|
+
var m;
|
|
86
|
+
return ((m = e == null ? void 0 : e.drawMethod) != null ? m : "diagonal") === "diagonal" ? se(s, t, e) : oe(s, t, e);
|
|
87
87
|
}
|
|
88
|
-
function ne(s,
|
|
89
|
-
const
|
|
90
|
-
return s.scene.traverse((
|
|
91
|
-
var
|
|
92
|
-
if (
|
|
93
|
-
const
|
|
94
|
-
const
|
|
95
|
-
return
|
|
88
|
+
function ne(s, t) {
|
|
89
|
+
const e = [];
|
|
90
|
+
return s.scene.traverse((i) => {
|
|
91
|
+
var m;
|
|
92
|
+
if (i.visible && !((m = t == null ? void 0 : t.excludes) != null && m.includes(i)) && (i instanceof Z || i instanceof S)) {
|
|
93
|
+
const w = i.points.map((l) => {
|
|
94
|
+
const a = new r.Face3(l.x, l.y, l.z, i.normal);
|
|
95
|
+
return i.style.occlusionVisibility && (a.IsAlwaysVisible = !0), a;
|
|
96
96
|
});
|
|
97
|
-
|
|
97
|
+
e.push(...w);
|
|
98
98
|
}
|
|
99
|
-
}),
|
|
99
|
+
}), e;
|
|
100
100
|
}
|
|
101
|
-
function se(s,
|
|
102
|
-
var
|
|
103
|
-
const { promise:
|
|
101
|
+
function se(s, t, e) {
|
|
102
|
+
var A;
|
|
103
|
+
const { promise: i, reject: m, resolve: w } = U(), l = s.parent;
|
|
104
104
|
if (!l)
|
|
105
|
-
return
|
|
106
|
-
const
|
|
107
|
-
l.add(
|
|
108
|
-
const
|
|
109
|
-
let
|
|
110
|
-
const
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
105
|
+
return m(new Error("No container"));
|
|
106
|
+
const a = (A = e == null ? void 0 : e.limit) != null ? A : "none", d = new M(u(f({}, s.style), { dashed: !0 })), P = new M(u(f({}, s.style), { dashed: !0, lengthEnable: !1 })), y = new M(u(f({}, s.style), { dashed: !1, lengthEnable: !1 }));
|
|
107
|
+
l.add(d, y, P), t.enable();
|
|
108
|
+
const n = [];
|
|
109
|
+
let h = new r.Vector3(), b = new r.Vector3();
|
|
110
|
+
const c = new r.Plane(), x = () => {
|
|
111
|
+
var o;
|
|
112
|
+
n.push(h.clone()), (o = e == null ? void 0 : e.onPointPlaced) == null || o.call(e), n.length === 1 ? (a === "xoz" && c.setFromNormalAndCoplanarPoint(new r.Vector3(0, 1, 0), n[0]), a === "none" && c.setFromNormalAndCoplanarPoint(b, n[0])) : n.length === 2 ? a === "y" || a === "xoz" ? (v(), w()) : y.setPoints([n[0], n[1]]) : n.length === 3 && (v(), w());
|
|
113
|
+
}, E = (o) => {
|
|
114
|
+
var R, N;
|
|
114
115
|
if (!(o != null && o.raycaster))
|
|
115
116
|
return;
|
|
116
|
-
const
|
|
117
|
-
if (
|
|
118
|
-
|
|
117
|
+
const L = (R = n.at(-1)) == null ? void 0 : R.clone();
|
|
118
|
+
if (n.length === 0) {
|
|
119
|
+
h = o.point.clone(), b = (N = o.face) == null ? void 0 : N.normal;
|
|
119
120
|
return;
|
|
120
121
|
}
|
|
121
|
-
if (
|
|
122
|
-
const
|
|
123
|
-
s.setPoints([
|
|
122
|
+
if (n.length === 1 && a === "y") {
|
|
123
|
+
const p = new r.Line3(new r.Vector3(0, 1, 0).add(n[0]), new r.Vector3(0, -1, 0).add(n[0])).closestPointToPoint(o.point, !1, new r.Vector3());
|
|
124
|
+
s.setPoints([n[0], p, o.point]);
|
|
124
125
|
return;
|
|
125
126
|
}
|
|
126
|
-
if (
|
|
127
|
-
const
|
|
128
|
-
s.setPoints([
|
|
127
|
+
if (n.length === 1 && a === "xoz") {
|
|
128
|
+
const V = new r.Line3(new r.Vector3(1, 0, 0).add(n[0]), new r.Vector3(-1, 0, 0).add(n[0])), p = o.raycaster.ray.intersectPlane(c, new r.Vector3()), g = V.closestPointToPoint(p, !1, new r.Vector3());
|
|
129
|
+
s.setPoints([n[0], g, p]);
|
|
129
130
|
return;
|
|
130
131
|
}
|
|
131
|
-
if (
|
|
132
|
-
|
|
132
|
+
if (n.length === 1 && a === "none") {
|
|
133
|
+
c ? (h = o.raycaster.ray.intersectPlane(c, new r.Vector3()), P.setPoints([h, o.point])) : h = o.point.clone(), d.setPoints([L, h]);
|
|
133
134
|
return;
|
|
134
135
|
}
|
|
135
|
-
if (
|
|
136
|
-
l.remove(
|
|
137
|
-
const
|
|
138
|
-
|
|
139
|
-
const F = [
|
|
136
|
+
if (n.length === 2 && a === "none") {
|
|
137
|
+
l.remove(d);
|
|
138
|
+
const V = o.raycaster.ray.intersectPlane(c, new r.Vector3()), p = n[0].distanceTo(n[1]) / 2, g = new r.Vector3().lerpVectors(n[0], n[1], 0.5), _ = new r.Vector3().subVectors(V, g).normalize();
|
|
139
|
+
h = new r.Vector3().addVectors(g, _.multiplyScalar(p));
|
|
140
|
+
const F = [n[0], h, n[1]], O = H(F, I.modules.five.camera.position);
|
|
140
141
|
s.setPoints(O);
|
|
141
142
|
return;
|
|
142
143
|
}
|
|
143
144
|
}, v = () => {
|
|
144
|
-
|
|
145
|
-
},
|
|
146
|
-
v(), l == null || l.remove(s),
|
|
145
|
+
t.off("select", x), t.off("intersectionUpdate", E), t.off("disable", C), t.disable(), l == null || l.remove(d, y, P);
|
|
146
|
+
}, C = () => {
|
|
147
|
+
v(), l == null || l.remove(s), m(new Error("Cancelled"));
|
|
147
148
|
};
|
|
148
|
-
return
|
|
149
|
+
return t.on("select", x), t.on("intersectionUpdate", E), t.on("disable", C), i;
|
|
149
150
|
}
|
|
150
|
-
function oe(s,
|
|
151
|
-
var
|
|
152
|
-
const { promise:
|
|
151
|
+
function oe(s, t, e) {
|
|
152
|
+
var A;
|
|
153
|
+
const { promise: i, reject: m, resolve: w } = U(), l = s.parent;
|
|
153
154
|
if (!l)
|
|
154
|
-
return
|
|
155
|
-
const
|
|
156
|
-
l.add(
|
|
157
|
-
const
|
|
158
|
-
let
|
|
159
|
-
const
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
155
|
+
return m(new Error("No container"));
|
|
156
|
+
const a = (A = e == null ? void 0 : e.limit) != null ? A : "none", d = new M(u(f({}, s.style), { dashed: !0 })), P = new M(u(f({}, s.style), { dashed: !0, lengthEnable: !1 })), y = new M(u(f({}, s.style), { dashed: !1, lengthEnable: !1 }));
|
|
157
|
+
l.add(d, y, P), t.enable(), t.setAdherePoints(ne(t.five, { excludes: [s] }));
|
|
158
|
+
const n = [];
|
|
159
|
+
let h = new r.Vector3(), b = new r.Vector3();
|
|
160
|
+
const c = new r.Plane(), x = () => {
|
|
161
|
+
var o;
|
|
162
|
+
if (n.push(h.clone()), (o = e == null ? void 0 : e.onPointPlaced) == null || o.call(e), n.length === 1)
|
|
163
|
+
t.planeMode = "onlyPlane", a === "y" && (t.adhereLine = [new r.Line3(n[0], new r.Vector3(0, 1, 0).add(n[0]))]), a === "xoz" && (c.setFromNormalAndCoplanarPoint(new r.Vector3(0, 1, 0), n[0]), t.plane = c), a === "none" && (c.setFromNormalAndCoplanarPoint(b, n[0]), t.plane = c);
|
|
164
|
+
else if (n.length === 2) {
|
|
165
|
+
t.planeMode = "vertical", a === "y" && (t.adhereLine = []);
|
|
166
|
+
let L = !1;
|
|
167
|
+
n[0].x === n[1].x && n[0].z === n[1].z && (L = !0), a === "y" && !L && (c.setFromCoplanarPoints(n[0], n[1], new r.Vector3(0, 1, 0).add(n[0])), t.plane = c), y.setPoints([n[0], n[1]]);
|
|
166
168
|
} else
|
|
167
|
-
|
|
168
|
-
},
|
|
169
|
-
var
|
|
169
|
+
n.length === 3 && (v(), w());
|
|
170
|
+
}, E = (o) => {
|
|
171
|
+
var R, N, V, p;
|
|
170
172
|
if (!o || !(o != null && o.raycaster))
|
|
171
173
|
return;
|
|
172
|
-
const
|
|
173
|
-
if (
|
|
174
|
-
|
|
174
|
+
const L = (R = n.at(-1)) == null ? void 0 : R.clone();
|
|
175
|
+
if (n.length === 0) {
|
|
176
|
+
h = o.point.clone(), b = (N = o.face) == null ? void 0 : N.normal;
|
|
175
177
|
return;
|
|
176
178
|
}
|
|
177
|
-
if (
|
|
178
|
-
|
|
179
|
+
if (n.length === 1) {
|
|
180
|
+
h = o.point, P.setPoints([(V = o.originalPoint) != null ? V : o.point, o.point]), d.setPoints([L, h]);
|
|
179
181
|
return;
|
|
180
182
|
}
|
|
181
|
-
if (
|
|
182
|
-
if (!
|
|
183
|
-
const k = ee([
|
|
184
|
-
|
|
183
|
+
if (n.length === 2) {
|
|
184
|
+
if (!t.plane) {
|
|
185
|
+
const k = ee([n[0], n[1], o.point]);
|
|
186
|
+
c.setFromNormalAndCoplanarPoint(k, n[0]);
|
|
185
187
|
}
|
|
186
|
-
|
|
187
|
-
const
|
|
188
|
-
|
|
189
|
-
const F = [
|
|
188
|
+
P.setPoints([(p = o.originalPoint) != null ? p : o.point, o.point]);
|
|
189
|
+
const g = new r.Vector3().crossVectors(n[0].clone().sub(n[1]), c.normal).normalize();
|
|
190
|
+
h = new r.Line3(n[1].clone().add(g), n[1].clone().sub(g)).closestPointToPoint(o.point, !1, new r.Vector3());
|
|
191
|
+
const F = [n[0], n[1], h], O = H(F, I.modules.five.camera.position);
|
|
190
192
|
s.setPoints(O);
|
|
191
193
|
return;
|
|
192
194
|
}
|
|
193
195
|
}, v = () => {
|
|
194
|
-
|
|
195
|
-
},
|
|
196
|
-
v(), l == null || l.remove(s),
|
|
196
|
+
t.setAdherePoints([]), t.adhereLine = [], t.adherePlane = [], t.plane = void 0, t.off("select", x), t.off("intersectionUpdate", E), t.off("disable", C), t.disable(), l == null || l.remove(d, y, P);
|
|
197
|
+
}, C = () => {
|
|
198
|
+
v(), l == null || l.remove(s), m(new Error("Cancelled"));
|
|
197
199
|
};
|
|
198
|
-
return
|
|
200
|
+
return t.on("select", x), t.on("intersectionUpdate", E), t.on("disable", C), i;
|
|
199
201
|
}
|
|
200
202
|
export {
|
|
201
|
-
|
|
203
|
+
ye as Rectangle,
|
|
202
204
|
te as createRectangle
|
|
203
205
|
};
|
package/libs/base/BasePlugin.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
var e = Object.defineProperty;
|
|
2
2
|
var s = (o, t, i) => t in o ? e(o, t, { enumerable: !0, configurable: !0, writable: !0, value: i }) : o[t] = i;
|
|
3
3
|
var r = (o, t, i) => (s(o, typeof t != "symbol" ? t + "" : t, i), i);
|
|
4
|
-
import { Subscribe as
|
|
4
|
+
import { Subscribe as l } from "../shared-utils/Subscribe.js";
|
|
5
5
|
import "../shared-utils/tag.js";
|
|
6
6
|
import "three";
|
|
7
7
|
import "../vendor/hammerjs/hammer.js";
|
|
@@ -15,7 +15,7 @@ import "../shared-utils/three/blink.js";
|
|
|
15
15
|
import "../vendor/@tweenjs/tween/dist/tween.esm.js.js";
|
|
16
16
|
import "../CSS3DRenderPlugin/utils/three/CSS3DRender.js";
|
|
17
17
|
import "../vendor/earcut/src/earcut.js";
|
|
18
|
-
import { FiveUtil as
|
|
18
|
+
import { FiveUtil as m } from "../shared-utils/Utils/FiveUtil.js";
|
|
19
19
|
import { DEFAULT_STATIC_PREFIX as p } from "../shared-utils/url/defaultUrls.js";
|
|
20
20
|
import "../shared-utils/five/FivePuppet.js";
|
|
21
21
|
let I = class {
|
|
@@ -23,7 +23,7 @@ let I = class {
|
|
|
23
23
|
/**
|
|
24
24
|
* @realsee/dnalogel 版本号
|
|
25
25
|
*/
|
|
26
|
-
r(this, "VERSION", "3.
|
|
26
|
+
r(this, "VERSION", "3.77.0-alpha.0");
|
|
27
27
|
r(this, "NAME");
|
|
28
28
|
r(this, "five");
|
|
29
29
|
r(this, "workUtil");
|
|
@@ -31,9 +31,9 @@ let I = class {
|
|
|
31
31
|
/**
|
|
32
32
|
* @description: 插件事件钩子
|
|
33
33
|
*/
|
|
34
|
-
r(this, "hooks", new
|
|
34
|
+
r(this, "hooks", new l());
|
|
35
35
|
r(this, "staticPrefix", p);
|
|
36
|
-
this.five = t, this.fiveUtil = new
|
|
36
|
+
this.five = t, this.fiveUtil = new m(t), this.workUtil = this.fiveUtil.workUtil, i != null && i.staticPrefix && (this.staticPrefix = i.staticPrefix);
|
|
37
37
|
}
|
|
38
38
|
set workCode(t) {
|
|
39
39
|
this.workUtil.workCode = t, this.onWorkCodeChange();
|
|
@@ -68,7 +68,7 @@ class z extends B {
|
|
|
68
68
|
}
|
|
69
69
|
}
|
|
70
70
|
const m = o === "plane" ? [] : [o];
|
|
71
|
-
this.helperObject3D.showDraggingHelper(m), this.hooks.emit("moveStart"), this.isDragging = !0;
|
|
71
|
+
this.helperObject3D.showDraggingHelper(m), this.hooks.emit("moveStart", o), this.isDragging = !0;
|
|
72
72
|
});
|
|
73
73
|
h(this, "dragging", (e) => {
|
|
74
74
|
if (!this.isDragging || !this.startInfo)
|
|
@@ -31,31 +31,31 @@ class _ extends Y {
|
|
|
31
31
|
this.helperObject3D.applyHelperScaleMatrix4(t.matrix, t.origin);
|
|
32
32
|
}
|
|
33
33
|
getDragPlane() {
|
|
34
|
-
const t = new D.Plane(),
|
|
35
|
-
if (
|
|
36
|
-
return
|
|
34
|
+
const t = new D.Plane(), e = this.helperObject3D.cornerPositions;
|
|
35
|
+
if (e.length !== 0)
|
|
36
|
+
return e.length < 3 ? t.setFromNormalAndCoplanarPoint(this.originObject3D.getWorldDirection(new o()), e[0]) : t.setFromCoplanarPoints(e[0], e[1], e[2]), t;
|
|
37
37
|
}
|
|
38
|
-
dragStart(t,
|
|
38
|
+
dragStart(t, e) {
|
|
39
39
|
var p, n;
|
|
40
40
|
(n = (p = this.helperObject3D).updatePoints) == null || n.call(p);
|
|
41
41
|
const f = this.getDragPlane();
|
|
42
42
|
if (!f)
|
|
43
43
|
return this.dragEnd();
|
|
44
|
-
this.startInfo = { startPoint: { position:
|
|
44
|
+
this.startInfo = { startPoint: { position: e.position.clone(), direction: e.direction }, plane: f }, this.hooks.emit("scaleStart", e.direction), this.render(), this.isDragging = !0;
|
|
45
45
|
}
|
|
46
46
|
dragging(t) {
|
|
47
47
|
if (!this.isDragging)
|
|
48
48
|
return;
|
|
49
|
-
const
|
|
50
|
-
if (!
|
|
49
|
+
const e = T(this.camera, t, this.container);
|
|
50
|
+
if (!e)
|
|
51
51
|
return this.dragEnd();
|
|
52
|
-
this.scale(
|
|
52
|
+
this.scale(e);
|
|
53
53
|
}
|
|
54
54
|
scale(t) {
|
|
55
55
|
var C, E;
|
|
56
56
|
if (!this.startInfo)
|
|
57
57
|
return;
|
|
58
|
-
const
|
|
58
|
+
const e = this.originObject3D, { startPoint: f, plane: p } = this.startInfo, n = this.helperObject3D.cornerPositions;
|
|
59
59
|
if (n.length < 4)
|
|
60
60
|
return this.dragEnd();
|
|
61
61
|
const g = t.ray.intersectPlane(p, new o());
|
|
@@ -65,30 +65,30 @@ class _ extends Y {
|
|
|
65
65
|
const i = new o(0, 0, 0);
|
|
66
66
|
if (!this.startInfo)
|
|
67
67
|
return i;
|
|
68
|
-
const
|
|
68
|
+
const s = (r === "ew" ? I : y).clone(), c = k.clone().projectOnVector(s), b = g.clone().projectOnVector(s), M = m.clone().projectOnVector(s);
|
|
69
69
|
if (b.equals(c))
|
|
70
70
|
return i;
|
|
71
71
|
if (r === "ns" && typeof this.startInfo.dragPointInCenterBottom != "boolean") {
|
|
72
|
-
const l = new o().subVectors(b, M), O = l.x < 0 &&
|
|
72
|
+
const l = new o().subVectors(b, M), O = l.x < 0 && s.x >= 0, P = l.y < 0 && s.y >= 0, j = l.z < 0 && s.z >= 0;
|
|
73
73
|
this.startInfo.dragPointInCenterBottom = O || P || j;
|
|
74
74
|
}
|
|
75
75
|
if (r === "ew" && typeof this.startInfo.dragPointInCenterLeft != "boolean") {
|
|
76
|
-
const l = new o().subVectors(b, M), O = l.x < 0 &&
|
|
76
|
+
const l = new o().subVectors(b, M), O = l.x < 0 && s.x >= 0, P = l.y < 0 && s.y >= 0, j = l.z < 0 && s.z >= 0;
|
|
77
77
|
this.startInfo.dragPointInCenterLeft = O || P || j;
|
|
78
78
|
}
|
|
79
79
|
const v = new o().subVectors(b, c), N = v.length();
|
|
80
80
|
return N > 0.3 ? (console.warn("offset.length() > 0.3, skipped", N), i) : v;
|
|
81
81
|
}, A = S("ew"), B = S("ns"), V = () => {
|
|
82
82
|
const r = A;
|
|
83
|
-
this.helperObject3D.cornerPositions.forEach((i,
|
|
83
|
+
this.helperObject3D.cornerPositions.forEach((i, s) => {
|
|
84
84
|
var c;
|
|
85
|
-
(c = this.startInfo) != null && c.dragPointInCenterLeft ? (
|
|
85
|
+
(c = this.startInfo) != null && c.dragPointInCenterLeft ? (s === 0 || s === 3) && i.add(r) : (s === 1 || s === 2) && i.add(r);
|
|
86
86
|
});
|
|
87
87
|
}, x = () => {
|
|
88
88
|
const r = B;
|
|
89
|
-
this.helperObject3D.cornerPositions.forEach((i,
|
|
89
|
+
this.helperObject3D.cornerPositions.forEach((i, s) => {
|
|
90
90
|
var c;
|
|
91
|
-
(c = this.startInfo) != null && c.dragPointInCenterBottom ? (
|
|
91
|
+
(c = this.startInfo) != null && c.dragPointInCenterBottom ? (s === 0 || s === 1) && i.add(r) : (s === 2 || s === 3) && i.add(r);
|
|
92
92
|
});
|
|
93
93
|
};
|
|
94
94
|
switch (z) {
|
|
@@ -103,9 +103,9 @@ class _ extends Y {
|
|
|
103
103
|
V(), x();
|
|
104
104
|
}
|
|
105
105
|
const H = new o().subVectors(n[1], n[0]).length() / I.length(), L = new o().subVectors(n[3], n[0]).length() / y.length(), R = new o(H, L, 1), u = new D.Matrix4().scale(R);
|
|
106
|
-
|
|
106
|
+
e.isCSS3DObjectPlus && e.applyScaleMatrix4 ? e.applyScaleMatrix4(u) : e.scale.applyMatrix4(u), f.position.copy(g);
|
|
107
107
|
const q = new o().addVectors(n[0], n[2]).divideScalar(2), F = new o().subVectors(q, m), d = new D.Matrix4().setPosition(F);
|
|
108
|
-
|
|
108
|
+
e.applyMatrix4(d), (C = this.helperObject3D.css3DInstance) == null || C.css3DObject.applyMatrix4(d), (E = this.helperObject3D.plane) == null || E.applyMatrix4(d), this.internalHooks.emit("applyObjectScale", { matrix: u }), this.internalHooks.emit("applyObjectPosition", { matrix: d }), this.render();
|
|
109
109
|
}
|
|
110
110
|
dragEnd() {
|
|
111
111
|
this.isDragging && (this.startInfo = void 0, this.isDragging = !1, "onScaleEnd" in this.helperObject3D && typeof this.helperObject3D.onScaleEnd == "function" && this.helperObject3D.onScaleEnd(), this.hooks.emit("scaleEnd"), this.render());
|
|
@@ -92,7 +92,7 @@ class I extends Q {
|
|
|
92
92
|
angleHelper: s,
|
|
93
93
|
angle: 0,
|
|
94
94
|
helperQuaternion: a.clone()
|
|
95
|
-
}, w = new o.Quaternion(), this.helperObject3D.showDraggingHelper([n]), this.hooks.emit("rotateStart"), this.isDragging = !0;
|
|
95
|
+
}, w = new o.Quaternion(), this.helperObject3D.showDraggingHelper([n]), this.hooks.emit("rotateStart", n), this.isDragging = !0;
|
|
96
96
|
}
|
|
97
97
|
getMatrix() {
|
|
98
98
|
var e, n;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type * as THREE from 'three';
|
|
2
|
+
import type { Direction, Direction4 } from './Direction';
|
|
2
3
|
export type HelperEventMap = {
|
|
3
4
|
wantToMove: (position: THREE.Vector3) => void;
|
|
4
5
|
moveBefore: (position: THREE.Vector3) => THREE.Vector3 | null | undefined;
|
|
@@ -7,9 +8,9 @@ export type HelperEventMap = {
|
|
|
7
8
|
move: (position: THREE.Vector3) => void;
|
|
8
9
|
rotate: (quaternion: THREE.Quaternion) => void;
|
|
9
10
|
scale: (scale: THREE.Vector3) => void;
|
|
10
|
-
moveStart: () => void;
|
|
11
|
-
rotateStart: () => void;
|
|
12
|
-
scaleStart: () => void;
|
|
11
|
+
moveStart: (direction?: Direction) => void;
|
|
12
|
+
rotateStart: (direction?: Direction) => void;
|
|
13
|
+
scaleStart: (direction?: Direction | Direction4) => void;
|
|
13
14
|
moveEnd: () => void;
|
|
14
15
|
rotateEnd: () => void;
|
|
15
16
|
scaleEnd: () => void;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
function A() {
|
|
2
2
|
console.debug(
|
|
3
|
-
"%c %c@realsee/dnalogel %cv3.
|
|
3
|
+
"%c %c@realsee/dnalogel %cv3.77.0-alpha.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",
|