Skip to content

Commit

Permalink
Fix mouse wheel input in orbit camera (#7115)
Browse files Browse the repository at this point in the history
  • Loading branch information
marklundin authored Nov 20, 2024
1 parent bbf72ec commit 9ea8f3a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions scripts/camera/orbit-camera.js
Original file line number Diff line number Diff line change
Expand Up @@ -494,9 +494,9 @@ OrbitCameraInputMouse.prototype.onMouseMove = function (event) {

OrbitCameraInputMouse.prototype.onMouseWheel = function (event) {
if (this.entity.camera.projection === pc.PROJECTION_PERSPECTIVE) {
this.orbitCamera.distance -= event.wheel * this.distanceSensitivity * (this.orbitCamera.distance * 0.1);
this.orbitCamera.distance -= event.wheelDelta * -2 * this.distanceSensitivity * (this.orbitCamera.distance * 0.1);
} else {
this.orbitCamera.orthoHeight -= event.wheel * this.distanceSensitivity;
this.orbitCamera.orthoHeight -= event.wheelDelta * -2 * this.distanceSensitivity;
}
event.event.preventDefault();
};
Expand Down

0 comments on commit 9ea8f3a

Please sign in to comment.