History

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

David Back committed 8 years ago

Commit f8fc7be2 parents f74e219 aca261a70 files · +1605 −927Browse files

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

Unified · Split

6 files
  1. scripts/system/controllers/controllerModules/equipEntity.js +7 −7
  2. scripts/system/controllers/controllerModules/nearActionGrabEntity.js +1 −1
  3. scripts/system/controllers/controllerModules/nearGrabHyperLinkEntity.js +2 −6
  4. scripts/system/controllers/controllerModules/nearParentGrabEntity.js +3 −10
  5. scripts/system/controllers/controllerModules/nearParentGrabOverlay.js +1 −2
  6. scripts/system/controllers/controllerModules/teleport.js +1 −1
scripts/system/controllers/controllerModules/equipEntity.js+7−7
@@ -6,11 +6,11 @@ · 5 unmodified lines
66 // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
77
88
9−/* global Script, Entities, MyAvatar, Controller, RIGHT_HAND, LEFT_HAND,
10− getControllerJointIndex, enableDispatcherModule, disableDispatcherModule,
9+/* global Script, Entities, MyAvatar, Controller, RIGHT_HAND, LEFT_HAND, Camera,
10+ getControllerJointIndex, enableDispatcherModule, disableDispatcherModule, entityIsFarGrabbedByOther,
1111 Messages, makeDispatcherModuleParameters, makeRunningValues, Settings, entityHasActions,
1212 Vec3, Overlays, flatten, Xform, getControllerWorldLocation, ensureDynamic, entityIsCloneable,
13− cloneEntity, DISPATCHER_PROPERTIES, TEAR_AWAY_DISTANCE, Uuid, unhighlightTargetEntity
13+ cloneEntity, DISPATCHER_PROPERTIES, Uuid, unhighlightTargetEntity, isInEditMode
1414 */
1515
1616 Script.include("/~/system/libraries/Xform.js");
@@ -780,7 +780,7 @@ EquipHotspotBuddy.prototype.update = function(deltaTime, timestamp, controllerDa · 763 unmodified lines
780780 }
781781 }
782782 };
783−
783+
784784 var clearGrabActions = function(entityID) {
785785 var actionIDs = Entities.getActionIDs(entityID);
786786 var myGrabTag = "grab-" + MyAvatar.sessionUUID;
@@ -793,7 +793,7 @@ EquipHotspotBuddy.prototype.update = function(deltaTime, timestamp, controllerDa · 6 unmodified lines
793793 }
794794 }
795795 };
796−
796+
797797 var onMousePress = function(event) {
798798 if (isInEditMode() || !event.isLeftButton) { // don't consider any left clicks on the entity while in edit
799799 return;
@@ -807,7 +807,7 @@ EquipHotspotBuddy.prototype.update = function(deltaTime, timestamp, controllerDa · 7 unmodified lines
807807 if (hasEquipData && entityProperties.parentID === EMPTY_PARENT_ID && !entityIsFarGrabbedByOther(entityID)) {
808808 entityProperties.id = entityID;
809809 var rightHandPosition = MyAvatar.getJointPosition("RightHand");
810− var leftHandPosition = MyAvatar.getJointPosition("LeftHand");
810+ var leftHandPosition = MyAvatar.getJointPosition("LeftHand");
811811 var distanceToRightHand = Vec3.distance(entityProperties.position, rightHandPosition);
812812 var distanceToLeftHand = Vec3.distance(entityProperties.position, leftHandPosition);
813813 var leftHandAvailable = leftEquipEntity.targetEntityID === null;
@@ -827,7 +827,7 @@ EquipHotspotBuddy.prototype.update = function(deltaTime, timestamp, controllerDa · 13 unmodified lines
827827 };
828828
829829 var onKeyPress = function(event) {
830− if (event.text === UNEQUIP_KEY) {
830+ if (event.text.toLowerCase() === UNEQUIP_KEY) {
831831 if (rightEquipEntity.targetEntityID) {
832832 rightEquipEntity.endEquipEntity();
833833 }
scripts/system/controllers/controllerModules/nearActionGrabEntity.js+1−1
@@ -10,7 +10,7 @@ · 9 unmodified lines
1010 propsArePhysical, Messages, HAPTIC_PULSE_STRENGTH, HAPTIC_PULSE_DURATION, entityIsGrabbable,
1111 Quat, Vec3, MSECS_PER_SEC, getControllerWorldLocation, makeDispatcherModuleParameters, makeRunningValues,
1212 TRIGGER_OFF_VALUE, NEAR_GRAB_RADIUS, findGroupParent, entityIsCloneable, propsAreCloneDynamic, cloneEntity,
13− HAPTIC_PULSE_STRENGTH, HAPTIC_PULSE_DURATION, BUMPER_ON_VALUE, unhighlightTargetEntity
13+ HAPTIC_PULSE_STRENGTH, HAPTIC_PULSE_DURATION, BUMPER_ON_VALUE, unhighlightTargetEntity, Uuid
1414 */
1515
1616 Script.include("/~/system/libraries/controllerDispatcherUtils.js");
scripts/system/controllers/controllerModules/nearGrabHyperLinkEntity.js+2−6
@@ -7,12 +7,8 @@ · 6 unmodified lines
77 // Distributed under the Apache License, Version 2.0.
88 // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
99
10−/* global Script, Entities, MyAvatar, Controller, RIGHT_HAND, LEFT_HAND,
11− getControllerJointIndex, getGrabbableData, enableDispatcherModule, disableDispatcherModule,
12− propsArePhysical, Messages, HAPTIC_PULSE_STRENGTH, HAPTIC_PULSE_DURATION, entityIsGrabbable,
13− Quat, Vec3, MSECS_PER_SEC, getControllerWorldLocation, makeDispatcherModuleParameters, makeRunningValues,
14− TRIGGER_OFF_VALUE, NEAR_GRAB_RADIUS, findGroupParent, entityIsCloneable, propsAreCloneDynamic, cloneEntity,
15− HAPTIC_PULSE_STRENGTH, HAPTIC_PULSE_DURATION, BUMPER_ON_VALUE, AddressManager
10+/* global Script, MyAvatar, RIGHT_HAND, LEFT_HAND, enableDispatcherModule, disableDispatcherModule,
11+ makeDispatcherModuleParameters, makeRunningValues, TRIGGER_OFF_VALUE, NEAR_GRAB_RADIUS, BUMPER_ON_VALUE, AddressManager
1612 */
1713
1814 (function() {
scripts/system/controllers/controllerModules/nearParentGrabEntity.js+3−10
@@ -11,8 +11,7 @@ · 10 unmodified lines
1111 TRIGGER_OFF_VALUE, makeDispatcherModuleParameters, entityIsGrabbable, makeRunningValues, NEAR_GRAB_RADIUS,
1212 findGroupParent, Vec3, cloneEntity, entityIsCloneable, propsAreCloneDynamic, HAPTIC_PULSE_STRENGTH,
1313 HAPTIC_PULSE_DURATION, BUMPER_ON_VALUE, findHandChildEntities, TEAR_AWAY_DISTANCE, MSECS_PER_SEC, TEAR_AWAY_CHECK_TIME,
14− TEAR_AWAY_COUNT, distanceBetweenPointAndEntityBoundingBox, print, Selection, DISPATCHER_HOVERING_LIST, Uuid,
15− highlightTargetEntity, unhighlightTargetEntity
14+ TEAR_AWAY_COUNT, distanceBetweenPointAndEntityBoundingBox, print, Uuid, highlightTargetEntity, unhighlightTargetEntity
1615 */
1716
1817 Script.include("/~/system/libraries/controllerDispatcherUtils.js");
@@ -43,11 +42,6 @@ Script.include("/~/system/libraries/cloneEntityUtils.js"); · 24 unmodified lines
4342 [],
4443 100);
4544
46−
47− // XXX does handJointIndex change if the avatar changes?
48− this.handJointIndex = MyAvatar.getJointIndex(this.hand === RIGHT_HAND ? "RightHand" : "LeftHand");
49− this.controllerJointIndex = getControllerJointIndex(this.hand);
50−
5145 this.thisHandIsParent = function(props) {
5246 if (!props) {
5347 return false;
@@ -62,8 +56,7 @@ Script.include("/~/system/libraries/cloneEntityUtils.js"); · 8 unmodified lines
6256 return true;
6357 }
6458
65− var controllerJointIndex = this.controllerJointIndex;
66− if (props.parentJointIndex === controllerJointIndex) {
59+ if (props.parentJointIndex === getControllerJointIndex(this.hand)) {
6760 return true;
6861 }
6962
@@ -102,7 +95,7 @@ Script.include("/~/system/libraries/cloneEntityUtils.js"); · 32 unmodified lines
10295 // } else {
10396 // handJointIndex = MyAvatar.getJointIndex(this.hand === RIGHT_HAND ? "RightHand" : "LeftHand");
10497 // }
105− handJointIndex = this.controllerJointIndex;
98+ handJointIndex = getControllerJointIndex(this.hand);
10699
107100 var args = [this.hand === RIGHT_HAND ? "right" : "left", MyAvatar.sessionUUID];
108101 Entities.callEntityMethod(targetProps.id, "startNearGrab", args);
scripts/system/controllers/controllerModules/nearParentGrabOverlay.js+1−2
@@ -9,7 +9,7 @@ · 8 unmodified lines
99 /* global Script, MyAvatar, Controller, RIGHT_HAND, LEFT_HAND, getControllerJointIndex,
1010 enableDispatcherModule, disableDispatcherModule, Messages, HAPTIC_PULSE_STRENGTH, HAPTIC_PULSE_DURATION,
1111 makeDispatcherModuleParameters, Overlays, makeRunningValues, Vec3, resizeTablet, getTabletWidthFromSettings,
12− NEAR_GRAB_RADIUS
12+ NEAR_GRAB_RADIUS, HMD, Uuid
1313 */
1414
1515 Script.include("/~/system/libraries/controllerDispatcherUtils.js");
@@ -37,7 +37,6 @@ Script.include("/~/system/libraries/utils.js"); · 21 unmodified lines
3737
3838 // XXX does handJointIndex change if the avatar changes?
3939 this.handJointIndex = MyAvatar.getJointIndex(this.hand === RIGHT_HAND ? "RightHand" : "LeftHand");
40− this.controllerJointIndex = getControllerJointIndex(this.hand);
4140
4241 this.getOtherModule = function() {
4342 return (this.hand === RIGHT_HAND) ? leftNearParentingGrabOverlay : rightNearParentingGrabOverlay;
scripts/system/controllers/controllerModules/teleport.js+1−1
@@ -10,7 +10,7 @@ · 9 unmodified lines
1010
1111 /* jslint bitwise: true */
1212
13−/* global Script, Entities, MyAvatar, Controller, RIGHT_HAND, LEFT_HAND, getControllerJointIndex,
13+/* global Script, Entities, MyAvatar, Controller, RIGHT_HAND, LEFT_HAND,
1414 enableDispatcherModule, disableDispatcherModule, Messages, makeDispatcherModuleParameters, makeRunningValues, Vec3,
1515 HMD, Uuid, AvatarList, Picks, Pointers, PickType
1616 */