summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJacob Palecki <[email protected]>2020-09-26 15:13:53 -0700
committerJacob Palecki <[email protected]>2020-09-26 15:13:53 -0700
commit80ffeaf6d6cb00106991bb7cc202c957c3e10d34 (patch)
tree7e3adf9cf7aa3f49faed6d1af79108965fa2e9dc
parentScale Last Mouse Move by poll rate (diff)
downloadrawaccel-80ffeaf6d6cb00106991bb7cc202c957c3e10d34.tar.xz
rawaccel-80ffeaf6d6cb00106991bb7cc202c957c3e10d34.zip
Remove logarithm
-rw-r--r--common/accel-logarithm.hpp32
-rw-r--r--common/common.vcxitems1
-rw-r--r--common/rawaccel-settings.h2
-rw-r--r--common/rawaccel.hpp3
-rw-r--r--grapher/Layouts/LogarithmLayout.cs22
-rw-r--r--grapher/Models/Options/AccelTypeOptions.cs1
-rw-r--r--grapher/ReadMe/Guide.md5
-rw-r--r--grapher/grapher.csproj1
-rw-r--r--wrapper/wrapper.cpp2
9 files changed, 2 insertions, 67 deletions
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 <math.h>
-
-#include "accel-base.hpp"
-
-namespace rawaccel {
-
- /// <summary> Struct to hold sigmoid (s-shaped) gain implementation. </summary>
- 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<logarithm_impl>;
-
-}
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 @@
<ClInclude Include="$(MSBuildThisFileDirectory)accel-experimentone.hpp" />
<ClInclude Include="$(MSBuildThisFileDirectory)accel-motivity.hpp" />
<ClInclude Include="$(MSBuildThisFileDirectory)accel-linear.hpp" />
- <ClInclude Include="$(MSBuildThisFileDirectory)accel-logarithm.hpp" />
<ClInclude Include="$(MSBuildThisFileDirectory)accel-natural.hpp" />
<ClInclude Include="$(MSBuildThisFileDirectory)accel-naturalgain.hpp" />
<ClInclude Include="$(MSBuildThisFileDirectory)accel-noaccel.hpp" />
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 = {};
diff --git a/grapher/Layouts/LogarithmLayout.cs b/grapher/Layouts/LogarithmLayout.cs
deleted file mode 100644
index e39dbe7..0000000
--- a/grapher/Layouts/LogarithmLayout.cs
+++ /dev/null
@@ -1,22 +0,0 @@
-using grapher.Models.Serialized;
-
-namespace grapher.Layouts
-{
- public class LogarithmLayout : LayoutBase
- {
- public LogarithmLayout ()
- : base()
- {
- Name = "Logarithm";
- Index = (int)AccelMode.logarithm;
- LogarithmicCharts = false;
-
- AccelLayout = new OptionLayout(true, Scale);
- CapLayout = new OptionLayout(true, Cap);
- WeightLayout = new OptionLayout(true, Weight);
- OffsetLayout = new OptionLayout(true, Offset);
- LimExpLayout = new OptionLayout(false, string.Empty);
- MidpointLayout = new OptionLayout(false, string.Empty);
- }
- }
-}
diff --git a/grapher/Models/Options/AccelTypeOptions.cs b/grapher/Models/Options/AccelTypeOptions.cs
index 9bd42f5..573e9b9 100644
--- a/grapher/Models/Options/AccelTypeOptions.cs
+++ b/grapher/Models/Options/AccelTypeOptions.cs
@@ -19,7 +19,6 @@ namespace grapher
new NaturalLayout(),
new NaturalGainLayout(),
new PowerLayout(),
- new LogarithmLayout(),
new MotivityLayout(),
new OffLayout()
}.ToDictionary(k => k.Name);
diff --git a/grapher/ReadMe/Guide.md b/grapher/ReadMe/Guide.md
index 43619d3..e3fd442 100644
--- a/grapher/ReadMe/Guide.md
+++ b/grapher/ReadMe/Guide.md
@@ -89,10 +89,5 @@ Natural is a style found in the game Diabotical. It features a concave curve whi
This curve looks like an "S" with the top half bigger than the bottom. Mathematically it's a "Sigmoid function on a log-log plot". A user can set the "midpoint" of the S, the "acceleration" (i.e. slantedness) of the S, and the "motivity". "Motivity" sets min and max sensitivity, where the maximum is just "motivity", and the minimum is "1/motivity." (Sensitivity is 1 at the midpoint.) This curve is calculated and stored in a lookup table before applying acceleration, which makes the gain graph look a little funny. This is one author's favorite curve, and an excellent choice for power users and new users who don't mind playing with the settings a little.
![MotivityExample](\images\motivity_example.png)
-### Logarithm
-Not a big difference between this and power in terms of shape.
-![LogarithmExample](\images\logarithm_example.png)
-
-
## Further Help
Further help and frequently asked questions can be found in the FAQ. \ No newline at end of file
diff --git a/grapher/grapher.csproj b/grapher/grapher.csproj
index 29b5cff..9e9b15b 100644
--- a/grapher/grapher.csproj
+++ b/grapher/grapher.csproj
@@ -55,7 +55,6 @@
<ItemGroup>
<Compile Include="Constants\Constants.cs" />
<Compile Include="Layouts\MotivityLayout.cs" />
- <Compile Include="Layouts\LogarithmLayout.cs" />
<Compile Include="Layouts\NaturalGainLayout.cs" />
<Compile Include="Models\AccelGUIFactory.cs" />
<Compile Include="Models\Calculations\AccelCalculator.cs" />
diff --git a/wrapper/wrapper.cpp b/wrapper/wrapper.cpp
index 9a53189..5b35a03 100644
--- a/wrapper/wrapper.cpp
+++ b/wrapper/wrapper.cpp
@@ -11,7 +11,7 @@ using namespace System::Runtime::InteropServices;
public enum class AccelMode
{
- linear, classic, natural, naturalgain, power, logarithm, motivity, noaccel
+ linear, classic, natural, naturalgain, power, motivity, noaccel
};
[StructLayout(LayoutKind::Sequential)]