23 ray_origin[0] =
pose[9];
24 ray_origin[1] =
pose[10];
25 ray_origin[2] =
pose[11];
26 ray_direction[0] = -
pose[6];
27 ray_direction[1] = -
pose[7];
28 ray_direction[2] = -
pose[8];
80 static const char* vr_key_names[] = {
106 int index = key - (int)VR_UNKNOWN;
107 return index < 24 ? vr_key_names[index] :
"VR_UNKNOWN";
112 static const char* flag_names[] = {
155 for (
unsigned i = 0; i < 19; ++i)
156 if ((flags & flag_values[i]) != 0) {
158 result = flag_names[i];
160 result += std::string(
"+") + flag_names[i];
172 default:
return "unknown status";
the vr namespace for virtual reality support
VRButtonStateFlags
one flag for each vr controller button
@ VRF_INPUT0
button of input 0
@ VRF_MENU
application menu button
@ VRF_DPAD_LEFT
direction pad left button
@ VRF_INPUT1_TOUCH
touch sensor for input 1 which often is touchpad or stick
@ VRF_DPAD_RIGHT
direction pad right button
@ VRF_INPUT3_TOUCH
touch sensor for input 3 which often is touchpad or stick
@ VRF_DPAD_UP
direction pad up button
@ VRF_INPUT1
button of input 1
@ VRF_SYSTEM
system button
@ VRF_PROXIMITY
proximity sensor
@ VRF_INPUT4_TOUCH
touch sensor for input 4 which often is touchpad or stick
@ VRF_INPUT0_TOUCH
touch sensor for input 0 which often is touchpad or stick
@ VRF_INPUT2
button of input 2
@ VRF_INPUT2_TOUCH
touch sensor for input 2 which often is touchpad or stick
@ VRF_INPUT4
button of input 4
@ VRF_DPAD_DOWN
direction pad down button
@ VRF_INPUT3
button of input 3
std::string get_key_string(unsigned short key)
convert key to string
std::string get_status_string(VRStatus status)
convert flags to string
const unsigned max_nr_controller_axes
maximum number of axes per controller
VRStatus
different status values for a trackable
@ VRS_TRACKED
trackable is connected and tracked
@ VRS_ATTACHED
trackable is connected via wireless but not tracked
@ VRS_DETACHED
trackable is not reachable via wireless
std::string get_state_flag_string(VRButtonStateFlags flags)
convert flags to string
Extends the trackable state by information on the buttons, input axes and vibration strengths.
vr_controller_state()
standard constructor for initialization of members
void put_ray(float *ray_origin, float *ray_direction) const
place the 3d ray origin and the 3d ray direction into the given arrays which must provide space for 3...
float axes[max_nr_controller_axes]
up to vr::max_nr_controller_axes axis values in the range [-1,1] or [0,1] (VIVE: 0|1....
unsigned time_stamp
a unique time stamp for fast test whether state changed
float vibration[2]
strength of the vibration motors
bool operator==(const vr_controller_state &state) const
equal comparison operator
unsigned button_flags
combination of flags in VRButtonStateFlags combined with the OR operation
structure that stores all information describing the state of a VR kit
vr_controller_state controller[max_nr_controllers]
status, pose, button, axes, and vibration information of up to vr::max_nr_controllers controller and ...
bool operator==(const vr_kit_state &state) const
check for equality
vr_trackable_state hmd
status and pose of hmd
vr_kit_state()
standard constructor for initialization of members
a trackable knows whether it is tracked and its 6d pose stored as 3x4 matrix in column major format
VRStatus status
whether trackable is currently tracked, only in case of true, the pose member contains useful informa...
float pose[12]
pose as 3x4 matrix in column major format, where each column is a vector in world coordinates
bool operator==(const vr_trackable_state &state) const
equality check
vr_trackable_state()
standard constructor for initialization of members
defines types to store the state vr::vr_kit_state of a vr kit, which is split into sub states for the...