History

fix grab entity methods

Seth Alves committed 9 years ago

Commit b67c5711 parent df80b7e2 files · +11 −9Browse files

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

Unified · Split

2 files
  1. scripts/system/controllers/controllerModules/nearActionGrabEntity.js +3 −2
  2. scripts/system/controllers/controllerModules/nearParentGrabEntity.js +8 −7
scripts/system/controllers/controllerModules/nearActionGrabEntity.js+3−2
@@ -111,6 +111,9 @@ Script.include("/~/system/libraries/cloneEntityUtils.js"); · 110 unmodified lines
111111 grabbedEntity: this.targetEntityID,
112112 joint: this.hand === RIGHT_HAND ? "RightHand" : "LeftHand"
113113 }));
114+
115+ var args = [this.hand === RIGHT_HAND ? "right" : "left", MyAvatar.sessionUUID];
116+ Entities.callEntityMethod(this.targetEntityID, "startNearGrab", args);
114117 };
115118
116119 // this is for when the action is going to time-out
@@ -182,8 +185,6 @@ Script.include("/~/system/libraries/cloneEntityUtils.js"); · 65 unmodified lines
182185 return makeRunningValues(false, [], []); // let nearParentGrabEntity handle it
183186 } else {
184187 this.targetEntityID = targetProps.id;
185− var args = [this.hand === RIGHT_HAND ? "right" : "left", MyAvatar.sessionUUID];
186− Entities.callEntityMethod(this.targetEntityID, "startNearGrab", args);
187188 return makeRunningValues(true, [this.targetEntityID], []);
188189 }
189190 } else {
scripts/system/controllers/controllerModules/nearParentGrabEntity.js+8−7
@@ -6,11 +6,10 @@ · 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, AVATAR_SELF_ID,
10− getControllerJointIndex, NULL_UUID, enableDispatcherModule, disableDispatcherModule,
11− propsArePhysical, Messages, HAPTIC_PULSE_STRENGTH, HAPTIC_PULSE_DURATION, TRIGGER_OFF_VALUE,
12− makeDispatcherModuleParameters, entityIsGrabbable, makeRunningValues, NEAR_GRAB_RADIUS,
13− findGroupParent, Vec3, cloneEntity, entityIsCloneable, propsAreCloneDynamic, HAPTIC_PULSE_STRENGTH, HAPTIC_PULSE_DURATION, BUMPER_ON_VALUE
9+/* global Script, Entities, MyAvatar, Controller, RIGHT_HAND, LEFT_HAND, AVATAR_SELF_ID, getControllerJointIndex, NULL_UUID,
10+ enableDispatcherModule, disableDispatcherModule, propsArePhysical, Messages, HAPTIC_PULSE_STRENGTH, HAPTIC_PULSE_DURATION,
11+ TRIGGER_OFF_VALUE, makeDispatcherModuleParameters, entityIsGrabbable, makeRunningValues, NEAR_GRAB_RADIUS, findGroupParent,
12+ Vec3, cloneEntity, entityIsCloneable, propsAreCloneDynamic, HAPTIC_PULSE_STRENGTH, HAPTIC_PULSE_DURATION, BUMPER_ON_VALUE
1413 */
1514
1615 Script.include("/~/system/libraries/controllerDispatcherUtils.js");
@@ -176,7 +175,8 @@ Script.include("/~/system/libraries/cloneEntityUtils.js"); · 159 unmodified lines
176175 this.grabbing = false;
177176
178177 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) {
180180 return makeRunningValues(false, [], []);
181181 }
182182
@@ -195,7 +195,8 @@ Script.include("/~/system/libraries/cloneEntityUtils.js"); · 12 unmodified lines
195195
196196 this.run = function (controllerData, deltaTime) {
197197 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) {
199200 this.endNearParentingGrabEntity();
200201 this.hapticTargetID = null;
201202 return makeRunningValues(false, [], []);

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