summaryrefslogtreecommitdiff
path: root/common/accel-base.hpp
diff options
context:
space:
mode:
authora1xd <[email protected]>2020-08-12 20:12:43 -0400
committerGitHub <[email protected]>2020-08-12 20:12:43 -0400
commit8a61f87647007316d5a55cc040821f1440e30173 (patch)
treed15dbadb2497ae5df3d734b534d73ea613a0e943 /common/accel-base.hpp
parentMerge pull request #13 from a1xd/write-cd (diff)
parentDisallow differing x and y weights with gain cap (diff)
downloadrawaccel-8a61f87647007316d5a55cc040821f1440e30173.tar.xz
rawaccel-8a61f87647007316d5a55cc040821f1440e30173.zip
Merge pull request #14 from JacobPalecki/GainCap
Gain cap
Diffstat (limited to 'common/accel-base.hpp')
-rw-r--r--common/accel-base.hpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/common/accel-base.hpp b/common/accel-base.hpp
index 91510a4..60b7362 100644
--- a/common/accel-base.hpp
+++ b/common/accel-base.hpp
@@ -24,6 +24,7 @@ namespace rawaccel {
double exponent = 2;
double midpoint = 0;
double power_scale = 1;
+ double gain_cap = 0;
vec2d weight = { 1, 1 };
};
@@ -68,6 +69,7 @@ namespace rawaccel {
/// <param name="args">Arguments to verified.</param>
void verify(const accel_args& args) const {
if (args.accel < 0) bad_arg("accel can not be negative, use a negative weight to compensate");
+ if (args.gain_cap > 0 && weight.x != weight.y) bad_arg("weight x and y values must be equal with a gain cap");
}
accel_base() = default;