summaryrefslogtreecommitdiffhomepage
path: root/tracker-rift-140
diff options
context:
space:
mode:
Diffstat (limited to 'tracker-rift-140')
-rw-r--r--tracker-rift-140/dialog.ui122
-rw-r--r--tracker-rift-140/lang/nl_NL.ts20
-rw-r--r--tracker-rift-140/lang/ru_RU.ts20
-rw-r--r--tracker-rift-140/lang/stub.ts20
-rw-r--r--tracker-rift-140/lang/zh_CN.ts20
-rw-r--r--tracker-rift-140/rift-140.cpp22
-rw-r--r--tracker-rift-140/rift-140.hpp18
7 files changed, 13 insertions, 229 deletions
diff --git a/tracker-rift-140/dialog.ui b/tracker-rift-140/dialog.ui
index a440db58..b2682529 100644
--- a/tracker-rift-140/dialog.ui
+++ b/tracker-rift-140/dialog.ui
@@ -9,8 +9,8 @@
<rect>
<x>0</x>
<y>0</y>
- <width>218</width>
- <height>200</height>
+ <width>184</width>
+ <height>40</height>
</rect>
</property>
<property name="sizePolicy">
@@ -34,124 +34,6 @@
</property>
<layout class="QGridLayout" name="gridLayout_2">
<item row="0" column="0">
- <widget class="QGroupBox" name="groupBox">
- <property name="title">
- <string>Yaw spring</string>
- </property>
- <layout class="QGridLayout" name="gridLayout">
- <item row="0" column="0">
- <widget class="QCheckBox" name="yawSpring">
- <property name="text">
- <string>Enable</string>
- </property>
- </widget>
- </item>
- <item row="1" column="0">
- <widget class="QLabel" name="label">
- <property name="text">
- <string>Persistence</string>
- </property>
- </widget>
- </item>
- <item row="1" column="1">
- <widget class="QDoubleSpinBox" name="persistence">
- <property name="sizePolicy">
- <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="minimumSize">
- <size>
- <width>0</width>
- <height>23</height>
- </size>
- </property>
- <property name="decimals">
- <number>5</number>
- </property>
- <property name="minimum">
- <double>0.900000000000000</double>
- </property>
- <property name="maximum">
- <double>1.000000000000000</double>
- </property>
- <property name="singleStep">
- <double>0.001000000000000</double>
- </property>
- </widget>
- </item>
- <item row="2" column="0">
- <widget class="QLabel" name="label_2">
- <property name="text">
- <string>Constant drift</string>
- </property>
- </widget>
- </item>
- <item row="2" column="1">
- <widget class="QDoubleSpinBox" name="constantDrift">
- <property name="sizePolicy">
- <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="minimumSize">
- <size>
- <width>0</width>
- <height>23</height>
- </size>
- </property>
- <property name="decimals">
- <number>5</number>
- </property>
- <property name="minimum">
- <double>0.000100000000000</double>
- </property>
- <property name="maximum">
- <double>0.100000000000000</double>
- </property>
- <property name="singleStep">
- <double>0.001000000000000</double>
- </property>
- </widget>
- </item>
- <item row="3" column="0">
- <widget class="QLabel" name="label_3">
- <property name="text">
- <string>Deadzone</string>
- </property>
- </widget>
- </item>
- <item row="3" column="1">
- <widget class="QDoubleSpinBox" name="deadzone">
- <property name="sizePolicy">
- <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="minimumSize">
- <size>
- <width>0</width>
- <height>23</height>
- </size>
- </property>
- <property name="decimals">
- <number>5</number>
- </property>
- <property name="maximum">
- <double>0.100000000000000</double>
- </property>
- <property name="singleStep">
- <double>0.010000000000000</double>
- </property>
- </widget>
- </item>
- </layout>
- </widget>
- </item>
- <item row="1" column="0">
<widget class="QDialogButtonBox" name="buttonBox">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
diff --git a/tracker-rift-140/lang/nl_NL.ts b/tracker-rift-140/lang/nl_NL.ts
index 9a62cd10..d472b35c 100644
--- a/tracker-rift-140/lang/nl_NL.ts
+++ b/tracker-rift-140/lang/nl_NL.ts
@@ -7,26 +7,6 @@
<source>Oculus Rift tracker settings FaceTrackNoIR</source>
<translation type="unfinished"></translation>
</message>
- <message>
- <source>Yaw spring</source>
- <translation type="unfinished"></translation>
- </message>
- <message>
- <source>Enable</source>
- <translation type="unfinished"></translation>
- </message>
- <message>
- <source>Persistence</source>
- <translation type="unfinished"></translation>
- </message>
- <message>
- <source>Constant drift</source>
- <translation type="unfinished"></translation>
- </message>
- <message>
- <source>Deadzone</source>
- <translation type="unfinished"></translation>
- </message>
</context>
<context>
<name>rift_140Dll</name>
diff --git a/tracker-rift-140/lang/ru_RU.ts b/tracker-rift-140/lang/ru_RU.ts
index dadafae1..59099270 100644
--- a/tracker-rift-140/lang/ru_RU.ts
+++ b/tracker-rift-140/lang/ru_RU.ts
@@ -7,26 +7,6 @@
<source>Oculus Rift tracker settings FaceTrackNoIR</source>
<translation type="unfinished"></translation>
</message>
- <message>
- <source>Yaw spring</source>
- <translation type="unfinished"></translation>
- </message>
- <message>
- <source>Enable</source>
- <translation type="unfinished"></translation>
- </message>
- <message>
- <source>Persistence</source>
- <translation type="unfinished"></translation>
- </message>
- <message>
- <source>Constant drift</source>
- <translation type="unfinished"></translation>
- </message>
- <message>
- <source>Deadzone</source>
- <translation type="unfinished"></translation>
- </message>
</context>
<context>
<name>rift_140Dll</name>
diff --git a/tracker-rift-140/lang/stub.ts b/tracker-rift-140/lang/stub.ts
index 9e7f747c..26ab2040 100644
--- a/tracker-rift-140/lang/stub.ts
+++ b/tracker-rift-140/lang/stub.ts
@@ -7,26 +7,6 @@
<source>Oculus Rift tracker settings FaceTrackNoIR</source>
<translation type="unfinished"></translation>
</message>
- <message>
- <source>Yaw spring</source>
- <translation type="unfinished"></translation>
- </message>
- <message>
- <source>Enable</source>
- <translation type="unfinished"></translation>
- </message>
- <message>
- <source>Persistence</source>
- <translation type="unfinished"></translation>
- </message>
- <message>
- <source>Constant drift</source>
- <translation type="unfinished"></translation>
- </message>
- <message>
- <source>Deadzone</source>
- <translation type="unfinished"></translation>
- </message>
</context>
<context>
<name>rift_140Dll</name>
diff --git a/tracker-rift-140/lang/zh_CN.ts b/tracker-rift-140/lang/zh_CN.ts
index 9e7f747c..26ab2040 100644
--- a/tracker-rift-140/lang/zh_CN.ts
+++ b/tracker-rift-140/lang/zh_CN.ts
@@ -7,26 +7,6 @@
<source>Oculus Rift tracker settings FaceTrackNoIR</source>
<translation type="unfinished"></translation>
</message>
- <message>
- <source>Yaw spring</source>
- <translation type="unfinished"></translation>
- </message>
- <message>
- <source>Enable</source>
- <translation type="unfinished"></translation>
- </message>
- <message>
- <source>Persistence</source>
- <translation type="unfinished"></translation>
- </message>
- <message>
- <source>Constant drift</source>
- <translation type="unfinished"></translation>
- </message>
- <message>
- <source>Deadzone</source>
- <translation type="unfinished"></translation>
- </message>
</context>
<context>
<name>rift_140Dll</name>
diff --git a/tracker-rift-140/rift-140.cpp b/tracker-rift-140/rift-140.cpp
index ee309ce8..839dd190 100644
--- a/tracker-rift-140/rift-140.cpp
+++ b/tracker-rift-140/rift-140.cpp
@@ -80,23 +80,13 @@ void rift_tracker_140::data(double *data)
pitch *= c_mult;
roll *= c_mult;
- double yaw_ = double(yaw);
- if (s.useYawSpring)
- {
- yaw_ = old_yaw*s.persistence + (yaw_-old_yaw);
- if(yaw_ > s.deadzone)
- yaw_ -= s.constant_drift;
- if(yaw_ < -s.deadzone)
- yaw_ += s.constant_drift;
- old_yaw = yaw_;
- }
constexpr double d2r = 180 / M_PI;
- data[Yaw] = yaw_ * -d2r;
- data[Pitch] = double(pitch) * d2r;
- data[Roll] = double(roll) * d2r;
- data[TX] = double(pose.Translation.x) * -1e2;
- data[TY] = double(pose.Translation.y) * 1e2;
- data[TZ] = double(pose.Translation.z) * 1e2;
+ data[Yaw] = double(yaw) * -d2r;
+ data[Pitch] = double(pitch) * d2r;
+ data[Roll] = double(roll) * d2r;
+ data[TX] = double(pose.Translation.x) * -1e2;
+ data[TY] = double(pose.Translation.y) * 1e2;
+ data[TZ] = double(pose.Translation.z) * 1e2;
}
}
}
diff --git a/tracker-rift-140/rift-140.hpp b/tracker-rift-140/rift-140.hpp
index 4437333b..030addab 100644
--- a/tracker-rift-140/rift-140.hpp
+++ b/tracker-rift-140/rift-140.hpp
@@ -9,14 +9,7 @@
using namespace options;
struct settings : opts {
- value<bool> useYawSpring;
- value<double> constant_drift, persistence, deadzone;
- settings() :
- opts("Rift-140"),
- useYawSpring(b, "yaw-spring", false),
- constant_drift(b, "constant-drift", 0.000005),
- persistence(b, "persistence", 0.99999),
- deadzone(b, "deadzone", 0.02)
+ settings() : opts("Rift-140")
{}
};
@@ -28,7 +21,6 @@ public:
module_status start_tracker(QFrame *) override;
void data(double *data) override;
private:
- double old_yaw = 0;
ovrSession hmd = nullptr;
ovrGraphicsLuid luid {};
settings s;
@@ -40,8 +32,8 @@ class dialog_rift_140: public ITrackerDialog
public:
dialog_rift_140();
- void register_tracker(ITracker *) {}
- void unregister_tracker() {}
+ void register_tracker(ITracker*) override {}
+ void unregister_tracker() override {}
private:
Ui::dialog_rift_140 ui;
@@ -55,7 +47,7 @@ class rift_140Dll : public Metadata
{
Q_OBJECT
- QString name() { return tr("Oculus Rift runtime 1.4.0 -- HMD"); }
- QIcon icon() { return QIcon(":/images/rift_tiny.png"); }
+ QString name() override { return tr("Oculus Rift runtime 1.4.0 -- HMD"); }
+ QIcon icon() override { return QIcon(":/images/rift_tiny.png"); }
};