@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.cjs
CHANGED
|
@@ -637,10 +637,9 @@ const _OrbitControls = class _OrbitControls {
|
|
|
637
637
|
__publicField(this, "isDragging", false);
|
|
638
638
|
__publicField(this, "lastX", 0);
|
|
639
639
|
__publicField(this, "lastY", 0);
|
|
640
|
-
//
|
|
640
|
+
// 待应用的增量(每帧全量应用后衰减,实现旋转/平移惯性)
|
|
641
641
|
__publicField(this, "deltaTheta", 0);
|
|
642
642
|
__publicField(this, "deltaPhi", 0);
|
|
643
|
-
__publicField(this, "deltaDistance", 0);
|
|
644
643
|
__publicField(this, "deltaPanX", 0);
|
|
645
644
|
__publicField(this, "deltaPanY", 0);
|
|
646
645
|
__publicField(this, "deltaPanZ", 0);
|
|
@@ -788,16 +787,11 @@ const _OrbitControls = class _OrbitControls {
|
|
|
788
787
|
else if (e.deltaMode === 2) delta *= 800;
|
|
789
788
|
const normalizedDelta = Math.sign(delta) * Math.min(Math.abs(delta), 120);
|
|
790
789
|
const zoomDelta = normalizedDelta * this.zoomSpeed;
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
this.
|
|
795
|
-
|
|
796
|
-
this.minDistance,
|
|
797
|
-
Math.min(this.maxDistance, this.distance)
|
|
798
|
-
);
|
|
799
|
-
this.applySpherical();
|
|
800
|
-
}
|
|
790
|
+
this.distance *= Math.exp(zoomDelta);
|
|
791
|
+
this.distance = Math.max(
|
|
792
|
+
this.minDistance,
|
|
793
|
+
Math.min(this.maxDistance, this.distance)
|
|
794
|
+
);
|
|
801
795
|
}
|
|
802
796
|
onKeyDown(e) {
|
|
803
797
|
var _a2;
|
|
@@ -937,15 +931,11 @@ const _OrbitControls = class _OrbitControls {
|
|
|
937
931
|
const currentCenter = this.getTouchCenter(e.touches);
|
|
938
932
|
if (this.lastTouchDistance > 0) {
|
|
939
933
|
const ratio = currentDistance / this.lastTouchDistance;
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
this.distance
|
|
944
|
-
|
|
945
|
-
this.minDistance,
|
|
946
|
-
Math.min(this.maxDistance, this.distance)
|
|
947
|
-
);
|
|
948
|
-
}
|
|
934
|
+
this.distance /= ratio;
|
|
935
|
+
this.distance = Math.max(
|
|
936
|
+
this.minDistance,
|
|
937
|
+
Math.min(this.maxDistance, this.distance)
|
|
938
|
+
);
|
|
949
939
|
}
|
|
950
940
|
const deltaX = currentCenter.x - this.lastTouchCenter.x;
|
|
951
941
|
const deltaY = currentCenter.y - this.lastTouchCenter.y;
|
|
@@ -1019,15 +1009,6 @@ const _OrbitControls = class _OrbitControls {
|
|
|
1019
1009
|
this.deltaPhi *= decay;
|
|
1020
1010
|
if (Math.abs(this.deltaTheta) < EPS) this.deltaTheta = 0;
|
|
1021
1011
|
if (Math.abs(this.deltaPhi) < EPS) this.deltaPhi = 0;
|
|
1022
|
-
if (Math.abs(this.deltaDistance) > EPS) {
|
|
1023
|
-
this.distance *= Math.exp(this.deltaDistance);
|
|
1024
|
-
this.distance = Math.max(
|
|
1025
|
-
this.minDistance,
|
|
1026
|
-
Math.min(this.maxDistance, this.distance)
|
|
1027
|
-
);
|
|
1028
|
-
this.deltaDistance *= decay;
|
|
1029
|
-
if (Math.abs(this.deltaDistance) < EPS) this.deltaDistance = 0;
|
|
1030
|
-
}
|
|
1031
1012
|
this.camera.target[0] += this.deltaPanX;
|
|
1032
1013
|
this.camera.target[1] += this.deltaPanY;
|
|
1033
1014
|
this.camera.target[2] += this.deltaPanZ;
|
|
@@ -1144,7 +1125,6 @@ const _OrbitControls = class _OrbitControls {
|
|
|
1144
1125
|
clearVelocity() {
|
|
1145
1126
|
this.deltaTheta = 0;
|
|
1146
1127
|
this.deltaPhi = 0;
|
|
1147
|
-
this.deltaDistance = 0;
|
|
1148
1128
|
this.deltaPanX = 0;
|
|
1149
1129
|
this.deltaPanY = 0;
|
|
1150
1130
|
this.deltaPanZ = 0;
|