From a304b8a79eb3c41d3a6c2e898d599306a92e13d4 Mon Sep 17 00:00:00 2001
From: Tony Tung <ytung@mozilla.com>
Date: Fri, 17 Aug 2018 15:25:31 -0700
Subject: [PATCH] init deltaR & deltaS. added disableTuneel param in README.

---
 README.md                    | 1 +
 src/systems/tunnel-effect.js | 2 +-
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/README.md b/README.md
index 790462087..7d1abc181 100644
--- a/README.md
+++ b/README.md
@@ -62,6 +62,7 @@ This will allow the CSP checks to pass that are served up by Reticulum so you ca
 - `disable_telemetry` - If `true` disables Sentry telemetry.
 - `log_filter` - A `debug` style filter for setting the logging level.
 - `debug` - If `true` performs verbose logging of Janus and NAF traffic.
+- `disableTunnel` - Tunnel vision is on by default. Disable the tunnel vision by this parameter.
 
 ## Additional Resources
 
diff --git a/src/systems/tunnel-effect.js b/src/systems/tunnel-effect.js
index d7b7f0997..8c748e0a6 100644
--- a/src/systems/tunnel-effect.js
+++ b/src/systems/tunnel-effect.js
@@ -74,7 +74,7 @@ AFRAME.registerSystem("tunneleffect", {
         Math.abs(r - TARGET_RADIUS) > CLAMP_RADIUS &&
         Math.abs(softness - TARGET_SOFTNESS) > CLAMP_SOFTNESS
       ) {
-        if (this.deltaR !== 0 && this.deltaS !== 0) {
+        if (!this.deltaR && !this.deltaS) {
           this.deltaR = TARGET_RADIUS - r;
           this.deltaS = softness - TARGET_SOFTNESS;
         }
-- 
GitLab