@d5techs/3dgs-lib 1.4.26 → 1.4.27

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 CHANGED
@@ -764,6 +764,9 @@ const _OrbitControls = class _OrbitControls {
764
764
  if (this.enableDamping) {
765
765
  this.velocityTheta += -deltaX * this.rotateSpeed;
766
766
  this.velocityPhi += -deltaY * this.rotateSpeed;
767
+ const maxRotVel = 0.5;
768
+ this.velocityTheta = Math.max(-maxRotVel, Math.min(maxRotVel, this.velocityTheta));
769
+ this.velocityPhi = Math.max(-maxRotVel, Math.min(maxRotVel, this.velocityPhi));
767
770
  } else {
768
771
  this.theta -= deltaX * this.rotateSpeed;
769
772
  this.phi -= deltaY * this.rotateSpeed;
@@ -782,9 +785,15 @@ const _OrbitControls = class _OrbitControls {
782
785
  onWheel(e) {
783
786
  e.preventDefault();
784
787
  if (!this.enabled) return;
785
- const zoomDelta = e.deltaY * this.zoomSpeed;
788
+ let delta = e.deltaY;
789
+ if (e.deltaMode === 1) delta *= 40;
790
+ else if (e.deltaMode === 2) delta *= 800;
791
+ const normalizedDelta = Math.sign(delta) * Math.min(Math.abs(delta), 150);
792
+ const zoomDelta = normalizedDelta * this.zoomSpeed;
786
793
  if (this.enableDamping) {
787
794
  this.velocityDistance += zoomDelta;
795
+ const maxVelocity = 2;
796
+ this.velocityDistance = Math.max(-maxVelocity, Math.min(maxVelocity, this.velocityDistance));
788
797
  } else {
789
798
  this.distance *= Math.exp(zoomDelta);
790
799
  this.distance = Math.max(