mirror of
https://github.com/overte-org/overte.git
synced 2025-04-20 14:03:55 +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->load("Root.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::executeQueuedLambdas();
|
||||
offscreenUi->resume();
|
||||
|
@ -4813,7 +4825,6 @@ void Application::updateDisplayMode() {
|
|||
} else {
|
||||
DependencyManager::get<OffscreenUi>()->setProxyWindow(nullptr);
|
||||
}
|
||||
offscreenUi->setMouseTranslator(newDisplayPlugin->getMouseTranslator());
|
||||
offscreenUi->resize(fromGlm(newDisplayPlugin->getCanvasSize()));
|
||||
_offscreenContext->makeCurrent();
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue