From 487ae335471a9ce7911e702fe71de1bcad2910e2 Mon Sep 17 00:00:00 2001 From: Tony Tung <ytung@mozilla.com> Date: Mon, 20 Aug 2018 11:34:03 -0700 Subject: [PATCH] deltaR should be TARGET_RADIUS - value of the radius while the user stops. --- src/systems/tunnel-effect.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/systems/tunnel-effect.js b/src/systems/tunnel-effect.js index 99d44bb69..b3d6ad6c2 100644 --- a/src/systems/tunnel-effect.js +++ b/src/systems/tunnel-effect.js @@ -25,12 +25,13 @@ AFRAME.registerSystem("tunneleffect", { }, init: function() { + const { radius, minRadius, maxSpeed } = this.data; this.scene = this.el; this.isMoving = false; this.isVR = false; this.dt = 0; this.isPostProcessingReady = false; - this.deltaR = TARGET_RADIUS - this.minRadius; + this.deltaR = TARGET_RADIUS - (radius - minRadius) * maxSpeed - minRadius; this.deltaS = this.softness - TARGET_SOFTNESS; this.characterEl = document.querySelector(`a-entity[${this.data.targetComponent}]`); if (this.characterEl) { -- GitLab