Hi I have a Unity app which uses google Cardboard SDK to enable stereoscopic view so I will have a VR enabled app. My app runs perfectly fine.
But there is a problem if
It appears the native code that the SDK uses to read the gyro is hardcoded for Landscape Left orientation only. This can be worked around by editing BaseCardboardDevice.cs and replacing the definition of UpdateState() with the following code:
private Quaternion fixOrientation;
public override void UpdateState() {
GetHeadPose(headData, Time.smoothDeltaTime);
ExtractMatrix(ref headView, headData);
headPose.SetRightHanded(headView.inverse);
// Fix head pose based on device orientation (since native code assumes Landscape Left).
switch (Input.deviceOrientation) {
case DeviceOrientation.LandscapeLeft:
fixOrientation = Quaternion.identity;
return;
case DeviceOrientation.LandscapeRight:
fixOrientation = Quaternion.Euler(0, 0, 180);
break;
}
headPose.Set(headPose.Position, headPose.Orientation * fixOrientation);
}
I suggest turning off the Neck Model Scale (set it to 0) in the Cardboard settings too, since it won't come out right with this code.