Merge pull request #12206 from druiz17/fix-reduce-calls-isPointOnDesktopWindow

reduce calls to isPointOnDesktopWindow in controllerModules
This commit is contained in:
Ryan Downe Karpf 2018-01-19 10:44:57 -08:00 committed by GitHub
commit 08b4c6eb40
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
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) { this.isReady = function (controllerData) {
if (this.notPointingAtEntity(controllerData)) { if (HMD.active) {
return makeRunningValues(false, [], []); if (this.notPointingAtEntity(controllerData)) {
} return makeRunningValues(false, [], []);
}
this.distanceHolding = false; this.distanceHolding = false;
this.distanceRotating = false; this.distanceRotating = false;
if (controllerData.triggerValues[this.hand] > TRIGGER_ON_VALUE) { if (controllerData.triggerValues[this.hand] > TRIGGER_ON_VALUE) {
this.prepareDistanceRotatingData(controllerData); this.prepareDistanceRotatingData(controllerData);
return makeRunningValues(true, [], []); return makeRunningValues(true, [], []);
} else { } else {
this.destroyContextOverlay(); this.destroyContextOverlay();
return makeRunningValues(false, [], []); return makeRunningValues(false, [], []);
}
} }
return makeRunningValues(false, [], []);
}; };
this.run = function (controllerData) { this.run = function (controllerData) {

View file

@ -89,7 +89,7 @@
this.isReady = function (controllerData) { this.isReady = function (controllerData) {
var otherModuleRunning = this.getOtherModule().running; var otherModuleRunning = this.getOtherModule().running;
if (!otherModuleRunning) { if (!otherModuleRunning && HMD.active) {
if (this.processLaser(controllerData)) { if (this.processLaser(controllerData)) {
this.running = true; this.running = true;
return ControllerDispatcherUtils.makeRunningValues(true, [], []); return ControllerDispatcherUtils.makeRunningValues(true, [], []);