Always show hand lasers when in edit mode.

This commit is contained in:
Andrew Lowry 2017-04-22 18:42:13 -04:00
parent 8479d835b2
commit ecf3826050
2 changed files with 28 additions and 3 deletions

View file

@ -1330,7 +1330,7 @@ function MyController(hand) {
if (this.stylus) {
return;
}
var stylusProperties = {
name: "stylus",
url: Script.resourcesPath() + "meshes/tablet-stylus-fat.fbx",
@ -1420,6 +1420,14 @@ function MyController(hand) {
}
};
// Turns off indicators used for searching. Overlay line and sphere.
this.searchIndicatorOff = function() {
this.searchSphereOff();
if (PICK_WITH_HAND_RAY) {
this.overlayLineOff();
}
}
this.otherGrabbingLineOn = function(avatarPosition, entityPosition, color) {
if (this.otherGrabbingLine === null) {
var lineProperties = {
@ -1791,6 +1799,15 @@ function MyController(hand) {
}
this.processStylus();
if (isInEditMode() && !this.isNearStylusTarget) {
// Always showing lasers while in edit mode and hands/stylus is not active.
var rayPickInfo = this.calcRayPickInfo(this.hand);
this.intersectionDistance = (rayPickInfo.entityID || rayPickInfo.overlayID) ? rayPickInfo.distance : 0;
this.searchIndicatorOn(rayPickInfo.searchRay);
} else {
this.searchIndicatorOff();
}
};
this.handleLaserOnHomeButton = function(rayPickInfo) {
@ -2281,7 +2298,7 @@ function MyController(hand) {
if (this.getOtherHandController().state === STATE_DISTANCE_HOLDING) {
this.setState(STATE_DISTANCE_ROTATING, "distance rotate '" + name + "'");
} else {
this.setState(STATE_DISTANCE_HOLDING, "distance hold '" + name + "'");
this.setState(STATE_DISTANCE_HOLDING, "distance hold '" + name + "'");
}
return;
} else {
@ -3346,7 +3363,14 @@ function MyController(hand) {
};
this.offEnter = function() {
// Reuse the existing search distance if lasers were active since
// they will be shown in OFF state while in edit mode.
var existingSearchDistance = this.searchSphereDistance;
this.release();
if (isInEditMode()) {
this.searchSphereDistance = existingSearchDistance;
}
};
this.entityLaserTouchingEnter = function() {

View file

@ -12,7 +12,8 @@
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
//
/* global Script, SelectionDisplay, LightOverlayManager, CameraManager, Grid, GridTool, EntityListTool, Vec3, SelectionManager, Overlays, OverlayWebWindow, UserActivityLogger, Settings, Entities, Tablet, Toolbars, Messages, Menu, Camera, progressDialog, tooltip, MyAvatar, Quat, Controller, Clipboard, HMD, UndoStack, ParticleExplorerTool */
/* global Script, SelectionDisplay, LightOverlayManager, CameraManager, Grid, GridTool, EntityListTool, Vec3, SelectionManager, Overlays, OverlayWebWindow, UserActivityLogger,
Settings, Entities, Tablet, Toolbars, Messages, Menu, Camera, progressDialog, tooltip, MyAvatar, Quat, Controller, Clipboard, HMD, UndoStack, ParticleExplorerTool */
(function() { // BEGIN LOCAL_SCOPE