From 11bee62e7740b879bc736ab3e605b071bd3ad3ac Mon Sep 17 00:00:00 2001
From: joni <johnfshaughnessy@gmail.com>
Date: Fri, 11 May 2018 11:07:29 -0700
Subject: [PATCH] respond to PR feedback.

---
 src/components/cursor-controller.js |  5 +++--
 src/components/in-world-hud.js      |  6 +++---
 src/hub.js                          | 14 +++++++-------
 3 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/components/cursor-controller.js b/src/components/cursor-controller.js
index 6c4cb4f30..40f90d82e 100644
--- a/src/components/cursor-controller.js
+++ b/src/components/cursor-controller.js
@@ -2,6 +2,7 @@ const TARGET_TYPE_NONE = 1;
 const TARGET_TYPE_INTERACTABLE = 2;
 const TARGET_TYPE_UI = 4;
 const TARGET_TYPE_INTERACTABLE_OR_UI = TARGET_TYPE_INTERACTABLE | TARGET_TYPE_UI;
+const virtualJoystickCutoff = 0.8;
 
 AFRAME.registerComponent("cursor-controller", {
   dependencies: ["raycaster", "line"],
@@ -263,7 +264,7 @@ AFRAME.registerComponent("cursor-controller", {
 
     for (let i = e.touches.length - 1; i >= 0; i--) {
       const touch = e.touches[i];
-      if (touch.clientY / window.innerHeight < 0.8) {
+      if (touch.clientY / window.innerHeight < virtualJoystickCutoff) {
         this.activeTouch = touch;
         break;
       }
@@ -299,7 +300,7 @@ AFRAME.registerComponent("cursor-controller", {
     for (let i = 0; i < e.touches.length; i++) {
       const touch = e.touches[i];
       if (
-        (!this.activeTouch && touch.clientY / window.innerHeight < 0.8) ||
+        (!this.activeTouch && touch.clientY / window.innerHeight < virtualJoystickCutoff) ||
         (this.activeTouch && touch.identifier === this.activeTouch.identifier)
       ) {
         this.mousePos.set(touch.clientX / window.innerWidth * 2 - 1, -(touch.clientY / window.innerHeight) * 2 + 1);
diff --git a/src/components/in-world-hud.js b/src/components/in-world-hud.js
index 7633414b6..2077b7ef2 100644
--- a/src/components/in-world-hud.js
+++ b/src/components/in-world-hud.js
@@ -9,9 +9,9 @@ AFRAME.registerComponent("in-world-hud", {
     this.bubble = this.el.querySelector(".bubble");
     this.background = this.el.querySelector(".bg");
     const renderOrder = window.APP.RENDER_ORDER;
-    this.mic.object3DMap.mesh.renderOrder = renderOrder.HUD;
-    this.freeze.object3DMap.mesh.renderOrder = renderOrder.HUD;
-    this.bubble.object3DMap.mesh.renderOrder = renderOrder.HUD;
+    this.mic.object3DMap.mesh.renderOrder = renderOrder.HUD_ICONS;
+    this.freeze.object3DMap.mesh.renderOrder = renderOrder.HUD_ICONS;
+    this.bubble.object3DMap.mesh.renderOrder = renderOrder.HUD_ICONS;
     this.background.object3DMap.mesh.renderORder = renderOrder.HUD_BACKGROUND;
 
     this.updateButtonStates = () => {
diff --git a/src/hub.js b/src/hub.js
index ace531434..b8906fd0f 100644
--- a/src/hub.js
+++ b/src/hub.js
@@ -79,6 +79,11 @@ import { DEFAULT_ENVIRONMENT_URL } from "./assets/environments/environments";
 import { App } from "./App";
 
 window.APP = new App();
+window.APP.RENDER_ORDER = {
+  HUD_BACKGROUND: 1,
+  HUD_ICONS: 2,
+  CURSOR: 3
+};
 const store = window.APP.store;
 
 const qs = queryString.parse(location.search);
@@ -89,11 +94,6 @@ if (qs.quality) {
 } else {
   window.APP.quality = isMobile ? "low" : "high";
 }
-window.APP.RENDER_ORDER = {
-  HUD_BACKGROUND: 1,
-  HUD: 2,
-  CURSOR: 3
-};
 
 import "aframe-physics-system";
 import "aframe-physics-extras";
@@ -177,7 +177,7 @@ const onReady = async () => {
   const scene = document.querySelector("a-scene");
   const hubChannel = new HubChannel(store);
 
-  document.querySelector("a-scene canvas").classList.add("blurred");
+  document.querySelector("canvas").classList.add("blurred");
   window.APP.scene = scene;
 
   registerNetworkSchemas();
@@ -222,7 +222,7 @@ const onReady = async () => {
     const scene = document.querySelector("a-scene");
     scene.renderer.sortObjects = true;
     const playerRig = document.querySelector("#player-rig");
-    document.querySelector("a-scene canvas").classList.remove("blurred");
+    document.querySelector("canvas").classList.remove("blurred");
     scene.render();
 
     if (enterInVR) {
-- 
GitLab