summaryrefslogtreecommitdiffhomepage
path: root/tracker-steamvr/steamvr.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'tracker-steamvr/steamvr.hpp')
-rw-r--r--tracker-steamvr/steamvr.hpp44
1 files changed, 18 insertions, 26 deletions
diff --git a/tracker-steamvr/steamvr.hpp b/tracker-steamvr/steamvr.hpp
index 479f517f..61da2e05 100644
--- a/tracker-steamvr/steamvr.hpp
+++ b/tracker-steamvr/steamvr.hpp
@@ -1,26 +1,24 @@
#pragma once
-#include "api/plugin-api.hpp"
+
#include "ui_dialog.h"
+#include "api/plugin-api.hpp"
#include "options/options.hpp"
-#include "compat/euler.hpp"
-
-#include <openvr.h>
-
-#include <cmath>
-#include <memory>
#include <tuple>
+#include <climits>
#include <QString>
#include <QMutex>
-#include <QMutexLocker>
#include <QList>
+#include <openvr.h>
+
using namespace options;
-using error_t = vr::EVRInitError;
+
+using vr_error_t = vr::EVRInitError;
using vr_t = vr::IVRSystem*;
-using tt = std::tuple<vr_t, error_t>;
+using tt = std::tuple<vr_t, vr_error_t>;
using pose_t = vr::TrackedDevicePose_t;
using origin = vr::ETrackingUniverseOrigin;
@@ -51,11 +49,11 @@ struct device_list final
const QList<device_spec>& devices() const { return device_specs; }
static never_inline maybe_pose get_pose(int k);
- static QString strerror(error_t error);
- static constexpr inline unsigned max_devices = vr::k_unMaxTrackedDeviceCount;
+ static QString error_string(vr_error_t error);
+ static constexpr unsigned max_devices = vr::k_unMaxTrackedDeviceCount;
template<typename F>
- friend auto with_vr_lock(F&& fun) -> decltype(fun(vr_t(), error_t()));
+ friend auto with_vr_lock(F&& fun) -> decltype(fun(vr_t(), vr_error_t()));
private:
QList<device_spec> device_specs;
@@ -69,8 +67,10 @@ class steamvr : public QObject, public ITracker
{
Q_OBJECT
- using error_t = vr::EVRInitError;
- using vr_t = vr::IVRSystem*;
+ static void matrix_to_euler(double& yaw, double& pitch, double& roll, const vr::HmdMatrix34_t& result);
+
+ settings s;
+ unsigned device_index{UINT_MAX};
public:
steamvr();
@@ -78,15 +78,6 @@ public:
module_status start_tracker(QFrame *) override;
void data(double *data) override;
bool center() override;
-
-private:
- static void matrix_to_euler(double& yaw, double& pitch, double& roll, const vr::HmdMatrix34_t& result);
-
- settings s;
- int device_index;
-
- using rmat = euler::rmat;
- using euler_t = euler::euler_t;
};
class steamvr_dialog : public ITrackerDialog
@@ -106,7 +97,8 @@ private slots:
class steamvr_metadata : public Metadata
{
-public:
- QString name() override { return otr_tr("Valve SteamVR"); }
+ Q_OBJECT
+
+ QString name() override { return tr("Valve SteamVR"); }
QIcon icon() override { return QIcon(":/images/rift_tiny.png"); }
};