From d0f9a20a012ed578ae1846c71614c75b87d1a0b1 Mon Sep 17 00:00:00 2001 From: "Anthony J. Thibault" Date: Thu, 7 Sep 2017 15:10:15 -0700 Subject: [PATCH] Fix for tablet grabbing at small scales --- interface/src/ui/overlays/Overlays.cpp | 1 + scripts/system/controllers/handControllerGrab.js | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/interface/src/ui/overlays/Overlays.cpp b/interface/src/ui/overlays/Overlays.cpp index d6e0b61e7d..c93d225718 100644 --- a/interface/src/ui/overlays/Overlays.cpp +++ b/interface/src/ui/overlays/Overlays.cpp @@ -1045,6 +1045,7 @@ QVector Overlays::findOverlays(const glm::vec3& center, float radius) { AABox overlayFrameBox(low, dimensions); Transform overlayToWorldMatrix = overlay->getTransform(); + overlayToWorldMatrix.setScale(1.0f); // ignore inherited scale factor from parents glm::mat4 worldToOverlayMatrix = glm::inverse(overlayToWorldMatrix.getMatrix()); glm::vec3 overlayFrameSearchPosition = glm::vec3(worldToOverlayMatrix * glm::vec4(center, 1.0f)); glm::vec3 penetration; diff --git a/scripts/system/controllers/handControllerGrab.js b/scripts/system/controllers/handControllerGrab.js index f66a8f976d..3bd503b5e7 100644 --- a/scripts/system/controllers/handControllerGrab.js +++ b/scripts/system/controllers/handControllerGrab.js @@ -2246,7 +2246,7 @@ function MyController(hand) { } } - var sensorScaleFactor = MyAvatar.sensorToWorldMatrix + var sensorScaleFactor = MyAvatar.sensorToWorldScale; var candidateEntities = Entities.findEntities(handPosition, NEAR_GRAB_RADIUS * sensorScaleFactor); var grabbableEntities = candidateEntities.filter(function(entity) { return _this.entityIsNearGrabbable(entity, handPosition, NEAR_GRAB_MAX_DISTANCE * sensorScaleFactor);