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