summaryrefslogtreecommitdiff
path: root/common/accel-linear.hpp
diff options
context:
space:
mode:
authora1xd <[email protected]>2021-09-22 20:49:04 -0400
committerGitHub <[email protected]>2021-09-22 20:49:04 -0400
commit8a4b6f57758338d5537d4671184099a4728a8cdd (patch)
treedf36529a344d5d21ff11f5ba021ec80afb4b68a4 /common/accel-linear.hpp
parentMerge pull request #87 from matthewstrasiotto/streamer_mode (diff)
parentimprove converter + docs (diff)
downloadrawaccel-8a4b6f57758338d5537d4671184099a4728a8cdd.tar.xz
rawaccel-8a4b6f57758338d5537d4671184099a4728a8cdd.zip
Merge pull request #105 from a1xd/1.5.x
v1.5
Diffstat (limited to 'common/accel-linear.hpp')
-rw-r--r--common/accel-linear.hpp31
1 files changed, 0 insertions, 31 deletions
diff --git a/common/accel-linear.hpp b/common/accel-linear.hpp
deleted file mode 100644
index 2bd57b8..0000000
--- a/common/accel-linear.hpp
+++ /dev/null
@@ -1,31 +0,0 @@
-#pragma once
-
-#include "accel-base.hpp"
-
-namespace rawaccel {
-
- /// <summary> Struct to hold linear acceleration implementation. </summary>
- struct linear_impl {
- double accel;
- double offset;
- double subtractive_const;
- double divisive_const;
-
- linear_impl(const accel_args& args) : accel(args.accel), offset(args.offset) {
- subtractive_const = 2 * accel * offset;
- divisive_const = accel * offset * offset;
- }
-
- inline double operator()(double speed) const {
- double base_speed = speed + offset;
- return accel * base_speed - subtractive_const + divisive_const / base_speed;
- }
-
- inline double legacy_offset(double speed) const {
- return accel * speed;
- }
- };
-
- using accel_linear = additive_accel<linear_impl>;
-
-}