mirror of
https://github.com/AleziaKurdis/overte.git
synced 2025-04-08 12:32:12 +02:00
Merge pull request #10993 from druiz17/bug-rogue-laser
Do not show lasers when editing in 2D mode.
This commit is contained in:
commit
044b8fc19a
1 changed files with 11 additions and 3 deletions
|
@ -1803,9 +1803,14 @@ function MyController(hand) {
|
|||
|
||||
if (isInEditMode() && !this.isNearStylusTarget && HMD.isHandControllerAvailable()) {
|
||||
// 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);
|
||||
if (rayPickInfo.isValid) {
|
||||
this.intersectionDistance = (rayPickInfo.entityID || rayPickInfo.overlayID) ? rayPickInfo.distance : 0;
|
||||
this.searchIndicatorOn(rayPickInfo.searchRay);
|
||||
} else {
|
||||
this.searchIndicatorOff();
|
||||
}
|
||||
} else {
|
||||
this.searchIndicatorOff();
|
||||
}
|
||||
|
@ -1854,12 +1859,14 @@ function MyController(hand) {
|
|||
this.calcRayPickInfo = function(hand, pickRayOverride) {
|
||||
|
||||
var pickRay;
|
||||
var valid = true
|
||||
if (pickRayOverride) {
|
||||
pickRay = pickRayOverride;
|
||||
} else {
|
||||
var controllerLocation = getControllerWorldLocation(this.handToController(), true);
|
||||
var worldHandPosition = controllerLocation.position;
|
||||
var worldHandRotation = controllerLocation.orientation;
|
||||
valid = !(worldHandPosition === undefined);
|
||||
|
||||
pickRay = {
|
||||
origin: PICK_WITH_HAND_RAY ? worldHandPosition : Camera.position,
|
||||
|
@ -1874,7 +1881,8 @@ function MyController(hand) {
|
|||
entityID: null,
|
||||
overlayID: null,
|
||||
searchRay: pickRay,
|
||||
distance: PICK_MAX_DISTANCE
|
||||
distance: PICK_MAX_DISTANCE,
|
||||
isValid: valid
|
||||
};
|
||||
|
||||
var now = Date.now();
|
||||
|
|
Loading…
Reference in a new issue