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