libultraship
Reimplementations of libultra (N64 SDK) functions for modern hardware
Loading...
Searching...
No Matches
SDLGyroMapping.h
Go to the documentation of this file.
2#include "SDLMapping.h"
3#include <memory>
4
5namespace Ship {
6class ConsoleVariable;
7class ControlDeck;
8
16 public:
25 SDLGyroMapping(uint8_t portIndex, float sensitivity, float neutralPitch, float neutralYaw, float neutralRoll,
26 std::shared_ptr<ControlDeck> controlDeck = nullptr,
27 std::shared_ptr<ConsoleVariable> consoleVariable = nullptr);
28
34 void UpdatePad(float& x, float& y) override;
35
37 void SaveToConfig() override;
38
40 void EraseFromConfig() override;
41
43 void Recalibrate() override;
44
46 std::string GetGyroMappingId() override;
47
49 std::string GetPhysicalDeviceName() override;
50
51 protected:
52 std::shared_ptr<ConsoleVariable> mConsoleVariable;
53 std::shared_ptr<ControlDeck> mControlDeck;
54
55 private:
56 float mNeutralPitch;
57 float mNeutralYaw;
58 float mNeutralRoll;
59};
60} // namespace Ship
Maps a physical gyroscope to virtual gyro input values.
Definition ControllerGyroMapping.h:18
Maps an SDL gamepad's gyroscope sensor to a virtual gyro input.
Definition SDLGyroMapping.h:15
std::string GetGyroMappingId() override
Returns the unique string identifier for this mapping.
void SaveToConfig() override
Persists this mapping to the application configuration.
void Recalibrate() override
Samples the current sensor output and recalculates neutral offsets.
SDLGyroMapping(uint8_t portIndex, float sensitivity, float neutralPitch, float neutralYaw, float neutralRoll, std::shared_ptr< ControlDeck > controlDeck=nullptr, std::shared_ptr< ConsoleVariable > consoleVariable=nullptr)
Constructs an SDL gyro mapping with calibration offsets.
std::shared_ptr< ControlDeck > mControlDeck
Definition SDLGyroMapping.h:53
void UpdatePad(float &x, float &y) override
Reads the gyro sensor and writes the resulting X/Y values.
std::string GetPhysicalDeviceName() override
Returns the human-readable name of the SDL gamepad device.
void EraseFromConfig() override
Removes this mapping from the application configuration.
std::shared_ptr< ConsoleVariable > mConsoleVariable
Definition SDLGyroMapping.h:52
Core namespace for the libultraship engine framework.
Definition gfx_direct3d_common.h:14