filter: add a comment for how we calculate velocity

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
This commit is contained in:
Peter Hutterer 2016-12-13 15:31:27 +10:00
parent 5016dcd012
commit 0e8be12383

View file

@ -228,6 +228,13 @@ calculate_velocity_after_timeout(struct pointer_tracker *tracker)
tracker->time + MOTION_TIMEOUT);
}
/**
* Calculate the velocity based on the tracker data. Velocity is averaged
* across multiple historical values, provided those values aren't "too
* different" to our current one. That includes either being too far in the
* past, moving into a different direction or having too much of a velocity
* change between events.
*/
static double
calculate_velocity(struct pointer_accelerator *accel, uint64_t time)
{