35 void myTrackerCallback(
void * ,
38 std::cout <<
"Got POSE report: Position = ("
48 void myOrientationCallback(
void * ,
51 std::cout <<
"Got ORIENTATION report: Orientation = ("
58 void myPositionCallback(
void * ,
61 std::cout <<
"Got POSITION report: Position = (" << report->
xyz.
data[0]
68 "com.osvr.exampleclients.TrackerCallback");
78 lefthand.registerCallback(&myTrackerCallback, NULL);
81 lefthand.registerCallback(&myOrientationCallback, NULL);
84 lefthand.registerCallback(&myPositionCallback, NULL);
87 for (
int i = 0; i < 1000000; ++i) {
91 std::cout <<
"Library shut down, exiting." << std::endl;
OSVR_PoseState pose
The pose structure, containing a position vector and a rotation quaternion.
Interface handle object. Typically acquired from a ClientContext.
Client context object: Create and keep one in your application. Handles lifetime management and provi...
double osvrQuatGetY(OSVR_Quaternion const *q)
Accessor for quaternion component Y.
OSVR_Quaternion rotation
Orientation as a unit quaternion.
double data[3]
Internal array data.
Interface getInterface(const std::string &path)
Get the interface associated with the given path.
double osvrQuatGetX(OSVR_Quaternion const *q)
Accessor for quaternion component X.
Report type for an orientation callback on a tracker interface.
void update()
Updates the state of the context - call regularly in your mainloop.
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.
Header containing the inline implementation of Interface.
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.