From ef2a23f3ce5652e915a77503cdce0f3c4c2183aa Mon Sep 17 00:00:00 2001
From: Brian Peiris <brianpeiris@gmail.com>
Date: Mon, 17 Sep 2018 21:16:02 -0700
Subject: [PATCH] HACK temporary fix for existing environments

---
 src/components/skybox.js | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/src/components/skybox.js b/src/components/skybox.js
index 08566b88c..04508ac2a 100644
--- a/src/components/skybox.js
+++ b/src/components/skybox.js
@@ -272,7 +272,11 @@ AFRAME.registerComponent("skybox", {
 
       uniforms.sunPosition.value.set(x, y, z).normalize();
 
-      this.sky.scale.set(distance, distance, distance);
+      // HACK Remove this if condition and always set the scale based on distance when the existing environments
+      // have their sky scales set to 1.
+      if (this.el.object3D.scale.x === 1) {
+        this.sky.scale.set(distance, distance, distance);
+      }
     }
   },
 
-- 
GitLab