|
stmm-games-doc
0.32.0
|
Elapsed mapper. More...
Public Types | |
| enum | MAPPING_TYPE { MAPPING_TYPE_IDENTITY = 0, MAPPING_TYPE_OOR_UNDEFINED = 1, MAPPING_TYPE_OOR_CLAMP = 2, MAPPING_TYPE_OOR_MODULO = 3, MAPPING_TYPE_OOR_ALT_MODULO = 4 } |
Public Member Functions | |
| double | map (double fElapsed01) const noexcept |
| The mapping. More... | |
Public Attributes | |
| MAPPING_TYPE | m_eMappingType = MAPPING_TYPE_IDENTITY |
| Default is MAPPING_TYPE_IDENTITY. More... | |
| double | m_fA = 1.0 |
| The 'a' in the mapping function 'y = a * x + b'. More... | |
| double | m_fB = 0.0 |
| The 'b' in the mapping function 'y = a * x + b'. More... | |
| double | m_fMin = 0.0 |
| The min value. More... | |
| double | m_fMax = 1.0 |
| The max value. More... | |
| bool | m_bShrink = false |
| Apply shrinking to (m_fMin, m_fMax) rather than clamping. More... | |
Elapsed mapper.
A linear function a * elapsed + b is applied according to MAPPING_TYPE. If elapsed is -1.0 the same value is returned, with no further processing. Otherwise an additional optional clamping or shrinking to a min and max value is applied.
|
noexcept |
The mapping.
| fElapsed01 | The input. Must be a non negative number not bigger than 1.0. |
-1 or a non negative number not bigger than 1.0. | bool stmg::ElapsedMapper::m_bShrink = false |
Apply shrinking to (m_fMin, m_fMax) rather than clamping.
Default is false.
| MAPPING_TYPE stmg::ElapsedMapper::m_eMappingType = MAPPING_TYPE_IDENTITY |
Default is MAPPING_TYPE_IDENTITY.
| double stmg::ElapsedMapper::m_fA = 1.0 |
The 'a' in the mapping function 'y = a * x + b'.
Default is 1.
| double stmg::ElapsedMapper::m_fB = 0.0 |
The 'b' in the mapping function 'y = a * x + b'.
Default is 0.
| double stmg::ElapsedMapper::m_fMax = 1.0 |
The max value.
Must be within interval (0.0, 1.0) and be bigger than m_fMin. Default is 1.
| double stmg::ElapsedMapper::m_fMin = 0.0 |
The min value.
Must be within interval (0.0, 1.0). Default is 0.
1.8.13