From 0e30393c81b7ec1067d0fdfb5f483b68004326cd Mon Sep 17 00:00:00 2001 From: "James B. Pollack" Date: Sun, 27 Dec 2015 12:47:56 -0800 Subject: [PATCH] make sure theres something on the blacklist --- examples/controllers/handControllerGrab.js | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/examples/controllers/handControllerGrab.js b/examples/controllers/handControllerGrab.js index 80fcaa3f6f..deca0aa3ba 100644 --- a/examples/controllers/handControllerGrab.js +++ b/examples/controllers/handControllerGrab.js @@ -778,13 +778,12 @@ function MyController(hand) { var intersection; - if(USE_BLACKLIST===true){ - intersection = Entities.findRayIntersection(pickRay, true, [], blacklist); + if (USE_BLACKLIST === true && blacklist.length !== 0) { + intersection = Entities.findRayIntersection(pickRay, true, [], blacklist); + } else { + intersection = Entities.findRayIntersection(pickRayBacked, true); } - else{ - intersection = Entities.findRayIntersection(pickRayBacked, true); - } - + if (intersection.intersects) { // the ray is intersecting something we can move. var intersectionDistance = Vec3.distance(pickRay.origin, intersection.intersection);