Fix tablet highlighting when using the Create and Shapes apps

This commit is contained in:
David Rowe 2018-10-20 11:57:46 +13:00
parent eb179363f6
commit 71ec5f3612
2 changed files with 12 additions and 12 deletions

View file

@ -158,11 +158,12 @@ Script.include("/~/system/libraries/utils.js");
}
}
var nearOverlay = getEnabledModuleByName(this.hand === RIGHT_HAND
? "RightNearParentingGrabOverlay" : "LeftNearParentingGrabOverlay");
if (nearOverlay) {
var nearOverlayReady = nearOverlay.isReady(controllerData);
if (nearOverlayReady.active && HMD.tabletID && nearOverlay.grabbedThingID === HMD.tabletID) {
// Tablet highlight and grabbing.
var tabletHighlight = getEnabledModuleByName(this.hand === RIGHT_HAND
? "RightNearTabletHighlight" : "LeftNearTabletHighlight");
if (tabletHighlight) {
var tabletHighlightReady = tabletHighlight.isReady(controllerData);
if (tabletHighlightReady.active) {
return this.exitModule();
}
}

View file

@ -101,13 +101,12 @@ Script.include("/~/system/libraries/controllerDispatcherUtils.js");
}
}
// Tablet grabbing.
var nearOverlay = getEnabledModuleByName(this.hand === RIGHT_HAND ?
"RightNearParentingGrabOverlay" :
"LeftNearParentingGrabOverlay");
if (nearOverlay) {
var nearOverlayReady = nearOverlay.isReady(controllerData);
if (nearOverlayReady.active && HMD.tabletID && nearOverlay.grabbedThingID === HMD.tabletID) {
// Tablet highlight and grabbing.
var tabletHighlight = getEnabledModuleByName(this.hand === RIGHT_HAND
? "RightNearTabletHighlight" : "LeftNearTabletHighlight");
if (tabletHighlight) {
var tabletHighlightReady = tabletHighlight.isReady(controllerData);
if (tabletHighlightReady.active) {
return this.exitModule();
}
}