three-gamepad-controls 0.10.1 → 0.10.2

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.
@@ -50,12 +50,12 @@ type GamepadOrbitControlsOptions = {
50
50
  axisPanY: number;
51
51
  /**
52
52
  * Button index for zooming **in** (analog trigger value used for proportional zoom).
53
- * @default 6 — Left trigger
53
+ * @default 7 — Right trigger
54
54
  */
55
55
  buttonDollyIn: number;
56
56
  /**
57
57
  * Button index for zooming **out** (analog trigger value used for proportional zoom).
58
- * @default 7 — Right trigger
58
+ * @default 6 — Left trigger
59
59
  */
60
60
  buttonDollyOut: number;
61
61
  };
@@ -13,8 +13,8 @@ const DEFAULT_ORBIT_OPTIONS = {
13
13
  axisRotateY: GAMEPAD_AXIS.LeftY,
14
14
  axisPanX: GAMEPAD_AXIS.RightX,
15
15
  axisPanY: GAMEPAD_AXIS.RightY,
16
- buttonDollyIn: GAMEPAD_BUTTON.LeftTrigger,
17
- buttonDollyOut: GAMEPAD_BUTTON.RightTrigger
16
+ buttonDollyIn: GAMEPAD_BUTTON.RightTrigger,
17
+ buttonDollyOut: GAMEPAD_BUTTON.LeftTrigger
18
18
  };
19
19
  /**
20
20
  * Adds gamepad support to Three.js `OrbitControls`.
@@ -55,8 +55,8 @@ var GamepadOrbitControls = class extends GamepadControls {
55
55
  if (panX !== 0 || panY !== 0) this.#controls.pan(panX * panSpeed * deltaTime * 500, panY * panSpeed * deltaTime * 500);
56
56
  const triggerIn = gamepad.buttons[buttonDollyIn]?.value ?? 0;
57
57
  const triggerOut = gamepad.buttons[buttonDollyOut]?.value ?? 0;
58
- if (triggerIn > deadzone) this.#controls.dollyIn(1 + zoomSpeed * triggerIn * deltaTime);
59
- if (triggerOut > deadzone) this.#controls.dollyOut(1 + zoomSpeed * triggerOut * deltaTime);
58
+ if (triggerIn > deadzone) this.#controls.dollyIn(1 / (1 + zoomSpeed * triggerIn * deltaTime));
59
+ if (triggerOut > deadzone) this.#controls.dollyOut(1 / (1 + zoomSpeed * triggerOut * deltaTime));
60
60
  }
61
61
  /**
62
62
  * Returns `value` unchanged, or `0` if below the dead zone `threshold`.
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "three-gamepad-controls",
3
3
  "description": "Gamepad support for Three.js controls.",
4
4
  "author": "Kasnix",
5
- "version": "0.10.1",
5
+ "version": "0.10.2",
6
6
  "repository": {
7
7
  "type": "git",
8
8
  "url": "git+https://github.com/luckasnix/three-gamepad-controls.git"