FreelookManager: Add gyro to support either keyboard/gamepad binding or motion based controllers

This commit is contained in:
iwubcode
2021-03-11 00:40:24 -06:00
parent 80cf87158e
commit d53ab32506
2 changed files with 78 additions and 1 deletions

View File

@ -4,6 +4,9 @@
#pragma once
#include <chrono>
#include <optional>
#include "Common/CommonTypes.h"
#include "InputCommon/ControllerEmu/ControllerEmu.h"
@ -13,6 +16,7 @@ namespace ControllerEmu
{
class ControlGroup;
class Buttons;
class IMUGyroscope;
} // namespace ControllerEmu
enum class FreeLookGroup
@ -20,7 +24,8 @@ enum class FreeLookGroup
Move,
Speed,
FieldOfView,
Other
Other,
Rotation,
};
namespace FreeLook
@ -52,6 +57,8 @@ private:
ControllerEmu::Buttons* m_speed_buttons;
ControllerEmu::Buttons* m_fov_buttons;
ControllerEmu::Buttons* m_other_buttons;
ControllerEmu::IMUGyroscope* m_rotation_gyro;
const unsigned int m_index;
std::optional<std::chrono::steady_clock::time_point> m_last_free_look_rotate_time;
};