From e5276167b90c9f156c31fd811a7106f1880b2856 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Wed, 11 Jun 2014 17:42:05 +0200 Subject: use the precise counter Signed-off-by: Stanislaw Halik --- ftnoir_filter_accela/ftnoir_filter_accela.cpp | 3 +-- ftnoir_filter_accela/ftnoir_filter_accela.h | 4 ++-- 2 files changed, 3 insertions(+), 4 deletions(-) (limited to 'ftnoir_filter_accela') diff --git a/ftnoir_filter_accela/ftnoir_filter_accela.cpp b/ftnoir_filter_accela/ftnoir_filter_accela.cpp index 13e4ea79..31cb94bd 100644 --- a/ftnoir_filter_accela/ftnoir_filter_accela.cpp +++ b/ftnoir_filter_accela/ftnoir_filter_accela.cpp @@ -67,8 +67,7 @@ void FTNoIR_Filter::FilterHeadPoseData(const double* target_camera_position, { for (int i = 0; i < 6; i++) last_input[i] = target_camera_position[i]; - frame_delta = timer.isValid() ? timer.elapsed() : 1; - timer.start(); + frame_delta = timer.start(); } else { auto d = timer.elapsed(); double c = clamp(0.0, 1.0, d / (double) frame_delta); diff --git a/ftnoir_filter_accela/ftnoir_filter_accela.h b/ftnoir_filter_accela/ftnoir_filter_accela.h index 42db2e47..f56ae57c 100644 --- a/ftnoir_filter_accela/ftnoir_filter_accela.h +++ b/ftnoir_filter_accela/ftnoir_filter_accela.h @@ -3,7 +3,7 @@ #include "ui_ftnoir_accela_filtercontrols.h" #include "facetracknoir/global-settings.h" #include -#include +#include "facetracknoir/timer.hpp" #define ACCELA_SMOOTHING_ROTATION 60.0 #define ACCELA_SMOOTHING_TRANSLATION 40.0 @@ -51,7 +51,7 @@ private: bool first_run; double last_input[6]; double last_output[3][6]; - QElapsedTimer timer; + Timer timer; qint64 frame_delta; }; -- cgit v1.2.3