@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.js
CHANGED
|
@@ -623,7 +623,7 @@ const _OrbitControls = class _OrbitControls {
|
|
|
623
623
|
__publicField(this, "maxPhi", Math.PI - 0.01);
|
|
624
624
|
// 灵敏度
|
|
625
625
|
__publicField(this, "rotateSpeed", 5e-3);
|
|
626
|
-
__publicField(this, "zoomSpeed",
|
|
626
|
+
__publicField(this, "zoomSpeed", 15e-4);
|
|
627
627
|
__publicField(this, "panSpeed", 5e-3);
|
|
628
628
|
// 移动端触摸灵敏度
|
|
629
629
|
__publicField(this, "touchZoomSpeed", 0.01);
|
|
@@ -737,9 +737,10 @@ const _OrbitControls = class _OrbitControls {
|
|
|
737
737
|
const dx = -deltaX * scale;
|
|
738
738
|
const dy = deltaY * scale;
|
|
739
739
|
if (this.enableDamping) {
|
|
740
|
-
|
|
741
|
-
this.
|
|
742
|
-
this.
|
|
740
|
+
const d = this.dampingFactor;
|
|
741
|
+
this.deltaPanX += (dx * right[0] + dy * up[0]) * d;
|
|
742
|
+
this.deltaPanY += (dx * right[1] + dy * up[1]) * d;
|
|
743
|
+
this.deltaPanZ += (dx * right[2] + dy * up[2]) * d;
|
|
743
744
|
} else {
|
|
744
745
|
this.camera.target[0] += dx * right[0] + dy * up[0];
|
|
745
746
|
this.camera.target[1] += dx * right[1] + dy * up[1];
|
|
@@ -760,8 +761,8 @@ const _OrbitControls = class _OrbitControls {
|
|
|
760
761
|
this.lastY = e.clientY;
|
|
761
762
|
if (e.buttons === 1) {
|
|
762
763
|
if (this.enableDamping) {
|
|
763
|
-
this.deltaTheta += -deltaX * this.rotateSpeed;
|
|
764
|
-
this.deltaPhi += -deltaY * this.rotateSpeed;
|
|
764
|
+
this.deltaTheta += -deltaX * this.rotateSpeed * this.dampingFactor;
|
|
765
|
+
this.deltaPhi += -deltaY * this.rotateSpeed * this.dampingFactor;
|
|
765
766
|
} else {
|
|
766
767
|
this.theta -= deltaX * this.rotateSpeed;
|
|
767
768
|
this.phi -= deltaY * this.rotateSpeed;
|
|
@@ -786,7 +787,7 @@ const _OrbitControls = class _OrbitControls {
|
|
|
786
787
|
const normalizedDelta = Math.sign(delta) * Math.min(Math.abs(delta), 120);
|
|
787
788
|
const zoomDelta = normalizedDelta * this.zoomSpeed;
|
|
788
789
|
if (this.enableDamping) {
|
|
789
|
-
this.deltaDistance += zoomDelta;
|
|
790
|
+
this.deltaDistance += zoomDelta * this.dampingFactor;
|
|
790
791
|
} else {
|
|
791
792
|
this.distance *= Math.exp(zoomDelta);
|
|
792
793
|
this.distance = Math.max(
|
|
@@ -921,8 +922,8 @@ const _OrbitControls = class _OrbitControls {
|
|
|
921
922
|
this.lastX = e.touches[0].clientX;
|
|
922
923
|
this.lastY = e.touches[0].clientY;
|
|
923
924
|
if (this.enableDamping) {
|
|
924
|
-
this.deltaTheta += -deltaX * this.rotateSpeed;
|
|
925
|
-
this.deltaPhi += -deltaY * this.rotateSpeed;
|
|
925
|
+
this.deltaTheta += -deltaX * this.rotateSpeed * this.dampingFactor;
|
|
926
|
+
this.deltaPhi += -deltaY * this.rotateSpeed * this.dampingFactor;
|
|
926
927
|
} else {
|
|
927
928
|
this.theta -= deltaX * this.rotateSpeed;
|
|
928
929
|
this.phi -= deltaY * this.rotateSpeed;
|
|
@@ -935,7 +936,7 @@ const _OrbitControls = class _OrbitControls {
|
|
|
935
936
|
if (this.lastTouchDistance > 0) {
|
|
936
937
|
const ratio = currentDistance / this.lastTouchDistance;
|
|
937
938
|
if (this.enableDamping) {
|
|
938
|
-
this.deltaDistance += -Math.log(ratio);
|
|
939
|
+
this.deltaDistance += -Math.log(ratio) * this.dampingFactor;
|
|
939
940
|
} else {
|
|
940
941
|
this.distance /= ratio;
|
|
941
942
|
this.distance = Math.max(
|
|
@@ -951,9 +952,10 @@ const _OrbitControls = class _OrbitControls {
|
|
|
951
952
|
const dx = -deltaX * scale;
|
|
952
953
|
const dy = deltaY * scale;
|
|
953
954
|
if (this.enableDamping) {
|
|
954
|
-
|
|
955
|
-
this.
|
|
956
|
-
this.
|
|
955
|
+
const d = this.dampingFactor;
|
|
956
|
+
this.deltaPanX += (dx * right[0] + dy * up[0]) * d;
|
|
957
|
+
this.deltaPanY += (dx * right[1] + dy * up[1]) * d;
|
|
958
|
+
this.deltaPanZ += (dx * right[2] + dy * up[2]) * d;
|
|
957
959
|
} else {
|
|
958
960
|
this.camera.target[0] += dx * right[0] + dy * up[0];
|
|
959
961
|
this.camera.target[1] += dx * right[1] + dy * up[1];
|