diff options
Diffstat (limited to 'facetracknoir/tracker.cpp')
-rw-r--r-- | facetracknoir/tracker.cpp | 31 |
1 files changed, 10 insertions, 21 deletions
diff --git a/facetracknoir/tracker.cpp b/facetracknoir/tracker.cpp index b65ccde8..8f8ad356 100644 --- a/facetracknoir/tracker.cpp +++ b/facetracknoir/tracker.cpp @@ -85,14 +85,9 @@ static void t_compensate(double* input, double* output) /** QThread run method @override **/
void Tracker::run() {
- T6DOF offset_camera, gameoutput_camera, target_camera;
-
- bool bTracker1Confid = false;
- bool bTracker2Confid = false;
+ T6DOF offset_camera;
double newpose[6] = {0};
- double last_post_filter[6] ;
-
int sleep_ms = 15;
if (Libraries->pTracker)
@@ -113,25 +108,22 @@ void Tracker::run() { break;
if (Libraries->pSecondTracker) {
- bTracker2Confid = Libraries->pSecondTracker->GiveHeadPoseData(newpose);
+ Libraries->pSecondTracker->GetHeadPoseData(newpose);
}
if (Libraries->pTracker) {
- bTracker1Confid = Libraries->pTracker->GiveHeadPoseData(newpose);
+ Libraries->pTracker->GetHeadPoseData(newpose);
}
{
QMutexLocker foo(&mtx);
- const bool confid = bTracker1Confid || bTracker2Confid;
- if ( confid ) {
- for (int i = 0; i < 6; i++)
- mainApp->axis(i).headPos = newpose[i];
- }
+ for (int i = 0; i < 6; i++)
+ mainApp->axis(i).headPos = newpose[i];
if (do_center) {
for (int i = 0; i < 6; i++)
- offset_camera.axes[i] = target_camera.axes[i];
+ offset_camera.axes[i] = mainApp->axis(i).headPos;
do_center = false;
@@ -139,9 +131,9 @@ void Tracker::run() { Libraries->pFilter->Initialize();
}
- T6DOF target_camera2, new_camera;
+ T6DOF target_camera, target_camera2, new_camera;
- if (enabled && confid)
+ if (enabled)
{
for (int i = 0; i < 6; i++)
target_camera.axes[i] = mainApp->axis(i).headPos;
@@ -150,9 +142,7 @@ void Tracker::run() { }
if (Libraries->pFilter) {
- for (int i = 0; i < 6; i++)
- last_post_filter[i] = gameoutput_camera.axes[i];
- Libraries->pFilter->FilterHeadPoseData(target_camera2.axes, new_camera.axes, last_post_filter);
+ Libraries->pFilter->FilterHeadPoseData(target_camera2.axes, new_camera.axes);
} else {
new_camera = target_camera2;
}
@@ -165,8 +155,7 @@ void Tracker::run() { t_compensate(output_camera.axes, output_camera.axes);
if (Libraries->pProtocol) {
- gameoutput_camera = output_camera;
- Libraries->pProtocol->sendHeadposeToGame( gameoutput_camera.axes ); // degrees & centimeters
+ Libraries->pProtocol->sendHeadposeToGame( output_camera.axes ); // degrees & centimeters
}
}
|