8#include "evan/openxr/InteractionProfile.hpp"
110 std::vector<XrPath>
paths;
138std::vector<std::string>
153const std::vector<std::string> &
156 static const std::vector<std::string>
candidates {
157 "/interaction_profiles/oculus/touch_controller",
158 "/interaction_profiles/microsoft/mixed_reality/motion_controller",
159 "/interaction_profiles/hp/mixed_reality/motion_controller",
160 "/interaction_profiles/valve/index_controller",
161 "/interaction_profiles/khr/simple_controller",
182bool evan::InteractionProfile::isInteractionProfileSupported(
189 XrPath interactionProfile = stringToPath(instance, profilePath);
190 if (interactionProfile == XR_NULL_PATH) {
194 XrInteractionProfileSuggestedBinding suggestedBindings {
195 XR_TYPE_INTERACTION_PROFILE_SUGGESTED_BINDING
197 suggestedBindings.interactionProfile = interactionProfile;
198 suggestedBindings.countSuggestedBindings = 0;
199 suggestedBindings.suggestedBindings =
nullptr;
202 xrSuggestInteractionProfileBindings(instance, &suggestedBindings);
203 return result == XR_SUCCESS;
A utility class for managing OpenXR interaction profiles, including retrieving runtime and system inf...
static std::vector< std::string > enumerateBoundSourcePathStringsForAction(XrInstance instance, XrSession session, XrAction action)
Enumerates the bound source path strings for a given action.
InteractionProfile()
Deleted default constructor to prevent instantiation of this utility class.
static std::string pathToString(XrInstance instance, XrPath path)
Converts an OpenXR path to a string.
static std::string getSystemName(XrInstance instance, XrSystemId systemId)
Retrieves the name of the OpenXR system.
static XrPath stringToPath(XrInstance instance, const std::string &pathString)
Converts a string to an OpenXR path.
static std::string getRuntimeName(XrInstance instance)
Retrieves the name of the OpenXR runtime in use.
static std::vector< XrPath > enumerateBoundSourcesForAction(XrInstance instance, XrSession session, XrAction action)
Enumerates the bound source paths for a given action.
static std::string getCurrentInteractionProfilePath(XrInstance instance, XrSession session, const std::string &userPathString)
Retrieves the current interaction profile path for a given user path.
static std::string getPreferredInteractionProfilePath(XrInstance instance, const std::vector< std::string > &candidateProfiles, const std::string &fallbackProfile)
Selects the preferred interaction profile path.
static const std::vector< std::string > & getDefaultProfileCandidates()
Retrieves the default interaction profile candidates.
Small result wrapper used by helpers that must return both a status and a value (e....