From d8f07aa30d2f2111657e47c82575ed44cd3cb957 Mon Sep 17 00:00:00 2001 From: Avaer Kazmer Date: Mon, 30 Sep 2019 00:16:02 -0400 Subject: [PATCH] Hack --- app.html | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app.html b/app.html index 3261922..513821c 100644 --- a/app.html +++ b/app.html @@ -6093,6 +6093,8 @@ const zDest = teleportMesh.position.z; const zDist = zDest - vrCamera.position.z; + console.log('teleport mesh', xDist, zDist); + window.document.xrOffset.position[0] -= xDist; window.document.xrOffset.position[2] -= zDist; window.document.xrOffset.pushUpdate(); @@ -6122,6 +6124,7 @@ lastPresseds[i] = pressed; const pad = gamepad.buttons[0].pressed || gamepad.axes[1] <= -0.5 || gamepad.axes[3] <= -0.5; + console.log('got axes', pad, gamepad.axes.join(',')); const lastPad = lastPads[i]; _handlePad(gamepad, i, pad, lastPad); lastPads[i] = pad; @@ -6280,7 +6283,7 @@ for (let i = 0; i < 2; i++) { const gamepad = gamepads[i]; - if (gamepad && gamepad.buttons[0].pressed) { + if (gamepad && (gamepad.buttons[0].pressed || gamepad.axes[1] <= -0.5 || gamepad.axes[3] <= -0.5)) { const controllerIndex = _getControllerIndex(gamepad); const teleportMesh = teleportMeshes[controllerIndex];