summaryrefslogtreecommitdiffhomepage
path: root/tracker-kinect-face/tracker.cpp
diff options
context:
space:
mode:
authorStéphane Lenclud <github@lenclud.com>2019-02-01 17:11:43 +0100
committerStéphane Lenclud <github@lenclud.com>2019-02-07 13:24:13 +0100
commite419e8056cd883d0c5465b20343d69eba8c255ae (patch)
treecad93218afc478edc472817b373b3a5c291be1d6 /tracker-kinect-face/tracker.cpp
parentaf286a3fa5e1460faad85b816149ad1309ef3584 (diff)
Kinect: Initializing positions and rotations to zero.
Diffstat (limited to 'tracker-kinect-face/tracker.cpp')
-rw-r--r--tracker-kinect-face/tracker.cpp11
1 files changed, 8 insertions, 3 deletions
diff --git a/tracker-kinect-face/tracker.cpp b/tracker-kinect-face/tracker.cpp
index 9b03f492..1ab14c87 100644
--- a/tracker-kinect-face/tracker.cpp
+++ b/tracker-kinect-face/tracker.cpp
@@ -84,8 +84,13 @@ KinectFaceTracker::KinectFaceTracker():
m_pCoordinateMapper(nullptr),
m_pColorFrameReader(nullptr),
m_pColorRGBX(nullptr),
- m_pBodyFrameReader(nullptr)
-
+ m_pBodyFrameReader(nullptr),
+ iLastFacePosition{0,0,0},
+ iFacePositionCenter{ 0,0,0 },
+ iFacePosition{ 0,0,0 },
+ iLastFaceRotation{ 0,0,0 },
+ iFaceRotationCenter{ 0,0,0 },
+ iFaceRotation{ 0,0,0 }
{
m_pFaceFrameSource = nullptr;
m_pFaceFrameReader = nullptr;
@@ -175,7 +180,7 @@ void KinectFaceTracker::data(double *data)
data[1] = (iLastFacePosition.Y - iFacePositionCenter.Y) * 100;
data[2] = (iLastFacePosition.Z - iFacePositionCenter.Z) * 100;
- // Yaw, picth, Roll
+ // Yaw, Picth, Roll
data[3] = 0-(iLastFaceRotation.X - iFaceRotationCenter.X); // Invert to be compatible with ED out-of-the-box
data[4] = (iLastFaceRotation.Y - iFaceRotationCenter.Y);
data[5] = (iLastFaceRotation.Z - iFaceRotationCenter.Z);