cgv
vr::vr_controller_state Struct Reference

Extends the trackable state by information on the buttons, input axes and vibration strengths. More...

#include <vr_state.h>

Inheritance diagram for vr::vr_controller_state:
vr::vr_trackable_state

Public Member Functions

bool operator== (const vr_controller_state &state) const
 equal comparison operator
 
 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 floats each More...
 
bool operator== (const vr_trackable_state &state) const
 equality check
 

Public Attributes

unsigned time_stamp
 a unique time stamp for fast test whether state changed
 
unsigned button_flags
 combination of flags in VRButtonStateFlags combined with the OR operation
 
float axes [max_nr_controller_axes]
 up to vr::max_nr_controller_axes axis values in the range [-1,1] or 0,1
 
float vibration [2]
 strength of the vibration motors
 
VRStatus status
 whether trackable is currently tracked, only in case of true, the pose member contains useful information
 
float pose [12]
 pose as 3x4 matrix in column major format, where each column is a vector in world coordinates More...
 

Detailed Description

Extends the trackable state by information on the buttons, input axes and vibration strengths.

extends the trackable state by a vr_controller_state::time_stamp, vr_controller_state::button_flags, vr_controller_state::axes[vr::max_nr_controller_axes], and vr_controller_state::vibration[2] There are 7 buttons as listed in vr::VRButtonStateFlags, where vr::VRF_STICK_TOUCH corresponds to touching of the stick|touchpad and vr::VRF_STICK to pressing it.The controller provides up to vr::max_nr_controller_axes axes, where the first two correspond to the stick|touchpad position and the third (vr_controller_state::axes[2]) to the trigger.

Member Function Documentation

◆ put_ray()

void vr::vr_controller_state::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 floats each

place the 3d ray origin and the 3d ray direction into the given arrays

Member Data Documentation

◆ pose

float vr::vr_trackable_state::pose[12]
inherited

pose as 3x4 matrix in column major format, where each column is a vector in world coordinates

  • pose[0..2] ... x-axis pointing to the right
  • pose[3..5] ... y-axis pointing up
  • pose[6..8] ... z-axis pointing backwards
  • pose[9..11] ... location of trackable's origin

The documentation for this struct was generated from the following files: