diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2013-04-13 05:45:07 +0200 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2013-04-13 05:45:07 +0200 |
commit | 351e844f6a3c5484acfcf4fb0154bcab6f1780a0 (patch) | |
tree | e2b1fcb041ae3b763120e3ffb134d529006b0cb2 /ftnoir_tracker_sm | |
parent | 29cf8b9ddf89a42d72ca1c0fbdc9fa93f0c5d189 (diff) |
Don't use axes as class/struct members. Use an array instead, and iterate over them where applicable.
Diffstat (limited to 'ftnoir_tracker_sm')
-rw-r--r-- | ftnoir_tracker_sm/ftnoir_tracker_faceapi.cpp | 14 | ||||
-rw-r--r-- | ftnoir_tracker_sm/ftnoir_tracker_sm.h | 2 |
2 files changed, 8 insertions, 8 deletions
diff --git a/ftnoir_tracker_sm/ftnoir_tracker_faceapi.cpp b/ftnoir_tracker_sm/ftnoir_tracker_faceapi.cpp index 09d7432b..81be669a 100644 --- a/ftnoir_tracker_sm/ftnoir_tracker_faceapi.cpp +++ b/ftnoir_tracker_sm/ftnoir_tracker_faceapi.cpp @@ -92,7 +92,7 @@ void FTNoIR_Tracker::WaitForExit() }
}
-bool FTNoIR_Tracker::GiveHeadPoseData(THeadPoseData *data)
+bool FTNoIR_Tracker::GiveHeadPoseData(double *data)
{
//
// Check if the pointer is OK and wait for the Mutex.
@@ -103,22 +103,22 @@ bool FTNoIR_Tracker::GiveHeadPoseData(THeadPoseData *data) // Copy the measurements to FaceTrackNoIR.
//
if (bEnableX) {
- data->x = pMemData->data.new_pose.head_pos.x * 100.0f; // From meters to centimeters
+ data[TX] = pMemData->data.new_pose.head_pos.x * 100.0f; // From meters to centimeters
}
if (bEnableY) {
- data->y = pMemData->data.new_pose.head_pos.y * 100.0f;
+ data[TY] = pMemData->data.new_pose.head_pos.y * 100.0f;
}
if (bEnableZ) {
- data->z = pMemData->data.new_pose.head_pos.z * 100.0f;
+ data[TZ] = pMemData->data.new_pose.head_pos.z * 100.0f;
}
if (bEnableYaw) {
- data->yaw = pMemData->data.new_pose.head_rot.y_rads * 57.295781f; // From rads to degrees
+ data[RX] = pMemData->data.new_pose.head_rot.y_rads * 57.295781f; // From rads to degrees
}
if (bEnablePitch) {
- data->pitch = pMemData->data.new_pose.head_rot.x_rads * 57.295781f;
+ data[RY] = pMemData->data.new_pose.head_rot.x_rads * 57.295781f;
}
if (bEnableRoll) {
- data->roll = pMemData->data.new_pose.head_rot.z_rads * 57.295781f;
+ data[RZ] = pMemData->data.new_pose.head_rot.z_rads * 57.295781f;
}
//
diff --git a/ftnoir_tracker_sm/ftnoir_tracker_sm.h b/ftnoir_tracker_sm/ftnoir_tracker_sm.h index ae79436d..665507e6 100644 --- a/ftnoir_tracker_sm/ftnoir_tracker_sm.h +++ b/ftnoir_tracker_sm/ftnoir_tracker_sm.h @@ -45,7 +45,7 @@ public: void StartTracker( QFrame* parent_window );
void StopTracker( bool exit );
- bool GiveHeadPoseData(THeadPoseData *data); // Returns true if confidence is good
+ bool GiveHeadPoseData(double *data); // Returns true if confidence is good
void WaitForExit();
void loadSettings();
|