From 1e6b2682c96ce8da9fb1c1a2140c8cf21b4711bc Mon Sep 17 00:00:00 2001 From: Seth Alves Date: Fri, 21 Apr 2017 10:17:57 -0700 Subject: [PATCH] use timers rather than relying on update calls --- scripts/system/controllers/handControllerGrab.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/scripts/system/controllers/handControllerGrab.js b/scripts/system/controllers/handControllerGrab.js index 464101a4e3..1091906de7 100644 --- a/scripts/system/controllers/handControllerGrab.js +++ b/scripts/system/controllers/handControllerGrab.js @@ -3984,7 +3984,7 @@ var updateTotalWork = 0; var UPDATE_PERFORMANCE_DEBUGGING = false; -function updateWrapper(){ +var updateWrapper = function () { intervalCount++; var thisInterval = Date.now(); @@ -4032,12 +4032,14 @@ function updateWrapper(){ updateTotalWork = 0; } + Script.setTimeout(updateWrapper, 16); } -Script.update.connect(updateWrapper); +// Script.update.connect(updateWrapper); +Script.setTimeout(updateWrapper, 16); function cleanup() { Menu.removeMenuItem("Developer", "Show Grab Sphere"); - Script.update.disconnect(updateWrapper); + // Script.update.disconnect(updateWrapper); rightController.cleanup(); leftController.cleanup(); Controller.disableMapping(MAPPING_NAME);