Go to the documentation of this file.
2 #include <cgv/base/node.h>
3 #include <cgv/render/drawable.h>
4 #include <cgv/gui/provider.h>
5 #include <cgv/gui/event_handler.h>
6 #include <cgv_gl/box_renderer.h>
7 #include <cgv_gl/gl/mesh_render_info.h>
8 #include <cgv_gl/sphere_renderer.h>
9 #include <cgv_gl/rounded_cone_renderer.h>
10 #include <cgv/render/shader_program.h>
11 #include <cgv_gl/rounded_cone_renderer.h>
12 #include <cgv/render/frame_buffer.h>
23 #include <cg_vr/vr_server.h>
24 #include <vr_view_interactor.h>
25 #include <vr_render_helpers.h>
34 enum InteractionState {
42 std::vector<box3> boxes;
43 std::vector<rgb> box_colors;
47 cgv::render::rounded_cone_render_style cone_style;
52 dquat mesh_orientation;
58 std::string label_text;
68 unsigned label_resolution;
73 std::vector<const char*> font_names;
74 std::string font_enum_decl;
81 std::vector<vr::controller_input_config> left_inp_cfg;
84 void* last_kit_handle;
93 std::vector<box3> movable_boxes;
94 std::vector<rgb> movable_box_colors;
95 std::vector<vec3> movable_box_translations;
96 std::vector<quat> movable_box_rotations;
99 std::vector<vec3> intersection_points;
100 std::vector<rgb> intersection_colors;
101 std::vector<int> intersection_box_indices;
102 std::vector<int> intersection_controller_indices;
105 InteractionState state[4];
112 int frame_width, frame_height;
114 float seethrough_gamma;
115 mat4 camera_to_head_matrix[2];
117 vec2 focal_lengths[4];
118 vec2 camera_centers[4];
121 GLuint camera_tex_id;
126 bool show_seethrough;
128 float background_distance;
129 float background_extent;
142 void compute_intersections(
const vec3& origin,
const vec3& direction,
int ci,
const rgb& color);
146 void on_device_change(
void* kit_handle,
bool attach);
148 void construct_table(
float tw,
float td,
float th,
float tW);
150 void construct_room(
float w,
float d,
float h,
float W,
bool walls,
bool ceiling);
152 void construct_environment(
float s,
float ew,
float ed,
float w,
float d,
float h);
154 void construct_movable_boxes(
float tw,
float td,
float th,
float tW,
size_t nr);
156 void build_scene(
float w,
float d,
float h,
float W,
float tw,
float td,
float th,
float tW);
164 void on_set(
void* member_ptr);
extends the stereo view interactor for vr support
Definition: vr_view_interactor.h:67
std::string get_type_name() const
overload to return the type name of this object
Definition: node.cxx:47
boxes use surface render styles
Definition: box_renderer.h:19
interface for all classes that want to receive events
Definition: event_handler.h:15
Definition: sphere_renderer.h:19
virtual void clear(context &)
clear all objects living in the context like textures or display lists
Definition: drawable.cxx:129
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
virtual bool init(context &)
this method is called after creation or recreation of the context, return whether all necessary funct...
Definition: drawable.cxx:98
derive from this class to provide a gui to the current viewer
Definition: provider.h:64
virtual void init_frame(context &)
this method is called in one pass over all drawables before the draw method
Definition: drawable.cxx:107
Definition: shader_program.h:25
virtual void finish_draw(context &)
this method is called when the current drawable is left in a tree traversal that calls the draw metho...
Definition: drawable.cxx:115
virtual void stream_help(std::ostream &os)=0
overload to stream help information to the given output stream
virtual void draw(context &)
overload to draw the content of this drawable
Definition: drawable.cxx:111
virtual bool handle(event &e)=0
overload and implement this method to handle events
virtual void on_set(void *member_ptr)
this callback is called when the set_void method has changed a member and can be overloaded in derive...
Definition: base.cxx:210
Definition: drawable.h:15
Definition: frame_buffer.h:17
Definition: mesh_render_info.h:16
VRStatus
different status values for a trackable
Definition: vr_state.h:85
Definition: context.h:525