diff options
Diffstat (limited to 'common/rawaccel.hpp')
| -rw-r--r-- | common/rawaccel.hpp | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/common/rawaccel.hpp b/common/rawaccel.hpp index a60fe1c..095af76 100644 --- a/common/rawaccel.hpp +++ b/common/rawaccel.hpp @@ -73,9 +73,8 @@ struct accel_function { // accel ramp rate double b = 0; - // the limit for natural and sigmoid modes, - // the exponent for classic mode, - // or the scale factor for power mode + // the limit for natural and sigmoid modes + // or the exponent for classic and power modes double k = 1; vec2d weight = { 1, 1 }; @@ -99,7 +98,7 @@ struct accel_function { break; case mode::sigmoid: accel_val = k / (exp(-b * (speed - m)) + 1); break; - case mode::power: accel_val = (speed_offset > 0 && speed < 1) ? 0 : pow(speed, b*k) - 1; + case mode::power: accel_val = (speed_offset > 0 && speed < 1) ? 0 : pow(speed*b, k) - 1; break; default: break; @@ -132,7 +131,7 @@ struct accel_function { if (args.time_min <= 0) error("min time must be positive"); if (args.lim_exp <= 1) { if (args.accel_mode == mode::classic) error("exponent must be greater than 1"); - else if (args.accel_mode == mode::power) error("scale factor must be greater than 1"); + if (args.accel_mode == mode::power) { if (args.lim_exp <=0 ) error("exponent must be greater than 0"); } else error("limit must be greater than 1"); } |