Skip to main content
Up and Coming
May 27, 2014

Posef is missing in v0.32

Perhaps the first thing anyone wants to do with the SDK is see if they can get the Euler angles from the tracker.
Unfortunately the documentation is even more wrong than it was in v0.31, because Posef that the documentation tells you to use doesn't exist.

Here is how I read the sensor instead (in Doom 3's angle system):


#include <windows.h>
#include "OVR_CAPI.h"
#include "Kernel/OVR_Math.h"

void ReadHmdOrientation(float *roll, float *pitch, float *yaw)
{
if (hmd)
{
ovrSensorState ss = ovrHmd_GetSensorState(hmd, 0.0);
if (ss.StatusFlags & (ovrStatus_OrientationTracked))
{
OVR::Transformf pose = ss.Recorded.Pose; // can't use prediction without frame timing
float y = 0.0f, p = 0.0f, r = 0.0f;
pose.Rotation.GetEulerAngles<OVR::Axis_Y, OVR::Axis_X, OVR::Axis_Z>(&y, &p, &r);
*roll = -RADIANS_TO_DEGREES(r); // ???
*pitch = -RADIANS_TO_DEGREES(p); // should be degrees down
*yaw = RADIANS_TO_DEGREES(y); // should be degrees left
}
}
}


I hope that helps someone.

    1 reply

    Inspiring
    May 27, 2014
    Pose was renamed Transform in 0.3.2. See this diff. Possibly not all the documentation has caught up.
    Brad Davis - Developer for High Fidelity Co-author of Oculus Rift in Action