diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2017-06-10 15:57:56 +0200 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2017-06-10 15:57:56 +0200 |
commit | 39c79af233bb5213701f54e779a3554fa2abe183 (patch) | |
tree | d8eddf023e7ec46595bff37649d8373c3152daf4 | |
parent | 4f61fe1d9f07262426c5c3b431c9a27958f22da5 (diff) |
get rid of camera angle position rotation
It doesn't work well enough anyway
-rw-r--r-- | gui/options-dialog.cpp | 4 | ||||
-rw-r--r-- | gui/options-dialog.ui | 135 | ||||
-rw-r--r-- | logic/main-settings.cpp | 3 | ||||
-rw-r--r-- | logic/main-settings.hpp | 1 | ||||
-rw-r--r-- | logic/tracker.cpp | 21 | ||||
-rw-r--r-- | logic/tracker.h | 2 |
6 files changed, 4 insertions, 162 deletions
diff --git a/gui/options-dialog.cpp b/gui/options-dialog.cpp index dd5ddb2a..7eb6f68d 100644 --- a/gui/options-dialog.cpp +++ b/gui/options-dialog.cpp @@ -82,10 +82,6 @@ OptionsDialog::OptionsDialog(std::function<void(bool)> pause_keybindings) : tie_setting(main.a_y.src, ui.src_y); tie_setting(main.a_z.src, ui.src_z); - 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.center_method, ui.center_method); tie_setting(main.tracklogging_enabled, ui.tracklogging_enabled); diff --git a/gui/options-dialog.ui b/gui/options-dialog.ui index b7f701f8..39725f89 100644 --- a/gui/options-dialog.ui +++ b/gui/options-dialog.ui @@ -7,7 +7,7 @@ <x>0</x> <y>0</y> <width>588</width> - <height>550</height> + <height>552</height> </rect> </property> <property name="sizePolicy"> @@ -966,136 +966,6 @@ </attribute> <layout class="QVBoxLayout" name="verticalLayout_2"> <item> - <widget class="QGroupBox" name="groupBox_5"> - <property name="sizePolicy"> - <sizepolicy hsizetype="MinimumExpanding" vsizetype="Maximum"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="title"> - <string>Camera angle</string> - </property> - <property name="alignment"> - <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set> - </property> - <layout class="QGridLayout" name="gridLayout_6"> - <item row="4" column="0"> - <widget class="QLabel" name="label_17"> - <property name="minimumSize"> - <size> - <width>300</width> - <height>0</height> - </size> - </property> - <property name="text"> - <string>Specify an angle to rotate position tracking. It lets the tracker avoid moving on the X and Y axes when zooming, since camera isn't mounted perfectly in front of the model, but above or below.</string> - </property> - <property name="alignment"> - <set>Qt::AlignJustify|Qt::AlignVCenter</set> - </property> - <property name="wordWrap"> - <bool>true</bool> - </property> - <property name="margin"> - <number>2</number> - </property> - <property name="openExternalLinks"> - <bool>true</bool> - </property> - </widget> - </item> - <item row="5" column="0" alignment="Qt::AlignLeft"> - <widget class="QGroupBox" name="groupBox_3"> - <property name="styleSheet"> - <string notr="true">QGroupBox -{ - border: 0; -}</string> - </property> - <layout class="QGridLayout" name="gridLayout_7"> - <property name="topMargin"> - <number>2</number> - </property> - <property name="bottomMargin"> - <number>2</number> - </property> - <item row="2" column="0"> - <widget class="QLabel" name="label_21"> - <property name="text"> - <string>Roll</string> - </property> - </widget> - </item> - <item row="2" column="1"> - <widget class="QSpinBox" name="camera_roll"> - <property name="minimumSize"> - <size> - <width>80</width> - <height>0</height> - </size> - </property> - <property name="minimum"> - <number>-180</number> - </property> - <property name="maximum"> - <number>180</number> - </property> - </widget> - </item> - <item row="0" column="1"> - <widget class="QSpinBox" name="camera_yaw"> - <property name="minimumSize"> - <size> - <width>80</width> - <height>0</height> - </size> - </property> - <property name="minimum"> - <number>-180</number> - </property> - <property name="maximum"> - <number>180</number> - </property> - </widget> - </item> - <item row="1" column="0"> - <widget class="QLabel" name="label_19"> - <property name="text"> - <string>Pitch</string> - </property> - </widget> - </item> - <item row="1" column="1"> - <widget class="QSpinBox" name="camera_pitch"> - <property name="minimumSize"> - <size> - <width>80</width> - <height>0</height> - </size> - </property> - <property name="minimum"> - <number>-180</number> - </property> - <property name="maximum"> - <number>180</number> - </property> - </widget> - </item> - <item row="0" column="0"> - <widget class="QLabel" name="label_18"> - <property name="text"> - <string>Yaw</string> - </property> - </widget> - </item> - </layout> - </widget> - </item> - </layout> - </widget> - </item> - <item> <widget class="QGroupBox" name="groupBox_6"> <property name="sizePolicy"> <sizepolicy hsizetype="MinimumExpanding" vsizetype="Maximum"> @@ -2458,9 +2328,6 @@ <tabstop>bind_restart_tracking</tabstop> <tabstop>trayp</tabstop> <tabstop>tray_start</tabstop> - <tabstop>camera_yaw</tabstop> - <tabstop>camera_pitch</tabstop> - <tabstop>camera_roll</tabstop> <tabstop>pos_rx</tabstop> <tabstop>pos_ry</tabstop> <tabstop>pos_rz</tabstop> diff --git a/logic/main-settings.cpp b/logic/main-settings.cpp index a847c920..1b94fbe8 100644 --- a/logic/main-settings.cpp +++ b/logic/main-settings.cpp @@ -18,9 +18,6 @@ main_settings::main_settings() : 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), center_at_startup(b, "center-at-startup", true), center_method(b, "centering-method", 1), neck_z(b, "neck-depth", 0), diff --git a/logic/main-settings.hpp b/logic/main-settings.hpp index 6f7c2c82..18c6f19a 100644 --- a/logic/main-settings.hpp +++ b/logic/main-settings.hpp @@ -76,7 +76,6 @@ struct OTR_LOGIC_EXPORT main_settings final 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> center_at_startup; value<int> center_method; value<int> neck_z; diff --git a/logic/tracker.cpp b/logic/tracker.cpp index 1132affe..08d88c38 100644 --- a/logic/tracker.cpp +++ b/logic/tracker.cpp @@ -52,18 +52,6 @@ Tracker::~Tracker() wait(); } -Tracker::rmat Tracker::camera_offset(double c) -{ - const double off[] = - { - d2r * c * (double)-s.camera_yaw, - d2r * c * (double)-s.camera_pitch, - d2r * c * (double)-s.camera_roll - }; - - return euler::euler_to_rmat(off); -} - double Tracker::map(double pos, Map& axis) { bool altp = (pos < 0) && axis.opts.altp; @@ -182,9 +170,6 @@ void Tracker::logic() real_rotation.rotation = euler_to_rmat(tmp); } - scaled_rotation.camera = camera_offset(c_div); - real_rotation.camera = camera_offset(1); - nanp |= is_nan(value) || is_nan(scaled_rotation.rotation) || is_nan(real_rotation.rotation); if (!tracking_started) @@ -244,8 +229,8 @@ void Tracker::logic() break; } - euler_t rot = r2d * c_mult * rmat_to_euler(rotation); euler_t pos = euler_t(&value[TX]) - t_center; + euler_t rot = r2d * c_mult * rmat_to_euler(rotation); for (int i = 0; i < 3; i++) { @@ -258,8 +243,6 @@ void Tracker::logic() pos(i) = -pos(i); } - t_compensate(real_rotation.camera.t(), pos, pos, false, false, false); - for (int i = 0; i < 3; i++) { value(i) = pos(i); @@ -381,6 +364,8 @@ void Tracker::logic() void Tracker::run() { setPriority(QThread::HighPriority); + setPriority(QThread::HighestPriority); + setPriority(QThread::TimeCriticalPriority); { static constexpr const char* posechannels[6] = { "TX", "TY", "TZ", "Yaw", "Pitch", "Roll" }; diff --git a/logic/tracker.h b/logic/tracker.h index 79961378..2c4c5610 100644 --- a/logic/tracker.h +++ b/logic/tracker.h @@ -75,7 +75,6 @@ private: struct state { rmat rot_center; - rmat camera; rmat rotation; state() : rot_center(rmat::eye()) @@ -94,7 +93,6 @@ private: void t_compensate(const rmat& rmat, const euler_t& ypr, euler_t& output, bool disable_tx, bool disable_ty, bool disable_tz); void run() override; - rmat camera_offset(double c); static constexpr double r2d = 180. / M_PI; static constexpr double d2r = M_PI / 180.; |