summaryrefslogtreecommitdiffhomepage
path: root/opentrack
diff options
context:
space:
mode:
Diffstat (limited to 'opentrack')
-rw-r--r--opentrack/plugin-api.hpp2
-rw-r--r--opentrack/tracker.cpp2
2 files changed, 4 insertions, 0 deletions
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);