From 76ca3aa546df72d2674a8147bf2f548357dad33a Mon Sep 17 00:00:00 2001 From: Brad Hefta-Gaub Date: Mon, 24 Oct 2016 15:25:06 -0700 Subject: [PATCH] fix residual head laser --- .../system/controllers/handControllerPointer.js | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/scripts/system/controllers/handControllerPointer.js b/scripts/system/controllers/handControllerPointer.js index 0b87672483..ae4d3d1f78 100644 --- a/scripts/system/controllers/handControllerPointer.js +++ b/scripts/system/controllers/handControllerPointer.js @@ -500,18 +500,18 @@ function update() { return off(); } - if (!HMD.isHandControllerAvailable()) { - var color = (activeTrigger.state === 'full') ? LASER_TRIGGER_COLOR_XYZW : LASER_SEARCH_COLOR_XYZW; - - var position = MyAvatar.getHeadPosition(); - var direction = Quat.getUp(Quat.multiply(MyAvatar.headOrientation, Quat.angleAxis(-90, { x: 1, y: 0, z: 0 }))); - HMD.setExtraLaser(position,true, color, direction); - } // If there's a HUD element at the (newly moved) reticle, just make it visible and bail. if (isPointingAtOverlay(hudPoint2d)) { if (HMD.active) { Reticle.depth = hudReticleDistance(); + + if (!HMD.isHandControllerAvailable()) { + var color = (activeTrigger.state === 'full') ? LASER_TRIGGER_COLOR_XYZW : LASER_SEARCH_COLOR_XYZW; + var position = MyAvatar.getHeadPosition(); + var direction = Quat.getUp(Quat.multiply(MyAvatar.headOrientation, Quat.angleAxis(-90, { x: 1, y: 0, z: 0 }))); + HMD.setExtraLaser(position,true, color, direction); + } } if (activeTrigger.state && (!systemLaserOn || (systemLaserOn !== activeTrigger.state))) { // last=>wrong color