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