| 37 | } |
| 38 | |
| 39 | InputManager::InputManager() |
| 40 | : m_InputDevices() |
| 41 | , m_LastError(vr::VRInputError_None) |
| 42 | , m_LastPoses() |
| 43 | , m_LastHandPose() |
| 44 | { |
| 45 | for (ovrPoseStatef& pose : m_LastPoses) |
| 46 | pose.ThePose = OVR::Posef::Identity(); |
| 47 | for (ovrPoseStatef& pose : m_LastHandPose) |
| 48 | pose.ThePose = OVR::Posef::Identity(); |
| 49 | |
| 50 | LoadActionManifest(); |
| 51 | |
| 52 | vr::VRActionSetHandle_t handle; |
| 53 | vr::EVRInputError err = vr::VRInput()->GetActionSetHandle("/actions/xbox", &handle); |
| 54 | if (err == vr::VRInputError_None) |
| 55 | m_InputDevices.push_back(new XboxGamepad(handle)); |
| 56 | err = vr::VRInput()->GetActionSetHandle("/actions/remote", &handle); |
| 57 | if (err == vr::VRInputError_None) |
| 58 | m_InputDevices.push_back(new OculusRemote(handle)); |
| 59 | err = vr::VRInput()->GetActionSetHandle("/actions/touch", &handle); |
| 60 | if (err == vr::VRInputError_None) |
| 61 | { |
| 62 | m_InputDevices.push_back(new OculusTouch(handle, vr::TrackedControllerRole_LeftHand)); |
| 63 | m_InputDevices.push_back(new OculusTouch(handle, vr::TrackedControllerRole_RightHand)); |
| 64 | } |
| 65 | m_LastError = err; |
| 66 | |
| 67 | UpdateConnectedControllers(); |
| 68 | } |
| 69 | |
| 70 | InputManager::~InputManager() |
| 71 | { |
nothing calls this directly
no outgoing calls
no test coverage detected