From e8417a29fb2153ea035a757f36bfa300cf8b480d Mon Sep 17 00:00:00 2001 From: a1xd <68629610+a1xd@users.noreply.github.com> Date: Thu, 30 Jul 2020 17:07:35 -0400 Subject: add tweaks for st-refactor --- common/accel-logarithmic.hpp | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 common/accel-logarithmic.hpp (limited to 'common/accel-logarithmic.hpp') diff --git a/common/accel-logarithmic.hpp b/common/accel-logarithmic.hpp new file mode 100644 index 0000000..b628327 --- /dev/null +++ b/common/accel-logarithmic.hpp @@ -0,0 +1,20 @@ +#pragma once + +#include + +#include "accel-base.hpp" + +namespace rawaccel { + + /// Struct to hold logarithmic acceleration implementation. + struct accel_logarithmic : accel_base { + + accel_logarithmic(accel_args args) : accel_base(args) {} + + inline double accelerate(double speed) const { + //f(x) = log(m*x+1) + return log(speed_coeff * speed + 1); + } + }; + +} -- cgit v1.2.3