History

fixing some issues with hud module

Dante Ruiz committed 9 years ago

Commit 7613bdd1 parent 56823f82 files · +17 −5Browse files

Showing the changes to scripts/system/controllers/controllerModules (2 of 2 files). Show all

Unified · Split

2 files
  1. scripts/system/controllers/controllerModules/hudOverlayPointer.js +16 −4
  2. scripts/system/controllers/controllerModules/tabletStylusInput.js +1 −1
scripts/system/controllers/controllerModules/hudOverlayPointer.js+16−4
@@ -26,6 +26,7 @@ · 25 unmodified lines
2626 var HUD_LASER_OFFSET = 2;
2727 function HudOverlayPointer(hand) {
2828 this.hand = hand;
29+ this.running = false;
2930 this.reticleMinX = MARGIN;
3031 this.reticleMaxX;
3132 this.reticleMinY = MARGIN;
@@ -64,8 +65,13 @@ · 32 unmodified lines
6465 return (rayPick.objectID === HMD.tabletScreenID || rayPick.objectID === HMD.homeButtonID);
6566 };
6667
68+ this.getOtherModule = function() {
69+ return this.hand === RIGHT_HAND ? leftHudOverlayPointer : rightHudOverlayPointer;
70+ };
71+
6772 this.processLaser = function(controllerData) {
6873 var controllerLocation = controllerData.controllerLocations[this.hand];
74+ var otherModuleRunning = this.getOtherModule().running;
6975 if ((controllerData.triggerValues[this.hand] < ControllerDispatcherUtils.TRIGGER_ON_VALUE || !controllerLocation.valid) ||
7076 this.pointingAtTablet(controllerData)) {
7177 return false;
@@ -81,11 +87,17 @@ · 9 unmodified lines
8187 };
8288
8389 this.isReady = function (controllerData) {
84− if (this.processLaser(controllerData)) {
85− return ControllerDispatcherUtils.makeRunningValues(true, [], []);
86− } else {
87− return ControllerDispatcherUtils.makeRunningValues(false, [], []);
90+ var otherModuleRunning = this.getOtherModule().running;
91+ if (!otherModuleRunning) {
92+ if (this.processLaser(controllerData)) {
93+ this.running = true;
94+ return ControllerDispatcherUtils.makeRunningValues(true, [], []);
95+ } else {
96+ this.running = false;
97+ return ControllerDispatcherUtils.makeRunningValues(false, [], []);
98+ }
8899 }
100+ return ControllerDispatcherUtils.makeRunningValues(false, [], []);
89101 };
90102
91103 this.run = function (controllerData, deltaTime) {
scripts/system/controllers/controllerModules/tabletStylusInput.js+1−1
@@ -20,7 +20,7 @@ Script.include("/~/system/libraries/controllers.js"); · 19 unmodified lines
2020 var stylusTargetIDs = [];
2121 for (var index = 0; index < stylusTargets.length; index++) {
2222 var stylusTarget = stylusTargets[index];
23− if (stylusTarget.distance <= maxNormalDistance) {
23+ if (stylusTarget.distance <= maxNormalDistance && stylusTarget.id !== HMD.tabletID) {
2424 stylusTargetIDs.push(stylusTarget.id);
2525 }
2626 }

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t