summaryrefslogtreecommitdiffhomepage
path: root/ftnoir_tracker_pt/ftnoir_tracker_pt.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'ftnoir_tracker_pt/ftnoir_tracker_pt.cpp')
-rw-r--r--ftnoir_tracker_pt/ftnoir_tracker_pt.cpp57
1 files changed, 42 insertions, 15 deletions
diff --git a/ftnoir_tracker_pt/ftnoir_tracker_pt.cpp b/ftnoir_tracker_pt/ftnoir_tracker_pt.cpp
index dc0659e5..d48f9252 100644
--- a/ftnoir_tracker_pt/ftnoir_tracker_pt.cpp
+++ b/ftnoir_tracker_pt/ftnoir_tracker_pt.cpp
@@ -55,7 +55,19 @@ void Tracker_PT::reset_command(Command command)
float Tracker_PT::get_focal_length()
{
static constexpr float pi = 3.1415926f;
- const float fov = static_cast<int>(s.fov) * pi / 180.f;
+ float fov_;
+ switch (s.fov)
+ {
+ default:
+ case 0:
+ fov_ = 56;
+ break;
+ case 1:
+ fov_ = 75;
+ break;
+ }
+
+ const float fov = static_cast<int>(fov_) * pi / 180.f;
return 0.5f / tan(0.5f * fov);
}
@@ -140,9 +152,35 @@ void Tracker_PT::apply_settings()
qDebug()<<"Tracker:: Applying settings";
QMutexLocker l(&camera_mtx);
QMutexLocker lock(&mutex);
- camera.set_device_index(camera_name_to_index(s.camera_name));
- camera.set_res(s.cam_res_x, s.cam_res_y);
- camera.set_fps(s.cam_fps);
+ camera.set_device_index(camera_name_to_index("PS3Eye Camera"));
+ int res_x, res_y, cam_fps;
+ switch (s.camera_mode)
+ {
+ default:
+ case 0:
+ res_x = 640;
+ res_y = 480;
+ cam_fps = 75;
+ break;
+ case 1:
+ res_x = 640;
+ res_y = 480;
+ cam_fps = 60;
+ break;
+ case 2:
+ res_x = 320;
+ res_y = 240;
+ cam_fps = 189;
+ break;
+ case 3:
+ res_x = 320;
+ res_y = 240;
+ cam_fps = 120;
+ break;
+ }
+
+ camera.set_res(res_x, res_y);
+ camera.set_fps(cam_fps);
qDebug()<<"Tracker::apply ends";
}
@@ -208,14 +246,3 @@ void Tracker_PT::data(THeadPoseData *data)
data[TZ] = t[2] / 10.0;
}
}
-
-//-----------------------------------------------------------------------------
-#ifdef OPENTRACK_API
-extern "C" OPENTRACK_EXPORT ITracker* GetConstructor()
-#else
-#pragma comment(linker, "/export:GetTracker=_GetTracker@0")
-OPENTRACK_EXPORT ITrackerPtr __stdcall GetTracker()
-#endif
-{
- return new Tracker_PT;
-}