mirror of
https://github.com/overte-org/overte.git
synced 2025-04-20 03:44:02 +02:00
fixing some issues with hud module
This commit is contained in:
parent
56823f8a72
commit
7613bddefa
2 changed files with 17 additions and 5 deletions
|
@ -26,6 +26,7 @@
|
|||
var HUD_LASER_OFFSET = 2;
|
||||
function HudOverlayPointer(hand) {
|
||||
this.hand = hand;
|
||||
this.running = false;
|
||||
this.reticleMinX = MARGIN;
|
||||
this.reticleMaxX;
|
||||
this.reticleMinY = MARGIN;
|
||||
|
@ -64,8 +65,13 @@
|
|||
return (rayPick.objectID === HMD.tabletScreenID || rayPick.objectID === HMD.homeButtonID);
|
||||
};
|
||||
|
||||
this.getOtherModule = function() {
|
||||
return this.hand === RIGHT_HAND ? leftHudOverlayPointer : rightHudOverlayPointer;
|
||||
};
|
||||
|
||||
this.processLaser = function(controllerData) {
|
||||
var controllerLocation = controllerData.controllerLocations[this.hand];
|
||||
var otherModuleRunning = this.getOtherModule().running;
|
||||
if ((controllerData.triggerValues[this.hand] < ControllerDispatcherUtils.TRIGGER_ON_VALUE || !controllerLocation.valid) ||
|
||||
this.pointingAtTablet(controllerData)) {
|
||||
return false;
|
||||
|
@ -81,11 +87,17 @@
|
|||
};
|
||||
|
||||
this.isReady = function (controllerData) {
|
||||
if (this.processLaser(controllerData)) {
|
||||
return ControllerDispatcherUtils.makeRunningValues(true, [], []);
|
||||
} else {
|
||||
return ControllerDispatcherUtils.makeRunningValues(false, [], []);
|
||||
var otherModuleRunning = this.getOtherModule().running;
|
||||
if (!otherModuleRunning) {
|
||||
if (this.processLaser(controllerData)) {
|
||||
this.running = true;
|
||||
return ControllerDispatcherUtils.makeRunningValues(true, [], []);
|
||||
} else {
|
||||
this.running = false;
|
||||
return ControllerDispatcherUtils.makeRunningValues(false, [], []);
|
||||
}
|
||||
}
|
||||
return ControllerDispatcherUtils.makeRunningValues(false, [], []);
|
||||
};
|
||||
|
||||
this.run = function (controllerData, deltaTime) {
|
||||
|
|
|
@ -20,7 +20,7 @@ Script.include("/~/system/libraries/controllers.js");
|
|||
var stylusTargetIDs = [];
|
||||
for (var index = 0; index < stylusTargets.length; index++) {
|
||||
var stylusTarget = stylusTargets[index];
|
||||
if (stylusTarget.distance <= maxNormalDistance) {
|
||||
if (stylusTarget.distance <= maxNormalDistance && stylusTarget.id !== HMD.tabletID) {
|
||||
stylusTargetIDs.push(stylusTarget.id);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue