From fa2b975e8f262a96b61ac30685c7a9af1e3febf0 Mon Sep 17 00:00:00 2001 From: Dante Ruiz Date: Mon, 16 Jul 2018 11:42:38 -0700 Subject: [PATCH] undo some wrong changes --- .../controllers/controllerModules/nearParentGrabEntity.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/scripts/system/controllers/controllerModules/nearParentGrabEntity.js b/scripts/system/controllers/controllerModules/nearParentGrabEntity.js index 75f8d28c85..59c2520c01 100644 --- a/scripts/system/controllers/controllerModules/nearParentGrabEntity.js +++ b/scripts/system/controllers/controllerModules/nearParentGrabEntity.js @@ -239,8 +239,10 @@ Script.include("/~/system/libraries/cloneEntityUtils.js"); for (var i = 0; i < nearbyEntityProperties.length; i++) { var props = nearbyEntityProperties[i]; var handPosition = controllerData.controllerLocations[this.hand].position; + var dist = distanceBetweenPointAndEntityBoundingBox(handPosition, props); var distance = Vec3.distance(handPosition, props.position); - if ((distance > NEAR_GRAB_RADIUS * sensorScaleFactor)) { + if ((dist > TEAR_AWAY_DISTANCE || + distance > NEAR_GRAB_RADIUS * sensorScaleFactor)) { continue; } if (entityIsGrabbable(props) || entityIsCloneable(props)) {