MCPcopy Create free account
hub / github.com/LibreVR/Revive / InputManager

Method InputManager

ReviveXR/InputManager.cpp:19–45  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

17XrPath InputManager::s_SubActionPaths[ovrHand_Count] = { XR_NULL_PATH, XR_NULL_PATH };
18
19InputManager::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
47InputManager::~InputManager()
48{

Callers

nothing calls this directly

Calls 4

GetXrPathFunction · 0.85
sizeMethod · 0.80
GetActiveSetsMethod · 0.45
GetSuggestedBindingsMethod · 0.45

Tested by

no test coverage detected