three-gamepad-controls 0.21.0 → 0.22.0

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.
@@ -71,7 +71,7 @@ type GamepadDeadzoneOptions = {
71
71
  rescale?: boolean;
72
72
  };
73
73
  /**
74
- * Options for {@link GamepadStickPipeline.curve}.
74
+ * Options for {@link GamepadStickPipeline.responseCurve}.
75
75
  */
76
76
  type GamepadResponseCurveOptions = {
77
77
  /**
@@ -97,11 +97,11 @@ type GamepadStickPipeline = GamepadStickProcessor & {
97
97
  /**
98
98
  * Appends an axial or radial response curve.
99
99
  *
100
- * @param curve - Curve used to transform normalized magnitudes.
100
+ * @param curve - Response curve used to transform normalized magnitudes.
101
101
  * @param options - Optional response curve configuration.
102
102
  * @returns New pipeline containing the response curve.
103
103
  */
104
- curve(curve: GamepadResponseCurve, options?: GamepadResponseCurveOptions): GamepadStickPipeline;
104
+ responseCurve(curve: GamepadResponseCurve, options?: GamepadResponseCurveOptions): GamepadStickPipeline;
105
105
  /**
106
106
  * Appends component inversion.
107
107
  *
@@ -58,13 +58,13 @@ const rescaleGamepadDeadzoneMagnitude = (magnitude, threshold) => {
58
58
  return Math.min((magnitude - threshold) / (1 - threshold), 1);
59
59
  };
60
60
  /**
61
- * Applies a built-in curve to a normalized magnitude.
61
+ * Applies a built-in response curve to a normalized magnitude.
62
62
  *
63
63
  * Magnitudes above `1` remain unchanged so response curves do not implicitly
64
64
  * clamp or normalize custom processor output.
65
65
  *
66
66
  * @param magnitude - Non-negative component or vector magnitude.
67
- * @param curve - Curve to apply.
67
+ * @param curve - Response curve to apply.
68
68
  * @returns Curved magnitude.
69
69
  */
70
70
  const applyGamepadResponseCurve = (magnitude, curve) => {
@@ -96,7 +96,7 @@ const createDeadzoneProcessor = (threshold, mode, rescale) => {
96
96
  /**
97
97
  * Creates an axial or radial response curve processor.
98
98
  *
99
- * @param curve - Curve applied to normalized magnitudes.
99
+ * @param curve - Response curve applied to normalized magnitudes.
100
100
  * @param mode - Whether to process components or vector magnitude.
101
101
  * @returns Frozen response curve processor.
102
102
  */
@@ -150,7 +150,7 @@ const createPipeline = (mode, processors) => {
150
150
  deadzone(threshold = DEFAULT_GAMEPAD_DEADZONE_THRESHOLD, options) {
151
151
  return append(createDeadzoneProcessor(threshold, options?.mode ?? mode, options?.rescale ?? false));
152
152
  },
153
- curve(curve, options) {
153
+ responseCurve(curve, options) {
154
154
  return append(createResponseCurveProcessor(curve, options?.mode ?? mode));
155
155
  },
156
156
  invert(axis) {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "three-gamepad-controls",
3
3
  "description": "Gamepad support for Three.js controls.",
4
- "version": "0.21.0",
4
+ "version": "0.22.0",
5
5
  "homepage": "https://github.com/luckasnix/three-gamepad-controls#readme",
6
6
  "author": {
7
7
  "name": "Kasnix",