mirror of
https://github.com/lubosz/overte.git
synced 2025-08-08 03:08:00 +02:00
Fix HUD content displaying only every second HUD recentering
This commit is contained in:
parent
9f95b101fe
commit
cbef9d2926
1 changed files with 12 additions and 13 deletions
|
@ -85,7 +85,6 @@ void OverlayConductor::update(float dt) {
|
||||||
if (!desktop) {
|
if (!desktop) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
bool currentVisible = !desktop->property("pinned").toBool();
|
|
||||||
|
|
||||||
auto myAvatar = DependencyManager::get<AvatarManager>()->getMyAvatar();
|
auto myAvatar = DependencyManager::get<AvatarManager>()->getMyAvatar();
|
||||||
// centerUI when hmd mode is first enabled and mounted
|
// centerUI when hmd mode is first enabled and mounted
|
||||||
|
@ -98,24 +97,24 @@ void OverlayConductor::update(float dt) {
|
||||||
_hmdMode = false;
|
_hmdMode = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool shouldRecenter = false;
|
bool initiateRecenter = false;
|
||||||
|
if (_hmdMode && headNotCenteredInOverlay()) {
|
||||||
if (_suppressedByHead) {
|
initiateRecenter = true;
|
||||||
if (updateAvatarIsAtRest()) {
|
|
||||||
_suppressedByHead = false;
|
|
||||||
shouldRecenter = true;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
if (_hmdMode && headNotCenteredInOverlay()) {
|
|
||||||
_suppressedByHead = true;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool shouldRecenter = false;
|
||||||
|
if (initiateRecenter || _suppressedByHead) {
|
||||||
|
_suppressedByHead = !updateAvatarIsAtRest();
|
||||||
|
shouldRecenter = !_suppressedByHead;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool currentVisible = !desktop->property("pinned").toBool();
|
||||||
bool targetVisible = Menu::getInstance()->isOptionChecked(MenuOption::Overlays) && !_suppressedByHead;
|
bool targetVisible = Menu::getInstance()->isOptionChecked(MenuOption::Overlays) && !_suppressedByHead;
|
||||||
if (targetVisible != currentVisible) {
|
if (targetVisible != currentVisible) {
|
||||||
offscreenUi->setPinned(!targetVisible);
|
offscreenUi->setPinned(!targetVisible);
|
||||||
}
|
}
|
||||||
if (shouldRecenter && !_suppressedByHead) {
|
|
||||||
|
if (shouldRecenter) {
|
||||||
centerUI();
|
centerUI();
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in a new issue