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
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-out119 // 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 it185 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 {
scripts/system/controllers/controllerModules/nearParentGrabEntity.js+8−7
@@ -6,11 +6,10 @@ · 5 unmodified lines
6// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html6// 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
16Script.include("/~/system/libraries/controllerDispatcherUtils.js");15Script.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, [], []);

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