You've already forked OpenRCT2-Unity
mirror of
https://github.com/izzy2lost/OpenRCT2-Unity.git
synced 2026-03-10 12:38:22 -07:00
24 lines
304 B
C++
24 lines
304 B
C++
#pragma once
|
|
|
|
/**
|
|
* Common mathematical functions.
|
|
*/
|
|
namespace Math {
|
|
|
|
template<typename T>
|
|
T Min(T a, T b) {
|
|
return a < b ? a : b;
|
|
}
|
|
|
|
template<typename T>
|
|
T Max(T a, T b) {
|
|
return a > b ? a : b;
|
|
}
|
|
|
|
template<typename T>
|
|
T Clamp(T low, T x, T high) {
|
|
return Min(Max(low, x), high);
|
|
}
|
|
|
|
}
|