3 #include <cgv/base/base.h>
5 #include <cg_vr/vr_server.h>
7 #include <cgv_gl/box_renderer.h>
8 #include <cgv_gl/sphere_renderer.h>
9 #include <cgv_gl/gl/mesh_render_info.h>
10 #include <stereo_view_interactor.h>
12 #include "lib_begin.h"
74 mat3 head_tracker_orientation;
103 float tracking_rotation;
110 void calibrate_driver();
114 void set_tracking_rotation(
float tr) {
115 tracking_rotation = tr;
117 float get_tracking_rotation() {
118 return tracking_rotation;
120 void set_tracking_origin(vec3 ori) {
121 tracking_origin = ori;
123 vec3 get_tracking_origin() {
124 return tracking_origin;
147 int rendered_display_index;
152 bool debug_vr_events;
155 VRkitVisType vis_type, hmd_vis_type, controller_vis_type, tracker_vis_type, base_vis_type;
156 bool show_action_zone;
157 rgb fence_color1, fence_color2;
158 float fence_frequency;
159 float fence_line_width;
162 void* current_vr_handle;
163 int current_vr_handle_index;
164 std::string kit_enum_definition;
166 std::vector<vr::vr_kit_state> kit_states;
168 std::vector<void*> new_kits;
170 std::vector<void*> kits;
172 std::vector<void*> old_kits;
182 std::string hmd_mesh_file_name, controller_mesh_file_name, tracker_mesh_file_name, base_mesh_file_name;
184 float mesh_scales[4];
186 vr::vr_kit* get_vr_kit_from_index(
int i)
const;
188 void configure_kits();
192 virtual void on_device_change(
void* handle,
bool attach);
194 void add_trackable_spheres(
const float* pose,
int i, std::vector<vec4>& spheres, std::vector<rgb>& sphere_colors);
210 void enable_vr_event_debugging(
bool enable =
true);
216 void query_vr_states();
225 dvec3 get_view_dir_of_kit(
int vr_kit_idx = -1)
const;
230 dvec3 get_view_up_dir_of_kit(
int vr_kit_idx = -1)
const;
239 dvec3 get_eye_of_kit(
int eye = 0,
int vr_kit_idx = -1)
const;
244 bool seperate_view_drawn()
const {
return separate_view; }
247 void draw_separate_view(
bool do_draw);
251 void draw_vr_kits(
bool do_draw);
255 void draw_action_zone(
bool do_draw);
259 void enable_blit_vr_views(
bool enable);
263 void set_blit_vr_view_width(
int width);
268 int get_rendered_eye()
const {
return rendered_eye; }
274 vr::vr_kit* get_rendered_vr_kit()
const {
return static_cast<vr::vr_kit*
>(rendered_display_ptr); }
276 void on_set(
void* member_ptr);
279 void stream_stats(std::ostream&);
289 void stream_help(std::ostream& os);
311 #include <cgv/config/lib_end.h>
extends the stereo view interactor for vr support
Definition: vr_view_interactor.h:67
Definition: sphere_renderer.h:19
renderer that supports point splatting
Definition: box_renderer.h:30
implements offscreen rendering
Definition: gl_vr_display.h:25
Definition: surface_renderer.h:26
bool vr_event_debugging_enabled() const
check whether vr events are printed to the console window
Definition: vr_view_interactor.h:208
base class with write access to driver calibration matrix
Definition: vr_driver.h:37
float blit_aspect_scale
scale of aspect ratio used for blitting
Definition: vr_view_interactor.h:141
std::string calibration_file_path
path to calibration file
Definition: vr_view_interactor.h:112
a vr kit is composed of headset, two controllers, and two trackers, where all devices can be attached...
Definition: vr_kit.h:69
bool create_gui(provider *p, const std::string &label, void *value_ptr, const std::string &value_type, const std::string &gui_type, const std::string &options, bool *toggles)
create the gui for a composed structure
Definition: gui_creator.cxx:21
vec3 tracking_origin
origin of tracking coordinate system given in world coordinates
Definition: vr_view_interactor.h:108
vec3 tracking_rotation_origin
location in tracking coordinate system around which rotation is defined
Definition: vr_view_interactor.h:106
VRkitVisType
different visualization types for vr kit components
Definition: vr_view_interactor.h:19
vr::gl_vr_display * get_rendered_display() const
Definition: vr_view_interactor.h:272
Definition: reflection_handler.h:63
vec3 head_tracker_position
head position from tracker location
Definition: vr_view_interactor.h:77
bool blit_vr_views
whether to blit in the views of the vr kits
Definition: vr_view_interactor.h:137
int pose_query
type of pose query according to vr::vr_kit::query_state function's 2nd parameter
Definition: vr_view_interactor.h:174
int none_separate_view
selection of view of current hmd used in case of no separate view (1 ... left, 2 ....
Definition: vr_view_interactor.h:143
int get_blit_vr_view_width() const
return width of vr view blitting
Definition: vr_view_interactor.h:261
bool separate_view
whether the window shows a separate view onto the scene or the one of the current vr kit
Definition: vr_view_interactor.h:133
bool vr_kits_drawn() const
check whether vr kits are drawn
Definition: vr_view_interactor.h:249
bool dont_render_kits
whether to not render for kits
Definition: vr_view_interactor.h:135
structure that stores all information describing the state of a VR kit
Definition: vr_state.h:139
VREventTypeFlags
flags to define which events should be generated by server
Definition: vr_server.h:27
const char * get_type_name(TypeId tid)
function that returns the name of a type specified through TypeId
Definition: type_id.cxx:117
VRStatus
different status values for a trackable
Definition: vr_state.h:85
Definition: context.h:525
bool action_zone_drawn() const
check whether action zone is drawn
Definition: vr_view_interactor.h:253
bool blit_vr_views_enabled() const
check whether vr views are blitted
Definition: vr_view_interactor.h:257