History

Merge remote-tracking branch 'tony/ajt/overlay-fade' into plugins

Bradley Austin Davis committed 11 years ago

Commit 975c95e2 parents a60e669 87a0e4811 files · +296 −14Browse files

Showing the changes to interface/src/Application.cpp (1 of 11 files). Show all

Unified · Split

interface/src/Application.cpp+21−3
@@ -970,13 +970,15 @@ void Application::paintGL() { · 969 unmodified lines
970 // or with changes from the face tracker970 // or with changes from the face tracker
971 renderArgs._renderMode = RenderArgs::DEFAULT_RENDER_MODE;971 renderArgs._renderMode = RenderArgs::DEFAULT_RENDER_MODE;
972 972
973 _myCamera.setPosition(_myAvatar->getDefaultEyePosition());
974 if (!getActiveDisplayPlugin()->isHmd()) {973 if (!getActiveDisplayPlugin()->isHmd()) {
974 _myCamera.setPosition(_myAvatar->getDefaultEyePosition());
975 _myCamera.setRotation(_myAvatar->getHead()->getCameraOrientation());975 _myCamera.setRotation(_myAvatar->getHead()->getCameraOrientation());
976 } else {976 } else {
977 // The plugin getModelview() call below will compose the base977 // The plugin getModelview() call below will compose the base
978 // avatar transform with the HMD pose.978 // sensor to world transform with the HMD pose.
979 _myCamera.setRotation(_myAvatar->getOrientation());979 mat4 sensorToWorldMat = _myAvatar->getSensorToWorldMatrix();
980 _myCamera.setPosition(extractTranslation(sensorToWorldMat));
981 _myCamera.setRotation(glm::quat_cast(sensorToWorldMat));
980 }982 }
981 } else if (_myCamera.getMode() == CAMERA_MODE_THIRD_PERSON) {983 } else if (_myCamera.getMode() == CAMERA_MODE_THIRD_PERSON) {
982 if (isHMDMode()) {984 if (isHMDMode()) {
@@ -1143,6 +1145,7 @@ void Application::audioMuteToggled() { · 160 unmodified lines
1143}1145}
1144 1146
1145void Application::faceTrackerMuteToggled() {1147void Application::faceTrackerMuteToggled() {
1148
1146 QAction* muteAction = Menu::getInstance()->getActionForOption(MenuOption::MuteFaceTracking);1149 QAction* muteAction = Menu::getInstance()->getActionForOption(MenuOption::MuteFaceTracking);
1147 Q_CHECK_PTR(muteAction);1150 Q_CHECK_PTR(muteAction);
1148 bool isMuted = getSelectedFaceTracker()->isMuted();1151 bool isMuted = getSelectedFaceTracker()->isMuted();
@@ -1703,6 +1706,9 @@ void Application::mousePressEvent(QMouseEvent* event, unsigned int deviceID) { · 554 unmodified lines
1703 1706
1704 } else if (event->button() == Qt::RightButton) {1707 } else if (event->button() == Qt::RightButton) {
1705 // right click items here1708 // 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 // depending on whether we're throttling or not.2000 // depending on whether we're throttling or not.
1992 // Once rendering is off on another thread we should be able to have Application::idle run at start(0) in2001 // Once rendering is off on another thread we should be able to have Application::idle run at start(0) in
1993 // perpetuity and not expect events to get backed up.2002 // perpetuity and not expect events to get backed up.
@@ -4892,6 +4901,15 @@ mat4 Application::getEyePose(int eye) const { · 2898 unmodified lines
4892 return mat4();4901 return mat4();
4893}4902}
4894 4903
4904mat4 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
4895mat4 Application::getHMDSensorPose() const {4913mat4 Application::getHMDSensorPose() const {
4896 if (isHMDMode()) {4914 if (isHMDMode()) {
4897 return getActiveDisplayPlugin()->getHeadPose();4915 return getActiveDisplayPlugin()->getHeadPose();