Skip to content

Commit

Permalink
fix: correct wrong transcription of acceleration factor calculation
Browse files Browse the repository at this point in the history
  • Loading branch information
burkfers committed Mar 5, 2024
1 parent 38e5400 commit e066550
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion maccel/maccel.c
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ report_mouse_t pointing_device_task_maccel(report_mouse_t mouse_report) {
// correct raw velocity for dpi
const float velocity = dpi_correction * velocity_raw;
// calculate mouse acceleration factor: f(dv) = c - ((c-1) / ((1 + e^(x(x - b)) * a/z)))
const float maccel_factor = g_maccel_config.limit - (g_maccel_config.limit - 1) / powf(1 + expf(g_maccel_config.takeoff * (velocity - g_maccel_config.limit)), g_maccel_config.growth_rate / g_maccel_config.takeoff);
const float maccel_factor = g_maccel_config.limit - (g_maccel_config.limit - 1) / powf(1 + expf(g_maccel_config.takeoff * (velocity - g_maccel_config.offset)), g_maccel_config.growth_rate / g_maccel_config.takeoff);
// calculate accelerated delta X and Y values and clamp:
const mouse_xy_report_t x = CONSTRAIN_REPORT(mouse_report.x * maccel_factor);
const mouse_xy_report_t y = CONSTRAIN_REPORT(mouse_report.y * maccel_factor);
Expand Down

0 comments on commit e066550

Please sign in to comment.