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
970970 // or with changes from the face tracker
971971 renderArgs._renderMode = RenderArgs::DEFAULT_RENDER_MODE;
972972
973− _myCamera.setPosition(_myAvatar->getDefaultEyePosition());
974973 if (!getActiveDisplayPlugin()->isHmd()) {
974+ _myCamera.setPosition(_myAvatar->getDefaultEyePosition());
975975 _myCamera.setRotation(_myAvatar->getHead()->getCameraOrientation());
976976 } else {
977977 // 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));
980982 }
981983 } else if (_myCamera.getMode() == CAMERA_MODE_THIRD_PERSON) {
982984 if (isHMDMode()) {
@@ -1143,6 +1145,7 @@ void Application::audioMuteToggled() { · 160 unmodified lines
11431145 }
11441146
11451147 void Application::faceTrackerMuteToggled() {
1148+
11461149 QAction* muteAction = Menu::getInstance()->getActionForOption(MenuOption::MuteFaceTracking);
11471150 Q_CHECK_PTR(muteAction);
11481151 bool isMuted = getSelectedFaceTracker()->isMuted();
@@ -1703,6 +1706,9 @@ void Application::mousePressEvent(QMouseEvent* event, unsigned int deviceID) { · 554 unmodified lines
17031706
17041707 } else if (event->button() == Qt::RightButton) {
17051708 // right click items here
1709+ } else if (event->button() == Qt::MiddleButton) {
1710+ // toggle the overlay
1711+ _overlayConductor.setEnabled(!_overlayConductor.getEnabled());
17061712 }
17071713 }
17081714 }
@@ -1988,6 +1994,9 @@ void Application::idle() { · 279 unmodified lines
19881994 }
19891995 }
19901996
1997+ float secondsSinceLastUpdate = (float)timeSinceLastUpdate / 1000.0f;
1998+ _overlayConductor.update(secondsSinceLastUpdate);
1999+
19912000 // depending on whether we're throttling or not.
19922001 // Once rendering is off on another thread we should be able to have Application::idle run at start(0) in
19932002 // perpetuity and not expect events to get backed up.
@@ -4892,6 +4901,15 @@ mat4 Application::getEyePose(int eye) const { · 2898 unmodified lines
48924901 return mat4();
48934902 }
48944903
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+
48954913 mat4 Application::getHMDSensorPose() const {
48964914 if (isHMDMode()) {
48974915 return getActiveDisplayPlugin()->getHeadPose();