summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2016-10-03 17:11:15 +0200
committerStanislaw Halik <sthalik@misaki.pl>2016-10-03 17:11:15 +0200
commitb0cd8e36fd1f2c7d7fc71909b355c0c53faaac0a (patch)
tree1249f737222be185dee4890cbb576e3e0285a886
parentb5e67864360d98145c67130bfdb3c4c56963c787 (diff)
logic/tracker: apply auto-offset reltrans rotations in right order
Remove warning on using reltrans with auto-offset. Tested-by: @Len62 Discussed-with: @Len62 Issue: #473
-rw-r--r--gui/options-dialog.ui62
-rw-r--r--logic/tracker.cpp2
2 files changed, 23 insertions, 41 deletions
diff --git a/gui/options-dialog.ui b/gui/options-dialog.ui
index 073162a6..ab80df3c 100644
--- a/gui/options-dialog.ui
+++ b/gui/options-dialog.ui
@@ -6,8 +6,8 @@
<rect>
<x>0</x>
<y>0</y>
- <width>546</width>
- <height>588</height>
+ <width>459</width>
+ <height>590</height>
</rect>
</property>
<property name="windowTitle">
@@ -376,10 +376,19 @@
<string>Camera offset</string>
</property>
<layout class="QGridLayout" name="gridLayout_6">
- <item row="2" column="0">
+ <item row="4" column="0">
+ <widget class="QCheckBox" name="use_center_as_translation_camera_offset">
+ <property name="text">
+ <string>Use camera center as translation offset</string>
+ </property>
+ </widget>
+ </item>
+ <item row="5" column="0">
<widget class="QLabel" name="label_17">
<property name="text">
- <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Specify an angle for off-center camera as a basis for which direction is which, avoiding axis interconnect. Also see &lt;a href=&quot;https://github.com/opentrack/opentrack/wiki/choosing-camera-offset&quot;&gt;&lt;span style=&quot; text-decoration: underline; color:#0000ff;&quot;&gt;description on wiki&lt;/span&gt;&lt;/a&gt;.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
+ <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Specify an angle for off-center camera as a basis for which direction is which, avoiding axis interconnect.&lt;/p&gt;
+
+&lt;p&gt;You can derive it from the center pose as per the checkbox or specify it manually. Using both also works, as in cases when moving toward the screen applies moving upward.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="alignment">
<set>Qt::AlignJustify|Qt::AlignVCenter</set>
@@ -395,28 +404,7 @@
</property>
</widget>
</item>
- <item row="5" column="0">
- <widget class="QCheckBox" name="use_center_as_translation_camera_offset">
- <property name="text">
- <string>Use camera center as translation offset</string>
- </property>
- </widget>
- </item>
- <item row="6" column="0">
- <widget class="QLabel" name="label_29">
- <property name="text">
- <string>This option is experimental. Please report your findings on the github issue tracker.
-It won't work properly with translation compensation enabled.</string>
- </property>
- <property name="alignment">
- <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
- </property>
- <property name="wordWrap">
- <bool>true</bool>
- </property>
- </widget>
- </item>
- <item row="3" column="0" alignment="Qt::AlignLeft">
+ <item row="6" column="0" alignment="Qt::AlignLeft">
<widget class="QGroupBox" name="groupBox_3">
<property name="styleSheet">
<string notr="true">QGroupBox
@@ -503,19 +491,6 @@ It won't work properly with translation compensation enabled.</string>
</layout>
</widget>
</item>
- <item row="4" column="0">
- <widget class="Line" name="line">
- <property name="sizePolicy">
- <sizepolicy hsizetype="Minimum" vsizetype="Preferred">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="lineWidth">
- <number>1</number>
- </property>
- </widget>
- </item>
</layout>
</widget>
</item>
@@ -1513,10 +1488,10 @@ It won't work properly with translation compensation enabled.</string>
<tabstop>center_at_startup</tabstop>
<tabstop>trayp</tabstop>
<tabstop>tray_start</tabstop>
+ <tabstop>use_center_as_translation_camera_offset</tabstop>
<tabstop>camera_yaw</tabstop>
<tabstop>camera_pitch</tabstop>
<tabstop>camera_roll</tabstop>
- <tabstop>use_center_as_translation_camera_offset</tabstop>
<tabstop>pos_rx</tabstop>
<tabstop>pos_ry</tabstop>
<tabstop>pos_rz</tabstop>
@@ -1537,6 +1512,13 @@ It won't work properly with translation compensation enabled.</string>
<tabstop>src_z</tabstop>
<tabstop>invert_z</tabstop>
<tabstop>tracklogging_enabled</tabstop>
+ <tabstop>tcomp_enable</tabstop>
+ <tabstop>tcomp_tx_disable</tabstop>
+ <tabstop>tcomp_ty_disable</tabstop>
+ <tabstop>tcomp_tz_disable</tabstop>
+ <tabstop>tcomp_src_yaw_disable</tabstop>
+ <tabstop>tcomp_src_pitch_disable</tabstop>
+ <tabstop>tcomp_src_roll_disable</tabstop>
</tabstops>
<resources/>
<connections/>
diff --git a/logic/tracker.cpp b/logic/tracker.cpp
index 325381ee..c6b9475b 100644
--- a/logic/tracker.cpp
+++ b/logic/tracker.cpp
@@ -255,7 +255,7 @@ void Tracker::logic()
euler_t pos = euler_t(&value[TX]) - t_center;
if (s.use_camera_offset_from_centering)
- t_compensate(real_rotation.rot_center.t() * real_rotation.camera.t(), pos, pos, false, false, false);
+ t_compensate((real_rotation.camera * real_rotation.rot_center).t(), pos, pos, false, false, false);
else
t_compensate(real_rotation.camera.t(), pos, pos, false, false, false);