mirror of
https://github.com/Armored-Dragon/overte.git
synced 2025-03-11 16:13:16 +01:00
save tablet web-overlay ID in HMD interface. don't trigger edit affordances if the click was intented for the tablet
This commit is contained in:
parent
4c1f5c1dc8
commit
5ddcbae934
4 changed files with 19 additions and 7 deletions
|
@ -808,7 +808,7 @@ void MyAvatar::saveData() {
|
|||
auto hmdInterface = DependencyManager::get<HMDScriptingInterface>();
|
||||
_avatarEntitiesLock.withReadLock([&] {
|
||||
for (auto entityID : _avatarEntityData.keys()) {
|
||||
if (hmdInterface->getCurrentTableUIID() == entityID) {
|
||||
if (hmdInterface->getCurrentTabletUIID() == entityID) {
|
||||
// don't persist the tablet between domains / sessions
|
||||
continue;
|
||||
}
|
||||
|
|
|
@ -29,8 +29,9 @@ class HMDScriptingInterface : public AbstractHMDScriptingInterface, public Depen
|
|||
Q_PROPERTY(glm::quat orientation READ getOrientation)
|
||||
Q_PROPERTY(bool mounted READ isMounted)
|
||||
Q_PROPERTY(bool showTablet READ getShouldShowTablet)
|
||||
Q_PROPERTY(QUuid tabletID READ getCurrentTableUIID WRITE setCurrentTabletUIID)
|
||||
Q_PROPERTY(QUuid tabletID READ getCurrentTabletUIID WRITE setCurrentTabletUIID)
|
||||
Q_PROPERTY(unsigned int homeButtonID READ getCurrentHomeButtonUUID WRITE setCurrentHomeButtonUUID)
|
||||
Q_PROPERTY(QUuid tabletScreenID READ getCurrentTabletScreenID WRITE setCurrentTabletScreenID)
|
||||
|
||||
|
||||
public:
|
||||
|
@ -91,14 +92,18 @@ public:
|
|||
bool getShouldShowTablet() const { return _showTablet; }
|
||||
|
||||
void setCurrentTabletUIID(QUuid tabletID) { _tabletUIID = tabletID; }
|
||||
QUuid getCurrentTableUIID() const { return _tabletUIID; }
|
||||
QUuid getCurrentTabletUIID() const { return _tabletUIID; }
|
||||
|
||||
void setCurrentHomeButtonUUID(unsigned int homeButtonID) { _homeButtonID = homeButtonID; }
|
||||
unsigned int getCurrentHomeButtonUUID() const { return _homeButtonID; }
|
||||
|
||||
void setCurrentTabletScreenID(QUuid tabletID) { _tabletScreenID = tabletID; }
|
||||
QUuid getCurrentTabletScreenID() const { return _tabletScreenID; }
|
||||
|
||||
private:
|
||||
bool _showTablet { false };
|
||||
QUuid _tabletUIID; // this is the entityID of the WebEntity which is part of (a child of) the tablet-ui.
|
||||
QUuid _tabletUIID; // this is the entityID of the tablet frame
|
||||
QUuid _tabletScreenID; // this is the overlayID which is part of (a child of) the tablet-ui.
|
||||
unsigned int _homeButtonID;
|
||||
QUuid _tabletEntityID;
|
||||
|
||||
|
|
|
@ -2048,7 +2048,7 @@ SelectionDisplay = (function() {
|
|||
Overlays.editOverlay(grabberPointLightL, {
|
||||
visible: false
|
||||
});
|
||||
Overlays.editOverlay(grabberPointLightR, {
|
||||
Overlays.editOverlay(grabberPointLightR, {
|
||||
visible: false
|
||||
});
|
||||
Overlays.editOverlay(grabberPointLightF, {
|
||||
|
@ -3866,6 +3866,12 @@ SelectionDisplay = (function() {
|
|||
var somethingClicked = false;
|
||||
var pickRay = generalComputePickRay(event.x, event.y);
|
||||
|
||||
var result = Overlays.findRayIntersection(pickRay, true, [HMD.tabletScreenID]);
|
||||
if (result.intersects) {
|
||||
// mouse clicks on the tablet should override the edit affordances
|
||||
return false;
|
||||
}
|
||||
|
||||
// before we do a ray test for grabbers, disable the ray intersection for our selection box
|
||||
Overlays.editOverlay(selectionBox, {
|
||||
ignoreRayIntersection: true
|
||||
|
@ -3879,10 +3885,9 @@ SelectionDisplay = (function() {
|
|||
Overlays.editOverlay(rollHandle, {
|
||||
ignoreRayIntersection: true
|
||||
});
|
||||
var result = Overlays.findRayIntersection(pickRay);
|
||||
|
||||
result = Overlays.findRayIntersection(pickRay);
|
||||
if (result.intersects) {
|
||||
|
||||
|
||||
if (wantDebug) {
|
||||
print("something intersects... ");
|
||||
|
|
|
@ -32,6 +32,7 @@
|
|||
UIWebTablet.register();
|
||||
HMD.tabletID = UIWebTablet.tabletEntityID;
|
||||
HMD.homeButtonID = UIWebTablet.homeButtonEntity;
|
||||
HMD.tabletScreenID = UIWebTablet.webOverlayID;
|
||||
}
|
||||
|
||||
function hideTabletUI() {
|
||||
|
@ -48,6 +49,7 @@
|
|||
UIWebTablet = null;
|
||||
HMD.tabletID = null;
|
||||
HMD.homeButtonID = null;
|
||||
HMD.tabletScreenID = null;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue