cgv
Loading...
Searching...
No Matches
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
 
- Public Member Functions inherited from vr::vr_trackable_state
bool operator== (const vr_trackable_state &state) const
 equality check
 
 vr_trackable_state ()
 standard constructor for initialization of members
 

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] (VIVE: 0|1..touchpad x|y [-1,1], 2..trigger [0,1])
 
float vibration [2]
 strength of the vibration motors
 
- Public Attributes inherited from vr::vr_trackable_state
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
 

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.

Definition at line 117 of file vr_state.h.

Constructor & Destructor Documentation

◆ vr_controller_state()

vr::vr_controller_state::vr_controller_state ( )

standard constructor for initialization of members

Definition at line 13 of file vr_state.cxx.

References axes, button_flags, vr::max_nr_controller_axes, time_stamp, and vibration.

Member Function Documentation

◆ operator==()

bool vr::vr_controller_state::operator== ( const vr_controller_state state) const

equal comparison operator

Definition at line 61 of file vr_state.cxx.

References axes, button_flags, vr::vr_trackable_state::operator==(), and vibration.

◆ 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

Definition at line 21 of file vr_state.cxx.

References vr::vr_trackable_state::pose.

Referenced by vr_test::draw(), and vr_test::handle().

Member Data Documentation

◆ axes

float vr::vr_controller_state::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..touchpad x|y [-1,1], 2..trigger [0,1])

Definition at line 124 of file vr_state.h.

Referenced by vr_emulator::create_controller_gui(), cgv::gui::vr_server::emit_events_and_update_state(), vr::vr_log::log_vr_state(), operator==(), and vr_controller_state().

◆ button_flags

unsigned vr::vr_controller_state::button_flags

combination of flags in VRButtonStateFlags combined with the OR operation

Definition at line 122 of file vr_state.h.

Referenced by vr::vr_log::log_vr_state(), operator==(), and vr_controller_state().

◆ time_stamp

unsigned vr::vr_controller_state::time_stamp

a unique time stamp for fast test whether state changed

Definition at line 120 of file vr_state.h.

Referenced by vr_emulator::create_controller_gui(), vr_view_interactor::draw_vr_kits(), and vr_controller_state().

◆ vibration

float vr::vr_controller_state::vibration[2]

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