Skip to content

Commit

Permalink
Hack
Browse files Browse the repository at this point in the history
  • Loading branch information
Avaer Kazmer committed Sep 30, 2019
1 parent dc5875e commit d8f07aa
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion app.html
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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];

Expand Down

0 comments on commit d8f07aa

Please sign in to comment.