InputCommon: Allow for partial gyro mapping; for Free Look, this allows you to only pitch or only yaw

This commit is contained in:
iwubcode 2020-05-17 14:30:11 -05:00
parent db4b4e40cb
commit 8055919905
1 changed files with 3 additions and 1 deletions

View File

@ -4,6 +4,7 @@
#include "InputCommon/ControllerEmu/ControlGroup/IMUGyroscope.h"
#include <algorithm>
#include <memory>
#include "Common/Common.h"
@ -124,7 +125,8 @@ auto IMUGyroscope::GetRawState() const -> StateData
std::optional<IMUGyroscope::StateData> IMUGyroscope::GetState() const
{
if (controls[0]->control_ref->BoundCount() == 0)
if (std::all_of(controls.begin(), controls.end(),
[](const auto& control) { return control->control_ref->BoundCount() == 0; }))
{
// Set calibration to zero.
m_calibration = {};