26 #include "org_osvr_example_Tracker_json.h"
47 m_dev.initAsync(ctx,
"Tracker", opts);
50 m_dev.sendJsonDescriptor(org_osvr_example_Tracker_json);
53 m_dev.registerUpdateCallback(
this);
56 OSVR_ReturnCode update() {
58 std::this_thread::sleep_for(std::chrono::milliseconds(
81 class HardwareDetection {
83 HardwareDetection() : m_found(false) {}
109 context.registerHardwareDetectCallback(
new HardwareDetection());
Wrapper class for OSVR_DeviceToken.
struct OSVR_TrackerDeviceInterfaceObject * OSVR_TrackerDeviceInterface
Opaque type used in conjunction with a device token to send data on a tracker interface.
void osvrTimeValueGetNow(OSVR_TimeValue *dest)
Gets the current time in the TimeValue. Parallel to gettimeofday.
C++ wrapper class for the opaque plugin context.
OSVR_ReturnCode osvrDeviceTrackerSendPose(OSVR_DeviceToken dev, OSVR_TrackerDeviceInterface iface, OSVR_PoseState const *val, OSVR_ChannelCount sensor)
Report the full rigid body pose of a sensor, automatically generating a timestamp.
double data[3]
Internal array data.
T * registerObjectForDeletion(OSVR_PluginRegContext ctx, T *obj)
Registers an object to be destroyed with delete when the plugin is unloaded.
struct OSVR_DeviceInitObject * OSVR_DeviceInitOptions
Opaque type of a device initialization object.
#define OSVR_RETURN_SUCCESS
The "success" value for an OSVR_ReturnCode.
OSVR_DeviceInitOptions osvrDeviceCreateInitOptions(OSVR_PluginRegContext ctx)
Create a OSVR_DeviceInitOptions object.
Header including the full PluginKit C++ interface.
#define OSVR_PLUGIN(PLUGIN_NAME)
This macro begins the entry point function of your plugin.
OSVR_TimeValue_Microseconds microseconds
Microseconds portion of the time value.
A structure defining a 3D (6DOF) rigid body pose: translation and rotation.
OSVR_ReturnCode osvrDeviceTrackerConfigure(OSVR_DeviceInitOptions opts, OSVR_TrackerDeviceInterface *iface)
Specify that your device will implement the Tracker interface.
OSVR_EXTERN_C_BEGIN typedef void * OSVR_PluginRegContext
A context pointer passed in to your plugin's entry point and other locations of control flow transfer...
void osvrPose3SetIdentity(OSVR_Pose3 *pose)
Set a pose to identity.
Standardized, portable parallel to struct timeval for representing both absolute times and time inter...
OSVR_Vec3 translation
Position vector.
OSVR_TimeValue_Seconds seconds
Seconds portion of the time value.