| 64 | } |
| 65 | |
| 66 | int main() { |
| 67 | osvr::clientkit::ClientContext context( |
| 68 | "com.osvr.exampleclients.TrackerCallback"); |
| 69 | |
| 70 | // This is just one of the paths. You can also use: |
| 71 | // /me/hands/right |
| 72 | // /me/head |
| 73 | osvr::clientkit::Interface lefthand = |
| 74 | context.getInterface("/me/hands/left"); |
| 75 | |
| 76 | // The coordinate system is right-handed, with X to the right, Y up, and Z |
| 77 | // near. |
| 78 | lefthand.registerCallback(&myTrackerCallback, NULL); |
| 79 | |
| 80 | /// If you just want orientation |
| 81 | lefthand.registerCallback(&myOrientationCallback, NULL); |
| 82 | |
| 83 | /// or position |
| 84 | lefthand.registerCallback(&myPositionCallback, NULL); |
| 85 | |
| 86 | // Pretend that this is your application's mainloop. |
| 87 | for (int i = 0; i < 1000000; ++i) { |
| 88 | context.update(); |
| 89 | } |
| 90 | |
| 91 | std::cout << "Library shut down, exiting." << std::endl; |
| 92 | return 0; |
| 93 | } |
nothing calls this directly
no test coverage detected