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 From b3ed8fd4e4fcad0b749126dee62588260d74b106 Mon Sep 17 00:00:00 2001 From: a1xd <68629610+a1xd@users.noreply.github.com> Date: Fri, 31 Jul 2020 01:37:41 -0400 Subject: add more tweaks for st-refactor --- common/accel-logarithmic.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'common/accel-logarithmic.hpp') diff --git a/common/accel-logarithmic.hpp b/common/accel-logarithmic.hpp index b628327..928eda9 100644 --- a/common/accel-logarithmic.hpp +++ b/common/accel-logarithmic.hpp @@ -9,7 +9,7 @@ namespace rawaccel { /// Struct to hold logarithmic acceleration implementation. struct accel_logarithmic : accel_base { - accel_logarithmic(accel_args args) : accel_base(args) {} + using accel_base::accel_base; inline double accelerate(double speed) const { //f(x) = log(m*x+1) -- cgit v1.2.3