mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-06-28 20:30:20 +02:00
Fix mouse interaction with overlays in HMDs
This commit is contained in:
parent
7ca63a4ace
commit
dcdf47dd66
1 changed files with 12 additions and 1 deletions
|
@ -859,6 +859,18 @@ void Application::initializeUi() {
|
||||||
offscreenUi->setBaseUrl(QUrl::fromLocalFile(PathUtils::resourcesPath() + "/qml/"));
|
offscreenUi->setBaseUrl(QUrl::fromLocalFile(PathUtils::resourcesPath() + "/qml/"));
|
||||||
offscreenUi->load("Root.qml");
|
offscreenUi->load("Root.qml");
|
||||||
offscreenUi->load("RootMenu.qml");
|
offscreenUi->load("RootMenu.qml");
|
||||||
|
|
||||||
|
offscreenUi->setMouseTranslator([=](const QPointF& pt) {
|
||||||
|
QPointF result = pt;
|
||||||
|
auto displayPlugin = getActiveDisplayPlugin();
|
||||||
|
if (displayPlugin->isHmd()) {
|
||||||
|
auto resultVec = _compositor.screenToOverlay(toGlm(pt));
|
||||||
|
result = QPointF(resultVec.x, resultVec.y);
|
||||||
|
} else if (displayPlugin->isStereo()) {
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
});
|
||||||
|
|
||||||
VrMenu::load();
|
VrMenu::load();
|
||||||
VrMenu::executeQueuedLambdas();
|
VrMenu::executeQueuedLambdas();
|
||||||
offscreenUi->resume();
|
offscreenUi->resume();
|
||||||
|
@ -4813,7 +4825,6 @@ void Application::updateDisplayMode() {
|
||||||
} else {
|
} else {
|
||||||
DependencyManager::get<OffscreenUi>()->setProxyWindow(nullptr);
|
DependencyManager::get<OffscreenUi>()->setProxyWindow(nullptr);
|
||||||
}
|
}
|
||||||
offscreenUi->setMouseTranslator(newDisplayPlugin->getMouseTranslator());
|
|
||||||
offscreenUi->resize(fromGlm(newDisplayPlugin->getCanvasSize()));
|
offscreenUi->resize(fromGlm(newDisplayPlugin->getCanvasSize()));
|
||||||
_offscreenContext->makeCurrent();
|
_offscreenContext->makeCurrent();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue