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 <plugins/crg_stereo_view/stereo_view_interactor.h>
116 void set_tracking_rotation(
float tr) {
120 float get_tracking_rotation() {
121 return tracking_rotation;
123 void set_tracking_origin(
cgv::vec3 ori) {
124 tracking_origin = ori;
128 return tracking_origin;
150 int rendered_display_index;
155 bool debug_vr_events;
158 VRkitVisType vis_type, hmd_vis_type, controller_vis_type, tracker_vis_type, base_vis_type;
159 bool show_action_zone;
160 cgv::rgb fence_color1, fence_color2;
161 float fence_frequency;
162 float fence_line_width;
165 void* current_vr_handle;
166 int current_vr_handle_index;
167 std::string kit_enum_definition;
169 std::vector<vr::vr_kit_state> kit_states;
171 std::vector<void*> new_kits;
173 std::vector<void*> kits;
175 std::vector<void*> old_kits;
185 std::string hmd_mesh_file_name, controller_mesh_file_name, tracker_mesh_file_name, base_mesh_file_name;
187 float mesh_scales[4];
189 vr::vr_kit* get_vr_kit_from_index(
int i)
const;
191 void configure_kits();
195 virtual void on_device_change(
void*
handle,
bool attach);
197 void add_trackable_spheres(
const float* pose,
int i, std::vector<cgv::vec4>& spheres, std::vector<cgv::rgb>& sphere_colors);
200 vr_view_interactor(
const char* name);
213 void enable_vr_event_debugging(
bool enable =
true);
219 void query_vr_states();
228 cgv::dvec3 get_view_dir_of_kit(
int vr_kit_idx = -1)
const;
233 cgv::dvec3 get_view_up_dir_of_kit(
int vr_kit_idx = -1)
const;
242 cgv::dvec3 get_eye_of_kit(
int eye = 0,
int vr_kit_idx = -1)
const;
250 void draw_separate_view(
bool do_draw);
254 void draw_vr_kits(
bool do_draw);
256 void draw_vr_controllers(
bool do_draw);
260 void draw_action_zone(
bool do_draw);
264 void enable_blit_vr_views(
bool enable);
268 void set_blit_vr_view_width(
int width);
284 void on_set(
void* member_ptr);
286 void stream_stats(std::ostream&);
296 void stream_help(std::ostream& os);
318#include <cgv/config/lib_end.h>
the self reflection handler is passed to the virtual self_reflect() method of cgv::base::base.
renderer that supports point splatting
base class for all drawables, which is independent of the used rendering API.
implements offscreen rendering
base class with write access to driver calibration matrix
a vr kit is composed of headset, two controllers, and two trackers, where all devices can be attached...
int get_rendered_eye() const
return the currently rendered eye
bool blit_vr_views_enabled() const
check whether vr views are blitted
void add_trackable_spheres(const float *pose, int i, std::vector< cgv::vec4 > &spheres, std::vector< cgv::rgb > &sphere_colors)
helper to visualize pose with colored spheres
vr::gl_vr_display * get_rendered_display() const
return the vr kit currently rendered return a pointer to the current vr kit
cgv::vec3 head_tracker_position
head position from tracker location
float tracking_rotation
rotation angle around the y-axis
vr::vr_kit * get_rendered_vr_kit() const
return pointer to rendered vr kit or nullptr if birds eye view is rendered
std::string get_type_name() const
return the type name
bool separate_view
whether the window shows a separate view onto the scene or the one of the current vr kit
cgv::gui::VREventTypeFlags get_event_type_flags() const
query the currently set event type flags
int pose_query
type of pose query according to vr::vr_kit::query_state function's 2nd parameter
int get_rendered_vr_kit_index() const
return index of rendered vr kit or -1 if birds eye view is rendered
float blit_aspect_scale
scale of aspect ratio used for blitting
cgv::vec3 tracking_rotation_origin
location in tracking coordinate system around which rotation is defined
std::string calibration_file_path
path to calibration file
cgv::mat3 head_tracker_orientation
head orientation from tracker orientation
bool vr_event_debugging_enabled() const
check whether vr events are printed to the console window
cgv::vec3 tracking_origin
origin of tracking coordinate system given in world coordinates
bool action_zone_drawn() const
check whether action zone is drawn
int get_blit_vr_view_width() const
return width of vr view blitting
bool blit_vr_views
whether to blit in the views of the vr kits
bool seperate_view_drawn() const
check whether separate view is rendered
int none_separate_view
selection of view of current hmd used in case of no separate view (1 ... left, 2 ....
void calibrate_driver()
perform driver calibration
void set_event_type_flags(cgv::gui::VREventTypeFlags flags)
set the event type flags of to be emitted events
bool handle(cgv::gui::event &e)
overload and implement this method to handle events
int rendered_eye
rendered_eye: 0...monitor,1...left eye,2...right eye
bool dont_render_kits
whether to not render for kits
bool vr_kits_drawn() const
check whether vr kits are drawn
VRkitVisType
different visualization types for vr kit components
CGV_API cgv::reflect::enum_reflection_traits< VRkitVisType > get_reflection_traits(const VRkitVisType &gm)
support reflection of enum names
VREventTypeFlags
flags to define which events should be generated by server
cgv::math::fvec< double, 3 > dvec3
declare type of 3d double precision floating point vectors
cgv::math::fvec< int32_t, 4 > ivec4
declare type of 4d 32 bit integer vectors
cgv::media::color< float, cgv::media::RGB > rgb
declare rgb color type with 32 bit components
cgv::math::fmat< float, 3, 3 > mat3
declare type of 3x3 matrices
cgv::math::fvec< float, 3 > vec3
declare type of 3d single precision floating point vectors
cgv::math::fmat< float, 3, 4 > mat3x4
declare type of 3x4 matrices which are often used to store a pose
VRStatus
different status values for a trackable
this type specific reflection traits class is used by the reflect_enum function to reflect enum types
render style for sphere rendere
structure that stores all information describing the state of a VR kit
defines the class vr::vr_driver class and gives access to the driver registry with the functions vr::...