WiimoteEmu: Expose maximum tilt acceleration.

This commit is contained in:
Jordan Woyak
2019-10-06 09:44:46 -05:00
parent b6545ea285
commit 260cefd60b
3 changed files with 20 additions and 5 deletions

View File

@ -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"
@ -31,6 +32,14 @@ Tilt::Tilt(const std::string& name_) : ReshapableInput(name_, name_, GroupType::
// i18n: Refers to emulated wii remote movement.
_trans("Maximum tilt angle.")},
90, 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