cgv
vr_info.h
1 #pragma once
2 
3 #include <iostream>
4 #include <map>
5 #include "vr_state.h"
6 
7 #include "lib_begin.h"
8 
11 
13 namespace vr {
15  struct CGV_API vr_device_info
16  {
18  std::string serial_number;
20  std::string model_number;
22  std::map<std::string, std::string> variable_parameters;
25  };
26 
28  extern CGV_API std::ostream& operator << (std::ostream& os, const vr_device_info& DI);
29 
31  struct CGV_API vr_trackable_info : public vr_device_info
32  {
34  std::string device_type;
36  int32_t device_class;
47  };
48 
50  extern CGV_API std::ostream& operator << (std::ostream& os, const vr_trackable_info& TI);
51 
53  struct CGV_API vr_hmd_info : public vr_trackable_info
54  {
60  float fps;
62  float ipd;
66  int32_t number_cameras;
67  /*
69  float imu_to_head_transform[12];
71  float imu_gyro_bias[3];
73  float imu_gyro_scale[3];
75  float imu_accelerometer_bias[3];
77  float imu_accelerometer_scale[3];
78  */
82  vr_hmd_info();
83  };
85  extern CGV_API std::ostream& operator << (std::ostream& os, const vr_hmd_info& HI);
86 
89  VRC_NONE = 0,
90  VRC_CONTROLLER = 1,
91  VRC_TRACKER = 2
92  };
95  VRC_NOT_ASSIGNED = 0,
96  VRC_LEFT_HAND,
97  VRC_RIGHT_HAND,
98  VRC_TREADMILL,
99  VRC_STYLUS,
100  VRC_ROLE_END
101  };
103  enum VRInputType {
104  VRI_NONE,
105  VRI_TRIGGER,
106  VRI_PAD,
107  VRI_STICK
108  };
110  enum VRAxisType {
111  VRA_NONE = 0,
112  VRA_TRIGGER = 1,
113  VRA_PAD_X = 2,
114  VRA_PAD_Y = 3,
115  VRA_STICK_X = 4,
116  VRA_STICK_Y = 5
117  };
119  struct CGV_API vr_controller_info : public vr_trackable_info
120  {
126  int32_t nr_inputs;
130  int32_t nr_axes;
132 
140  };
142  extern CGV_API std::ostream& operator << (std::ostream& os, const vr_controller_info& CI);
143 
145  struct CGV_API vr_kit_info
146  {
154  vr_kit_info();
155  };
157  extern CGV_API std::ostream& operator << (std::ostream& os, const vr_kit_info& VI);
158 
161  {
163  std::string mode;
165  float z_near, z_far;
167  float frustum[4];
170  };
172  extern CGV_API std::ostream& operator << (std::ostream& os, const vr_tracking_reference_info& TI);
173 
175  struct CGV_API vr_tracking_system_info
176  {
178  std::string name;
180  std::map<std::string, vr_tracking_reference_info> references;
183  };
185  extern CGV_API std::ostream& operator << (std::ostream& os, const vr_tracking_system_info& TSI);
186 }
187 
vr::vr_controller_info::role
VRControllerRole role
controller role
Definition: vr_info.h:124
vr::vr_trackable_info::device_class
int32_t device_class
index of device class
Definition: vr_info.h:36
vr::vr_tracking_reference_info::z_near
float z_near
near and far clipping planes of tracking frustum in meters
Definition: vr_info.h:165
vr::vr_tracking_system_info::references
std::map< std::string, vr_tracking_reference_info > references
map from serial number to info of corresponding tracking reference
Definition: vr_info.h:180
vr::vr_kit_info
information provided for a vr kit
Definition: vr_info.h:146
vr::vr_tracking_reference_info::mode
std::string mode
tracking mode string
Definition: vr_info.h:163
vr::vr_device_info::variable_parameters
std::map< std::string, std::string > variable_parameters
a map from parameter name to parameter value used for all device parameters that are not explicitly d...
Definition: vr_info.h:22
vr::vr_hmd_info::head_to_eye_distance
float head_to_eye_distance
distance from head origin to eye centers in meters
Definition: vr_info.h:64
vr::VRButtonStateFlags
VRButtonStateFlags
one flag for each vr controller button
Definition: vr_state.h:62
vr::vr_device_info::serial_number
std::string serial_number
unique identifier of device
Definition: vr_info.h:18
vr::vr_trackable_info::is_wireless
bool is_wireless
whether device is wireless
Definition: vr_info.h:38
vr::vr_controller_info
information provided for controller devices
Definition: vr_info.h:120
vr::vr_hmd_info::fps
float fps
frame rate
Definition: vr_info.h:60
vr
the vr namespace for virtual reality support
Definition: gl_vr_display.cxx:5
vr::VRAxisType
VRAxisType
different axis types of controller inputs
Definition: vr_info.h:110
vr::vr_device_info
information provided for any device type
Definition: vr_info.h:16
vr::vr_hmd_info::number_cameras
int32_t number_cameras
number of cameras
Definition: vr_info.h:66
vr::vr_hmd_info::lighthouse_2_0_features
bool lighthouse_2_0_features
whether lighthouse 2.0 features are supported
Definition: vr_info.h:80
vr::vr_hmd_info::ipd
float ipd
interpupilar distance measured in meters
Definition: vr_info.h:62
vr::vr_kit_info::hmd
vr_hmd_info hmd
information for head mounted display
Definition: vr_info.h:150
vr::vr_hmd_info::seconds_vsynch_to_photons
float seconds_vsynch_to_photons
seconds from vsynch to photons
Definition: vr_info.h:58
vr::vr_kit_info::force_feedback_support
bool force_feedback_support
whether force feedback is supported
Definition: vr_info.h:148
vr::vr_controller_info::nr_inputs
int32_t nr_inputs
number of used inputs
Definition: vr_info.h:126
vr::max_nr_controller_axes
const unsigned max_nr_controller_axes
maximum number of axes per controller
Definition: vr_state.h:23
vr::vr_trackable_info::battery_charge_level
float battery_charge_level
battery charge level in percentage (0 .. empty, 1 .. full)
Definition: vr_info.h:42
vr::vr_trackable_info::provides_battery_charge_level
bool provides_battery_charge_level
whether one can query battery charge level
Definition: vr_info.h:40
vr::vr_hmd_info
information provided for hmd device
Definition: vr_info.h:54
vr::vr_controller_info::nr_axes
int32_t nr_axes
total number of axes provided by all inputs
Definition: vr_info.h:130
vr::vr_tracking_reference_info
information provided for a base station / tracking reference
Definition: vr_info.h:161
vr::vr_tracking_system_info::name
std::string name
name of tracking system
Definition: vr_info.h:178
vr::max_nr_controllers
const unsigned max_nr_controllers
maximum number of attachable controller and tracker devices
Definition: vr_state.h:19
vr::vr_trackable_info::has_proximity_sensor
bool has_proximity_sensor
whether device has proximity sensor
Definition: vr_info.h:44
vr::VRControllerRole
VRControllerRole
role of controller
Definition: vr_info.h:94
vr::VRControllerType
VRControllerType
type of controller
Definition: vr_info.h:88
vr::vr_hmd_info::reports_time_since_vsynch
bool reports_time_since_vsynch
whether time since vsynch is reported
Definition: vr_info.h:56
vr::vr_device_info::model_number
std::string model_number
number describing the device type
Definition: vr_info.h:20
vr::max_nr_controller_inputs
const unsigned max_nr_controller_inputs
maximum number of inputs per controller
Definition: vr_state.h:21
vr_state.h
vr::operator<<
std::ostream & operator<<(std::ostream &os, const vr_device_info &di)
stream out operator for device infos
Definition: vr_info.cxx:10
vr::vr_controller_info::supported_buttons
VRButtonStateFlags supported_buttons
one flag per button telling whether it is supported
Definition: vr_info.h:137
vr::vr_trackable_info::device_type
std::string device_type
type name of device
Definition: vr_info.h:34
vr::vr_controller_info::type
VRControllerType type
controller type
Definition: vr_info.h:122
vr::VRInputType
VRInputType
different controller input types
Definition: vr_info.h:103
vr::vr_trackable_info
information provided for trackable devices
Definition: vr_info.h:32
vr::vr_tracking_system_info
information provided for tracking system
Definition: vr_info.h:176