diff options
| -rw-r--r-- | src/grail-gestures.c | 19 |
1 files changed, 1 insertions, 18 deletions
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, | |||
| 87 | return da; | 87 | return da; |
| 88 | } | 88 | } |
| 89 | 89 | ||
| 90 | /* Response-augmented EWMA filter, courtesy of Vojtech Pavlik */ | ||
| 91 | static float move_filter(const struct filter_model *m, float val) | ||
| 92 | { | ||
| 93 | if (val > m->value - m->fuzz / 2 && val < m->value + m->fuzz / 2) | ||
| 94 | return m->value; | ||
| 95 | if (val > m->value - m->fuzz && val < m->value + m->fuzz) | ||
| 96 | return (m->value * 3 + val) / 4; | ||
| 97 | if (val > m->value - m->fuzz * 2 && val < m->value + m->fuzz * 2) | ||
| 98 | return (m->value + val) / 2; | ||
| 99 | return val; | ||
| 100 | } | ||
| 101 | |||
| 102 | static void move_reset(struct move_model *m, int i, float x, grail_time_t t) | 90 | static void move_reset(struct move_model *m, int i, float x, grail_time_t t) |
| 103 | { | 91 | { |
| 104 | struct filter_model *fm = &m->fm[i]; | 92 | struct filter_model *fm = &m->fm[i]; |
| @@ -192,15 +180,10 @@ void gru_motion(struct grail *ge, | |||
| 192 | m->single = 1; | 180 | m->single = 1; |
| 193 | m->multi = 0; | 181 | m->multi = 0; |
| 194 | } else { | 182 | } else { |
| 195 | x = move_filter(&m->fm[FM_X], x); | ||
| 196 | y = move_filter(&m->fm[FM_Y], y); | ||
| 197 | r = compute_radius(x, y, frame); | 183 | r = compute_radius(x, y, frame); |
| 198 | r = move_filter(&m->fm[FM_R], r); | ||
| 199 | a = m->fm[FM_A].value; | 184 | a = m->fm[FM_A].value; |
| 200 | if (!s->is_semi_mt) { | 185 | if (!s->is_semi_mt) |
| 201 | a += compute_rotation(x, y, r, frame); | 186 | a += compute_rotation(x, y, r, frame); |
| 202 | a = move_filter(&m->fm[FM_A], a); | ||
| 203 | } | ||
| 204 | move_update(m, FM_X, x, t); | 187 | move_update(m, FM_X, x, t); |
| 205 | move_update(m, FM_Y, y, t); | 188 | move_update(m, FM_Y, y, t); |
| 206 | move_update(m, FM_R, r, t); | 189 | move_update(m, FM_R, r, t); |
