summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2016-08-08 17:15:58 +0200
committerStanislaw Halik <sthalik@misaki.pl>2016-08-08 17:16:14 +0200
commit4e98241bac583b65aa29bd8b37ea360e11961d6b (patch)
tree523aa6eefb953536027b0ab59888d83d7c2f372e
parent2778ac50551c5175125a066ba6b59cad6ce4e45b (diff)
gui: make octopus pitch the right way
-rw-r--r--gui/ui.cpp6
-rw-r--r--pose-widget/glwidget.cpp6
-rw-r--r--pose-widget/glwidget.h2
3 files changed, 7 insertions, 7 deletions
diff --git a/gui/ui.cpp b/gui/ui.cpp
index 94fd0cbf..6cd2d819 100644
--- a/gui/ui.cpp
+++ b/gui/ui.cpp
@@ -332,7 +332,7 @@ void MainWindow::startTracker()
// trackers take care of layout state updates
const bool is_inertial = ui.video_frame->layout() == nullptr;
updateButtonState(true, is_inertial);
-
+
// Update the state of the options window directly.
// Might be better to emit signals and allow the options window
// to connect its slots to them (?)
@@ -371,7 +371,7 @@ void MainWindow::stopTracker()
display_pose(p, p);
}
updateButtonState(false, false);
-
+
if (options_widget)
options_widget->update_widgets_states(false);
@@ -382,7 +382,7 @@ void MainWindow::stopTracker()
void MainWindow::display_pose(const double *mapped, const double *raw)
{
- ui.pose_display->rotateBy(mapped[Yaw], -mapped[Pitch], -mapped[Roll],
+ ui.pose_display->rotateBy(mapped[Yaw], mapped[Pitch], -mapped[Roll],
mapped[TX], mapped[TY], mapped[TZ]);
if (mapping_widget)
diff --git a/pose-widget/glwidget.cpp b/pose-widget/glwidget.cpp
index 27e6becd..9523cd1f 100644
--- a/pose-widget/glwidget.cpp
+++ b/pose-widget/glwidget.cpp
@@ -33,7 +33,7 @@ void GLWidget::paintEvent (QPaintEvent * event)
p.drawImage(event->rect(), image);
}
-void GLWidget::rotateBy(float xAngle, float yAngle, float zAngle, float x, float y, float z)
+void GLWidget::rotateBy(double xAngle, double yAngle, double zAngle, double x, double y, double z)
{
if (visible_timer.elapsed_ms() > 250)
{
@@ -47,11 +47,11 @@ void GLWidget::rotateBy(float xAngle, float yAngle, float zAngle, float x, float
using std::sin;
using std::cos;
- static constexpr num d2r = float(OPENTRACK_PI / 180);
+ static constexpr double d2r = OPENTRACK_PI / 180;
translation = vec3(x, y, z);
- euler::euler_t euler(-zAngle * d2r, xAngle * d2r, yAngle * d2r);
+ euler::euler_t euler(-zAngle * d2r, xAngle * d2r, -yAngle * d2r);
euler::rmat r = euler::euler_to_rmat(euler);
for (int i = 0; i < 3; i++)
diff --git a/pose-widget/glwidget.h b/pose-widget/glwidget.h
index 6cccdfcd..03ca5d48 100644
--- a/pose-widget/glwidget.h
+++ b/pose-widget/glwidget.h
@@ -30,7 +30,7 @@ public:
GLWidget(QWidget *parent);
~GLWidget();
- void rotateBy(float xAngle, float yAngle, float zAngle, float x, float y, float z);
+ void rotateBy(double xAngle, double yAngle, double zAngle, double x, double y, double z);
protected:
void paintEvent (QPaintEvent *event) override;
private: