leafwing_input_manager::input_processing::single_axis

Trait WithAxisProcessingPipelineExt

source
pub trait WithAxisProcessingPipelineExt: Sized {
Show 18 methods // Required methods fn reset_processing_pipeline(self) -> Self; fn replace_processing_pipeline( self, processors: impl IntoIterator<Item = AxisProcessor>, ) -> Self; fn with_processor(self, processor: impl Into<AxisProcessor>) -> Self; // Provided methods fn digital(self) -> Self { ... } fn inverted(self) -> Self { ... } fn sensitivity(self, sensitivity: f32) -> Self { ... } fn with_bounds(self, min: f32, max: f32) -> Self { ... } fn with_bounds_symmetric(self, threshold: f32) -> Self { ... } fn at_least(self, min: f32) -> Self { ... } fn at_most(self, max: f32) -> Self { ... } fn with_deadzone(self, negative_max: f32, positive_min: f32) -> Self { ... } fn with_deadzone_symmetric(self, threshold: f32) -> Self { ... } fn only_positive(self, positive_min: f32) -> Self { ... } fn only_negative(self, negative_max: f32) -> Self { ... } fn with_deadzone_unscaled( self, negative_max: f32, positive_min: f32, ) -> Self { ... } fn with_deadzone_symmetric_unscaled(self, threshold: f32) -> Self { ... } fn only_positive_unscaled(self, positive_min: f32) -> Self { ... } fn only_negative_unscaled(self, negative_max: f32) -> Self { ... }
}
Expand description

Provides methods for configuring and manipulating the processing pipeline for single-axis input.

Required Methods§

source

fn reset_processing_pipeline(self) -> Self

Resets the processing pipeline, removing any currently applied processors.

source

fn replace_processing_pipeline( self, processors: impl IntoIterator<Item = AxisProcessor>, ) -> Self

Replaces the current processing pipeline with the given AxisProcessors.

source

fn with_processor(self, processor: impl Into<AxisProcessor>) -> Self

Appends the given AxisProcessor as the next processing step.

Provided Methods§

source

fn digital(self) -> Self

Appends an AxisProcessor::Digital processor as the next processing step, similar to f32::signum but returning 0.0 for zero values.

source

fn inverted(self) -> Self

Appends an AxisProcessor::Inverted processor as the next processing step, flipping the sign of values on the axis.

source

fn sensitivity(self, sensitivity: f32) -> Self

Appends an AxisProcessor::Sensitivity processor as the next processing step, multiplying values on the axis with the given sensitivity factor.

source

fn with_bounds(self, min: f32, max: f32) -> Self

Appends an AxisBounds processor as the next processing step, restricting values within the range [min, max] on the axis.

source

fn with_bounds_symmetric(self, threshold: f32) -> Self

Appends an AxisBounds processor as the next processing step, restricting values within the range [-threshold, threshold].

source

fn at_least(self, min: f32) -> Self

Appends an AxisBounds processor as the next processing step, restricting values to a minimum value.

source

fn at_most(self, max: f32) -> Self

Appends an AxisBounds processor as the next processing step, restricting values to a maximum value.

source

fn with_deadzone(self, negative_max: f32, positive_min: f32) -> Self

Appends an AxisDeadZone processor as the next processing step, excluding values within the dead zone range [negative_max, positive_min] on the axis, treating them as zeros, then normalizing non-excluded input values into the “live zone”, the remaining range within the AxisBounds::magnitude(1.0) after dead zone exclusion.

§Requirements
  • negative_max <= 0.0 <= positive_min.
§Panics

Panics if the requirements aren’t met.

source

fn with_deadzone_symmetric(self, threshold: f32) -> Self

Appends an AxisDeadZone processor as the next processing step, excluding values within the dead zone range [-threshold, threshold] on the axis, treating them as zeros, then normalizing non-excluded input values into the “live zone”, the remaining range within the AxisBounds::magnitude(1.0) after dead zone exclusion.

§Requirements
  • threshold >= 0.0.
§Panics

Panics if the requirements aren’t met.

source

fn only_positive(self, positive_min: f32) -> Self

Appends an AxisDeadZone processor as the next processing step, only passing positive values that greater than positive_min and then normalizing them into the “live zone” range [positive_min, 1.0].

§Requirements
  • positive_min >= 0.0.
§Panics

Panics if the requirements aren’t met.

source

fn only_negative(self, negative_max: f32) -> Self

Appends an AxisDeadZone processor as the next processing step, only passing negative values that less than negative_max and then normalizing them into the “live zone” range [-1.0, negative_max].

§Requirements
  • negative_max <= 0.0.
§Panics

Panics if the requirements aren’t met.

source

fn with_deadzone_unscaled(self, negative_max: f32, positive_min: f32) -> Self

Appends an AxisExclusion processor as the next processing step, ignoring values within the dead zone range [negative_max, positive_min] on the axis, treating them as zeros.

§Requirements
  • negative_max <= 0.0 <= positive_min.
§Panics

Panics if the requirements aren’t met.

source

fn with_deadzone_symmetric_unscaled(self, threshold: f32) -> Self

Appends an AxisExclusion processor as the next processing step, ignoring values within the dead zone range [-threshold, threshold] on the axis, treating them as zeros.

§Requirements
  • threshold >= 0.0.
§Panics

Panics if the requirements aren’t met.

source

fn only_positive_unscaled(self, positive_min: f32) -> Self

Appends an AxisExclusion processor as the next processing step, only passing positive values that greater than positive_min.

§Requirements
  • positive_min >= 0.0.
§Panics

Panics if the requirements aren’t met.

source

fn only_negative_unscaled(self, negative_max: f32) -> Self

Appends an AxisExclusion processor as the next processing step, only passing negative values that less than negative_max.

§Requirements
  • negative_max <= 0.0.
§Panics

Panics if the requirements aren’t met.

Object Safety§

This trait is not object safe.

Implementors§