MCPcopy Create free account
hub / github.com/OSVR/OSVR-Core / main

Function main

examples/clients/TrackerCallback.cpp:66–93  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

64}
65
66int 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}

Callers

nothing calls this directly

Calls 3

registerCallbackMethod · 0.80
getInterfaceMethod · 0.45
updateMethod · 0.45

Tested by

no test coverage detected