1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-01-16 08:19:56 +00:00
openmw-tes3mp/apps/openmw/mwvr/openxrinput.hpp
2021-01-02 17:40:37 +01:00

44 lines
1.5 KiB
C++

#ifndef OPENXR_INPUT_HPP
#define OPENXR_INPUT_HPP
#include "vrinput.hpp"
#include "openxractionset.hpp"
#include <vector>
#include <array>
namespace MWVR
{
/// \brief Generates and manages OpenXR Actions and ActionSets by generating openxr bindings from a list of SuggestedBindings structs.
class OpenXRInput
{
public:
using XrSuggestedBindings = std::vector<XrActionSuggestedBinding>;
using XrProfileSuggestedBindings = std::map<std::string, XrSuggestedBindings>;
//! Default constructor, creates two ActionSets: Gameplay and GUI
OpenXRInput(std::shared_ptr<AxisAction::Deadzone> deadzone);
//! Get the specified actionSet.
OpenXRActionSet& getActionSet(ActionSet actionSet);
//! Suggest bindings for the specific actionSet and profile pair. Call things after calling attachActionSets is an error.
void suggestBindings(ActionSet actionSet, std::string profile, const SuggestedBindings& mwSuggestedBindings);
//! Set bindings and attach actionSets to the session.
void attachActionSets();
//! Notify that active interaction profile has changed
void notifyInteractionProfileChanged();
protected:
std::map<ActionSet, OpenXRActionSet> mActionSets{};
std::map<XrPath, std::string> mInteractionProfileNames{};
std::map<std::string, XrPath> mInteractionProfilePaths{};
std::map<XrPath, XrPath> mActiveInteractionProfiles;
XrProfileSuggestedBindings mSuggestedBindings{};
bool mAttached = false;
};
}
#endif