From dfe3e5b1cbdedad51fa829202ec22c8144faa30d Mon Sep 17 00:00:00 2001 From: Brad Hefta-Gaub Date: Tue, 20 Oct 2015 09:30:27 -0700 Subject: [PATCH] fix laser lifetimes --- examples/controllers/handControllerGrab.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/controllers/handControllerGrab.js b/examples/controllers/handControllerGrab.js index 1e77125d00..d2ad2aa4be 100644 --- a/examples/controllers/handControllerGrab.js +++ b/examples/controllers/handControllerGrab.js @@ -64,7 +64,6 @@ var NULL_ACTION_ID = "{00000000-0000-0000-000000000000}"; 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 = 15; // seconds var ACTION_LIFETIME_REFRESH = 5; @@ -203,11 +202,12 @@ function MyController(hand, triggerAction) { lifetime: LIFETIME }); } else { + var age = Entities.getEntityProperties(this.pointer, "age").age; Entities.editEntity(this.pointer, { position: closePoint, linePoints: [ZERO_VEC, farPoint], color: color, - lifetime: (Date.now() - startTime) / MSEC_PER_SEC + LIFETIME + lifetime: age + LIFETIME }); }