1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-01-26 18:35:20 +00:00
OpenMW/apps/openmw/mwinput/gyromanager.hpp
2022-01-19 18:09:37 +01:00

37 lines
900 B
C++

#ifndef MWINPUT_GYROMANAGER
#define MWINPUT_GYROMANAGER
#include <components/settings/settings.hpp>
#include "gyroaxis.hpp"
namespace MWInput
{
class GyroManager
{
public:
GyroManager();
bool isEnabled() const { return mEnabled; }
void update(float dt, std::array<float, 3> values) const;
void processChangedSettings(const Settings::CategorySettingVector& changed);
void setGuiCursorEnabled(bool enabled) { mGuiCursorEnabled = enabled; }
private:
bool mEnabled;
bool mGuiCursorEnabled;
float mSensitivityH;
float mSensitivityV;
float mInputThreshold;
GyroscopeAxis mAxisH;
GyroscopeAxis mAxisV;
float getAxisValue(GyroscopeAxis axis, std::array<float, 3> values) const;
};
}
#endif // !MWINPUT_GYROMANAGER