38 void myTrackerCallback(
void *userdata,
const OSVR_TimeValue *timestamp,
40 printf(
"Got POSE report: Position = (%f, %f, %f), orientation = (%f, %f, "
50 void myOrientationCallback(
void *userdata,
const OSVR_TimeValue *timestamp,
52 printf(
"Got ORIENTATION report: Orientation = (%f, %f, %f, %f)\n",
58 void myPositionCallback(
void *userdata,
const OSVR_TimeValue *timestamp,
60 printf(
"Got POSITION report: Position = (%f, %f, %f)\n",
88 for (i = 0; i < 1000000; ++i) {
93 printf(
"Library shut down, exiting.\n");
OSVR_PoseState pose
The pose structure, containing a position vector and a rotation quaternion.
OSVR_ReturnCode osvrClientGetInterface(OSVR_ClientContext ctx, const char path[], OSVR_ClientInterface *iface)
Get the interface associated with the given path.
OSVR_ReturnCode osvrRegisterOrientationCallback(OSVR_ClientInterface iface, OSVR_OrientationCallback cb, void *userdata)
Register a callback for Orientation reports on an interface.
double osvrQuatGetY(OSVR_Quaternion const *q)
Accessor for quaternion component Y.
OSVR_ReturnCode osvrRegisterPoseCallback(OSVR_ClientInterface iface, OSVR_PoseCallback cb, void *userdata)
Register a callback for Pose reports on an interface.
OSVR_ClientContext osvrClientInit(const char applicationIdentifier[], uint32_t flags=0)
Initialize the library.
OSVR_Quaternion rotation
Orientation as a unit quaternion.
double data[3]
Internal array data.
OSVR_ReturnCode osvrRegisterPositionCallback(OSVR_ClientInterface iface, OSVR_PositionCallback cb, void *userdata)
Register a callback for Position reports on an interface.
double osvrQuatGetX(OSVR_Quaternion const *q)
Accessor for quaternion component X.
OSVR_ReturnCode osvrClientShutdown(OSVR_ClientContext ctx)
Shutdown the library.
struct OSVR_ClientContextObject * OSVR_ClientContext
Opaque handle that should be retained by your application. You need only and exactly one...
OSVR_ReturnCode osvrClientUpdate(OSVR_ClientContext ctx)
Updates the state of the context - call regularly in your mainloop.
Report type for an orientation callback on a tracker interface.
double osvrQuatGetW(OSVR_Quaternion const *q)
Accessor for quaternion component W.
OSVR_PositionState xyz
The position vector.
Report type for a position callback on a tracker interface.
struct OSVR_ClientInterfaceObject * OSVR_ClientInterface
Opaque handle to an interface used for registering callbacks and getting status.
Standardized, portable parallel to struct timeval for representing both absolute times and time inter...
OSVR_OrientationState rotation
The rotation unit quaternion.
double osvrQuatGetZ(OSVR_Quaternion const *q)
Accessor for quaternion component Z.
OSVR_Vec3 translation
Position vector.
Report type for a pose (position and orientation) callback on a tracker interface.