@d5techs/3dgs-lib 1.4.34 → 1.4.35
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/3dgs-lib.cjs +16 -10
- package/dist/3dgs-lib.cjs.map +1 -1
- package/dist/3dgs-lib.js +16 -10
- package/dist/3dgs-lib.js.map +1 -1
- package/dist/App.d.ts +5 -0
- package/package.json +1 -1
package/dist/3dgs-lib.js
CHANGED
|
@@ -18803,18 +18803,24 @@ class App {
|
|
|
18803
18803
|
return false;
|
|
18804
18804
|
}
|
|
18805
18805
|
this.controls.frameModel(bbox.center, bbox.radius, animate);
|
|
18806
|
-
if (!animate) {
|
|
18807
|
-
const rect = this.canvas.getBoundingClientRect();
|
|
18808
|
-
const hit = this.pickSplatPosition(
|
|
18809
|
-
rect.left + rect.width / 2,
|
|
18810
|
-
rect.top + rect.height / 2
|
|
18811
|
-
);
|
|
18812
|
-
if (hit) {
|
|
18813
|
-
this.controls.setTargetKeepPosition(hit[0], hit[1], hit[2]);
|
|
18814
|
-
}
|
|
18815
|
-
}
|
|
18816
18806
|
return true;
|
|
18817
18807
|
}
|
|
18808
|
+
/**
|
|
18809
|
+
* 将 orbit target 吸附到视口中心的模型表面点,保持相机位置不变。
|
|
18810
|
+
* 用于相机初始化完成后改善缩放手感(target 在表面而非包围盒中心)。
|
|
18811
|
+
*/
|
|
18812
|
+
snapTargetToSurface() {
|
|
18813
|
+
const rect = this.canvas.getBoundingClientRect();
|
|
18814
|
+
const hit = this.pickSplatPosition(
|
|
18815
|
+
rect.left + rect.width / 2,
|
|
18816
|
+
rect.top + rect.height / 2
|
|
18817
|
+
);
|
|
18818
|
+
if (hit) {
|
|
18819
|
+
this.controls.setTargetKeepPosition(hit[0], hit[1], hit[2]);
|
|
18820
|
+
return true;
|
|
18821
|
+
}
|
|
18822
|
+
return false;
|
|
18823
|
+
}
|
|
18818
18824
|
// ============================================
|
|
18819
18825
|
// Gizmo(委托给 GizmoManager)
|
|
18820
18826
|
// ============================================
|