Showing the changes to scripts/system/controllers/controllerModules (2 of 2 files). Show all
Unified · Split
| @@ -111,6 +111,9 @@ Script.include("/~/system/libraries/cloneEntityUtils.js"); · 110 unmodified lines | |||
| 111 | grabbedEntity: this.targetEntityID, | 111 | grabbedEntity: this.targetEntityID, |
| 112 | joint: this.hand === RIGHT_HAND ? "RightHand" : "LeftHand" | 112 | joint: this.hand === RIGHT_HAND ? "RightHand" : "LeftHand" |
| 113 | })); | 113 | })); |
| 114 | |||
| 115 | var args = [this.hand === RIGHT_HAND ? "right" : "left", MyAvatar.sessionUUID]; | ||
| 116 | Entities.callEntityMethod(this.targetEntityID, "startNearGrab", args); | ||
| 114 | }; | 117 | }; |
| 115 | 118 | ||
| 116 | // this is for when the action is going to time-out | 119 | // this is for when the action is going to time-out |
| @@ -182,8 +185,6 @@ Script.include("/~/system/libraries/cloneEntityUtils.js"); · 65 unmodified lines | |||
| 182 | return makeRunningValues(false, [], []); // let nearParentGrabEntity handle it | 185 | return makeRunningValues(false, [], []); // let nearParentGrabEntity handle it |
| 183 | } else { | 186 | } else { |
| 184 | this.targetEntityID = targetProps.id; | 187 | this.targetEntityID = targetProps.id; |
| 185 | var args = [this.hand === RIGHT_HAND ? "right" : "left", MyAvatar.sessionUUID]; | ||
| 186 | Entities.callEntityMethod(this.targetEntityID, "startNearGrab", args); | ||
| 187 | return makeRunningValues(true, [this.targetEntityID], []); | 188 | return makeRunningValues(true, [this.targetEntityID], []); |
| 188 | } | 189 | } |
| 189 | } else { | 190 | } else { |
| @@ -6,11 +6,10 @@ · 5 unmodified lines | |||
| 6 | // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html | 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, AVATAR_SELF_ID, | 9 | /* global Script, Entities, MyAvatar, Controller, RIGHT_HAND, LEFT_HAND, AVATAR_SELF_ID, getControllerJointIndex, NULL_UUID, |
| 10 | getControllerJointIndex, NULL_UUID, enableDispatcherModule, disableDispatcherModule, | 10 | enableDispatcherModule, disableDispatcherModule, propsArePhysical, Messages, HAPTIC_PULSE_STRENGTH, HAPTIC_PULSE_DURATION, |
| 11 | propsArePhysical, Messages, HAPTIC_PULSE_STRENGTH, HAPTIC_PULSE_DURATION, TRIGGER_OFF_VALUE, | 11 | TRIGGER_OFF_VALUE, makeDispatcherModuleParameters, entityIsGrabbable, makeRunningValues, NEAR_GRAB_RADIUS, findGroupParent, |
| 12 | makeDispatcherModuleParameters, entityIsGrabbable, makeRunningValues, NEAR_GRAB_RADIUS, | 12 | Vec3, cloneEntity, entityIsCloneable, propsAreCloneDynamic, HAPTIC_PULSE_STRENGTH, HAPTIC_PULSE_DURATION, BUMPER_ON_VALUE |
| 13 | findGroupParent, Vec3, cloneEntity, entityIsCloneable, propsAreCloneDynamic, HAPTIC_PULSE_STRENGTH, HAPTIC_PULSE_DURATION, BUMPER_ON_VALUE | ||
| 14 | */ | 13 | */ |
| 15 | 14 | ||
| 16 | Script.include("/~/system/libraries/controllerDispatcherUtils.js"); | 15 | Script.include("/~/system/libraries/controllerDispatcherUtils.js"); |
| @@ -176,7 +175,8 @@ Script.include("/~/system/libraries/cloneEntityUtils.js"); · 159 unmodified lines | |||
| 176 | this.grabbing = false; | 175 | this.grabbing = false; |
| 177 | 176 | ||
| 178 | var targetProps = this.getTargetProps(controllerData); | 177 | var targetProps = this.getTargetProps(controllerData); |
| 179 | if (controllerData.triggerValues[this.hand] < TRIGGER_OFF_VALUE && controllerData.secondaryValues[this.hand] < TRIGGER_OFF_VALUE) { | 178 | if (controllerData.triggerValues[this.hand] < TRIGGER_OFF_VALUE && |
| 179 | controllerData.secondaryValues[this.hand] < TRIGGER_OFF_VALUE) { | ||
| 180 | return makeRunningValues(false, [], []); | 180 | return makeRunningValues(false, [], []); |
| 181 | } | 181 | } |
| 182 | 182 | ||
| @@ -195,7 +195,8 @@ Script.include("/~/system/libraries/cloneEntityUtils.js"); · 12 unmodified lines | |||
| 195 | 195 | ||
| 196 | this.run = function (controllerData, deltaTime) { | 196 | this.run = function (controllerData, deltaTime) { |
| 197 | if (this.grabbing) { | 197 | if (this.grabbing) { |
| 198 | if (controllerData.triggerClicks[this.hand] < TRIGGER_OFF_VALUE && controllerData.secondaryValues[this.hand] < TRIGGER_OFF_VALUE) { | 198 | if (controllerData.triggerClicks[this.hand] < TRIGGER_OFF_VALUE && |
| 199 | controllerData.secondaryValues[this.hand] < TRIGGER_OFF_VALUE) { | ||
| 199 | this.endNearParentingGrabEntity(); | 200 | this.endNearParentingGrabEntity(); |
| 200 | this.hapticTargetID = null; | 201 | this.hapticTargetID = null; |
| 201 | return makeRunningValues(false, [], []); | 202 | return makeRunningValues(false, [], []); |