1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-01-28 07:45:32 +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;
2020-02-29 22:53:56 +00:00
class OpenXRInputManager;
class OpenXRSession;
class VRGUIManager;
2020-02-29 22:53:56 +00:00
class OpenXRViewer;
class OpenXRManager;
/// \brief Central hub for mw openxr subsystems
///
/// This class allows each mw openxr subsystem to access any others subsystem's top-level manager class.
///
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::OpenXRInputManager* getInputManager() const;
// 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
2020-02-29 22:53:56 +00:00
MWVR::OpenXRSession* getSession() const;
void setSession(MWVR::OpenXRSession* xrSession);
MWVR::OpenXRViewer* getViewer() const;
void setViewer(MWVR::OpenXRViewer* xrViewer);
MWVR::OpenXRManager* getManager() const;
void setManager(MWVR::OpenXRManager* xrManager);
float unitsPerMeter() const;
void setUnitsPerMeter(float unitsPerMeter);
private:
MWVR::OpenXRSession* mSession{ nullptr };
MWVR::VRGUIManager* mGUIManager{ nullptr };
2020-03-15 14:31:38 +00:00
MWVR::VRAnimation* mPlayerAnimation{ nullptr };
MWVR::OpenXRViewer* mViewer{ nullptr };
MWVR::OpenXRManager* mOpenXRManager{ nullptr };
float mUnitsPerMeter{ 1.f };
2020-02-29 22:53:56 +00:00
};
}
#endif