History

Update system scripts to use new properties

David Rowe committed 9 years ago

Commit fc4e4401 parent 949ed3b22 files · +109 −255Browse files

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

Unified · Split

10 files
  1. scripts/system/controllers/controllerModules/equipEntity.js +3 −3
  2. scripts/system/controllers/controllerModules/farActionGrabEntity.js +2 −2
  3. scripts/system/controllers/controllerModules/hudOverlayPointer.js +1 −1
  4. scripts/system/controllers/controllerModules/nearActionGrabEntity.js +3 −3
  5. scripts/system/controllers/controllerModules/nearParentGrabEntity.js +6 −6
  6. scripts/system/controllers/controllerModules/nearParentGrabOverlay.js +3 −3
  7. scripts/system/controllers/controllerModules/overlayLaserInput.js +1 −1
  8. scripts/system/controllers/controllerModules/tabletStylusInput.js +3 −3
  9. scripts/system/controllers/controllerModules/teleport.js +1 −1
  10. scripts/system/controllers/controllerModules/webEntityLaserInput.js +9 −9
scripts/system/controllers/controllerModules/equipEntity.js+3−3
@@ -7,7 +7,7 @@ · 6 unmodified lines
77
88
99 /* global Script, Entities, MyAvatar, Controller, RIGHT_HAND, LEFT_HAND, AVATAR_SELF_ID,
10− getControllerJointIndex, NULL_UUID, enableDispatcherModule, disableDispatcherModule,
10+ getControllerJointIndex, enableDispatcherModule, disableDispatcherModule,
1111 Messages, makeDispatcherModuleParameters, makeRunningValues, Settings, entityHasActions,
1212 Vec3, Overlays, flatten, Xform, getControllerWorldLocation, ensureDynamic, entityIsCloneable,
1313 cloneEntity, DISPATCHER_PROPERTIES
@@ -333,7 +333,7 @@ EquipHotspotBuddy.prototype.update = function(deltaTime, timestamp, controllerDa · 319 unmodified lines
333333 var props = controllerData.nearbyEntityPropertiesByID[hotspot.entityID];
334334
335335 var hasParent = true;
336− if (props.parentID === NULL_UUID) {
336+ if (props.parentID === Uuid.NULL) {
337337 hasParent = false;
338338 }
339339
@@ -539,7 +539,7 @@ EquipHotspotBuddy.prototype.update = function(deltaTime, timestamp, controllerDa · 199 unmodified lines
539539
540540 this.endEquipEntity = function () {
541541 Entities.editEntity(this.targetEntityID, {
542− parentID: NULL_UUID,
542+ parentID: Uuid.NULL,
543543 parentJointIndex: -1
544544 });
545545
scripts/system/controllers/controllerModules/farActionGrabEntity.js+2−2
@@ -8,7 +8,7 @@ · 7 unmodified lines
88 /* jslint bitwise: true */
99
1010 /* global Script, Controller, LaserPointers, RayPick, RIGHT_HAND, LEFT_HAND, Mat4, MyAvatar, Vec3, Camera, Quat,
11− getGrabPointSphereOffset, getEnabledModuleByName, makeRunningValues, Entities, NULL_UUID,
11+ getGrabPointSphereOffset, getEnabledModuleByName, makeRunningValues, Entities,
1212 enableDispatcherModule, disableDispatcherModule, entityIsDistanceGrabbable,
1313 makeDispatcherModuleParameters, MSECS_PER_SEC, HAPTIC_PULSE_STRENGTH, HAPTIC_PULSE_DURATION,
1414 PICK_MAX_DISTANCE, COLORS_GRAB_SEARCHING_HALF_SQUEEZE, COLORS_GRAB_SEARCHING_FULL_SQUEEZE, COLORS_GRAB_DISTANCE_HOLD,
@@ -238,7 +238,7 @@ Script.include("/~/system/libraries/controllers.js"); · 223 unmodified lines
238238 tag: "far-grab-" + MyAvatar.sessionUUID,
239239 ttl: ACTION_TTL
240240 });
241− if (this.actionID === NULL_UUID) {
241+ if (this.actionID === Uuid.NULL) {
242242 this.actionID = null;
243243 }
244244
scripts/system/controllers/controllerModules/hudOverlayPointer.js+1−1
@@ -11,7 +11,7 @@ · 10 unmodified lines
1111 //
1212
1313 /* global Script, Controller, LaserPointers, RayPick, RIGHT_HAND, LEFT_HAND, Mat4, MyAvatar, Vec3, Camera, Quat,
14− getGrabPointSphereOffset, getEnabledModuleByName, makeRunningValues, Entities, NULL_UUID,
14+ getGrabPointSphereOffset, getEnabledModuleByName, makeRunningValues, Entities,
1515 enableDispatcherModule, disableDispatcherModule, entityIsDistanceGrabbable,
1616 makeDispatcherModuleParameters, MSECS_PER_SEC, HAPTIC_PULSE_STRENGTH, HAPTIC_PULSE_DURATION,
1717 PICK_MAX_DISTANCE, COLORS_GRAB_SEARCHING_HALF_SQUEEZE, COLORS_GRAB_SEARCHING_FULL_SQUEEZE, COLORS_GRAB_DISTANCE_HOLD,
scripts/system/controllers/controllerModules/nearActionGrabEntity.js+3−3
@@ -6,7 +6,7 @@ · 5 unmodified lines
66 // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
77
88 /* global Script, Entities, MyAvatar, Controller, RIGHT_HAND, LEFT_HAND,
9− getControllerJointIndex, getGrabbableData, NULL_UUID, enableDispatcherModule, disableDispatcherModule,
9+ getControllerJointIndex, getGrabbableData, enableDispatcherModule, disableDispatcherModule,
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,
@@ -101,7 +101,7 @@ Script.include("/~/system/libraries/cloneEntityUtils.js"); · 88 unmodified lines
101101 kinematicSetVelocity: true,
102102 ignoreIK: this.ignoreIK
103103 });
104− if (this.actionID === NULL_UUID) {
104+ if (this.actionID === Uuid.NULL) {
105105 this.actionID = null;
106106 return;
107107 }
@@ -183,7 +183,7 @@ Script.include("/~/system/libraries/cloneEntityUtils.js"); · 75 unmodified lines
183183
184184 if (targetProps) {
185185 if ((!propsArePhysical(targetProps) && !propsAreCloneDynamic(targetProps)) ||
186− targetProps.parentID != NULL_UUID) {
186+ targetProps.parentID !== Uuid.NULL) {
187187 return makeRunningValues(false, [], []); // let nearParentGrabEntity handle it
188188 } else {
189189 this.targetEntityID = targetProps.id;
scripts/system/controllers/controllerModules/nearParentGrabEntity.js+6−6
@@ -6,7 +6,7 @@ · 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, getControllerJointIndex, NULL_UUID,
9+/* global Script, Entities, MyAvatar, Controller, RIGHT_HAND, LEFT_HAND, AVATAR_SELF_ID, getControllerJointIndex,
1010 enableDispatcherModule, disableDispatcherModule, propsArePhysical, Messages, HAPTIC_PULSE_STRENGTH, HAPTIC_PULSE_DURATION,
1111 TRIGGER_OFF_VALUE, makeDispatcherModuleParameters, entityIsGrabbable, makeRunningValues, NEAR_GRAB_RADIUS,
1212 findGroupParent, Vec3, cloneEntity, entityIsCloneable, propsAreCloneDynamic, HAPTIC_PULSE_STRENGTH,
@@ -120,7 +120,7 @@ Script.include("/~/system/libraries/cloneEntityUtils.js"); · 107 unmodified lines
120120 this.hapticTargetID = null;
121121 var props = controllerData.nearbyEntityPropertiesByID[this.targetEntityID];
122122 if (this.thisHandIsParent(props)) {
123− if (this.previousParentID[this.targetEntityID] === NULL_UUID || this.previousParentID === undefined) {
123+ if (this.previousParentID[this.targetEntityID] === Uuid.NULL || this.previousParentID === undefined) {
124124 Entities.editEntity(this.targetEntityID, {
125125 parentID: this.previousParentID[this.targetEntityID],
126126 parentJointIndex: this.previousParentJointIndex[this.targetEntityID]
@@ -193,7 +193,7 @@ Script.include("/~/system/libraries/cloneEntityUtils.js"); · 66 unmodified lines
193193 var UNHOOK_LOOP_DETECT_MS = 200;
194194 if (_this.previouslyUnhooked[childID]) {
195195 if (now - _this.previouslyUnhooked[childID] < UNHOOK_LOOP_DETECT_MS) {
196− previousParentID = NULL_UUID;
196+ previousParentID = Uuid.NULL;
197197 previousParentJointIndex = -1;
198198 }
199199 }
@@ -204,7 +204,7 @@ Script.include("/~/system/libraries/cloneEntityUtils.js"); · 4 unmodified lines
204204 parentJointIndex: previousParentJointIndex
205205 });
206206 } else {
207− Entities.editEntity(childID, { parentID: NULL_UUID });
207+ Entities.editEntity(childID, { parentID: Uuid.NULL });
208208 }
209209 });
210210 }
@@ -253,7 +253,7 @@ Script.include("/~/system/libraries/cloneEntityUtils.js"); · 42 unmodified lines
253253
254254 if (targetProps) {
255255 if ((propsArePhysical(targetProps) || propsAreCloneDynamic(targetProps)) &&
256− targetProps.parentID == NULL_UUID) {
256+ targetProps.parentID === Uuid.NULL) {
257257 return makeRunningValues(false, [], []); // let nearActionGrabEntity handle it
258258 } else {
259259 this.targetEntityID = targetProps.id;
@@ -268,7 +268,7 @@ Script.include("/~/system/libraries/cloneEntityUtils.js"); · 8 unmodified lines
268268 this.run = function (controllerData, deltaTime) {
269269 if (this.grabbing) {
270270 if (controllerData.triggerClicks[this.hand] < TRIGGER_OFF_VALUE &&
271− controllerData.secondaryValues[this.hand] < TRIGGER_OFF_VALUE) {
271+ controllerData.secondaryValues[this.hand] < TRIGGER_OFF_VALUE) {
272272 this.endNearParentingGrabEntity(controllerData);
273273 return makeRunningValues(false, [], []);
274274 }
scripts/system/controllers/controllerModules/nearParentGrabOverlay.js+3−3
@@ -6,7 +6,7 @@ · 5 unmodified lines
66 // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
77
88
9−/* global Script, MyAvatar, Controller, RIGHT_HAND, LEFT_HAND, AVATAR_SELF_ID, getControllerJointIndex, NULL_UUID,
9+/* global Script, MyAvatar, Controller, RIGHT_HAND, LEFT_HAND, AVATAR_SELF_ID, getControllerJointIndex,
1010 enableDispatcherModule, disableDispatcherModule, Messages, HAPTIC_PULSE_STRENGTH, HAPTIC_PULSE_DURATION,
1111 makeDispatcherModuleParameters, Overlays, makeRunningValues, Vec3, resizeTablet, getTabletWidthFromSettings,
1212 NEAR_GRAB_RADIUS
@@ -130,9 +130,9 @@ Script.include("/~/system/libraries/utils.js"); · 117 unmodified lines
130130
131131 this.endNearParentingGrabOverlay = function () {
132132 var previousParentID = this.previousParentID[this.grabbedThingID];
133− if ((previousParentID === NULL_UUID || previousParentID === null) && !this.robbed) {
133+ if ((previousParentID === Uuid.NULL || previousParentID === null) && !this.robbed) {
134134 Overlays.editOverlay(this.grabbedThingID, {
135− parentID: NULL_UUID,
135+ parentID: Uuid.NULL,
136136 parentJointIndex: -1
137137 });
138138 } else if (!this.robbed){
scripts/system/controllers/controllerModules/overlayLaserInput.js+1−1
@@ -5,7 +5,7 @@ · 4 unmodified lines
55 // Distributed under the Apache License, Version 2.0.
66 // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
77
8−/* global Script, Entities, Controller, RIGHT_HAND, LEFT_HAND, NULL_UUID, enableDispatcherModule, disableDispatcherModule,
8+/* global Script, Entities, Controller, RIGHT_HAND, LEFT_HAND, enableDispatcherModule, disableDispatcherModule,
99 makeRunningValues, Messages, Quat, Vec3, makeDispatcherModuleParameters, Overlays, ZERO_VEC, AVATAR_SELF_ID, HMD,
1010 INCHES_TO_METERS, DEFAULT_REGISTRATION_POINT, getGrabPointSphereOffset, COLORS_GRAB_SEARCHING_HALF_SQUEEZE,
1111 COLORS_GRAB_SEARCHING_FULL_SQUEEZE, COLORS_GRAB_DISTANCE_HOLD, DEFAULT_SEARCH_SPHERE_DISTANCE, TRIGGER_ON_VALUE,
scripts/system/controllers/controllerModules/tabletStylusInput.js+3−3
@@ -6,7 +6,7 @@ · 5 unmodified lines
66 // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
77
88 /* global Script, Entities, MyAvatar, Controller, RIGHT_HAND, LEFT_HAND,
9− NULL_UUID, enableDispatcherModule, disableDispatcherModule, makeRunningValues,
9+ enableDispatcherModule, disableDispatcherModule, makeRunningValues,
1010 Messages, Quat, Vec3, getControllerWorldLocation, makeDispatcherModuleParameters, Overlays, ZERO_VEC,
1111 AVATAR_SELF_ID, HMD, INCHES_TO_METERS, DEFAULT_REGISTRATION_POINT, Settings, getGrabPointSphereOffset,
1212 getEnabledModuleByName
@@ -286,7 +286,7 @@ Script.include("/~/system/libraries/controllers.js"); · 273 unmodified lines
286286 }
287287
288288 // add the tabletScreen, if it is valid
289− if (HMD.tabletScreenID && HMD.tabletScreenID !== NULL_UUID &&
289+ if (HMD.tabletScreenID && HMD.tabletScreenID !== Uuid.NULL &&
290290 Overlays.getProperty(HMD.tabletScreenID, "visible")) {
291291 stylusTarget = TouchEventUtils.calculateTouchTargetFromOverlay(this.stylusTip, HMD.tabletScreenID);
292292 if (stylusTarget) {
@@ -295,7 +295,7 @@ Script.include("/~/system/libraries/controllers.js"); · 2 unmodified lines
295295 }
296296
297297 // add the tablet home button.
298− if (HMD.homeButtonID && HMD.homeButtonID !== NULL_UUID &&
298+ if (HMD.homeButtonID && HMD.homeButtonID !== Uuid.NULL &&
299299 Overlays.getProperty(HMD.homeButtonID, "visible")) {
300300 stylusTarget = TouchEventUtils.calculateTouchTargetFromOverlay(this.stylusTip, HMD.homeButtonID);
301301 if (stylusTarget) {
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, AVATAR_SELF_ID, getControllerJointIndex, NULL_UUID,
13+/* global Script, Entities, MyAvatar, Controller, RIGHT_HAND, LEFT_HAND, AVATAR_SELF_ID, getControllerJointIndex,
1414 enableDispatcherModule, disableDispatcherModule, Messages, makeDispatcherModuleParameters, makeRunningValues, Vec3,
1515 LaserPointers, RayPick, HMD, Uuid, AvatarList
1616 */
scripts/system/controllers/controllerModules/webEntityLaserInput.js+9−9
@@ -8,7 +8,7 @@ · 7 unmodified lines
88 /* jslint bitwise: true */
99
1010 /* global Script, Controller, LaserPointers, RayPick, RIGHT_HAND, LEFT_HAND, Vec3, Quat, getGrabPointSphereOffset,
11− makeRunningValues, Entities, NULL_UUID, enableDispatcherModule, disableDispatcherModule, makeDispatcherModuleParameters,
11+ makeRunningValues, Entities, enableDispatcherModule, disableDispatcherModule, makeDispatcherModuleParameters,
1212 PICK_MAX_DISTANCE, COLORS_GRAB_SEARCHING_HALF_SQUEEZE, COLORS_GRAB_SEARCHING_FULL_SQUEEZE, COLORS_GRAB_DISTANCE_HOLD,
1313 AVATAR_SELF_ID, DEFAULT_SEARCH_SPHERE_DISTANCE, TRIGGER_ON_VALUE, ZERO_VEC, Overlays
1414 */
@@ -90,15 +90,15 @@ Script.include("/~/system/libraries/controllers.js"); · 75 unmodified lines
9090 var HAPTIC_STYLUS_DURATION = 20.0;
9191
9292 function laserTargetHasKeyboardFocus(laserTarget) {
93− if (laserTarget && laserTarget !== NULL_UUID) {
93+ if (laserTarget && laserTarget !== Uuid.NULL) {
9494 return Entities.keyboardFocusOverlay === laserTarget;
9595 }
9696 }
9797
9898 function setKeyboardFocusOnLaserTarget(laserTarget) {
99− if (laserTarget && laserTarget !== NULL_UUID) {
99+ if (laserTarget && laserTarget !== Uuid.NULL) {
100100 Entities.wantsHandControllerPointerEvents(laserTarget);
101− Overlays.keyboardFocusOverlay = NULL_UUID;
101+ Overlays.keyboardFocusOverlay = Uuid.NULL;
102102 Entities.keyboardFocusEntity = laserTarget;
103103 }
104104 }
@@ -117,7 +117,7 @@ Script.include("/~/system/libraries/controllers.js"); · 12 unmodified lines
117117 button: "None"
118118 };
119119
120− if (laserTarget.entityID && laserTarget.entityID !== NULL_UUID) {
120+ if (laserTarget.entityID && laserTarget.entityID !== Uuid.NULL) {
121121 Entities.sendHoverEnterEntity(laserTarget.entityID, pointerEvent);
122122 }
123123 }
@@ -137,7 +137,7 @@ Script.include("/~/system/libraries/controllers.js"); · 13 unmodified lines
137137 button: "None"
138138 };
139139
140− if (laserTarget.entityID && laserTarget.entityID !== NULL_UUID) {
140+ if (laserTarget.entityID && laserTarget.entityID !== Uuid.NULL) {
141141 Entities.sendMouseMoveOnEntity(laserTarget.entityID, pointerEvent);
142142 Entities.sendHoverOverEntity(laserTarget.entityID, pointerEvent);
143143 }
@@ -156,7 +156,7 @@ Script.include("/~/system/libraries/controllers.js"); · 12 unmodified lines
156156 isPrimaryHeld: true
157157 };
158158
159− if (laserTarget.entityID && laserTarget.entityID !== NULL_UUID) {
159+ if (laserTarget.entityID && laserTarget.entityID !== Uuid.NULL) {
160160 Entities.sendMousePressOnEntity(laserTarget.entityID, pointerEvent);
161161 Entities.sendClickDownOnEntity(laserTarget.entityID, pointerEvent);
162162 }
@@ -173,7 +173,7 @@ Script.include("/~/system/libraries/controllers.js"); · 10 unmodified lines
173173 button: "Primary"
174174 };
175175
176− if (laserTarget.entityID && laserTarget.entityID !== NULL_UUID) {
176+ if (laserTarget.entityID && laserTarget.entityID !== Uuid.NULL) {
177177 Entities.sendMouseReleaseOnEntity(laserTarget.entityID, pointerEvent);
178178 Entities.sendClickReleaseOnEntity(laserTarget.entityID, pointerEvent);
179179 Entities.sendHoverLeaveEntity(laserTarget.entityID, pointerEvent);
@@ -192,7 +192,7 @@ Script.include("/~/system/libraries/controllers.js"); · 12 unmodified lines
192192 isPrimaryHeld: true
193193 };
194194
195− if (laserTarget.entityID && laserTarget.entityID !== NULL_UUID) {
195+ if (laserTarget.entityID && laserTarget.entityID !== Uuid.NULL) {
196196 Entities.sendMouseMoveOnEntity(laserTarget.entityID, pointerEvent);
197197 Entities.sendHoldingClickOnEntity(laserTarget.entityID, pointerEvent);
198198 }