2017-02-09 03:15:43 +00:00
|
|
|
// Copyright 2017 Dolphin Emulator Project
|
2021-07-05 01:22:19 +00:00
|
|
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
2017-02-09 03:15:43 +00:00
|
|
|
|
|
|
|
#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"
|
2020-09-15 11:34:41 +00:00
|
|
|
#include "InputCommon/ControllerInterface/CoreDevice.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);
|
|
|
|
|
2021-05-04 20:47:55 +00:00
|
|
|
ReshapeData GetReshapableState(bool adjusted) const 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
|
|
|
|
2021-05-04 20:47:55 +00:00
|
|
|
StateData GetState() const;
|
2018-12-30 15:10:32 +00:00
|
|
|
|
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:
|
2022-01-04 20:09:50 +00:00
|
|
|
Control* GetModifierInput() const override;
|
|
|
|
|
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
|