From 1532b5d91aec8ef03d6a7d2c65109a56e3e77d14 Mon Sep 17 00:00:00 2001 From: Andrzej Kapolka Date: Wed, 4 Sep 2013 17:33:57 -0700 Subject: [PATCH] Apply eye offset position based on Faceshift/webcam. --- interface/src/Application.cpp | 9 +++++++++ interface/src/Menu.cpp | 5 +++++ interface/src/Menu.h | 1 + 3 files changed, 15 insertions(+) diff --git a/interface/src/Application.cpp b/interface/src/Application.cpp index 8faf8d2002..8a9d54684f 100644 --- a/interface/src/Application.cpp +++ b/interface/src/Application.cpp @@ -1800,6 +1800,15 @@ void Application::update(float deltaTime) { _myCamera.setModeShiftRate(1.0f); } } + + if (Menu::getInstance()->isOptionChecked(MenuOption::OffAxisProjection)) { + if (_faceshift.isActive()) { + _myCamera.setEyeOffsetPosition(_faceshift.getHeadTranslation()); + + } else if (_webcam.isActive()) { + _myCamera.setEyeOffsetPosition(_webcam.getEstimatedPosition()); + } + } } // Update bandwidth dialog, if any diff --git a/interface/src/Menu.cpp b/interface/src/Menu.cpp index 36dad85f60..f96b45207c 100644 --- a/interface/src/Menu.cpp +++ b/interface/src/Menu.cpp @@ -210,6 +210,11 @@ Menu::Menu() : false, appInstance->getWebcam()->getGrabber(), SLOT(setLEDTrackingOn(bool))); + + addCheckableActionToQMenuAndActionHash(viewMenu, + MenuOption::OffAxisProjection, + 0, + false); addDisabledActionAndSeparator(viewMenu, "Stats"); addCheckableActionToQMenuAndActionHash(viewMenu, MenuOption::Stats, Qt::Key_Slash); diff --git a/interface/src/Menu.h b/interface/src/Menu.h index bb2b1e6fc0..da773ad39e 100644 --- a/interface/src/Menu.h +++ b/interface/src/Menu.h @@ -170,6 +170,7 @@ namespace MenuOption { const QString LowRes = "Lower Resolution While Moving"; const QString Mirror = "Mirror"; const QString OcclusionCulling = "Occlusion Culling"; + const QString OffAxisProjection = "Off-Axis Projection"; const QString Oscilloscope = "Audio Oscilloscope"; const QString Pair = "Pair"; const QString PasteVoxels = "Paste";