X-Git-Url: http://git.tdb.fi/?p=libs%2Fvr.git;a=blobdiff_plain;f=source%2Fopenvr%2Fopenvrsystem.h;h=0e787eb8d465c947d8d6f53283be5c5a6bfb5f1d;hp=498865992fdaa8c5a886e3f3e2bb8bdb1d3f128d;hb=8b0577558582dd34362219e498f688d9416f0ca1;hpb=e21e0b80154afe4a62480efca61a07d4c2f2b0ef diff --git a/source/openvr/openvrsystem.h b/source/openvr/openvrsystem.h index 4988659..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,7 +16,20 @@ namespace VR { class OpenVRSystem: public System { private: - GL::Matrix hmd_matrix; + 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; @@ -24,12 +41,26 @@ public: virtual void configure_window(Graphics::Window &) const { } virtual void configure_view(StereoView &) const; + virtual bool is_absolute_tracking_supported() const { return true; } virtual void set_absolute_tracking(bool); + 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_hmd_matrix() const { return hmd_matrix; } + 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