Unity Cardboard Orientation Landscape Right Upside Down

前端 未结 5 640
挽巷
挽巷 2021-01-21 10:25

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

5条回答
  •  无人共我
    2021-01-21 10:53

            var fixOrientation = Quaternion.identity;
            // Fix head pose based on device orientation (since native code assumes Landscape Left).
            switch (Input.deviceOrientation) {
            case DeviceOrientation.LandscapeLeft:
                fixOrientation = Quaternion.identity;
                break;
            case DeviceOrientation.LandscapeRight:
                fixOrientation = Quaternion.Euler(0, 0, 180);
                break;
            default:
                Debug.Log ("Error No Orientation" + Input.deviceOrientation.ToString ());
                break;
            }
            headPose.Set(headPose.Position, headPose.Orientation * fixOrientation);
    

    Now, Cardboard SDK became GoogleVR, so I wrote like this at GvrDevice.cs

提交回复
热议问题