summaryrefslogtreecommitdiffhomepage
path: root/dev/ZKA/Modules/CoreCG/Math.hxx
blob: bfa28a3d76cad0ce908382628e97ccbe004aeba0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
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);
}