summaryrefslogtreecommitdiff
path: root/common/rawaccel.hpp
diff options
context:
space:
mode:
authorJacob Palecki <[email protected]>2020-07-22 20:48:59 -0700
committerJacob Palecki <[email protected]>2020-07-22 20:48:59 -0700
commit01d773c072e6b9efb4c2a9ebcc70b4cf98a6e32b (patch)
tree51f94b33c7beba43b379124c45516563497cebe8 /common/rawaccel.hpp
parentadd a license (diff)
downloadrawaccel-01d773c072e6b9efb4c2a9ebcc70b4cf98a6e32b.tar.xz
rawaccel-01d773c072e6b9efb4c2a9ebcc70b4cf98a6e32b.zip
Added source-style power acceleration option
Diffstat (limited to 'common/rawaccel.hpp')
-rw-r--r--common/rawaccel.hpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/common/rawaccel.hpp b/common/rawaccel.hpp
index 1483e67..a40b85b 100644
--- a/common/rawaccel.hpp
+++ b/common/rawaccel.hpp
@@ -8,7 +8,7 @@
namespace rawaccel {
-enum class mode { noaccel, linear, classic, natural, logarithmic, sigmoid };
+enum class mode { noaccel, linear, classic, natural, logarithmic, sigmoid, power };
struct rotator {
vec2d rot_vec = { 1, 0 };
@@ -98,6 +98,8 @@ struct accel_function {
break;
case mode::sigmoid: accel_val = k / (exp(-b * (speed - m)) + 1);
break;
+ case mode::power: accel_val = pow(speed, b) - 1;
+ break;
default:
break;
}