Showing the changes to scripts/system/controllers/controllerModules (6 of 70 files). Show all
Unified · Split
| @@ -6,11 +6,11 @@ · 5 unmodified lines | ||
| 6 | 6 | // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html |
| 7 | 7 | |
| 8 | 8 | |
| 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, | |
| 11 | 11 | Messages, makeDispatcherModuleParameters, makeRunningValues, Settings, entityHasActions, |
| 12 | 12 | Vec3, Overlays, flatten, Xform, getControllerWorldLocation, ensureDynamic, entityIsCloneable, |
| 13 | − cloneEntity, DISPATCHER_PROPERTIES, TEAR_AWAY_DISTANCE, Uuid, unhighlightTargetEntity | |
| 13 | + cloneEntity, DISPATCHER_PROPERTIES, Uuid, unhighlightTargetEntity, isInEditMode | |
| 14 | 14 | */ |
| 15 | 15 | |
| 16 | 16 | Script.include("/~/system/libraries/Xform.js"); |
| @@ -780,7 +780,7 @@ EquipHotspotBuddy.prototype.update = function(deltaTime, timestamp, controllerDa · 763 unmodified lines | ||
| 780 | 780 | } |
| 781 | 781 | } |
| 782 | 782 | }; |
| 783 | − | |
| 783 | + | |
| 784 | 784 | var clearGrabActions = function(entityID) { |
| 785 | 785 | var actionIDs = Entities.getActionIDs(entityID); |
| 786 | 786 | var myGrabTag = "grab-" + MyAvatar.sessionUUID; |
| @@ -793,7 +793,7 @@ EquipHotspotBuddy.prototype.update = function(deltaTime, timestamp, controllerDa · 6 unmodified lines | ||
| 793 | 793 | } |
| 794 | 794 | } |
| 795 | 795 | }; |
| 796 | − | |
| 796 | + | |
| 797 | 797 | var onMousePress = function(event) { |
| 798 | 798 | if (isInEditMode() || !event.isLeftButton) { // don't consider any left clicks on the entity while in edit |
| 799 | 799 | return; |
| @@ -807,7 +807,7 @@ EquipHotspotBuddy.prototype.update = function(deltaTime, timestamp, controllerDa · 7 unmodified lines | ||
| 807 | 807 | if (hasEquipData && entityProperties.parentID === EMPTY_PARENT_ID && !entityIsFarGrabbedByOther(entityID)) { |
| 808 | 808 | entityProperties.id = entityID; |
| 809 | 809 | var rightHandPosition = MyAvatar.getJointPosition("RightHand"); |
| 810 | − var leftHandPosition = MyAvatar.getJointPosition("LeftHand"); | |
| 810 | + var leftHandPosition = MyAvatar.getJointPosition("LeftHand"); | |
| 811 | 811 | var distanceToRightHand = Vec3.distance(entityProperties.position, rightHandPosition); |
| 812 | 812 | var distanceToLeftHand = Vec3.distance(entityProperties.position, leftHandPosition); |
| 813 | 813 | var leftHandAvailable = leftEquipEntity.targetEntityID === null; |
| @@ -827,7 +827,7 @@ EquipHotspotBuddy.prototype.update = function(deltaTime, timestamp, controllerDa · 13 unmodified lines | ||
| 827 | 827 | }; |
| 828 | 828 | |
| 829 | 829 | var onKeyPress = function(event) { |
| 830 | − if (event.text === UNEQUIP_KEY) { | |
| 830 | + if (event.text.toLowerCase() === UNEQUIP_KEY) { | |
| 831 | 831 | if (rightEquipEntity.targetEntityID) { |
| 832 | 832 | rightEquipEntity.endEquipEntity(); |
| 833 | 833 | } |
| @@ -10,7 +10,7 @@ · 9 unmodified lines | ||
| 10 | 10 | propsArePhysical, Messages, HAPTIC_PULSE_STRENGTH, HAPTIC_PULSE_DURATION, entityIsGrabbable, |
| 11 | 11 | Quat, Vec3, MSECS_PER_SEC, getControllerWorldLocation, makeDispatcherModuleParameters, makeRunningValues, |
| 12 | 12 | 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 | |
| 14 | 14 | */ |
| 15 | 15 | |
| 16 | 16 | Script.include("/~/system/libraries/controllerDispatcherUtils.js"); |
| @@ -7,12 +7,8 @@ · 6 unmodified lines | ||
| 7 | 7 | // Distributed under the Apache License, Version 2.0. |
| 8 | 8 | // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html |
| 9 | 9 | |
| 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 | |
| 16 | 12 | */ |
| 17 | 13 | |
| 18 | 14 | (function() { |
| @@ -11,8 +11,7 @@ · 10 unmodified lines | ||
| 11 | 11 | TRIGGER_OFF_VALUE, makeDispatcherModuleParameters, entityIsGrabbable, makeRunningValues, NEAR_GRAB_RADIUS, |
| 12 | 12 | findGroupParent, Vec3, cloneEntity, entityIsCloneable, propsAreCloneDynamic, HAPTIC_PULSE_STRENGTH, |
| 13 | 13 | 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 | |
| 16 | 15 | */ |
| 17 | 16 | |
| 18 | 17 | Script.include("/~/system/libraries/controllerDispatcherUtils.js"); |
| @@ -43,11 +42,6 @@ Script.include("/~/system/libraries/cloneEntityUtils.js"); · 24 unmodified lines | ||
| 43 | 42 | [], |
| 44 | 43 | 100); |
| 45 | 44 | |
| 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 | − | |
| 51 | 45 | this.thisHandIsParent = function(props) { |
| 52 | 46 | if (!props) { |
| 53 | 47 | return false; |
| @@ -62,8 +56,7 @@ Script.include("/~/system/libraries/cloneEntityUtils.js"); · 8 unmodified lines | ||
| 62 | 56 | return true; |
| 63 | 57 | } |
| 64 | 58 | |
| 65 | − var controllerJointIndex = this.controllerJointIndex; | |
| 66 | − if (props.parentJointIndex === controllerJointIndex) { | |
| 59 | + if (props.parentJointIndex === getControllerJointIndex(this.hand)) { | |
| 67 | 60 | return true; |
| 68 | 61 | } |
| 69 | 62 | |
| @@ -102,7 +95,7 @@ Script.include("/~/system/libraries/cloneEntityUtils.js"); · 32 unmodified lines | ||
| 102 | 95 | // } else { |
| 103 | 96 | // handJointIndex = MyAvatar.getJointIndex(this.hand === RIGHT_HAND ? "RightHand" : "LeftHand"); |
| 104 | 97 | // } |
| 105 | − handJointIndex = this.controllerJointIndex; | |
| 98 | + handJointIndex = getControllerJointIndex(this.hand); | |
| 106 | 99 | |
| 107 | 100 | var args = [this.hand === RIGHT_HAND ? "right" : "left", MyAvatar.sessionUUID]; |
| 108 | 101 | Entities.callEntityMethod(targetProps.id, "startNearGrab", args); |
| @@ -9,7 +9,7 @@ · 8 unmodified lines | ||
| 9 | 9 | /* global Script, MyAvatar, Controller, RIGHT_HAND, LEFT_HAND, getControllerJointIndex, |
| 10 | 10 | enableDispatcherModule, disableDispatcherModule, Messages, HAPTIC_PULSE_STRENGTH, HAPTIC_PULSE_DURATION, |
| 11 | 11 | makeDispatcherModuleParameters, Overlays, makeRunningValues, Vec3, resizeTablet, getTabletWidthFromSettings, |
| 12 | − NEAR_GRAB_RADIUS | |
| 12 | + NEAR_GRAB_RADIUS, HMD, Uuid | |
| 13 | 13 | */ |
| 14 | 14 | |
| 15 | 15 | Script.include("/~/system/libraries/controllerDispatcherUtils.js"); |
| @@ -37,7 +37,6 @@ Script.include("/~/system/libraries/utils.js"); · 21 unmodified lines | ||
| 37 | 37 | |
| 38 | 38 | // XXX does handJointIndex change if the avatar changes? |
| 39 | 39 | this.handJointIndex = MyAvatar.getJointIndex(this.hand === RIGHT_HAND ? "RightHand" : "LeftHand"); |
| 40 | − this.controllerJointIndex = getControllerJointIndex(this.hand); | |
| 41 | 40 | |
| 42 | 41 | this.getOtherModule = function() { |
| 43 | 42 | return (this.hand === RIGHT_HAND) ? leftNearParentingGrabOverlay : rightNearParentingGrabOverlay; |
| @@ -10,7 +10,7 @@ · 9 unmodified lines | ||
| 10 | 10 | |
| 11 | 11 | /* jslint bitwise: true */ |
| 12 | 12 | |
| 13 | −/* global Script, Entities, MyAvatar, Controller, RIGHT_HAND, LEFT_HAND, getControllerJointIndex, | |
| 13 | +/* global Script, Entities, MyAvatar, Controller, RIGHT_HAND, LEFT_HAND, | |
| 14 | 14 | enableDispatcherModule, disableDispatcherModule, Messages, makeDispatcherModuleParameters, makeRunningValues, Vec3, |
| 15 | 15 | HMD, Uuid, AvatarList, Picks, Pointers, PickType |
| 16 | 16 | */ |