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_pt | |
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_pt')
-rw-r--r-- | ftnoir_tracker_pt/ftnoir_tracker_pt.cpp | 14 | ||||
-rw-r--r-- | ftnoir_tracker_pt/ftnoir_tracker_pt.h | 2 |
2 files changed, 8 insertions, 8 deletions
diff --git a/ftnoir_tracker_pt/ftnoir_tracker_pt.cpp b/ftnoir_tracker_pt/ftnoir_tracker_pt.cpp index 96017d52..654e9924 100644 --- a/ftnoir_tracker_pt/ftnoir_tracker_pt.cpp +++ b/ftnoir_tracker_pt/ftnoir_tracker_pt.cpp @@ -192,7 +192,7 @@ void Tracker::paint_widget() { }
}
-bool Tracker::GiveHeadPoseData(THeadPoseData *data)
+bool Tracker::GiveHeadPoseData(double *data)
{
const float rad2deg = 180.0/3.14159265;
const float deg2rad = 1.0/rad2deg;
@@ -217,13 +217,13 @@ bool Tracker::GiveHeadPoseData(THeadPoseData *data) // get translation(s)
if (bEnableX) {
- data->x = t[0] / 10.0; // convert to cm
+ data[TX] = t[0] / 10.0; // convert to cm
}
if (bEnableY) {
- data->y = t[1] / 10.0;
+ data[TY] = t[1] / 10.0;
}
if (bEnableZ) {
- data->z = t[2] / 10.0;
+ data[TZ] = t[2] / 10.0;
}
// translate rotation matrix from opengl (G) to roll-pitch-yaw (R) frame
@@ -241,13 +241,13 @@ bool Tracker::GiveHeadPoseData(THeadPoseData *data) gamma = atan2( R(2,1), R(2,2));
if (bEnableYaw) {
- data->yaw = rad2deg * alpha;
+ data[RX] = rad2deg * alpha;
}
if (bEnablePitch) {
- data->pitch = rad2deg * beta;
+ data[RY] = rad2deg * beta;
}
if (bEnableRoll) {
- data->roll = rad2deg * gamma;
+ data[RZ] = rad2deg * gamma;
}
}
return true;
diff --git a/ftnoir_tracker_pt/ftnoir_tracker_pt.h b/ftnoir_tracker_pt/ftnoir_tracker_pt.h index 49881b69..014cab76 100644 --- a/ftnoir_tracker_pt/ftnoir_tracker_pt.h +++ b/ftnoir_tracker_pt/ftnoir_tracker_pt.h @@ -33,7 +33,7 @@ public: // ITracker interface
void StartTracker(QFrame* videoFrame);
- bool GiveHeadPoseData(THeadPoseData *data);
+ bool GiveHeadPoseData(double *data);
void refreshVideo();
|