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-06-26 21:02:48 +00:00
|
|
|
class VRInputManager;
|
2020-05-24 16:00:42 +00:00
|
|
|
class VRSession;
|
2020-05-01 19:37:01 +00:00
|
|
|
class VRGUIManager;
|
2020-05-24 16:00:42 +00:00
|
|
|
class VRViewer;
|
2020-02-29 22:53:56 +00:00
|
|
|
class OpenXRManager;
|
|
|
|
|
2020-06-26 21:02:48 +00:00
|
|
|
/// \brief Central hub for mw vr/openxr subsystems
|
2020-02-29 22:53:56 +00:00
|
|
|
///
|
2020-06-26 21:02:48 +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.
|
|
|
|
|
2020-06-26 21:02:48 +00:00
|
|
|
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*);
|
|
|
|
|
2020-05-01 19:37:01 +00:00
|
|
|
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-05-24 16:00:42 +00:00
|
|
|
MWVR::VRSession* getSession() const;
|
|
|
|
void setSession(MWVR::VRSession* xrSession);
|
2020-02-29 22:53:56 +00:00
|
|
|
|
2020-05-24 16:00:42 +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:
|
2020-05-24 16:00:42 +00:00
|
|
|
MWVR::VRSession* mSession{ nullptr };
|
2020-05-01 19:37:01 +00:00
|
|
|
MWVR::VRGUIManager* mGUIManager{ nullptr };
|
2020-03-15 14:31:38 +00:00
|
|
|
MWVR::VRAnimation* mPlayerAnimation{ nullptr };
|
2020-05-24 16:00:42 +00:00
|
|
|
MWVR::VRViewer* mViewer{ nullptr };
|
2020-03-01 11:54:32 +00:00
|
|
|
MWVR::OpenXRManager* mOpenXRManager{ nullptr };
|
|
|
|
float mUnitsPerMeter{ 1.f };
|
2020-02-29 22:53:56 +00:00
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|