@d5techs/3dgs-lib 1.4.29 → 1.4.30
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 +15 -13
- package/dist/3dgs-lib.cjs.map +1 -1
- package/dist/3dgs-lib.js +15 -13
- package/dist/3dgs-lib.js.map +1 -1
- package/package.json +1 -1
package/dist/3dgs-lib.cjs
CHANGED
|
@@ -625,7 +625,7 @@ const _OrbitControls = class _OrbitControls {
|
|
|
625
625
|
__publicField(this, "maxPhi", Math.PI - 0.01);
|
|
626
626
|
// 灵敏度
|
|
627
627
|
__publicField(this, "rotateSpeed", 5e-3);
|
|
628
|
-
__publicField(this, "zoomSpeed",
|
|
628
|
+
__publicField(this, "zoomSpeed", 15e-4);
|
|
629
629
|
__publicField(this, "panSpeed", 5e-3);
|
|
630
630
|
// 移动端触摸灵敏度
|
|
631
631
|
__publicField(this, "touchZoomSpeed", 0.01);
|
|
@@ -739,9 +739,10 @@ const _OrbitControls = class _OrbitControls {
|
|
|
739
739
|
const dx = -deltaX * scale;
|
|
740
740
|
const dy = deltaY * scale;
|
|
741
741
|
if (this.enableDamping) {
|
|
742
|
-
|
|
743
|
-
this.
|
|
744
|
-
this.
|
|
742
|
+
const d = this.dampingFactor;
|
|
743
|
+
this.deltaPanX += (dx * right[0] + dy * up[0]) * d;
|
|
744
|
+
this.deltaPanY += (dx * right[1] + dy * up[1]) * d;
|
|
745
|
+
this.deltaPanZ += (dx * right[2] + dy * up[2]) * d;
|
|
745
746
|
} else {
|
|
746
747
|
this.camera.target[0] += dx * right[0] + dy * up[0];
|
|
747
748
|
this.camera.target[1] += dx * right[1] + dy * up[1];
|
|
@@ -762,8 +763,8 @@ const _OrbitControls = class _OrbitControls {
|
|
|
762
763
|
this.lastY = e.clientY;
|
|
763
764
|
if (e.buttons === 1) {
|
|
764
765
|
if (this.enableDamping) {
|
|
765
|
-
this.deltaTheta += -deltaX * this.rotateSpeed;
|
|
766
|
-
this.deltaPhi += -deltaY * this.rotateSpeed;
|
|
766
|
+
this.deltaTheta += -deltaX * this.rotateSpeed * this.dampingFactor;
|
|
767
|
+
this.deltaPhi += -deltaY * this.rotateSpeed * this.dampingFactor;
|
|
767
768
|
} else {
|
|
768
769
|
this.theta -= deltaX * this.rotateSpeed;
|
|
769
770
|
this.phi -= deltaY * this.rotateSpeed;
|
|
@@ -788,7 +789,7 @@ const _OrbitControls = class _OrbitControls {
|
|
|
788
789
|
const normalizedDelta = Math.sign(delta) * Math.min(Math.abs(delta), 120);
|
|
789
790
|
const zoomDelta = normalizedDelta * this.zoomSpeed;
|
|
790
791
|
if (this.enableDamping) {
|
|
791
|
-
this.deltaDistance += zoomDelta;
|
|
792
|
+
this.deltaDistance += zoomDelta * this.dampingFactor;
|
|
792
793
|
} else {
|
|
793
794
|
this.distance *= Math.exp(zoomDelta);
|
|
794
795
|
this.distance = Math.max(
|
|
@@ -923,8 +924,8 @@ const _OrbitControls = class _OrbitControls {
|
|
|
923
924
|
this.lastX = e.touches[0].clientX;
|
|
924
925
|
this.lastY = e.touches[0].clientY;
|
|
925
926
|
if (this.enableDamping) {
|
|
926
|
-
this.deltaTheta += -deltaX * this.rotateSpeed;
|
|
927
|
-
this.deltaPhi += -deltaY * this.rotateSpeed;
|
|
927
|
+
this.deltaTheta += -deltaX * this.rotateSpeed * this.dampingFactor;
|
|
928
|
+
this.deltaPhi += -deltaY * this.rotateSpeed * this.dampingFactor;
|
|
928
929
|
} else {
|
|
929
930
|
this.theta -= deltaX * this.rotateSpeed;
|
|
930
931
|
this.phi -= deltaY * this.rotateSpeed;
|
|
@@ -937,7 +938,7 @@ const _OrbitControls = class _OrbitControls {
|
|
|
937
938
|
if (this.lastTouchDistance > 0) {
|
|
938
939
|
const ratio = currentDistance / this.lastTouchDistance;
|
|
939
940
|
if (this.enableDamping) {
|
|
940
|
-
this.deltaDistance += -Math.log(ratio);
|
|
941
|
+
this.deltaDistance += -Math.log(ratio) * this.dampingFactor;
|
|
941
942
|
} else {
|
|
942
943
|
this.distance /= ratio;
|
|
943
944
|
this.distance = Math.max(
|
|
@@ -953,9 +954,10 @@ const _OrbitControls = class _OrbitControls {
|
|
|
953
954
|
const dx = -deltaX * scale;
|
|
954
955
|
const dy = deltaY * scale;
|
|
955
956
|
if (this.enableDamping) {
|
|
956
|
-
|
|
957
|
-
this.
|
|
958
|
-
this.
|
|
957
|
+
const d = this.dampingFactor;
|
|
958
|
+
this.deltaPanX += (dx * right[0] + dy * up[0]) * d;
|
|
959
|
+
this.deltaPanY += (dx * right[1] + dy * up[1]) * d;
|
|
960
|
+
this.deltaPanZ += (dx * right[2] + dy * up[2]) * d;
|
|
959
961
|
} else {
|
|
960
962
|
this.camera.target[0] += dx * right[0] + dy * up[0];
|
|
961
963
|
this.camera.target[1] += dx * right[1] + dy * up[1];
|