mirror of
https://github.com/RawAccelOfficial/rawaccel.git
synced 2025-05-11 18:36:46 +02:00
optimize a bit/refactor modify
This commit is contained in:
parent
805ed31165
commit
c55d1bfd01
10 changed files with 199 additions and 259 deletions
|
@ -26,8 +26,8 @@ namespace rawaccel {
|
|||
{
|
||||
if (x <= offset) return 1;
|
||||
|
||||
double offset_x = x - offset;
|
||||
double decay = exp(-accel * offset_x);
|
||||
double offset_x = offset - x;
|
||||
double decay = exp(accel * offset_x);
|
||||
return limit * (1 - (decay * offset_x + offset) / x) + 1;
|
||||
}
|
||||
|
||||
|
@ -41,8 +41,8 @@ namespace rawaccel {
|
|||
{
|
||||
if (x <= offset) return 1;
|
||||
|
||||
double offset_x = x - offset;
|
||||
double decay = exp(-accel * offset_x);
|
||||
double offset_x = offset - x;
|
||||
double decay = exp(accel * offset_x);
|
||||
double output = limit * (offset_x + decay / accel) + constant;
|
||||
return output / x + 1;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue