mirror of
https://gitea.wildfiregames.com/0ad/0ad.git
synced 2026-06-21 01:04:06 +00:00
Slightly improves minimap flares, makes animation more smooth via alpha fade in/out.
Tested By: Langbart Differential Revision: https://code.wildfiregames.com/D4351 This was SVN commit r26001.
This commit is contained in:
@@ -22,13 +22,13 @@
|
||||
#define RADTODEG(a) ((a) * (180.0f/(float)M_PI))
|
||||
#define SQR(x) ((x) * (x))
|
||||
|
||||
template <typename T>
|
||||
template<typename T>
|
||||
inline T Interpolate(const T& a, const T& b, float t)
|
||||
{
|
||||
return a + (b - a) * t;
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
template<typename T>
|
||||
inline T Clamp(T value, T min, T max)
|
||||
{
|
||||
if (value <= min)
|
||||
@@ -38,6 +38,13 @@ inline T Clamp(T value, T min, T max)
|
||||
return value;
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
inline T SmoothStep(T edge0, T edge1, T value)
|
||||
{
|
||||
value = Clamp<T>((value - edge0) / (edge1 - edge0), 0, 1);
|
||||
return value * value * (3 - 2 * value);
|
||||
}
|
||||
|
||||
inline float sgn(float a)
|
||||
{
|
||||
if (a > 0.0f)
|
||||
|
||||
Reference in New Issue
Block a user