documented new node classes
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user