From 6b56d222dde782fb618b1886c5ed8279271a80b8 Mon Sep 17 00:00:00 2001 From: Chase Douglas Date: Tue, 12 Apr 2011 18:11:46 +0200 Subject: Remove the obsoleted transformation filter Remove the additional filtering performed in the gestural transforms. This used to serve a purpose during development against devices without per-contact filtering. Since then, all devices are filtered, rendering the extra filtering obsolete. This patch also fixes a problem with rotation events. Currently, if you rotate very fast, the rotation angle will be close to the true angle. However, if you rotate very slow, the rotation angle will be much less than the true rotation angle. Signed-off-by: Chase Douglas Signed-off-by: Henrik Rydberg --- src/grail-gestures.c | 19 +------------------ 1 file changed, 1 insertion(+), 18 deletions(-) (limited to 'src/grail-gestures.c') diff --git a/src/grail-gestures.c b/src/grail-gestures.c index c4ae0dc..b461dc3 100644 --- a/src/grail-gestures.c +++ b/src/grail-gestures.c @@ -87,18 +87,6 @@ static float compute_rotation(float x, float y, float r, return da; } -/* Response-augmented EWMA filter, courtesy of Vojtech Pavlik */ -static float move_filter(const struct filter_model *m, float val) -{ - if (val > m->value - m->fuzz / 2 && val < m->value + m->fuzz / 2) - return m->value; - if (val > m->value - m->fuzz && val < m->value + m->fuzz) - return (m->value * 3 + val) / 4; - if (val > m->value - m->fuzz * 2 && val < m->value + m->fuzz * 2) - return (m->value + val) / 2; - return val; -} - static void move_reset(struct move_model *m, int i, float x, grail_time_t t) { struct filter_model *fm = &m->fm[i]; @@ -192,15 +180,10 @@ void gru_motion(struct grail *ge, m->single = 1; m->multi = 0; } else { - x = move_filter(&m->fm[FM_X], x); - y = move_filter(&m->fm[FM_Y], y); r = compute_radius(x, y, frame); - r = move_filter(&m->fm[FM_R], r); a = m->fm[FM_A].value; - if (!s->is_semi_mt) { + if (!s->is_semi_mt) a += compute_rotation(x, y, r, frame); - a = move_filter(&m->fm[FM_A], a); - } move_update(m, FM_X, x, t); move_update(m, FM_Y, y, t); move_update(m, FM_R, r, t); -- cgit v1.2.3