Showing the changes to scripts/system/controllers/controllerModules (10 of 205 files). Show all
Unified · Split
| @@ -37,7 +37,7 @@ · 36 unmodified lines | ||
| 37 | 37 | this.highlightedEntities = []; |
| 38 | 38 | |
| 39 | 39 | this.parameters = dispatcherUtils.makeDispatcherModuleParameters( |
| 40 | − 120, | |
| 40 | + 480, | |
| 41 | 41 | this.hand === dispatcherUtils.RIGHT_HAND ? ["rightHand"] : ["leftHand"], |
| 42 | 42 | [], |
| 43 | 43 | 100); |
| @@ -29,7 +29,7 @@ Script.include("/~/system/libraries/utils.js"); · 28 unmodified lines | ||
| 29 | 29 | this.reticleMaxY; |
| 30 | 30 | |
| 31 | 31 | this.parameters = makeDispatcherModuleParameters( |
| 32 | − 200, | |
| 32 | + 160, | |
| 33 | 33 | this.hand === RIGHT_HAND ? ["rightHand", "rightHandEquip", "rightHandTrigger"] : ["leftHand", "leftHandEquip", "leftHandTrigger"], |
| 34 | 34 | [], |
| 35 | 35 | 100, |
| @@ -73,21 +73,22 @@ Script.include("/~/system/libraries/utils.js"); · 37 unmodified lines | ||
| 73 | 73 | method: "clearSelection", |
| 74 | 74 | hand: hand |
| 75 | 75 | })); |
| 76 | + } else { | |
| 77 | + if (this.selectedTarget.type === Picks.INTERSECTED_ENTITY) { | |
| 78 | + Messages.sendLocalMessage("entityToolUpdates", JSON.stringify({ | |
| 79 | + method: "selectEntity", | |
| 80 | + entityID: this.selectedTarget.objectID, | |
| 81 | + hand: hand | |
| 82 | + })); | |
| 83 | + } else if (this.selectedTarget.type === Picks.INTERSECTED_OVERLAY) { | |
| 84 | + Messages.sendLocalMessage("entityToolUpdates", JSON.stringify({ | |
| 85 | + method: "selectOverlay", | |
| 86 | + overlayID: this.selectedTarget.objectID, | |
| 87 | + hand: hand | |
| 88 | + })); | |
| 89 | + } | |
| 76 | 90 | } |
| 77 | 91 | } |
| 78 | − if (this.selectedTarget.type === Picks.INTERSECTED_ENTITY) { | |
| 79 | − Messages.sendLocalMessage("entityToolUpdates", JSON.stringify({ | |
| 80 | − method: "selectEntity", | |
| 81 | − entityID: this.selectedTarget.objectID, | |
| 82 | − hand: hand | |
| 83 | − })); | |
| 84 | − } else if (this.selectedTarget.type === Picks.INTERSECTED_OVERLAY) { | |
| 85 | − Messages.sendLocalMessage("entityToolUpdates", JSON.stringify({ | |
| 86 | − method: "selectOverlay", | |
| 87 | − overlayID: this.selectedTarget.objectID, | |
| 88 | − hand: hand | |
| 89 | − })); | |
| 90 | − } | |
| 91 | 92 | |
| 92 | 93 | this.triggerClicked = true; |
| 93 | 94 | } |
| @@ -21,7 +21,7 @@ Script.include("/~/system/libraries/controllerDispatcherUtils.js"); · 20 unmodified lines | ||
| 21 | 21 | this.disableModules = false; |
| 22 | 22 | var NO_HAND_LASER = -1; // Invalid hand parameter so that default laser is not displayed. |
| 23 | 23 | this.parameters = makeDispatcherModuleParameters( |
| 24 | − 240, // Not too high otherwise the tablet laser doesn't work. | |
| 24 | + 200, // Not too high otherwise the tablet laser doesn't work. | |
| 25 | 25 | this.hand === RIGHT_HAND |
| 26 | 26 | ? ["rightHand", "rightHandEquip", "rightHandTrigger"] |
| 27 | 27 | : ["leftHand", "leftHandEquip", "leftHandTrigger"], |
| @@ -26,7 +26,7 @@ Script.include("/~/system/libraries/cloneEntityUtils.js"); · 25 unmodified lines | ||
| 26 | 26 | this.hapticTargetID = null; |
| 27 | 27 | |
| 28 | 28 | this.parameters = makeDispatcherModuleParameters( |
| 29 | − 140, | |
| 29 | + 500, | |
| 30 | 30 | this.hand === RIGHT_HAND ? ["rightHand"] : ["leftHand"], |
| 31 | 31 | [], |
| 32 | 32 | 100); |
| @@ -21,7 +21,7 @@ · 20 unmodified lines | ||
| 21 | 21 | this.hyperlink = ""; |
| 22 | 22 | |
| 23 | 23 | this.parameters = makeDispatcherModuleParameters( |
| 24 | − 125, | |
| 24 | + 485, | |
| 25 | 25 | this.hand === RIGHT_HAND ? ["rightHand"] : ["leftHand"], |
| 26 | 26 | [], |
| 27 | 27 | 100); |
| @@ -57,7 +57,7 @@ Script.include("/~/system/libraries/controllers.js"); · 56 unmodified lines | ||
| 57 | 57 | this.cloneAllowed = true; |
| 58 | 58 | |
| 59 | 59 | this.parameters = makeDispatcherModuleParameters( |
| 60 | − 140, | |
| 60 | + 500, | |
| 61 | 61 | this.hand === RIGHT_HAND ? ["rightHand"] : ["leftHand"], |
| 62 | 62 | [], |
| 63 | 63 | 100); |
| @@ -163,7 +163,10 @@ Script.include("/~/system/libraries/utils.js"); · 162 unmodified lines | ||
| 163 | 163 | var handPosition = controllerData.controllerLocations[this.hand].position; |
| 164 | 164 | var distance = Vec3.distance(overlayPosition, handPosition); |
| 165 | 165 | if (distance <= NEAR_GRAB_RADIUS * sensorScaleFactor) { |
| 166 | − return overlays[i]; | |
| 166 | + if (overlays[i] !== HMD.miniTabletID || controllerData.secondaryValues[this.hand] === 0) { | |
| 167 | + // Don't grab mini tablet with grip. | |
| 168 | + return overlays[i]; | |
| 169 | + } | |
| 167 | 170 | } |
| 168 | 171 | } |
| 169 | 172 | return null; |
| @@ -29,7 +29,7 @@ Script.include("/~/system/libraries/controllerDispatcherUtils.js"); · 28 unmodified lines | ||
| 29 | 29 | this.startSent = false; |
| 30 | 30 | |
| 31 | 31 | this.parameters = makeDispatcherModuleParameters( |
| 32 | − 120, | |
| 32 | + 480, | |
| 33 | 33 | this.hand === RIGHT_HAND ? ["rightHandTrigger", "rightHand"] : ["leftHandTrigger", "leftHand"], |
| 34 | 34 | [], |
| 35 | 35 | 100); |
| @@ -35,13 +35,6 @@ Script.include("/~/system/libraries/controllers.js"); · 34 unmodified lines | ||
| 35 | 35 | }; |
| 36 | 36 | } |
| 37 | 37 | |
| 38 | − function getEntityDistance(controllerPosition, entityProps) { | |
| 39 | − return { | |
| 40 | − id: entityProps.id, | |
| 41 | − distance: Vec3.distance(entityProps.position, controllerPosition) | |
| 42 | − }; | |
| 43 | − } | |
| 44 | − | |
| 45 | 38 | function StylusInput(hand) { |
| 46 | 39 | this.hand = hand; |
| 47 | 40 | |
| @@ -123,6 +116,14 @@ Script.include("/~/system/libraries/controllers.js"); · 75 unmodified lines | ||
| 123 | 116 | } |
| 124 | 117 | } |
| 125 | 118 | |
| 119 | + // Add the mini tablet. | |
| 120 | + if (HMD.miniTabletScreenID && Overlays.getProperty(HMD.miniTabletScreenID, "visible")) { | |
| 121 | + stylusTarget = getOverlayDistance(controllerPosition, HMD.miniTabletScreenID); | |
| 122 | + if (stylusTarget) { | |
| 123 | + stylusTargets.push(stylusTarget); | |
| 124 | + } | |
| 125 | + } | |
| 126 | + | |
| 126 | 127 | var WEB_DISPLAY_STYLUS_DISTANCE = 0.5; |
| 127 | 128 | var nearStylusTarget = isNearStylusTarget(stylusTargets, WEB_DISPLAY_STYLUS_DISTANCE * sensorScaleFactor); |
| 128 | 129 | |
| @@ -121,7 +121,7 @@ Script.include("/~/system/libraries/controllers.js"); · 120 unmodified lines | ||
| 121 | 121 | controllerData.triggerValues[this.otherHand] <= TRIGGER_OFF_VALUE; |
| 122 | 122 | var allowThisModule = !otherModuleRunning || isTriggerPressed; |
| 123 | 123 | |
| 124 | − if (allowThisModule && this.isPointingAtTriggerable(controllerData, isTriggerPressed, false)) { | |
| 124 | + if ((allowThisModule && this.isPointingAtTriggerable(controllerData, isTriggerPressed, false)) && !this.grabModuleWantsNearbyOverlay(controllerData)) { | |
| 125 | 125 | this.updateAllwaysOn(); |
| 126 | 126 | if (isTriggerPressed) { |
| 127 | 127 | this.dominantHandOverride = true; // Override dominant hand. |