mirror of
https://github.com/bevyengine/bevy
synced 2024-11-25 22:20:20 +00:00
b4fa833a92
# 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 |
||
---|---|---|
.. | ||
src | ||
Cargo.toml |