From d88ff701b5f9c21e5b3363d9edacea59af513311 Mon Sep 17 00:00:00 2001 From: Dante Ruiz Date: Thu, 18 Jan 2018 10:48:35 -0800 Subject: [PATCH] reduce calls to isPointOnDesktopWindow --- .../controllerModules/farActionGrabEntity.js | 25 +++++++++++-------- .../controllerModules/hudOverlayPointer.js | 2 +- 2 files changed, 15 insertions(+), 12 deletions(-) diff --git a/scripts/system/controllers/controllerModules/farActionGrabEntity.js b/scripts/system/controllers/controllerModules/farActionGrabEntity.js index 88195d7024..32bf7316a9 100644 --- a/scripts/system/controllers/controllerModules/farActionGrabEntity.js +++ b/scripts/system/controllers/controllerModules/farActionGrabEntity.js @@ -370,20 +370,23 @@ Script.include("/~/system/libraries/Xform.js"); }; this.isReady = function (controllerData) { - if (this.notPointingAtEntity(controllerData)) { - return makeRunningValues(false, [], []); - } + if (HMD.active) { + if (this.notPointingAtEntity(controllerData)) { + return makeRunningValues(false, [], []); + } - this.distanceHolding = false; - this.distanceRotating = false; + this.distanceHolding = false; + this.distanceRotating = false; - if (controllerData.triggerValues[this.hand] > TRIGGER_ON_VALUE) { - this.prepareDistanceRotatingData(controllerData); - return makeRunningValues(true, [], []); - } else { - this.destroyContextOverlay(); - return makeRunningValues(false, [], []); + if (controllerData.triggerValues[this.hand] > TRIGGER_ON_VALUE) { + this.prepareDistanceRotatingData(controllerData); + return makeRunningValues(true, [], []); + } else { + this.destroyContextOverlay(); + return makeRunningValues(false, [], []); + } } + return makeRunningValues(false, [], []); }; this.run = function (controllerData) { diff --git a/scripts/system/controllers/controllerModules/hudOverlayPointer.js b/scripts/system/controllers/controllerModules/hudOverlayPointer.js index a7a186b07a..afc9256875 100644 --- a/scripts/system/controllers/controllerModules/hudOverlayPointer.js +++ b/scripts/system/controllers/controllerModules/hudOverlayPointer.js @@ -89,7 +89,7 @@ this.isReady = function (controllerData) { var otherModuleRunning = this.getOtherModule().running; - if (!otherModuleRunning) { + if (!otherModuleRunning && HMD.active) { if (this.processLaser(controllerData)) { this.running = true; return ControllerDispatcherUtils.makeRunningValues(true, [], []);