summaryrefslogtreecommitdiff
path: root/common/accel-base.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'common/accel-base.hpp')
-rw-r--r--common/accel-base.hpp16
1 files changed, 9 insertions, 7 deletions
diff --git a/common/accel-base.hpp b/common/accel-base.hpp
index e87b463..da2c96b 100644
--- a/common/accel-base.hpp
+++ b/common/accel-base.hpp
@@ -31,12 +31,7 @@ namespace rawaccel {
/// <summary> Generally, the acceleration ramp rate.
double speed_coeff = 0;
- /// <summary>
- /// Initializes a new instance of the <see cref="accel_base"/> struct.
- /// </summary>
- /// <param name="args"></param>
- /// <returns></returns>
- accel_base(accel_args args) {
+ accel_base(const accel_args& args) {
verify(args);
speed_coeff = args.accel;
@@ -44,6 +39,13 @@ namespace rawaccel {
}
/// <summary>
+ /// Default transformation of speed -> acceleration.
+ /// </summary>
+ inline double accelerate(double speed) const {
+ return speed_coeff * speed;
+ }
+
+ /// <summary>
/// Default transformation of acceleration -> mouse input multipliers.
/// </summary>
inline vec2d scale(double accel_val) const {
@@ -57,7 +59,7 @@ namespace rawaccel {
/// Verifies arguments as valid. Errors if not.
/// </summary>
/// <param name="args">Arguments to verified.</param>
- void verify(accel_args args) const {
+ void verify(const accel_args& args) const {
if (args.accel < 0) error("accel can not be negative, use a negative weight to compensate");
}