History

Merge branch 'master' of github.com:highfidelity/hifi into stt_parenting2

sabrina-shanman committed 8 years ago

Commit 67dc5262 parents b988382 0ef407a205 files · +4536 −1014Browse files

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

Unified · Split

10 files
  1. scripts/system/controllers/controllerModules/highlightNearbyEntities.js +1 −1
  2. scripts/system/controllers/controllerModules/inEditMode.js +15 −14
  3. scripts/system/controllers/controllerModules/inVREditMode.js +1 −1
  4. scripts/system/controllers/controllerModules/nearActionGrabEntity.js +1 −1
  5. scripts/system/controllers/controllerModules/nearGrabHyperLinkEntity.js +1 −1
  6. scripts/system/controllers/controllerModules/nearParentGrabEntity.js +1 −1
  7. scripts/system/controllers/controllerModules/nearParentGrabOverlay.js +4 −1
  8. scripts/system/controllers/controllerModules/nearTrigger.js +1 −1
  9. scripts/system/controllers/controllerModules/stylusInput.js +8 −7
  10. scripts/system/controllers/controllerModules/webSurfaceLaserInput.js +1 −1
scripts/system/controllers/controllerModules/highlightNearbyEntities.js+1−1
@@ -37,7 +37,7 @@ · 36 unmodified lines
3737 this.highlightedEntities = [];
3838
3939 this.parameters = dispatcherUtils.makeDispatcherModuleParameters(
40− 120,
40+ 480,
4141 this.hand === dispatcherUtils.RIGHT_HAND ? ["rightHand"] : ["leftHand"],
4242 [],
4343 100);
scripts/system/controllers/controllerModules/inEditMode.js+15−14
@@ -29,7 +29,7 @@ Script.include("/~/system/libraries/utils.js"); · 28 unmodified lines
2929 this.reticleMaxY;
3030
3131 this.parameters = makeDispatcherModuleParameters(
32− 200,
32+ 160,
3333 this.hand === RIGHT_HAND ? ["rightHand", "rightHandEquip", "rightHandTrigger"] : ["leftHand", "leftHandEquip", "leftHandTrigger"],
3434 [],
3535 100,
@@ -73,21 +73,22 @@ Script.include("/~/system/libraries/utils.js"); · 37 unmodified lines
7373 method: "clearSelection",
7474 hand: hand
7575 }));
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+ }
7690 }
7791 }
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− }
9192
9293 this.triggerClicked = true;
9394 }
scripts/system/controllers/controllerModules/inVREditMode.js+1−1
@@ -21,7 +21,7 @@ Script.include("/~/system/libraries/controllerDispatcherUtils.js"); · 20 unmodified lines
2121 this.disableModules = false;
2222 var NO_HAND_LASER = -1; // Invalid hand parameter so that default laser is not displayed.
2323 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.
2525 this.hand === RIGHT_HAND
2626 ? ["rightHand", "rightHandEquip", "rightHandTrigger"]
2727 : ["leftHand", "leftHandEquip", "leftHandTrigger"],
scripts/system/controllers/controllerModules/nearActionGrabEntity.js+1−1
@@ -26,7 +26,7 @@ Script.include("/~/system/libraries/cloneEntityUtils.js"); · 25 unmodified lines
2626 this.hapticTargetID = null;
2727
2828 this.parameters = makeDispatcherModuleParameters(
29− 140,
29+ 500,
3030 this.hand === RIGHT_HAND ? ["rightHand"] : ["leftHand"],
3131 [],
3232 100);
scripts/system/controllers/controllerModules/nearGrabHyperLinkEntity.js+1−1
@@ -21,7 +21,7 @@ · 20 unmodified lines
2121 this.hyperlink = "";
2222
2323 this.parameters = makeDispatcherModuleParameters(
24− 125,
24+ 485,
2525 this.hand === RIGHT_HAND ? ["rightHand"] : ["leftHand"],
2626 [],
2727 100);
scripts/system/controllers/controllerModules/nearParentGrabEntity.js+1−1
@@ -57,7 +57,7 @@ Script.include("/~/system/libraries/controllers.js"); · 56 unmodified lines
5757 this.cloneAllowed = true;
5858
5959 this.parameters = makeDispatcherModuleParameters(
60− 140,
60+ 500,
6161 this.hand === RIGHT_HAND ? ["rightHand"] : ["leftHand"],
6262 [],
6363 100);
scripts/system/controllers/controllerModules/nearParentGrabOverlay.js+4−1
@@ -163,7 +163,10 @@ Script.include("/~/system/libraries/utils.js"); · 162 unmodified lines
163163 var handPosition = controllerData.controllerLocations[this.hand].position;
164164 var distance = Vec3.distance(overlayPosition, handPosition);
165165 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+ }
167170 }
168171 }
169172 return null;
scripts/system/controllers/controllerModules/nearTrigger.js+1−1
@@ -29,7 +29,7 @@ Script.include("/~/system/libraries/controllerDispatcherUtils.js"); · 28 unmodified lines
2929 this.startSent = false;
3030
3131 this.parameters = makeDispatcherModuleParameters(
32− 120,
32+ 480,
3333 this.hand === RIGHT_HAND ? ["rightHandTrigger", "rightHand"] : ["leftHandTrigger", "leftHand"],
3434 [],
3535 100);
scripts/system/controllers/controllerModules/stylusInput.js+8−7
@@ -35,13 +35,6 @@ Script.include("/~/system/libraries/controllers.js"); · 34 unmodified lines
3535 };
3636 }
3737
38− function getEntityDistance(controllerPosition, entityProps) {
39− return {
40− id: entityProps.id,
41− distance: Vec3.distance(entityProps.position, controllerPosition)
42− };
43− }
44−
4538 function StylusInput(hand) {
4639 this.hand = hand;
4740
@@ -123,6 +116,14 @@ Script.include("/~/system/libraries/controllers.js"); · 75 unmodified lines
123116 }
124117 }
125118
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+
126127 var WEB_DISPLAY_STYLUS_DISTANCE = 0.5;
127128 var nearStylusTarget = isNearStylusTarget(stylusTargets, WEB_DISPLAY_STYLUS_DISTANCE * sensorScaleFactor);
128129
scripts/system/controllers/controllerModules/webSurfaceLaserInput.js+1−1
@@ -121,7 +121,7 @@ Script.include("/~/system/libraries/controllers.js"); · 120 unmodified lines
121121 controllerData.triggerValues[this.otherHand] <= TRIGGER_OFF_VALUE;
122122 var allowThisModule = !otherModuleRunning || isTriggerPressed;
123123
124− if (allowThisModule && this.isPointingAtTriggerable(controllerData, isTriggerPressed, false)) {
124+ if ((allowThisModule && this.isPointingAtTriggerable(controllerData, isTriggerPressed, false)) && !this.grabModuleWantsNearbyOverlay(controllerData)) {
125125 this.updateAllwaysOn();
126126 if (isTriggerPressed) {
127127 this.dominantHandOverride = true; // Override dominant hand.

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