|
libultraship
Reimplementations of libultra (N64 SDK) functions for modern hardware
|
Maps a physical input to a virtual analog stick direction. More...
#include <ControllerAxisDirectionMapping.h>
Public Member Functions | |
| ControllerAxisDirectionMapping (PhysicalDeviceType physicalDeviceType, uint8_t portIndex, StickIndex stickIndex, Direction direction, std::shared_ptr< ControlDeck > controlDeck=nullptr) | |
| Constructs a ControllerAxisDirectionMapping. | |
| virtual | ~ControllerAxisDirectionMapping () |
| virtual float | GetNormalizedAxisDirectionValue ()=0 |
| Returns the current axis value normalised to [0, MAX_AXIS_RANGE]. | |
| virtual int8_t | GetMappingType () |
| Returns the mapping type identifier (e.g. gamepad, keyboard). | |
| virtual std::string | GetAxisDirectionMappingId ()=0 |
| Returns a unique string identifier for this axis direction mapping. | |
| virtual void | SaveToConfig ()=0 |
| Persists this mapping to the application configuration. | |
| virtual void | EraseFromConfig ()=0 |
| Removes this mapping from the application configuration. | |
| Direction | GetDirection () |
| Returns the direction this mapping represents. | |
| void | SetPortIndex (uint8_t portIndex) |
| Sets the controller port index for this mapping. | |
| std::shared_ptr< ControlDeck > | GetControlDeck () const |
Public Member Functions inherited from Ship::ControllerInputMapping | |
| ControllerInputMapping (PhysicalDeviceType physicalDeviceType) | |
| Constructs a ControllerInputMapping for the given physical device type. | |
| ~ControllerInputMapping () | |
| virtual std::string | GetPhysicalInputName () |
| Returns a human-readable name for the physical input this mapping represents. | |
Public Member Functions inherited from Ship::ControllerMapping | |
| ControllerMapping (PhysicalDeviceType physicalDeviceType) | |
| Constructs a ControllerMapping for the given physical device type. | |
| ~ControllerMapping () | |
| virtual std::string | GetPhysicalDeviceName () |
| Returns a human-readable name for the physical device associated with this mapping. | |
| PhysicalDeviceType | GetPhysicalDeviceType () |
| Returns the physical device type for this mapping. | |
Protected Attributes | |
| uint8_t | mPortIndex |
| StickIndex | mStickIndex |
| Direction | mDirection |
| std::shared_ptr< ControlDeck > | mControlDeck |
Protected Attributes inherited from Ship::ControllerMapping | |
| PhysicalDeviceType | mPhysicalDeviceType |
Maps a physical input to a virtual analog stick direction.
Subclasses implement the details for specific device types (keyboard keys, SDL gamepad axes/buttons, etc.) and convert raw input into a normalised axis value in the range [0, MAX_AXIS_RANGE].
| Ship::ControllerAxisDirectionMapping::ControllerAxisDirectionMapping | ( | PhysicalDeviceType | physicalDeviceType, |
| uint8_t | portIndex, | ||
| StickIndex | stickIndex, | ||
| Direction | direction, | ||
| std::shared_ptr< ControlDeck > | controlDeck = nullptr |
||
| ) |
Constructs a ControllerAxisDirectionMapping.
| physicalDeviceType | The type of physical device this mapping targets. |
| portIndex | The controller port index this mapping is assigned to. |
| stickIndex | Which analog stick this mapping affects. |
| direction | The direction on the stick this mapping represents. |
|
virtual |
|
pure virtual |
Removes this mapping from the application configuration.
Implemented in Ship::KeyboardKeyToAxisDirectionMapping, Ship::MouseButtonToAxisDirectionMapping, Ship::MouseWheelToAxisDirectionMapping, Ship::SDLAxisDirectionToAxisDirectionMapping, and Ship::SDLButtonToAxisDirectionMapping.
|
pure virtual |
Returns a unique string identifier for this axis direction mapping.
Implemented in Ship::KeyboardKeyToAxisDirectionMapping, Ship::MouseButtonToAxisDirectionMapping, Ship::MouseWheelToAxisDirectionMapping, Ship::SDLAxisDirectionToAxisDirectionMapping, and Ship::SDLButtonToAxisDirectionMapping.
| std::shared_ptr< ControlDeck > Ship::ControllerAxisDirectionMapping::GetControlDeck | ( | ) | const |
| Direction Ship::ControllerAxisDirectionMapping::GetDirection | ( | ) |
Returns the direction this mapping represents.
|
virtual |
Returns the mapping type identifier (e.g. gamepad, keyboard).
Reimplemented in Ship::KeyboardKeyToAxisDirectionMapping, Ship::MouseButtonToAxisDirectionMapping, Ship::MouseWheelToAxisDirectionMapping, Ship::SDLAxisDirectionToAxisDirectionMapping, and Ship::SDLButtonToAxisDirectionMapping.
|
pure virtual |
Returns the current axis value normalised to [0, MAX_AXIS_RANGE].
Implemented in Ship::KeyboardKeyToAxisDirectionMapping, Ship::MouseButtonToAxisDirectionMapping, Ship::MouseWheelToAxisDirectionMapping, Ship::SDLAxisDirectionToAxisDirectionMapping, and Ship::SDLButtonToAxisDirectionMapping.
|
pure virtual |
Persists this mapping to the application configuration.
Implemented in Ship::KeyboardKeyToAxisDirectionMapping, Ship::MouseButtonToAxisDirectionMapping, Ship::MouseWheelToAxisDirectionMapping, Ship::SDLAxisDirectionToAxisDirectionMapping, and Ship::SDLButtonToAxisDirectionMapping.
| void Ship::ControllerAxisDirectionMapping::SetPortIndex | ( | uint8_t | portIndex | ) |
Sets the controller port index for this mapping.
| portIndex | The new port index. |
|
protected |
|
protected |
|
protected |
|
protected |