From 258fcd3bd236a787f07d7dac2049be524d86cb75 Mon Sep 17 00:00:00 2001 From: Jacob Palecki Date: Tue, 6 Apr 2021 23:11:20 -0700 Subject: Fix natural legacy algorithm, rename accelNatural to decayRate --- common/accel-natural.hpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'common/accel-natural.hpp') 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; -- cgit v1.2.3