diff options
| author | JacobPalecki <[email protected]> | 2020-09-08 16:00:05 -0700 |
|---|---|---|
| committer | GitHub <[email protected]> | 2020-09-08 16:00:05 -0700 |
| commit | e5461fa84e65d78823d0022339fa2d8864f7e63c (patch) | |
| tree | b486ef524c93bfeb29a86403114b6805bf9decf1 /common/accel-sigmoid.hpp | |
| parent | Merge pull request #19 from JacobPalecki/gainOffset (diff) | |
| parent | Save show last mouse value (diff) | |
| download | rawaccel-e5461fa84e65d78823d0022339fa2d8864f7e63c.tar.xz rawaccel-e5461fa84e65d78823d0022339fa2d8864f7e63c.zip | |
Merge pull request #20 from JacobPalecki/GUI
GUI: Add By Component & Anisotropy; Remove Logarithm and Sigmoid; Delete Console; Some Refactoring
Diffstat (limited to 'common/accel-sigmoid.hpp')
| -rw-r--r-- | common/accel-sigmoid.hpp | 29 |
1 files changed, 0 insertions, 29 deletions
diff --git a/common/accel-sigmoid.hpp b/common/accel-sigmoid.hpp deleted file mode 100644 index 239bd9d..0000000 --- a/common/accel-sigmoid.hpp +++ /dev/null @@ -1,29 +0,0 @@ -#pragma once - -#include <math.h> - -#include "accel-base.hpp" - -namespace rawaccel { - - /// <summary> Struct to hold sigmoid (s-shaped) acceleration implementation. </summary> - struct sigmoid_impl { - double rate; - double limit; - double midpoint; - - sigmoid_impl(const accel_args& args) : - rate(args.accel), limit(args.limit - 1), midpoint(args.midpoint) - {} - - inline double operator()(double speed) const { - //f(x) = k/(1+e^(-m(x-c))) - return limit / (exp(-rate * (speed - midpoint)) + 1); - } - - inline double legacy_offset(double speed) const { return operator()(speed); } - }; - - using accel_sigmoid = additive_accel<sigmoid_impl>; - -} |