reduce calls to isPointOnDesktopWindow

This commit is contained in:
Dante Ruiz 2018-01-18 10:48:35 -08:00
parent dd436229c1
commit d88ff701b5
2 changed files with 15 additions and 12 deletions

View file

@ -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) {

View file

@ -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, [], []);