summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--FTNoIR_Tracker_PT/ftnoir_tracker_pt.cpp2
-rw-r--r--FTNoIR_Tracker_PT/ftnoir_tracker_pt.h4
-rw-r--r--ftnoir_filter_accela/ftnoir_filter_accela.cpp3
-rw-r--r--ftnoir_filter_accela/ftnoir_filter_accela.h4
4 files changed, 6 insertions, 7 deletions
diff --git a/FTNoIR_Tracker_PT/ftnoir_tracker_pt.cpp b/FTNoIR_Tracker_PT/ftnoir_tracker_pt.cpp
index 162e4343..cbc1f1dc 100644
--- a/FTNoIR_Tracker_PT/ftnoir_tracker_pt.cpp
+++ b/FTNoIR_Tracker_PT/ftnoir_tracker_pt.cpp
@@ -74,7 +74,7 @@ void Tracker::run()
if (commands & PAUSE) continue;
commands = 0;
- dt = time.restart() / 1000.0;
+ dt = time.start() / 1000.0;
new_frame = camera.get_frame(dt, &frame);
diff --git a/FTNoIR_Tracker_PT/ftnoir_tracker_pt.h b/FTNoIR_Tracker_PT/ftnoir_tracker_pt.h
index 1f6efce1..80abbc6a 100644
--- a/FTNoIR_Tracker_PT/ftnoir_tracker_pt.h
+++ b/FTNoIR_Tracker_PT/ftnoir_tracker_pt.h
@@ -18,7 +18,7 @@
#include "point_extractor.h"
#include "point_tracker.h"
#include "pt_video_widget.h"
-#include <QElapsedTimer>
+#include "facetracknoir/timer.hpp"
#include <QThread>
#include <QMutex>
@@ -84,7 +84,7 @@ protected:
bool tracking_valid;
settings s;
- QElapsedTimer time;
+ Timer time;
};
#undef VideoWidget
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;
};