Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Javascript errors & black screen when Enter, then exit, then re-enter VR #22

Open
leweaver opened this issue Jan 9, 2018 · 0 comments

Comments

@leweaver
Copy link

leweaver commented Jan 9, 2018

System
OS: Windows 10 Fall Creators Update
Browser: Edge
Headset: Windows Mixed Reality with Motion Controllers

Repo steps:

  1. Ensure controllers are powered on and connected
  2. Navigate to site, and Enter VR
  3. Press the Windows Key on the controller to Exit VR
  4. Press the Enter VR button to re-enter VR

Observed issue
JavaScript errors flood the console and nothing is rendered to the headset. I traced the javascript error to this line, which fails as pose.orientation is null:

this.armModel.setControllerOrientation(( new THREE.Quaternion() ).fromArray( pose.orientation ));

I believe this issue appears because you are caching the gamepad object between frames; but VRController does not get a chance to emit the 'on gamepad disconnected' event, since you do not update the controls when not presenting:

if (vrEffect.isPresenting) {

This causes the gamepad object to become stale and invalid when requestPresent is called a second time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant