Skip to content

Commit

Permalink
Improved input sensitivity.
Browse files Browse the repository at this point in the history
  • Loading branch information
varganorbert222 committed May 17, 2024
1 parent c871d3e commit 73c4d2e
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions scripts/input.js
Original file line number Diff line number Diff line change
Expand Up @@ -133,11 +133,14 @@ class Input {

const currentMousePosition = this.getMousePosition(e);

this._dragX = (this._mouseposition[0] - currentMousePosition[0]) / (window.innerWidth * 4);
this._dragY = (this._mouseposition[1] - currentMousePosition[1]) / (window.innerHeight * 8);
const deltaX = this._mouseposition[0] - currentMousePosition[0];
const deltaY = this._mouseposition[1] - currentMousePosition[1];

this._leftright = (this._dragX / window.innerWidth) * 2;
this._updown = (this._dragY / window.innerHeight) * 10;
this._leftright = (deltaX / window.innerWidth) * 2;
this._updown = (deltaY / window.innerHeight) * 10;

this._dragX = (deltaX / window.innerWidth) * 0.2;
this._dragY = (deltaY / window.innerHeight) * 0.1;
}

detectMouseWheel(e) {
Expand Down

0 comments on commit 73c4d2e

Please sign in to comment.