AxisSettings

AxisSettings

  • livezone_upperbound : f32
  • deadzone_upperbound : f32
  • deadzone_lowerbound : f32
  • livezone_lowerbound : f32
  • threshold : f32

Description

Settings for a [GamepadAxis].

It is used inside the [GamepadSettings] to define the sensitivity range and threshold for an axis. Values that are higher than livezone_upperbound will be rounded up to 1.0. Values that are lower than livezone_lowerbound will be rounded down to -1.0. Values that are in-between deadzone_lowerbound and deadzone_upperbound will be rounded to 0.0. Otherwise, values will not be rounded.

The valid range is [-1.0, 1.0].

Functions

FunctionSummary
clamp(_self, new_value) Clamps the `raw_value` according to the `AxisSettings`.
clone(_self)No Documentation 🚧
deadzone_lowerbound(_self) Get the value above which inputs will be rounded up to 0.0.
deadzone_upperbound(_self) Get the value below which positive inputs will be rounded down to 0.0.
eq(_self, other)No Documentation 🚧
filter(_self, new_value, old_value) Filters the `new_value` based on the `old_value`, according to the [`AxisSettings`]. Returns the clamped `new_value` if the change exceeds the settings threshold, and `None` otherwise.
livezone_lowerbound(_self) Get the value below which negative inputs will be rounded down to -1.0.
livezone_upperbound(_self) Get the value above which inputs will be rounded up to 1.0.
set_deadzone_lowerbound(_self, value) Try to set the value above which inputs will be rounded up to 0.0. If the value passed is less tha
set_deadzone_upperbound(_self, value) Try to set the value below which positive inputs will be rounded down to 0.0. If the value passed
set_livezone_lowerbound(_self, value) Try to set the value below which negative inputs will be rounded down to -1.0. If the value passed
set_livezone_upperbound(_self, value) Try to set the value above which inputs will be rounded up to 1.0. If the value passed is negative
set_threshold(_self, value) Try to set the minimum value by which input must change before the changes will be applied. If the
threshold(_self) Get the minimum value by which input must change before the change is registered.