diff options
| author | Amlal El Mahrouss <amlal.elmahrouss@icloud.com> | 2024-12-26 21:19:14 +0100 |
|---|---|---|
| committer | Amlal El Mahrouss <amlal.elmahrouss@icloud.com> | 2024-12-26 21:19:14 +0100 |
| commit | 486425ed00acec134f8799bdde64bfd093c5fb55 (patch) | |
| tree | 5104af49b56f39d0b14941d76f9d6d746cd1677b /dev/Mod/GfxMgr/MathMgr.h | |
| parent | c0f7f3f300d603d355fc7ec5be317afe1f0ee1b6 (diff) | |
IMPL: A lot of new changes, see details.
Signed-off-by: Amlal El Mahrouss <amlal.elmahrouss@icloud.com>
Diffstat (limited to 'dev/Mod/GfxMgr/MathMgr.h')
| -rw-r--r-- | dev/Mod/GfxMgr/MathMgr.h | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/dev/Mod/GfxMgr/MathMgr.h b/dev/Mod/GfxMgr/MathMgr.h new file mode 100644 index 00000000..bb078b42 --- /dev/null +++ b/dev/Mod/GfxMgr/MathMgr.h @@ -0,0 +1,29 @@ +/* ------------------------------------------- + + Copyright Theater Quality Inc. + +------------------------------------------- */ + +#pragma once + +/// @file MathMgr.h +/// @brief Linear interpolation implementation. + +namespace UI +{ +#ifdef ZKA_GFX_MGR_USE_DOUBLE + typedef double fb_real_t; +#else + typedef float fb_real_t; +#endif + + /// @brief Linear interpolation equation solver. + /// @param from where? + /// @param to to? + /// @param at which state we're at **to**. + inline fb_real_t fb_math_lerp(fb_real_t to, fb_real_t from, fb_real_t stat) + { + fb_real_t difference = to - from; + return from + (difference * stat); + } +} // namespace UI
\ No newline at end of file |
