summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authormm0zct <the_cartographer@hotmail.com>2013-11-01 23:39:38 +0000
committermm0zct <the_cartographer@hotmail.com>2013-11-01 23:39:38 +0000
commita047a476bbb5ce1bab49f779d3f25e9d21ff1345 (patch)
treeca3b79c261e909723cb6f64d8ed58113d8dc5e7e
parent1489b987a09b1de3cb6317d8765e802647c709fc (diff)
We now just enumerate on the sensor, rather than finding the HMD, this means we don't need it attached to the display and it also works better on linux now
-mm0zct
-rw-r--r--ftnoir_tracker_rift/ftnoir_tracker_rift.cpp22
-rw-r--r--ftnoir_tracker_rift/ftnoir_tracker_rift.h1
2 files changed, 6 insertions, 17 deletions
diff --git a/ftnoir_tracker_rift/ftnoir_tracker_rift.cpp b/ftnoir_tracker_rift/ftnoir_tracker_rift.cpp
index accd41d3..dd78bf9f 100644
--- a/ftnoir_tracker_rift/ftnoir_tracker_rift.cpp
+++ b/ftnoir_tracker_rift/ftnoir_tracker_rift.cpp
@@ -18,7 +18,6 @@ Rift_Tracker::Rift_Tracker()
#endif
should_quit = false;
pManager = NULL;
- pHMD = NULL;
pSensor = NULL;
pSFusion = NULL;
old_yaw = 0;
@@ -30,8 +29,6 @@ Rift_Tracker::~Rift_Tracker()
pSensor->Release();
if (pSFusion)
delete pSFusion;
- if (pHMD)
- pHMD->Release();
if (pManager)
pManager->Release();
System::Destroy();
@@ -49,20 +46,13 @@ void Rift_Tracker::StartTracker(QFrame*)
pManager = DeviceManager::Create();
if (pManager != NULL)
{
- DeviceEnumerator<HMDDevice> enumerator = pManager->EnumerateDevices<HMDDevice>();
+ DeviceEnumerator<OVR::SensorDevice> enumerator = pManager->EnumerateDevices<OVR::SensorDevice>();
if (enumerator.IsAvailable())
{
- pHMD = enumerator.CreateDevice();
-
- if (pHMD != NULL)
- {
- pSensor = pHMD->GetSensor();
- }else{
- QMessageBox::warning(0,"FaceTrackNoIR Error", "Unable to find Rift tracker",QMessageBox::Ok,QMessageBox::NoButton);
- }
-
+ pSensor = enumerator.CreateDevice();
+
if (pSensor){
- pSFusion = new OVR::SensorFusion();
+ pSFusion = new OVR::SensorFusion();
pSFusion->Reset();
pSFusion->AttachToSensor(pSensor);
}else{
@@ -70,7 +60,7 @@ void Rift_Tracker::StartTracker(QFrame*)
}
}else{
- QMessageBox::warning(0,"FaceTrackNoIR Error", "Unable to find Rift tracker",QMessageBox::Ok,QMessageBox::NoButton);
+ QMessageBox::warning(0,"FaceTrackNoIR Error", "Unable to enumerate Rift tracker",QMessageBox::Ok,QMessageBox::NoButton);
}
}else{
QMessageBox::warning(0,"FaceTrackNoIR Error", "Unable to start Rift tracker",QMessageBox::Ok,QMessageBox::NoButton);
@@ -123,7 +113,7 @@ bool Rift_Tracker::GiveHeadPoseData(double *data)
data[Roll] = newHeadPose[Roll] * 57.295781f;
}
}
- return pHMD != NULL;
+ return pSensor != NULL;
}
diff --git a/ftnoir_tracker_rift/ftnoir_tracker_rift.h b/ftnoir_tracker_rift/ftnoir_tracker_rift.h
index bd295838..b76d8d09 100644
--- a/ftnoir_tracker_rift/ftnoir_tracker_rift.h
+++ b/ftnoir_tracker_rift/ftnoir_tracker_rift.h
@@ -24,7 +24,6 @@ protected:
private:
static bool isInitialised;
OVR::DeviceManager* pManager;
- OVR::HMDDevice* pHMD;
OVR::SensorDevice* pSensor;
OVR::SensorFusion* pSFusion;
bool bEnableRoll;