diff options
-rw-r--r-- | facetracknoir/trackhat-wizard.ui | 35 | ||||
-rw-r--r-- | facetracknoir/wizard.cpp | 32 | ||||
-rw-r--r-- | facetracknoir/wizard.h | 4 |
3 files changed, 58 insertions, 13 deletions
diff --git a/facetracknoir/trackhat-wizard.ui b/facetracknoir/trackhat-wizard.ui index 751c324f..99c44ba9 100644 --- a/facetracknoir/trackhat-wizard.ui +++ b/facetracknoir/trackhat-wizard.ui @@ -57,13 +57,6 @@ <enum>QFrame::Raised</enum> </property> <layout class="QGridLayout" name="gridLayout_3"> - <item row="0" column="0"> - <widget class="QLabel" name="label_3"> - <property name="text"> - <string>Resolution and framerate</string> - </property> - </widget> - </item> <item row="0" column="1"> <widget class="QComboBox" name="resolution_select"> <item> @@ -88,6 +81,34 @@ </item> </widget> </item> + <item row="0" column="0"> + <widget class="QLabel" name="label_3"> + <property name="text"> + <string>Resolution and framerate</string> + </property> + </widget> + </item> + <item row="1" column="0"> + <widget class="QLabel" name="label_4"> + <property name="text"> + <string>Field of view</string> + </property> + </widget> + </item> + <item row="1" column="1"> + <widget class="QComboBox" name="camera_fov"> + <item> + <property name="text"> + <string>56°</string> + </property> + </item> + <item> + <property name="text"> + <string>75°</string> + </property> + </item> + </widget> + </item> </layout> </widget> </item> diff --git a/facetracknoir/wizard.cpp b/facetracknoir/wizard.cpp index e432ddf5..63309dbe 100644 --- a/facetracknoir/wizard.cpp +++ b/facetracknoir/wizard.cpp @@ -1,4 +1,7 @@ #include "wizard.h" +#include "opentrack/state.hpp" +#include "ftnoir_tracker_pt/ftnoir_tracker_pt_settings.h" +#include "ftnoir_filter_accela/ftnoir_filter_accela.h" Wizard::Wizard() : QWizard(nullptr) { @@ -31,7 +34,7 @@ static constexpr double roll[][2] = { { -1, -1 }, }; -static void set_mapping(Mapping& m, double* spline[2]) +static void set_mapping(Mapping& m, const double spline[][2]) { m.opts.altp = false; m.curve.removeAllPoints(); @@ -53,9 +56,34 @@ void Wizard::set_data() auto camera_mode = static_cast<CameraMode>(ui.resolution_select->currentIndex()); settings_pt pt; - main_settings s; + State state; + + set_mapping(state.pose(TZ), tz); + set_mapping(state.pose(Yaw), yaw); + set_mapping(state.pose(Pitch), pitch); + set_mapping(state.pose(Roll), roll); pt.threshold = 31; + pt.min_point_size = 2; + pt.max_point_size = 50; + + switch (m) + { + default: + case Cap: pt.t_MH_x = 0; pt.t_MH_y = 0; pt.t_MH_z = 0; break; + case ClipRight: pt.t_MH_x = ClipRightX; pt.t_MH_y = 0; pt.t_MH_z = 0; break; + case ClipLeft: pt.t_MH_x = ClipLeftX; pt.t_MH_y = 0; pt.t_MH_z = 0; break; + } + + pt.camera_mode = camera_mode; + pt.fov = ui.camera_fov->currentIndex(); + + settings_accela acc; + acc.ewma = 49; + acc.rot_threshold = 29; + acc.rot_deadzone = 29; + acc.trans_deadzone = 33; + acc.trans_threshold = 19; qDebug() << "wizard done" << "model" << m << "camera-mode" << camera_mode; } diff --git a/facetracknoir/wizard.h b/facetracknoir/wizard.h index 08259bc1..9b0172f5 100644 --- a/facetracknoir/wizard.h +++ b/facetracknoir/wizard.h @@ -4,16 +4,12 @@ #include "opentrack/main-settings.hpp" #include "opentrack/mappings.hpp" #include "ui_trackhat-wizard.h" -#include "ftnoir_tracker_pt/ftnoir_tracker_pt_settings.h" #include <QObject> #include <QWizard> class Wizard : public QWizard { Q_OBJECT - - settings_pt pt; - main_settings s; Ui_wizard ui; public: Wizard(); |