summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJacob Palecki <[email protected]>2021-04-06 23:34:13 -0700
committerJacob Palecki <[email protected]>2021-04-06 23:34:13 -0700
commitc06d88e602983b650d4a61b8fb248be3e15d822b (patch)
treebc65eeccf10fab20a7f624fe80a4fded11168b42
parentFix natural legacy algorithm, rename accelNatural to decayRate (diff)
downloadrawaccel-c06d88e602983b650d4a61b8fb248be3e15d822b.tar.xz
rawaccel-c06d88e602983b650d4a61b8fb248be3e15d822b.zip
natural legacy algorithm was correct, leave as it was
-rw-r--r--common/accel-natural.hpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/common/accel-natural.hpp b/common/accel-natural.hpp
index 1f18e0d..28e17c2 100644
--- a/common/accel-natural.hpp
+++ b/common/accel-natural.hpp
@@ -28,7 +28,7 @@ namespace rawaccel {
double offset_x = x - offset;
double decay = exp(-accel * offset_x);
- return limit * (1 - (decay)) + 1;
+ return limit * (1 - (decay * offset_x + offset) / x) + 1;
}
using natural_base::natural_base;