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_udp/ftnoir_tracker_udp.cpp | |
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_udp/ftnoir_tracker_udp.cpp')
-rw-r--r-- | ftnoir_tracker_udp/ftnoir_tracker_udp.cpp | 22 |
1 files changed, 9 insertions, 13 deletions
diff --git a/ftnoir_tracker_udp/ftnoir_tracker_udp.cpp b/ftnoir_tracker_udp/ftnoir_tracker_udp.cpp index 4978fa8d..58316298 100644 --- a/ftnoir_tracker_udp/ftnoir_tracker_udp.cpp +++ b/ftnoir_tracker_udp/ftnoir_tracker_udp.cpp @@ -38,12 +38,8 @@ FTNoIR_Tracker::FTNoIR_Tracker() bEnableZ = true;
portAddress = 5551;
- newHeadPose.x = 0.0f;
- newHeadPose.y = 0.0f;
- newHeadPose.z = 0.0f;
- newHeadPose.yaw = 0.0f;
- newHeadPose.pitch = 0.0f;
- newHeadPose.roll = 0.0f;
+ for (int i = 0; i < 6; i++)
+ newHeadPose[i] = 0;
}
FTNoIR_Tracker::~FTNoIR_Tracker()
@@ -111,26 +107,26 @@ void FTNoIR_Tracker::StartTracker(QFrame* videoFrame) return;
}
-bool FTNoIR_Tracker::GiveHeadPoseData(THeadPoseData *data)
+bool FTNoIR_Tracker::GiveHeadPoseData(double *data)
{
mutex.lock();
if (bEnableX) {
- data->x = newHeadPose.x;
+ data[TX] = newHeadPose[TX];
}
if (bEnableX) {
- data->y = newHeadPose.y;
+ data[TY] = newHeadPose[TY];
}
if (bEnableX) {
- data->z = newHeadPose.z;
+ data[TZ] = newHeadPose[TZ];
}
if (bEnableYaw) {
- data->yaw = newHeadPose.yaw;
+ data[RX] = newHeadPose[RX];
}
if (bEnablePitch) {
- data->pitch = newHeadPose.pitch;
+ data[RY] = newHeadPose[RY];
}
if (bEnableRoll) {
- data->roll = newHeadPose.roll;
+ data[RZ] = newHeadPose[RZ];
}
mutex.unlock();
return true;
|