From aa085e577d3850f3b46c00647d6aabcfe00e205e Mon Sep 17 00:00:00 2001 From: David Kelly Date: Thu, 23 Mar 2017 09:19:04 -0700 Subject: [PATCH] more vis work --- scripts/system/makeUserConnection.js | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/scripts/system/makeUserConnection.js b/scripts/system/makeUserConnection.js index b7dbef0520..a9d2653146 100644 --- a/scripts/system/makeUserConnection.js +++ b/scripts/system/makeUserConnection.js @@ -200,15 +200,6 @@ function positionFractionallyTowards(posA, posB, frac) { return Vec3.sum(posA, Vec3.multiply(frac, Vec3.subtract(posB, posA))); } -function fadeEffects() { - if (particleEffect) { - Entities.editEntity(particleEffect, {isEmitting: 0, lifespan: 1.0}); - } - if(makingConnectionParticleEffect) { - Entities.editEntity(makingConnectionParticleEffect, {isEmitting: 0, lifespan: 1.5}); - } -} - function deleteParticleEffect() { if (particleEffect) { particleEffect = Entities.deleteEntity(particleEffect); @@ -241,8 +232,8 @@ function calcParticlePos(myHand, otherHand, otherOrientation, reset) { // this is called frequently, but usually does nothing function updateVisualization() { if (state == STATES.inactive) { - fadeEffects(); - stopHandshakeSound(); + deleteParticleEffect(); + deleteMakeConnectionParticleEffect(); return; } @@ -384,6 +375,9 @@ function startHandshake(fromKeyboard) { function endHandshake() { debug("ending handshake for", currentHand); + + deleteParticleEffect(); + deleteMakeConnectionParticleEffect(); currentHand = undefined; // note that setting the state to inactive should really // only be done here, unless we change how the triggering works, @@ -495,7 +489,7 @@ function makeConnection(id) { successfulHandshakeInjector.restart(); } Controller.triggerHapticPulse(HAPTIC_DATA.success.strength, HAPTIC_DATA.success.duration, handToHaptic(currentHand)); - endHandshake(); + // don't change state (so animation continues while gripped) }, MAKING_CONNECTION_TIMEOUT); }