Showing the changes to interface/src/Application.cpp (1 of 11 files). Show all
Unified · Split
| @@ -970,13 +970,15 @@ void Application::paintGL() { · 969 unmodified lines | ||
| 970 | 970 | // or with changes from the face tracker |
| 971 | 971 | renderArgs._renderMode = RenderArgs::DEFAULT_RENDER_MODE; |
| 972 | 972 | |
| 973 | − _myCamera.setPosition(_myAvatar->getDefaultEyePosition()); | |
| 974 | 973 | if (!getActiveDisplayPlugin()->isHmd()) { |
| 974 | + _myCamera.setPosition(_myAvatar->getDefaultEyePosition()); | |
| 975 | 975 | _myCamera.setRotation(_myAvatar->getHead()->getCameraOrientation()); |
| 976 | 976 | } else { |
| 977 | 977 | // The plugin getModelview() call below will compose the base |
| 978 | − // avatar transform with the HMD pose. | |
| 979 | − _myCamera.setRotation(_myAvatar->getOrientation()); | |
| 978 | + // sensor to world transform with the HMD pose. | |
| 979 | + mat4 sensorToWorldMat = _myAvatar->getSensorToWorldMatrix(); | |
| 980 | + _myCamera.setPosition(extractTranslation(sensorToWorldMat)); | |
| 981 | + _myCamera.setRotation(glm::quat_cast(sensorToWorldMat)); | |
| 980 | 982 | } |
| 981 | 983 | } else if (_myCamera.getMode() == CAMERA_MODE_THIRD_PERSON) { |
| 982 | 984 | if (isHMDMode()) { |
| @@ -1143,6 +1145,7 @@ void Application::audioMuteToggled() { · 160 unmodified lines | ||
| 1143 | 1145 | } |
| 1144 | 1146 | |
| 1145 | 1147 | void Application::faceTrackerMuteToggled() { |
| 1148 | + | |
| 1146 | 1149 | QAction* muteAction = Menu::getInstance()->getActionForOption(MenuOption::MuteFaceTracking); |
| 1147 | 1150 | Q_CHECK_PTR(muteAction); |
| 1148 | 1151 | bool isMuted = getSelectedFaceTracker()->isMuted(); |
| @@ -1703,6 +1706,9 @@ void Application::mousePressEvent(QMouseEvent* event, unsigned int deviceID) { · 554 unmodified lines | ||
| 1703 | 1706 | |
| 1704 | 1707 | } else if (event->button() == Qt::RightButton) { |
| 1705 | 1708 | // right click items here |
| 1709 | + } else if (event->button() == Qt::MiddleButton) { | |
| 1710 | + // toggle the overlay | |
| 1711 | + _overlayConductor.setEnabled(!_overlayConductor.getEnabled()); | |
| 1706 | 1712 | } |
| 1707 | 1713 | } |
| 1708 | 1714 | } |
| @@ -1988,6 +1994,9 @@ void Application::idle() { · 279 unmodified lines | ||
| 1988 | 1994 | } |
| 1989 | 1995 | } |
| 1990 | 1996 | |
| 1997 | + float secondsSinceLastUpdate = (float)timeSinceLastUpdate / 1000.0f; | |
| 1998 | + _overlayConductor.update(secondsSinceLastUpdate); | |
| 1999 | + | |
| 1991 | 2000 | // depending on whether we're throttling or not. |
| 1992 | 2001 | // Once rendering is off on another thread we should be able to have Application::idle run at start(0) in |
| 1993 | 2002 | // perpetuity and not expect events to get backed up. |
| @@ -4892,6 +4901,15 @@ mat4 Application::getEyePose(int eye) const { · 2898 unmodified lines | ||
| 4892 | 4901 | return mat4(); |
| 4893 | 4902 | } |
| 4894 | 4903 | |
| 4904 | +mat4 Application::getEyeOffset(int eye) const { | |
| 4905 | + if (isHMDMode()) { | |
| 4906 | + mat4 identity; | |
| 4907 | + return getActiveDisplayPlugin()->getModelview((Eye)eye, identity); | |
| 4908 | + } | |
| 4909 | + | |
| 4910 | + return mat4(); | |
| 4911 | +} | |
| 4912 | + | |
| 4895 | 4913 | mat4 Application::getHMDSensorPose() const { |
| 4896 | 4914 | if (isHMDMode()) { |
| 4897 | 4915 | return getActiveDisplayPlugin()->getHeadPose(); |