Revert handControllerGrab.js related changes

This commit is contained in:
David Rowe 2017-09-14 17:08:26 +12:00
parent a4ecb69ea6
commit 299a8078e3
3 changed files with 29 additions and 34 deletions

View file

@ -14,7 +14,7 @@
/* global getEntityCustomData, flatten, Xform, Script, Quat, Vec3, MyAvatar, Entities, Overlays, Settings,
Reticle, Controller, Camera, Messages, Mat4, getControllerWorldLocation, getGrabPointSphereOffset,
setGrabCommunications, Menu, HMD, isInEditMode, isInVREditMode, AvatarList */
setGrabCommunications, Menu, HMD, isInEditMode, AvatarList */
/* eslint indent: ["error", 4, { "outerIIFEBody": 0 }] */
(function() { // BEGIN LOCAL_SCOPE
@ -539,7 +539,7 @@ function storeAttachPointForHotspotInSettings(hotspot, hand, offsetPosition, off
var EXTERNALLY_MANAGED_2D_MINOR_MODE = true;
function isEditing() {
return EXTERNALLY_MANAGED_2D_MINOR_MODE && (isInEditMode() || isInVREditMode());
return EXTERNALLY_MANAGED_2D_MINOR_MODE && isInEditMode();
}
function isIn2DMode() {
@ -1313,7 +1313,7 @@ function MyController(hand) {
};
this.setState = function(newState, reason) {
if (((isInEditMode() || isInVREditMode()) && this.grabbedThingID !== HMD.tabletID) &&
if ((isInEditMode() && this.grabbedThingID !== HMD.tabletID) &&
(newState !== STATE_OFF &&
newState !== STATE_SEARCHING &&
newState !== STATE_STYLUS_TOUCHING &&
@ -1752,7 +1752,7 @@ function MyController(hand) {
var nonTabletEntities = grabbableEntities.filter(function(entityID) {
return entityID != HMD.tabletID && entityID != HMD.homeButtonID;
});
if (nonTabletEntities.length > 0 && !isInEditMode() && !isInVREditMode()) {
if (nonTabletEntities.length > 0) {
Controller.triggerHapticPulse(1, 20, this.hand);
}
this.grabPointIntersectsEntity = true;
@ -1765,9 +1765,9 @@ function MyController(hand) {
this.processStylus();
if (isInEditMode() && !isInVREditMode() && !this.isNearStylusTarget && HMD.isHandControllerAvailable()) {
if (isInEditMode() && !this.isNearStylusTarget && HMD.isHandControllerAvailable()) {
// Always showing lasers while in edit mode and hands/stylus is not active.
// But don't show lasers while in VR edit mode.
var rayPickInfo = this.calcRayPickInfo(this.hand);
if (rayPickInfo.isValid) {
this.intersectionDistance = (rayPickInfo.entityID || rayPickInfo.overlayID) ? rayPickInfo.distance : 0;
@ -2289,7 +2289,7 @@ function MyController(hand) {
return aDistance - bDistance;
});
entity = grabbableEntities[0];
if ((!isInEditMode() && !isInVREditMode()) || entity == HMD.tabletID) { // tablet is grabbable, even when editing
if (!isInEditMode() || entity == HMD.tabletID) { // tablet is grabbable, even when editing
name = entityPropertiesCache.getProps(entity).name;
this.grabbedThingID = entity;
this.grabbedIsOverlay = false;
@ -2389,7 +2389,7 @@ function MyController(hand) {
equipHotspotBuddy.highlightHotspot(potentialEquipHotspot);
}
if (farGrabEnabled && farSearching && !isInVREditMode()) {
if (farGrabEnabled && farSearching) {
this.updateLaserPointer();
}
Reticle.setVisible(false);

View file

@ -6,16 +6,12 @@
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
//
EDIT_SETTING = "io.highfidelity.isEditing"; // Note: This constant is duplicated in edit.js.
isInEditMode = function () {
// note: this constant is currently duplicated in edit.js
EDIT_SETTING = "io.highfidelity.isEditting";
isInEditMode = function isInEditMode() {
return Settings.getValue(EDIT_SETTING);
};
VR_EDIT_SETTING = "io.highfidelity.isVREditing"; // Note: This constant is duplicated in vr-edit.js.
isInVREditMode = function () {
return HMD.active && Settings.getValue(VR_EDIT_SETTING);
}
if (!Function.prototype.bind) {
Function.prototype.bind = function(oThis) {
if (typeof this !== 'function') {

View file

@ -18,7 +18,6 @@
APP_ICON_DISABLED = "icons/tablet-icons/edit-disabled.svg",
ENABLED_CAPTION_COLOR_OVERRIDE = "",
DISABLED_CAPTION_COLOR_OVERRIDE = "#888888",
VR_EDIT_SETTING = "io.highfidelity.isVREditing", // Note: This constant is duplicated in utils.js.
START_DELAY = 2000, // ms
// Application state
@ -1392,7 +1391,7 @@
function updateHandControllerGrab() {
// Communicate app status to handControllerGrab.js.
Settings.setValue(VR_EDIT_SETTING, isAppActive);
// TODO
}
function onUICommand(command, parameter) {