|
libultraship
Reimplementations of libultra (N64 SDK) functions for modern hardware
|
Maps a physical gyroscope to virtual gyro input values. More...
#include <ControllerGyroMapping.h>
Public Member Functions | |
| ControllerGyroMapping (PhysicalDeviceType physicalDeviceType, uint8_t portIndex, float sensitivity) | |
| Constructs a ControllerGyroMapping. | |
| virtual | ~ControllerGyroMapping () |
| virtual void | UpdatePad (float &x, float &y)=0 |
| Reads the physical gyroscope and updates the X and Y gyro values. | |
| virtual void | SaveToConfig ()=0 |
| Persists this mapping to the application configuration. | |
| virtual void | EraseFromConfig ()=0 |
| Removes this mapping from the application configuration. | |
| virtual void | Recalibrate ()=0 |
| Recalibrates the gyroscope to establish a new neutral baseline. | |
| virtual std::string | GetGyroMappingId ()=0 |
| Returns a unique string identifier for this gyro mapping. | |
| float | GetSensitivity () |
| Returns the current sensitivity multiplier. | |
| uint8_t | GetSensitivityPercent () |
| Returns the current sensitivity as a percentage of the default. | |
| void | SetSensitivity (uint8_t sensitivityPercent) |
| Sets the gyro sensitivity from a percentage value. | |
| void | ResetSensitivityToDefault () |
| Resets the sensitivity to GYRO_SENSITIVITY_DEFAULT. | |
| bool | SensitivityIsDefault () |
| Checks whether the current sensitivity matches the default value. | |
| void | SetPortIndex (uint8_t portIndex) |
| Sets the controller port index for this mapping. | |
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 |
| uint8_t | mSensitivityPercent |
| float | mSensitivity |
Protected Attributes inherited from Ship::ControllerMapping | |
| PhysicalDeviceType | mPhysicalDeviceType |
Maps a physical gyroscope to virtual gyro input values.
Subclasses implement device-specific gyroscope reading and convert raw angular velocity data into X/Y values used by the game. Sensitivity can be adjusted as a percentage of the default value.
| Ship::ControllerGyroMapping::ControllerGyroMapping | ( | PhysicalDeviceType | physicalDeviceType, |
| uint8_t | portIndex, | ||
| float | sensitivity | ||
| ) |
Constructs a ControllerGyroMapping.
| physicalDeviceType | The type of physical device this mapping targets. |
| portIndex | The controller port index this mapping is assigned to. |
| sensitivity | The gyro sensitivity multiplier. |
|
virtual |
|
pure virtual |
Removes this mapping from the application configuration.
Implemented in Ship::SDLGyroMapping.
|
pure virtual |
Returns a unique string identifier for this gyro mapping.
Implemented in Ship::SDLGyroMapping.
| float Ship::ControllerGyroMapping::GetSensitivity | ( | ) |
Returns the current sensitivity multiplier.
| uint8_t Ship::ControllerGyroMapping::GetSensitivityPercent | ( | ) |
Returns the current sensitivity as a percentage of the default.
|
pure virtual |
Recalibrates the gyroscope to establish a new neutral baseline.
Implemented in Ship::SDLGyroMapping.
| void Ship::ControllerGyroMapping::ResetSensitivityToDefault | ( | ) |
Resets the sensitivity to GYRO_SENSITIVITY_DEFAULT.
|
pure virtual |
Persists this mapping to the application configuration.
Implemented in Ship::SDLGyroMapping.
| bool Ship::ControllerGyroMapping::SensitivityIsDefault | ( | ) |
Checks whether the current sensitivity matches the default value.
| void Ship::ControllerGyroMapping::SetPortIndex | ( | uint8_t | portIndex | ) |
Sets the controller port index for this mapping.
| portIndex | The new port index. |
| void Ship::ControllerGyroMapping::SetSensitivity | ( | uint8_t | sensitivityPercent | ) |
Sets the gyro sensitivity from a percentage value.
| sensitivityPercent | The new sensitivity percentage. |
|
pure virtual |
Reads the physical gyroscope and updates the X and Y gyro values.
| x | Reference to the X gyro axis value to update. |
| y | Reference to the Y gyro axis value to update. |
Implemented in Ship::SDLGyroMapping.
|
protected |
|
protected |
|
protected |