mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-08-09 18:26:26 +02:00
Don't show proxy if tablet has been opened by other means
This commit is contained in:
parent
b240a4248d
commit
557f18f370
1 changed files with 19 additions and 8 deletions
|
@ -107,8 +107,10 @@
|
||||||
// #region State Machine ===================================================================================================
|
// #region State Machine ===================================================================================================
|
||||||
|
|
||||||
function enterProxyHidden() {
|
function enterProxyHidden() {
|
||||||
Overlays.deleteOverlay(proxyOverlay);
|
if (proxyOverlay) {
|
||||||
proxyOverlay = null;
|
Overlays.deleteOverlay(proxyOverlay);
|
||||||
|
proxyOverlay = null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function enterProxyVisible(hand) {
|
function enterProxyVisible(hand) {
|
||||||
|
@ -253,30 +255,39 @@
|
||||||
// Assumes that is HMD.mounted.
|
// Assumes that is HMD.mounted.
|
||||||
switch (rezzerState) {
|
switch (rezzerState) {
|
||||||
case PROXY_HIDDEN:
|
case PROXY_HIDDEN:
|
||||||
|
// Don't show proxy is tablet is already displayed.
|
||||||
|
if (HMD.showTablet) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
// Compare palm directions of hands with vectors from palms to camera.
|
// Compare palm directions of hands with vectors from palms to camera.
|
||||||
if (shouldShowProxy(LEFT_HAND)) {
|
if (shouldShowProxy(LEFT_HAND)) {
|
||||||
setState(PROXY_VISIBLE, LEFT_HAND);
|
setState(PROXY_VISIBLE, LEFT_HAND);
|
||||||
break;
|
|
||||||
} else if (shouldShowProxy(RIGHT_HAND)) {
|
} else if (shouldShowProxy(RIGHT_HAND)) {
|
||||||
setState(PROXY_VISIBLE, RIGHT_HAND);
|
setState(PROXY_VISIBLE, RIGHT_HAND);
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case PROXY_VISIBLE:
|
case PROXY_VISIBLE:
|
||||||
|
// Hide proxy if tablet has been displayed by other means.
|
||||||
|
if (HMD.showTablet) {
|
||||||
|
setState(PROXY_HIDDEN);
|
||||||
|
break;
|
||||||
|
}
|
||||||
// Check that palm direction of proxy hand still less than maximum angle.
|
// Check that palm direction of proxy hand still less than maximum angle.
|
||||||
if (!shouldShowProxy(proxyHand)) {
|
if (!shouldShowProxy(proxyHand)) {
|
||||||
setState(PROXY_HIDDEN);
|
setState(PROXY_HIDDEN);
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case PROXY_GRABBED:
|
case PROXY_GRABBED:
|
||||||
case PROXY_EXPANDING:
|
case PROXY_EXPANDING:
|
||||||
break;
|
// Hide proxy if tablet has been displayed by other means.
|
||||||
case TABLET_OPEN:
|
if (HMD.showTablet) {
|
||||||
if (!HMD.showTablet) {
|
|
||||||
setState(PROXY_HIDDEN);
|
setState(PROXY_HIDDEN);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
case TABLET_OPEN:
|
||||||
|
// Immediately transition back to PROXY_HIDDEN.
|
||||||
|
setState(PROXY_HIDDEN);
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
error("Missing case: " + rezzerState);
|
error("Missing case: " + rezzerState);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue