@d5techs/3dgs-lib 1.4.30 → 1.4.31
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 +11 -31
- package/dist/3dgs-lib.cjs.map +1 -1
- package/dist/3dgs-lib.js +11 -31
- package/dist/3dgs-lib.js.map +1 -1
- package/dist/core/OrbitControls.d.ts +0 -1
- package/package.json +1 -1
package/dist/3dgs-lib.js
CHANGED
|
@@ -635,10 +635,9 @@ const _OrbitControls = class _OrbitControls {
|
|
|
635
635
|
__publicField(this, "isDragging", false);
|
|
636
636
|
__publicField(this, "lastX", 0);
|
|
637
637
|
__publicField(this, "lastY", 0);
|
|
638
|
-
//
|
|
638
|
+
// 待应用的增量(每帧全量应用后衰减,实现旋转/平移惯性)
|
|
639
639
|
__publicField(this, "deltaTheta", 0);
|
|
640
640
|
__publicField(this, "deltaPhi", 0);
|
|
641
|
-
__publicField(this, "deltaDistance", 0);
|
|
642
641
|
__publicField(this, "deltaPanX", 0);
|
|
643
642
|
__publicField(this, "deltaPanY", 0);
|
|
644
643
|
__publicField(this, "deltaPanZ", 0);
|
|
@@ -786,16 +785,11 @@ const _OrbitControls = class _OrbitControls {
|
|
|
786
785
|
else if (e.deltaMode === 2) delta *= 800;
|
|
787
786
|
const normalizedDelta = Math.sign(delta) * Math.min(Math.abs(delta), 120);
|
|
788
787
|
const zoomDelta = normalizedDelta * this.zoomSpeed;
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
this.
|
|
793
|
-
|
|
794
|
-
this.minDistance,
|
|
795
|
-
Math.min(this.maxDistance, this.distance)
|
|
796
|
-
);
|
|
797
|
-
this.applySpherical();
|
|
798
|
-
}
|
|
788
|
+
this.distance *= Math.exp(zoomDelta);
|
|
789
|
+
this.distance = Math.max(
|
|
790
|
+
this.minDistance,
|
|
791
|
+
Math.min(this.maxDistance, this.distance)
|
|
792
|
+
);
|
|
799
793
|
}
|
|
800
794
|
onKeyDown(e) {
|
|
801
795
|
var _a2;
|
|
@@ -935,15 +929,11 @@ const _OrbitControls = class _OrbitControls {
|
|
|
935
929
|
const currentCenter = this.getTouchCenter(e.touches);
|
|
936
930
|
if (this.lastTouchDistance > 0) {
|
|
937
931
|
const ratio = currentDistance / this.lastTouchDistance;
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
this.distance
|
|
942
|
-
|
|
943
|
-
this.minDistance,
|
|
944
|
-
Math.min(this.maxDistance, this.distance)
|
|
945
|
-
);
|
|
946
|
-
}
|
|
932
|
+
this.distance /= ratio;
|
|
933
|
+
this.distance = Math.max(
|
|
934
|
+
this.minDistance,
|
|
935
|
+
Math.min(this.maxDistance, this.distance)
|
|
936
|
+
);
|
|
947
937
|
}
|
|
948
938
|
const deltaX = currentCenter.x - this.lastTouchCenter.x;
|
|
949
939
|
const deltaY = currentCenter.y - this.lastTouchCenter.y;
|
|
@@ -1017,15 +1007,6 @@ const _OrbitControls = class _OrbitControls {
|
|
|
1017
1007
|
this.deltaPhi *= decay;
|
|
1018
1008
|
if (Math.abs(this.deltaTheta) < EPS) this.deltaTheta = 0;
|
|
1019
1009
|
if (Math.abs(this.deltaPhi) < EPS) this.deltaPhi = 0;
|
|
1020
|
-
if (Math.abs(this.deltaDistance) > EPS) {
|
|
1021
|
-
this.distance *= Math.exp(this.deltaDistance);
|
|
1022
|
-
this.distance = Math.max(
|
|
1023
|
-
this.minDistance,
|
|
1024
|
-
Math.min(this.maxDistance, this.distance)
|
|
1025
|
-
);
|
|
1026
|
-
this.deltaDistance *= decay;
|
|
1027
|
-
if (Math.abs(this.deltaDistance) < EPS) this.deltaDistance = 0;
|
|
1028
|
-
}
|
|
1029
1010
|
this.camera.target[0] += this.deltaPanX;
|
|
1030
1011
|
this.camera.target[1] += this.deltaPanY;
|
|
1031
1012
|
this.camera.target[2] += this.deltaPanZ;
|
|
@@ -1142,7 +1123,6 @@ const _OrbitControls = class _OrbitControls {
|
|
|
1142
1123
|
clearVelocity() {
|
|
1143
1124
|
this.deltaTheta = 0;
|
|
1144
1125
|
this.deltaPhi = 0;
|
|
1145
|
-
this.deltaDistance = 0;
|
|
1146
1126
|
this.deltaPanX = 0;
|
|
1147
1127
|
this.deltaPanY = 0;
|
|
1148
1128
|
this.deltaPanZ = 0;
|