Skip to content
This repository has been archived by the owner on Nov 8, 2019. It is now read-only.

When using InstantPreview GvrVRHelpers.GetHeadRotation(); doesnt work anymore. #865

Closed
whizzkid opened this issue Mar 8, 2018 · 4 comments

Comments

@whizzkid
Copy link

whizzkid commented Mar 8, 2018

Summary:
When InstantPreview is working (i.e. connected to your phone) then GvrVRHelpers.GetHeadRotation(); doesnt return the correct angle anymore.

Found using:

  • Google VR SDK version: 1.120.0
  • Unity version: 2017.3.1p3
  • Phone manufacturer, model, and O/S version: Samsung galaxy s6
  • Viewer manufacturer & model:

Steps to reproduce the issue:

  1. turn on Instant Preview
  2. run your scene, and have it connect to a phone
  3. try to access GvrVRHelpers.GetHeadRotation();

Workarounds:
use Camera.main.transform.rotation; instead.

Additional comments:

@ddrocco
Copy link

ddrocco commented Mar 29, 2018

Thanks for reporting; we'll take a look!

@whizzkid
Copy link
Author

Also, when you use the GyroController https://developers.google.com/vr/develop/unity/guides/magic-window GetHeadRotation doesn't work properly because the GyroController just changes the camera's rotation.. so you'll manually have to workaround that again.

It would be cool if you could actually SetHeadRotation for situations like this.

@ddrocco
Copy link

ddrocco commented Apr 30, 2018

Hi, we've addressed the first problem, and it should be live with our next release on 5/28. If you want to make a local change on your end before that, it was an issue with branching in the GetHeadRotation's editor code. We've added the following lines inside the #if UNITY_EDITOR statement:

if (InstantPreview.Instance.IsCurrentlyConnected != null) {
return Camera.main.transform.localRotation;
} else {
//prior behavior
}

Regarding the second problem, we'll take a look at detecting the GyroController behavior and getting rotation accordingly.

Accommodating a SetHeadRotation method would be useful, but would require a larger refactor to work well. We'll look into it and let you know what we decide!

@rusmaxham
Copy link
Contributor

This is now fixed in the latest release.

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

No branches or pull requests

3 participants