From 4f002353ff2da3816d9bec4fbcd91d1a706f494d Mon Sep 17 00:00:00 2001
From: johnshaughnessy <johnfshaughnessy@gmail.com>
Date: Mon, 22 Oct 2018 14:15:04 -0700
Subject: [PATCH]  Remove (misnamed) "jump" from character controller

---
 src/components/character-controller.js             | 14 +++-----------
 .../userinput/bindings/xbox-controller-user.js     | 10 ----------
 src/systems/userinput/paths.js                     |  5 -----
 3 files changed, 3 insertions(+), 26 deletions(-)

diff --git a/src/components/character-controller.js b/src/components/character-controller.js
index 6aeb0797b..05bb83ff3 100644
--- a/src/components/character-controller.js
+++ b/src/components/character-controller.js
@@ -103,7 +103,6 @@ AFRAME.registerComponent("character-controller", {
     const pivotRotationInvMatrix = new THREE.Matrix4();
     const startPos = new THREE.Vector3();
     const startScale = new THREE.Vector3();
-    const jump = new THREE.Vector3();
 
     return function(t, dt) {
       const deltaSeconds = dt / 1000;
@@ -125,13 +124,6 @@ AFRAME.registerComponent("character-controller", {
       if (userinput.readFrameValueAtPath(paths.actions.snapRotateRight)) {
         this.snapRotateRight();
       }
-      jump.set(0, 0, 0);
-      if (userinput.readFrameValueAtPath(paths.actions.translate.up)) {
-        jump.y += userinput.readFrameValueAtPath(paths.actions.translate.up);
-      }
-      if (userinput.readFrameValueAtPath(paths.actions.translate.down)) {
-        jump.y -= userinput.readFrameValueAtPath(paths.actions.translate.down);
-      }
       const acc = userinput.readFrameValueAtPath(paths.actions.characterAcceleration);
       if (acc) {
         this.accelerationInput.set(acc[0], 0, acc[1]);
@@ -149,9 +141,9 @@ AFRAME.registerComponent("character-controller", {
 
       const boost = userinput.readFrameValueAtPath(paths.actions.boost) ? 2 : 1;
       move.makeTranslation(
-        jump.x + this.velocity.x * distance * boost,
-        jump.y + this.velocity.y * distance * boost,
-        jump.z + this.velocity.z * distance * boost
+        this.velocity.x * distance * boost,
+        this.velocity.y * distance * boost,
+        this.velocity.z * distance * boost
       );
       yawMatrix.makeRotationAxis(rotationAxis, rotationDelta);
 
diff --git a/src/systems/userinput/bindings/xbox-controller-user.js b/src/systems/userinput/bindings/xbox-controller-user.js
index 460f3b1f5..b9d230a79 100644
--- a/src/systems/userinput/bindings/xbox-controller-user.js
+++ b/src/systems/userinput/bindings/xbox-controller-user.js
@@ -161,16 +161,6 @@ export const xboxControllerUserBindings = {
       dest: { value: paths.actions.snapRotateRight },
       xform: xforms.rising
     },
-    {
-      src: { value: button("dpadUp").pressed },
-      dest: { value: paths.actions.translate.up },
-      xform: xforms.scale(0.1)
-    },
-    {
-      src: { value: button("dpadDown").pressed },
-      dest: { value: paths.actions.translate.down },
-      xform: xforms.scale(0.1)
-    },
     {
       dest: { value: "var/vec2/zero" },
       xform: xforms.vec2Zero
diff --git a/src/systems/userinput/paths.js b/src/systems/userinput/paths.js
index d4cc4994c..9ec460491 100644
--- a/src/systems/userinput/paths.js
+++ b/src/systems/userinput/paths.js
@@ -11,11 +11,6 @@ paths.actions.characterAcceleration = "/actions/characterAcceleration";
 paths.actions.boost = "/actions/boost";
 paths.actions.startGazeTeleport = "/actions/startTeleport";
 paths.actions.stopGazeTeleport = "/actions/stopTeleport";
-paths.actions.translate = {};
-paths.actions.translate.forward = "/actions/translate/forward";
-paths.actions.translate.backward = "/actions/translate/backward";
-paths.actions.translate.up = "/actions/translate/up";
-paths.actions.translate.down = "/actions/translate/down";
 paths.actions.spawnPen = "/actions/spawnPen";
 paths.actions.cursor = {};
 paths.actions.cursor.pose = "/actions/cursorPose";
-- 
GitLab