summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2015-10-16 21:38:23 +0200
committerStanislaw Halik <sthalik@misaki.pl>2015-10-16 21:38:23 +0200
commit95f542365f6f1cd043c7b3090a67d269d6dde58b (patch)
tree4154c6e20097402789b43f9a48746fe4a3597e27
parent28deb29d72809b009b83dd8365fbae3043684f14 (diff)
allow for filter immediate center
-rw-r--r--ftnoir_filter_accela/ftnoir_filter_accela.h3
-rw-r--r--opentrack/plugin-api.hpp2
-rw-r--r--opentrack/tracker.cpp2
3 files changed, 6 insertions, 1 deletions
diff --git a/ftnoir_filter_accela/ftnoir_filter_accela.h b/ftnoir_filter_accela/ftnoir_filter_accela.h
index 318cf909..a6f04dfa 100644
--- a/ftnoir_filter_accela/ftnoir_filter_accela.h
+++ b/ftnoir_filter_accela/ftnoir_filter_accela.h
@@ -37,7 +37,8 @@ class FTNoIR_Filter : public IFilter
{
public:
FTNoIR_Filter();
- void filter(const double* input, double *output);
+ void filter(const double* input, double *output) override;
+ void center() override { first_run = true; }
Map rot, trans;
private:
settings_accela s;
diff --git a/opentrack/plugin-api.hpp b/opentrack/plugin-api.hpp
index 732dbb3d..a57077ab 100644
--- a/opentrack/plugin-api.hpp
+++ b/opentrack/plugin-api.hpp
@@ -61,6 +61,8 @@ struct IFilter
// perform filtering step.
// you have to take care of dt on your own, try "opentrack-compat/timer.hpp"
virtual void filter(const double *input, double *output) = 0;
+ // optionally reset the filter when centering
+ virtual void center() {}
};
struct IFilterDialog : public BaseDialog
diff --git a/opentrack/tracker.cpp b/opentrack/tracker.cpp
index 8fd054b4..a9e60555 100644
--- a/opentrack/tracker.cpp
+++ b/opentrack/tracker.cpp
@@ -114,6 +114,8 @@ void Tracker::logic()
if (can_center)
{
+ if (libs.pFilter)
+ libs.pFilter->center();
centerp = false;
for (int i = 0; i < 3; i++)
t_b[i] = t(i);