| 17 | XrPath InputManager::s_SubActionPaths[ovrHand_Count] = { XR_NULL_PATH, XR_NULL_PATH }; |
| 18 | |
| 19 | InputManager::InputManager(XrInstance instance) |
| 20 | : m_InputDevices() |
| 21 | { |
| 22 | s_SubActionPaths[ovrHand_Left] = GetXrPath("/user/hand/left"); |
| 23 | s_SubActionPaths[ovrHand_Right] = GetXrPath("/user/hand/right"); |
| 24 | |
| 25 | m_InputDevices.push_back(new OculusTouch(instance)); |
| 26 | m_InputDevices.push_back(new XboxGamepad(instance)); |
| 27 | m_InputDevices.push_back(new OculusRemote(instance)); |
| 28 | |
| 29 | for (const InputDevice* device : m_InputDevices) |
| 30 | { |
| 31 | device->GetActiveSets(m_ActionSets); |
| 32 | |
| 33 | std::vector<XrActionSuggestedBinding> bindings; |
| 34 | XrPath profile = device->GetSuggestedBindings(bindings); |
| 35 | if (!profile) |
| 36 | continue; |
| 37 | |
| 38 | XrInteractionProfileSuggestedBinding suggestedBinding = XR_TYPE(INTERACTION_PROFILE_SUGGESTED_BINDING); |
| 39 | suggestedBinding.countSuggestedBindings = (uint32_t)bindings.size(); |
| 40 | suggestedBinding.suggestedBindings = bindings.data(); |
| 41 | suggestedBinding.interactionProfile = profile; |
| 42 | XrResult rs = xrSuggestInteractionProfileBindings(instance, &suggestedBinding); |
| 43 | assert(XR_SUCCEEDED(rs)); |
| 44 | } |
| 45 | } |
| 46 | |
| 47 | InputManager::~InputManager() |
| 48 | { |
nothing calls this directly
no test coverage detected