three-gamepad-controls 0.10.2 → 0.10.4

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.
@@ -73,7 +73,7 @@ var GamepadTrackballControls = class extends GamepadControls {
73
73
  const panX = this.#applyDeadzone(gamepad.axes[axisPanX] ?? 0, deadzone);
74
74
  const panY = this.#applyDeadzone(gamepad.axes[axisPanY] ?? 0, deadzone);
75
75
  if (panX === 0 && panY === 0) return;
76
- const scale = panSpeed * deltaTime;
76
+ const scale = panSpeed * deltaTime * this.#getInputDampingFactor();
77
77
  controls._panEnd.x += panX * scale;
78
78
  controls._panEnd.y += panY * scale;
79
79
  }
@@ -86,7 +86,15 @@ var GamepadTrackballControls = class extends GamepadControls {
86
86
  const triggerIn = gamepad.buttons[buttonZoomIn]?.value ?? 0;
87
87
  const triggerOut = gamepad.buttons[buttonZoomOut]?.value ?? 0;
88
88
  if (triggerIn <= deadzone && triggerOut <= deadzone) return;
89
- controls._zoomEnd.y += (triggerOut - triggerIn) * zoomSpeed * deltaTime;
89
+ controls._zoomEnd.y += (triggerOut - triggerIn) * zoomSpeed * deltaTime * this.#getInputDampingFactor();
90
+ }
91
+ /**
92
+ * Compensates for TrackballControls reapplying queued pan and zoom deltas
93
+ * while their input state catches up through damping.
94
+ */
95
+ #getInputDampingFactor() {
96
+ const controls = this.#controls;
97
+ return controls.staticMoving ? 1 : controls.dynamicDampingFactor;
90
98
  }
91
99
  /**
92
100
  * Returns `value` unchanged, or `0` if below the dead zone `threshold`.
package/package.json CHANGED
@@ -1,12 +1,19 @@
1
1
  {
2
2
  "name": "three-gamepad-controls",
3
3
  "description": "Gamepad support for Three.js controls.",
4
- "author": "Kasnix",
5
- "version": "0.10.2",
4
+ "version": "0.10.4",
5
+ "homepage": "https://github.com/luckasnix/three-gamepad-controls#readme",
6
+ "author": {
7
+ "name": "Kasnix",
8
+ "url": "https://github.com/luckasnix"
9
+ },
6
10
  "repository": {
7
11
  "type": "git",
8
12
  "url": "git+https://github.com/luckasnix/three-gamepad-controls.git"
9
13
  },
14
+ "bugs": {
15
+ "url": "https://github.com/luckasnix/three-gamepad-controls/issues"
16
+ },
10
17
  "type": "module",
11
18
  "sideEffects": false,
12
19
  "types": "./dist/index.d.ts",
@@ -31,8 +38,12 @@
31
38
  "publishConfig": {
32
39
  "access": "public"
33
40
  },
34
- "engines": {
35
- "node": ">=24.0.0"
41
+ "devEngines": {
42
+ "runtime": {
43
+ "name": "node",
44
+ "version": ">=24.0.0",
45
+ "onFail": "error"
46
+ }
36
47
  },
37
48
  "devDependencies": {
38
49
  "@biomejs/biome": "2.4.16",
@@ -43,7 +54,7 @@
43
54
  "@types/three": "0.184.1",
44
55
  "husky": "9.1.7",
45
56
  "three": "0.184.0",
46
- "tsdown": "0.22.1",
57
+ "tsdown": "0.22.2",
47
58
  "typescript": "6.0.3"
48
59
  },
49
60
  "peerDependencies": {