libultraship
Reimplementations of libultra (N64 SDK) functions for modern hardware
Loading...
Searching...
No Matches
Ship::GyroMappingFactory Class Reference

Factory for creating ControllerGyroMapping instances. More...

#include <GyroMappingFactory.h>

Static Public Member Functions

static std::shared_ptr< ControllerGyroMappingCreateGyroMappingFromConfig (uint8_t portIndex, std::string id, std::shared_ptr< ConsoleVariable > consoleVariable, std::shared_ptr< ControlDeck > controlDeck)
 Deserializes a gyro mapping from the configuration string.
 
static std::shared_ptr< ControllerGyroMappingCreateGyroMappingFromSDLInput (uint8_t portIndex, std::shared_ptr< ConsoleVariable > consoleVariable, std::shared_ptr< ControlDeck > controlDeck)
 Creates a gyro mapping from live SDL input for interactive binding.
 

Detailed Description

Factory for creating ControllerGyroMapping instances.

GyroMappingFactory provides static helpers to create ControllerGyroMapping instances that map gyroscope (motion control) input from SDL controllers to game controller gyro output. It supports deserializing gyro mappings from persisted configuration and creating mappings from live SDL input events during interactive binding.

Gyro mappings enable motion-based aim control and other game features that rely on accelerometer/gyroscope input from compatible physical devices.

All factory methods require a ConsoleVariable and ControlDeck to track state and configuration.

Typical usage (within ControlDeck or ConfigUI):

portIndex, mappingId, consoleVariable, controlDeck);
static std::shared_ptr< ControllerGyroMapping > CreateGyroMappingFromConfig(uint8_t portIndex, std::string id, std::shared_ptr< ConsoleVariable > consoleVariable, std::shared_ptr< ControlDeck > controlDeck)
Deserializes a gyro mapping from the configuration string.

Member Function Documentation

◆ CreateGyroMappingFromConfig()

static std::shared_ptr< ControllerGyroMapping > Ship::GyroMappingFactory::CreateGyroMappingFromConfig ( uint8_t  portIndex,
std::string  id,
std::shared_ptr< ConsoleVariable consoleVariable,
std::shared_ptr< ControlDeck controlDeck 
)
static

Deserializes a gyro mapping from the configuration string.

Parameters
portIndexThe controller port index (0-based).
idConfiguration string encoding the gyro input source.
consoleVariableConsoleVariable for persisting the mapping.
controlDeckControlDeck for physical device access.
Returns
The deserialized mapping, or nullptr if the configuration string is invalid.

◆ CreateGyroMappingFromSDLInput()

static std::shared_ptr< ControllerGyroMapping > Ship::GyroMappingFactory::CreateGyroMappingFromSDLInput ( uint8_t  portIndex,
std::shared_ptr< ConsoleVariable consoleVariable,
std::shared_ptr< ControlDeck controlDeck 
)
static

Creates a gyro mapping from live SDL input for interactive binding.

Parameters
portIndexThe controller port index (0-based).
consoleVariableConsoleVariable for persisting the mapping.
controlDeckControlDeck for physical device access.
Returns
The newly created mapping, or nullptr if no gyro device is detected.

The documentation for this class was generated from the following file: