Skip to content

Conversation

@ngokevin
Copy link
Member

@ngokevin ngokevin commented Aug 8, 2017

Description:

Shouldn't try to run any WASD controls code if we're not using WASD (e.g., in real VR).

Changes proposed:

  • Add early return to wasd-controls tick to not run updateVelocity if no keys have been pressed and no velocity to decay. Keep better track of what relevant keys have been pressed to be able to detect this.
  • Re-use object for updating position.
if (!velocity[data.adAxis] && !velocity[data.wsAxis]) { return; }

// Get movement vector and translate position.
currentPosition = el.object3D.position;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would keep using getAttribute to keep using the public API instead of coupling with the internals. I don't think there's any difference.

@dmarcos dmarcos merged commit 5010ad6 into aframevr:master Aug 9, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

2 participants