|
libultraship
Reimplementations of libultra (N64 SDK) functions for modern hardware
|
Factory for creating ControllerRumbleMapping instances. More...
#include <RumbleMappingFactory.h>
Static Public Member Functions | |
| static std::shared_ptr< ControllerRumbleMapping > | CreateRumbleMappingFromConfig (uint8_t portIndex, std::string id, std::shared_ptr< ConsoleVariable > consoleVariable, std::shared_ptr< ControlDeck > controlDeck) |
| Deserializes a rumble mapping from the configuration string. | |
| static std::vector< std::shared_ptr< ControllerRumbleMapping > > | CreateDefaultSDLRumbleMappings (PhysicalDeviceType physicalDeviceType, uint8_t portIndex, std::shared_ptr< ConsoleVariable > consoleVariable, std::shared_ptr< ControlDeck > controlDeck) |
| Creates default SDL rumble mappings for a specific physical device type. | |
| static std::shared_ptr< ControllerRumbleMapping > | CreateRumbleMappingFromSDLInput (uint8_t portIndex, std::shared_ptr< ConsoleVariable > consoleVariable, std::shared_ptr< ControlDeck > controlDeck) |
| Creates a rumble mapping from live SDL input for interactive binding. | |
Factory for creating ControllerRumbleMapping instances.
RumbleMappingFactory provides static helpers to create ControllerRumbleMapping instances that map game controller rumble/haptic output to physical device rumble motors. It supports deserializing rumble mappings from persisted configuration, generating default SDL rumble mappings for known device types, and creating mappings from live SDL input events during interactive binding.
Rumble mappings enable force feedback (vibration) on physical controllers in response to in-game events, enhancing immersion and providing tactile feedback.
All factory methods require a ConsoleVariable and ControlDeck to track state and configuration.
Typical usage (within ControlDeck or ConfigUI):
|
static |
Creates default SDL rumble mappings for a specific physical device type.
| physicalDeviceType | The type of physical device (e.g., SDL2 gamepad, Nintendo controller). |
| portIndex | The controller port index (0-based). |
| consoleVariable | ConsoleVariable for persisting mappings. |
| controlDeck | ControlDeck for physical device access. |
|
static |
Deserializes a rumble mapping from the configuration string.
| portIndex | The controller port index (0-based). |
| id | Configuration string encoding the rumble output target. |
| consoleVariable | ConsoleVariable for persisting the mapping. |
| controlDeck | ControlDeck for physical device access. |
|
static |
Creates a rumble mapping from live SDL input for interactive binding.
| portIndex | The controller port index (0-based). |
| consoleVariable | ConsoleVariable for persisting the mapping. |
| controlDeck | ControlDeck for physical device access. |