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:
vladislavbelov
2021-11-16 16:58:32 +00:00
parent 0c4f59d0a7
commit 9b3dcd2610
11 changed files with 69 additions and 27 deletions
+9 -2
View File
@@ -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)