mirror of
https://github.com/overte-org/overte.git
synced 2025-04-25 20:36:38 +02:00
Merge pull request #8819 from howard-stearns/no-hud-interaction-while-grabbing
never interact with hud elements while holding something
This commit is contained in:
commit
268cc098cd
3 changed files with 16 additions and 5 deletions
|
@ -15,9 +15,9 @@
|
||||||
|
|
||||||
(function() { // BEGIN LOCAL_SCOPE
|
(function() { // BEGIN LOCAL_SCOPE
|
||||||
|
|
||||||
Script.include("/~/system/libraries/utils.js");
|
Script.include("../libraries/utils.js");
|
||||||
Script.include("/~/system/libraries/Xform.js");
|
Script.include("../libraries/Xform.js");
|
||||||
Script.include("/~/system/libraries/controllers.js");
|
Script.include("../libraries/controllers.js");
|
||||||
|
|
||||||
//
|
//
|
||||||
// add lines where the hand ray picking is happening
|
// add lines where the hand ray picking is happening
|
||||||
|
@ -792,7 +792,7 @@ function MyController(hand) {
|
||||||
};
|
};
|
||||||
|
|
||||||
this.setState = function(newState, reason) {
|
this.setState = function(newState, reason) {
|
||||||
|
setGrabCommunications((newState === STATE_DISTANCE_HOLDING) || (newState === STATE_NEAR_GRABBING));
|
||||||
if (WANT_DEBUG || WANT_DEBUG_STATE) {
|
if (WANT_DEBUG || WANT_DEBUG_STATE) {
|
||||||
var oldStateName = stateToName(this.state);
|
var oldStateName = stateToName(this.state);
|
||||||
var newStateName = stateToName(newState);
|
var newStateName = stateToName(newState);
|
||||||
|
|
|
@ -20,7 +20,7 @@
|
||||||
// When partially squeezing over a HUD element, a laser or the reticle is shown where the active hand
|
// When partially squeezing over a HUD element, a laser or the reticle is shown where the active hand
|
||||||
// controller beam intersects the HUD.
|
// controller beam intersects the HUD.
|
||||||
|
|
||||||
Script.include("/~/system/libraries/controllers.js");
|
Script.include("../libraries/controllers.js");
|
||||||
|
|
||||||
// UTILITIES -------------
|
// UTILITIES -------------
|
||||||
//
|
//
|
||||||
|
@ -484,6 +484,9 @@ function update() {
|
||||||
if (!activeTrigger.state) {
|
if (!activeTrigger.state) {
|
||||||
return off(); // No trigger
|
return off(); // No trigger
|
||||||
}
|
}
|
||||||
|
if (getGrabCommunications()) {
|
||||||
|
return off();
|
||||||
|
}
|
||||||
var hudPoint2d = activeHudPoint2d(activeHand);
|
var hudPoint2d = activeHudPoint2d(activeHand);
|
||||||
if (!hudPoint2d) {
|
if (!hudPoint2d) {
|
||||||
return off();
|
return off();
|
||||||
|
|
|
@ -7,6 +7,14 @@
|
||||||
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
|
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
|
||||||
/* global MyAvatar, Vec3, Controller, Quat */
|
/* 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, y: 0.2, z: 0 };
|
||||||
// var GRAB_POINT_SPHERE_OFFSET = { x: 0.1, y: 0.175, z: 0.04 };
|
// var GRAB_POINT_SPHERE_OFFSET = { x: 0.1, y: 0.175, z: 0.04 };
|
||||||
|
|
Loading…
Reference in a new issue