From dc2d81f3c7628433bd3c51f1624200b3913ac746 Mon Sep 17 00:00:00 2001 From: Amlal Date: Sat, 7 Dec 2024 11:43:21 +0100 Subject: IMPL: Recover Kernel Window framework from previous commits. IMPL: Compiler fixes and improvements on the source code. Signed-off-by: Amlal --- dev/Modules/FB/Math.h | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 dev/Modules/FB/Math.h (limited to 'dev/Modules/FB/Math.h') diff --git a/dev/Modules/FB/Math.h b/dev/Modules/FB/Math.h new file mode 100644 index 00000000..3ccbaf5d --- /dev/null +++ b/dev/Modules/FB/Math.h @@ -0,0 +1,22 @@ +/* ------------------------------------------- + + Copyright ZKA Technologies. + +------------------------------------------- */ + +#pragma once + +/// @file Math.h +/// @brief Linear interpolation implementation. + +typedef float CGReal; + +/// @brief Linear interpolation equation solver. +/// @param from where? +/// @param to to? +/// @param at which state we're at **to**. +inline CGReal CGLerp(CGReal to, CGReal from, CGReal stat) +{ + CGReal difference = to - from; + return from + (difference * stat); +} -- cgit v1.2.3