Forum Discussion
MattPeddlesden
11 years agoHonored Guest
Rotation Tracking Problem
Hi, I'm having a problem with rotation tracking - but before I get to the current issue, let me describe an issue I had during initial integration as I have a rumble in my tummy that my solution wa...
kojack
11 years agoMVP
The orientation/rotation difference here is due to the mix of C and C++ in the api.
The C api has an ovrPosef structure that contains the orientation as an ovrQuatf called "Orientation".
The C++ api has a Pose class that contains the orientation as a Quat called "Rotation".
Both ovrQuatf and Quat are quaternions (a 4D value describing rotations around an axis), but ovrQuatf has no member functions (since it's in C) while Quat is a C++ class with a full range of methods such as GetEulerAngles.
Quaternions can be tricky to understand. Have a look here for more details: http://www.euclideanspace.com/maths/algebra/realNormedAlgebra/quaternions
A lot of engines use them and they have a lot of good properties.
It's kind of like poking a stick through an object in any direction, then twisting the stick to rotate the entire object. But the angle of twist and the direction of the stick (rotation axis) aren't stored in the quaternion directly. Instead, the quaternion contains:
w = cos(angle/2)
x,y,z = axis * sin(angle/2)
The C api has an ovrPosef structure that contains the orientation as an ovrQuatf called "Orientation".
The C++ api has a Pose class that contains the orientation as a Quat called "Rotation".
Both ovrQuatf and Quat are quaternions (a 4D value describing rotations around an axis), but ovrQuatf has no member functions (since it's in C) while Quat is a C++ class with a full range of methods such as GetEulerAngles.
Quaternions can be tricky to understand. Have a look here for more details: http://www.euclideanspace.com/maths/algebra/realNormedAlgebra/quaternions
A lot of engines use them and they have a lot of good properties.
It's kind of like poking a stick through an object in any direction, then twisting the stick to rotate the entire object. But the angle of twist and the direction of the stick (rotation axis) aren't stored in the quaternion directly. Instead, the quaternion contains:
w = cos(angle/2)
x,y,z = axis * sin(angle/2)
Quick Links
- Horizon Developer Support
- Quest User Forums
- Troubleshooting Forum for problems with a game or app
- Quest Support for problems with your device
Other Meta Support
Related Content
- 2 years ago
- 1 year ago
- 2 months ago