summaryrefslogtreecommitdiff
path: root/common/accel-linear.hpp
diff options
context:
space:
mode:
authorJacobPalecki <[email protected]>2020-08-31 23:03:46 -0700
committerGitHub <[email protected]>2020-08-31 23:03:46 -0700
commit471fe599bab6ba0632ddd1dacd20c7fc42db0eee (patch)
tree90a82ee14dbb112621657efbd2523ed35f59d154 /common/accel-linear.hpp
parentMerge pull request #16 from JacobPalecki/Misc (diff)
parentadd independent xy accel to driver (diff)
downloadrawaccel-471fe599bab6ba0632ddd1dacd20c7fc42db0eee.tar.xz
rawaccel-471fe599bab6ba0632ddd1dacd20c7fc42db0eee.zip
Merge pull request #17 from a1xd/indep
Indep
Diffstat (limited to 'common/accel-linear.hpp')
-rw-r--r--common/accel-linear.hpp11
1 files changed, 9 insertions, 2 deletions
diff --git a/common/accel-linear.hpp b/common/accel-linear.hpp
index 5cbb7c6..a943594 100644
--- a/common/accel-linear.hpp
+++ b/common/accel-linear.hpp
@@ -5,10 +5,17 @@
namespace rawaccel {
/// <summary> Struct to hold linear acceleration implementation. </summary>
- struct accel_linear : accel_base {
+ struct linear_impl {
+ double accel;
+
+ linear_impl(const accel_args& args) : accel(args.accel) {}
- using accel_base::accel_base;
+ inline double operator()(double speed) const {
+ return accel * speed;
+ }
};
+ using accel_linear = additive_accel<linear_impl>;
+
}