summaryrefslogtreecommitdiff
path: root/common/accel-natural.hpp
diff options
context:
space:
mode:
authorJacob Palecki <[email protected]>2021-04-06 23:11:20 -0700
committerJacob Palecki <[email protected]>2021-04-06 23:11:20 -0700
commit258fcd3bd236a787f07d7dac2049be524d86cb75 (patch)
tree8a92d603c6c9db3e822b7cc09d2a88c485ebed3b /common/accel-natural.hpp
parentRename accelMotivity to growthRate (diff)
downloadrawaccel-258fcd3bd236a787f07d7dac2049be524d86cb75.tar.xz
rawaccel-258fcd3bd236a787f07d7dac2049be524d86cb75.zip
Fix natural legacy algorithm, rename accelNatural to decayRate
Diffstat (limited to 'common/accel-natural.hpp')
-rw-r--r--common/accel-natural.hpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/common/accel-natural.hpp b/common/accel-natural.hpp
index 31ed190..1f18e0d 100644
--- a/common/accel-natural.hpp
+++ b/common/accel-natural.hpp
@@ -16,7 +16,7 @@ namespace rawaccel {
offset(args.offset),
limit(args.limit - 1)
{
- accel = args.accel_natural / fabs(limit);
+ accel = args.decay_rate / fabs(limit);
}
};
@@ -28,7 +28,7 @@ namespace rawaccel {
double offset_x = x - offset;
double decay = exp(-accel * offset_x);
- return limit * (1 - (decay * offset_x + offset) / x) + 1;
+ return limit * (1 - (decay)) + 1;
}
using natural_base::natural_base;