From 3ed11d2e5fa50c0f9574a8075dbad81e4f973cd6 Mon Sep 17 00:00:00 2001 From: "Anthony J. Thibault" Date: Mon, 29 Aug 2016 13:22:57 -0700 Subject: [PATCH] When trigger is pulled, snap search beam to correct length instead of animating. This improves interaction on web browser tablets. Instead of the beam shooting through the tablet and animating back to the surface, it starts at the correct length. --- scripts/system/controllers/handControllerGrab.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/scripts/system/controllers/handControllerGrab.js b/scripts/system/controllers/handControllerGrab.js index 32e0b047de..1658a661be 100644 --- a/scripts/system/controllers/handControllerGrab.js +++ b/scripts/system/controllers/handControllerGrab.js @@ -1319,6 +1319,11 @@ function MyController(hand) { this.searchEnter = function() { mostRecentSearchingHand = this.hand; + var rayPickInfo = this.calcRayPickInfo(this.hand); + if (rayPickInfo.entityID || rayPickInfo.overlayID) { + this.intersectionDistance = rayPickInfo.distance; + this.searchSphereDistance = this.intersectionDistance; + } }; this.search = function(deltaTime, timestamp) {