diff options
| author | Jacob Palecki <[email protected]> | 2020-09-03 13:21:45 -0700 |
|---|---|---|
| committer | Jacob Palecki <[email protected]> | 2020-09-03 13:21:45 -0700 |
| commit | c7e9641e8688c82874dbfa067f7dc8cb4d40e23d (patch) | |
| tree | f621b568c8fac71126829f8db1bc72808ab4e059 /common/accel-naturalgain.hpp | |
| parent | Start adding gain offsets (diff) | |
| download | rawaccel-c7e9641e8688c82874dbfa067f7dc8cb4d40e23d.tar.xz rawaccel-c7e9641e8688c82874dbfa067f7dc8cb4d40e23d.zip | |
Change classic, natural, naturalgain to use gain offset
Diffstat (limited to 'common/accel-naturalgain.hpp')
| -rw-r--r-- | common/accel-naturalgain.hpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/common/accel-naturalgain.hpp b/common/accel-naturalgain.hpp index 03d749f..5979d92 100644 --- a/common/accel-naturalgain.hpp +++ b/common/accel-naturalgain.hpp @@ -18,8 +18,9 @@ namespace rawaccel { return 0; } + double base_speed = speed + offset; double scaled_speed = rate * speed; - return limit * (((exp(-scaled_speed) - 1) / scaled_speed) + 1); + return limit * (((exp(-scaled_speed) - 1) / (base_speed * rate) ) + 1 - offset / base_speed); } }; |