Merge pull request #14280 from ElderOrb/FB17381

FB17381 - Reticle.setVisible isn't working
This commit is contained in:
John Conklin II 2018-11-20 09:53:52 -08:00 committed by GitHub
commit 87cac67c75
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -29,6 +29,7 @@
function MouseHMD() {
var _this = this;
this.hmdWasActive = HMD.active;
this.mouseMoved = false;
this.mouseActivity = new TimeLock(5000);
this.handControllerActivity = new TimeLock(4000);
@ -102,6 +103,8 @@
this.isReady = function(controllerData, deltaTime) {
var now = Date.now();
var hmdChanged = this.hmdWasActive !== HMD.active;
this.hmdWasActive = HMD.active;
this.triggersPressed(controllerData, now);
if (HMD.active) {
if (!this.mouseActivity.expired(now) && _this.handControllerActivity.expired()) {
@ -110,7 +113,7 @@
} else {
Reticle.visible = false;
}
} else if (!Reticle.visible) {
} else if (hmdChanged && !Reticle.visible) {
Reticle.visible = true;
}