dolphin/Source/Core/InputCommon/ControllerEmu/ControlGroup/Tilt.h

41 lines
833 B
C
Raw Normal View History

// Copyright 2017 Dolphin Emulator Project
// Licensed under GPLv2+
// Refer to the license.txt file included.
#pragma once
#include <chrono>
#include <string>
#include "InputCommon/ControllerEmu/StickGate.h"
#include "InputCommon/ControllerInterface/Device.h"
namespace ControllerEmu
{
class Tilt : public ReshapableInput
{
public:
2018-12-30 16:52:45 +00:00
using StateData = ReshapeData;
explicit Tilt(const std::string& name);
2018-12-30 16:52:45 +00:00
ReshapeData GetReshapableState(bool adjusted) final override;
ControlState GetGateRadiusAtAngle(double ang) const override;
StateData GetState();
private:
2018-12-30 16:52:45 +00:00
enum
{
SETTING_MAX_ANGLE = ReshapableInput::SETTING_COUNT,
};
static constexpr int MAX_DEG_PER_SEC = 360 * 6;
StateData m_tilt;
2018-12-30 16:52:45 +00:00
using Clock = std::chrono::steady_clock;
Clock::time_point m_last_update;
};
} // namespace ControllerEmu