Aggregates rumble output mappings and drives force-feedback hardware.
More...
#include <ControllerRumble.h>
Aggregates rumble output mappings and drives force-feedback hardware.
ControllerRumble holds a collection of ControllerRumbleMapping instances (one per physical device output) and fans out StartRumble() / StopRumble() calls to all of them. Multiple mappings allow the same logical rumble request to activate haptics on several devices simultaneously.
Mappings are persisted in Config and applied via the standard load/save helpers.
◆ ControllerRumble()
| Ship::ControllerRumble::ControllerRumble |
( |
uint8_t |
portIndex, |
|
|
std::shared_ptr< ConsoleVariable > |
consoleVariable = nullptr, |
|
|
std::shared_ptr< ControlDeck > |
controlDeck = nullptr |
|
) |
| |
Constructs a ControllerRumble for the given port.
- Parameters
-
| portIndex | Zero-based port index. |
◆ ~ControllerRumble()
| Ship::ControllerRumble::~ControllerRumble |
( |
| ) |
|
◆ AddDefaultMappings()
Applies the default rumble mappings for the given device type.
- Parameters
-
| physicalDeviceType | Device type to apply defaults for. |
◆ AddRumbleMapping()
Adds a rumble mapping to the collection.
- Parameters
-
| mapping | Mapping to add. Its ID must be unique. |
◆ AddRumbleMappingFromRawPress()
| bool Ship::ControllerRumble::AddRumbleMappingFromRawPress |
( |
| ) |
|
Listens for the next raw physical input and creates a rumble mapping from it.
- Returns
- true if a mapping was successfully created.
◆ ClearAllMappings()
| void Ship::ControllerRumble::ClearAllMappings |
( |
| ) |
|
Removes all in-memory rumble mappings.
◆ ClearAllMappingsForDeviceType()
| void Ship::ControllerRumble::ClearAllMappingsForDeviceType |
( |
PhysicalDeviceType |
physicalDeviceType | ) |
|
Removes all mappings that target the given device type.
- Parameters
-
| physicalDeviceType | Device type whose mappings should be cleared. |
◆ ClearRumbleMapping()
| void Ship::ControllerRumble::ClearRumbleMapping |
( |
std::string |
id | ) |
|
Removes the mapping with id from both in-memory and Config.
- Parameters
-
◆ ClearRumbleMappingId()
| void Ship::ControllerRumble::ClearRumbleMappingId |
( |
std::string |
id | ) |
|
Removes the mapping ID from Config without destroying the in-memory object.
- Parameters
-
◆ GetAllRumbleMappings()
| std::unordered_map< std::string, std::shared_ptr< ControllerRumbleMapping > > Ship::ControllerRumble::GetAllRumbleMappings |
( |
| ) |
|
Returns a copy of the full id → mapping map.
◆ HasMappingsForPhysicalDeviceType()
| bool Ship::ControllerRumble::HasMappingsForPhysicalDeviceType |
( |
PhysicalDeviceType |
physicalDeviceType | ) |
|
Returns true if any mapping targets the given device type.
- Parameters
-
| physicalDeviceType | Device type to query. |
◆ LoadRumbleMappingFromConfig()
| void Ship::ControllerRumble::LoadRumbleMappingFromConfig |
( |
std::string |
id | ) |
|
Loads the mapping with id from Config and adds it to the collection.
- Parameters
-
| id | Mapping UUID stored in Config. |
◆ ReloadAllMappingsFromConfig()
| void Ship::ControllerRumble::ReloadAllMappingsFromConfig |
( |
| ) |
|
Clears all in-memory mappings and reloads them from Config.
◆ SaveRumbleMappingIdsToConfig()
| void Ship::ControllerRumble::SaveRumbleMappingIdsToConfig |
( |
| ) |
|
Writes the current set of mapping IDs to Config.
◆ SetControlDeck()
| void Ship::ControllerRumble::SetControlDeck |
( |
std::shared_ptr< ControlDeck > |
controlDeck | ) |
|
|
inline |
◆ StartRumble()
| void Ship::ControllerRumble::StartRumble |
( |
| ) |
|
Activates rumble on all mapped physical devices.
◆ StopRumble()
| void Ship::ControllerRumble::StopRumble |
( |
| ) |
|
Stops rumble on all mapped physical devices.
The documentation for this class was generated from the following file: