summaryrefslogtreecommitdiff
path: root/common/rawaccel.hpp
diff options
context:
space:
mode:
authorJacob Palecki <[email protected]>2021-01-10 23:49:28 -0800
committerJacob Palecki <[email protected]>2021-01-10 23:49:28 -0800
commitde6b18db8226650cee9726c4694931bdc4b89fad (patch)
treec5bffd4d1eaad53842394c92d4907acb65c6ff84 /common/rawaccel.hpp
parentAdd to stigma, directional to settings (diff)
downloadrawaccel-de6b18db8226650cee9726c4694931bdc4b89fad.tar.xz
rawaccel-de6b18db8226650cee9726c4694931bdc4b89fad.zip
Implement direcitonality UI
Diffstat (limited to 'common/rawaccel.hpp')
-rw-r--r--common/rawaccel.hpp11
1 files changed, 3 insertions, 8 deletions
diff --git a/common/rawaccel.hpp b/common/rawaccel.hpp
index 4a9dc90..d1cafdd 100644
--- a/common/rawaccel.hpp
+++ b/common/rawaccel.hpp
@@ -225,11 +225,6 @@ namespace rawaccel {
accelerator() = default;
};
- struct stigma_args {
- vec2d sigmas = { 1, 1 };
- double lp_norm = 2;
- };
-
struct stigma_distance {
double p = 2.0;
double p_inverse = 0.5;
@@ -255,7 +250,7 @@ namespace rawaccel {
}
}
- double calculate(int x, int y)
+ double calculate(double x, double y)
{
double x_scaled = x * sigma_x;
double y_scaled = y * sigma_y;
@@ -285,7 +280,7 @@ namespace rawaccel {
}
}
- inline int atan_scale(double x, double y)
+ inline double atan_scale(double x, double y)
{
return M_2_PI * atan2(fabs(y), fabs(x));
}
@@ -361,7 +356,7 @@ namespace rawaccel {
if (directional.should_apply)
{
- scale *= directional.apply(movement.x, movement.y);
+ scale = (scale - 1)*directional.apply(movement.x, movement.y) + 1;
}
movement.x *= scale;