From e1a3bc7d553b22fd19b8d7b66b3200bc6d923089 Mon Sep 17 00:00:00 2001 From: Brad Hefta-Gaub Date: Tue, 11 Oct 2016 16:22:42 -0700 Subject: [PATCH] hide/show grab point sphere only when in a grabbable entity --- scripts/system/controllers/handControllerGrab.js | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/scripts/system/controllers/handControllerGrab.js b/scripts/system/controllers/handControllerGrab.js index 6dedbec381..6241f6b20e 100644 --- a/scripts/system/controllers/handControllerGrab.js +++ b/scripts/system/controllers/handControllerGrab.js @@ -1075,12 +1075,6 @@ function MyController(hand) { var controllerLocation = getControllerWorldLocation(this.handToController(), true); var worldHandPosition = controllerLocation.position; - if (controllerLocation.valid) { - this.grabPointSphereOn(); - } else { - this.grabPointSphereOff(); - } - var candidateEntities = Entities.findEntities(worldHandPosition, MAX_EQUIP_HOTSPOT_RADIUS); entityPropertiesCache.addEntities(candidateEntities); var potentialEquipHotspot = this.chooseBestEquipHotspot(candidateEntities); @@ -1103,9 +1097,11 @@ function MyController(hand) { if (!this.grabPointIntersectsEntity) { Controller.triggerHapticPulse(1, 20, this.hand); this.grabPointIntersectsEntity = true; + this.grabPointSphereOn(); } } else { this.grabPointIntersectsEntity = false; + this.grabPointSphereOff(); } }; @@ -1427,12 +1423,6 @@ function MyController(hand) { var controllerLocation = getControllerWorldLocation(this.handToController(), true); var handPosition = controllerLocation.position; - if (controllerLocation.valid) { - this.grabPointSphereOn(); - } else { - this.grabPointSphereOff(); - } - var rayPickInfo = this.calcRayPickInfo(this.hand); if (rayPickInfo.entityID) {