From aca0fa7beb17c5157601b39ebf4f45ffed5b3961 Mon Sep 17 00:00:00 2001 From: "James B. Pollack" Date: Tue, 1 Dec 2015 16:03:19 -0800 Subject: [PATCH] support disabling both hands --- examples/controllers/handControllerGrab.js | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/examples/controllers/handControllerGrab.js b/examples/controllers/handControllerGrab.js index 272c2903af..287f57ca30 100644 --- a/examples/controllers/handControllerGrab.js +++ b/examples/controllers/handControllerGrab.js @@ -1266,10 +1266,10 @@ Controller.enableMapping(MAPPING_NAME); var handToDisable = 'none'; function update() { - if (handToDisable !== LEFT_HAND) { + if (handToDisable !== LEFT_HAND && handToDisable!=='both') { leftController.update(); } - if (handToDisable !== RIGHT_HAND) { + if (handToDisable !== RIGHT_HAND && handToDisable!=='both') { rightController.update(); } } @@ -1279,13 +1279,18 @@ Messages.subscribe('Hifi-Hand-Disabler'); handleHandDisablerMessages = function(channel, message, sender) { if (sender === MyAvatar.sessionUUID) { - handToDisable = message; if (message === 'left') { handToDisable = LEFT_HAND; } if (message === 'right') { handToDisable = RIGHT_HAND; } + if(message==='both'){ + handToDisable='both'; + } + if(message==='none'){ + handToDisable='none'; + } } }