From c884f466bc3d7977abc977f09522d4a3d91689b7 Mon Sep 17 00:00:00 2001 From: Seth Alves Date: Thu, 15 Oct 2015 10:40:58 -0700 Subject: [PATCH] adjust timing of action refresh --- examples/controllers/handControllerGrab.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/examples/controllers/handControllerGrab.js b/examples/controllers/handControllerGrab.js index ee16eadeed..117ee8c453 100644 --- a/examples/controllers/handControllerGrab.js +++ b/examples/controllers/handControllerGrab.js @@ -66,7 +66,8 @@ var MSEC_PER_SEC = 1000.0; // these control how long an abandoned pointer line will hang around var startTime = Date.now(); var LIFETIME = 10; -var ACTION_LIFETIME = 10; // seconds +var ACTION_LIFETIME = 15; // seconds +var ACTION_LIFETIME_REFRESH = 5; var PICKS_PER_SECOND_PER_HAND = 5; var MSECS_PER_SEC = 1000.0; @@ -536,8 +537,8 @@ function MyController(hand, triggerAction) { this.currentObjectTime = now; Entities.callEntityMethod(this.grabbedEntity, "continueNearGrab"); - if (this.actionTimeout - now < MSEC_PER_SEC) { - // if less than a second left, refresh the actions lifetime + if (this.actionTimeout - now < ACTION_LIFETIME_REFRESH * MSEC_PER_SEC) { + // if less than a 5 seconds left, refresh the actions lifetime Entities.updateAction(this.grabbedEntity, this.actionID, { hand: this.hand === RIGHT_HAND ? "right" : "left", timeScale: NEAR_GRABBING_ACTION_TIMEFRAME,