never interact with hud elements while holding something

This commit is contained in:
howard-stearns 2016-10-14 18:30:52 -07:00
parent d70b58555e
commit 140caf84d8
3 changed files with 16 additions and 5 deletions

View file

@ -15,9 +15,9 @@
(function() { // BEGIN LOCAL_SCOPE
Script.include("/~/system/libraries/utils.js");
Script.include("/~/system/libraries/Xform.js");
Script.include("/~/system/libraries/controllers.js");
Script.include("../libraries/utils.js");
Script.include("../libraries/Xform.js");
Script.include("../libraries/controllers.js");
//
// add lines where the hand ray picking is happening
@ -792,7 +792,7 @@ function MyController(hand) {
};
this.setState = function(newState, reason) {
setGrabCommunications((newState === STATE_DISTANCE_HOLDING) || (newState === STATE_NEAR_GRABBING));
if (WANT_DEBUG || WANT_DEBUG_STATE) {
var oldStateName = stateToName(this.state);
var newStateName = stateToName(newState);

View file

@ -20,7 +20,7 @@
// When partially squeezing over a HUD element, a laser or the reticle is shown where the active hand
// controller beam intersects the HUD.
Script.include("/~/system/libraries/controllers.js");
Script.include("../libraries/controllers.js");
// UTILITIES -------------
//
@ -484,6 +484,9 @@ function update() {
if (!activeTrigger.state) {
return off(); // No trigger
}
if (getGrabCommunications()) {
return off();
}
var hudPoint2d = activeHudPoint2d(activeHand);
if (!hudPoint2d) {
return off();

View file

@ -7,6 +7,14 @@
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
/* global MyAvatar, Vec3, Controller, Quat */
var GRAB_COMMUNICATIONS_SETTING = "io.highfidelity.isFarGrabbing";
setGrabCommunications = function setFarGrabCommunications(on) {
Settings.setValue(GRAB_COMMUNICATIONS_SETTING, on ? "on" : "");
}
getGrabCommunications = function getFarGrabCommunications() {
return !!Settings.getValue(GRAB_COMMUNICATIONS_SETTING, "");
}
// var GRAB_POINT_SPHERE_OFFSET = { x: 0, y: 0.2, z: 0 };
// var GRAB_POINT_SPHERE_OFFSET = { x: 0.1, y: 0.175, z: 0.04 };