mirror of
https://github.com/overte-org/overte.git
synced 2025-04-15 19:39:20 +02:00
Fix tablet laser when Shapes app is running
This commit is contained in:
parent
7236ac17e2
commit
6c16fcfe65
1 changed files with 22 additions and 3 deletions
|
@ -9,7 +9,7 @@
|
|||
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
|
||||
|
||||
/* global Script, MyAvatar, RIGHT_HAND, LEFT_HAND, enableDispatcherModule, disableDispatcherModule,
|
||||
makeDispatcherModuleParameters, makeRunningValues, getEnabledModuleByName
|
||||
makeDispatcherModuleParameters, makeRunningValues, getEnabledModuleByName, makeLaserParams
|
||||
*/
|
||||
|
||||
Script.include("/~/system/libraries/controllerDispatcherUtils.js");
|
||||
|
@ -25,9 +25,17 @@ Script.include("/~/system/libraries/controllerDispatcherUtils.js");
|
|||
? ["rightHand", "rightHandEquip", "rightHandTrigger"]
|
||||
: ["leftHand", "leftHandEquip", "leftHandTrigger"],
|
||||
[],
|
||||
100
|
||||
100,
|
||||
makeLaserParams(this.hand, false)
|
||||
);
|
||||
|
||||
this.pointingAtTablet = function (objectID) {
|
||||
if (objectID === HMD.tabletScreenID || objectID === HMD.homeButtonID) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
};
|
||||
|
||||
this.isReady = function (controllerData) {
|
||||
if (this.disableModules) {
|
||||
return makeRunningValues(true, [], []);
|
||||
|
@ -42,7 +50,6 @@ Script.include("/~/system/libraries/controllerDispatcherUtils.js");
|
|||
}
|
||||
|
||||
// Tablet stylus.
|
||||
// Includes the tablet laser.
|
||||
var tabletStylusInput = getEnabledModuleByName(this.hand === RIGHT_HAND
|
||||
? "RightTabletStylusInput"
|
||||
: "LeftTabletStylusInput");
|
||||
|
@ -53,6 +60,18 @@ Script.include("/~/system/libraries/controllerDispatcherUtils.js");
|
|||
}
|
||||
}
|
||||
|
||||
// Tablet surface.
|
||||
var overlayLaser = getEnabledModuleByName(this.hand === RIGHT_HAND
|
||||
? "RightWebSurfaceLaserInput"
|
||||
: "LeftWebSurfaceLaserInput");
|
||||
if (overlayLaser) {
|
||||
var overlayLaserReady = overlayLaser.isReady(controllerData);
|
||||
var target = controllerData.rayPicks[this.hand].objectID;
|
||||
if (overlayLaserReady.active && this.pointingAtTablet(target)) {
|
||||
return makeRunningValues(false, [], []);
|
||||
}
|
||||
}
|
||||
|
||||
// Tablet grabbing.
|
||||
var nearOverlay = getEnabledModuleByName(this.hand === RIGHT_HAND
|
||||
? "RightNearParentingGrabOverlay"
|
||||
|
|
Loading…
Reference in a new issue