2017-02-09 03:15:43 +00:00
|
|
|
// Copyright 2017 Dolphin Emulator Project
|
|
|
|
// Licensed under GPLv2+
|
|
|
|
// Refer to the license.txt file included.
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <string>
|
2018-12-29 22:06:03 +00:00
|
|
|
|
2019-03-27 00:31:03 +00:00
|
|
|
#include "InputCommon/ControllerEmu/Setting/NumericSetting.h"
|
2018-12-29 22:06:03 +00:00
|
|
|
#include "InputCommon/ControllerEmu/StickGate.h"
|
2017-04-04 19:37:31 +00:00
|
|
|
#include "InputCommon/ControllerInterface/Device.h"
|
2017-02-09 03:15:43 +00:00
|
|
|
|
|
|
|
namespace ControllerEmu
|
|
|
|
{
|
2018-12-29 22:06:03 +00:00
|
|
|
class Tilt : public ReshapableInput
|
2017-02-09 03:15:43 +00:00
|
|
|
{
|
|
|
|
public:
|
2018-12-30 16:52:45 +00:00
|
|
|
using StateData = ReshapeData;
|
2018-07-13 15:04:40 +00:00
|
|
|
|
2017-02-09 03:15:43 +00:00
|
|
|
explicit Tilt(const std::string& name);
|
|
|
|
|
2018-12-30 16:52:45 +00:00
|
|
|
ReshapeData GetReshapableState(bool adjusted) final override;
|
2019-02-05 00:50:07 +00:00
|
|
|
ControlState GetGateRadiusAtAngle(double angle) const final override;
|
|
|
|
|
|
|
|
// Tilt is using the gate radius to adjust the tilt angle so we must provide an unadjusted value
|
|
|
|
// for the default input radius.
|
|
|
|
ControlState GetDefaultInputRadiusAtAngle(double angle) const final override;
|
2017-02-09 03:15:43 +00:00
|
|
|
|
2018-12-30 15:10:32 +00:00
|
|
|
StateData GetState();
|
|
|
|
|
2019-10-06 14:44:46 +00:00
|
|
|
// Return peak rotational velocity (for a complete turn) in radians/sec
|
|
|
|
ControlState GetMaxRotationalVelocity() const;
|
|
|
|
|
2017-02-09 03:15:43 +00:00
|
|
|
private:
|
2019-03-27 00:31:03 +00:00
|
|
|
SettingValue<double> m_max_angle_setting;
|
2019-10-06 14:44:46 +00:00
|
|
|
SettingValue<double> m_max_rotational_velocity;
|
2017-02-09 03:15:43 +00:00
|
|
|
};
|
|
|
|
} // namespace ControllerEmu
|