diff options
| author | Jacob Palecki <[email protected]> | 2020-09-26 15:13:53 -0700 |
|---|---|---|
| committer | Jacob Palecki <[email protected]> | 2020-09-26 15:13:53 -0700 |
| commit | 80ffeaf6d6cb00106991bb7cc202c957c3e10d34 (patch) | |
| tree | 7e3adf9cf7aa3f49faed6d1af79108965fa2e9dc /common/accel-logarithm.hpp | |
| parent | Scale Last Mouse Move by poll rate (diff) | |
| download | rawaccel-80ffeaf6d6cb00106991bb7cc202c957c3e10d34.tar.xz rawaccel-80ffeaf6d6cb00106991bb7cc202c957c3e10d34.zip | |
Remove logarithm
Diffstat (limited to 'common/accel-logarithm.hpp')
| -rw-r--r-- | common/accel-logarithm.hpp | 32 |
1 files changed, 0 insertions, 32 deletions
diff --git a/common/accel-logarithm.hpp b/common/accel-logarithm.hpp deleted file mode 100644 index 044d23c..0000000 --- a/common/accel-logarithm.hpp +++ /dev/null @@ -1,32 +0,0 @@ -#pragma once - -#include <math.h> - -#include "accel-base.hpp" - -namespace rawaccel { - - /// <summary> Struct to hold sigmoid (s-shaped) gain implementation. </summary> - struct logarithm_impl { - double rate; - double offset; - double additive_const; - - logarithm_impl (const accel_args& args) : - rate(args.rate), offset (args.offset) { - additive_const = offset * rate; - } - - inline double operator()(double speed) const { - double scaled_speed = rate * speed + 1; - double base_speed = speed + offset; - - return (scaled_speed * log(scaled_speed) + additive_const ) / ( rate * base_speed) - 1; - } - - inline double legacy_offset(double speed) const { return operator()(speed); } - }; - - using accel_logarithm = additive_accel<logarithm_impl>; - -} |