mirror of
https://github.com/overte-org/overte.git
synced 2025-08-09 23:40:11 +02:00
FB17381 - Reticle.setVisible isn't working
This commit is contained in:
parent
5729d35c48
commit
dcf20d2a15
1 changed files with 4 additions and 1 deletions
|
@ -29,6 +29,7 @@
|
||||||
|
|
||||||
function MouseHMD() {
|
function MouseHMD() {
|
||||||
var _this = this;
|
var _this = this;
|
||||||
|
this.hmdWasActive = HMD.active;
|
||||||
this.mouseMoved = false;
|
this.mouseMoved = false;
|
||||||
this.mouseActivity = new TimeLock(5000);
|
this.mouseActivity = new TimeLock(5000);
|
||||||
this.handControllerActivity = new TimeLock(4000);
|
this.handControllerActivity = new TimeLock(4000);
|
||||||
|
@ -102,6 +103,8 @@
|
||||||
|
|
||||||
this.isReady = function(controllerData, deltaTime) {
|
this.isReady = function(controllerData, deltaTime) {
|
||||||
var now = Date.now();
|
var now = Date.now();
|
||||||
|
var hmdChanged = this.hmdWasActive !== HMD.active;
|
||||||
|
this.hmdWasActive = HMD.active;
|
||||||
this.triggersPressed(controllerData, now);
|
this.triggersPressed(controllerData, now);
|
||||||
if (HMD.active) {
|
if (HMD.active) {
|
||||||
if (!this.mouseActivity.expired(now) && _this.handControllerActivity.expired()) {
|
if (!this.mouseActivity.expired(now) && _this.handControllerActivity.expired()) {
|
||||||
|
@ -110,7 +113,7 @@
|
||||||
} else {
|
} else {
|
||||||
Reticle.visible = false;
|
Reticle.visible = false;
|
||||||
}
|
}
|
||||||
} else if (!Reticle.visible) {
|
} else if (hmdChanged && !Reticle.visible) {
|
||||||
Reticle.visible = true;
|
Reticle.visible = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue