Showing the changes to scripts/system/controllers/controllerModules (3 of 4 files). Show all
Unified · Split
| @@ -167,7 +167,7 @@ Script.include("/~/system/libraries/cloneEntityUtils.js"); · 166 unmodified lines | ||
| 167 | 167 | this.isReady = function (controllerData) { |
| 168 | 168 | this.targetEntityID = null; |
| 169 | 169 | |
| 170 | − if (controllerData.triggerValues[this.hand] < TRIGGER_OFF_VALUE) { | |
| 170 | + if (controllerData.triggerValues[this.hand] < TRIGGER_OFF_VALUE && controllerData.secondaryValues[this.hand] < TRIGGER_OFF_VALUE) { | |
| 171 | 171 | return makeRunningValues(false, [], []); |
| 172 | 172 | } |
| 173 | 173 | |
| @@ -186,7 +186,7 @@ Script.include("/~/system/libraries/cloneEntityUtils.js"); · 12 unmodified lines | ||
| 186 | 186 | |
| 187 | 187 | this.run = function (controllerData) { |
| 188 | 188 | if (this.actionID) { |
| 189 | − if (controllerData.triggerClicks[this.hand] === 0) { | |
| 189 | + if (controllerData.triggerClicks[this.hand] === 0 && controllerData.secondaryValues[this.hand] === 0) { | |
| 190 | 190 | this.endNearGrabAction(); |
| 191 | 191 | return makeRunningValues(false, [], []); |
| 192 | 192 | } |
| @@ -204,7 +204,7 @@ Script.include("/~/system/libraries/cloneEntityUtils.js"); · 11 unmodified lines | ||
| 204 | 204 | |
| 205 | 205 | var targetProps = this.getTargetProps(controllerData); |
| 206 | 206 | if (targetProps) { |
| 207 | − if (controllerData.triggerClicks[this.hand] === 1) { | |
| 207 | + if (controllerData.triggerClicks[this.hand] === 1 || controllerData.secondaryValues[this.hand] === 1) { | |
| 208 | 208 | // switch to grabbing |
| 209 | 209 | var targetCloneable = entityIsCloneable(targetProps); |
| 210 | 210 | if (targetCloneable) { |
| @@ -128,7 +128,8 @@ var GRAB_RADIUS = 0.35; · 127 unmodified lines | ||
| 128 | 128 | }; |
| 129 | 129 | |
| 130 | 130 | this.endNearParentingGrabOverlay = function () { |
| 131 | − if (this.previousParentID[this.grabbedThingID] === NULL_UUID) { | |
| 131 | + var previousParentID = this.previousParentID[this.grabbedThingID]; | |
| 132 | + if (previousParentID === NULL_UUID || previousParentID === null || previousParentID === undefined) { | |
| 132 | 133 | Overlays.editOverlay(this.grabbedThingID, { |
| 133 | 134 | parentID: NULL_UUID, |
| 134 | 135 | parentJointIndex: -1 |
| @@ -429,8 +429,11 @@ Script.include("/~/system/libraries/controllers.js"); · 428 unmodified lines | ||
| 429 | 429 | |
| 430 | 430 | this.shouldExit = function(controllerData) { |
| 431 | 431 | var intersection = controllerData.rayPicks[this.hand]; |
| 432 | + var nearGrabName = this.hand === RIGHT_HAND ? "RightNearParentingGrabOverlay" : "LeftNearParentingGrabOverlay"; | |
| 433 | + var nearGrabModule = getEnabledModuleByName(nearGrabName); | |
| 434 | + var status = nearGrabModule ? nearGrabModule.isReady(controllerData) : makeRunningValues(false, [], []); | |
| 432 | 435 | var offOverlay = (intersection.type !== RayPick.INTERSECTED_OVERLAY); |
| 433 | − return offOverlay; | |
| 436 | + return offOverlay || status.active; | |
| 434 | 437 | }; |
| 435 | 438 | |
| 436 | 439 | this.exitModule = function() { |