diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2016-11-25 09:13:14 +0100 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2016-11-25 09:13:14 +0100 |
commit | 97f80ccc1fed421665ee49745e230a7fb63f226a (patch) | |
tree | 9de66fe34bab9a55d2f10ba5e6694167390d70c4 | |
parent | 50d3b377880049aebfd69c4c6f956b0f8d5326dd (diff) |
Revert "logic, gui: remove relative translation disable axis"opentrack-2.3-rc99p15
This reverts commit 9fb8b48027ac8c03628955da2b186de88745e348.
-rw-r--r-- | gui/options-dialog.cpp | 7 | ||||
-rw-r--r-- | gui/options-dialog.ui | 88 | ||||
-rw-r--r-- | logic/main-settings.hpp | 10 | ||||
-rw-r--r-- | logic/tracker.cpp | 16 |
4 files changed, 113 insertions, 8 deletions
diff --git a/gui/options-dialog.cpp b/gui/options-dialog.cpp index 2be39ac2..bafddb57 100644 --- a/gui/options-dialog.cpp +++ b/gui/options-dialog.cpp @@ -51,8 +51,14 @@ OptionsDialog::OptionsDialog(std::function<void(bool)> pause_keybindings) : tie_setting(main.tcomp_p, ui.tcomp_enable); + tie_setting(main.tcomp_disable_tx, ui.tcomp_tx_disable); + tie_setting(main.tcomp_disable_ty, ui.tcomp_ty_disable); tie_setting(main.tcomp_disable_tz, ui.tcomp_tz_disable); + tie_setting(main.tcomp_disable_src_yaw, ui.tcomp_src_yaw_disable); + tie_setting(main.tcomp_disable_src_pitch, ui.tcomp_src_pitch_disable); + tie_setting(main.tcomp_disable_src_roll, ui.tcomp_src_roll_disable); + tie_setting(main.a_x.zero, ui.pos_tx); tie_setting(main.a_y.zero, ui.pos_ty); tie_setting(main.a_z.zero, ui.pos_tz); @@ -77,6 +83,7 @@ OptionsDialog::OptionsDialog(std::function<void(bool)> pause_keybindings) : tie_setting(main.camera_yaw, ui.camera_yaw); tie_setting(main.camera_pitch, ui.camera_pitch); tie_setting(main.camera_roll, ui.camera_roll); + tie_setting(main.use_camera_offset_from_centering, ui.use_center_as_translation_camera_offset); tie_setting(main.center_method, ui.center_method); diff --git a/gui/options-dialog.ui b/gui/options-dialog.ui index 737bc581..f23dd63f 100644 --- a/gui/options-dialog.ui +++ b/gui/options-dialog.ui @@ -7,7 +7,7 @@ <x>0</x> <y>0</y> <width>450</width> - <height>593</height> + <height>599</height> </rect> </property> <property name="minimumSize"> @@ -463,6 +463,13 @@ </property> <layout class="QGridLayout" name="gridLayout_6"> <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="minimumSize"> <size> @@ -487,7 +494,7 @@ </property> </widget> </item> - <item row="5" 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 @@ -936,6 +943,38 @@ <number>0</number> </property> <item row="2" column="0"> + <widget class="QCheckBox" name="tcomp_tx_disable"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Minimum" vsizetype="Maximum"> + <horstretch>3</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="styleSheet"> + <string notr="true"/> + </property> + <property name="text"> + <string>Disable for X</string> + </property> + </widget> + </item> + <item row="3" column="0"> + <widget class="QCheckBox" name="tcomp_ty_disable"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Minimum" vsizetype="Maximum"> + <horstretch>3</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="styleSheet"> + <string notr="true"/> + </property> + <property name="text"> + <string>Disable for Y</string> + </property> + </widget> + </item> + <item row="4" column="0"> <widget class="QCheckBox" name="tcomp_tz_disable"> <property name="sizePolicy"> <sizepolicy hsizetype="Minimum" vsizetype="Maximum"> @@ -951,6 +990,45 @@ </property> </widget> </item> + <item row="2" column="1"> + <widget class="QCheckBox" name="tcomp_src_yaw_disable"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Minimum" vsizetype="Maximum"> + <horstretch>2</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="text"> + <string>Disable effect by yaw</string> + </property> + </widget> + </item> + <item row="3" column="1"> + <widget class="QCheckBox" name="tcomp_src_pitch_disable"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Minimum" vsizetype="Maximum"> + <horstretch>2</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="text"> + <string>Disable effect by pitch</string> + </property> + </widget> + </item> + <item row="4" column="1"> + <widget class="QCheckBox" name="tcomp_src_roll_disable"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Minimum" vsizetype="Maximum"> + <horstretch>2</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="text"> + <string>Disable effect by roll</string> + </property> + </widget> + </item> </layout> </widget> </item> @@ -1505,6 +1583,7 @@ <tabstop>bind_tcomp_off_held</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> @@ -1529,7 +1608,12 @@ <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> <include location="opentrack-res.qrc"/> diff --git a/logic/main-settings.hpp b/logic/main-settings.hpp index ecb7cd5c..53c5fae1 100644 --- a/logic/main-settings.hpp +++ b/logic/main-settings.hpp @@ -67,9 +67,11 @@ struct main_settings { bundle b, b_map; axis_opts a_x, a_y, a_z, a_yaw, a_pitch, a_roll; - value<bool> tcomp_p, tcomp_disable_tz; + value<bool> tcomp_p, tcomp_disable_tx, tcomp_disable_ty, tcomp_disable_tz; + value<bool> tcomp_disable_src_yaw, tcomp_disable_src_pitch, tcomp_disable_src_roll; value<bool> tray_enabled, tray_start; value<int> camera_yaw, camera_pitch, camera_roll; + value<bool> use_camera_offset_from_centering; value<bool> center_at_startup; value<int> center_method; key_opts key_start_tracking, key_stop_tracking, key_toggle_tracking, key_restart_tracking; @@ -88,12 +90,18 @@ struct main_settings a_pitch(b, b_map, "pitch", Pitch), a_roll(b, b_map, "roll", Roll), tcomp_p(b, "compensate-translation", true), + tcomp_disable_tx(b, "compensate-translation-disable-x-axis", false), + tcomp_disable_ty(b, "compensate-translation-disable-y-axis", false), tcomp_disable_tz(b, "compensate-translation-disable-z-axis", false), + tcomp_disable_src_yaw(b, "compensate-translation-disable-source-yaw", false), + tcomp_disable_src_pitch(b, "compensate-translation-disable-source-pitch", false), + tcomp_disable_src_roll(b, "compensate-translation-disable-source-roll", false), tray_enabled(b, "use-system-tray", false), tray_start(b, "start-in-tray", false), camera_yaw(b, "camera-yaw", 0), camera_pitch(b, "camera-pitch", 0), camera_roll(b, "camera-roll", 0), + use_camera_offset_from_centering(b, "use-camera-offset-from-centering", false), center_at_startup(b, "center-at-startup", true), center_method(b, "centering-method", true), key_start_tracking(b, "start-tracking"), diff --git a/logic/tracker.cpp b/logic/tracker.cpp index 5733166a..a5892dd0 100644 --- a/logic/tracker.cpp +++ b/logic/tracker.cpp @@ -300,15 +300,21 @@ void Tracker::logic() if (s.tcomp_p && !get(f_tcomp_disabled)) { + const double tcomp_c[] = + { + double(!s.tcomp_disable_src_yaw), + double(!s.tcomp_disable_src_pitch), + double(!s.tcomp_disable_src_roll), + }; euler_t value_(value(TX), value(TY), value(TZ)); t_compensate(euler_to_rmat( - euler_t(value(Yaw) * d2r, - value(Pitch) * d2r, - value(Roll) * d2r)), + euler_t(value(Yaw) * d2r * tcomp_c[0], + value(Pitch) * d2r * tcomp_c[1], + value(Roll) * d2r * tcomp_c[2])), value_, value_, - false, - false, + s.tcomp_disable_tx, + s.tcomp_disable_ty, s.tcomp_disable_tz); if (is_nan(value_)) nanp = true; |