mirror of
https://github.com/overte-org/overte.git
synced 2025-08-09 03:37:49 +02:00
No handControllerGrab.js lasers while in VR edit mode
This commit is contained in:
parent
a863e37eb5
commit
83a78aa407
1 changed files with 6 additions and 5 deletions
|
@ -537,7 +537,7 @@ function storeAttachPointForHotspotInSettings(hotspot, hand, offsetPosition, off
|
||||||
var EXTERNALLY_MANAGED_2D_MINOR_MODE = true;
|
var EXTERNALLY_MANAGED_2D_MINOR_MODE = true;
|
||||||
|
|
||||||
function isEditing() {
|
function isEditing() {
|
||||||
return EXTERNALLY_MANAGED_2D_MINOR_MODE && isInEditMode();
|
return EXTERNALLY_MANAGED_2D_MINOR_MODE && (isInEditMode() || isInVREditMode());
|
||||||
}
|
}
|
||||||
|
|
||||||
function isIn2DMode() {
|
function isIn2DMode() {
|
||||||
|
@ -1220,7 +1220,7 @@ function MyController(hand) {
|
||||||
};
|
};
|
||||||
|
|
||||||
this.setState = function(newState, reason) {
|
this.setState = function(newState, reason) {
|
||||||
if ((isInEditMode() && this.grabbedThingID !== HMD.tabletID) &&
|
if (((isInEditMode() || isInVREditMode()) && this.grabbedThingID !== HMD.tabletID) &&
|
||||||
(newState !== STATE_OFF &&
|
(newState !== STATE_OFF &&
|
||||||
newState !== STATE_SEARCHING &&
|
newState !== STATE_SEARCHING &&
|
||||||
newState !== STATE_STYLUS_TOUCHING &&
|
newState !== STATE_STYLUS_TOUCHING &&
|
||||||
|
@ -1799,8 +1799,9 @@ function MyController(hand) {
|
||||||
|
|
||||||
this.processStylus();
|
this.processStylus();
|
||||||
|
|
||||||
if (isInEditMode() && !this.isNearStylusTarget && HMD.isHandControllerAvailable()) {
|
if (isInEditMode() && !isInVREditMode() && !this.isNearStylusTarget && HMD.isHandControllerAvailable()) {
|
||||||
// Always showing lasers while in edit mode and hands/stylus is not active.
|
// 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);
|
var rayPickInfo = this.calcRayPickInfo(this.hand);
|
||||||
this.intersectionDistance = (rayPickInfo.entityID || rayPickInfo.overlayID) ? rayPickInfo.distance : 0;
|
this.intersectionDistance = (rayPickInfo.entityID || rayPickInfo.overlayID) ? rayPickInfo.distance : 0;
|
||||||
this.searchIndicatorOn(rayPickInfo.searchRay);
|
this.searchIndicatorOn(rayPickInfo.searchRay);
|
||||||
|
@ -2263,7 +2264,7 @@ function MyController(hand) {
|
||||||
return aDistance - bDistance;
|
return aDistance - bDistance;
|
||||||
});
|
});
|
||||||
entity = grabbableEntities[0];
|
entity = grabbableEntities[0];
|
||||||
if (!isInEditMode() || entity == HMD.tabletID) { // tablet is grabbable, even when editing
|
if ((!isInEditMode() && !isInVREditMode()) || entity == HMD.tabletID) { // tablet is grabbable, even when editing
|
||||||
name = entityPropertiesCache.getProps(entity).name;
|
name = entityPropertiesCache.getProps(entity).name;
|
||||||
this.grabbedThingID = entity;
|
this.grabbedThingID = entity;
|
||||||
this.grabbedIsOverlay = false;
|
this.grabbedIsOverlay = false;
|
||||||
|
@ -2371,7 +2372,7 @@ function MyController(hand) {
|
||||||
equipHotspotBuddy.highlightHotspot(potentialEquipHotspot);
|
equipHotspotBuddy.highlightHotspot(potentialEquipHotspot);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (farGrabEnabled && farSearching) {
|
if (farGrabEnabled && farSearching && !isInVREditMode()) {
|
||||||
this.searchIndicatorOn(rayPickInfo.searchRay);
|
this.searchIndicatorOn(rayPickInfo.searchRay);
|
||||||
}
|
}
|
||||||
Reticle.setVisible(false);
|
Reticle.setVisible(false);
|
||||||
|
|
Loading…
Reference in a new issue