X-Git-Url: http://git.tdb.fi/?p=libs%2Fvr.git;a=blobdiff_plain;f=source%2Fopenvr%2Fopenvrsystem.h;h=0e787eb8d465c947d8d6f53283be5c5a6bfb5f1d;hp=98ad55673ab78a8ad041aab66b818673158c1e69;hb=8b0577558582dd34362219e498f688d9416f0ca1;hpb=b6de7d24475dec8f5d6b8148a69cf8b561bc0761 diff --git a/source/openvr/openvrsystem.h b/source/openvr/openvrsystem.h index 98ad556..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; @@ -20,13 +37,30 @@ public: OpenVRSystem(); ~OpenVRSystem(); + static bool is_maybe_available(); + 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