X-Git-Url: http://git.tdb.fi/?p=libs%2Fvr.git;a=blobdiff_plain;f=source%2Fopenvr%2Fopenvrsystem.h;h=0e787eb8d465c947d8d6f53283be5c5a6bfb5f1d;hp=ca5411e287181e08b1cfd7875e67d5f3e1b98671;hb=8b0577558582dd34362219e498f688d9416f0ca1;hpb=5fe4e511b9eb2f093070270e8f5694bcdf3a4f96 diff --git a/source/openvr/openvrsystem.h b/source/openvr/openvrsystem.h index ca5411e..0e787eb 100644 --- a/source/openvr/openvrsystem.h +++ b/source/openvr/openvrsystem.h @@ -1,10 +1,14 @@ #ifndef MSP_VR_OPENVRSYSTEM_H_ #define MSP_VR_OPENVRSYSTEM_H_ +#include #include +#include +#include #include #include "openvrcamera.h" #include "openvrcombiner.h" +#include "openvrcontroller.h" namespace Msp { namespace VR { @@ -12,8 +16,20 @@ namespace VR { class OpenVRSystem: public System { private: + struct RenderModel; + unsigned n_tracked_devices; std::vector tracking_matrices; + std::vector controllers; + std::vector unclaimed_controllers; + + GL::Program render_shprog; + GL::Program render_shprog_textured; + GL::Material render_material; + std::map render_models; + std::map render_textures; + std::list loading_render_models; + std::list loading_textures; static unsigned n_instances; @@ -30,10 +46,21 @@ public: virtual bool get_absolute_tracking() const; virtual OpenVRCamera *create_camera(const GL::Camera &); virtual OpenVRCombiner *create_combiner(GL::View &); + virtual OpenVRController *create_controller(); + + virtual void tick(); void update_pose_matrices(); const GL::Matrix &get_tracking_matrix(unsigned) const; const GL::Matrix &get_hmd_matrix() const; + void add_controller(OpenVRController &); + void remove_controller(OpenVRController &); + + const GL::Object *get_render_model(const std::string &); +private: + bool check_loading_render_model(const std::string &); + const GL::Texture2D *get_texture(unsigned); + bool check_loading_texture(unsigned); }; } // namespace VR