-
Notifications
You must be signed in to change notification settings - Fork 11
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
Get correct device orientation from Cardboard SDK #6
Comments
I think the float array for orientation from native to Unity is not transferred the right way. I found this by: The orientation values from the native side (printed on log in xcode) does not match with values on unity side. |
@cai-mobfish |
CACurrentMediaTime is iOS native method. Some other equivalent method in c# or unity is needed here. On Android, the equivalent is written in util, with some extra calculation. https://github.com/googlevr/cardboard/blob/master/hellocardboard-android/src/main/jni/util.cc
|
iOS code:
Android code:
The goal is to have a monotonic time in nanoseconds. |
Do a refactor, push the branch. |
Done. |
Technical Detail
Currently,
Input.gyro
is used to retrieve and calculate device orientation, because there are problems with cardboard way to get the orientation. The quaternion needs converted, but the bigger issue is, the "rotation speed" is almost 2 times faster, rotate device 90 degrees makes in-game camera 180 degrees rotation. Somethings are definately wrong with the usage.Related file is
CardboardHeadTracker.cs
The text was updated successfully, but these errors were encountered: