diff --git a/src/gui/qopenglplotter.cpp b/src/gui/qopenglplotter.cpp index 0e65e8f1..2c358b20 100644 --- a/src/gui/qopenglplotter.cpp +++ b/src/gui/qopenglplotter.cpp @@ -382,8 +382,10 @@ void ssr::QOpenGLPlotter::_draw_reference() glTranslatef(0.03f, -0.03f, 0.0f); - // rotate according to reference position - glRotatef(_scene.get_reference().orientation.azimuth, 0.0f, 0.0f, 1.0f); + // rotate according to reference offset position + glRotatef(_scene.get_reference().orientation.azimuth + + _scene.get_reference_offset().orientation.azimuth, + 0.0f, 0.0f, 1.0f); glBindTexture(GL_TEXTURE_2D, _listener_shadow_texture); @@ -396,8 +398,10 @@ void ssr::QOpenGLPlotter::_draw_reference() glPopMatrix(); - // rotate according to reference position - glRotatef(_scene.get_reference().orientation.azimuth, 0.0f, 0.0f, 1.0f); + // rotate according to reference offset position + glRotatef(_scene.get_reference().orientation.azimuth + + _scene.get_reference_offset().orientation.azimuth, + 0.0f, 0.0f, 1.0f); glBindTexture(GL_TEXTURE_2D, _listener_texture); diff --git a/src/gui/quserinterface.cpp b/src/gui/quserinterface.cpp index 782ff5b8..a701564c 100644 --- a/src/gui/quserinterface.cpp +++ b/src/gui/quserinterface.cpp @@ -980,8 +980,8 @@ void ssr::QUserInterface::mouseMoveEvent(QMouseEvent *event) // absolut mouse position in OpenGL coordinates Position mouse_pos(static_cast(pos_x), static_cast(pos_y)); - // position relative to reference position - mouse_pos -= _scene.get_reference().position; + // position relative to reference position offset + mouse_pos -= _scene.get_reference_offset().position; _get_openGL_pos(_previous_mouse_event.x(), _previous_mouse_event.y(), @@ -990,11 +990,12 @@ void ssr::QUserInterface::mouseMoveEvent(QMouseEvent *event) // previous absolut position in OpenGL coordinates Position prev_mouse_pos(static_cast(pos_x), static_cast(pos_y)); - // previous position relative to relative position - prev_mouse_pos -= _scene.get_reference().position; + // previous position relative to relative position offset + prev_mouse_pos -= _scene.get_reference_offset().position; - _controller.take_control()->reference_rotation(_scene.get_reference().orientation + - (mouse_pos.orientation() - prev_mouse_pos.orientation())); + _controller.take_control()->reference_rotation_offset(_scene.get_reference().orientation + + _scene.get_reference_offset().orientation + + (mouse_pos.orientation() - prev_mouse_pos.orientation())); } // else if diff --git a/src/trackerpolhemus.cpp b/src/trackerpolhemus.cpp index f2651ae8..fcfad114 100644 --- a/src/trackerpolhemus.cpp +++ b/src/trackerpolhemus.cpp @@ -192,7 +192,7 @@ ssr::TrackerPolhemus::_open_serial_port(const char *portname) void ssr::TrackerPolhemus::calibrate() { - _az_corr = _current_data.azimuth; + _az_corr = _current_data.azimuth + 90; } void diff --git a/src/trackerrazor.h b/src/trackerrazor.h index f0ab35e4..34fc9cdf 100644 --- a/src/trackerrazor.h +++ b/src/trackerrazor.h @@ -57,7 +57,7 @@ class TrackerRazor : public Tracker if (_tracker != nullptr) delete _tracker; } - virtual void calibrate() { _az_corr = _current_azimuth; } + virtual void calibrate() { _az_corr = _current_azimuth + 90; } private: /// constructor diff --git a/src/trackervrpn.cpp b/src/trackervrpn.cpp index 0f171602..934a1568 100644 --- a/src/trackervrpn.cpp +++ b/src/trackervrpn.cpp @@ -109,7 +109,7 @@ ssr::TrackerVrpn::vrpn_change_handler(const vrpn_TRACKERCB t) void ssr::TrackerVrpn::calibrate() { - _az_corr = _current_azimuth; + _az_corr = _current_azimuth + 90; } void