diff options
| author | Amlal El Mahrouss <amlal.elmahrouss@icloud.com> | 2024-08-24 14:49:23 +0200 |
|---|---|---|
| committer | Amlal El Mahrouss <amlal.elmahrouss@icloud.com> | 2024-08-24 14:49:23 +0200 |
| commit | 7b653878ee84add4172c20f13a436582c744a603 (patch) | |
| tree | 2f01ed70d6a8b0762403eb7b8cac4df511271d9e /dev/ZKA/Modules/CoreCG/Math.hxx | |
| parent | ae87ff9f949a71a398b4355fe9074c0531de34ba (diff) | |
[API] Refactors and improvements.
Signed-off-by: Amlal El Mahrouss <amlal.elmahrouss@icloud.com>
Diffstat (limited to 'dev/ZKA/Modules/CoreCG/Math.hxx')
| -rw-r--r-- | dev/ZKA/Modules/CoreCG/Math.hxx | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/dev/ZKA/Modules/CoreCG/Math.hxx b/dev/ZKA/Modules/CoreCG/Math.hxx new file mode 100644 index 00000000..bfa28a3d --- /dev/null +++ b/dev/ZKA/Modules/CoreCG/Math.hxx @@ -0,0 +1,22 @@ +/* ------------------------------------------- + + Copyright ZKA Technologies. + +------------------------------------------- */ + +#pragma once + +/// @file Math.hxx +/// @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); +} |
