|
@@ -122,6 +122,8 @@ int main(int argc, char** argv)
|
|
|
|
|
|
printf("\n\n");
|
|
|
|
|
|
+ int device_class = 0;
|
|
|
+ ohmd_device_geti(hmd, OHMD_DEVICE_CLASS, &device_class);
|
|
|
// Ask for n rotation quaternions and position vectors
|
|
|
for(int i = 0; i < 10000; i++){
|
|
|
ohmd_ctx_update(ctx);
|
|
@@ -137,13 +139,15 @@ int main(int argc, char** argv)
|
|
|
print_infof(hmd, "position vec: ", 3, OHMD_POSITION_VECTOR);
|
|
|
|
|
|
// read controls
|
|
|
- float control_state[256];
|
|
|
- ohmd_device_getf(hmd, OHMD_CONTROLS_STATE, control_state);
|
|
|
-
|
|
|
- printf("%-25s", "controls state:");
|
|
|
- for(int i = 0; i < control_count; i++)
|
|
|
- {
|
|
|
- printf("%f ", control_state[i]);
|
|
|
+ if (device_class & OHMD_DEVICE_CLASS_CONTROLLER) {
|
|
|
+ float control_state[256];
|
|
|
+ ohmd_device_getf(hmd, OHMD_CONTROLS_STATE, control_state);
|
|
|
+
|
|
|
+ printf("%-25s", "controls state:");
|
|
|
+ for(int i = 0; i < control_count; i++)
|
|
|
+ {
|
|
|
+ printf("%f ", control_state[i]);
|
|
|
+ }
|
|
|
}
|
|
|
puts("");
|
|
|
|