summaryrefslogtreecommitdiffhomepage
path: root/dev/Modules/GfxMgr/MathMgr.h
diff options
context:
space:
mode:
authorAmlal El Mahrouss <amlal.elmahrouss@icloud.com>2024-12-25 14:04:14 +0100
committerAmlal El Mahrouss <amlal.elmahrouss@icloud.com>2024-12-25 14:04:14 +0100
commit4ed658c633ce5d7c5bde4acdbe322e5f51592369 (patch)
tree2eaf1d46946bf86123f1561338c81aaff8956662 /dev/Modules/GfxMgr/MathMgr.h
parent02fd0b59edbcb2b5c08ab1f36bbffc12ba08a5d3 (diff)
IMPL: Important refactors and improvements of ZkaOS.
Signed-off-by: Amlal El Mahrouss <amlal.elmahrouss@icloud.com>
Diffstat (limited to 'dev/Modules/GfxMgr/MathMgr.h')
-rw-r--r--dev/Modules/GfxMgr/MathMgr.h29
1 files changed, 29 insertions, 0 deletions
diff --git a/dev/Modules/GfxMgr/MathMgr.h b/dev/Modules/GfxMgr/MathMgr.h
new file mode 100644
index 00000000..13e653a5
--- /dev/null
+++ b/dev/Modules/GfxMgr/MathMgr.h
@@ -0,0 +1,29 @@
+/* -------------------------------------------
+
+ Copyright Theater Quality Inc.
+
+------------------------------------------- */
+
+#pragma once
+
+/// @file MathMgr.h
+/// @brief Linear interpolation implementation.
+
+namespace UI
+{
+#ifdef ZKA_FB_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