From 80ffeaf6d6cb00106991bb7cc202c957c3e10d34 Mon Sep 17 00:00:00 2001 From: Jacob Palecki Date: Sat, 26 Sep 2020 15:13:53 -0700 Subject: Remove logarithm --- common/accel-logarithm.hpp | 32 -------------------------------- common/common.vcxitems | 1 - common/rawaccel-settings.h | 2 +- common/rawaccel.hpp | 3 --- 4 files changed, 1 insertion(+), 37 deletions(-) delete mode 100644 common/accel-logarithm.hpp (limited to 'common') diff --git a/common/accel-logarithm.hpp b/common/accel-logarithm.hpp deleted file mode 100644 index 044d23c..0000000 --- a/common/accel-logarithm.hpp +++ /dev/null @@ -1,32 +0,0 @@ -#pragma once - -#include - -#include "accel-base.hpp" - -namespace rawaccel { - - /// Struct to hold sigmoid (s-shaped) gain implementation. - struct logarithm_impl { - double rate; - double offset; - double additive_const; - - logarithm_impl (const accel_args& args) : - rate(args.rate), offset (args.offset) { - additive_const = offset * rate; - } - - inline double operator()(double speed) const { - double scaled_speed = rate * speed + 1; - double base_speed = speed + offset; - - return (scaled_speed * log(scaled_speed) + additive_const ) / ( rate * base_speed) - 1; - } - - inline double legacy_offset(double speed) const { return operator()(speed); } - }; - - using accel_logarithm = additive_accel; - -} diff --git a/common/common.vcxitems b/common/common.vcxitems index 3407cf2..f8cbf28 100644 --- a/common/common.vcxitems +++ b/common/common.vcxitems @@ -19,7 +19,6 @@ - diff --git a/common/rawaccel-settings.h b/common/rawaccel-settings.h index 93f4768..1a513ac 100644 --- a/common/rawaccel-settings.h +++ b/common/rawaccel-settings.h @@ -9,7 +9,7 @@ namespace rawaccel { inline constexpr milliseconds WRITE_DELAY = 1000; enum class accel_mode { - linear, classic, natural, naturalgain, power, logarithm, motivity, noaccel + linear, classic, natural, naturalgain, power, motivity, noaccel }; struct settings { diff --git a/common/rawaccel.hpp b/common/rawaccel.hpp index 2e627c9..14db883 100644 --- a/common/rawaccel.hpp +++ b/common/rawaccel.hpp @@ -8,7 +8,6 @@ #include "accel-linear.hpp" #include "accel-classic.hpp" -#include "accel-logarithm.hpp" #include "accel-natural.hpp" #include "accel-naturalgain.hpp" #include "accel-power.hpp" @@ -84,7 +83,6 @@ namespace rawaccel { case accel_mode::natural: return vis(var.u.natural); case accel_mode::naturalgain: return vis(var.u.naturalgain); case accel_mode::power: return vis(var.u.power); - case accel_mode::logarithm: return vis(var.u.logarithm); case accel_mode::motivity: return vis(var.u.motivity); default: return vis(var.u.noaccel); } @@ -101,7 +99,6 @@ namespace rawaccel { accel_natural natural; accel_naturalgain naturalgain; accel_power power; - accel_logarithm logarithm; accel_motivity motivity; accel_noaccel noaccel = {}; } u = {}; -- cgit v1.2.3