summaryrefslogtreecommitdiffhomepage
path: root/FaceTrackNoIR/FaceTrackNoIR.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'FaceTrackNoIR/FaceTrackNoIR.cpp')
-rw-r--r--FaceTrackNoIR/FaceTrackNoIR.cpp19
1 files changed, 19 insertions, 0 deletions
diff --git a/FaceTrackNoIR/FaceTrackNoIR.cpp b/FaceTrackNoIR/FaceTrackNoIR.cpp
index e9a0c8be..7197a5f7 100644
--- a/FaceTrackNoIR/FaceTrackNoIR.cpp
+++ b/FaceTrackNoIR/FaceTrackNoIR.cpp
@@ -147,6 +147,11 @@ void FaceTrackNoIR::setupFaceTrackNoIR() {
//Setup the timer for automatically minimizing after StartTracker.
timMinimizeFTN = new QTimer(this);
connect(timMinimizeFTN, SIGNAL(timeout()), this, SLOT(showMinimized()));
+
+ //Setup the timer for showing the headpose.
+ timUpdateHeadPose = new QTimer(this);
+ connect(timUpdateHeadPose, SIGNAL(timeout()), this, SLOT(showHeadPose()));
+ timUpdateHeadPose->start(10);
}
/** destructor stops the engine and quits the faceapi **/
@@ -654,6 +659,20 @@ void FaceTrackNoIR::setUseFilter( int set ) {
settingsDirty = true;
}
+/** Show the headpose in the widget (triggered by timer) **/
+void FaceTrackNoIR::showHeadPose() {
+THeadPoseData newdata;
+
+ Tracker::getHeadPose(&newdata);
+ ui.lcdNumX->display((double) (((int)(newdata.x * 10.0f))/10.0f));
+ ui.lcdNumY->display((double) (((int)(newdata.y * 10.0f))/10.0f));
+ ui.lcdNumZ->display((double) (((int)(newdata.z * 10.0f))/10.0f));
+
+ ui.lcdNumRotX->display((double) (((int)(newdata.yaw * 10.0f))/10.0f));
+ ui.lcdNumRotY->display((double) (((int)(newdata.pitch * 10.0f))/10.0f));
+ ui.lcdNumRotZ->display((double) (((int)(newdata.roll * 10.0f))/10.0f));
+}
+
/** set the redhold from the slider **/
void FaceTrackNoIR::setMinSmooth( int redh ) {
Tracker::setMinSmooth ( redh );