diff options
| author | Jacob Palecki <[email protected]> | 2021-04-07 23:38:47 -0700 |
|---|---|---|
| committer | Jacob Palecki <[email protected]> | 2021-04-07 23:38:47 -0700 |
| commit | e1b5ff67764384ab067cee7983cbaaf9b5df39ad (patch) | |
| tree | 39ffa4a79bc6b019443521f10203f787c4b98698 /common/accel-natural.hpp | |
| parent | remove const from uneeded class (diff) | |
| parent | optimize a bit/refactor modify (diff) | |
| download | rawaccel-e1b5ff67764384ab067cee7983cbaaf9b5df39ad.tar.xz rawaccel-e1b5ff67764384ab067cee7983cbaaf9b5df39ad.zip | |
Merge remote-tracking branch 'upstream/dyn-lut-b' into lut2
Diffstat (limited to 'common/accel-natural.hpp')
| -rw-r--r-- | common/accel-natural.hpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/common/accel-natural.hpp b/common/accel-natural.hpp index 28e17c2..8d25351 100644 --- a/common/accel-natural.hpp +++ b/common/accel-natural.hpp @@ -26,8 +26,8 @@ namespace rawaccel { { if (x <= offset) return 1; - double offset_x = x - offset; - double decay = exp(-accel * offset_x); + double offset_x = offset - x; + double decay = exp(accel * offset_x); return limit * (1 - (decay * offset_x + offset) / x) + 1; } @@ -41,8 +41,8 @@ namespace rawaccel { { if (x <= offset) return 1; - double offset_x = x - offset; - double decay = exp(-accel * offset_x); + double offset_x = offset - x; + double decay = exp(accel * offset_x); double output = limit * (offset_x + decay / accel) + constant; return output / x + 1; } |