From 47753f159bd09e71966b2b579cee08b33b0f0801 Mon Sep 17 00:00:00 2001
From: Brian Peiris <brianpeiris@gmail.com>
Date: Thu, 22 Feb 2018 01:43:05 +0000
Subject: [PATCH] remove arScale. use avatarScale instead

---
 src/components/character-controller.js | 13 +++++++------
 templates/room.hbs                     |  2 +-
 2 files changed, 8 insertions(+), 7 deletions(-)

diff --git a/src/components/character-controller.js b/src/components/character-controller.js
index 3631c2a1e..bf1378024 100644
--- a/src/components/character-controller.js
+++ b/src/components/character-controller.js
@@ -11,7 +11,6 @@ AFRAME.registerComponent("character-controller", {
     pivot: { type: "selector" },
     snapRotationDegrees: { default: THREE.Math.DEG2RAD * 45 },
     rotationSpeed: { default: -3 },
-    arScale: { type: 'number' }
   },
 
   init: function() {
@@ -26,8 +25,10 @@ AFRAME.registerComponent("character-controller", {
   },
 
   update: function() {
-    const qsArScale = parseInt(qs.arScale, 10);
-    this.arScale = {x: qsArScale || this.data.arScale, y: qsArScale || this.data.arScale, z: qsArScale || this.data.arScale};
+    const avatarScale = parseInt(qs.avatarScale, 10);
+    if (avatarScale) {
+      this.avatarScale = {x: avatarScale, y: avatarScale, z: avatarScale};
+    }
     this.leftRotationMatrix = new THREE.Matrix4().makeRotationY(
       this.data.snapRotationDegrees
     );
@@ -136,9 +137,9 @@ AFRAME.registerComponent("character-controller", {
 
       this.el.setAttribute("position", root.position);
 
-      // Apply AR scale
-      if (this.data.arScale && qs.arScale) {
-          this.el.setAttribute('scale', this.arScale);
+      // Apply avatar scale
+      if (this.avatarScale) {
+          this.el.setAttribute('scale', this.avatarScale);
       }
 
       this.pendingSnapRotationMatrix.identity(); // Revert to identity
diff --git a/templates/room.hbs b/templates/room.hbs
index 7c45add06..6457c7904 100644
--- a/templates/room.hbs
+++ b/templates/room.hbs
@@ -129,7 +129,7 @@
             networked="template: #player-template;"
             spawn-controller="radius: 4;"
             wasd-to-analog2d
-            character-controller="pivot: #head; arScale: 4"
+            character-controller="pivot: #head;"
         >
             <a-entity
                 id="head"
-- 
GitLab