summaryrefslogtreecommitdiff
path: root/common/accel-naturalgain.hpp
diff options
context:
space:
mode:
authora1xd <[email protected]>2021-03-29 17:14:49 -0400
committera1xd <[email protected]>2021-03-29 17:14:49 -0400
commit16dc4df3d438142ae378c9c6983585d06e0c6a33 (patch)
tree1080b11b6ec98d6f47509ced922f2c338e0068bd /common/accel-naturalgain.hpp
parentMerge pull request #81 from a1xd/log-unhandled-ex (diff)
downloadrawaccel-16dc4df3d438142ae378c9c6983585d06e0c6a33.tar.xz
rawaccel-16dc4df3d438142ae378c9c6983585d06e0c6a33.zip
refactor common/settings
only driver compiles remove accel-base types merge linear + classic move gain cap logic into classic impl, cap is now set in terms of output use cap/limit to determine negation remove weight, add replacement for power mode only remove legacy offset option remove naturalgain mode add legacy mode flag naturalgain -> natural natural -> natural + legacy flag add dpi setting and more accel args + defaults (prep for ips mode) replace output speed cap with input cap
Diffstat (limited to 'common/accel-naturalgain.hpp')
-rw-r--r--common/accel-naturalgain.hpp28
1 files changed, 0 insertions, 28 deletions
diff --git a/common/accel-naturalgain.hpp b/common/accel-naturalgain.hpp
deleted file mode 100644
index cdfd1fa..0000000
--- a/common/accel-naturalgain.hpp
+++ /dev/null
@@ -1,28 +0,0 @@
-#pragma once
-
-#include <math.h>
-
-#include "accel-natural.hpp"
-
-namespace rawaccel {
-
- /// <summary> Struct to hold "natural" (vanishing difference) gain implementation. </summary>
- struct naturalgain_impl : natural_impl {
-
- using natural_impl::natural_impl;
-
- inline double operator()(double speed) const {
- // f(x) = k((e^(-mx)-1)/mx + 1)
- double base_speed = speed + offset;
- double scaled_speed = rate * speed;
- return limit * (((exp(-scaled_speed) - 1) / (base_speed * rate) ) + 1 - offset / base_speed);
- }
-
- inline double legacy_offset(double speed) const {
- double scaled_speed = rate * speed;
- return limit * (((exp(-scaled_speed) - 1) / scaled_speed) + 1);
- }
- };
-
- using accel_naturalgain = additive_accel<naturalgain_impl>;
-}