From 1fc86cacd7733a0f194f517ed17094abbaa7e240 Mon Sep 17 00:00:00 2001 From: Jordan Woyak Date: Tue, 11 Feb 2020 16:24:31 -0600 Subject: WiimoteEmu: Expose IMU pointing accelerometer weight setting. --- .../InputCommon/ControllerEmu/ControlGroup/IMUCursor.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'Source/Core/InputCommon/ControllerEmu/ControlGroup/IMUCursor.cpp') diff --git a/Source/Core/InputCommon/ControllerEmu/ControlGroup/IMUCursor.cpp b/Source/Core/InputCommon/ControllerEmu/ControlGroup/IMUCursor.cpp index 5ddbe05073..d7ff228a19 100644 --- a/Source/Core/InputCommon/ControllerEmu/ControlGroup/IMUCursor.cpp +++ b/Source/Core/InputCommon/ControllerEmu/ControlGroup/IMUCursor.cpp @@ -38,6 +38,16 @@ IMUCursor::IMUCursor(std::string name_, std::string ui_name_) // i18n: Refers to emulated wii remote movements. _trans("Clamping of rotation about the yaw axis.")}, 25, 0, 360); + + AddSetting(&m_accel_weight_setting, + {// i18n: Percentage value of accelerometer data (complementary filter coefficient). + _trans("Accelerometer Influence"), + // i18n: The symbol/abbreviation for percent. + _trans("%"), + // i18n: Refers to a setting controling the influence of accelerometer data. + _trans("Influence of accelerometer data on pitch and roll. Higher values will reduce " + "drift at the cost of noise. Consider values between 1% and 3%.")}, + 2, 0, 100); } ControlState IMUCursor::GetTotalYaw() const @@ -45,4 +55,9 @@ ControlState IMUCursor::GetTotalYaw() const return m_yaw_setting.GetValue() * MathUtil::TAU / 360; } +ControlState IMUCursor::GetAccelWeight() const +{ + return m_accel_weight_setting.GetValue() / 100; +} + } // namespace ControllerEmu -- cgit v1.2.3