From 2a95abb332d9f3eee9bb155a355cfcfc661bbd5f Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Wed, 17 Jul 2013 15:17:47 +0200 Subject: Center immediately; remove dead code --- ftnoir_filter_accela/ftnoir_filter_accela.cpp | 6 ++++-- ftnoir_filter_accela/ftnoir_filter_accela.h | 7 +++---- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/ftnoir_filter_accela/ftnoir_filter_accela.cpp b/ftnoir_filter_accela/ftnoir_filter_accela.cpp index a53f689e..0eb7ea7b 100644 --- a/ftnoir_filter_accela/ftnoir_filter_accela.cpp +++ b/ftnoir_filter_accela/ftnoir_filter_accela.cpp @@ -46,7 +46,6 @@ void FTNoIR_Filter::loadSettings() { iniFile.beginGroup ( "Accela" ); kMagicNumber = iniFile.value ( "Reduction", 100 ).toFloat(); kZoomSlowness = iniFile.value("zoom-slowness", 0).toFloat(); - kSmoothingFactor = iniFile.value("smoothing-factor", 1).toFloat(); iniFile.endGroup (); } @@ -68,7 +67,10 @@ void FTNoIR_Filter::FilterHeadPoseData(double *current_camera_position, if (first_run) { for (int i = 0; i < 6; i++) + { new_camera_position[i] = target[i]; + current_camera_position[i] = target[i]; + } first_run=false; return; @@ -86,7 +88,7 @@ void FTNoIR_Filter::FilterHeadPoseData(double *current_camera_position, double start = prev_output[i]; double vec = e2 - start; int sign = vec < 0 ? -1 : 1; - double x = fabs(vec) / kSmoothingFactor; + double x = fabs(vec); QList points = (i >= 3 ? functionConfig : translationFunctionConfig).getPoints(); int extrapolatep = 0; double ratio; diff --git a/ftnoir_filter_accela/ftnoir_filter_accela.h b/ftnoir_filter_accela/ftnoir_filter_accela.h index 2e954c37..637d1a5d 100644 --- a/ftnoir_filter_accela/ftnoir_filter_accela.h +++ b/ftnoir_filter_accela/ftnoir_filter_accela.h @@ -48,17 +48,16 @@ public: FTNoIR_Filter(); ~FTNoIR_Filter(); void FilterHeadPoseData(double *current_camera_position, double *target_camera_position, double *new_camera_position, double *last_post_filter_values); - void Initialize() {} + void Initialize() { + first_run = true; + } private: void loadSettings(); // Load the settings from the INI-file double newHeadPose[6]; // Structure with new headpose bool first_run; - double kFactor, kFactorTranslation; - double kSensitivity, kSensitivityTranslation; double kMagicNumber, kZoomSlowness; // Stanislaws' magic number (should be 100 according to him...) - double kSmoothingFactor; FunctionConfig functionConfig; FunctionConfig translationFunctionConfig; -- cgit v1.2.3