1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-01-16 11:49:56 +00:00
openmw-tes3mp/apps/openmw/mwvr/vrenvironment.hpp

77 lines
2.1 KiB
C++
Raw Normal View History

2020-03-15 14:31:38 +00:00
#ifndef MWVR_ENVIRONMENT_H
#define MWVR_ENVIRONMENT_H
2020-02-29 22:53:56 +00:00
namespace MWVR
{
2020-03-15 14:31:38 +00:00
class VRAnimation;
class VRInputManager;
class VRSession;
class VRGUIManager;
class VRViewer;
2020-02-29 22:53:56 +00:00
class OpenXRManager;
/// \brief Central hub for mw vr/openxr subsystems
2020-02-29 22:53:56 +00:00
///
/// This class allows each mw subsystem to access any vr subsystem's top-level manager class.
2020-02-29 22:53:56 +00:00
///
2020-03-15 14:31:38 +00:00
/// \attention Environment takes ownership of the manager class instances it is handed over in
2020-02-29 22:53:56 +00:00
/// the set* functions.
2020-03-15 14:31:38 +00:00
class Environment
2020-02-29 22:53:56 +00:00
{
2020-03-15 14:31:38 +00:00
static Environment* sThis;
2020-02-29 22:53:56 +00:00
2020-03-15 14:31:38 +00:00
Environment(const Environment&) = delete;
2020-02-29 22:53:56 +00:00
///< not implemented
2020-03-15 14:31:38 +00:00
Environment& operator= (const Environment&) = delete;
2020-02-29 22:53:56 +00:00
///< not implemented
public:
2020-03-15 14:31:38 +00:00
Environment();
2020-02-29 22:53:56 +00:00
2020-03-15 14:31:38 +00:00
~Environment();
2020-02-29 22:53:56 +00:00
void cleanup();
///< Delete all mwvr-subsystems.
2020-03-15 14:31:38 +00:00
static Environment& get();
2020-02-29 22:53:56 +00:00
///< Return instance of this class.
MWVR::VRInputManager* getInputManager() const;
2020-02-29 22:53:56 +00:00
// The OpenXRInputManager supplants the regular input manager
// which is stored in MWBase::Environment
// void setInputManager(MWVR::OpenXRInputManager*);
MWVR::VRGUIManager* getGUIManager() const;
void setGUIManager(MWVR::VRGUIManager* xrGUIManager);
2020-02-29 22:53:56 +00:00
2020-03-15 14:31:38 +00:00
MWVR::VRAnimation* getPlayerAnimation() const;
void setPlayerAnimation(MWVR::VRAnimation* xrAnimation);
2020-03-08 13:14:24 +00:00
MWVR::VRSession* getSession() const;
void setSession(MWVR::VRSession* xrSession);
2020-02-29 22:53:56 +00:00
MWVR::VRViewer* getViewer() const;
void setViewer(MWVR::VRViewer* xrViewer);
2020-02-29 22:53:56 +00:00
MWVR::OpenXRManager* getManager() const;
void setManager(MWVR::OpenXRManager* xrManager);
float unitsPerMeter() const;
void setUnitsPerMeter(float unitsPerMeter);
private:
MWVR::VRSession* mSession{ nullptr };
MWVR::VRGUIManager* mGUIManager{ nullptr };
2020-03-15 14:31:38 +00:00
MWVR::VRAnimation* mPlayerAnimation{ nullptr };
MWVR::VRViewer* mViewer{ nullptr };
MWVR::OpenXRManager* mOpenXRManager{ nullptr };
float mUnitsPerMeter{ 1.f };
2020-02-29 22:53:56 +00:00
};
}
#endif