mirror of
https://github.com/RawAccelOfficial/rawaccel.git
synced 2025-05-19 07:52:02 +02:00
minor changes to settings shape, requires driver reinstall add error handling to writer grapher changes: add prettier serialization + comments add elements for scale and separated limit/exp reset irrelevant (invisible) arg input before checks/write
26 lines
494 B
C++
26 lines
494 B
C++
#pragma once
|
|
|
|
#include <math.h>
|
|
|
|
#include "accel-base.hpp"
|
|
|
|
namespace rawaccel {
|
|
|
|
/// <summary> Struct to hold power (non-additive) acceleration implementation. </summary>
|
|
struct power_impl {
|
|
double scale;
|
|
double exponent;
|
|
|
|
power_impl(const accel_args& args) :
|
|
scale(args.scale), exponent(args.exponent)
|
|
{}
|
|
|
|
inline double operator()(double speed) const {
|
|
// f(x) = (mx)^k
|
|
return pow(speed * scale, exponent);
|
|
}
|
|
};
|
|
|
|
using accel_power = nonadditive_accel<power_impl>;
|
|
|
|
}
|