3#include <cgv/base/base.h>
4#include <cgv/render/drawable.h>
5#include <cgv/math/quaternion.h>
6#include <cgv/gui/provider.h>
7#include <cgv/gui/event_handler.h>
8#include <cgv/gui/key_event.h>
44 quat hand_orientation[2];
47 quat tracker_orientations[4];
48 bool tracker_enabled[4];
49 TrackerAttachment tracker_attachments[4];
54 void set_pose_matrix(
const cgv::mat4& H,
float* pose)
const;
55 void compute_state_poses();
58 vr_emulated_kit(
float _body_direction,
const cgv::vec3& _body_position,
float _body_height,
unsigned _width,
unsigned _height,
vr::vr_driver* _driver,
void* _handle,
const std::string& _name,
int _nr_trackers);
60 const std::vector<std::pair<int, int> >& get_controller_throttles_and_sticks(
int controller_index)
const;
61 const std::vector<std::pair<float, float> >& get_controller_throttles_and_sticks_deadzone_and_precision(
int controller_index)
const;
62 bool set_vibration(
unsigned controller_index,
float low_frequency_strength,
float high_frequency_strength);
64 void put_projection_matrix(
int eye,
float z_near,
float z_far,
float* projection_matrix,
const float* hmd_pose)
const;
87 std::vector<vr_emulated_kit*> kits;
88 static bool gamepad_connected;
89 unsigned screen_width, screen_height;
95 InteractionMode interaction_mode;
102 std::vector<cgv::quat> base_orientations;
103 std::vector<cgv::vec3> base_positions;
104 std::vector<std::string> base_serials;
106 void update_reference_states(
int i = -1);
109 mutable std::map<std::string, vr::vr_trackable_state> transformed_reference_states;
115 bool left_ctrl, right_ctrl, up_ctrl, down_ctrl;
116 bool home_ctrl, end_ctrl, pgup_ctrl, pgdn_ctrl;
123 int current_kit_index;
126 void timer_event(
double t,
double dt);
131 void on_set(
void* member_ptr);
133 std::string get_driver_name()
const;
135 bool is_installed()
const;
143 void put_up_direction(
float* up_dir)
const;
145 float get_floor_level()
const;
147 float get_action_zone_height()
const;
149 void put_action_zone_bounary(std::vector<float>& boundary)
const;
157 void stream_help(std::ostream& os);
159 std::string get_type_name()
const;
161 void stream_stats(std::ostream&);
177#include <cgv/config/lib_end.h>
The node class keeps a pointer to its parent.
interface for all classes that want to receive events
class to represent all possible keyboard events with the EID_KEY
derive from this class to provide a gui to the current viewer
the self reflection handler is passed to the virtual self_reflect() method of cgv::base::base.
base class for all drawables, which is independent of the used rendering API.
base class for all drawables, which is independent of the used rendering API.
interface class for vr drivers.
a vr kit is composed of headset, two controllers, and two trackers, where all devices can be attached...
virtual bool set_vibration(unsigned controller_index, float low_frequency_strength, float high_frequency_strength)=0
set the vibration strength between 0 and 1 of low and high frequency motors, return false if device i...
void * handle
handle for internal use
virtual bool query_state_impl(vr_kit_state &state, int pose_query)=0
derived kits implement this without caring about calibration; vr_kit::query_state() will apply driver...
virtual void put_eye_to_head_matrix(int eye, float *pose_matrix) const =0
access to 3x4 matrix in column major format for transformation from eye (0..left, 1....
virtual void submit_frame()=0
submit the rendered stereo frame to the hmd
virtual void put_projection_matrix(int eye, float z_near, float z_far, float *projection_matrix, const float *hmd_pose=0) const =0
access to 4x4 matrix in column major format for perspective transformation from eye (0....
VRButtonStateFlags
one flag for each vr controller button
std::vector< void * > scan_vr_kits()
iterate all registered vr drivers to scan for vr kits and return vector of vr kit handles
bool replace_by_pointer(vr_kit *old_kit_ptr, vr_kit *new_kit_ptr)
scan vr kits and if one with given pointer exists, replace it by passed kit; return whether replaceme...
vr_kit * replace_by_index(int vr_kit_index, vr_kit *new_kit_ptr)
scan vr kits and if one of given index exists replace it by passed kit and return index to replaced k...
Extends the trackable state by information on the buttons, input axes and vibration strengths.
structure that stores all information describing the state of a VR kit
a trackable knows whether it is tracked and its 6d pose stored as 3x4 matrix in column major format
defines the class vr::vr_driver class and gives access to the driver registry with the functions vr::...