History

HUD events WIP, fix entity/overlay hover, no hover for empty renderState

SamGondelman committed 9 years ago

Commit 3c779f11 parent 76eb4c616 files · +138 −20Browse files

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

Unified · Split

interface/src/Application.cpp+6−0
@@ -1811,6 +1811,12 @@ Application::Application(int& argc, char** argv, QElapsedTimer& startupTimer, bo · 1810 unmodified lines
18111811 connect(&_myCamera, &Camera::modeUpdated, this, &Application::cameraModeChanged);
18121812
18131813 DependencyManager::get<PickManager>()->setShouldPickHUDOperator([&]() { return DependencyManager::get<HMDScriptingInterface>()->isHMDMode(); });
1814+ DependencyManager::get<PickManager>()->setCalculatePos2DFromHUDOperator([&](const glm::vec3& intersection) {
1815+ const glm::vec2 MARGIN(25.0f);
1816+ glm::vec2 maxPos = _controllerScriptingInterface->getViewportDimensions() - MARGIN;
1817+ glm::vec2 pos2D = DependencyManager::get<HMDScriptingInterface>()->overlayFromWorldPoint(intersection);
1818+ return glm::max(MARGIN, glm::min(pos2D, maxPos));
1819+ });
18141820
18151821 // Setup the mouse ray pick and related operators
18161822 DependencyManager::get<EntityTreeRenderer>()->setMouseRayPickID(DependencyManager::get<PickManager>()->addPick(PickQuery::Ray, std::make_shared<MouseRayPick>(