summaryrefslogtreecommitdiff
path: root/common/accel-logarithmic.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'common/accel-logarithmic.hpp')
-rw-r--r--common/accel-logarithmic.hpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/common/accel-logarithmic.hpp b/common/accel-logarithmic.hpp
index 928eda9..c7991c7 100644
--- a/common/accel-logarithmic.hpp
+++ b/common/accel-logarithmic.hpp
@@ -7,14 +7,16 @@
namespace rawaccel {
/// <summary> Struct to hold logarithmic acceleration implementation. </summary>
- struct accel_logarithmic : accel_base {
+ struct logarithmic_impl {
+ double accel;
- using accel_base::accel_base;
+ logarithmic_impl(const accel_args& args) : accel(args.accel) {}
- inline double accelerate(double speed) const {
+ inline double operator()(double speed) const {
//f(x) = log(m*x+1)
- return log(speed_coeff * speed + 1);
+ return log(accel * speed + 1);
}
};
+ using accel_logarithmic = additive_accel<logarithmic_impl>;
}