1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-01-30 06:45:32 +00:00
openmw-tes3mp/apps/openmw/mwvr/openxrenvironment.hpp
2020-03-01 12:54:32 +01:00

71 lines
2 KiB
C++

#ifndef OPENXR_ENVIRONMENT_H
#define OPENXR_ENVIRONMENT_H
namespace MWVR
{
class OpenXRInputManager;
class OpenXRSession;
class OpenXRMenuManager;
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.
///
/// \attention OpenXREnvironment takes ownership of the manager class instances it is handed over in
/// the set* functions.
class OpenXREnvironment
{
static OpenXREnvironment*sThis;
OpenXREnvironment(const OpenXREnvironment&) = delete;
///< not implemented
OpenXREnvironment& operator= (const OpenXREnvironment&) = delete;
///< not implemented
public:
OpenXREnvironment();
~OpenXREnvironment();
void cleanup();
///< Delete all mwvr-subsystems.
static const OpenXREnvironment& get();
///< 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::OpenXRMenuManager* getMenuManager() const;
void setMenuManager(MWVR::OpenXRMenuManager* xrMenuManager);
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::OpenXRMenuManager* mMenuManager{ nullptr };
MWVR::OpenXRViewer* mViewer{ nullptr };
MWVR::OpenXRManager* mOpenXRManager{ nullptr };
float mUnitsPerMeter{ 1.f };
};
}
#endif