bevy/crates/bevy_input/src
Paul Hansen b4fa833a92
Add get_unclamped to Axis (#8871)
# Objective

Add a get_unclamped method to
[Axis](https://docs.rs/bevy/0.10.1/bevy/input/struct.Axis.html) to allow
it to be used in cases where being able to get a precise relative
movement is important. For example, camera zoom with the mouse wheel.

This would make it possible for libraries like leafwing input manager to
leverage `Axis` for mouse motion and mouse wheel axis mapping. I tried
to use it my PR here
https://github.com/Leafwing-Studios/leafwing-input-manager/pull/346 but
will likely have to revert that and read the mouse wheel events for now
which is what prompted this PR.

## Solution

Instead of clamping the axis value when it is set, it now stores the raw
value and clamps it in the `get` method. This allows a simple
get_unclamped method that just returns the raw value.


## Changelog

- Added a get_unclamped method to Axis that can return values outside of
-1.0 to 1.0
2023-06-19 23:06:11 +00:00
..
axis.rs Add get_unclamped to Axis (#8871) 2023-06-19 23:06:11 +00:00
common_conditions.rs Schedule-First: the new and improved add_systems (#8079) 2023-03-18 01:45:34 +00:00
gamepad.rs Add FromReflect where Reflect is used (#8776) 2023-06-19 16:18:17 +00:00
input.rs Add FromReflect where Reflect is used (#8776) 2023-06-19 16:18:17 +00:00
keyboard.rs Add FromReflect where Reflect is used (#8776) 2023-06-19 16:18:17 +00:00
lib.rs Add FromReflect where Reflect is used (#8776) 2023-06-19 16:18:17 +00:00
mouse.rs Add FromReflect where Reflect is used (#8776) 2023-06-19 16:18:17 +00:00
touch.rs Add FromReflect where Reflect is used (#8776) 2023-06-19 16:18:17 +00:00
touchpad.rs Touchpad magnify and rotate events (#8791) 2023-06-08 20:31:43 +00:00