mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-22 22:00:39 -06:00
IMUGyroscope: make GetState update optional (on by default), fix const, clean code
My future PRs will split the UI state from the Emulation State of some of these emulated controller values and this readies the code for it.
This commit is contained in:
@ -23,7 +23,8 @@ public:
|
||||
IMUGyroscope(std::string name, std::string ui_name);
|
||||
|
||||
StateData GetRawState() const;
|
||||
std::optional<StateData> GetState() const;
|
||||
// Also updates the state by default
|
||||
std::optional<StateData> GetState(bool update = true);
|
||||
|
||||
// Value is in rad/s.
|
||||
ControlState GetDeadzone() const;
|
||||
@ -33,14 +34,16 @@ public:
|
||||
private:
|
||||
using Clock = std::chrono::steady_clock;
|
||||
|
||||
void RestartCalibration() const;
|
||||
void UpdateCalibration(const StateData&) const;
|
||||
bool AreInputsBound() const;
|
||||
bool CanCalibrate() const;
|
||||
void RestartCalibration();
|
||||
void UpdateCalibration(const StateData&);
|
||||
|
||||
SettingValue<double> m_deadzone_setting;
|
||||
SettingValue<double> m_calibration_period_setting;
|
||||
|
||||
mutable StateData m_calibration = {};
|
||||
mutable MathUtil::RunningMean<StateData> m_running_calibration;
|
||||
mutable Clock::time_point m_calibration_period_start = Clock::now();
|
||||
StateData m_calibration = {};
|
||||
MathUtil::RunningMean<StateData> m_running_calibration;
|
||||
Clock::time_point m_calibration_period_start = Clock::now();
|
||||
};
|
||||
} // namespace ControllerEmu
|
||||
|
Reference in New Issue
Block a user