summaryrefslogtreecommitdiffhomepage
path: root/ftnoir_tracker_ht
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2013-04-13 05:45:07 +0200
committerStanislaw Halik <sthalik@misaki.pl>2013-04-13 05:45:07 +0200
commit351e844f6a3c5484acfcf4fb0154bcab6f1780a0 (patch)
treee2b1fcb041ae3b763120e3ffb134d529006b0cb2 /ftnoir_tracker_ht
parent29cf8b9ddf89a42d72ca1c0fbdc9fa93f0c5d189 (diff)
Don't use axes as class/struct members. Use an array instead, and iterate over them where applicable.
Diffstat (limited to 'ftnoir_tracker_ht')
-rw-r--r--ftnoir_tracker_ht/ftnoir_tracker_ht.cpp26
-rw-r--r--ftnoir_tracker_ht/ftnoir_tracker_ht.h2
2 files changed, 14 insertions, 14 deletions
diff --git a/ftnoir_tracker_ht/ftnoir_tracker_ht.cpp b/ftnoir_tracker_ht/ftnoir_tracker_ht.cpp
index d37ab9b2..224fff4a 100644
--- a/ftnoir_tracker_ht/ftnoir_tracker_ht.cpp
+++ b/ftnoir_tracker_ht/ftnoir_tracker_ht.cpp
@@ -218,7 +218,7 @@ void Tracker::paint_widget() {
}
}
-bool Tracker::GiveHeadPoseData(THeadPoseData* data)
+bool Tracker::GiveHeadPoseData(double *data)
{
bool ret = false;
@@ -233,25 +233,25 @@ bool Tracker::GiveHeadPoseData(THeadPoseData* data)
}
if (shm->result.filled) {
if (enableRX)
- data->yaw = shm->result.rotx;
+ data[RX] = shm->result.rotx;
if (enableRY) {
- data->pitch = shm->result.roty;
- double sign = data->pitch >= 0 ? 1 : -1;
- if (fabs(fabs(data->pitch) - 180) < fabs(data->pitch))
- data->pitch = fabs(fabs(data->pitch) - 180) * sign;
+ data[RY] = shm->result.roty;
+ double sign = data[RY] >= 0 ? 1 : -1;
+ if (fabs(fabs(data[RY]) - 180) < fabs(data[RY]))
+ data[RY] = fabs(fabs(data[RY]) - 180) * sign;
}
if (enableRZ) {
- data->roll = shm->result.rotz;
- double sign = data->roll >= 0 ? 1 : -1;
- if (fabs(fabs(data->roll) - 180) < fabs(data->roll))
- data->roll = fabs(fabs(data->roll) - 180) * sign;
+ data[RZ] = shm->result.rotz;
+ double sign = data[RZ] >= 0 ? 1 : -1;
+ if (fabs(fabs(data[RZ]) - 180) < fabs(data[RZ]))
+ data[RZ] = fabs(fabs(data[RZ]) - 180) * sign;
}
if (enableTX)
- data->x = shm->result.tx;
+ data[TX] = shm->result.tx;
if (enableTY)
- data->y = shm->result.ty;
+ data[TY] = shm->result.ty;
if (enableTZ)
- data->z = shm->result.tz;
+ data[TZ] = shm->result.tz;
ret = true;
}
lck_shm.unlock();
diff --git a/ftnoir_tracker_ht/ftnoir_tracker_ht.h b/ftnoir_tracker_ht/ftnoir_tracker_ht.h
index 5a17e4af..a08f2437 100644
--- a/ftnoir_tracker_ht/ftnoir_tracker_ht.h
+++ b/ftnoir_tracker_ht/ftnoir_tracker_ht.h
@@ -24,7 +24,7 @@ public:
Tracker();
~Tracker();
void StartTracker(QFrame* frame);
- bool GiveHeadPoseData(THeadPoseData *data);
+ bool GiveHeadPoseData(double *data);
bool enableTX, enableTY, enableTZ, enableRX, enableRY, enableRZ;
ht_shm_t* shm;
bool NeedsTimeToFinish() {