Showing the changes to scripts/system/controllers/controllerModules (2 of 2 files). Show all
Unified · Split
| @@ -26,6 +26,7 @@ · 25 unmodified lines | ||
| 26 | 26 | var HUD_LASER_OFFSET = 2; |
| 27 | 27 | function HudOverlayPointer(hand) { |
| 28 | 28 | this.hand = hand; |
| 29 | + this.running = false; | |
| 29 | 30 | this.reticleMinX = MARGIN; |
| 30 | 31 | this.reticleMaxX; |
| 31 | 32 | this.reticleMinY = MARGIN; |
| @@ -64,8 +65,13 @@ · 32 unmodified lines | ||
| 64 | 65 | return (rayPick.objectID === HMD.tabletScreenID || rayPick.objectID === HMD.homeButtonID); |
| 65 | 66 | }; |
| 66 | 67 | |
| 68 | + this.getOtherModule = function() { | |
| 69 | + return this.hand === RIGHT_HAND ? leftHudOverlayPointer : rightHudOverlayPointer; | |
| 70 | + }; | |
| 71 | + | |
| 67 | 72 | this.processLaser = function(controllerData) { |
| 68 | 73 | var controllerLocation = controllerData.controllerLocations[this.hand]; |
| 74 | + var otherModuleRunning = this.getOtherModule().running; | |
| 69 | 75 | if ((controllerData.triggerValues[this.hand] < ControllerDispatcherUtils.TRIGGER_ON_VALUE || !controllerLocation.valid) || |
| 70 | 76 | this.pointingAtTablet(controllerData)) { |
| 71 | 77 | return false; |
| @@ -81,11 +87,17 @@ · 9 unmodified lines | ||
| 81 | 87 | }; |
| 82 | 88 | |
| 83 | 89 | 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 | + } | |
| 88 | 99 | } |
| 100 | + return ControllerDispatcherUtils.makeRunningValues(false, [], []); | |
| 89 | 101 | }; |
| 90 | 102 | |
| 91 | 103 | this.run = function (controllerData, deltaTime) { |
| @@ -20,7 +20,7 @@ Script.include("/~/system/libraries/controllers.js"); · 19 unmodified lines | ||
| 20 | 20 | var stylusTargetIDs = []; |
| 21 | 21 | for (var index = 0; index < stylusTargets.length; index++) { |
| 22 | 22 | var stylusTarget = stylusTargets[index]; |
| 23 | − if (stylusTarget.distance <= maxNormalDistance) { | |
| 23 | + if (stylusTarget.distance <= maxNormalDistance && stylusTarget.id !== HMD.tabletID) { | |
| 24 | 24 | stylusTargetIDs.push(stylusTarget.id); |
| 25 | 25 | } |
| 26 | 26 | } |