From 6470bff9672c56024c542a74a00429273501879f Mon Sep 17 00:00:00 2001 From: Jacob Palecki Date: Fri, 4 Sep 2020 01:53:59 -0700 Subject: Remove log and sigmoid styles --- common/accel-logarithmic.hpp | 25 ------------------------- common/accel-sigmoid.hpp | 29 ----------------------------- common/common.vcxitems | 2 -- common/rawaccel-settings.h | 2 +- common/rawaccel.hpp | 8 +------- 5 files changed, 2 insertions(+), 64 deletions(-) delete mode 100644 common/accel-logarithmic.hpp delete mode 100644 common/accel-sigmoid.hpp (limited to 'common') diff --git a/common/accel-logarithmic.hpp b/common/accel-logarithmic.hpp deleted file mode 100644 index 1ab0e53..0000000 --- a/common/accel-logarithmic.hpp +++ /dev/null @@ -1,25 +0,0 @@ -#pragma once - -#include - -#include "accel-base.hpp" - -namespace rawaccel { - - /// Struct to hold logarithmic acceleration implementation. - struct logarithmic_impl { - double accel; - - logarithmic_impl(const accel_args& args) : accel(args.accel) {} - - inline double operator()(double speed) const { - //f(x) = log(m*x+1) - return log(accel * speed + 1); - } - - // incorrect but this style is slated for removal - inline double legacy_offset(double speed) const { return operator()(speed); } - }; - - using accel_logarithmic = additive_accel; -} diff --git a/common/accel-sigmoid.hpp b/common/accel-sigmoid.hpp deleted file mode 100644 index 239bd9d..0000000 --- a/common/accel-sigmoid.hpp +++ /dev/null @@ -1,29 +0,0 @@ -#pragma once - -#include - -#include "accel-base.hpp" - -namespace rawaccel { - - /// Struct to hold sigmoid (s-shaped) acceleration implementation. - struct sigmoid_impl { - double rate; - double limit; - double midpoint; - - sigmoid_impl(const accel_args& args) : - rate(args.accel), limit(args.limit - 1), midpoint(args.midpoint) - {} - - inline double operator()(double speed) const { - //f(x) = k/(1+e^(-m(x-c))) - return limit / (exp(-rate * (speed - midpoint)) + 1); - } - - inline double legacy_offset(double speed) const { return operator()(speed); } - }; - - using accel_sigmoid = additive_accel; - -} diff --git a/common/common.vcxitems b/common/common.vcxitems index 52d4f8a..2913080 100644 --- a/common/common.vcxitems +++ b/common/common.vcxitems @@ -17,12 +17,10 @@ - - diff --git a/common/rawaccel-settings.h b/common/rawaccel-settings.h index b9ff946..12f136d 100644 --- a/common/rawaccel-settings.h +++ b/common/rawaccel-settings.h @@ -6,7 +6,7 @@ namespace rawaccel { enum class accel_mode { - linear, classic, natural, logarithmic, sigmoid, naturalgain, sigmoidgain, power, noaccel + linear, classic, natural, naturalgain, sigmoidgain, power, noaccel }; struct settings { diff --git a/common/rawaccel.hpp b/common/rawaccel.hpp index d3a2a03..08ac322 100644 --- a/common/rawaccel.hpp +++ b/common/rawaccel.hpp @@ -10,10 +10,8 @@ #include "accel-classic.hpp" #include "accel-natural.hpp" #include "accel-naturalgain.hpp" -#include "accel-logarithmic.hpp" -#include "accel-sigmoid.hpp" -#include "accel-sigmoidgain.hpp" #include "accel-power.hpp" +#include "accel-sigmoidgain.hpp" #include "accel-noaccel.hpp" namespace rawaccel { @@ -83,8 +81,6 @@ namespace rawaccel { case accel_mode::linear: return vis(var.u.linear); case accel_mode::classic: return vis(var.u.classic); case accel_mode::natural: return vis(var.u.natural); - case accel_mode::logarithmic: return vis(var.u.logarithmic); - case accel_mode::sigmoid: return vis(var.u.sigmoid); case accel_mode::naturalgain: return vis(var.u.naturalgain); case accel_mode::sigmoidgain: return vis(var.u.sigmoidgain); case accel_mode::power: return vis(var.u.power); @@ -99,8 +95,6 @@ namespace rawaccel { accel_linear linear; accel_classic classic; accel_natural natural; - accel_logarithmic logarithmic; - accel_sigmoid sigmoid; accel_naturalgain naturalgain; accel_sigmoidgain sigmoidgain; accel_power power; -- cgit v1.2.3