summaryrefslogtreecommitdiffhomepage
path: root/FaceTrackNoIR
diff options
context:
space:
mode:
authorWim Vriend <facetracknoir@gmail.com>2012-09-28 13:40:18 +0000
committerWim Vriend <facetracknoir@gmail.com>2012-09-28 13:40:18 +0000
commit75360443eb879b49a72c11b2a3d2d299ca61f9d7 (patch)
treefdab3ff501710e19f31f63815957a1fe86dbcb88 /FaceTrackNoIR
parentee53c49af9789553fb51987bd6003ce30344e173 (diff)
Modified sendHeadposeToGame, so it also sends raw data.
Unified the code by adding the Dll class to the protocols and moving the dialog to a separate source. git-svn-id: svn+ssh://svn.code.sf.net/p/facetracknoir/code@173 19e81ba0-9b1a-49c3-bd6c-561e1906d5fb
Diffstat (limited to 'FaceTrackNoIR')
-rw-r--r--FaceTrackNoIR/FaceTrackNoIR.cpp23
-rw-r--r--FaceTrackNoIR/FaceTrackNoIR.h4
-rwxr-xr-xFaceTrackNoIR/tracker.cpp37
3 files changed, 15 insertions, 49 deletions
diff --git a/FaceTrackNoIR/FaceTrackNoIR.cpp b/FaceTrackNoIR/FaceTrackNoIR.cpp
index 00e3a87c..340b80d5 100644
--- a/FaceTrackNoIR/FaceTrackNoIR.cpp
+++ b/FaceTrackNoIR/FaceTrackNoIR.cpp
@@ -1143,11 +1143,12 @@ void FaceTrackNoIR::exit() {
//
void FaceTrackNoIR::createIconGroupBox()
{
-importGetProtocolDialog getProtocol;
+importGetProtocolDll getProtocol;
+IProtocolDllPtr pProtocolDll; // Pointer to Protocol info instance (in DLL)
importGetFilterDll getFilter;
IFilterDllPtr pFilterDll; // Pointer to Filter info instance (in DLL)
importGetTrackerDll getTracker;
-ITrackerDll *pTrackerDll; // Pointer to Filter info instance (in DLL)
+ITrackerDll *pTrackerDll; // Pointer to Tracker info instance (in DLL)
QSettings settings("Abbequerque Inc.", "FaceTrackNoIR"); // Registry settings (in HK_USER)
@@ -1173,27 +1174,19 @@ ITrackerDll *pTrackerDll; // Pointer to Filter info instance (in DLL)
// qDebug() << "createIconGroupBox says: ProtocolName = " << protocolFileList.at(i);
- //
- // Delete the existing QDialog
- //
- if (pProtocolDialog) {
- delete pProtocolDialog;
- pProtocolDialog = NULL;
- }
-
// Show the appropriate Protocol-server Settings
QLibrary *protocolLib = new QLibrary(protocolFileList.at(i));
QString *protocolName = new QString("");
QIcon *protocolIcon = new QIcon();
- getProtocol = (importGetProtocolDialog) protocolLib->resolve("GetProtocolDialog");
+ getProtocol = (importGetProtocolDll) protocolLib->resolve("GetProtocolDll");
if (getProtocol) {
- IProtocolDialogPtr ptrXyz(getProtocol());
+ IProtocolDllPtr ptrXyz(getProtocol());
if (ptrXyz)
{
- pProtocolDialog = ptrXyz;
- pProtocolDialog->getFullName( protocolName );
- pProtocolDialog->getIcon( protocolIcon );
+ pProtocolDll = ptrXyz;
+ pProtocolDll->getFullName( protocolName );
+ pProtocolDll->getIcon( protocolIcon );
// qDebug() << "FaceTrackNoIR::showServerControls GetProtocolDialog Function Resolved!";
}
else {
diff --git a/FaceTrackNoIR/FaceTrackNoIR.h b/FaceTrackNoIR/FaceTrackNoIR.h
index e3cf798e..a7992bbb 100644
--- a/FaceTrackNoIR/FaceTrackNoIR.h
+++ b/FaceTrackNoIR/FaceTrackNoIR.h
@@ -49,7 +49,7 @@
typedef ITrackerDialogPtr (WINAPI *importGetTrackerDialog)(void);
typedef ITrackerDllPtr (WINAPI *importGetTrackerDll)(void);
typedef IProtocolDialogPtr (WINAPI *importGetProtocolDialog)(void);
-//typedef IProtocolDllPtr (WINAPI *importGetProtocolDll)(void);
+typedef IProtocolDllPtr (WINAPI *importGetProtocolDll)(void);
typedef IFilterDialogPtr (WINAPI *importGetFilterDialog)(void);
typedef IFilterDllPtr (WINAPI *importGetFilterDll)(void);
@@ -83,7 +83,7 @@ private:
QStringList filterFileList; // List of Filter-DLL-files, that are present in the program-folder
QStringList trackerFileList; // List of Tracker-DLL-files, that are present in the program-folder
- ITrackerDialogPtr pTrackerDialog; // Pointer to Tracker dialog instance (in DLL)
+ ITrackerDialogPtr pTrackerDialog; // Pointer to Tracker dialog instance (in DLL)
IProtocolDialogPtr pProtocolDialog; // Pointer to Protocol dialog instance (in DLL)
IFilterDialogPtr pFilterDialog; // Pointer to Filter dialog instance (in DLL)
diff --git a/FaceTrackNoIR/tracker.cpp b/FaceTrackNoIR/tracker.cpp
index c78644c1..6153433f 100755
--- a/FaceTrackNoIR/tracker.cpp
+++ b/FaceTrackNoIR/tracker.cpp
@@ -664,30 +664,13 @@ T6DOF gameoutput_camera(0,0,0,0,0,0);
if (InhibitKey.doZ) output_camera.z = 0.0f;
}
- // All Protocol server(s)
+ //
+ // Send the headpose to the game
+ //
if (pProtocol) {
gameoutput_camera = output_camera + gamezero_camera;
- pProtocol->sendHeadposeToGame( &gameoutput_camera ); // degrees & centimeters
+ pProtocol->sendHeadposeToGame( &gameoutput_camera, &newpose ); // degrees & centimeters
}
-
-# ifdef USE_DEBUG_CLIENT
- debug_Client->setHeadRotX( Tracker::Pitch.headPos ); // degrees
- debug_Client->setHeadRotY( Tracker::Yaw.headPos );
- debug_Client->setHeadRotZ( Tracker::Roll.headPos );
-
- debug_Client->setHeadPosX( Tracker::X.headPos ); // centimeters
- debug_Client->setHeadPosY( Tracker::Y.headPos );
- debug_Client->setHeadPosZ( Tracker::Z.headPos );
-
- debug_Client->setVirtRotX ( new_camera.pitch ); // degrees
- debug_Client->setVirtRotY ( new_camera.yaw );
- debug_Client->setVirtRotZ ( new_camera.roll );
- debug_Client->setVirtPosX ( new_camera.x ); // centimeters
- debug_Client->setVirtPosY ( new_camera.y );
- debug_Client->setVirtPosZ ( new_camera.z );
-# endif
-
-
}
else {
//
@@ -701,7 +684,7 @@ T6DOF gameoutput_camera(0,0,0,0,0,0);
output_camera.y = 0.0f;
output_camera.z = 0.0f;
gameoutput_camera = output_camera + gamezero_camera;
- pProtocol->sendHeadposeToGame( &gameoutput_camera ); // degrees & centimeters
+ pProtocol->sendHeadposeToGame( &gameoutput_camera, &newpose ); // degrees & centimeters
}
X.curvePtr->setTrackingActive( false );
Y.curvePtr->setTrackingActive( false );
@@ -713,17 +696,7 @@ T6DOF gameoutput_camera(0,0,0,0,0,0);
}
}
-# ifdef USE_DEBUG_CLIENT
- debug_Client->confidence = Tracker::Pitch.confidence;
- debug_Client->newSample = Tracker::Pitch.newSample;
- debug_Client->smoothvalue = getSmoothFromList( &Pitch.rawList );
- debug_Client->prev_value = Tracker::Pitch.prevPos;
- debug_Client->dT = dT;
- debug_Client->sendHeadposeToGame(); // Log to Excel
-# endif
-
Tracker::Pitch.newSample = false;
-
ReleaseMutex(Tracker::hTrackMutex);
//for lower cpu load