endset_three_editor 0.4.0 → 0.4.1
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/dist/three-editor.es.js
CHANGED
|
@@ -1583,6 +1583,7 @@ function _t() {
|
|
|
1583
1583
|
I.selectedObject && (Jt(), I.transformControls.detach(), I.selectedObject = null, Te == null || Te(null));
|
|
1584
1584
|
}
|
|
1585
1585
|
function Ei(r) {
|
|
1586
|
+
Hi(r);
|
|
1586
1587
|
let e;
|
|
1587
1588
|
if (st.forEach((t) => {
|
|
1588
1589
|
t.userData.id == r && (e = t), t.children && t.children.forEach((s) => {
|
|
@@ -1591,7 +1592,7 @@ function Ei(r) {
|
|
|
1591
1592
|
}), !e) return Jt();
|
|
1592
1593
|
e.children.forEach((t) => {
|
|
1593
1594
|
t.name && t.name.startsWith("DataPanel_") && (t.visible = !0);
|
|
1594
|
-
}), Un(e)
|
|
1595
|
+
}), Un(e);
|
|
1595
1596
|
}
|
|
1596
1597
|
function Ri(r) {
|
|
1597
1598
|
if (Oe) {
|
|
@@ -1627,33 +1628,38 @@ function Si(r) {
|
|
|
1627
1628
|
return r;
|
|
1628
1629
|
}
|
|
1629
1630
|
function Hi(r, e = 500) {
|
|
1631
|
+
var d;
|
|
1630
1632
|
if (!I.camera || !I.orbitControls) return;
|
|
1631
|
-
let t
|
|
1632
|
-
|
|
1633
|
-
|
|
1634
|
-
|
|
1635
|
-
|
|
1636
|
-
|
|
1637
|
-
const
|
|
1633
|
+
let t;
|
|
1634
|
+
(d = I.scene) == null || d.traverse((m) => {
|
|
1635
|
+
m.userData.id == r && (t = m);
|
|
1636
|
+
});
|
|
1637
|
+
let s = null;
|
|
1638
|
+
t.userData.closeUpView && typeof t.userData.closeUpView.x == "number" && typeof t.userData.closeUpView.y == "number" && typeof t.userData.closeUpView.z == "number" && (s = t.userData.closeUpView);
|
|
1639
|
+
const n = new P.Vector3();
|
|
1640
|
+
t.getWorldPosition(n);
|
|
1641
|
+
const o = new P.Box3().setFromObject(t).getSize(new P.Vector3()), a = Math.max(o.x, o.y, o.z) * 0.5, l = Math.max(a * 3.5, 5), c = new P.Vector3().copy(I.camera.position).sub(n).normalize();
|
|
1642
|
+
c.lengthSq() < 1e-3 && c.set(0, 0, 1);
|
|
1643
|
+
const A = n.clone().add(c.multiplyScalar(l)), u = I.camera.position.clone(), h = I.orbitControls.target.clone();
|
|
1638
1644
|
new nt.Tween({
|
|
1639
|
-
x:
|
|
1640
|
-
y:
|
|
1641
|
-
z:
|
|
1642
|
-
tx:
|
|
1643
|
-
ty:
|
|
1644
|
-
tz:
|
|
1645
|
+
x: u.x,
|
|
1646
|
+
y: u.y,
|
|
1647
|
+
z: u.z,
|
|
1648
|
+
tx: h.x,
|
|
1649
|
+
ty: h.y,
|
|
1650
|
+
tz: h.z
|
|
1645
1651
|
}).to(
|
|
1646
1652
|
{
|
|
1647
|
-
x:
|
|
1648
|
-
y:
|
|
1649
|
-
z:
|
|
1650
|
-
tx:
|
|
1651
|
-
ty:
|
|
1652
|
-
tz:
|
|
1653
|
+
x: s ? s.x : A.x,
|
|
1654
|
+
y: s ? s.y : A.y,
|
|
1655
|
+
z: s ? s.z : A.z,
|
|
1656
|
+
tx: n.x,
|
|
1657
|
+
ty: n.y,
|
|
1658
|
+
tz: n.z
|
|
1653
1659
|
},
|
|
1654
1660
|
e
|
|
1655
|
-
).easing(nt.Easing.Quadratic.InOut).onUpdate((
|
|
1656
|
-
I.camera.position.set(
|
|
1661
|
+
).easing(nt.Easing.Quadratic.InOut).onUpdate((m) => {
|
|
1662
|
+
I.camera.position.set(m.x, m.y, m.z), I.orbitControls.target.set(m.tx, m.ty, m.tz), I.orbitControls.update();
|
|
1657
1663
|
}).start();
|
|
1658
1664
|
}
|
|
1659
1665
|
function Li(r) {
|