documented new node classes

This commit is contained in:
itsmattkc
2019-07-17 03:05:25 -04:00
parent 39256fd6f9
commit 9f6d0f9dc7
20 changed files with 435 additions and 7 deletions
+10
View File
@@ -2,6 +2,16 @@
#define CLAMP_H
template<typename T>
/**
* @brief Clamp a value between a minimum and a maximum value
*
* Similar to using min() and max() functions, but performs both at once. If value is less than minimum, this returns
* minimum. If it is more than maximum, this returns maximum. Otherwise it returns value as-is.
*
* @return
*
* Will always return a value between minimum and maximum (inclusive).
*/
T clamp(T value, T minimum, T maximum) {
if (value < minimum) {
return minimum;
+3
View File
@@ -2,6 +2,9 @@
#define LERP_H
template<typename T>
/**
* @brief Linearly interpolate a value between a and b using t
*/
T lerp(T a, T b, double t) {
return (a * (1.0 - t)) + (b * t);
}