diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2014-06-11 17:42:05 +0200 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2014-06-11 17:42:05 +0200 |
commit | e5276167b90c9f156c31fd811a7106f1880b2856 (patch) | |
tree | bc1395aa4108664fc56b0d0b58bd4f0e3d063e3a /ftnoir_filter_accela | |
parent | afbca18600670b900eaa0ab30a296428d66eaaaf (diff) |
use the precise counter
Signed-off-by: Stanislaw Halik <sthalik@misaki.pl>
Diffstat (limited to 'ftnoir_filter_accela')
-rw-r--r-- | ftnoir_filter_accela/ftnoir_filter_accela.cpp | 3 | ||||
-rw-r--r-- | ftnoir_filter_accela/ftnoir_filter_accela.h | 4 |
2 files changed, 3 insertions, 4 deletions
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 <QMutex>
-#include <QElapsedTimer>
+#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;
};
|