mirror of
https://github.com/overte-org/overte.git
synced 2025-04-20 01:24:03 +02:00
Merge pull request #11033 from zfox23/contextOverlays_tabletOrientation
Hack to mod tablet orientation when clicking context overlay
This commit is contained in:
commit
483d1e5b96
3 changed files with 15 additions and 1 deletions
|
@ -33,6 +33,17 @@ ContextOverlayInterface::ContextOverlayInterface() {
|
|||
|
||||
auto entityTreeRenderer = DependencyManager::get<EntityTreeRenderer>().data();
|
||||
connect(entityTreeRenderer, SIGNAL(mousePressOnEntity(const EntityItemID&, const PointerEvent&)), this, SLOT(createOrDestroyContextOverlay(const EntityItemID&, const PointerEvent&)));
|
||||
connect(_tabletScriptingInterface->getTablet("com.highfidelity.interface.tablet.system"), &TabletProxy::tabletShownChanged, this, [&]() {
|
||||
if (_contextOverlayJustClicked && _hmdScriptingInterface->isMounted()) {
|
||||
QUuid tabletFrameID = _hmdScriptingInterface->getCurrentTabletFrameID();
|
||||
QVariantMap props;
|
||||
auto myAvatar = DependencyManager::get<AvatarManager>()->getMyAvatar();
|
||||
props.insert("position", vec3toVariant(myAvatar->getEyePosition() + glm::quat(glm::radians(glm::vec3(0.0f, 30.0f, 0.0f))) * (0.65f * (myAvatar->getHeadOrientation() * Vectors::FRONT))));
|
||||
props.insert("orientation", quatToVariant(myAvatar->getHeadOrientation() * glm::quat(glm::radians(glm::vec3(0.0f, 210.0f, 0.0f)))));
|
||||
qApp->getOverlays().editOverlay(tabletFrameID, props);
|
||||
_contextOverlayJustClicked = false;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
static const xColor BB_OVERLAY_COLOR = {255, 255, 0};
|
||||
|
@ -149,6 +160,7 @@ void ContextOverlayInterface::clickContextOverlay(const OverlayID& overlayID, co
|
|||
qCDebug(context_overlay) << "Clicked Context Overlay. Entity ID:" << _currentEntityWithContextOverlay << "Overlay ID:" << overlayID;
|
||||
openMarketplace();
|
||||
destroyContextOverlay(_currentEntityWithContextOverlay, PointerEvent());
|
||||
_contextOverlayJustClicked = true;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -19,6 +19,7 @@
|
|||
#include <DependencyManager.h>
|
||||
#include <PointerEvent.h>
|
||||
#include <ui/TabletScriptingInterface.h>
|
||||
#include "avatar/AvatarManager.h"
|
||||
|
||||
#include "EntityScriptingInterface.h"
|
||||
#include "ui/overlays/Image3DOverlay.h"
|
||||
|
@ -66,6 +67,7 @@ private:
|
|||
bool _enabled { true };
|
||||
QUuid _currentEntityWithContextOverlay{};
|
||||
QString _entityMarketplaceID;
|
||||
bool _contextOverlayJustClicked { false };
|
||||
|
||||
void openMarketplace();
|
||||
};
|
||||
|
|
|
@ -104,7 +104,6 @@
|
|||
|
||||
function showTabletUI() {
|
||||
checkTablet()
|
||||
gTablet.tabletShown = true;
|
||||
|
||||
if (!tabletRezzed || !tabletIsValid()) {
|
||||
closeTabletUI();
|
||||
|
@ -123,6 +122,7 @@
|
|||
Overlays.editOverlay(HMD.tabletScreenID, { visible: true });
|
||||
Overlays.editOverlay(HMD.tabletScreenID, { maxFPS: 90 });
|
||||
}
|
||||
gTablet.tabletShown = true;
|
||||
}
|
||||
|
||||
function hideTabletUI() {
|
||||
|
|
Loading…
Reference in a new issue