summaryrefslogtreecommitdiff
path: root/Source/Core/InputCommon/ControllerEmu/ControlGroup/Tilt.cpp
diff options
context:
space:
mode:
authorAnthony <Helios747@users.noreply.github.com>2019-10-16 16:14:42 -0700
committerGitHub <noreply@github.com>2019-10-16 16:14:42 -0700
commita21b7b1bdda421049aded3033e07fa2877dc54b0 (patch)
tree83d26a16194c11631c5bff8be5f1b1c0f484f215 /Source/Core/InputCommon/ControllerEmu/ControlGroup/Tilt.cpp
parent2f0ad1b6a0e3ee5a17c9cd4b7959b7d0cb95c09a (diff)
parentb794737bcf5db7f941cb4741757607de31c3f953 (diff)
Merge pull request #8390 from jordan-woyak/wiimote-emu-tilt-fix
WiimoteEmu: Tilt fixes.
Diffstat (limited to 'Source/Core/InputCommon/ControllerEmu/ControlGroup/Tilt.cpp')
-rw-r--r--Source/Core/InputCommon/ControllerEmu/ControlGroup/Tilt.cpp16
1 files changed, 15 insertions, 1 deletions
diff --git a/Source/Core/InputCommon/ControllerEmu/ControlGroup/Tilt.cpp b/Source/Core/InputCommon/ControllerEmu/ControlGroup/Tilt.cpp
index 91089455f8..c010c969fc 100644
--- a/Source/Core/InputCommon/ControllerEmu/ControlGroup/Tilt.cpp
+++ b/Source/Core/InputCommon/ControllerEmu/ControlGroup/Tilt.cpp
@@ -7,6 +7,7 @@
#include <string>
#include "Common/Common.h"
+#include "Common/MathUtil.h"
#include "InputCommon/ControlReference/ControlReference.h"
#include "InputCommon/ControllerEmu/Control/Control.h"
@@ -30,7 +31,15 @@ Tilt::Tilt(const std::string& name_) : ReshapableInput(name_, name_, GroupType::
_trans("°"),
// i18n: Refers to emulated wii remote movement.
_trans("Maximum tilt angle.")},
- 90, 0, 180);
+ 85, 0, 180);
+
+ AddSetting(&m_max_rotational_velocity,
+ {_trans("Velocity"),
+ // i18n: The symbol/abbreviation for hertz (cycles per second).
+ _trans("Hz"),
+ // i18n: Refers to emulated wii remote movement.
+ _trans("Peak complete turns per second.")},
+ 7, 1, 50);
}
Tilt::ReshapeData Tilt::GetReshapableState(bool adjusted)
@@ -63,4 +72,9 @@ ControlState Tilt::GetDefaultInputRadiusAtAngle(double ang) const
return SquareStickGate(1.0).GetRadiusAtAngle(ang);
}
+ControlState Tilt::GetMaxRotationalVelocity() const
+{
+ return m_max_rotational_velocity.GetValue() * MathUtil::TAU;
+}
+
} // namespace ControllerEmu