InputModifier

Trait InputModifier 

Source
pub trait InputModifier: Debug {
    // Required method
    fn transform(
        &mut self,
        actions: &ActionsQuery<'_, '_>,
        time: &ContextTime<'_>,
        value: ActionValue,
    ) -> ActionValue;
}
Expand description

Pre-processor that alter the raw input values.

Input modifiers are useful for applying sensitivity settings, smoothing input over multiple frames, or changing how input maps to axes.

Can be attached both to bindings and actions.

If you create a custom modifier, it needs to be registered using InputModifierAppExt::add_input_modifier.

Required Methods§

Source

fn transform( &mut self, actions: &ActionsQuery<'_, '_>, time: &ContextTime<'_>, value: ActionValue, ) -> ActionValue

Returns pre-processed value.

Called each frame.

Implementors§