cancel
Showing results for 
Search instead for 
Did you mean: 

Getting HMD headings in Native app?

scottoculus
Protege
I know how to get HMD heading in degrees in Unity.  Whats' the recommended method with  Native 1.0?
3 REPLIES 3

owenwp
Expert Protege
There are plenty of code snippets you can google for computing euler angles from a quaternion or matrix.  You have to decide for yourself how to handle gimbal lock at the poles.

scottoculus
Protege
So Oculus doesn't have even basic methods of providing headings? All I'm looking for is the same as Unity provides - euler.

joan
Protege
Saying just "Euler" is super ambiguous. Anyway, you can have a look at OVR_Math.h and especially Quat::GetEulerAngles and Matrix4::ToEulerAngles.

The difference with Unity is that the native API doesn't assume it knows your coordinate system, so you will probably have to work a little more to make sure you get what you want. There are a lot of ways to describe rotations.