diff --git a/src/components/character-controller.js b/src/components/character-controller.js index 3631c2a1eec0fb3c8e3515e699b97637a7eec6e7..bf137802415e45f687cbbbfdd7581740faa77e5c 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 7c45add06989a4b4f94ff0c1ff4dca14972f48f9..6457c7904990e37fa5b88f4effe4dd0e49d42e7b 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"