Skip to content

WASD / Controller Input #8

Description

@IstoraMandiri

Hi, Loving the VR. Thanks for the library.

Just wanted to ask if you've seen an example of combining this with movement controls, such as using WASD or a Gamepad?

EDIT: it was easier than I thought. Just add something like the following inside requestAnimationFrame

pad = navigator.getGamepads()[0]
if pad
  camera.translateX pad.axes[0]
  camera.translateZ pad.axes[1]
  camera.translateY pad.buttons[0].value*-1 + pad.buttons[1].value

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions